forked from akanyan/mu3-mods
fix(MoreProfileOptions): a better way
This commit is contained in:
@ -1,36 +1,19 @@
|
||||
using MU3.Mod;
|
||||
using MU3.User;
|
||||
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(isRatingDisplay) {
|
||||
var b = CustomRating.GetSuffix();
|
||||
if(b != 0) {
|
||||
pushFigureFront(b);
|
||||
}
|
||||
}
|
||||
public void SetRating(int value, byte suffix) {
|
||||
Counter = UserUtil.toRatingFloat(value);
|
||||
AddSuffix(suffix);
|
||||
}
|
||||
protected void pushFigureFront(byte c) {
|
||||
|
||||
public void AddSuffix(byte c) {
|
||||
for(int i = numFigures_; i > 0; --i) {
|
||||
figures_[i] = figures_[i - 1];
|
||||
}
|
||||
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);
|
||||
}
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user