The District of Joban Difference between revisions of "JCM:PIDS Preset"

Difference between revisions of "JCM:PIDS Preset"

From The District of Joban
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Joban PIDS''' refers to a series of '''Passenger Information Display System''' blocks that supports customization currently not present on the PIDS of the main MTR Mod'''.'''
A PIDS Preset is a set of configuration/customization for how a JCM PIDS (Passenger Information Display System) Block should display it's content.


These class has support for '''PIDS Variable''' and '''PIDS Preset. The following block supports these features:'''
'''The following block supports these features:'''
 
* [[JCM:Old Tsueng Kwan O Line PIDS|Old Tsueng Kwan O Line (LCD) PIDS]]
* [[JCM:Old Tsueng Kwan O Line PIDS|Old Tsueng Kwan O Line PIDS]]


* [[JCM:Railway Vision PIDS|Railway Vision PIDS]]
* [[JCM:Railway Vision PIDS|Railway Vision PIDS]]
Line 10: Line 9:


* [[JCM:Railway Vision PIDS (SIL 2)|Railway Vision PIDS (SIL 2)]]
* [[JCM:Railway Vision PIDS (SIL 2)|Railway Vision PIDS (SIL 2)]]
*[[JCM:PIDS Projector|PIDS Projector]]
*[[JCM:PIDS 1A|PIDS 1A]]
There are 2 types of PIDS Preset, presented as follows:


=== Block Entity Data ===
=== JSON PIDS Preset ===
{| class="wikitable"
A JSON PIDS Preset is a RV PIDS-alike preset, using JSON property to modify the ''basic'' appearance of the PIDS.
|+
!Name
!Type
!Description
|-
| colspan="3" |All MTR Mod PIDS Properties
|-
|preset_id
|String
|The string of the Preset ID
|}


=== PIDS Preset ===
Things you can change:
A PIDS preset is like a collection of configurations for the PIDS, things you can change including:


* Visibility of Weather/Time (RV PIDS Only)
* Visibility of Weather/Time
* Font used
* Font used
* Font Color
* Font Color
Line 35: Line 25:
* Push arrival down even without hiding the arrivals (Since [[JCM:1.1.5|v1.1.5]])
* Push arrival down even without hiding the arrivals (Since [[JCM:1.1.5|v1.1.5]])
*Colors for different cars (Since [[JCM:1.2.2|v1.2.2]])
*Colors for different cars (Since [[JCM:1.2.2|v1.2.2]])
For more detail of the implementation, you may download the [https://www.joban.tk/JCM/1.1.5/Joban_Custom_Resources.zip Example Pack] to learn more.
For more detail of the implementation, you may download the [https://www.joban.org/JCM/1.1.5/Joban_Custom_Resources.zip Example Pack] to learn more.
 
==== Cars Color ====
You may now specify the color for the car display by adding a <code>carLengthColor</code> array for each preset, for example:
 
<code>"carLengthColor": [null, "00FFFF", "FF00FF"]</code>
 
This means:
 
* No color change for the 1st car
* Use color #00FFFF if the train is 2-car long
* Use color #FF00FF if the train is 3-car long
* No color change for other car length.
 
=== PIDS Variable (v1 only) ===
'''Note: PIDS Variable has been deprecated and removed in v2.0.0'''


==== PIDS Variable ====
A variable is like a placeholder, you can put a text formatted in a specific way, and that text will be replaced with something else (e.g. a dynamic value).
A variable is like a placeholder, you can put a text formatted in a specific way, and that text will be replaced with something else (e.g. a dynamic value).
{| class="wikitable"
{| class="wikitable"
Line 87: Line 63:
|}
|}
Simply put the '''Variable Name''' mentioned above in your PIDS as custom text, and it will work.
Simply put the '''Variable Name''' mentioned above in your PIDS as custom text, and it will work.
=== Scripted PIDS Preset ===
Scripted PIDS Preset, as the name implies, uses a scripting language (Javascript in this case) to create the appearance of PIDS.
As custom logic can be expressed, this method is much more flexible than JSON PIDS Preset, but has a higher learning curve due to the need to learn programming.
For more details, please check [[JCM:Scripted PIDS Preset|Scripted PIDS Preset]]
=== List of Supported JSON Property for PIDS Preset ===
{| class="wikitable"
|+
!Property Name
!Description
!Possible values
!Default
!Version Added
!Preset Type
|-
|<code>id</code>
|The unique ID for the preset
|Any string
|No default, must be filled
|v1.1.4+
|All
|-
|<code>name</code>
|The displayed name for the preset
|Any string
|The <code>id</code> property
|v2.0.0+
|All
|-
|<code>thumbnail</code>
|The thumbnail image for the preset, shown in UI
|Any string pointing to the texture
|
* JSON: <code>background</code> property
* Scripted: <code>"textures/gui/pids_preview_js.png"</code>
|v2.0.0+
|All
|-
|<code>blacklist</code>
|The type of PIDS that are blacklisted from selecting this preset
|String JSON Array of any of the following:
* <code>"rv_pids"</code>
* <code>"rv_pids_sil_1"</code>
* <code>"rv_pids_sil_2"</code>
* <code>"lcd_pids"</code>
* <code>"pids_projector"</code>
*<code>"pids_1a"</code>
|<code>[]</code>
|v2.0.0+
|All
|-
|<code>background</code>
|The background image of the preset
|Any string pointing to the texture
|No default, must be filled
|v1.1.4+
|JSON
|-
|<code>color</code>
|The color of the text
|Color hex code string, i.e.
<code>"FFFFFF"</code>
|<code>"000000"</code>
|v1.1.4+
|JSON
|-
|<code>fonts</code>
|The font used for text
|Any string pointing to the font
|<code>"mtr:mtr"</code>
|v1.1.4+
|JSON
|-
|<code>showWeather</code>
|Whether to show the weather icon
|<code>true</code> / <code>false</code>
|<code>false</code>
|v1.1.4+
|JSON
|-
|<code>showClock</code>
|Whether to show clock text
|<code>true</code> / <code>false</code>
|<code>false</code>
|v1.1.4+
|JSON
|-
|<code>hidePlatform</code>
|Whether platform number should
be hidden (Override Hide Platform in per-block PIDS Config)
|<code>true</code> / <code>false</code>
|<code>false</code>
|v1.1.4+
|JSON
|-
|<code>hideRow</code>
|Which row should
be hidden (Override Hide Arrivals in per-block PIDS Config)
|Boolean JSON Array
(Length: 4)
|<code>[false, false, false, false]</code>
|v1.1.5+
|JSON
|-
|<code>carLengthColor</code>
|The text color when the car number is shown in the PIDS. (Per car length)
|String JSON Array containing the hex code string, i.e.
<code>["FF0000", "00FFFF"]</code>
|<code>[]</code>
|'''v1.2.2 only'''
|JSON
|-
|<code>topPadding</code>
|Whether arrival should be
pushed downwards for RV PIDS's top bar.
|<code>true</code> / <code>false</code>
|<code>true</code>
|v2.0.0+
|JSON
|-
|<code>textOverflowMode</code>
|Display mode when text
exceeds its boundary
|<code>STRETCH</code> - Scale in the overflowing Axis
<code>SCALE</code> - Scale in both axis
|<code>"STRETCH"</code>
|v2.0.0+
|JSON
|-
|<code>scriptFiles</code>
|The script files to load
|String JSON Array, pointing to the scripts to load.
|No default, must be filled to be considered Scripted PIDS Preset.
|v2.0.0+
|Scripted
|}

Latest revision as of 17:02, 9 December 2024

A PIDS Preset is a set of configuration/customization for how a JCM PIDS (Passenger Information Display System) Block should display it's content.

The following block supports these features:

There are 2 types of PIDS Preset, presented as follows:

JSON PIDS Preset

A JSON PIDS Preset is a RV PIDS-alike preset, using JSON property to modify the basic appearance of the PIDS.

Things you can change:

  • Visibility of Weather/Time
  • Font used
  • Font Color
  • Background Images
  • Hide arrival override (Since v1.1.5)
  • Push arrival down even without hiding the arrivals (Since v1.1.5)
  • Colors for different cars (Since v1.2.2)

For more detail of the implementation, you may download the Example Pack to learn more.

PIDS Variable

A variable is like a placeholder, you can put a text formatted in a specific way, and that text will be replaced with something else (e.g. a dynamic value).

List of variables
Variable Name Description Version Added
{weather} The weather of the current world, possible values are:

"Sunny", "Raining", "Thundering"

v1.1.2
{time} The current world time, returns "HH:MM" v1.1.2
{time_period} The current time period, possible values are:

"Morning", "Afternoon", "Night"

v1.1.2
{weatherChin} The weather of the current world in chinese.

Possible values are: "晴天", "下雨", "雷暴"

v1.1.4
{worldPlayer} Current amount of player on the current world v1.1.4
{day} The day elapsed (Same as the one shown in F3 Screen) v1.1.5

Simply put the Variable Name mentioned above in your PIDS as custom text, and it will work.

Scripted PIDS Preset

Scripted PIDS Preset, as the name implies, uses a scripting language (Javascript in this case) to create the appearance of PIDS.

As custom logic can be expressed, this method is much more flexible than JSON PIDS Preset, but has a higher learning curve due to the need to learn programming.

For more details, please check Scripted PIDS Preset

List of Supported JSON Property for PIDS Preset

Property Name Description Possible values Default Version Added Preset Type
id The unique ID for the preset Any string No default, must be filled v1.1.4+ All
name The displayed name for the preset Any string The id property v2.0.0+ All
thumbnail The thumbnail image for the preset, shown in UI Any string pointing to the texture
  • JSON: background property
  • Scripted: "textures/gui/pids_preview_js.png"
v2.0.0+ All
blacklist The type of PIDS that are blacklisted from selecting this preset String JSON Array of any of the following:
  • "rv_pids"
  • "rv_pids_sil_1"
  • "rv_pids_sil_2"
  • "lcd_pids"
  • "pids_projector"
  • "pids_1a"
[] v2.0.0+ All
background The background image of the preset Any string pointing to the texture No default, must be filled v1.1.4+ JSON
color The color of the text Color hex code string, i.e.

"FFFFFF"

"000000" v1.1.4+ JSON
fonts The font used for text Any string pointing to the font "mtr:mtr" v1.1.4+ JSON
showWeather Whether to show the weather icon true / false false v1.1.4+ JSON
showClock Whether to show clock text true / false false v1.1.4+ JSON
hidePlatform Whether platform number should

be hidden (Override Hide Platform in per-block PIDS Config)

true / false false v1.1.4+ JSON
hideRow Which row should

be hidden (Override Hide Arrivals in per-block PIDS Config)

Boolean JSON Array

(Length: 4)

[false, false, false, false] v1.1.5+ JSON
carLengthColor The text color when the car number is shown in the PIDS. (Per car length) String JSON Array containing the hex code string, i.e.

["FF0000", "00FFFF"]

[] v1.2.2 only JSON
topPadding Whether arrival should be

pushed downwards for RV PIDS's top bar.

true / false true v2.0.0+ JSON
textOverflowMode Display mode when text

exceeds its boundary

STRETCH - Scale in the overflowing Axis

SCALE - Scale in both axis

"STRETCH" v2.0.0+ JSON
scriptFiles The script files to load String JSON Array, pointing to the scripts to load. No default, must be filled to be considered Scripted PIDS Preset. v2.0.0+ Scripted