1
0
forked from akanyan/mu3-mods

feat: implement SortByInternalDifficulty

This commit is contained in:
2024-07-05 09:15:56 +09:00
parent 76884216dd
commit 44dfa20ea8
9 changed files with 865 additions and 0 deletions

View File

@ -0,0 +1,19 @@
using MonoMod;
namespace MU3.DB;
[MonoModPatch("global::MU3.DB.MusicSort1ID")]
[MonoModEnumReplace()]
public enum patch_MusicSort1ID {
Genre = 0,
All = 1,
Character = 2,
Version = 3,
Level = 4,
Name = 5,
Attribute = 6,
InternalLevel = 7,
Begin = 0,
End = 8,
Invalid = -1
}

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