fix(SortByInternal): re:mas de-grouping in act3

This commit is contained in:
あかニャン 2024-07-06 01:21:33 +09:00
parent de9bcda48d
commit 8a66b8becd

View File

@ -1,7 +1,9 @@
using MU3.DB; using MU3.DataStudio;
using MU3.DB;
using MU3.Util; using MU3.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection;
using System.Text; using System.Text;
namespace MU3.ViewData; namespace MU3.ViewData;
@ -34,6 +36,33 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
} }
} }
private PropertyInfo reMasterPi = null;
private bool isReMaster(Data.MusicData d) {
// Fall back for pre-Act3
if(reMasterPi == null) {
return false;
}
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");
orig_create(gameViewData, chapterSelection, difficulty, sort1, sort2);
}
private string getMetaGategoryName(MusicSelectViewData d) {
var remas = isReMaster(d.musicViewData.data);
if(d.musicViewData.data.isBonusTrack) {
return "ボーナストラック";
}
if(d.musicViewData.data.isLunatic && remas && __sort1 != MusicSort1ID.Level && __sort1 != (MusicSort1ID)patch_MusicSort1ID.InternalLevel) {
return "Re:MASTER";
}
return d.musicViewData.data.isLunatic && !remas ? "LUNATIC" : null;
}
private string getCategoryNameByInternalLevel(MusicSelectViewData d) { private string getCategoryNameByInternalLevel(MusicSelectViewData d) {
StringBuilder stringBuilder = Singleton<MU3.Sys.System>.instance.getStringBuilder(); StringBuilder stringBuilder = Singleton<MU3.Sys.System>.instance.getStringBuilder();
Data.FumenData fumenData = ((d.musicViewData.data == null) ? null : d.musicViewData.data.fumenData[(int)d.difficulty]); Data.FumenData fumenData = ((d.musicViewData.data == null) ? null : d.musicViewData.data.fumenData[(int)d.difficulty]);
@ -69,21 +98,31 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
return orig_createMyListMusicDataAllDifficulty(list, idList, musicData, sort1, initOrder); return orig_createMyListMusicDataAllDifficulty(list, idList, musicData, sort1, initOrder);
} }
// Enable this for 1.45 Re:MAS inclusion private extern int orig_getMetaSortKey(MusicSelectViewData d, bool forCategorySort);
/*private int getMetaSortKey(MusicSelectViewData d, bool forCategorySort) { private int getMetaSortKey(MusicSelectViewData d, bool forCategorySort) {
if(reMasterPi == null) {
return orig_getMetaSortKey(d, forCategorySort);
}
var remas = isReMaster(d.musicViewData.data);
if(forCategorySort) { if(forCategorySort) {
if(d.musicViewData.data.isBonusTrack) if(d.musicViewData.data.isBonusTrack) {
return 3; return 3;
if(d.musicViewData.data.isLunatic && d.musicViewData.data.isReMaster && __sort1 != MusicSort1ID.Level && __sort1 != (MusicSort1ID)patch_MusicSort1ID.InternalLevel) }
if(d.musicViewData.data.isLunatic && remas && __sort1 != MusicSort1ID.Level && __sort1 != (MusicSort1ID)patch_MusicSort1ID.InternalLevel) {
return 1; return 1;
if(d.musicViewData.data.isLunatic && !d.musicViewData.data.isReMaster) }
if(d.musicViewData.data.isLunatic && !remas) {
return 2; return 2;
}
} else { } else {
if(d.musicViewData.data.isLunatic && d.musicViewData.data.isReMaster && __sort1 != MusicSort1ID.Level && __sort1 != (MusicSort1ID)patch_MusicSort1ID.InternalLevel) if(d.musicViewData.data.isLunatic && remas && __sort1 != MusicSort1ID.Level && __sort1 != (MusicSort1ID)patch_MusicSort1ID.InternalLevel) {
return 1; return 1;
if(d.musicViewData.data.isLunatic && !d.musicViewData.data.isReMaster) }
if(d.musicViewData.data.isLunatic && !remas) {
return 2; return 2;
}
} }
return 0; return 0;
}*/ }
} }