mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix bug if you change hideonui
This commit is contained in:
1 parent
3ba71d8f19
commit
64604aff98
2 files changed
+12
No files matched your search
@@ -96,6 +96,12 @@ public class ModifierDisplayComponent(nint ptr) : MonoBehaviour(ptr)
|
|||||||
_children.gameObject.SetActive(false);
|
_children.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void DestroyComponent(ModifierUiComponent component)
|
||||||
|
{
|
||||||
|
_modifiers.Remove(component.Modifier!);
|
||||||
|
component.gameObject.DestroyImmediate();
|
||||||
|
}
|
||||||
|
|
||||||
[HideFromIl2Cpp]
|
[HideFromIl2Cpp]
|
||||||
internal static ModifierDisplayComponent CreateDisplay()
|
internal static ModifierDisplayComponent CreateDisplay()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,6 +43,12 @@ public class ModifierUiComponent(nint ptr) : MonoBehaviour(ptr)
|
|||||||
{
|
{
|
||||||
if (Modifier == null || ModifierDisplayComponent.Instance == null || !ModifierDisplayComponent.Instance.IsOpen) return;
|
if (Modifier == null || ModifierDisplayComponent.Instance == null || !ModifierDisplayComponent.Instance.IsOpen) return;
|
||||||
|
|
||||||
|
if (Modifier.HideOnUi || Modifier.GetDescription() == string.Empty)
|
||||||
|
{
|
||||||
|
ModifierDisplayComponent.Instance.DestroyComponent(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nameText.text = Modifier.ModifierName;
|
nameText.text = Modifier.ModifierName;
|
||||||
desc.text = Modifier.GetDescription();
|
desc.text = Modifier.GetDescription();
|
||||||
modBg.gameObject.SetActive(true);
|
modBg.gameObject.SetActive(true);
|
||||||
|
|||||||
Reference in new issue
Block a user