forked from akanyan/mu3-mods
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using MU3.Util;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MU3;
|
|
|
|
public class patch_BattleUI : BattleUI
|
|
{
|
|
private extern void orig_Awake();
|
|
public extern void orig_dispFinish();
|
|
|
|
private void Awake()
|
|
{
|
|
orig_Awake();
|
|
|
|
Mod.State state = Singleton<Mod.State>.instance;
|
|
state.Init();
|
|
|
|
List<string> disabled = [];
|
|
if (state.RemoveBackground)
|
|
{
|
|
disabled.Add("CVS_SurfBoard3D");
|
|
}
|
|
|
|
if (state.RemoveEnemyUI)
|
|
{
|
|
disabled.Add("CVS_PLY_EnemyDamage");
|
|
disabled.Add("CVS_PLY_Enemyinfo_00");
|
|
}
|
|
|
|
if (state.RemovePlayerCardUI)
|
|
{
|
|
disabled.Add("CVS_PLY_Cardinfo_00");
|
|
}
|
|
|
|
foreach (var item in GetComponentsInChildren<Canvas>())
|
|
{
|
|
if (item.enabled && disabled.Contains(item.name)){
|
|
item.enabled = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void dispFinish()
|
|
{
|
|
foreach (var item in GetComponentsInChildren<Canvas>())
|
|
{
|
|
item.enabled = true;
|
|
}
|
|
|
|
orig_dispFinish();
|
|
}
|
|
}
|