36 lines
971 B
C#
36 lines
971 B
C#
using MonoMod;
|
|
|
|
namespace MU3.User;
|
|
|
|
class patch_UserOption: UserOption {
|
|
[MonoModEnumReplace]
|
|
public enum patch_eRating {
|
|
OFF = 0,
|
|
Default = 1,
|
|
ON = 1,
|
|
Naive = 2,
|
|
MAX = 2
|
|
}
|
|
class patch_DataSet: DataSet {
|
|
private patch_eRating rating = patch_eRating.ON;
|
|
public extern bool orig_isMax(OptionName id);
|
|
public new bool isMax(OptionName id) {
|
|
if(id == OptionName.Rating) {
|
|
return rating == patch_eRating.MAX;
|
|
}
|
|
return orig_isMax(id);
|
|
}
|
|
public new patch_eRating Rating {
|
|
get => rating;
|
|
set {
|
|
if(patch_eRating.MAX < value) {
|
|
rating = patch_eRating.MAX;
|
|
} else if(value < patch_eRating.OFF) {
|
|
rating = patch_eRating.OFF;
|
|
} else {
|
|
rating = value;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |