forked from akanyan/mu3-mods
feat!: NaiveRating -> MoreProfileOptions
This commit is contained in:
54
Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs
Normal file
54
Extras/MoreProfileOptions/MU3/patch_UIResultBattlePoint.cs
Normal file
@ -0,0 +1,54 @@
|
||||
using MonoMod;
|
||||
using MU3.CustomUI;
|
||||
using MU3.Sequence;
|
||||
using MU3.User;
|
||||
using MU3.Mod;
|
||||
using MU3.Game;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_UIResultBattlePoint: UIResultBattlePoint {
|
||||
private Animator animator_;
|
||||
private patch_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) {
|
||||
counterScore_.isDispSuffix = NaiveRating.IsEnabled();
|
||||
if(!NaiveRating.IsEnabled()) {
|
||||
orig_initTechRating(playInfo);
|
||||
return;
|
||||
}
|
||||
int prevRating = ((patch_SessionResult)playInfo.sessionResult).prevNaiveRating;
|
||||
int rating1 = NaiveRating.Get();
|
||||
|
||||
UnityEngine.Debug.Log(prevRating + " " + rating1);
|
||||
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(Sys.Const.AnimatorID_State, 2);
|
||||
} else if(0 < rating2) {
|
||||
disable(counterScoreMinus_);
|
||||
if((bool)counterScorePlus_) {
|
||||
counterScorePlus_.Counter = rating2 * 0.01f + 1E-05f;
|
||||
}
|
||||
animator_.SetInteger(Sys.Const.AnimatorID_State, 0);
|
||||
}
|
||||
animator_.SetTrigger(Sys.Const.AnimatorID_In);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user