1
0
forked from akanyan/mu3-mods

feat!: rename and reorganize

This commit is contained in:
2024-12-22 16:16:52 +00:00
parent 7acd754397
commit 895ae9e76d
99 changed files with 110 additions and 87 deletions

View File

@ -0,0 +1,50 @@
using MonoMod;
using MU3.CustomUI;
using MU3.Sequence;
using MU3.User;
using UnityEngine;
namespace MU3;
class patch_UIResultBattlePoint: UIResultBattlePoint {
private Animator animator_;
private MU3UICounter counterScore_;
private MU3UIImageChanger imageHeader_;
private MU3UICounter counterScorePlus_;
private MU3UICounter counterScoreMinus_;
private GameObject hideScore_;
[MonoModIgnore]
private extern void disable(MU3UICounter counter);
public extern void orig_initTechRating(PlayInfo playInfo);
public new void initTechRating(PlayInfo playInfo) {
((patch_MU3UICounter)counterScore_).isDispSuffix = NaiveRating.IsEnabled();
if(!NaiveRating.IsEnabled()) {
orig_initTechRating(playInfo);
return;
}
int prevRating = NaiveRating.PrevRating;
int rating1 = NaiveRating.Get();
if((bool)hideScore_) {
hideScore_.SetActive(false);
}
counterScore_.Counter = (double)UserUtil.toRatingFloat(rating1);
int ratingPatternNo = UserUtil.toRatingPatternNo(rating1);
counterScore_.SpriteIndex = ratingPatternNo;
imageHeader_.patternNumber = (float)ratingPatternNo;
int rating2 = rating1 - prevRating;
if(rating2 == 0) {
disable(counterScorePlus_);
disable(counterScoreMinus_);
animator_.SetInteger(MU3.Sys.Const.AnimatorID_State, 2);
} else if(0 < rating2) {
disable(counterScoreMinus_);
if((bool)counterScorePlus_) {
counterScorePlus_.Counter = rating2 * 0.01f + 1E-05f;
}
animator_.SetInteger(MU3.Sys.Const.AnimatorID_State, 0);
}
animator_.SetTrigger(MU3.Sys.Const.AnimatorID_In);
}
}