mu3-mods/InfiniteGP/MU3/patch_UICredit.cs

55 lines
1.8 KiB
C#

using MU3.CustomUI;
using UnityEngine;
namespace MU3;
class patch_UICredit: UICredit {
private Animator gpAnimator_;
private GameObject creditRoot_;
private MU3UICounter credit_;
private GameObject freePlayRoot_;
private GameObject gpRoot_;
private MU3UICounter gp_;
private MU3UICounter gpPlus_;
private MU3UICounter gpMinus_;
private MU3UIImageChanger netIcon_;
private MU3UIImageChanger groupIcon_;
private void onUpdateGP(int value) { /* nop */ }
public extern void orig_initialize();
public new void initialize() {
orig_initialize();
using IniFile iniFile = new("mu3.ini");
if(iniFile.getValue("Extra", "HideGP", true)) {
DestroyImmediate(gpAnimator_);
gpRoot_.transform.localScale = new Vector3(0, 0, 0);
gp_.transform.localScale = new Vector3(0, 0, 0);
gpPlus_.transform.localScale = new Vector3(0, 0, 0);
gpMinus_.transform.localScale = new Vector3(0, 0, 0);
}
if(iniFile.getValue("Extra", "HideCredits", true)) {
creditRoot_.transform.localScale = new Vector3(0, 0, 0);
credit_.transform.localScale = new Vector3(0, 0, 0);
freePlayRoot_.transform.localScale = new Vector3(0, 0, 0);
netIcon_.transform.localPosition = new Vector3(
-514,
netIcon_.transform.localPosition.y,
netIcon_.transform.localPosition.z
);
netIcon_.image.rectTransform.pivot = new Vector2(0f, 0.5f);
groupIcon_.transform.localPosition = new Vector3(
-476,
groupIcon_.transform.localPosition.y,
groupIcon_.transform.localPosition.z
);
groupIcon_.image.rectTransform.pivot = new Vector2(0f, 0.5f);
}
}
}