From daf0d45396b3cc1b9606b035531f6c3962cf8543 Mon Sep 17 00:00:00 2001 From: TELK Date: Sat, 8 Jun 2024 17:41:21 +0900 Subject: [PATCH] Add #25: Parameter for dynamic multi-aspect signals Closes #25 --- docs/changelog.md | 2 ++ ko_signal_set.pnml | 22 ++++++++++++-- lang/english.lng | 6 ++++ lang/korean.lng | 6 ++++ src/electric/block/code.pnml | 21 +++++++++++-- src/electric/combo/code.pnml | 44 +++++++++++++++++++++++---- src/electric/entry/code.pnml | 20 +++++++++++-- src/electric/exit/code.pnml | 46 ++++++++++++++++++++++++----- src/electric/oneway_path/code.pnml | 26 ++++++++++++++-- src/electric/path/code.pnml | 26 ++++++++++++++-- src/electric/programmable/code.pnml | 21 +++++++++++-- 11 files changed, 212 insertions(+), 28 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 41921c3..565ca85 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,8 @@ 1.3.0 ----- * 추가: [JGRPP] 입환 신호기 [#30] + * 추가: [JGRPP] 현시 수를 설정할 수 있는 매개변수 추가 [#25] + - 2현시, 3현시, 4현시, 5현시(기존)로 설정 가능 * 수정: [JGRPP] 복합, 출구 신호기 주의 표시 매개변수가 JGRPP 한정으로 적용되지 않던 현상 * 수정: [JGRPP] 프로그램 신호기가 기본 그래픽으로 보이는 현상 [#28] diff --git a/ko_signal_set.pnml b/ko_signal_set.pnml index 025ade0..7351225 100644 --- a/ko_signal_set.pnml +++ b/ko_signal_set.pnml @@ -9,7 +9,7 @@ grf { name : string(STR_GRF_NAME_WITH_VER); desc : string(STR_GRF_DESC); url : string(STR_GRF_URL); - version : 1210; + version : 1290; min_compatible_version : 1; param 1 { @@ -115,6 +115,24 @@ grf { def_value: 0; } } + + // Signal aspects + param 3 { + param_aspect_style { + type: int; + name: string(STR_PARAM_ASPECT_STYLE_NAME); + desc: string(STR_PARAM_ASPECT_STYLE_DESC); + min_value: 0; + max_value: 3; + def_value: 3; + names: { + 0: string(STR_ASPECT_STYLE_2); + 1: string(STR_ASPECT_STYLE_3); + 2: string(STR_ASPECT_STYLE_4); + 3: string(STR_ASPECT_STYLE_5); + }; + } + } /* // Force TVM signal side param 3 { @@ -210,7 +228,7 @@ item (FEAT_SIGNALS, ko_signal_set, 0) { enable_signal_recolour: 1; enable_no_entry_signals: 1; enable_programmable_pre_signals: 1; - extra_aspects: 3; + extra_aspects: param_aspect_style; } graphics { diff --git a/lang/english.lng b/lang/english.lng index b820171..8ddd870 100644 --- a/lang/english.lng +++ b/lang/english.lng @@ -15,6 +15,12 @@ STR_PARAM_USE_CAUTION_SIGNALS_NAME :Use caution signals STR_PARAM_USE_CAUTION_SIGNALS_DESC :Use deceleration(YG) and caution(Y) signals for electric combo, exit signals respectively. (default: enabled) STR_PARAM_USE_ROUTING_RESTRICTION_NAME :Show routing restrictions STR_PARAM_USE_ROUTING_RESTRICTION_DESC :When enabled, signals with routing restriction programs atttached are shown with a blue signal post. +STR_PARAM_ASPECT_STYLE_NAME :Signal aspect sequence +STR_PARAM_ASPECT_STYLE_DESC :This sets the aspect sequence style. (Default: 5 Aspect) +STR_ASPECT_STYLE_2 :None, 2 Aspect (R -> G) +STR_ASPECT_STYLE_3 :3 Aspect (R -> Y -> G) +STR_ASPECT_STYLE_4 :4 Aspect (R -> Y -> YG -> G) +STR_ASPECT_STYLE_5 :5 Aspect (R -> YY -> Y -> YG -> G) # STR_PARAM_FORCE_TVM_SIGNAL_SIDE_NAME :Position of the TVM signal's side # STR_PARAM_FORCE_TVM_SIGNAL_SIDE_DESC :Force TVM signal's position regardless of the driving traffic side. (default: As driving traffic side) # STR_PARAM_TVM_SIGNAL_SIDE_TRAFFIC_SIDE :As driving traffic side diff --git a/lang/korean.lng b/lang/korean.lng index 0b36be9..ee60c44 100644 --- a/lang/korean.lng +++ b/lang/korean.lng @@ -15,6 +15,12 @@ STR_PARAM_USE_CAUTION_SIGNALS_NAME :주의 신호 사용 STR_PARAM_USE_CAUTION_SIGNALS_DESC :전자식 복합, 출구 신호기의 진행 신호를 각각 감속(YG), 주의(Y) 신호로 변경합니다. (기본값: 켬) STR_PARAM_USE_ROUTING_RESTRICTION_NAME :경로 제한 표시 STR_PARAM_USE_ROUTING_RESTRICTION_DESC :이 설정을 켜면, 경로 제한 프로그램이 있는 신호기의 기둥을 파란색으로 표시합니다. +STR_PARAM_ASPECT_STYLE_NAME :신호 현시 수 +STR_PARAM_ASPECT_STYLE_DESC :신호기의 현시 수를 조정합니다. (기본값: 5현시) +STR_ASPECT_STYLE_2 :사용 안 함, 2현시 (R → G) +STR_ASPECT_STYLE_3 :3현시 (R → Y → G) +STR_ASPECT_STYLE_4 :4현시 (R → Y → YG → G) +STR_ASPECT_STYLE_5 :5현시 (R → YY → Y → YG → G) # STR_PARAM_FORCE_TVM_SIGNAL_SIDE_NAME :TVM 신호 위치 # STR_PARAM_FORCE_TVM_SIGNAL_SIDE_DESC :TVM 신호기의 위치를 통행 방향과 상관없이 강제할 수 있습니다 (기본값: 통행 방향) # STR_PARAM_TVM_SIGNAL_SIDE_TRAFFIC_SIDE :통행 방향 diff --git a/src/electric/block/code.pnml b/src/electric/block/code.pnml index 21863ca..002a78f 100644 --- a/src/electric/block/code.pnml +++ b/src/electric/block/code.pnml @@ -42,10 +42,25 @@ switch (FEAT_SIGNALS, SELF, sw_signal_block_YG, (is_realistic << 1) + (use_blue_ set_signal_block_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_block, extra_callback_info2 & 0x000000FF) { +switch (FEAT_SIGNALS, SELF, sw_signal_block_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_block_R; - 1: sw_signal_block_G; 2: sw_signal_block_Y; 3: sw_signal_block_YG; - 4: sw_signal_block_G; + sw_signal_block_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_block_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_block_R; + 2: sw_signal_block_Y; + sw_signal_block_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_block_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_block_R; + sw_signal_block_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_block, param_aspect_style) { + 3: sw_signal_block_aspect_4; + 2: sw_signal_block_aspect_4; + 1: sw_signal_block_aspect_3; + sw_signal_block_aspect_2; } diff --git a/src/electric/combo/code.pnml b/src/electric/combo/code.pnml index ef83805..d5bc94c 100644 --- a/src/electric/combo/code.pnml +++ b/src/electric/combo/code.pnml @@ -42,20 +42,52 @@ switch (FEAT_SIGNALS, SELF, sw_signal_combo_YG, (is_realistic << 1) + (use_blue_ set_signal_combo_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_combo_normal, (extra_callback_info2 & 0x000000FF)) { +switch (FEAT_SIGNALS, SELF, sw_signal_combo_normal_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_combo_R; - 1: sw_signal_combo_G; 2: sw_signal_combo_Y; 3: sw_signal_combo_YG; - 4: sw_signal_combo_G; + sw_signal_combo_G; } -switch (FEAT_SIGNALS, SELF, sw_signal_combo_caution, (extra_callback_info2 & 0x000000FF)) { +switch (FEAT_SIGNALS, SELF, sw_signal_combo_normal_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_combo_R; + 2: sw_signal_combo_Y; + sw_signal_combo_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_combo_normal_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_combo_R; + sw_signal_combo_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_combo_normal, param_aspect_style) { + 3: sw_signal_combo_normal_aspect_4; + 2: sw_signal_combo_normal_aspect_4; + 1: sw_signal_combo_normal_aspect_3; + sw_signal_combo_normal_aspect_2; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_combo_caution_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_combo_R; - 1: sw_signal_combo_G; 2: sw_signal_combo_Y; 3: sw_signal_combo_YG; - 4: sw_signal_combo_YG; + sw_signal_combo_YG; } +switch (FEAT_SIGNALS, SELF, sw_signal_combo_caution_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_combo_R; + 2: sw_signal_combo_Y; + sw_signal_combo_YG; +} +switch (FEAT_SIGNALS, SELF, sw_signal_combo_caution_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_combo_R; + sw_signal_combo_YG; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_combo_caution, param_aspect_style) { + 3: sw_signal_combo_caution_aspect_4; + 2: sw_signal_combo_caution_aspect_4; + 1: sw_signal_combo_caution_aspect_3; + sw_signal_combo_caution_aspect_2; +} + switch (FEAT_SIGNALS, SELF, sw_signal_combo, use_caution_signal) { 0: sw_signal_combo_normal; 1: sw_signal_combo_caution; diff --git a/src/electric/entry/code.pnml b/src/electric/entry/code.pnml index c142bc9..f5697a0 100644 --- a/src/electric/entry/code.pnml +++ b/src/electric/entry/code.pnml @@ -42,10 +42,24 @@ switch (FEAT_SIGNALS, SELF, sw_signal_entry_YG, (is_realistic << 1) + (use_blue_ set_signal_entry_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_entry, extra_callback_info2 & 0x000000FF) { +switch (FEAT_SIGNALS, SELF, sw_signal_entry_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_entry_R; - 1: sw_signal_entry_G; 2: sw_signal_entry_Y; 3: sw_signal_entry_YG; - 4: sw_signal_entry_G; + sw_signal_entry_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_entry_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_entry_R; + 2: sw_signal_entry_Y; + sw_signal_entry_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_entry_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_entry_R; + sw_signal_entry_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_entry, param_aspect_style) { + 2: sw_signal_entry_aspect_4; + 1: sw_signal_entry_aspect_3; + sw_signal_entry_aspect_2; } diff --git a/src/electric/exit/code.pnml b/src/electric/exit/code.pnml index a6b4623..4ee8a74 100644 --- a/src/electric/exit/code.pnml +++ b/src/electric/exit/code.pnml @@ -42,20 +42,52 @@ switch (FEAT_SIGNALS, SELF, sw_signal_exit_YG, (is_realistic << 1) + (use_blue_e set_signal_exit_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_exit_normal, (extra_callback_info2 & 0x000000FF)) { +switch (FEAT_SIGNALS, SELF, sw_signal_exit_normal_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_exit_R; - 1: sw_signal_exit_G; 2: sw_signal_exit_Y; 3: sw_signal_exit_YG; - 4: sw_signal_exit_G; + sw_signal_exit_G; } -switch (FEAT_SIGNALS, SELF, sw_signal_exit_caution, (extra_callback_info2 & 0x000000FF)) { +switch (FEAT_SIGNALS, SELF, sw_signal_exit_normal_aspect_3, extra_callback_info2 & 0x000000FF) { 0: sw_signal_exit_R; - 1: sw_signal_exit_G; 2: sw_signal_exit_Y; - 3: sw_signal_exit_Y; - 4: sw_signal_exit_Y; + sw_signal_exit_G; } +switch (FEAT_SIGNALS, SELF, sw_signal_exit_normal_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_exit_R; + sw_signal_exit_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_exit_normal, param_aspect_style) { + 3: sw_signal_exit_normal_aspect_4; + 2: sw_signal_exit_normal_aspect_4; + 1: sw_signal_exit_normal_aspect_3; + sw_signal_exit_normal_aspect_2; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_exit_caution_aspect_4, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_exit_R; + 2: sw_signal_exit_Y; + 3: sw_signal_exit_YG; + sw_signal_exit_YG; +} +switch (FEAT_SIGNALS, SELF, sw_signal_exit_caution_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_exit_R; + 2: sw_signal_exit_Y; + sw_signal_exit_YG; +} +switch (FEAT_SIGNALS, SELF, sw_signal_exit_caution_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_exit_R; + sw_signal_exit_YG; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_exit_caution, param_aspect_style) { + 3: sw_signal_exit_caution_aspect_4; + 2: sw_signal_exit_caution_aspect_4; + 1: sw_signal_exit_caution_aspect_3; + sw_signal_exit_caution_aspect_2; +} + switch (FEAT_SIGNALS, SELF, sw_signal_exit, use_caution_signal) { 0: sw_signal_exit_normal; 1: sw_signal_exit_caution; diff --git a/src/electric/oneway_path/code.pnml b/src/electric/oneway_path/code.pnml index b2aa017..e6ea772 100644 --- a/src/electric/oneway_path/code.pnml +++ b/src/electric/oneway_path/code.pnml @@ -50,10 +50,32 @@ switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path_YG, (is_realistic << 1) + (use set_signal_oneway_path_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path, extra_callback_info2 & 0x000000FF) { +switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path_aspect_5, extra_callback_info2 & 0x000000FF) { 0: sw_signal_oneway_path_R; - 1: sw_signal_oneway_path_G; 2: sw_signal_oneway_path_YY; 3: sw_signal_oneway_path_Y; 4: sw_signal_oneway_path_YG; + sw_signal_oneway_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path_aspect_4, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_oneway_path_R; + 2: sw_signal_oneway_path_Y; + 3: sw_signal_oneway_path_YG; + sw_signal_oneway_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_oneway_path_R; + 2: sw_signal_oneway_path_Y; + sw_signal_oneway_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_oneway_path_R; + sw_signal_oneway_path_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_oneway_path, param_aspect_style) { + 3: sw_signal_oneway_path_aspect_5; + 2: sw_signal_oneway_path_aspect_4; + 1: sw_signal_oneway_path_aspect_3; + sw_signal_oneway_path_aspect_2; } diff --git a/src/electric/path/code.pnml b/src/electric/path/code.pnml index 54be48e..0b1298d 100644 --- a/src/electric/path/code.pnml +++ b/src/electric/path/code.pnml @@ -50,10 +50,32 @@ switch (FEAT_SIGNALS, SELF, sw_signal_path_YG, (is_realistic << 1) + (use_blue_p set_signal_path_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_path, extra_callback_info2 & 0x000000FF) { +switch (FEAT_SIGNALS, SELF, sw_signal_path_aspect_5, extra_callback_info2 & 0x000000FF) { 0: sw_signal_path_R; - 1: sw_signal_path_G; 2: sw_signal_path_YY; 3: sw_signal_path_Y; 4: sw_signal_path_YG; + sw_signal_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_path_aspect_4, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_path_R; + 2: sw_signal_path_Y; + 3: sw_signal_path_YG; + sw_signal_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_path_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_path_R; + 2: sw_signal_path_Y; + sw_signal_path_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_path_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_path_R; + sw_signal_path_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_path, param_aspect_style) { + 3: sw_signal_path_aspect_5; + 2: sw_signal_path_aspect_4; + 1: sw_signal_path_aspect_3; + sw_signal_path_aspect_2; } diff --git a/src/electric/programmable/code.pnml b/src/electric/programmable/code.pnml index a89f479..385ab37 100644 --- a/src/electric/programmable/code.pnml +++ b/src/electric/programmable/code.pnml @@ -42,10 +42,25 @@ switch (FEAT_SIGNALS, SELF, sw_signal_programmable_YG, (is_realistic << 1) + (us set_signal_programmable_YG_nonreal; // non realistic && green } -switch (FEAT_SIGNALS, SELF, sw_signal_programmable, extra_callback_info2 & 0x000000FF) { +switch (FEAT_SIGNALS, SELF, sw_signal_programmable_aspect_4, extra_callback_info2 & 0x000000FF) { 0: sw_signal_programmable_R; - 1: sw_signal_programmable_G; 2: sw_signal_programmable_Y; 3: sw_signal_programmable_YG; - 4: sw_signal_programmable_G; + sw_signal_programmable_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_programmable_aspect_3, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_programmable_R; + 2: sw_signal_programmable_Y; + sw_signal_programmable_G; +} +switch (FEAT_SIGNALS, SELF, sw_signal_programmable_aspect_2, extra_callback_info2 & 0x000000FF) { + 0: sw_signal_programmable_R; + sw_signal_programmable_G; +} + +switch (FEAT_SIGNALS, SELF, sw_signal_programmable, param_aspect_style) { + 3: sw_signal_programmable_aspect_4; + 2: sw_signal_programmable_aspect_4; + 1: sw_signal_programmable_aspect_3; + sw_signal_programmable_aspect_2; }