Signals: Add variable for signal context (track, tunnel, bridge, etc)

This commit is contained in:
Jonathan G Rennison
2022-06-15 19:03:13 +01:00
parent cf5eef515e
commit 41117a52d2
11 changed files with 170 additions and 33 deletions

View File

@@ -121,6 +121,33 @@
</dl>
</td>
</tr>
<tr><td>signal_context</td><td>SIGNAL_CONTEXT_XXX</td>
<td>
Information about the context of the signal being drawn:
<dl>
<dt>GUI</dt>
<dd>The signal is being drawn in the GUI (signal window)</dd>
<dt>TRACK</dt>
<dd>The signal is being drawn on ordinary rail track</dd>
<dt>TUNNEL_BRIDGE_ENTRANCE</dt>
<dd>The signal is being drawn as a tunnel/bridge entrance signal</dd>
<dt>TUNNEL_BRIDGE_EXIT</dt>
<dd>The signal is being drawn as a tunnel/bridge exit signal</dd>
<dt>BRIDGE_MIDDLE</dt>
<dd>The signal is being drawn on the middle of a bridge</dd>
</dl>
</td>
</tr>
<tr><td>signal_context_is_tunnel</td><td>0 or 1</td>
<td>
The signal is being drawn on a tunnel entrance/exit (not a bridge)
</td>
</tr>
<tr><td>signal_context_info</td><td></td>
<td>
Above signal context variables in one variable (all of the railtype_signal_context variable)
</td>
</tr>
</table>
<h3><a href="https://newgrf-specs.tt-wiki.net/wiki/NML:Roadtypes#Roadtype_properties">Roadtype properties</a></h3>
<table>
@@ -435,6 +462,33 @@ item (FEAT_GLOBALVARS) {
</dl>
</td>
</tr>
<tr><td>signal_context</td><td>SIGNAL_CONTEXT_XXX</td>
<td>
Information about the context of the signal being drawn:
<dl>
<dt>GUI</dt>
<dd>The signal is being drawn in the GUI (signal window)</dd>
<dt>TRACK</dt>
<dd>The signal is being drawn on ordinary rail track</dd>
<dt>TUNNEL_BRIDGE_ENTRANCE</dt>
<dd>The signal is being drawn as a tunnel/bridge entrance signal</dd>
<dt>TUNNEL_BRIDGE_EXIT</dt>
<dd>The signal is being drawn as a tunnel/bridge exit signal</dd>
<dt>BRIDGE_MIDDLE</dt>
<dd>The signal is being drawn on the middle of a bridge</dd>
</dl>
</td>
</tr>
<tr><td>signal_context_is_tunnel</td><td>0 or 1</td>
<td>
The signal is being drawn on a tunnel entrance/exit (not a bridge)
</td>
</tr>
<tr><td>signal_context_info</td><td></td>
<td>
Above signal context variables in one variable (all of the signals_signal_context variable)
</td>
</tr>
</table>
<p>
Custom signal sprites example:

View File

@@ -588,6 +588,25 @@
</p>
<p>See also: <a href="#railtype_enable_restricted_signals">railtype_enable_restricted_signals property</a></p>
<p>This is indicated by the feature name: <font face="monospace">action0_railtype_restricted_signals</font>, version 2</p>
<h4 id="railtype_signal_context">Signal context (mappable variable: railtype_signal_context)</h4>
<p>This applies to <a href="https://newgrf-specs.tt-wiki.net/wiki/Action3/Railtypes#Signal_sprites_.280B.29">Action 2/3 - Railtype custom signal sprites</a>.<br />
<table>
<tr><th>Bit</th><th>Meaning</th></tr>
<tr><td>0 - 7</td><td>
Context:
<table>
<tr><th>Value</th><th>Meaning</th></tr>
<tr><td>0</td><td>GUI</td></tr>
<tr><td>1</td><td>Plain rail track</td></tr>
<tr><td>2</td><td>Tunnel/bridge entrance</td></tr>
<tr><td>3</td><td>Tunnel/bridge exit</td></tr>
<tr><td>4</td><td>Bridge middle</td></tr>
</table>
</td></tr>
<tr><td>8</td><td>Tunnel tile</td></tr>
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">varaction2_railtype_signal_context</font>, version 1</p>
<br />
<h3 id="varaction2_object"><a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects">Variational Action 2 - Objects</a></h3>
<h4 id="object_foundation_tile_slope">Tile slope after foundation applied (mappable variable: object_foundation_tile_slope)</h4>
@@ -611,6 +630,25 @@
</p>
<p>See also: <a href="#signals_enable_restricted_signals">signals_enable_restricted_signals property</a></p>
<p>This is indicated by the feature name: <font face="monospace">action0_signals_restricted_signals</font>, version 2</p>
<h4 id="signals_signal_context">Signal context (mappable variable: signals_signal_context)</h4>
<p>This applies to <a href="#a3signals_custom_signal_sprites">Action 2/3 Signals (Feature 0E) custom signal sprites</a>.<br />
<table>
<tr><th>Bit</th><th>Meaning</th></tr>
<tr><td>0 - 7</td><td>
Context:
<table>
<tr><th>Value</th><th>Meaning</th></tr>
<tr><td>0</td><td>GUI</td></tr>
<tr><td>1</td><td>Plain rail track</td></tr>
<tr><td>2</td><td>Tunnel/bridge entrance</td></tr>
<tr><td>3</td><td>Tunnel/bridge exit</td></tr>
<tr><td>4</td><td>Bridge middle</td></tr>
</table>
</td></tr>
<tr><td>8</td><td>Tunnel tile</td></tr>
</table>
</p>
<p>This is indicated by the feature name: <font face="monospace">varaction2_signals_signal_context</font>, version 1</p>
<br />
<br />
<h3 id="a3signals"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action3">Action 3 - Signals (Feature 0E)</a></h3>