From 1b199c13cf22f46d68e2679f6859dff8d2cb1cc8 Mon Sep 17 00:00:00 2001 From: Rinary Date: Tue, 1 Oct 2024 14:26:57 +0300 Subject: [PATCH 1/8] optimize night vision shader --- .../Eye/NightVision/NightVisionOverlay.cs | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs b/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs index 09580176a89..202f9a4f249 100644 --- a/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs +++ b/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs @@ -18,6 +18,8 @@ public sealed class NightVisionOverlay : Overlay public override OverlaySpace Space => OverlaySpace.WorldSpace; private readonly ShaderInstance? _greyscaleShader; public Color NightvisionColor = Color.Green; + private EntityUid? _playerEntity; + private EyeComponent? _eyeComponent; private NightVisionComponent _nightvisionComponent = default!; @@ -35,21 +37,20 @@ public NightVisionOverlay(Color color) } protected override bool BeforeDraw(in OverlayDrawArgs args) { - var playerEntity = _playerManager.LocalSession?.AttachedEntity; - if (playerEntity == null) - return false; - - if (!_entityManager.TryGetComponent(playerEntity, out EyeComponent? eyeComp)) + if (_playerEntity == null) + _playerEntity = _playerManager.LocalSession?.AttachedEntity; + + if (_playerEntity == null || !_entityManager.TryGetComponent(_playerEntity.Value, out _eyeComponent)) return false; - if (args.Viewport.Eye != eyeComp.Eye) + if (args.Viewport.Eye != _eyeComponent?.Eye) return false; - if (!_entityManager.TryGetComponent(playerEntity, out var nightvisionComp)) + if (!_entityManager.TryGetComponent(_playerEntity.Value, out var nightvisionComp)) return false; _nightvisionComponent = nightvisionComp; - + var nightvision = _nightvisionComponent.IsNightVision; if (!nightvision && _nightvisionComponent.DrawShadows) // Disable our Night Vision @@ -78,13 +79,16 @@ protected override void Draw(in OverlayDrawArgs args) _nightvisionComponent.GraceFrame = false; } - _greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture); - - var worldHandle = args.WorldHandle; - var viewport = args.WorldBounds; - worldHandle.UseShader(_greyscaleShader); - worldHandle.DrawRect(viewport, NightvisionColor); - worldHandle.UseShader(null); + if (_nightvisionComponent.IsNightVision) + { + _greyscaleShader?.SetParameter("SCREEN_TEXTURE", ScreenTexture); + + var worldHandle = args.WorldHandle; + var viewport = args.WorldBounds; + worldHandle.UseShader(_greyscaleShader); + worldHandle.DrawRect(viewport, NightvisionColor); + worldHandle.UseShader(null); + } } } } \ No newline at end of file From 4199a42360c3d6b7e6ca09eb3757f9bf3821e693 Mon Sep 17 00:00:00 2001 From: Rinary Date: Tue, 1 Oct 2024 17:06:38 +0300 Subject: [PATCH 2/8] upd --- .../Audio/_Sunrise/Items/night_vision_off.ogg | Bin 0 -> 3966 bytes .../Audio/_Sunrise/Items/night_vision_on.ogg | Bin 0 -> 8215 bytes .../nvg.rsi/equipped-EYES-unshaded.png | Bin 0 -> 432 bytes .../Eyes/Glasses/nvg.rsi/icon-flash.png | Bin 0 -> 1720 bytes .../Eyes/Glasses/nvg.rsi/icon-unshaded.png | Bin 0 -> 215 bytes .../Clothing/Eyes/Glasses/nvg.rsi/icon.png | Bin 0 -> 423 bytes .../Glasses/nvg.rsi/inhand-left-unshaded.png | Bin 0 -> 377 bytes .../Eyes/Glasses/nvg.rsi/inhand-left.png | Bin 0 -> 588 bytes .../Glasses/nvg.rsi/inhand-right-unshaded.png | Bin 0 -> 396 bytes .../Eyes/Glasses/nvg.rsi/inhand-right.png | Bin 0 -> 670 bytes .../Eyes/Glasses/nvg.rsi/light-overlay.png | Bin 0 -> 1365 bytes .../Clothing/Eyes/Glasses/nvg.rsi/meta.json | 51 ++++++++++++++++++ .../Glasses/nvg.rsi/off-equipped-EYES.png | Bin 0 -> 613 bytes .../Eyes/Glasses/nvg.rsi/on-equipped-EYES.png | Bin 0 -> 1938 bytes 14 files changed, 51 insertions(+) create mode 100644 Resources/Audio/_Sunrise/Items/night_vision_off.ogg create mode 100644 Resources/Audio/_Sunrise/Items/night_vision_on.ogg create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/equipped-EYES-unshaded.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/icon-flash.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/icon-unshaded.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/icon.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left-unshaded.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-right-unshaded.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-right.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/light-overlay.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/meta.json create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/off-equipped-EYES.png create mode 100644 Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/on-equipped-EYES.png diff --git a/Resources/Audio/_Sunrise/Items/night_vision_off.ogg b/Resources/Audio/_Sunrise/Items/night_vision_off.ogg new file mode 100644 index 0000000000000000000000000000000000000000..563f2b0e36f4edb777f0bedf3a730af2264a2b17 GIT binary patch literal 3966 zcmahMeOy!5^#%e2WGq6!K!bysNP?gQgAxTx0#OJ=$P15;u#5sm!5FKCSlx<46Oct@ z7(-BuDV|EwLgUQ*)-sWE8>cWww+%Ua6}U}D@W;UnFf@$nAnflx@xfHXFw1$gbrN?($~ z*(|+(%?(e$fiM853bOB3qry#1^x($1PgA%9vd8Y+nB~VPfiWq4G)1v@RXMjHg?@Cf z7zLQXan2!IgbLUYmxbYo+;;!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D@p0NSpF?X@8kA?3Bm$xBC?C?hR}yxh&rNUG3;-UB|GTNdR4u<6HI{Hm|P44Z0P- zX}(IWy)|BXNYJ{jean?we`vY><@pCML;WXZ@yVW-Ypooo_u_lokL2{$vN>%E=Jd;v z#kv;L2Fjx7S(Tu?LJc7J!~~r;y?3AV~zdmpLTxC zxzo~d`OPZWAxBZ~Rp9oao>;J{U-`?sUPoTa!9hgY9zOig~BdBd6PvLK;7t zNN{^3O5XlkzXey@^<+RDAMU7Rf=`e3WdScRhzIM|Q7#1E{k-P&CiR8zk%&_zo^OuC z;wXtZv`j}3Yt>`M=Yp_5;lhH14?`ID&-`PjN7tv9$Yp^K+$m!otldx*YSnq<6ujBM z?+D;`(XM}W&)qfBe7d-OjloX5j$#tuJ$eFnzXqTC`T{I#z#uy*EC{_Q!Qa304{}wb z|JE~KQ4;^K_&gmfO6u^PZ~h%`9fo@xQju4w-*Zi7eZR%=)z(uVOna-oo2gy7d8HLa zu;;|!>t*MzgXg(@pWx_`^|IY7et#kR!>YNM(l08=w=Vr_ZvAkoyD)0L!{ZxAHJ9<( t_?!Cmoup3cr?0PhPt}`0dvcGvY>O#&caPw5TjS#sV|$!Kf91Is{0AK`GWGxf literal 0 HcmV?d00001 diff --git a/Resources/Audio/_Sunrise/Items/night_vision_on.ogg b/Resources/Audio/_Sunrise/Items/night_vision_on.ogg new file mode 100644 index 0000000000000000000000000000000000000000..edef7e2a41895ebd7915ac5ca5bb6c47b207ccb6 GIT binary patch literal 8215 zcmahtc|4Te_jio!X|iQE-pEpl8Zv|-!XOM|O;SmP2vbxtuPv`OAtW*tMN#ouTbK%| zB#}MQn+#F3SYE>KJfr%4zkmJi=b1bAIrp4%&pq2c_p$f$b3#1mXS=NvEQAevsv|6L zinv2TAv^blVgQ_ZA@+w5Qy<6uuf*A7l)oEBiOp!sT>UO;yzpP`Py8Yq5tz00IkZPl zdo5|LjR%`JJM zQn3VCGY6UX@@7r`qcUc;%cJGj+j>4%4NX$cWtk;-s{h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?m>w!&TMYjlHC7o3beVK-4TWam?Wm_ z)DmLYDMUExsk7nwNK1M-M={6l(DA+v*J;(c^{^09wg&UFDm}MK=v`V*V}FX*Pi<_! zV&Z$D@$A(vdr>`pR9I?Huq95}Gk@o;%-O7nCjp^euNtcruh%|m>wWj5**yapr~T+& z+gI+W{qdoq>CQi7NCBr#7vp#+kU~yCtu#6k%Je#Vp+oZ1*^#Mr9Gyt_uq~|y z+f>W9e=m_p7rgd&`&7yJ_WC{EM(Nk40$bhNj7IXqY;l}NRpYz8>suTTwr`hG+%b3V HrYHJ8=o4XG literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/equipped-EYES-unshaded.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/equipped-EYES-unshaded.png new file mode 100644 index 0000000000000000000000000000000000000000..a9fc73fd6285a936d72f1cf860f7179326c9d0d3 GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GG!XV7ZFl&wk0|R4{ zr;B4q#hkaZHs&@vNVwTAS~EemVA_sD))y|gPrT7+x#&ygjV4v0vILHxxl?XvOnhKJ zPp5wU;twC+{p5>&v??{Sw+(v7>0>2nbOsx z?HT&Txj^Rlg^x=%F`DHzmf7jn$KDs3&GaO-zOvSCzVe)P8XH#`&EDoPFC+H)q$QcN zR6J|%AD_84AW8d8700tq`J?Bj3Wz2LH(a{^W#XN`{~6d9ux7|Kh%G2&h-x^-n87H8 zS0F9CVUoUXe^POS&Ce;5g1n^K6n$RVE4>%}R%J6^G~@Z?IJ^5!$6}P1et8{pDDKdC zc8}Ei&)o8NUuaLTQ~&VqkCf$`SGJ2ZHZkRK{^z*_@v8-cuES%7EeyTPP|xEOIBWik XEub`xf9H2#6fk(Y`njxgN@xNA`?joQ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/icon-flash.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/icon-flash.png new file mode 100644 index 0000000000000000000000000000000000000000..cce978c8c2f1e4b65bb386e9df5bb01e3049e6f0 GIT binary patch literal 1720 zcmV;p21ogcP)S%aln*6H$mILL(s#vUmGCC683;lRl>7`PuS9tNfII>zeH}sS zJ$g)mCZ84Pz{KPepnW&XanKtFFrli*lI|CtKr#dcISe7&ZwVj+2T_1VU;rxPnFDBm zTsW8>=+Go15DfqUr@bkB3c{oTh)*GY1O-skP!>?Opa@V_P)k0STZ2GSn0Ho=NwY&R!OP;snrjq?I!u5S@V{ zyJl)L3WR&FUbJ&mAcJOsBxn-me}D7E3X22JJduvh5=1HK=P=9dc3lHXR+xp)LTG_( zd5mXEGC@27YSX$@15n<3?ZO=?l=HvnAThK4y$dUt50vVW@Y0Q&XWswj7axl459()^ zAnT1BGGrh;0ZL1;f<;1z4q)hvK)nCjg%yd);`I*yXfJc_`ca6=gV#UzPh7Y_R0tB3 zXo5!o`koz!&Nu`jSCm$1F&h( zJ989jK~q4gz~Mtjc<nWcJ4l4B?k2NGk8t2|wpb-SZO7Ox)zvAEjU*x>Gm@3Z#yD*yia zE01`_SZe|R_y~v|o52C#Y47~c=D5{f=G>2uSt3_F`@`Z-j&ZBK%=w?sfm%vzK3BhX zuFG>q_#Yl)&V+h3vngnXw|?-Li#uOp)lo#edahlJ5 z<`vHV<<8uv|9bn#?XNEGG=;tiEckllgon(7i)0>MdT5m&UcK}m3PqwqP&!9vIXr!s zot+)J8(m9v4vG}$%p7Cp&=Cf|{M`!~s(at~%EqVu{I~Wdq|O0ODBn`bDF_wB0mMlI zQ6?y&lXLItrFV(S{Fzf!*Zz23%&`>E``^B}G6XUI(#yQ}-@6_WmK{(2>F?74QUPh( znAJy309TZvWjR0OMg|={rDSn%&e%*-lY0fW_nIzU}Ptx%VcYDf`M4{{rF3-YG7 zYu8W>ZLFyXmNIj;rXnRjFq&&r83qvs3VoojwjKb30F^+MEFGr^DMR)Yoh#4|=rrg_ zxBb%42_O2)V8tRUlnVXj6ND;QhM}LA2czrGdyTFSP@Aumn}h>|JFO zTnz=+?mNjsZ6tiy9q+oVIFH2wux6nFz%=M4$fT7}-SJX7Wep479n%J$8vP9HLZUsR zMLXm6d?ftx9_mL7EIBR5JwE%sF@kPG?pV{ACOnpdQJZ@Hd)SOVG2cmT$PC&Wt{k7ne?Sl(zj|5epdUTcA&%I=eD2ORSb#X2wt)UWz& zYR$;uz`$g}tf1uO@~9^6*pIsC?8V(I53b$&Z85Lu@P=#=-uvhdR8cI$SeO@Pli6$*g%zBE5HfEj-|zjI;VEMb4mpkvs_p?ifCu;s z0LN3tq9~m6%)IsX%JW=lt-;J2^HCHz*Y6#Hfw&qzT5FT%`3PX!*b6|!m#c+Lxgya+ z{3?Jg{&;dff?(#6*K?vUSpza2)@uU*M1(SJae8-#GHpRbsOuU;WU?%StOGHv^B`z-)X(;y5(R8_Upxk&(9e7RcS>HKX&Y-kghkI#28?To^#8gS%& zmJI+duP!DV4mH(~bb0KB#7h^1ZIe2P<5&sA%k!%<5|a^N=6;h15D~&K1QB6qbBQyv zxw*dGnua;2K%qNoU16ytNdyqE?gA;ix~}{Bv7K=K-1meYzyo*y5Ag2+z5qjPnu(r} Rk|zKF002ovPDHLkV1m8Ju=)T1 literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left-unshaded.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left-unshaded.png new file mode 100644 index 0000000000000000000000000000000000000000..b6f81fc9482249d2f454582a5ad324a43dc26581 GIT binary patch literal 377 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GG!XV7ZFl&wk0|TSB zr;B4q#hkaZ4Evf5L|Er_xTng#}N>Zw|ZX!4W9Y%dX57 zqvUk|48N|!V}>mZz04PwO!yqQFIX_(5b*VCxcyn`@6QEWmj#_#`S@;an~>nkBO@Cf=k$DFxInWGD@*8V9k(e5L-~l5Y=#uF@s0}yM^~{47*k` zed)PnYjpMg!=O_yW!2JWX0d*mEWb5BW0mNHgCW`q%rL`${$kK~;kY01=Hf0{U|2GE My85}Sb4q9e0J;s3k^lez literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..346c9b36b91bda0a2e768b591498a5f1f0f3da79 GIT binary patch literal 588 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=oCO|{#S9GG!XV7ZFl&wk0|Vnf zPZ!6KiaBp*t?j$*AmXR4>;uHBVYjtlUog=r?NcZ^m6Bl zPS9+&N-$+zol}2e*~^IdwRa91+ZCH^Q~K?7PV)L0>1_<>)X(H}tY5 zaBtYiki%#u)}VXf7}EyU8xaiK7-p~L|FG^!k`mMVTDFEMLJSGJ?|R+dCeikA{k2n; zi*s-DFr3>t-8;u@cF`e?8m3vxPHL*!)KxaDdQ`FhaM8{)t7h%}ezUs%TU74tXOI8# zowJm=#+=l{p(s+{sHqy?)x`nS(S4MOVZkbf28qQhw1T`O8|D;C?OONSSEr?6*Si1j zfx+X*Cp!b4k^?~Xnq(P(@q*6U*Q1An`^{frE6?#Zj~KDOT|v%#|9 z>wjiEAwV#gMCJ<2l$!Xw|A^{x_q0kTFTegXMh(S$@^Y_;2Nes zR%XSs!PC{xWt~$(697`c^ArF8 literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-right-unshaded.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/inhand-right-unshaded.png new file mode 100644 index 0000000000000000000000000000000000000000..45eb42895a23c5aaf819fabb065e2bbe467c8a2a GIT binary patch literal 396 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0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hKF3Q9`3>sc*^e_>2Zcioz02X=iupOTbISw9FONm@L$iQKPs>ZS#IL^ypM^=Q>U)|&{-Bxas<~ldX97( z!r}vz71RaPZ7BNyHUq!-Lz4O5+s4&6`8E5B?_iHHZF^=x+h(sL%GZ%Ew= zb40+8?cZzjA5%E`ds_X~pVLbcMND@%8@sz$ZYxyCw7h<0&Ot~`ia8F(gQZvDy%Sg!o(PR zP~n^YWHpIxC&gB#a~r$yMPBH6R1^8dz93Pu|DH`|i-VCOOV3Q@Z49$7vRnB5b-rxE z!0^7d{OydRNgo6K_U?>d%fwJ@I``c+%jc7hov>nlwTq9TpzJ#j!-i{ZyVe!ANgdgh z%icdx=0LT)3k$=BnZ67RN=$;B_kJIAn(zBbh+&(1o$>4gQQU$zYwbO;Fxb%$*^OV-*>g`F?x&)pMTm^`%JEq zzhJ`qXl347)(x>t3{I=!G^3Qw<6@5pT9y9>_WX16VBWxbBZFZZgEa2} zv4q8pH<)rv7@`|`*%G)nTx7^$G?Qx3J>Z6-$oLn-P5-t>%Afd_>6~t~+WVcCq58M} zX``15Gg40cW@Kwvx$0C0M_is7A*<5&!Z_>E-8l*#0fOuvuZ>R3-(s_jQv_awcquegAB3 zY5KbQ`tu(>?*8xVYp?trz5d`A+k+E{ay6==pWMgGX2%I$KC&E`ZWugW{an^LB{Ts5 DuVwj# literal 0 HcmV?d00001 diff --git a/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/on-equipped-EYES.png b/Resources/Textures/_Sunrise/Clothing/Eyes/Glasses/nvg.rsi/on-equipped-EYES.png new file mode 100644 index 0000000000000000000000000000000000000000..be07c6862005197edff7bd76eedf0102a872d13b GIT binary patch literal 1938 zcmV;D2W|L?P)9I-=y%eeopNa%U5aiH<{|TLf=GuTLjM_322a0Mck!zC{xjP>{ z%uuFeeeg?J7vcjDOHr78-}l*fX5O9W70x;KLkQu&IK(?3Dj-sjZIC5UU62t74I%<3 zz)Em!FeR`F*z;gl00hq)_>OQ;Z2K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-- .../Eye/NightVision/Systems/NVGSystem.cs | 6 +-- .../NightVision/Systems/NightVisionSystem.cs | 9 ++++- .../night-vision-sound-effect_E_minor.ogg | Bin 15478 -> 0 bytes .../Entities/Clothing/Eyes/glasses.yml | 1 - .../_Sunrise/Entities/Clothing/Eyes/nvg.yml | 35 ++++++++++++++---- 7 files changed, 43 insertions(+), 16 deletions(-) delete mode 100644 Resources/Audio/_Sunrise/Misc/night-vision-sound-effect_E_minor.ogg diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs index 8e6d2b98da3..f937a4756a8 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs @@ -11,4 +11,5 @@ public sealed partial class NVGComponent : Component { [DataField] public EntProtoId ActionProto = "NVToggleAction"; [DataField] public EntityUid? ActionContainer; + [DataField] public string LightLayer = "light"; } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs index 68629c656db..99b05e5dbb0 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs @@ -27,9 +27,10 @@ public sealed partial class NightVisionComponent : Component [Access(Other = AccessPermissions.ReadWriteExecute)] public bool GraceFrame = false; - [DataField("playSoundOn")] - public bool PlaySoundOn = true; - public SoundSpecifier OnOffSound = new SoundPathSpecifier("/Audio/_Sunrise/Misc/night-vision-sound-effect_E_minor.ogg"); + [DataField("playSounds")] + public bool PlaySounds = true; + public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_on.ogg"); + public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_off.ogg"); } public sealed partial class NVInstantActionEvent : InstantActionEvent { } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs index 8e9d078f777..a211d4e473b 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs @@ -7,7 +7,7 @@ namespace Content.Shared._Sunrise.Eye.NightVision.Systems; -public sealed class PNVSystem : EntitySystem +public sealed class NVGSystem : EntitySystem { [Dependency] private readonly NightVisionSystem _nightvisionableSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; @@ -43,10 +43,10 @@ private void OnEquipped(EntityUid uid, NVGComponent component, GotEquippedEvent _actionsSystem.AddAction(args.Equipee, ref component.ActionContainer, component.ActionProto); _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(1)); // GCD? - if (nvcomp.PlaySoundOn && nvcomp.IsNightVision) + if (nvcomp.PlaySounds && nvcomp.IsNightVision) { if (_net.IsServer) - _audioSystem.PlayPvs(nvcomp.OnOffSound, uid); + _audioSystem.PlayPvs(nvcomp.SoundOn, uid); } } diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs index f6b8ffbaba1..68605655ee8 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs @@ -39,10 +39,15 @@ private void OnActionToggle(EntityUid uid, NightVisionComponent component, NVIns RaiseLocalEvent(uid, ref changeEv); Dirty(uid, component); _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(1)); - if (component is { IsNightVision: true, PlaySoundOn: true }) + if (component is { IsNightVision: true, PlaySounds: true }) { if (_net.IsServer) - _audioSystem.PlayPvs(component.OnOffSound, uid); + _audioSystem.PlayPvs(component.SoundOn, uid); + } + else if (component is { IsNightVision: false, PlaySounds: true }) + { + if (_net.IsServer) + _audioSystem.PlayPvs(component.SoundOff, uid); } } diff --git a/Resources/Audio/_Sunrise/Misc/night-vision-sound-effect_E_minor.ogg b/Resources/Audio/_Sunrise/Misc/night-vision-sound-effect_E_minor.ogg deleted file mode 100644 index 1a3d86d2a57e0b098552d8165400e7cbc3c32e10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15478 zcmb7rc|28L_y4|wS-OUh@hWqO%tSZyJj;|RnL=bpW#}pinKNaIObKNOsc=(<$~@1M zOp%l^<8NPmp6B&EzdwH8@9(^hbNAWj?7i1sdkyck_Mz|WYz&a#pJS2fZ-K>JPXWP! zxbEqF$<>Egg-|I0-~b*g`iR5dR|tJ#%YPrlmI!zkJN2#cXf*N7e;@Ivzx_zS$L6kH zE+YEg&RBQXOBW7%$7*8Fh@KG@l@^u2@*6o`_H%H(>Wo#rdfnCA^QwpARbK%jb*JE; zimI`)k*0x(roNtnil_focTfAvj+e1c-ku&~IS~-@ zRGlFpoLHJJQSZ7HUJFahb%iVepJAO3R^sw80MGz0K%VA3rS!dSljHa-ts#qG3$b)B zLNxLCJ%ywZ%SEn-V@lr@<~YcYSdak7XdF3LD1(s(*S&vT1oBfaMG6$8Uiu_Z$mY`~ z)`GoDBR8M-&_IboAkRQcuqZFlNK1IY(r3AjY~1JP`7LZHMhSNEugl>)u#gs5dHJxC z*z@21{!R-E@Q@uqGoImdIa_--Tl+7zPFfyAI-c$`!o5b4#^MU5CaV1=re>zr*8U#- z*FE}^Jq9lv7A|;LRC|p6_jx#VECOVolubA(kZ?jEVOk~u9U4}G1eb{{$>xuomWlbM z5yRt};B+(DIU?=pqqO;=EXu=Ippc-6)PSiQk#jdM3~>U>Nz`B-(4>R*chmmMBBdLdQg zvn>zLcG63B_DZzV>l#Yv_WmzUV}_7Jd4Ut*%5+M;f+rV`vp-}D9(K!|L#|Byc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agzYZL(3czZf6c`YY+IxuVWNACmXfshc`D-AxgG7KV8V6dHvoeCki?2jJjFnJv+m7RPd;9bAQ;gePu8Q|B15eM~l^eth(nb zemQqL%pK1ZDiMxOGy;U1g`5s8lda_<P_myo`-~GZk&w z^isX$g8saEp{BxMsT)tz<7(@wz+dzAishKoilc>p%ufl}d~%jMFt`(!$wx1uY}M^y Tqu?>)X%c(0)fH@=;06B&vDrRL diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml index 0c0cf7b3c12..478525713f3 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml @@ -65,7 +65,6 @@ - type: EyeProtection - type: IdentityBlocker coverage: EYES - - type: NVG #Sunrise - night vision - type: entity parent: ClothingEyesBase diff --git a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml index 19b122b119d..e1d49ddf955 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml @@ -1,24 +1,45 @@ - type: entity name: NVD - id: ClothingEyesVision + id: ClothingEyesNVD parent: BaseItem description: Night vision device. Provides an image of the terrain in low-light conditions. components: - type: Item - type: Sprite - sprite: Clothing/Eyes/Glasses/ninjavisor.rsi - state: icon + netsync: false + sprite: _Sunrise/Clothing/Eyes/Glasses/nvg.rsi + layers: + - state: icon + - state: icon-unshaded + shader: unshaded + - state: light-overlay + visible: false + shader: unshaded + map: [ "light" ] - type: Clothing - sprite: Clothing/Eyes/Glasses/ninjavisor.rsi + sprite: _Sunrise/Clothing/Eyes/Glasses/nvg.rsi quickEquip: true + clothingVisuals: + eyes: + - state: off-equipped-EYES + - state: equipped-EYES-unshaded + shader: unshaded slots: [ Eyes ] - type: UseDelay delay: 4 - type: NVG + - type: PointLight + color: green + netsync: false + enabled: false + autoRot: true + radius: 0.5 + energy: 0.5 + - type: Appearance - type: entity - parent: [ClothingEyesVision,ShowSecurityIcons] - id: ClothingEyesVisionNuki - suffix: nuke + parent: [ClothingEyesNVD,ShowSecurityIcons] + id: ClothingEyesNVDSyndicate + suffix: syndicate components: - type: ShowSyndicateIcons \ No newline at end of file From 8151294f790ada50225f7b745123886f9230aa43 Mon Sep 17 00:00:00 2001 From: Rinary Date: Wed, 2 Oct 2024 10:08:33 +0300 Subject: [PATCH 4/8] upd --- .../NightVision/Components/NightVisionComponent.cs | 3 +++ .../_Sunrise/Eye/NightVision/Systems/NVGSystem.cs | 2 +- .../Eye/NightVision/Systems/NightVisionSystem.cs | 5 +++++ Resources/Prototypes/Entities/Mobs/NPCs/animals.yml | 12 ++++++++---- Resources/Prototypes/Entities/Mobs/NPCs/carp.yml | 3 ++- Resources/Prototypes/Entities/Mobs/Player/dragon.yml | 3 ++- 6 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs index 99b05e5dbb0..fa3abf855db 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs @@ -27,6 +27,9 @@ public sealed partial class NightVisionComponent : Component [Access(Other = AccessPermissions.ReadWriteExecute)] public bool GraceFrame = false; + [DataField("changeLight")] + public bool ChangeLight = true; + [DataField("playSounds")] public bool PlaySounds = true; public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_on.ogg"); diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs index a211d4e473b..c91b9b12f25 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs @@ -41,7 +41,7 @@ private void OnEquipped(EntityUid uid, NVGComponent component, GotEquippedEvent _nightvisionableSystem.UpdateIsNightVision(args.Equipee, nvcomp); if (component.ActionContainer == null) _actionsSystem.AddAction(args.Equipee, ref component.ActionContainer, component.ActionProto); - _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(1)); // GCD? + _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); // GCD? if (nvcomp.PlaySounds && nvcomp.IsNightVision) { diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs index 68605655ee8..799b49ea265 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs @@ -1,6 +1,7 @@ using Content.Shared._Sunrise.Eye.NightVision.Components; using Content.Shared.Inventory; using Content.Shared.Actions; +using Content.Shared.Light; using JetBrains.Annotations; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; @@ -13,6 +14,7 @@ public sealed class NightVisionSystem : EntitySystem [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly INetManager _net = default!; + [Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!; public override void Initialize() { @@ -49,6 +51,9 @@ private void OnActionToggle(EntityUid uid, NightVisionComponent component, NVIns if (_net.IsServer) _audioSystem.PlayPvs(component.SoundOff, uid); } + + if (component is { ChangeLight: true }) + _pointLightSystem.SetEnabled(uid, component.IsNightVision); } [PublicAPI] diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 298a0879cfe..2a286404a51 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -67,7 +67,8 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false - type: entity name: bee @@ -1763,7 +1764,8 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false - type: entity parent: MobMouse @@ -2285,7 +2287,8 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false # Code unique spider prototypes or combine them all into one spider and get a # random sprite state when you spawn it. @@ -2925,7 +2928,8 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false - type: entity name: calico cat diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index 1c1ef4c7f3d..140c85a099e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -93,7 +93,8 @@ - type: NightVision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false # Sunrise-End - type: entity diff --git a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml index f419e343b03..ab306c59d2c 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml @@ -157,7 +157,8 @@ - type: NightVision isToggle: true color: "#808080" - playSoundOn: false + playSounds: false + changeLight: false # Sunrise-End - type: entity From dafb7669c3b6254e40230031b5cff4aabf9d72a2 Mon Sep 17 00:00:00 2001 From: Rinary Date: Wed, 2 Oct 2024 16:57:10 +0300 Subject: [PATCH 5/8] =?UTF-8?q?=D1=8F=20=D0=BD=D0=B5=20=D0=B7=D0=BD=D0=B0?= =?UTF-8?q?=D1=8E=20=D0=BF=D0=BE=D1=87=D0=B5=D0=BC=D1=83=20=D1=8D=D1=82?= =?UTF-8?q?=D0=B0=20=D1=85=D1=83=D0=B9=D0=BD=D1=8F=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82,=20=D1=8F=20=D1=83?= =?UTF-8?q?=D0=B6=D0=B5=20=D0=B7=D0=B4=D0=B0=D0=BB=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NightVision/Components/NVGComponent.cs | 21 +++++++- .../Components/NightVisionComponent.cs | 12 ++--- .../Eye/NightVision/Systems/NVGSystem.cs | 48 +++++++++++++++++-- .../NightVision/Systems/NightVisionSystem.cs | 27 +++++------ .../_Sunrise/Entities/Clothing/Eyes/nvg.yml | 2 +- 5 files changed, 81 insertions(+), 29 deletions(-) diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs index f937a4756a8..13db588f67f 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs @@ -1,6 +1,8 @@ using Content.Shared.Actions; +using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Shared._Sunrise.Eye.NightVision.Components; @@ -11,5 +13,22 @@ public sealed partial class NVGComponent : Component { [DataField] public EntProtoId ActionProto = "NVToggleAction"; [DataField] public EntityUid? ActionContainer; - [DataField] public string LightLayer = "light"; + + [DataField("playSounds")] + public bool PlaySounds = true; + public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_on.ogg"); + public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_off.ogg"); +} + +[Serializable, NetSerializable] +public enum NVGVisuals : byte +{ + Light +} + +[Serializable, NetSerializable] +public enum NVGContents : byte +{ + None, + Enabled, } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs index fa3abf855db..d4a3d1cf227 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs @@ -26,14 +26,8 @@ public sealed partial class NightVisionComponent : Component [Access(Other = AccessPermissions.ReadWriteExecute)] public bool GraceFrame = false; - - [DataField("changeLight")] - public bool ChangeLight = true; - - [DataField("playSounds")] - public bool PlaySounds = true; - public SoundSpecifier SoundOn = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_on.ogg"); - public SoundSpecifier SoundOff = new SoundPathSpecifier("/Audio/_Sunrise/Items/night_vision_off.ogg"); } -public sealed partial class NVInstantActionEvent : InstantActionEvent { } \ No newline at end of file +public sealed partial class NVInstantActionEvent : InstantActionEvent { } + +public sealed partial class NVToggleDoAfterEvent : InstantActionEvent { } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs index c91b9b12f25..2a36c1a9c5a 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs @@ -1,9 +1,12 @@ using Content.Shared._Sunrise.Eye.NightVision.Components; using Content.Shared.Inventory; using Content.Shared.Actions; +using Content.Shared.Light; +using Content.Shared.Light.Components; using Content.Shared.Inventory.Events; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; +using Robust.Shared.Log; namespace Content.Shared._Sunrise.Eye.NightVision.Systems; @@ -12,7 +15,11 @@ public sealed class NVGSystem : EntitySystem [Dependency] private readonly NightVisionSystem _nightvisionableSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!; [Dependency] private readonly INetManager _net = default!; + + private EntityUid? _equippedNVGItem; public override void Initialize() { @@ -21,12 +28,45 @@ public override void Initialize() SubscribeLocalEvent(OnEquipped); SubscribeLocalEvent(OnUnequipped); SubscribeLocalEvent>(OnPNVTrySee); + SubscribeLocalEvent(OnNVToggled); } private void OnPNVTrySee(EntityUid uid, NVGComponent component, InventoryRelayedEvent args) { args.Args.Cancel(); } + + private void OnNVToggled(EntityUid uid, NVGComponent component, NVGUpdateVisualsEvent args) + { + var nvcomp = args.nvcomp; + + _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); + + + if (nvcomp.IsNightVision) + { + if (_net.IsServer && component is { PlaySounds: true }) + _audioSystem.PlayPvs(component.SoundOn, uid); + + if (TryComp(component.Owner, out var appearance)) + return; + + _appearance.SetData(component.Owner, NVGVisuals.Light, NVGContents.Enabled, appearance); + } + else if (!nvcomp.IsNightVision) + { + if (_net.IsServer && component is { PlaySounds: true }) + _audioSystem.PlayPvs(component.SoundOff, uid); + + if (TryComp(component.Owner, out var appearance)) + return; + + _appearance.SetData(component.Owner, NVGVisuals.Light, NVGContents.None, appearance); + } + + if (TryComp(uid, out var light)) + _pointLightSystem.SetEnabled(component.Owner, nvcomp.IsNightVision, light); + } private void OnEquipped(EntityUid uid, NVGComponent component, GotEquippedEvent args) { @@ -37,16 +77,18 @@ private void OnEquipped(EntityUid uid, NVGComponent component, GotEquippedEvent return; var nvcomp = EnsureComp(args.Equipee); + + _equippedNVGItem = args.Equipee; _nightvisionableSystem.UpdateIsNightVision(args.Equipee, nvcomp); if (component.ActionContainer == null) _actionsSystem.AddAction(args.Equipee, ref component.ActionContainer, component.ActionProto); - _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); // GCD? + _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(1)); // GCD? - if (nvcomp.PlaySounds && nvcomp.IsNightVision) + if (component.PlaySounds && nvcomp.IsNightVision) { if (_net.IsServer) - _audioSystem.PlayPvs(nvcomp.SoundOn, uid); + _audioSystem.PlayPvs(component.SoundOn, uid); } } diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs index 799b49ea265..d8ee130c481 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs @@ -1,7 +1,6 @@ using Content.Shared._Sunrise.Eye.NightVision.Components; using Content.Shared.Inventory; using Content.Shared.Actions; -using Content.Shared.Light; using JetBrains.Annotations; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; @@ -14,7 +13,6 @@ public sealed class NightVisionSystem : EntitySystem [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly INetManager _net = default!; - [Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!; public override void Initialize() { @@ -40,20 +38,10 @@ private void OnActionToggle(EntityUid uid, NightVisionComponent component, NVIns var changeEv = new NightVisionToggledEvent(component.IsNightVision); RaiseLocalEvent(uid, ref changeEv); Dirty(uid, component); - _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(1)); - if (component is { IsNightVision: true, PlaySounds: true }) - { - if (_net.IsServer) - _audioSystem.PlayPvs(component.SoundOn, uid); - } - else if (component is { IsNightVision: false, PlaySounds: true }) - { - if (_net.IsServer) - _audioSystem.PlayPvs(component.SoundOff, uid); - } + _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); - if (component is { ChangeLight: true }) - _pointLightSystem.SetEnabled(uid, component.IsNightVision); + var updVisEv = new NVGUpdateVisualsEvent(component); + RaiseLocalEvent(uid, ref updVisEv); } [PublicAPI] @@ -81,6 +69,15 @@ public void UpdateIsNightVision(EntityUid uid, NightVisionComponent? component = [ByRefEvent] public record struct NightVisionToggledEvent(bool CanEnableNightVision); +[PublicAPI, ByRefEvent] +public sealed class NVGUpdateVisualsEvent : EntityEventArgs { + public NightVisionComponent nvcomp; + + public NVGUpdateVisualsEvent(NightVisionComponent component) + { + nvcomp = component; + } +} public sealed class CanVisionAttemptEvent : CancellableEntityEventArgs, IInventoryRelayEvent { diff --git a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml index e1d49ddf955..64020ae35cb 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml @@ -15,7 +15,7 @@ - state: light-overlay visible: false shader: unshaded - map: [ "light" ] + map: [ "enum.NVGContents.Enabled" ] - type: Clothing sprite: _Sunrise/Clothing/Eyes/Glasses/nvg.rsi quickEquip: true From b09311ed3b36c64cf9ef2325ab89c36e08903a5f Mon Sep 17 00:00:00 2001 From: Rinary Date: Thu, 3 Oct 2024 16:29:44 +0300 Subject: [PATCH 6/8] fix --- .../Components/NightVisionComponent.cs | 4 +-- .../Eye/NightVision/Systems/NVGSystem.cs | 9 ++++--- .../NightVision/Systems/NightVisionSystem.cs | 27 +++++++++++++++++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs index d4a3d1cf227..c650f49e4ed 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NightVisionComponent.cs @@ -28,6 +28,4 @@ public sealed partial class NightVisionComponent : Component public bool GraceFrame = false; } -public sealed partial class NVInstantActionEvent : InstantActionEvent { } - -public sealed partial class NVToggleDoAfterEvent : InstantActionEvent { } \ No newline at end of file +public sealed partial class NVInstantActionEvent : InstantActionEvent { } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs index 2a36c1a9c5a..e15277b2b9c 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs @@ -28,7 +28,7 @@ public override void Initialize() SubscribeLocalEvent(OnEquipped); SubscribeLocalEvent(OnUnequipped); SubscribeLocalEvent>(OnPNVTrySee); - SubscribeLocalEvent(OnNVToggled); + SubscribeLocalEvent(OnNVGUpdateVisuals); } private void OnPNVTrySee(EntityUid uid, NVGComponent component, InventoryRelayedEvent args) @@ -36,8 +36,9 @@ private void OnPNVTrySee(EntityUid uid, NVGComponent component, InventoryRelayed args.Args.Cancel(); } - private void OnNVToggled(EntityUid uid, NVGComponent component, NVGUpdateVisualsEvent args) + private void OnNVGUpdateVisuals(EntityUid uid, NVGComponent component, NVGUpdateVisualsEvent args) { + Log.Debug("NVG try to update visuals"); var nvcomp = args.nvcomp; _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); @@ -45,7 +46,7 @@ private void OnNVToggled(EntityUid uid, NVGComponent component, NVGUpdateVisuals if (nvcomp.IsNightVision) { - if (_net.IsServer && component is { PlaySounds: true }) + if (_net.IsServer && component.PlaySounds) _audioSystem.PlayPvs(component.SoundOn, uid); if (TryComp(component.Owner, out var appearance)) @@ -55,7 +56,7 @@ private void OnNVToggled(EntityUid uid, NVGComponent component, NVGUpdateVisuals } else if (!nvcomp.IsNightVision) { - if (_net.IsServer && component is { PlaySounds: true }) + if (_net.IsServer && component.PlaySounds) _audioSystem.PlayPvs(component.SoundOff, uid); if (TryComp(component.Owner, out var appearance)) diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs index d8ee130c481..81354bb0fff 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs @@ -11,6 +11,7 @@ namespace Content.Shared._Sunrise.Eye.NightVision.Systems; public sealed class NightVisionSystem : EntitySystem { [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; + [Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly INetManager _net = default!; @@ -40,8 +41,30 @@ private void OnActionToggle(EntityUid uid, NightVisionComponent component, NVIns Dirty(uid, component); _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); - var updVisEv = new NVGUpdateVisualsEvent(component); - RaiseLocalEvent(uid, ref updVisEv); + if (_inventory.TryGetSlotEntity(uid, "eyes", out var eyesEntity)) + { + if (HasComp(eyesEntity)) + { + var updVisEv = new NVGUpdateVisualsEvent(component); + RaiseLocalEvent(eyesEntity, ref updVisEv); + } + } + else if (_inventory.TryGetSlotEntity(uid, "mask", out var maskEntity)) + { + if (HasComp(maskEntity)) + { + var updVisEv = new NVGUpdateVisualsEvent(component); + RaiseLocalEvent(maskEntity, ref updVisEv); + } + } + else if (_inventory.TryGetSlotEntity(uid, "head", out var headEntity)) + { + if (HasComp(headEntity)) + { + var updVisEv = new NVGUpdateVisualsEvent(component); + RaiseLocalEvent(headEntity, ref updVisEv); + } + } } [PublicAPI] From d7a7707ffef798d5d3cfc2f3cdbfc2835ba64f90 Mon Sep 17 00:00:00 2001 From: Rinary Date: Thu, 3 Oct 2024 17:57:53 +0300 Subject: [PATCH 7/8] upd --- .../_Sunrise/Eye/NightVision/NVGSystem.cs | 23 ++++++++++++++ .../Eye/NightVision/NightVisionOverlay.cs | 13 ++++---- .../NightVision/Components/NVGComponent.cs | 7 ----- .../Eye/NightVision/Systems/NVGSystem.cs | 31 ++++++++----------- .../NightVision/Systems/NightVisionSystem.cs | 12 +++---- .../_Sunrise/Entities/Clothing/Eyes/nvg.yml | 4 +-- 6 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 Content.Client/_Sunrise/Eye/NightVision/NVGSystem.cs diff --git a/Content.Client/_Sunrise/Eye/NightVision/NVGSystem.cs b/Content.Client/_Sunrise/Eye/NightVision/NVGSystem.cs new file mode 100644 index 00000000000..683a3ec2886 --- /dev/null +++ b/Content.Client/_Sunrise/Eye/NightVision/NVGSystem.cs @@ -0,0 +1,23 @@ +using Content.Shared._Sunrise.Eye.NightVision.Components; +using Content.Shared._Sunrise.Eye.NightVision.Systems; +using Robust.Client.GameObjects; + +namespace Content.Client._Sunrise.Eye.NightVision; + +public sealed class NVGSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnAfterNVGUpdateVisualsEvent); + } + + private void OnAfterNVGUpdateVisualsEvent(EntityUid uid, NVGComponent component, AfterNVGUpdateVisualsEvent args) + { + var nvcomp = args.nvcomp; + + if (TryComp(component.Owner, out var sprite)) + sprite.LayerSetVisible(NVGVisuals.Light, nvcomp.IsNightVision); + } +} \ No newline at end of file diff --git a/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs b/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs index 202f9a4f249..70b7ef8f74f 100644 --- a/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs +++ b/Content.Client/_Sunrise/Eye/NightVision/NightVisionOverlay.cs @@ -18,8 +18,6 @@ public sealed class NightVisionOverlay : Overlay public override OverlaySpace Space => OverlaySpace.WorldSpace; private readonly ShaderInstance? _greyscaleShader; public Color NightvisionColor = Color.Green; - private EntityUid? _playerEntity; - private EyeComponent? _eyeComponent; private NightVisionComponent _nightvisionComponent = default!; @@ -37,16 +35,17 @@ public NightVisionOverlay(Color color) } protected override bool BeforeDraw(in OverlayDrawArgs args) { - if (_playerEntity == null) - _playerEntity = _playerManager.LocalSession?.AttachedEntity; + var playerEntity = _playerManager.LocalSession?.AttachedEntity; + if (playerEntity == null) + return false; - if (_playerEntity == null || !_entityManager.TryGetComponent(_playerEntity.Value, out _eyeComponent)) + if (!_entityManager.TryGetComponent(playerEntity, out EyeComponent? eyeComp)) return false; - if (args.Viewport.Eye != _eyeComponent?.Eye) + if (args.Viewport.Eye != eyeComp.Eye) return false; - if (!_entityManager.TryGetComponent(_playerEntity.Value, out var nightvisionComp)) + if (!_entityManager.TryGetComponent(playerEntity.Value, out var nightvisionComp)) return false; _nightvisionComponent = nightvisionComp; diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs index 13db588f67f..ce0fb41c45a 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Components/NVGComponent.cs @@ -24,11 +24,4 @@ public sealed partial class NVGComponent : Component public enum NVGVisuals : byte { Light -} - -[Serializable, NetSerializable] -public enum NVGContents : byte -{ - None, - Enabled, } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs index e15277b2b9c..ab403c1cb9d 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NVGSystem.cs @@ -1,12 +1,11 @@ using Content.Shared._Sunrise.Eye.NightVision.Components; using Content.Shared.Inventory; using Content.Shared.Actions; -using Content.Shared.Light; -using Content.Shared.Light.Components; using Content.Shared.Inventory.Events; using Robust.Shared.Audio.Systems; using Robust.Shared.Network; using Robust.Shared.Log; +using JetBrains.Annotations; namespace Content.Shared._Sunrise.Eye.NightVision.Systems; @@ -15,8 +14,6 @@ public sealed class NVGSystem : EntitySystem [Dependency] private readonly NightVisionSystem _nightvisionableSystem = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!; [Dependency] private readonly INetManager _net = default!; private EntityUid? _equippedNVGItem; @@ -38,35 +35,23 @@ private void OnPNVTrySee(EntityUid uid, NVGComponent component, InventoryRelayed private void OnNVGUpdateVisuals(EntityUid uid, NVGComponent component, NVGUpdateVisualsEvent args) { - Log.Debug("NVG try to update visuals"); var nvcomp = args.nvcomp; _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); - if (nvcomp.IsNightVision) { if (_net.IsServer && component.PlaySounds) _audioSystem.PlayPvs(component.SoundOn, uid); - - if (TryComp(component.Owner, out var appearance)) - return; - - _appearance.SetData(component.Owner, NVGVisuals.Light, NVGContents.Enabled, appearance); } else if (!nvcomp.IsNightVision) { if (_net.IsServer && component.PlaySounds) _audioSystem.PlayPvs(component.SoundOff, uid); - - if (TryComp(component.Owner, out var appearance)) - return; - - _appearance.SetData(component.Owner, NVGVisuals.Light, NVGContents.None, appearance); } - if (TryComp(uid, out var light)) - _pointLightSystem.SetEnabled(component.Owner, nvcomp.IsNightVision, light); + var updVisEv = new AfterNVGUpdateVisualsEvent(nvcomp); + RaiseLocalEvent(component.Owner, ref updVisEv); } private void OnEquipped(EntityUid uid, NVGComponent component, GotEquippedEvent args) @@ -111,4 +96,14 @@ private void OnUnequipped(EntityUid uid, NVGComponent component, GotUnequippedEv RemCompDeferred(args.Equipee); } +} + +[PublicAPI, ByRefEvent] +public sealed class AfterNVGUpdateVisualsEvent : EntityEventArgs { + public NightVisionComponent nvcomp; + + public AfterNVGUpdateVisualsEvent(NightVisionComponent component) + { + nvcomp = component; + } } \ No newline at end of file diff --git a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs index 81354bb0fff..3b81a042f16 100644 --- a/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs +++ b/Content.Shared/_Sunrise/Eye/NightVision/Systems/NightVisionSystem.cs @@ -41,28 +41,28 @@ private void OnActionToggle(EntityUid uid, NightVisionComponent component, NVIns Dirty(uid, component); _actionsSystem.SetCooldown(component.ActionContainer, TimeSpan.FromSeconds(15)); + + var updVisEv = new NVGUpdateVisualsEvent(component); + if (_inventory.TryGetSlotEntity(uid, "eyes", out var eyesEntity)) { if (HasComp(eyesEntity)) { - var updVisEv = new NVGUpdateVisualsEvent(component); - RaiseLocalEvent(eyesEntity, ref updVisEv); + RaiseLocalEvent(eyesEntity.Value, ref updVisEv); } } else if (_inventory.TryGetSlotEntity(uid, "mask", out var maskEntity)) { if (HasComp(maskEntity)) { - var updVisEv = new NVGUpdateVisualsEvent(component); - RaiseLocalEvent(maskEntity, ref updVisEv); + RaiseLocalEvent(maskEntity.Value, ref updVisEv); } } else if (_inventory.TryGetSlotEntity(uid, "head", out var headEntity)) { if (HasComp(headEntity)) { - var updVisEv = new NVGUpdateVisualsEvent(component); - RaiseLocalEvent(headEntity, ref updVisEv); + RaiseLocalEvent(headEntity.Value, ref updVisEv); } } } diff --git a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml index 64020ae35cb..dbae86e581d 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Clothing/Eyes/nvg.yml @@ -6,7 +6,6 @@ components: - type: Item - type: Sprite - netsync: false sprite: _Sunrise/Clothing/Eyes/Glasses/nvg.rsi layers: - state: icon @@ -15,7 +14,7 @@ - state: light-overlay visible: false shader: unshaded - map: [ "enum.NVGContents.Enabled" ] + map: [ "enum.NVGVisuals.Light" ] - type: Clothing sprite: _Sunrise/Clothing/Eyes/Glasses/nvg.rsi quickEquip: true @@ -30,7 +29,6 @@ - type: NVG - type: PointLight color: green - netsync: false enabled: false autoRot: true radius: 0.5 From 076fb54ca2b004c35900faf95251ef8bd264fbb5 Mon Sep 17 00:00:00 2001 From: Rinary Date: Thu, 3 Oct 2024 19:03:23 +0300 Subject: [PATCH 8/8] fix --- Resources/Prototypes/Entities/Mobs/NPCs/animals.yml | 8 -------- Resources/Prototypes/Entities/Mobs/NPCs/carp.yml | 2 -- Resources/Prototypes/Entities/Mobs/Player/dragon.yml | 2 -- 3 files changed, 12 deletions(-) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 2a286404a51..0deea695d92 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -67,8 +67,6 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSounds: false - changeLight: false - type: entity name: bee @@ -1764,8 +1762,6 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSounds: false - changeLight: false - type: entity parent: MobMouse @@ -2287,8 +2283,6 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSounds: false - changeLight: false # Code unique spider prototypes or combine them all into one spider and get a # random sprite state when you spawn it. @@ -2928,8 +2922,6 @@ - type: NightVision #Sunrise - Night vision isToggle: true color: "#808080" - playSounds: false - changeLight: false - type: entity name: calico cat diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index 140c85a099e..0cc28f390d5 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -93,8 +93,6 @@ - type: NightVision isToggle: true color: "#808080" - playSounds: false - changeLight: false # Sunrise-End - type: entity diff --git a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml index ab306c59d2c..57468c0d800 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/dragon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/dragon.yml @@ -157,8 +157,6 @@ - type: NightVision isToggle: true color: "#808080" - playSounds: false - changeLight: false # Sunrise-End - type: entity