forked from akanyan/mu3-mods
feat: implement SortByInternalDifficulty
This commit is contained in:
40
SortByInternalDifficulty/MU3.DB/patch_MusicSort1IDEnum.cs
Normal file
40
SortByInternalDifficulty/MU3.DB/patch_MusicSort1IDEnum.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using MonoMod;
|
||||
|
||||
namespace MU3.DB;
|
||||
|
||||
[MonoModPatch("global::MU3.DB.MusicSort1IDEnum")]
|
||||
public static class patch_MusicSort1IDEnum {
|
||||
private static MusicSort1TableRecord[] records;
|
||||
public static patch_MusicSort1ID[] List;
|
||||
public static extern bool orig_loadFromFile(string filename);
|
||||
|
||||
public static bool loadFromFile(string filename) {
|
||||
var rv = orig_loadFromFile(filename);
|
||||
records = new[] {
|
||||
new MusicSort1TableRecord(0, "Genre", "ジャンル", 0),
|
||||
new MusicSort1TableRecord(1, "All", "全曲", 0),
|
||||
new MusicSort1TableRecord(2, "Character", "キャラクター", 0),
|
||||
new MusicSort1TableRecord(3, "Version", "バージョン", 0),
|
||||
new MusicSort1TableRecord(4, "Level", "譜面レベル", 0),
|
||||
new MusicSort1TableRecord(5, "Name", "曲名", 0),
|
||||
new MusicSort1TableRecord(6, "Attribute", "属性", 0),
|
||||
new MusicSort1TableRecord(7, "InternalLevel", "インターナル", 0)
|
||||
};
|
||||
List = new[] {
|
||||
patch_MusicSort1ID.Genre,
|
||||
patch_MusicSort1ID.All,
|
||||
patch_MusicSort1ID.Character,
|
||||
patch_MusicSort1ID.Version,
|
||||
patch_MusicSort1ID.Level,
|
||||
patch_MusicSort1ID.Name,
|
||||
patch_MusicSort1ID.Attribute,
|
||||
patch_MusicSort1ID.InternalLevel
|
||||
};
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Not exactly sure why this is necessary
|
||||
public static bool isValid(this patch_MusicSort1ID self) {
|
||||
return self >= patch_MusicSort1ID.Genre && self < patch_MusicSort1ID.End;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user