diff --git a/Extras/MoreProfileOptions/MU3.CustomUI/patch_MU3UICounter.cs b/Extras/MoreProfileOptions/MU3.CustomUI/patch_MU3UICounter.cs index 52f1134..1ed6ec5 100644 --- a/Extras/MoreProfileOptions/MU3.CustomUI/patch_MU3UICounter.cs +++ b/Extras/MoreProfileOptions/MU3.CustomUI/patch_MU3UICounter.cs @@ -1,20 +1,22 @@ using MU3.Mod; +using MU3.User; namespace MU3.CustomUI; class patch_MU3UICounter: MU3UICounter { + public bool isRatingDisplay { get; set; } + protected extern void orig_calcNumFiguresFloat(double value); protected new void calcNumFiguresFloat(double value) { orig_calcNumFiguresFloat(value); - if(isDispSuffix) { + if(isRatingDisplay) { var b = CustomRating.GetSuffix(); if(b != 0) { pushFigureFront(b); } } } - public bool isDispSuffix { get; set; } protected void pushFigureFront(byte c) { for(int i = numFigures_; i > 0; --i) { figures_[i] = figures_[i - 1]; @@ -22,4 +24,13 @@ class patch_MU3UICounter: MU3UICounter { figures_[0] = c; numFigures_ += 1; } + + public extern void orig_set_Counter(double value); + public void set_Counter(double value) { + if(isRatingDisplay && CustomRating.IsEnabled()) { + orig_set_Counter(UserUtil.toRatingFloat(CustomRating.Get())); + } else { + orig_set_Counter(value); + } + } } diff --git a/Extras/MoreProfileOptions/MU3.SceneObject/patch_ANM_CMN_User.cs b/Extras/MoreProfileOptions/MU3.SceneObject/patch_ANM_CMN_User.cs index ad6284f..ab0ee52 100644 --- a/Extras/MoreProfileOptions/MU3.SceneObject/patch_ANM_CMN_User.cs +++ b/Extras/MoreProfileOptions/MU3.SceneObject/patch_ANM_CMN_User.cs @@ -7,9 +7,8 @@ class patch_ANM_CMN_UserDeta_01: ANM_CMN_UserDeta_01 { public extern void orig_setUserDetail(); public new void setUserDetail() { - rating.isDispSuffix = true; + rating.isRatingDisplay = true; orig_setUserDetail(); rating.setForceDirty(); - } } diff --git a/Extras/MoreProfileOptions/MU3.User/patch_UserUtil.cs b/Extras/MoreProfileOptions/MU3.User/patch_UserUtil.cs deleted file mode 100644 index fab8ee5..0000000 --- a/Extras/MoreProfileOptions/MU3.User/patch_UserUtil.cs +++ /dev/null @@ -1,16 +0,0 @@ -using MonoMod; -using MU3.Mod; - -namespace MU3.User; - -[MonoModPatch("global::MU3.User.UserUtil")] -public static class patch_UserUtil { - public extern static float orig_toRatingFloat(int rating); - public static float toRatingFloat(int rating) { - if(CustomRating.IsEnabled()) { - return orig_toRatingFloat(CustomRating.Get()); - } else { - return orig_toRatingFloat(rating); - } - } -} \ No newline at end of file diff --git a/Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs b/Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs index 45d5211..c2578c8 100644 --- a/Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs +++ b/Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs @@ -21,15 +21,17 @@ class patch_UIResultBattlePoint: UIResultBattlePoint { public extern void orig_initTechRating(PlayInfo playInfo); public new void initTechRating(PlayInfo playInfo) { + counterScore_.isRatingDisplay = true; + if(!CustomRating.IsEnabled()) { orig_initTechRating(playInfo); return; } + int prevRating = ((patch_SessionResult)playInfo.sessionResult).prevCustomRating; int rating1 = CustomRating.Get(); hideScore_?.SetActive(false); - counterScore_.isDispSuffix = true; counterScore_.Counter = (double)UserUtil.toRatingFloat(rating1); int ratingPatternNo = UserUtil.toRatingPatternNo(rating1); counterScore_.SpriteIndex = ratingPatternNo; @@ -42,15 +44,15 @@ class patch_UIResultBattlePoint: UIResultBattlePoint { } else if(0 < rating2) { disable(counterScoreMinus_); if(counterScorePlus_ != null) { - counterScorePlus_.Counter = rating2 * 0.01f + 1E-05f; + counterScorePlus_.Counter = UserUtil.toRatingFloat(rating2); } animator_.SetInteger(Sys.Const.AnimatorID_State, 0); } else { disable(counterScorePlus_); if(counterScoreMinus_ != null) { - counterScoreMinus_.Counter = rating2 * 0.01f + 1E-05f; + counterScoreMinus_.Counter = UserUtil.toRatingFloat(rating2); } - animator_.SetInteger(MU3.Sys.Const.AnimatorID_State, 1); + animator_.SetInteger(Sys.Const.AnimatorID_State, 1); } animator_.SetTrigger(Sys.Const.AnimatorID_In); } diff --git a/Mu3Mods.csproj b/Mu3Mods.csproj index 3f86268..2ae5ae5 100644 --- a/Mu3Mods.csproj +++ b/Mu3Mods.csproj @@ -2,7 +2,7 @@ net35 7EVENDAYS⇔HOLIDAYS - 3.0.0 + 3.0.0.1 true latest x64