forked from akanyan/mu3-mods
fix: misc cleanup
Also set HideVersion default to false Also fix the new skipper crashing on tutorial
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3.CustomUI;
|
||||
|
||||
class patch_MU3UIImageChanger: MU3UIImageChanger {
|
||||
private Sprite[] _sprites;
|
||||
|
||||
public Sprite[] sprites {
|
||||
get { return _sprites; }
|
||||
set { _sprites = value; }
|
||||
}
|
||||
}
|
@ -5,8 +5,8 @@ namespace MU3.DB;
|
||||
[MonoModPatch("global::MU3.DB.MusicSort2IDEnum")]
|
||||
public static class patch_MusicSort2IDEnum {
|
||||
private static MusicSort2TableRecord[] records;
|
||||
public static extern bool orig_loadFromFile(string filename);
|
||||
|
||||
public static extern bool orig_loadFromFile(string filename);
|
||||
public static bool loadFromFile(string filename) {
|
||||
var rv = orig_loadFromFile(filename);
|
||||
records[4].Name = "譜面定数";
|
||||
|
@ -6,6 +6,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace MU3.User;
|
||||
|
||||
class patch_UserDetail: UserDetail {
|
||||
public extern void orig_copyTo(UserData userDetail);
|
||||
public new void copyTo(UserData userDetail) {
|
||||
|
@ -46,7 +46,6 @@ class patch_MusicSelectViewDataList: MusicSelectViewDataList {
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -5,8 +5,8 @@ namespace MU3;
|
||||
public class patch_Scene_32_PrePlayMusic_MusicSelect: Scene_32_PrePlayMusic_MusicSelect {
|
||||
private static patch_MusicSort1ID[] _sort1SettingList;
|
||||
private static MusicSort2ID[] _sort2SettingList;
|
||||
private extern void orig_Awake();
|
||||
|
||||
private extern void orig_Awake();
|
||||
private new void Awake() {
|
||||
_sort1SettingList = new[] {
|
||||
patch_MusicSort1ID.Genre,
|
||||
|
@ -1,4 +1,5 @@
|
||||
using MU3.CustomUI;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
@ -9,19 +10,22 @@ class patch_UISortButton: UISortButton {
|
||||
protected override void Awake() {
|
||||
base.Awake();
|
||||
|
||||
var changer = (patch_MU3UIImageChanger)_selectPreviewImageChanger;
|
||||
var n = changer.sprites.Length;
|
||||
var sprites = new Sprite[n + 1];
|
||||
var spritesFi = typeof(MU3UIImageChanger).GetField("_sprites", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
var changer = _selectPreviewImageChanger;
|
||||
|
||||
var oldSprites = (Sprite[])spritesFi.GetValue(changer);
|
||||
var n = oldSprites.Length;
|
||||
var newSprites = new Sprite[n + 1];
|
||||
|
||||
for(int i = 0; i < n; ++i) {
|
||||
sprites[i] = changer.sprites[i];
|
||||
newSprites[i] = oldSprites[i];
|
||||
}
|
||||
|
||||
Texture2D tex = new Texture2D(2, 2);
|
||||
tex.LoadImage(InternalSortPreview.Bytes);
|
||||
|
||||
sprites[n] = Sprite.Create(tex, new Rect(0, 0, 254, 121), sprites[0].pivot);
|
||||
newSprites[n] = Sprite.Create(tex, new Rect(0, 0, 254, 121), newSprites[0].pivot);
|
||||
|
||||
changer.sprites = sprites;
|
||||
spritesFi.SetValue(changer, newSprites);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user