From 8f3c42e61b4d7ac95fb74dc0e958f38e38d69b0b Mon Sep 17 00:00:00 2001 From: Christian Kosman Date: Wed, 9 Mar 2022 12:17:11 -0800 Subject: [PATCH 1/4] NoteRecorder fixes --- IForgor/Recorders/NoteRecorder.cs | 26 ++++++++++++++------------ IForgor/manifest.json | 4 ++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/IForgor/Recorders/NoteRecorder.cs b/IForgor/Recorders/NoteRecorder.cs index ad137c4..de48dcb 100644 --- a/IForgor/Recorders/NoteRecorder.cs +++ b/IForgor/Recorders/NoteRecorder.cs @@ -32,24 +32,26 @@ public void Dispose() { } private void OnNoteWasCut(NoteController noteController, in NoteCutInfo noteCutInfo) { - ProcessNote(noteController.noteData, noteCutInfo); + if (noteController.noteData == null || noteController.noteData.colorType == ColorType.None) return; + if (!noteCutInfo.saberTypeOK) + ProcessNote(noteController.noteData, null); + else + ProcessNote(noteController.noteData, noteCutInfo); } private void OnNoteWasMissed(NoteController noteController) { ProcessNote(noteController.noteData, null); } private void ProcessNote(NoteData noteData, NoteCutInfo? noteCutInfo) { - if (noteData != null) { - if (noteData.colorType == ColorType.ColorA) - { - noteAData = noteData; - noteACutInfo = noteCutInfo; - } - else if (noteData.colorType == ColorType.ColorB) - { - noteBData = noteData; - noteBCutInfo = noteCutInfo; - } + if (noteData.colorType == ColorType.ColorA) + { + noteAData = noteData; + noteACutInfo = noteCutInfo; + } + else if (noteData.colorType == ColorType.ColorB) + { + noteBData = noteData; + noteBCutInfo = noteCutInfo; } } } diff --git a/IForgor/manifest.json b/IForgor/manifest.json index 25c02e5..e1afb5c 100644 --- a/IForgor/manifest.json +++ b/IForgor/manifest.json @@ -3,9 +3,9 @@ "id": "I Forgor", "name": "IForgor", "author": "ckosmic", - "version": "1.1.1", + "version": "1.2.1", "description": "A mod that displays the last notes and saber angles before you paused in the pause menu.", - "gameVersion": "1.19.0", + "gameVersion": "1.20.0", "dependsOn": { "BSIPA": "^4.2.1", "SiraUtil": "^3.0.0" From 490781e2b37c13719b3d7b05f127139f9371221e Mon Sep 17 00:00:00 2001 From: Christian Kosman Date: Wed, 9 Mar 2022 15:01:33 -0800 Subject: [PATCH 2/4] Add burst slider/angled dot notes support --- IForgor/Plugin.cs | 8 +++++++- IForgor/Recorders/NoteRecorder.cs | 8 +++++++- IForgor/Resources/layers.psd | Bin 56482 -> 70220 bytes IForgor/Resources/slider.png | Bin 0 -> 4055 bytes IForgor/Resources/slider_dots.png | Bin 0 -> 5461 bytes IForgor/UI/AssetLoader.cs | 4 ++++ IForgor/UI/UIGroup.cs | 14 ++++++++++++-- 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 IForgor/Resources/slider.png create mode 100644 IForgor/Resources/slider_dots.png diff --git a/IForgor/Plugin.cs b/IForgor/Plugin.cs index 173147a..68b5a4b 100644 --- a/IForgor/Plugin.cs +++ b/IForgor/Plugin.cs @@ -1,5 +1,7 @@ using IForgor.Installers; using IPA; +using IPA.Logging; +using ModestTree; using SiraUtil.Zenject; namespace IForgor @@ -7,14 +9,18 @@ namespace IForgor [Plugin(RuntimeOptions.DynamicInit), NoEnableDisable] public class Plugin { + internal static Logger Log { get; private set; } + [Init] /// /// Called when the plugin is first loaded by IPA (either when the game starts or when the plugin is enabled if it starts disabled). /// [Init] methods that use a Constructor or called before regular methods like InitWithConfig. /// Only use [Init] with one Constructor. /// - public void Init(Zenjector zenject) + public void Init(Logger logger, Zenjector zenject) { + Log = logger; + zenject.Install(Location.App); zenject.Install(Location.StandardPlayer); } diff --git a/IForgor/Recorders/NoteRecorder.cs b/IForgor/Recorders/NoteRecorder.cs index de48dcb..5b34d73 100644 --- a/IForgor/Recorders/NoteRecorder.cs +++ b/IForgor/Recorders/NoteRecorder.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using UnityEngine; using Zenject; namespace IForgor.Recorders @@ -32,11 +34,15 @@ public void Dispose() { } private void OnNoteWasCut(NoteController noteController, in NoteCutInfo noteCutInfo) { - if (noteController.noteData == null || noteController.noteData.colorType == ColorType.None) return; + if (noteController.noteData.colorType == ColorType.None) return; if (!noteCutInfo.saberTypeOK) + { ProcessNote(noteController.noteData, null); + } else + { ProcessNote(noteController.noteData, noteCutInfo); + } } private void OnNoteWasMissed(NoteController noteController) { ProcessNote(noteController.noteData, null); diff --git a/IForgor/Resources/layers.psd b/IForgor/Resources/layers.psd index f767d14eb5c0d30510f3a3b80da70aa41a36a716..f64032deb524cf623c66ff7b314482720944c279 100644 GIT binary patch delta 6945 zcmeHLX-rgC6h8O8VMYlGiZ(8^j8$W5oia1*Q%Y+CRt2LC#?~d#8D>xu3JPd6Hhr;L zN^PsyXP{KOh^=4=h(3*Cv@UT=+f<~5f;Co~;1*;67Z%0S^X`C45zD6iQQn*L?pf|V z_dEC8^Iqm=7l}WAt4Y^~PqK%+K52?Z1L~#o5di21TsNBQye`+yx$bv($mZ-7^Yf3{ zOZRcxDAi_JwPSL%;B7V-{SC&@>81cnK#0Yk#1J`3^nav&y|`>tfZ5*>YYMd)jKS17 zBrd>V2n`??L4kH-aH!dCG})|*L9!L!cwT zZm?>G`t#wWx&l2a0s zlEdAp!@Vmk$sT8U-8%naEt$C?exW>D^NM^#JM6`W`-J&DW(LJiH`9-Sk``1hdWm&B z+3o)ik_lO6#S?X-`qae zsxf{^!a}kPBGN(hJ$!mFxvC&OAvuX`nt1E-B;J4dLc1yx^^?y>ZT9BCvU$bCElXNN zdN29S3Eqn5v_V=I>H~y2O$;7JCNohD(JwBrhMFZC`&F5`Hp)x(T>a8u4_Z+5?(^WSEMB{s zNtZy!#?4F3FR85Cf(KDoS6PyuI&U1i1Xn>EXv?{>3HPFSCD-PC6|R9OOfGE7!rdq~ z6;2keffEGH-0}?Ei9-22jgyv(O{my_g~%!<)KIFK&-b5U0kS-wI=Buj#|4J4iW1apy{^J#!aV1p|@ z#vGbra3eGU)1F*|TalgAHjxDKNBAAWh961jb5KK`f#DO51nRYWxO;$(+yS ze6IR3_N?c8y(euF+baATnT@#ZoZAjebaJjn1i$z3D+E7~VmT8F>AYPByLh_`PV@FO zT;lCTsN-$jO8gRglB71y;7eHf^hk0|*27V?393E+AU)M++XgGOhpeac|B_0n$8+5| z;9=d_&5AMWC)RcccMd^!0H|Z7?mFn^c&TS!2puk+)>VGuJGgbCc3P>^h}&`0ML+-d z{6F*PzM;;P;f5RG^_vV15bR6PGl#78s*ZhzR%Wz(09d+4cLIf zjTL=s>F9yIR-B2qkrlsoO@1ZkxuKOHc%(LNL7_3#qY^FvoA?Kv7yL1)S>BxEEg#9z z4=n{Y@s$$tGMR`*C1ni~dAbH1;of zeXh5>Gxs@ZA28FgdODLZl~Ip9pz}y;L~Km+_?5(!Pn@LgPf`T#LPW+XCpu4MLHOsL8_2S>zms%;q&;=W_GrshNdowy24SNr`~VPDjSyWy{6RV= z`K=mRnQ(?n5K)B?*}`WKpV7h>6Mw3OcM@OY;;&*`9X!}Kllo?!0gC@1aOV?T1DH^D zZ(0HrO@OATfDQm`B%qr(>XsPx@)*?kHd1_>czkN?WfXfEk6m4x$jstetS!!rgJUwvOk&TV>X6x}>L5X6>fyE!zE0 qqRbRiRsoaKw^hmCY&+XRyX5nE%alV$gF0?dvc5a(qbxfzcG%zF{ovdH delta 343 zcmX@Jgk{lA<_QW~F5fJiJbhVI89+b)Od=6rITetAncc>?cTAJnm}MqsFl&M7b|Ap=4WNw?8&l_X>tTt;^qn5f%=;tS>0gXe8J9;QJVv17}z8OFpq^12*7+@FrSTq z5lC}SHgYi6^#romz@lIRBmu$u1vWSA>0k!3 TIS))`-kf}UzszR&AG%Ti%!^vD diff --git a/IForgor/Resources/slider.png b/IForgor/Resources/slider.png new file mode 100644 index 0000000000000000000000000000000000000000..0aa3006c098ad6ba1b8f19f4296f106374f24389 GIT binary patch literal 4055 zcmcIn3s4m29pCdsq7gb{n>dljdR&N^y0?#e?&^6l9>P^l8N>)St?cdY!Irz*&F%t+ z+Nf!!7A;l}8%5E^v7&7=l}3Xx8aVHyM1Y2%srGx9PoMlG8M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^#k{|RQgeHw{9GcrS)t$G4J$7q$=;P!_W6|xV<{9;^XD4TBtkXoKsiCd> zWgRrFcST3jk>tp&<>kxIwPV-cUkkl7B_UmX>E|8dx%M$R!^AH`Z-*p({o*qpUx!|_ z&riK^y0c+bE0s3>q~^ZT9I|E~Bsh6^d3oub6tZc`rJ+jxLF$7y$pDR+$w?gxy-$XA z7O%K^N;6nb4S@G=wyz?XK&Ay+`QL`VXd3=MP5V{s4B7t^$W&$NpNgSvp0w8Tq=8f6 z>pQ4T9c#WgNn28N^4p+j=J8SOu^g0EeDgWT%=y_dYUN`m(<&b@I0sO4ci7DHzp(FZ TeXU*n>Fvy(?fByhC9nP$2>@AN literal 0 HcmV?d00001 diff --git a/IForgor/Resources/slider_dots.png b/IForgor/Resources/slider_dots.png new file mode 100644 index 0000000000000000000000000000000000000000..3db18f17bcad2221351baede1f5126d8decf38ca GIT binary patch literal 5461 zcmeHLdsGuw8lNP*&k_8we45d>yy_XV2!GWbWMiyWjWS z@BY5uy(cT;VkddI4|9hg$ZK*;R6GPxK$8Nwxq!z!&6hIp=%Ir0uA|_iy&diQYkYuMy1X5;LC_`w#fq`^VM=%WOX-X|_2w`^H#X;NF&0;dTA-dEM zW`xZlBT*E`n4r>-3|wG;$VOAP}$+l!c-&K)~88rH(MbO6{m#3sIz2 zqEV=I3YC&!vq*?l8M+WAh_q)3>1u~rrPiJ%kT8~kP_x)Uh;2#TK&ixmQ)g(>x}8fU zEHaHuCzU!az_J}!kR_4G0e`01^mGSWtBcMA5!u)FOtdy3OHH!kNv$eFBO#+RfyYt3 zfoXN|N!bp3_q0$okI2;hqjTYprk?Z9H?!?0afD@G$f%@ zX%bYbv|jGS^~T0P(IAxZ_H2bxs?uu%YzwzfAfpH!8N##?2}Xip6iYzZID+DA9(ctO zqz5Vj)RYoB!U0BMgaadj1U47v@^KV_5&jdfN~(}$y%Z{y;4+maod6rBNGIeZORbc5 zdlQN9$x5w`P)f+jQ6WqaYLG%9#YwJ=$Hh<%%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@l7U6GT#5v*=qm`K~lvv&>|4hH2rN|fo0+Tx%wzgJ`GFX>O zAu&!b{F>XyRhOO*^jcK{Exgz+G~O`2*PaCt0Gb;45c#O)a=*e8OT&b;{xwegsQsIA z6`xklDG2FejOe_U<^J)>4VtOV)cO;}S;;gjUM~t=Z{(Qo8h&JX0WG~A@aL-RQ``7L zUj2WM|A+Uu)t7eASYnK}V99vL0e(kU&?3=xv>>*`RK2;a4Vtv%^bW)AH!N=IvWAsh zHy6epfyGzd&MVFtXn1o&!u&NZ$Dw1GtI*?i($Q5O=EbYR6N{UVXB6%p-dRzcyY
  • i3!!g#U!u{`j069UD~|nf#Cc0BSS=9smFU literal 0 HcmV?d00001 diff --git a/IForgor/UI/AssetLoader.cs b/IForgor/UI/AssetLoader.cs index 7e7fb7b..65025a7 100644 --- a/IForgor/UI/AssetLoader.cs +++ b/IForgor/UI/AssetLoader.cs @@ -8,8 +8,10 @@ namespace IForgor.UI internal class AssetLoader { public Sprite spr_bloq { get; } + public Sprite spr_slider { get; } public Sprite spr_arrow { get; } public Sprite spr_dot { get; } + public Sprite spr_slider_dots { get; } public Sprite spr_cut_arrow { get; } public Sprite spr_saber_bg { get; } public Sprite spr_saber_fg { get; } @@ -19,8 +21,10 @@ internal class AssetLoader public AssetLoader() { spr_bloq = LoadSpriteFromResource("IForgor.Resources.bloq.png"); + spr_slider = LoadSpriteFromResource("IForgor.Resources.slider.png"); spr_arrow = LoadSpriteFromResource("IForgor.Resources.arrow.png"); spr_dot = LoadSpriteFromResource("IForgor.Resources.dot.png"); + spr_slider_dots = LoadSpriteFromResource("IForgor.Resources.slider_dots.png"); spr_cut_arrow = LoadSpriteFromResource("IForgor.Resources.cut_arrow.png"); spr_saber_bg = LoadSpriteFromResource("IForgor.Resources.saber_bg.png"); spr_saber_fg = LoadSpriteFromResource("IForgor.Resources.saber_fg.png"); diff --git a/IForgor/UI/UIGroup.cs b/IForgor/UI/UIGroup.cs index dbce54e..9767005 100644 --- a/IForgor/UI/UIGroup.cs +++ b/IForgor/UI/UIGroup.cs @@ -79,6 +79,7 @@ public void Initialize() { public void SetNoteData(NoteData noteData) { this.noteData = noteData; + bloqImage.sprite = _assetLoader.spr_bloq; directionImage.sprite = _assetLoader.spr_arrow; RectTransform bloqRootTransform = bloqImage.rectTransform; @@ -108,8 +109,17 @@ public void SetNoteData(NoteData noteData) { bloqRootTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 135f)); break; case NoteCutDirection.Any: - bloqRootTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, 0f)); - directionImage.sprite = _assetLoader.spr_dot; + bloqRootTransform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, noteData.cutDirectionAngleOffset)); + if (noteData.gameplayType == NoteData.GameplayType.BurstSliderElement) + { + bloqImage.sprite = _assetLoader.spr_slider; + directionImage.sprite = _assetLoader.spr_slider_dots; + } + else + { + bloqImage.sprite = _assetLoader.spr_bloq; + directionImage.sprite = _assetLoader.spr_dot; + } break; } } From 2c731f40cf4300c8567d66016d1dc78ec0e6bac7 Mon Sep 17 00:00:00 2001 From: Christian Kosman Date: Wed, 9 Mar 2022 15:04:46 -0800 Subject: [PATCH 3/4] Cleanup --- IForgor/Recorders/NoteRecorder.cs | 2 +- IForgor/UI/UIGroup.cs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/IForgor/Recorders/NoteRecorder.cs b/IForgor/Recorders/NoteRecorder.cs index 5b34d73..1e74be2 100644 --- a/IForgor/Recorders/NoteRecorder.cs +++ b/IForgor/Recorders/NoteRecorder.cs @@ -34,7 +34,7 @@ public void Dispose() { } private void OnNoteWasCut(NoteController noteController, in NoteCutInfo noteCutInfo) { - if (noteController.noteData.colorType == ColorType.None) return; + if (noteController.noteData == null || noteController.noteData.colorType == ColorType.None) return; if (!noteCutInfo.saberTypeOK) { ProcessNote(noteController.noteData, null); diff --git a/IForgor/UI/UIGroup.cs b/IForgor/UI/UIGroup.cs index 9767005..0b73fdd 100644 --- a/IForgor/UI/UIGroup.cs +++ b/IForgor/UI/UIGroup.cs @@ -115,11 +115,6 @@ public void SetNoteData(NoteData noteData) { bloqImage.sprite = _assetLoader.spr_slider; directionImage.sprite = _assetLoader.spr_slider_dots; } - else - { - bloqImage.sprite = _assetLoader.spr_bloq; - directionImage.sprite = _assetLoader.spr_dot; - } break; } } From 4b703445457897179410ccbeded5146225819a9b Mon Sep 17 00:00:00 2001 From: Christian Kosman Date: Wed, 16 Mar 2022 23:43:30 -0700 Subject: [PATCH 4/4] Bump version --- IForgor/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IForgor/manifest.json b/IForgor/manifest.json index e1afb5c..2a7a05f 100644 --- a/IForgor/manifest.json +++ b/IForgor/manifest.json @@ -3,7 +3,7 @@ "id": "I Forgor", "name": "IForgor", "author": "ckosmic", - "version": "1.2.1", + "version": "1.3.0", "description": "A mod that displays the last notes and saber angles before you paused in the pause menu.", "gameVersion": "1.20.0", "dependsOn": {