From 5e52be676f9bc7259baeee9c2d8c4d50debd0e2f Mon Sep 17 00:00:00 2001 From: Benjamin Odom Date: Wed, 5 Jun 2024 22:57:55 -0500 Subject: [PATCH] [QoL] Add Time of Day Widget to Arena Flyout (#1846) * Time of Day Sample * Add Proper Time of Day Tracking * Add Settings --- public/images/ui/dawn_icon.png | Bin 581 -> 0 bytes public/images/ui/dawn_icon_bg.png | Bin 0 -> 186 bytes public/images/ui/dawn_icon_fg.png | Bin 0 -> 347 bytes public/images/ui/dawn_icon_mg.png | Bin 0 -> 273 bytes public/images/ui/day_icon.png | Bin 593 -> 0 bytes public/images/ui/day_icon_bg.png | Bin 0 -> 186 bytes public/images/ui/day_icon_fg.png | Bin 0 -> 398 bytes public/images/ui/day_icon_mg.png | Bin 0 -> 245 bytes public/images/ui/dusk_icon.png | Bin 534 -> 0 bytes public/images/ui/dusk_icon_bg.png | Bin 0 -> 186 bytes public/images/ui/dusk_icon_fg.png | Bin 0 -> 388 bytes public/images/ui/dusk_icon_mg.png | Bin 0 -> 235 bytes public/images/ui/legacy/dawn_icon.png | Bin 327 -> 0 bytes public/images/ui/legacy/dawn_icon_bg.png | Bin 0 -> 150 bytes public/images/ui/legacy/dawn_icon_fg.png | Bin 0 -> 249 bytes public/images/ui/legacy/dawn_icon_mg.png | Bin 0 -> 239 bytes public/images/ui/legacy/day_icon.png | Bin 285 -> 0 bytes public/images/ui/legacy/day_icon_bg.png | Bin 0 -> 186 bytes public/images/ui/legacy/day_icon_fg.png | Bin 0 -> 255 bytes public/images/ui/legacy/day_icon_mg.png | Bin 0 -> 151 bytes public/images/ui/legacy/dusk_icon.png | Bin 300 -> 0 bytes public/images/ui/legacy/dusk_icon_bg.png | Bin 0 -> 150 bytes public/images/ui/legacy/dusk_icon_fg.png | Bin 0 -> 252 bytes public/images/ui/legacy/dusk_icon_mg.png | Bin 0 -> 219 bytes public/images/ui/legacy/night_icon.png | Bin 288 -> 0 bytes public/images/ui/legacy/night_icon_bg.png | Bin 0 -> 150 bytes public/images/ui/legacy/night_icon_fg.png | Bin 0 -> 240 bytes public/images/ui/legacy/night_icon_mg.png | Bin 0 -> 120 bytes public/images/ui/night_icon.png | Bin 686 -> 0 bytes public/images/ui/night_icon_bg.png | Bin 0 -> 186 bytes public/images/ui/night_icon_fg.png | Bin 0 -> 440 bytes public/images/ui/night_icon_mg.png | Bin 0 -> 271 bytes src/battle-scene-events.ts | 14 ++ src/battle-scene.ts | 3 + src/loading-scene.ts | 16 +- src/phases.ts | 4 +- src/system/settings/settings.ts | 24 +++ src/ui/arena-flyout.ts | 30 +--- src/ui/enums/ease-type.ts | 15 ++ src/ui/time-of-day-widget.ts | 172 ++++++++++++++++++++++ 40 files changed, 251 insertions(+), 27 deletions(-) delete mode 100644 public/images/ui/dawn_icon.png create mode 100644 public/images/ui/dawn_icon_bg.png create mode 100644 public/images/ui/dawn_icon_fg.png create mode 100644 public/images/ui/dawn_icon_mg.png delete mode 100644 public/images/ui/day_icon.png create mode 100644 public/images/ui/day_icon_bg.png create mode 100644 public/images/ui/day_icon_fg.png create mode 100644 public/images/ui/day_icon_mg.png delete mode 100644 public/images/ui/dusk_icon.png create mode 100644 public/images/ui/dusk_icon_bg.png create mode 100644 public/images/ui/dusk_icon_fg.png create mode 100644 public/images/ui/dusk_icon_mg.png delete mode 100644 public/images/ui/legacy/dawn_icon.png create mode 100644 public/images/ui/legacy/dawn_icon_bg.png create mode 100644 public/images/ui/legacy/dawn_icon_fg.png create mode 100644 public/images/ui/legacy/dawn_icon_mg.png delete mode 100644 public/images/ui/legacy/day_icon.png create mode 100644 public/images/ui/legacy/day_icon_bg.png create mode 100644 public/images/ui/legacy/day_icon_fg.png create mode 100644 public/images/ui/legacy/day_icon_mg.png delete mode 100644 public/images/ui/legacy/dusk_icon.png create mode 100644 public/images/ui/legacy/dusk_icon_bg.png create mode 100644 public/images/ui/legacy/dusk_icon_fg.png create mode 100644 public/images/ui/legacy/dusk_icon_mg.png delete mode 100644 public/images/ui/legacy/night_icon.png create mode 100644 public/images/ui/legacy/night_icon_bg.png create mode 100644 public/images/ui/legacy/night_icon_fg.png create mode 100644 public/images/ui/legacy/night_icon_mg.png delete mode 100644 public/images/ui/night_icon.png create mode 100644 public/images/ui/night_icon_bg.png create mode 100644 public/images/ui/night_icon_fg.png create mode 100644 public/images/ui/night_icon_mg.png create mode 100644 src/ui/enums/ease-type.ts create mode 100644 src/ui/time-of-day-widget.ts diff --git a/public/images/ui/dawn_icon.png b/public/images/ui/dawn_icon.png deleted file mode 100644 index e04e6024aa0b097dff236c4b4a1ca56e24bd4531..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0oqAKK~y+Tjgw7F z+)xyT-z3KIYf#5lXmn6ysHiY4rh?E`L2PFyYFF*bh4TYusNk>AAK=EFZrluX;ihf` z1(niL3$4;BiYZmckCExL(ZrmSA2^(Ia_4>TxpNZL^A#r@6w^~U;zcVG<9rvtKhI!m^CQgsn#9(Ms+}HZe|Bkp5;l z?D7Z;eB|sVj34tXc1T;M;l9cQAI1Bag46iy?X37hBJJ$XACoZf2^!sk5V`=D1CXre ThUT}f00000NkvXXu0mjfz();` diff --git a/public/images/ui/dawn_icon_bg.png b/public/images/ui/dawn_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..2983c2744a3b8a3f53da20bf5a3b94fe9dc46e29 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(BIR=F~q_@d4Y(5Q>MrU?b1{A8p5nQ&Yn9M z(67|st!(9B#&J#|%$Vl@Pa@N24TgkZkFBz74(k@&U|r0{GpmGwSwuB8rQx(fN^b}g b4-bRRAsMmjTW3rI8qMJ8>gTe~DWM4fL!dHc literal 0 HcmV?d00001 diff --git a/public/images/ui/dawn_icon_fg.png b/public/images/ui/dawn_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..e6c195bd371e5198ee92f02d39d7cbd12acfc71f GIT binary patch literal 347 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en@Pns|V~B-+atcG!|NsA+H7o+2PjnM)Xqp{A zujy(tgR=4*PD6&4t2>tdb1sw%;o@^hGN_zUW#DkRXQ80%0iGslr>-;!2Q!vDhLFAt z2IB@!sf3>biIW`cBJ?e{9cJ**7oOs4CZWQ{@YktCNS%G}T0G|-o%ViVaFWB+4q4(9ag)fdi`Z9UK*CoAQHq?JV+xqEd2~ZX5ku~W+ zin}DpFZe$kFnIYhegX<}7I;J!GcfQS0%1l`4X*~EV3MbcV~9p@?72Xp1_ch5fF(gs z{;~Jn)y;l#c;fS}s617JX!aW+(O1QG{C>DVeu0Aef%RIQLN7e8S!`HP-lW8;oTQ=j z!Z1CA?Z86)2bpR``zPHGs1b`;n`gr*V1I1wwa}U7K_A)tngvw$0BvLNboFyt=akR{ E0Fkj~JOBUy literal 0 HcmV?d00001 diff --git a/public/images/ui/day_icon.png b/public/images/ui/day_icon.png deleted file mode 100644 index fe41acffd9cfb2096a87a86cadbbc7f57ea136a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 593 zcmV-X0Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T|WK~y+TV`M-B ztSZKZK&lVI!vICU@0{(2vcUju0J28!qzndI{}2!p4i0Zz!?1PU3@8s_5ZC~iX6L9B z2G{TikPuF=d*up-z02l+m|#PgK`dq=spIIHRrx+L_(&aP&=;4!@HjxU~y#~ z9fto*Yz+4=pL75B?s+3K)OPpC(q;yB4i>N?kY?*wa~Zg=En#4Lc#J`k;UmLWAuYHe zqOz(Chu1FyS^S9!$Ok(e8CVLRVc>eTn}PBDTQCN(L1M@Ns;3WR0E4+lAc!If!1RC( zKnKU)nlOA5b7lB1C=A9RHb@K`z-qwlPy7r=#gZAm*q4AYhz%0M22c$6^zkQ@1uTAV>bk`KybV0iKT6T{M@FByKWEnr~y$4~@GiL%E3nKe8a zSQMK{C;?r5t0)5r9S0kT0@ f09+#kFfafBum-cC{w~Yc00000NkvXXu0mjf3PJjV diff --git a/public/images/ui/day_icon_bg.png b/public/images/ui/day_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..9028e0309f7d26c386f1e8fb1a89c3ca1ec2834c GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBuf-vKbiP>*~g8rT^jv*HQ$qPgboH9iMw*9?WuOZA@Qh6$I zg}dN^rGl~w(k$r$t0mbI+6)>iMHn_{F1f|WtPmdXrYVq_&DW}dv1^i%(ScNfO>SC@ bY-|h@lVrqpmbFd+8qMJ8>gTe~DWM4f)!s8C literal 0 HcmV?d00001 diff --git a/public/images/ui/day_icon_fg.png b/public/images/ui/day_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..523f7b1be7e3043b445bea6dc53bf6cd1606cd56 GIT binary patch literal 398 zcmV;90df9`P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940V7F7K~y+Tos%(7 z0znXkXAdPYoOVPi={$OBt^5O)hLT)P5I zHrNMrY8$rctJ=BApnXTGb;Ac7y?l7}Z%4;TyI=kK87dgXjYO-?$Zc&=FpCGz$m&6l zyOh71PaBKqB1&$l(!54V%la9QyU?#wqL(LHd}P)@y6{avXms@XO{@8g{?duP-N-k; smY8538UYak5d+RZ3g8=s_(BWO8rl_+IyPPD!TNS%G|s0G|-oY1dxVAA7Os@q^dj*1Wph`suLm_f1+r$(wab1we|UB*-uLKLjw` zYu+0P6yq%Lh%9Dc;5!Jyj5{V~zXb{gdAc};Xau*OCGucnxrM|2gfPA{fli+6QwzLJ9ZqxBTZQa> eIMe>b9)@fCnGbH`Ff#_4&fw|l=d#Wzp$PydrdNId literal 0 HcmV?d00001 diff --git a/public/images/ui/dusk_icon.png b/public/images/ui/dusk_icon.png deleted file mode 100644 index e848fa313459ce44809049ffe80f8a0ce298da7c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 534 zcmV+x0_pvUP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0jo(wK~y+Tjg!kt z!%z^0|J-OmisGeGQ9-*EM2ZVVUA73~6Da5-vnB%CR}p2kH{Vt{ur@=C(bPW6(Vf9i9@dVitK?fa!ot~o5cNzb&O5LAnTt{_I8`Z zN{_#$v(qOw5eAaX)x}(sSbhN3mLW~YSr`-(^9y~#(dk_Bs{hw|P%QU4W8>NHLMEq9 z#M(HZPe>e;dtJ!xd|RlpHY~O)oZz6`>!u@vc64MwYc|U^P&?wFoSqRf9Sk}oP1H0V z>aWhJA>3>#BVC4ZdjE|?tswrcuH*3Cgs6yJl-lL77`>jjlBOe1qm9p5)?WB YKRnE+uEonOR{#J207*qoM6N<$g63c9P5=M^ diff --git a/public/images/ui/dusk_icon_bg.png b/public/images/ui/dusk_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..57d22ec2b21bb8dbf52ab55fb766c3a3d9ddfce5 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1en(BIR=F~q_@d4Y(5Q>Ms=1y}ysPw8Y5*;Ssj z!d>vdQbAb-X_j<>)sk!pZ3c~%A`BZem)zoGRtOJx(-g?e=4;i!*fq(>=s>E#CO0ic bHZ}&~Su$dYJ|R9pqZvG1{an^LB{Ts5SSc|E literal 0 HcmV?d00001 diff --git a/public/images/ui/dusk_icon_fg.png b/public/images/ui/dusk_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..e0ca1bce79b04db334d537124cfda67f6e906a34 GIT binary patch literal 388 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBufiR<}hF1engQTa6V~B-+a>@awD=jLTMA1r2eggjwIu&;9lP;7-~9^0CqFcf~Xu%vj#2 z3#6x&i#IP?Xv8dh+?*|K*>r_OffZA(op{r*DUiW~-@+$hoAc35wu0~jbDa1XUZyr} zI?2|2gdsW1^AfY*s`iin|NrN)QF`@%>!Ea`J?%$cg(=)CO`mmGMSxv$MT+bR;glct zf=BjkGn)JG^z7L^39@$%W&J<;b(6#o)l!ETHZjIDgI?}Ed+R1Xe7ZD~C;tAuB$nL_ zEDq~{ZezK?`|I;V{lmwfhaZ@Aa2xYm_T3CO1q6EY1UL?uG%ceF_}Fc~;IFr*1s fHQelC;Nf8~Qpsm-;;`Tbh8%;ZtDnm{r-UW|jDC<= literal 0 HcmV?d00001 diff --git a/public/images/ui/dusk_icon_mg.png b/public/images/ui/dusk_icon_mg.png new file mode 100644 index 0000000000000000000000000000000000000000..4e6a880b37fb6531b577159342108f698b7e9258 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}f0G|-or)};prn#B|(0{|G|Jk%A45@ zD8yOd5n0T@z;_6Q8AUa`8i0a6o-U3d8o{;a0=XCzIamUWKmT*TmuWIlY*v4foJwcB zraPx#|4BqaR5(v#WWWyo;}B;=7e^NWYdloaj-u}J-REF__WDUMakxHY1O7joJQ=R> z&ciQoHp~E+0MsC`UYG$WnqdlwF$7`2;>ipQA5eXWZa`p;D#Q9Iw~@WW2r}URGmvH& zKr#fM3t(XaHsHth5U}=lZ|ot)Kn)?ufPjM6V7<@Yy#v!z;-j#}1hOC~Fu^YHP`8I` zM2}~XLFlmn3k$dbdZM~G(hWp7-Nq5CJlp_FWm~v{ub&_Rz|ALsqA5nt5X@h4={#Kg z_}#;ZbbxFKUgtn1L7GA72%ZioH2`GVe_{=R*$#FBnsdRK370`ojVSssvM1C)qO&sq ZXBK-4;%UQk00000NkvXXu0mjf008%?gY^Ia diff --git a/public/images/ui/legacy/dawn_icon_bg.png b/public/images/ui/legacy/dawn_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..87c4d75cd942ab4e9b8d900562ff63a360331d00 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`v7RoDAr^wk2@3=ak}lhu8oakR z`}pSTWP>YdQ9TLMhQ`DROPC|} x2+fvDSShfC{~hZLMFpwpjwhrhUJX9N#&G1cj9B*HERYKrJYD@<);T3K0RX_uFbe_gEm^MciGyA@fK8$JGwS{xt$Bo!-j3juvb+;9Zi@CdqcqS(N$2M%i~<6S!9- zH?;4vwP=~Yx0>DT@1@tLkFdO`-@t8ixB(7Jty z_s6f7%rnlORc}ao@o{(i!MIH!+gg`jdR)$bSeUO%v0^UsRF+IPPxce*6pk}YkXsbX xxLNiMi^=T+{|-NuTHz*A+fpRE@Xl!lh7=`x?n|PJF9V&=;OXk;vd$@?2>_pPV0Zuk literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/dawn_icon_mg.png b/public/images/ui/legacy/dawn_icon_mg.png new file mode 100644 index 0000000000000000000000000000000000000000..442cb1b674c8ad854c662d79a7189833115e242d GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`+dN$yLo5W76BY;N0 literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/day_icon.png b/public/images/ui/legacy/day_icon.png deleted file mode 100644 index 310ba50dcf306bc4fb559b4a96ae9da8d53bc40b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 285 zcmV+&0pk9NP)Px#*GWV{R5(v#WWWNXm0bQ~6MuSd4Lki*gF1_po zv-QNwQM@3Ur2*!@o^}H+etu0q13Vg$4I$`x1_lO@W>8|HjsdXLNUSShwuAIx%}lrq j0%^pVnNUKXgzO9eAn$t--D6GR00000NkvXXu0mjfSW0br diff --git a/public/images/ui/legacy/day_icon_bg.png b/public/images/ui/legacy/day_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..3db0dab4589360e5f7e76862f65e1ddc973d85b1 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL4Qvd#}Etu~ bJUk2wPsxbQN#?ol-tu literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/day_icon_fg.png b/public/images/ui/legacy/day_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..657c82e5dbda1b7653c66acf9dad30c5887bff99 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|wtKobhFJI~ zryO8fGBxI3vT%J>KELuVi!KHqWwTa=-WyLIvNfm_X1Z(_jnuut5M*+gr}^c=I}AlR z?q#gXS9vCMZ~v{I`+-$1?l|}PL>I|z2UvDD-25gU!*^3)f`VPMLzN+q!#3752|ecr zY!YoEhrY&E-Q-Mr-8p^njtcMT<~O|UQllTP{PJg39b1Kol5~@<n`M{qXQv%X74T5zPf{7F`TJ$y57S%>MG^hQ~D=oyglH&2Xv5d-1YO8eNSWrS%W< zGDzD(vPBlle_=Ij|i#u**btO<>n`h6yTW&MwS94z}&R_d(F-aBRZD zWY+CZA1$s<*tSn5tKlnKmr(;xNB4f_@ajjW4B0A7l%$(3pY;$@IJ-c^QbO8@`> diff --git a/public/images/ui/legacy/dusk_icon_bg.png b/public/images/ui/legacy/dusk_icon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..7610a2e67f8ea404dcf0545b488240feeb3ec807 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`v7RoDAr^wk2@3=ak}lg{4S8*E z_VLZ->jqaAb3C}zkteaqv4FYbDvvQw8i%k?LyXiLrl8#RNVX!@qk0mi4ULHtmM}-` y5t=QRuu@f{7F`TJ%4V$!y*HjbWNT0<%yii<8mW7OA;{z~PxH%#cNmIt z+{;*%ukr*4UT<=jl~*@Eypw&o;Ub>sgr?X7C)FF3*o_$2K1i}$>b}Y_AuWlgQ95B^ zGVAt_j}})aY}+?SsB87LdH0yU1#MW#e`mG&I+^4KcjZlrHzpbGlJGFrco=w`AtFoV znyA5T$6p)L)MD5gO_~^r<{gx}z9c1`;mH47|69f(i-GQE@O1TaS?83{#J~Ump$1%% literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/dusk_icon_mg.png b/public/images/ui/legacy/dusk_icon_mg.png new file mode 100644 index 0000000000000000000000000000000000000000..dc603f8ca79a7289b34f1daae36664014d831ef0 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`i#%N%Lo5W76C^SYc=RxTbG`B3 zJ?#0GM+!0Wa~jt$9CN$QATNm?*D4{E8`N*3>UkCVVy02sxXc;wZ>i zv?0^&ddC{}<>ColA2QiiDrPX8QHU||Wb0u2VBBC}bRe5S@p&`PAr6<6%NK91H?L{o zZcJi0a`1Ii_4IcKO&=sBNHBOO?l5UMlDMt;Muf1C2a~1kfkRA@${xI-3=CG=6s-Tg SH%$S$mci52&t;ucLK6VZcTq_gEm^MciGSA)Dt@#=%wfcl)GfSj5P0V*Fp28MEV1r=new{GEUmjtP4WmwjJPUkYp-i46Ji6XKZ6^@Aq^6xNdE! zn%?`xENVAc7wx%ZA)0K=A?CNBKp}(SL`uxMMrj504BqmC-|hJi|i{S)h5Yi+`_5mpvPOrxN_TJ9p;@)N#Z?H2M!o`Tw>IT x>-6Q{5W;bZ{X5ec0fFAr3MsuOUTG#VGj#5j5tFm%@&H=I;OXk;vd$@?2>^3iE}j4Y literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/night_icon_fg.png b/public/images/ui/legacy/night_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..737cca3305e838b29ff0485279af7021b994b5a7 GIT binary patch literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|R(QHNhFJI~ zrySt>_gEm^MciGyA@fK8$JGwS{xt$Bo!-j3juvb+;9Zi@CdqcqS(N$2M%i~<6S!9- zH)yOk@w&42-=8Tn82<8?H3GSP8R-cM2?B}C4r-4LS&|y&EHJ&pdjG!-!)D7!k${-5 zFa8E@nEr%i?Zdd*FaI=b9xjk*x@_+uq;OW_CBse8ClU;ooVREvY-^s|kS2Yjen$-R l)s98|0qc~fR7*1SFk5mfmG+ka-OS+W>gTe~DWQph0RR^{SeO6+ literal 0 HcmV?d00001 diff --git a/public/images/ui/legacy/night_icon_mg.png b/public/images/ui/legacy/night_icon_mg.png new file mode 100644 index 0000000000000000000000000000000000000000..f5fdff51cc87e6bf6f7f3eebe5428b3891c8b3a2 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`_MR?|Ar^wk2@*mNKDQ_TfB8Hh zX4~HSy)W!Jf}aTGuo*lw7QAVC!{qU0?`X@E>4Epva+W0vFWz_7#IP{KLYCnfhkE;( TgU2|5MlpE0`njxgN@xNAOcW?i literal 0 HcmV?d00001 diff --git a/public/images/ui/night_icon.png b/public/images/ui/night_icon.png deleted file mode 100644 index 1782303f73d853f90b38fe94dff34cdbe9593faf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 686 zcmV;f0#W^mP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940z*keK~y+Tjgw7G z6HySy|Ld})w8R#%SgRFjfY?|yp%)U2(Sz(wC4rj>Q9P?`ylB+mO%thJ^lH3#FkHPE zB|S)uDORQ0sA(!32Q^=kB% zz9&q9=0tnD6KxJJ-a|*^` z>BVPrF;*py@$r+mGkqFD%NB}#SuCNWvlYI6H(o{(;9ZF9F~_S*QY&V{*YWWFEG1i5 zZ{oN|i^COp*N`Y_`p0NnrZMZH%57 zqHp9#76)o7aCBJ4V97bNM6umd$gO1LPIos7`Jc3U1Ag=m?4`9@Eh3jmLumY_#G#R6aCvuP_R#~brD%h+ zHK^|B*$1!B&t2G^HnJRVw@=>z>BS`3#C#NAQ*4k{*dXzMX!8_`xvZ?RpW^6nu?efw zvREavE56FP3X*SMQ!+zoRP<5iurAEY)ZC3hI{D5>bP0l+XkKO5QTv literal 0 HcmV?d00001 diff --git a/public/images/ui/night_icon_fg.png b/public/images/ui/night_icon_fg.png new file mode 100644 index 0000000000000000000000000000000000000000..78741584312c1ed37ad11a1a2a23330ed1af4409 GIT binary patch literal 440 zcmV;p0Z0CcP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0ZmCnK~y+TV`PAW z|Ns9(Squz3eCh}e68Q4zCR{xuBb*7*48q*JYX3o)nN6(_Dg_51F_=6|Js2Qs#-oym8?M!_nP`z+Pg4NHH)F(hLHV>PoVJ z)N~C44Tt~;5bJbw0P_mi0H_$r0Hhc01)%@_L;Xk+02`1|+4BF__a7i;Cdr0S>IFt_ zF}43vTJ{XiE*?-}V2m(vz+M17YIoQ;_Clxy)&Rv3=9g&@=zA4 zVX19f^O*nrma;3<>gICf(E%lRNjg~URs5LQ;-WJ1P925fxv^i4;gM;xy11L z;W3B-AQylD$Q3X{U;y2)@9)1cJbZcwt{Ef-CXfvQ(dY(&08AqYz%>Is0MC;!LqGs# i5ITTqgaJlIMg{NS%G}T0G|+783i8&?S$T`2R;0&{{R1f^w9$`G27#3o=)rCKYh|UpsE+oIBozb z?vfzCV4wmhVDR#1`~(!{EbxddW?)>$04j2JLz3 z>AF*EGi$XMH>`E}Ak#26q+-9tl)~2TKbPbUb~7v!WnJhuTW>GWE(T9mKbLh*2~7a# Cs$)9< literal 0 HcmV?d00001 diff --git a/src/battle-scene-events.ts b/src/battle-scene-events.ts index 74fac97d2b7..aaeb590f8ba 100644 --- a/src/battle-scene-events.ts +++ b/src/battle-scene-events.ts @@ -20,6 +20,11 @@ export enum BattleSceneEventType { */ BERRY_USED = "onBerryUsed", + /** + * Triggers at the start of each new encounter + * @see {@linkcode EncounterPhaseEvent} + */ + ENCOUNTER_PHASE = "onEncounterPhase", /** * Triggers on the first turn of a new battle * @see {@linkcode TurnInitEvent} @@ -85,6 +90,15 @@ export class BerryUsedEvent extends Event { } } +/** + * Container class for {@linkcode BattleSceneEventType.ENCOUNTER_PHASE} events + * @extends Event +*/ +export class EncounterPhaseEvent extends Event { + constructor() { + super(BattleSceneEventType.ENCOUNTER_PHASE); + } +} /** * Container class for {@linkcode BattleSceneEventType.TURN_INIT} events * @extends Event diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 53b58cb8a41..38882cf3e68 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -60,6 +60,7 @@ import {UiInputs} from "./ui-inputs"; import { MoneyFormat } from "./enums/money-format"; import { NewArenaEvent } from "./battle-scene-events"; import ArenaFlyout from "./ui/arena-flyout"; +import { EaseType } from "./ui/enums/ease-type"; export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; @@ -100,6 +101,8 @@ export default class BattleScene extends SceneBase { public reroll: boolean = false; public showMovesetFlyout: boolean = true; public showArenaFlyout: boolean = true; + public showTimeOfDayWidget: boolean = true; + public timeOfDayAnimation: EaseType = EaseType.NONE; public showLevelUpStats: boolean = true; public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1"; public enableMoveInfo: boolean = true; diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 34b2f9d6be7..522962d5829 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -96,10 +96,18 @@ export class LoadingScene extends SceneBase { this.loadImage("type_tera", "ui"); this.loadAtlas("type_bgs", "ui"); - this.loadImage("dawn_icon", "ui"); - this.loadImage("day_icon", "ui"); - this.loadImage("dusk_icon", "ui"); - this.loadImage("night_icon", "ui"); + this.loadImage("dawn_icon_fg", "ui"); + this.loadImage("dawn_icon_mg", "ui"); + this.loadImage("dawn_icon_bg", "ui"); + this.loadImage("day_icon_fg", "ui"); + this.loadImage("day_icon_mg", "ui"); + this.loadImage("day_icon_bg", "ui"); + this.loadImage("dusk_icon_fg", "ui"); + this.loadImage("dusk_icon_mg", "ui"); + this.loadImage("dusk_icon_bg", "ui"); + this.loadImage("night_icon_fg", "ui"); + this.loadImage("night_icon_mg", "ui"); + this.loadImage("night_icon_bg", "ui"); this.loadImage("pb_tray_overlay_player", "ui"); this.loadImage("pb_tray_overlay_enemy", "ui"); diff --git a/src/phases.ts b/src/phases.ts index 406d47cff22..e9becbe485d 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -62,7 +62,7 @@ import { Abilities } from "./data/enums/abilities"; import * as Overrides from "./overrides"; import { TextStyle, addTextObject } from "./ui/text"; import { Type } from "./data/type"; -import { BerryUsedEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./battle-scene-events"; +import { BerryUsedEvent, EncounterPhaseEvent, MoveUsedEvent, TurnEndEvent, TurnInitEvent } from "./battle-scene-events"; export class LoginPhase extends Phase { @@ -741,6 +741,8 @@ export class EncounterPhase extends BattlePhase { this.scene.initSession(); + this.scene.eventTarget.dispatchEvent(new EncounterPhaseEvent()); + // Failsafe if players somehow skip floor 200 in classic mode if (this.scene.gameMode.isClassic && this.scene.currentBattle.waveIndex > 200) { this.scene.unshiftPhase(new GameOverPhase(this.scene)); diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 81971a08d69..b2175275eef 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -7,6 +7,7 @@ import { PlayerGender } from "#app/data/enums/player-gender"; import { CandyUpgradeNotificationChangedEvent } from "#app/battle-scene-events.js"; import { MoneyFormat } from "../../enums/money-format"; import SettingsUiHandler from "#app/ui/settings/settings-ui-handler"; +import { EaseType } from "#app/ui/enums/ease-type.js"; const MUTE = "Mute"; const VOLUME_OPTIONS = new Array(11).fill(null).map((_, i) => i ? (i * 10).toString() : MUTE); @@ -54,6 +55,8 @@ export const SettingKeys = { Move_Animations: "MOVE_ANIMATIONS", Show_Moveset_Flyout: "SHOW_MOVESET_FLYOUT", Show_Arena_Flyout: "SHOW_ARENA_FLYOUT", + Show_Time_Of_Day_Widget: "SHOW_TIME_OF_DAY_WIDGET", + Time_Of_Day_Animation: "TIME_OF_DAY_ANIMATION", Show_Stats_on_Level_Up: "SHOW_LEVEL_UP_STATS", EXP_Gains_Speed: "EXP_GAINS_SPEED", EXP_Party_Display: "EXP_PARTY_DISPLAY", @@ -205,6 +208,21 @@ export const Setting: Array = [ default: 1, type: SettingType.ACCESSIBILITY }, + { + key: SettingKeys.Show_Time_Of_Day_Widget, + label: "Show Time of Day Widget", + options: OFF_ON, + default: 1, + type: SettingType.ACCESSIBILITY, + requireReload: true, + }, + { + key: SettingKeys.Time_Of_Day_Animation, + label: "Time of Day Animation", + options: ["Bounce", "Back"], + default: 0, + type: SettingType.ACCESSIBILITY + }, { key: SettingKeys.Show_Stats_on_Level_Up, label: "Show Stats on Level Up", @@ -365,6 +383,12 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): case SettingKeys.Show_Arena_Flyout: scene.showArenaFlyout = Setting[index].options[value] === "On"; break; + case SettingKeys.Show_Time_Of_Day_Widget: + scene.showTimeOfDayWidget = Setting[index].options[value] === "On"; + break; + case SettingKeys.Time_Of_Day_Animation: + scene.timeOfDayAnimation = Setting[index].options[value] === "Bounce" ? EaseType.BOUNCE : EaseType.BACK; + break; case SettingKeys.Show_Stats_on_Level_Up: scene.showLevelUpStats = Setting[index].options[value] === "On"; break; diff --git a/src/ui/arena-flyout.ts b/src/ui/arena-flyout.ts index 77996625fed..e854de2006b 100644 --- a/src/ui/arena-flyout.ts +++ b/src/ui/arena-flyout.ts @@ -1,4 +1,3 @@ -import * as Utils from "../utils"; import { addTextObject, TextStyle } from "./text"; import BattleScene from "#app/battle-scene.js"; import { ArenaTagSide } from "#app/data/arena-tag.js"; @@ -8,7 +7,8 @@ import { addWindow, WindowVariant } from "./ui-theme"; import { ArenaEvent, ArenaEventType, TagAddedEvent, TagRemovedEvent, TerrainChangedEvent, WeatherChangedEvent } from "#app/field/arena-events.js"; import { BattleSceneEventType, TurnEndEvent } from "#app/battle-scene-events.js"; import { ArenaTagType } from "#app/data/enums/arena-tag-type.js"; -import { TimeOfDay } from "#app/data/enums/time-of-day.js"; +import TimeOfDayWidget from "./time-of-day-widget"; +import * as Utils from "../utils"; /** Enum used to differentiate {@linkcode Arena} effects */ enum ArenaEffectType { @@ -60,8 +60,7 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { /** The {@linkcode Phaser.GameObjects.Text} that goes inside of the header */ private flyoutTextHeader: Phaser.GameObjects.Text; - /** The {@linkcode Phaser.GameObjects.Sprite} that represents the current time of day */ - private timeOfDayIcon: Phaser.GameObjects.Sprite; + private timeOfDayWidget: TimeOfDayWidget; /** The {@linkcode Phaser.GameObjects.Text} header used to indicate the player's effects */ private flyoutTextHeaderPlayer: Phaser.GameObjects.Text; @@ -82,7 +81,6 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { // Stores callbacks in a variable so they can be unsubscribed from when destroyed private readonly onNewArenaEvent = (event: Event) => this.onNewArena(event); - private readonly onTurnInitEvent = (event: Event) => this.onTurnInit(event); private readonly onTurnEndEvent = (event: Event) => this.onTurnEnd(event); private readonly onFieldEffectChangedEvent = (event: Event) => this.onFieldEffectChanged(event); @@ -117,10 +115,8 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { this.flyoutContainer.add(this.flyoutTextHeader); - this.timeOfDayIcon = this.scene.add.sprite((this.flyoutWidth / 2) + (this.flyoutWindowHeader.displayWidth / 2), 0, "dawn_icon").setOrigin(); - this.timeOfDayIcon.setVisible(false); - - this.flyoutContainer.add(this.timeOfDayIcon); + this.timeOfDayWidget = new TimeOfDayWidget(this.scene, (this.flyoutWidth / 2) + (this.flyoutWindowHeader.displayWidth / 2)); + this.flyoutContainer.add(this.timeOfDayWidget); this.flyoutTextHeaderPlayer = addTextObject(this.scene, 6, 5, "Player", TextStyle.SUMMARY_BLUE); this.flyoutTextHeaderPlayer.setFontSize(54); @@ -172,18 +168,9 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { // Subscribes to required events available on game start this.battleScene.eventTarget.addEventListener(BattleSceneEventType.NEW_ARENA, this.onNewArenaEvent); - this.battleScene.eventTarget.addEventListener(BattleSceneEventType.TURN_INIT, this.onTurnInitEvent); this.battleScene.eventTarget.addEventListener(BattleSceneEventType.TURN_END, this.onTurnEndEvent); } - private setTimeOfDayIcon() { - this.timeOfDayIcon.setTexture(TimeOfDay[this.battleScene.arena.getTimeOfDay()].toLowerCase() + "_icon"); - } - - private onTurnInit(event: Event) { - this.setTimeOfDayIcon(); - } - private onNewArena(event: Event) { this.fieldEffectInfo.length = 0; @@ -192,8 +179,6 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { this.battleScene.arena.eventTarget.addEventListener(ArenaEventType.TERRAIN_CHANGED, this.onFieldEffectChangedEvent); this.battleScene.arena.eventTarget.addEventListener(ArenaEventType.TAG_ADDED, this.onFieldEffectChangedEvent); this.battleScene.arena.eventTarget.addEventListener(ArenaEventType.TAG_REMOVED, this.onFieldEffectChangedEvent); - - this.setTimeOfDayIcon(); } /** @@ -360,17 +345,18 @@ export default class ArenaFlyout extends Phaser.GameObjects.Container { * Animates the flyout to either show or hide it by applying a fade and translation * @param visible Should the flyout be shown? */ - toggleFlyout(visible: boolean): void { + public toggleFlyout(visible: boolean): void { this.scene.tweens.add({ targets: this.flyoutParent, x: visible ? this.anchorX : this.anchorX - this.translationX, duration: Utils.fixedInt(125), ease: "Sine.easeInOut", alpha: visible ? 1 : 0, + onComplete: () => this.timeOfDayWidget.parentVisible = visible, }); } - destroy(fromScene?: boolean): void { + public destroy(fromScene?: boolean): void { this.battleScene.eventTarget.removeEventListener(BattleSceneEventType.NEW_ARENA, this.onNewArenaEvent); this.battleScene.eventTarget.removeEventListener(BattleSceneEventType.TURN_END, this.onTurnEndEvent); diff --git a/src/ui/enums/ease-type.ts b/src/ui/enums/ease-type.ts new file mode 100644 index 00000000000..fbe06fd536d --- /dev/null +++ b/src/ui/enums/ease-type.ts @@ -0,0 +1,15 @@ +export enum EaseType { + NONE, + LINEAR = "Linear", + QUADRATIC = "Quad", + CUBIC = "Cubic", + QUARTIC = "Quart", + QUINTIC = "Quint", + SINUSOIDAL = "Sine", + EXPONENTIAL = "Expo", + CIRCULAR = "Circ", + ELASTIC = "Elastic", + BACK = "Back", + BOUNCE = "Bounce", + STEPPED = "Stepped", +} diff --git a/src/ui/time-of-day-widget.ts b/src/ui/time-of-day-widget.ts new file mode 100644 index 00000000000..fd5a8b0b15e --- /dev/null +++ b/src/ui/time-of-day-widget.ts @@ -0,0 +1,172 @@ +import * as Utils from "../utils"; +import BattleScene from "#app/battle-scene.js"; +import { TimeOfDay } from "#app/data/enums/time-of-day.js"; +import { BattleSceneEventType } from "#app/battle-scene-events.js"; +import { EaseType } from "./enums/ease-type"; + +/** A small self contained UI element that displays the time of day as an icon */ +export default class TimeOfDayWidget extends Phaser.GameObjects.Container { + /** An alias for the scene typecast to a {@linkcode BattleScene} */ + private battleScene: BattleScene; + + /** The {@linkcode Phaser.GameObjects.Sprite} that represents the foreground of the current time of day */ + private readonly timeOfDayIconFgs: Phaser.GameObjects.Sprite[] = new Array(2); + /** The {@linkcode Phaser.GameObjects.Sprite} that represents the middle-ground of the current time of day */ + private readonly timeOfDayIconMgs: Phaser.GameObjects.Sprite[] = new Array(2); + /** The {@linkcode Phaser.GameObjects.Sprite} that represents the background of the current time of day */ + private readonly timeOfDayIconBgs: Phaser.GameObjects.Sprite[] = new Array(2); + + /** An array containing all timeOfDayIcon objects for easier iteration */ + private timeOfDayIcons: Phaser.GameObjects.Sprite[]; + + /** A map containing all timeOfDayIcon arrays with a matching string key for easier iteration */ + private timeOfDayIconPairs: Map = new Map([ + ["bg", this.timeOfDayIconBgs], + ["mg", this.timeOfDayIconMgs], + ["fg", this.timeOfDayIconFgs],]); + + /** The current time of day */ + private currentTime: TimeOfDay = TimeOfDay.ALL; + /** The previous time of day */ + private previousTime: TimeOfDay = TimeOfDay.ALL; + + // Subscribes to required events available on game start + private readonly onEncounterPhaseEvent = (event: Event) => this.onEncounterPhase(event); + + private _parentVisible: boolean; + /** Is the parent object visible? */ + public get parentVisible(): boolean { + return this._parentVisible; + } + /** On set, resumes any paused tweens if true */ + public set parentVisible(visible: boolean) { + if (visible && !this._parentVisible) { // Only resume the tweens if parent is newly visible + this.timeOfDayIcons?.forEach( + icon => this.scene.tweens.getTweensOf(icon).forEach( + tween => tween.resume())); + } + + this._parentVisible = visible; + } + + constructor(scene: Phaser.Scene, x: number = 0, y: number = 0) { + super(scene, x, y); + this.battleScene = this.scene as BattleScene; + + this.setVisible(this.battleScene.showTimeOfDayWidget); + if (!this.battleScene.showTimeOfDayWidget) { + return; + } + + // Initialize all sprites + this.timeOfDayIconPairs.forEach( + (icons, key) => { + for (let i = 0; i < icons.length; i++) { + icons[i] = this.scene.add.sprite(0, 0, "dawn_icon_" + key).setOrigin(); + } + }); + // Store a flat array of all icons for later + this.timeOfDayIcons = [this.timeOfDayIconBgs, this.timeOfDayIconMgs, this.timeOfDayIconFgs].flat(); + this.add(this.timeOfDayIcons); + + this.battleScene.eventTarget.addEventListener(BattleSceneEventType.ENCOUNTER_PHASE, this.onEncounterPhaseEvent); + } + + /** + * Creates a tween animation based on the 'Back' ease algorithm + * @returns an array of all tweens in the animation + */ + private getBackTween(): Phaser.Types.Tweens.TweenBuilderConfig[] { + const rotate = { + targets: [this.timeOfDayIconMgs[0], this.timeOfDayIconMgs[1]], + angle: "+=90", + duration: Utils.fixedInt(1500), + ease: "Back.easeOut", + paused: !this.parentVisible, + }; + const fade = { + targets: [this.timeOfDayIconBgs[1], this.timeOfDayIconMgs[1], this.timeOfDayIconFgs[1]], + alpha: 0, + duration: Utils.fixedInt(500), + ease: "Linear", + paused: !this.parentVisible, + }; + + return [rotate, fade]; + } + + /** + * Creates a tween animation based on the 'Bounce' ease algorithm + * @returns an array of all tweens in the animation + */ + private getBounceTween(): Phaser.Types.Tweens.TweenBuilderConfig[] { + const bounce = { + targets: [this.timeOfDayIconMgs[0], this.timeOfDayIconMgs[1]], + angle: "+=90", + duration: Utils.fixedInt(2000), + ease: "Bounce.easeOut", + paused: !this.parentVisible, + }; + const fade = { + targets: [this.timeOfDayIconBgs[1], this.timeOfDayIconMgs[1], this.timeOfDayIconFgs[1]], + alpha: 0, + duration: Utils.fixedInt(800), + ease: "Linear", + paused: !this.parentVisible, + }; + + return [bounce, fade]; + } + + /** Resets all icons to the proper depth, texture, and alpha so they are ready to tween */ + private resetIcons() { + this.moveBelow(this.timeOfDayIconBgs[0], this.timeOfDayIconBgs[1]); + this.moveBelow(this.timeOfDayIconMgs[0], this.timeOfDayIconBgs[1]); + this.moveBelow(this.timeOfDayIconFgs[0], this.timeOfDayIconFgs[1]); + + this.timeOfDayIconPairs.forEach( + (icons, key) => { + icons[0].setTexture(TimeOfDay[this.currentTime].toLowerCase() + "_icon_" + key); + icons[1].setTexture(TimeOfDay[this.previousTime].toLowerCase() + "_icon_" + key); + }); + this.timeOfDayIconMgs[0].setRotation(-90 * (3.14/180)); + + this.timeOfDayIcons.forEach(icon => icon.setAlpha(1)); + } + + /** Adds the proper tween for all icons */ + private tweenTimeOfDayIcon() { + this.scene.tweens.killTweensOf(this.timeOfDayIcons); + + this.resetIcons(); + + // Tween based on the player setting + (this.battleScene.timeOfDayAnimation === EaseType.BACK ? this.getBackTween() : this.getBounceTween()) + .forEach(tween => this.scene.tweens.add(tween)); + + // Swaps all elements of the icon arrays by shifting the first element onto the end of the array + // This ensures index[0] is always the new time of day icon and index[1] is always the current one + this.timeOfDayIconPairs.forEach( + icons => icons.push(icons.shift())); + } + + /** + * Grabs the current time of day from the arena and calls {@linkcode tweenTimeOfDayIcon} + * @param event {@linkcode Event} being sent + */ + private onEncounterPhase(event: Event) { + const newTime = this.battleScene.arena.getTimeOfDay(); + + if (this.currentTime === newTime) { + return; + } + + this.currentTime = newTime; + this.previousTime = this.currentTime - 1; + if (this.previousTime < TimeOfDay.DAWN) { + this.previousTime = TimeOfDay.NIGHT; + } + + this.tweenTimeOfDayIcon(); + } +}