1
0
forked from akanyan/mu3-mods

fix(MPO): don't tap into toRatingFloat

Cleaner, safer, and should fix collab play
This commit is contained in:
2024-12-28 21:10:31 +00:00
parent c84898cb78
commit 566d17c230
5 changed files with 21 additions and 25 deletions

View File

@ -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);
}
}
}