Initial implementation of NewGRF custom signal styles
This commit is contained in:
@@ -508,6 +508,8 @@
|
||||
|
||||
<li>m3 bits 7..4: bit set = signal 3..0 present</li>
|
||||
<li>m4 bits 7..4: bit clear = signal 3..0 shows red</li>
|
||||
<li style="color: blue">m6 bits 7..4: signal style for signal 0 and 1</li>
|
||||
<li style="color: blue">m6 bits 3..0: signal style for signal 2 and 3</li>
|
||||
<li style="color: blue">m7 bits 5..3: signal aspect for signal 0 or 1 (only valid if signal is present and not red, and multi-aspect signalling is in effect)</li>
|
||||
<li style="color: blue">m7 bits 2..0: signal aspect for signal 2 or 3 (only valid if signal is present and not red, and multi-aspect signalling is in effect)</li>
|
||||
</ul>
|
||||
@@ -1753,6 +1755,7 @@
|
||||
<ul>
|
||||
<li>m2 bit 15: for bridge entrances only: storage for visual red/green state of signals starting from 15 is allocated outside the map array</li>
|
||||
<li>m2 bits 14..4: for bridge entrances only: for signals 0..10 on bridge, signal is visually red if corresponding bit in 4..14 is set</li>
|
||||
<li>m3 bit 7: the signal style is non-zero (style stored outside the map array)</li>
|
||||
<li>m3 bit 6: the entrance and/or exit signals on this tile are restricted (tracerestrict patch)</li>
|
||||
<li>m3 bits 5..3: entrance signal aspect (only valid if signal is present and not red, and multi-aspect signalling is in effect)</li>
|
||||
<li>m3 bits 2..0: exit signal aspect (only valid if signal is present and not red, and multi-aspect signalling is in effect)</li>
|
||||
|
||||
@@ -103,7 +103,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits"><span class="free">OOOO OOOO</span> </td>
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Ground type: fences, snow, desert">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">OO</span> <span class="used" title="Track pieces">XXXXXX</span></td>
|
||||
<td class="bits" rowspan=3><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits" rowspan=2><span class="free">OOOO</span> <span class="patch" title="Secondary railway type (used for lower or right track when two parallel tracks on tile)">PPPP PP</span><span class="used" title="Railway type">XX XXXX</span></td>
|
||||
</tr>
|
||||
@@ -113,6 +113,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits"><span class="used" title="Signals present">XXXX</span> <span class="free">OOOO</span></td>
|
||||
<td class="bits"><span class="used" title="Signals colors">XXXX</span> <span class="used" title="Ground type: fences, snow, desert">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">O1</span> <span class="used" title="Track pieces">XXXXXX</span></td>
|
||||
<td class="bits"><span class="patch" title="Signal styles">PPPP PPPP</span></td>
|
||||
<td class="bits"><span class="free">OO</span> <span class="patch" title="Signal aspects">PPPPPP</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -122,6 +123,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="bits"><span class="free">OOOO</span> <span class="used" title="Ground type: fences, snow, desert (fences on depot are not valid)">XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Rail tile type: rail, rail with signals, depot">11</span><span class="free">O</span><span class="used" title="PBS reservation">X</span> <span class="free">OO</span><span class="used" title="Depot exit direction">XX</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO</span></td>
|
||||
<td class="bits"><span class="free">OOOO OOOO OO</span><span class="used" title="Railway type">XX XXXX</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -292,7 +294,7 @@ the array so you can quickly see what is used and what is not.
|
||||
<td class="caption">tunnel entrance</td>
|
||||
<td class="bits" rowspan=3><span class="free">OOO</span> <span class="used" title="Owner">XXXXX</span></td>
|
||||
<td class="bits"><span class="patch-pool" title="Tunnel index on pool (or overflow sentinel)">PPPP PPPP PPPP PPPP</span></td>
|
||||
<td class="bits" rowspan=4><span class="rearrange" title="Owner of tram (road only; a rearrangement can free some of these bits)">XXXX</span> <span class="free">OOOO</span><br /><span class="free">O</span><span class="patch" title="Routing restrictions present on entrance/exit signal(s)">P</span> <span class="patch" title="Entrance/exit signal aspects (rail only)">PPPPPP</span></td>
|
||||
<td class="bits" rowspan=4><span class="rearrange" title="Owner of tram (road only; a rearrangement can free some of these bits)">XXXX</span> <span class="free">OOOO</span><br /><span class="patch" title="New signal style is non-zero (rail only)">P</span> <span class="patch" title="Routing restrictions present on entrance/exit signal(s)">P</span> <span class="patch" title="Entrance/exit signal aspects (rail only)">PPPPPP</span></td>
|
||||
<td class="bits"><span class="free">OO</span><span class="used" title="Road type">XX XXXX</span></td>
|
||||
<td class="bits"><span class="used" title="Bridge or tunnel bit">O</span><span class="patch" title="Signal simulation mode (rail only)">PP</span><span class="rearrange" title="PBS reservation (rail; a rearrangement can free some of these bits)">X</span> <span class="used" title="Transport type">XX</span> <span class="used" title="Direction of the tunnel/bridge">XX</span></td>
|
||||
<td class="bits"><span class="patch" title="PBS mode, exit signal state">PP</span><span class="free">OO OO</span><span class="patch" title="Semaphore/light mode, entrance signal state">PP</span></td>
|
||||
|
||||
@@ -445,6 +445,26 @@ item (FEAT_GLOBALVARS) {
|
||||
N.B. Realistic braking must be enabled for additional signal aspects to be used
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>define_style</td><td>1 - 255</td>
|
||||
<td>
|
||||
Define a custom signal style<br />
|
||||
Signals using this style will only use this GRF, or the default graphics if no graphics are returned.<br />
|
||||
The value supplied is returned in the signal_style variable.<br />
|
||||
This property (and related signal style properties) may be used more than once.<br />
|
||||
The total number of custom signal styles in a game is currently limited to 15.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>style_name</td><td>string</td>
|
||||
<td>
|
||||
Set the name of the most recently defined style (defined using the define_style property).<br />
|
||||
This property should be used if using the define_style property, as otherwise the style will have no name.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>no_default_style</td><td>0 or 1</td>
|
||||
<td>
|
||||
When enabled, custom signal graphics from this GRF are only used for custom signal styles, not the default style
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table>
|
||||
@@ -489,6 +509,11 @@ item (FEAT_GLOBALVARS) {
|
||||
Above signal context variables in one variable (all of the signals_signal_context variable)
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>signal_style</td><td>0 - 255</td>
|
||||
<td>
|
||||
The style ID defined using define_style for signals using a custom style, or 0 for signals using the default style
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
Custom signal sprites example:
|
||||
|
||||
@@ -416,6 +416,28 @@
|
||||
The provided value is currently clamped to be within the range 0 - 6 (inclusive).</p>
|
||||
<p>N.B. Realistic braking must be enabled for additional signal aspects to be used.</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">action0_signals_extra_aspects</font>, version 1</p>
|
||||
<h4 id="signals_define_style">Define a custom signal style (mappable property: signals_define_style)</h4>
|
||||
<p>This applies to <a href="#a3signals_custom_signal_sprites">Action 2/3 Signals (Feature 0E) custom signal sprites</a> for this GRF.<br />
|
||||
This defines a new signal style. Signals using this style will only use this GRF, or the default graphics if no graphics are returned.</p>
|
||||
<p>The total number of custom signal styles in a game is currently limited to 15.</p>
|
||||
<p>The property length is 1 byte. This is the local ID of the style which is returned in the <a href="#signals_signal_style">signals_signal_style</a> variable.<br />
|
||||
The Action 0 Id field is not used, the value is ignored.
|
||||
</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</font>, version 1</p>
|
||||
<h4 id="signals_style_name">Set custom signal style name (mappable property: signals_style_name)</h4>
|
||||
<p>This applies to the most recent custom signal style defined using the <a href="#signals_define_style">signals_define_style</a> property.<br />
|
||||
This property should be set, as otherwise the style will not have a name.</p>
|
||||
<p>The property length is 2 byte. This is a string ID.<br />
|
||||
The Action 0 Id field is not used, the value is ignored.
|
||||
</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</font>, version 1</p>
|
||||
<h4 id="signals_no_default_style">Set whether custom signal sprites should not be used for the default signal style (mappable property: signals_no_default_style)</h4>
|
||||
<p>This applies to <a href="#a3signals_custom_signal_sprites">Action 2/3 Signals (Feature 0E) custom signal sprites</a> for this GRF.<br />
|
||||
When enabled, this GRF is not used for the default signal style, it is only used for custom signal styles defined with <a href="#signals_define_style">signals_define_style</a>.</p>
|
||||
<p>The property length is 1 byte. 0 is disabled (default). 1 is enabled.<br />
|
||||
The Action 0 Id field is not used, the value is ignored.
|
||||
</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</font>, version 1</p>
|
||||
<br />
|
||||
<h3 id="a0objects"><a href="https://newgrf-specs.tt-wiki.net/wiki/Action0/Objects">Action 0 - Objects</a></h3>
|
||||
<h4 id="object_use_land_ground">Object uses land ground sprite (mappable property: object_use_land_ground)</h4>
|
||||
@@ -649,6 +671,12 @@
|
||||
</table>
|
||||
</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">varaction2_signals_signal_context</font>, version 1</p>
|
||||
<h4 id="signals_signal_style">Signal style (mappable variable: signals_signal_style)</h4>
|
||||
<p>This applies to <a href="#a3signals_custom_signal_sprites">Action 2/3 Signals (Feature 0E) custom signal sprites</a>.<br />
|
||||
If the signal being drawn uses a custom signal style, the value is the signal style ID as set in the <a href="#signals_define_style">signals_define_style</a> property.<br />
|
||||
Otherwise for signals using the default style, the value is 0.
|
||||
</p>
|
||||
<p>This is indicated by the feature name: <font face="monospace">action0_signals_style</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>
|
||||
|
||||
Reference in New Issue
Block a user