mu3-mods/NaiveRating/MU3.User/patch_UserOption.cs
akanyan cc7bc8613b feat: add the remaining things
* DisableMaintenance
* UnlockAllMusic
* UnlockGameEvents
* UnlockMemoryChapters
2024-07-08 02:10:46 +09:00

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