From 22293a4314ad9897a847b73cd5deec81606d28ba Mon Sep 17 00:00:00 2001 From: TELK Date: Sat, 8 Jun 2024 16:48:34 +0900 Subject: [PATCH] Add #30: Shunt signals This is an initial application for shunt singals and related to #31. Closes #30 --- docs/changelog.md | 3 +- ko_signal_set.pnml | 52 ++++++++++++++++++++++------ lang/english.lng | 6 ++++ lang/korean.lng | 6 ++++ src/shunt.pnml | 36 +++++++++++++++++++ src/shunt/shunt.colour_multiple.png | Bin 0 -> 3012 bytes src/shunt/shunt.colour_single.png | Bin 0 -> 1893 bytes src/shunt/shunt.position.png | Bin 0 -> 2777 bytes 8 files changed, 91 insertions(+), 12 deletions(-) create mode 100644 src/shunt.pnml create mode 100644 src/shunt/shunt.colour_multiple.png create mode 100644 src/shunt/shunt.colour_single.png create mode 100644 src/shunt/shunt.position.png 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 0000000000000000000000000000000000000000..41dfdd7d7a1a8f3408cd19e34fd59813abaec366 GIT binary patch literal 3012 zcmb_e4QvzF9e*7ecr9!eO(l1D<>tWZ4m&>EXUBITdmXO=f!BW zrM)B3l}h(y`v!1Tfw^?P-B#$Tm4`y+c$`h8qS(%Vp7Jfrev)x%{zM{d@df5 z5I|}Mn7sgZ6`1|=9nnHhTpmfP%x1HS#!8*I-Baob+amGW_7s0G8%&IcEtTxf< zit(Y&SbK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fMHdGw9U`O3xndKYZjTlwl^M}{lUt!vKhK)QYJ@BHBE(&Zn# z{LjimFJ2wGzGmF>=Ap6Ui~czA_Hxb0O&^?lII!>8?G8Em-vvNb`D*&Lm9FRh4M$LO A3;+NC literal 0 HcmV?d00001 diff --git a/src/shunt/shunt.colour_single.png b/src/shunt/shunt.colour_single.png new file mode 100644 index 0000000000000000000000000000000000000000..ce1ad3f7c81c00cf3b8d8c33fb272bc1558638e4 GIT binary patch literal 1893 zcmaJ>Z)_Xo8Gp3qgH_teh*X%>gTqac5srO!u8D1&_S#%hM>ypgjCvB*cCPQ5Gd=qb z`?_3P3t5{#xYVLy7%3nN%#;alvNmrNFwCQ2^M?$qsbbdTRUR|{MpQ*K4Qb;xFJ$M^ zw0s~ty?5`Qdw##?dEV#uzNhE|`?qfX(PjYHI_jmywO-QRdv%+%?>4^FuXXn*!;JEn zbVQj9#(3DvNr!oCG!mTP$N3<4{Hee39)L~vhy9GgjQQLlDPj$FY^-WT*3bZ+J*pfG z9px45Fh3EF4w^3g>6{4*bAzTsyTn+dyNq8uGGeH#=rMq@)#jK_9a`+Gxn!hsFAtoDA~uNSww@qTxo3%mK4G;cBPh%r4VnZ+k=-`i z%VonIHix5Ev*?WY(1fwB-lo~W?1lDkvbN4xh z2&!+d!?CM>z-}KNaZ<#HYsfi_?;9BzaPjf~yljbp(#5k4|BX zX~mgK)1{nPJ)5Qsz*@SJlrG2W%c`NC!{*C+R0q^fA~cJ20okqd8}*{am~@)6US}cT zD~n7uDb}+|9RYe0FuDt8yGVJ9Kh-T{jmd(ABuNW}c^I4)JVL^k%m$`Q;@Mh4PZ%(- z#mRbo3d5#FbtXMMTPQc@FatP^K+`lsY!OI9!f(llWIoCG%zBnED3m$vch0b6S*B}A zww{$+h2%mdOB=g5bGPa=XMALyW6SAukD0;=KS^>lt#DjAm6|CQXY2JAj^m_diXn@F zuc|VwjDYfKR4E`Zh|rS)A`jj&uyuplbWY7Pg~enQRa!_-vIbf-vnnB{=uBQI&gN>( z+9E0vM4cdz);I=DB~Uq!8gpoQ!P_kdEE$<9WVmV}-I^=4&zINc&m-+F4FDto@&HwU z768&34M+r(1~da`7Eluqf?8Vl*;E(G0V?6B%Av-z&cJNx5xR+lk;<3@GfuVQoo;Z& zRv<@+B{DJRn`#AG%V=()eYUxfsx+ACqF%4>T!NI`<5kQ))j}t5f6~iMaj8OM8L`P3 zip}^8I?-a7@)9M{|KTs6)ngMVeNKz{etgS&dn_YpGHngw7 zwd-(w6;=_Tui@)&;F~q=|JvFa+n*-T&kpm5aadzGm;g>%|uz-ewmZci#QVpWnSFwtc5Q zSa<*C@hcV6$G`45`IDWWJ>LD>mnXJ8@QC$~Uwr=K-=k*^U0AsMpXVP&&bIx!y=}km z+QG%sp5;3#?V)!+ojmvUKXzf47Q&}zfMd~7yfXDXihw{ zZ}ZA)7eC(p;j^pPw|{i*>cNYPkGyAl^`}2Lm;LYVmsW)(Ywe^Chu5Fj{lW9wm;R|` O2BX6VsNd~lfBrw*7VHoJ literal 0 HcmV?d00001 diff --git a/src/shunt/shunt.position.png b/src/shunt/shunt.position.png new file mode 100644 index 0000000000000000000000000000000000000000..b50e2239804c5b884e6f09e4bb0acbc7a42c08d9 GIT binary patch literal 2777 zcmbVN4QvzF9e=E;meEjLk!>Dw;bu_hu6BHO&W>$4aE>p;(HuCy6tjB6hwmJ_oPDl+ zBqp=Kqn0qkCF$x#Y3oj2NheE7TW>_vW0@L+MN^vbwWy8O6hc?3sLM*A;iK?q_M9)+ zM%QYmyYsvM`~Cjk@9%x|+J;37mo5YVENZk-8_=(So@M3tq4&4BydHr20Bv{F12FX| z`1BIEGyx_qgUeUImCwLulVI{HxOxp-%jI%~LSbNFV0d_VY-|idNSJMu-Q{$LcrlSk zb!Dq@u^+2~MTdU7P6 zNF|EP^4{!oXcL|oy9mml#Z7Z zKtckHF2mhrWT?WCsPv^}@tl$*NhO7uojC0?`(pNZ+SQfkdk13@LWAZzz&#|5ju<+|oVkg35%!Hj3F(&7yuu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