diff --git a/docs/changelog.md b/docs/changelog.md index 7862c44..41921c3 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,6 @@ -1.2.2 +1.3.0 ----- + * 추가: [JGRPP] 입환 신호기 [#30] * 수정: [JGRPP] 복합, 출구 신호기 주의 표시 매개변수가 JGRPP 한정으로 적용되지 않던 현상 * 수정: [JGRPP] 프로그램 신호기가 기본 그래픽으로 보이는 현상 [#28] diff --git a/ko_signal_set.pnml b/ko_signal_set.pnml index db498a1..025ade0 100644 --- a/ko_signal_set.pnml +++ b/ko_signal_set.pnml @@ -149,6 +149,9 @@ if (!extended_feature_test("action3_signals_custom_signal_sprites")) { // Electric signals #include "./src/electric.pnml" +// Shunt +#include "./src/shunt.pnml" + param[10] = reserve_sprites(1); replace (param[10]) { // No recolouring @@ -168,8 +171,15 @@ replace (param[10]) { // General signal switches switch (FEAT_SIGNALS, SELF, sw_signal_types, [ + // Recolouring by parameter STORE_TEMP(param[10] + (hasbit(extra_callback_info2, 24) ? 1 : 0), 0x100), - ((extra_callback_info2 & 0x00FFFF00) | signal_style) + + // Assign signal type + ( + (extra_callback_info2 & 0x0000FF00) // 00: electric, 01: semaphore + | (extra_callback_info2 & 0x00FF0000) // from 00, block, entry, exit, combo, path, oneway path, programmable, no-entry signals + | signal_style + ) ]) { // Signals 0x00000: sw_signal_block; // Block @@ -180,17 +190,16 @@ switch (FEAT_SIGNALS, SELF, sw_signal_types, [ 0x50000: sw_signal_oneway_path; // Oneway path 0x60000: sw_signal_programmable; // Programmable 0x70000: sw_signal_noentry; // No-entry -/* + // (Reserved) Shunt - 0x00001: sw_shunt_block; // Block - 0x10001: sw_shunt_entry; // Entry - 0x20001: sw_shunt_exit; // Exit - 0x30001: sw_shunt_combo; // Combo - 0x40001: sw_shunt_path; // Path - 0x50001: sw_shunt_oneway_path; // Oneway path - 0x60001: sw_shunt_programmable; // Programmable - 0x70001: sw_shunt_noentry; // No-entry -*/ + 0x40001: sw_shunt_single; // Path + 0x70001: sw_shunt_single; // No-entry + 0x40101: sw_shunt_multiple; // Path, semaphore + 0x70101: sw_shunt_multiple; // No-entry, semaphore + + 0x40102: sw_shunt_position; // Path, semaphore + 0x70102: sw_shunt_position; // No-entry, semaphore + CB_FAILED; } @@ -208,3 +217,24 @@ item (FEAT_SIGNALS, ko_signal_set, 0) { sw_signal_types; } } + +// Additional signals +item (FEAT_SIGNALS, custom_signals, 0) { + property { + define_style: 1; + style_name: string(STR_STYLE_SHUNT_COLOUR); + style_electric_enabled: bitmask(SIGNAL_TYPE_PBS, SIGNAL_TYPE_NO_ENTRY); + style_semaphore_enabled: bitmask(SIGNAL_TYPE_PBS, SIGNAL_TYPE_NO_ENTRY); + style_no_aspect_increase: 1; + style_always_reserve_through: 1; + style_lookahead_single_signal_only: 1; + + define_style: 2; + style_name: string(STR_STYLE_SHUNT_POSITION); + style_electric_enabled: 0; + style_semaphore_enabled: bitmask(SIGNAL_TYPE_PBS, SIGNAL_TYPE_NO_ENTRY); + style_no_aspect_increase: 1; + style_always_reserve_through: 1; + style_lookahead_single_signal_only: 1; + } +} diff --git a/lang/english.lng b/lang/english.lng index 61832e6..b820171 100644 --- a/lang/english.lng +++ b/lang/english.lng @@ -35,5 +35,11 @@ STR_PARAM_USE_BLUE_AS_OPEN_ONEWAY_PATH_DESC :If enabled, use blue signal fo STR_PARAM_USE_BLUE_AS_OPEN_PROGRAMMABLE_NAME :Use blue signal for programmable signal STR_PARAM_USE_BLUE_AS_OPEN_PROGRAMMABLE_DESC :If enabled, use blue signal for programmable signal instead of green.{}{ORANGE}It only affects in JGRPP{BLACK} (default: disabled) + +# Shunt +STR_STYLE_SHUNT_COLOUR :Shunt (Colour) +STR_STYLE_SHUNT_POSITION :Shunt (Position light) + + # Errors STR_UNSUPPORTED_VERSION :This NewGRF requires OpenTTD JGRPP 0.43.0 or higher to experience full features like multi-aspect signals. diff --git a/lang/korean.lng b/lang/korean.lng index caf87bd..0b36be9 100644 --- a/lang/korean.lng +++ b/lang/korean.lng @@ -35,5 +35,11 @@ STR_PARAM_USE_BLUE_AS_OPEN_ONEWAY_PATH_DESC :이 설정을 켜면, 단방 STR_PARAM_USE_BLUE_AS_OPEN_PROGRAMMABLE_NAME :프로그램 신호기에 청색 신호 사용 STR_PARAM_USE_BLUE_AS_OPEN_PROGRAMMABLE_DESC :이 설정을 켜면, 단방향 경로 신호기에 녹색 신호 대신 청색 신호를 사용합니다.{}{ORANGE}JGRPP에서만 적용됩니다{BLACK} (기본값: 끔) + +# Shunt +STR_STYLE_SHUNT_COLOUR :입환 (색등식) +STR_STYLE_SHUNT_POSITION :입환 (등열식) + + # Errors STR_UNSUPPORTED_VERSION :이 NewGRF의 모든 기능(eg. 다현시 신호)을 사용하려면 OpenTTD JGRPP 0.43.0 또는 그 이상의 버전이 필요합니다. diff --git a/src/shunt.pnml b/src/shunt.pnml new file mode 100644 index 0000000..f12a00d --- /dev/null +++ b/src/shunt.pnml @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------------ + * 한국 신호기 세트(Korean Signal Set) + * https://github.com/KoreanGRF/KoreanSignalSet +------------------------------------------------------------------------------*/ + +// Templates for shunt signal +template shunt_signal(file, x, y) { + [x+0, y+0, 6, 9, -3, -7, file] + [x+15, y+0, 6, 9, -1, -7, file] + [x+30, y+0, 6, 9, -3, -7, file] + [x+45, y+0, 6, 9, -1, -6, file] + [x+60, y+0, 7, 9, -1, -7, file] + [x+75, y+0, 7, 9, -4, -7, file] + [x+90, y+0, 4, 9, -1, -7, file] + [x+105, y+0, 4, 9, -1, -7, file] +} + +spriteset(set_shunt_multiple_off) { shunt_signal("./src/shunt/shunt.colour_multiple.png", 0, 0) } +spriteset(set_shunt_multiple_on) { shunt_signal("./src/shunt/shunt.colour_multiple.png", 0, 15) } +spriteset(set_shunt_single_off) { shunt_signal("./src/shunt/shunt.colour_single.png", 0, 0) } +spriteset(set_shunt_single_on) { shunt_signal("./src/shunt/shunt.colour_single.png", 0, 15) } +spriteset(set_shunt_position_off) { shunt_signal("./src/shunt/shunt.position.png", 0, 0) } +spriteset(set_shunt_position_on) { shunt_signal("./src/shunt/shunt.position.png", 0, 15) } + +switch(FEAT_SIGNALS, SELF, sw_shunt_multiple, extra_callback_info2 & 0x000000FF) { + 0: set_shunt_multiple_off; + set_shunt_multiple_on; +} +switch(FEAT_SIGNALS, SELF, sw_shunt_single, extra_callback_info2 & 0x000000FF) { + 0: set_shunt_single_off; + set_shunt_single_on; +} +switch(FEAT_SIGNALS, SELF, sw_shunt_position, extra_callback_info2 & 0x000000FF) { + 0: set_shunt_position_off; + set_shunt_position_on; +} diff --git a/src/shunt/shunt.colour_multiple.png b/src/shunt/shunt.colour_multiple.png new file mode 100644 index 0000000..41dfdd7 Binary files /dev/null and b/src/shunt/shunt.colour_multiple.png differ diff --git a/src/shunt/shunt.colour_single.png b/src/shunt/shunt.colour_single.png new file mode 100644 index 0000000..ce1ad3f Binary files /dev/null and b/src/shunt/shunt.colour_single.png differ diff --git a/src/shunt/shunt.position.png b/src/shunt/shunt.position.png new file mode 100644 index 0000000..b50e223 Binary files /dev/null and b/src/shunt/shunt.position.png differ