forked from akanyan/mu3-mods
fix: don't store SortByInternal in db
This commit is contained in:
parent
ebb78efcde
commit
ca15fac6a1
@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net35</TargetFramework>
|
||||
<Company>7EVENDAYS⇔HOLIDAYS</Company>
|
||||
<Version>2.3.0</Version>
|
||||
<Version>2.3.1</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Platforms>x64</Platforms>
|
||||
|
20
SortByInternalDifficulty/MU3.User/patch_UserDetail.cs
Normal file
20
SortByInternalDifficulty/MU3.User/patch_UserDetail.cs
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user