1
0
forked from akanyan/mu3-mods

fix(MPO): custom rating display bug

This commit is contained in:
2025-01-26 14:09:38 +00:00
parent 8d2d9a3d43
commit 52a15722a8
3 changed files with 14 additions and 7 deletions

View File

@ -1,14 +1,13 @@
using MU3.User;
using MonoMod;
namespace MU3.CustomUI;
class patch_MU3UICounter: MU3UICounter {
public void SetRating(int value, byte suffix) {
Counter = UserUtil.toRatingFloat(value);
AddSuffix(suffix);
}
[MonoModIgnore]
private extern void updatePosition();
public void AddSuffix(byte c) {
updatePosition();
for(int i = numFigures_; i > 0; --i) {
figures_[i] = figures_[i - 1];
}

View File

@ -12,7 +12,6 @@ class patch_ANM_CMN_UserDeta_01: ANM_CMN_UserDeta_01 {
public extern void orig_setUserDetail();
public new void setUserDetail() {
orig_setUserDetail();
if(CustomRating.IsEnabled()) {
var r = CustomRating.Get();
rating.Counter = UserUtil.toRatingFloat(r);
@ -20,6 +19,8 @@ class patch_ANM_CMN_UserDeta_01: ANM_CMN_UserDeta_01 {
RatingColorID ratingColorIDFromRating = GameData.getRatingColorIDFromRating100(r);
transform.Find("NUM_CMN_UserData_01/NUM_Rating").GetComponent<MU3UICounter>().SpriteIndex = (int)ratingColorIDFromRating;
transform.Find("NUM_CMN_UserData_01/NUM_Rating/PAT_Header").GetComponent<MU3UIImageChanger>().patternNumber = (float)ratingColorIDFromRating;
} else {
rating.setForceDirty();
}
}
}

View File

@ -4,6 +4,7 @@ using MU3.Game;
using MU3.Mod;
using MU3.Sequence;
using MU3.User;
using System.Collections;
using UnityEngine;
namespace MU3;
@ -33,8 +34,9 @@ class patch_UIResultBattlePoint: UIResultBattlePoint {
counterScore_.Counter = (double)UserUtil.toRatingFloat(rating1);
int ratingPatternNo = UserUtil.toRatingPatternNo(rating1);
counterScore_.SpriteIndex = ratingPatternNo;
StartCoroutine(addSuffix());
imageHeader_.patternNumber = ratingPatternNo;
counterScore_.AddSuffix(CustomRating.GetSuffix());
int rating2 = rating1 - prevRating;
if(rating2 == 0) {
disable(counterScorePlus_);
@ -55,4 +57,9 @@ class patch_UIResultBattlePoint: UIResultBattlePoint {
}
animator_.SetTrigger(Sys.Const.AnimatorID_In);
}
private IEnumerator addSuffix() {
yield return new WaitForSeconds(0.1f);
counterScore_.AddSuffix(CustomRating.GetSuffix());
}
}