diff --git a/Mu3Mods.csproj b/Mu3Mods.csproj index 0e6bb87..93d3332 100644 --- a/Mu3Mods.csproj +++ b/Mu3Mods.csproj @@ -2,7 +2,7 @@ net35 7EVENDAYS⇔HOLIDAYS - 2.3.0 + 2.3.1 true latest x64 diff --git a/SortByInternalDifficulty/MU3.User/patch_UserDetail.cs b/SortByInternalDifficulty/MU3.User/patch_UserDetail.cs new file mode 100644 index 0000000..11cd792 --- /dev/null +++ b/SortByInternalDifficulty/MU3.User/patch_UserDetail.cs @@ -0,0 +1,20 @@ +using MU3.Client; +using MU3.DB; + +namespace MU3.User; +class patch_UserDetail: UserDetail { + public extern void orig_copyTo(UserData userDetail); + public new void copyTo(UserData userDetail) { + orig_copyTo(userDetail); + + // Attempting to use a profile with InternalLevel sorting enabled + // causes unpatched clients to crash thanks to enormous incompetence + // of Sxga's interns. So, unfortunately, this value has to be discarded. + // See: + // * MusicSelectViewDataList._sort1 set + // * UserDetail.copyFrom() + if(userDetail.tabSetting == (int)patch_MusicSort1ID.InternalLevel) { + userDetail.tabSetting = (int)patch_MusicSort1ID.Level; + } + } +} diff --git a/SortByInternalDifficulty/MU3.ViewData/patch_MusicSelectViewDataList.cs b/SortByInternalDifficulty/MU3.ViewData/patch_MusicSelectViewDataList.cs index 69d1fdf..98c0712 100644 --- a/SortByInternalDifficulty/MU3.ViewData/patch_MusicSelectViewDataList.cs +++ b/SortByInternalDifficulty/MU3.ViewData/patch_MusicSelectViewDataList.cs @@ -15,6 +15,7 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList { private CompareProc _compareProc1; private CompareProc _compareProc2; private GetCategoryNameProc _getCategoryNameProc; + private PropertyInfo _reMasterPi = null; private extern void orig_set__sort1(MusicSort1ID value); private extern void orig_set__sort2(MusicSort2ID value); @@ -36,19 +37,18 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList { } } - private PropertyInfo reMasterPi = null; private bool isReMaster(Data.MusicData d) { // Fall back for pre-Act3 - if(reMasterPi == null) { + if(_reMasterPi == null) { return false; } - return (bool)reMasterPi.GetValue(d, null); + return (bool)_reMasterPi.GetValue(d, null); } public extern void orig_create(GameViewData gameViewData, ChapterSelection chapterSelection, FumenDifficulty difficulty, MusicSort1ID sort1, MusicSort2ID sort2); public new void create(GameViewData gameViewData, ChapterSelection chapterSelection, FumenDifficulty difficulty, MusicSort1ID sort1, MusicSort2ID sort2) { - reMasterPi = typeof(Data.MusicData).GetProperty("isReMaster"); + _reMasterPi = typeof(Data.MusicData).GetProperty("isReMaster"); orig_create(gameViewData, chapterSelection, difficulty, sort1, sort2); } @@ -100,7 +100,7 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList { private extern int orig_getMetaSortKey(MusicSelectViewData d, bool forCategorySort); private int getMetaSortKey(MusicSelectViewData d, bool forCategorySort) { - if(reMasterPi == null) { + if(_reMasterPi == null) { return orig_getMetaSortKey(d, forCategorySort); } var remas = isReMaster(d.musicViewData.data);