forked from akanyan/mu3-mods
add offgeki
This commit is contained in:
53
Extras/Offgeki/MU3/patch_BattleUI.cs
Normal file
53
Extras/Offgeki/MU3/patch_BattleUI.cs
Normal file
@ -0,0 +1,53 @@
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user