forked from akanyan/mu3-mods
fix: inconsistencies with the new selector
This commit is contained in:
27
NaiveRating/MU3/patch_OptionMiniSummaryController.cs
Normal file
27
NaiveRating/MU3/patch_OptionMiniSummaryController.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using MU3.CustomUI;
|
||||
using MU3.User;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MU3;
|
||||
|
||||
class patch_OptionMiniSummaryController: OptionMiniSummaryController {
|
||||
private GameObject[] arrayIcon = new GameObject[35];
|
||||
private extern void orig_setParam(UserOption.OptionName id, int value);
|
||||
private void setParam(UserOption.OptionName id, int value) {
|
||||
if(id == UserOption.OptionName.Rating) {
|
||||
switch(value) {
|
||||
case 0:
|
||||
arrayIcon[(int)id].transform.Find("NUL_Option_mini_Icon/TXT_Option_mini").GetComponent<MU3Text>().text = "OFF";
|
||||
break;
|
||||
case 1:
|
||||
arrayIcon[(int)id].transform.Find("NUL_Option_mini_Icon/TXT_Option_mini").GetComponent<MU3Text>().text = "TYPE-A";
|
||||
break;
|
||||
case 2:
|
||||
arrayIcon[(int)id].transform.Find("NUL_Option_mini_Icon/TXT_Option_mini").GetComponent<MU3Text>().text = "TYPE-B";
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
orig_setParam(id, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using MU3.CustomUI;
|
||||
using MonoMod;
|
||||
using MU3.CustomUI;
|
||||
using MU3.User;
|
||||
using MU3.Util;
|
||||
using System.Reflection;
|
||||
@ -8,6 +9,10 @@ namespace MU3;
|
||||
|
||||
class patch_OptionSelecterController: OptionSelecterController {
|
||||
private chengeParamFuncArray[] cpFuncArray = new chengeParamFuncArray[35];
|
||||
|
||||
[MonoModIgnore]
|
||||
private extern void setInputCursor(int currentParam);
|
||||
|
||||
public extern void orig_init(UserOption.OptionName id);
|
||||
public new void init(UserOption.OptionName id) {
|
||||
orig_init(id);
|
||||
@ -23,13 +28,13 @@ class patch_OptionSelecterController: OptionSelecterController {
|
||||
var spritesFi = typeof(MU3UIImageChanger).GetField("_sprites", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
var tex = ((Sprite[])spritesFi.GetValue(changer))[0].texture;
|
||||
var newSprites = new Sprite[3];
|
||||
newSprites[0] = Sprite.Create(tex, new Rect(1552.0f, 366.0f, 160.0f, 65.0f), new Vector2(80.0f, 0.0f));
|
||||
newSprites[1] = Sprite.Create(tex, new Rect(1221.0f, 1488.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f));
|
||||
newSprites[2] = Sprite.Create(tex, new Rect(1221.0f, 1410.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f));
|
||||
|
||||
spritesFi.SetValue(changer, newSprites);
|
||||
|
||||
changer.patternNumber = (int)Singleton<UserManager>.instance.userOption.customSet.Rating;
|
||||
changer.setSprite(0, Sprite.Create(tex, new Rect(1552.0f, 366.0f, 160.0f, 65.0f), new Vector2(80.0f, 0.0f)));
|
||||
changer.setSprite(1, Sprite.Create(tex, new Rect(1221.0f, 1488.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f)));
|
||||
changer.setSprite(2, Sprite.Create(tex, new Rect(1221.0f, 1410.0f, 160.0f, 70.0f), new Vector2(80.0f, 35.0f)));
|
||||
|
||||
setInputCursor((int)Singleton<UserManager>.instance.userOption.customSet.Rating);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user