mu3-mods/SortByInternalDifficulty/MU3/patch_UISortButton.cs

28 lines
695 B
C#

using MU3.CustomUI;
using UnityEngine;
namespace MU3;
class patch_UISortButton: UISortButton {
private MU3UIImageChanger _selectPreviewImageChanger;
protected override void Awake() {
base.Awake();
var changer = (patch_MU3UIImageChanger)_selectPreviewImageChanger;
var n = changer.sprites.Length;
var sprites = new Sprite[n + 1];
for(int i = 0; i < n; ++i) {
sprites[i] = changer.sprites[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);
changer.sprites = sprites;
}
}