Skip to content

Commit

Permalink
Add #25: Parameter for dynamic multi-aspect signals
Browse files Browse the repository at this point in the history
Closes #25
  • Loading branch information
telk5093 committed Jun 8, 2024
1 parent 22293a4 commit daf0d45
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 28 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
1.3.0
-----
* 추가: [JGRPP] 입환 신호기 [#30]
* 추가: [JGRPP] 현시 수를 설정할 수 있는 매개변수 추가 [#25]
- 2현시, 3현시, 4현시, 5현시(기존)로 설정 가능
* 수정: [JGRPP] 복합, 출구 신호기 주의 표시 매개변수가 JGRPP 한정으로 적용되지 않던 현상
* 수정: [JGRPP] 프로그램 신호기가 기본 그래픽으로 보이는 현상 [#28]

Expand Down
22 changes: 20 additions & 2 deletions ko_signal_set.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions lang/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions lang/korean.lng
Original file line number Diff line number Diff line change
Expand Up @@ -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 :통행 방향
Expand Down
21 changes: 18 additions & 3 deletions src/electric/block/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
44 changes: 38 additions & 6 deletions src/electric/combo/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 17 additions & 3 deletions src/electric/entry/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
46 changes: 39 additions & 7 deletions src/electric/exit/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 24 additions & 2 deletions src/electric/oneway_path/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
26 changes: 24 additions & 2 deletions src/electric/path/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
21 changes: 18 additions & 3 deletions src/electric/programmable/code.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit daf0d45

Please sign in to comment.