forked from akanyan/mu3-mods
feat!: NaiveRating -> MoreProfileOptions
This commit is contained in:
59
Extras/MoreProfileOptions/MU3.User/patch_UserOption.cs
Normal file
59
Extras/MoreProfileOptions/MU3.User/patch_UserOption.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using MonoMod;
|
||||
|
||||
namespace MU3.User;
|
||||
|
||||
class patch_UserOption: UserOption {
|
||||
[MonoModEnumReplace]
|
||||
public new enum eRating {
|
||||
OFF = 0,
|
||||
Default = 1,
|
||||
ON = 1,
|
||||
Naive = 2,
|
||||
MAX = 2
|
||||
}
|
||||
|
||||
[MonoModEnumReplace]
|
||||
public new enum eAbort {
|
||||
OFF = 0,
|
||||
S = 1,
|
||||
SS = 2,
|
||||
SSS = 3,
|
||||
SSS1 = 4,
|
||||
PB = 5,
|
||||
FB = 6,
|
||||
ZERO = 7,
|
||||
MAX = 8,
|
||||
Default = 0
|
||||
}
|
||||
|
||||
class patch_DataSet: DataSet {
|
||||
private eRating rating = eRating.ON;
|
||||
private eAbort abort;
|
||||
|
||||
public extern bool orig_isMax(OptionName id);
|
||||
public new bool isMax(OptionName id) {
|
||||
if(id == OptionName.Rating) {
|
||||
return rating == eRating.MAX;
|
||||
}
|
||||
return orig_isMax(id);
|
||||
}
|
||||
public void set_Rating(eRating value) {
|
||||
if(eRating.MAX < value) {
|
||||
rating = eRating.MAX;
|
||||
} else if(value < eRating.OFF) {
|
||||
rating = eRating.OFF;
|
||||
} else {
|
||||
rating = value;
|
||||
}
|
||||
}
|
||||
public void set_Abort(eAbort value) {
|
||||
if(eAbort.MAX < value) {
|
||||
abort = eAbort.ZERO;
|
||||
} else if(value < eAbort.OFF) {
|
||||
abort = eAbort.OFF;
|
||||
} else {
|
||||
abort = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
Extras/MoreProfileOptions/MU3.User/patch_UserUtil.cs
Normal file
16
Extras/MoreProfileOptions/MU3.User/patch_UserUtil.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using MonoMod;
|
||||
using MU3.Mod;
|
||||
|
||||
namespace MU3.User;
|
||||
|
||||
[MonoModPatch("global::MU3.User.UserUtil")]
|
||||
public static class patch_UserUtil {
|
||||
public extern static float orig_toRatingFloat(int rating);
|
||||
public static float toRatingFloat(int rating) {
|
||||
if(NaiveRating.IsEnabled()) {
|
||||
return orig_toRatingFloat(NaiveRating.Get());
|
||||
} else {
|
||||
return orig_toRatingFloat(rating);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user