Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit b5c69fc

Browse files
committed
Fix UI mouse inspector results panel not always coming to front
1 parent 4fdb2aa commit b5c69fc

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/Inspectors/MouseInspectors/UiInspector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections;
23
using System.Collections.Generic;
34
using System.Linq;
45
using System.Text;
@@ -8,6 +9,7 @@
89
using UnityExplorer.UI;
910
using UnityExplorer.UI.Panels;
1011
using UniverseLib;
12+
using UniverseLib.Input;
1113

1214
namespace UnityExplorer.Inspectors.MouseInspectors
1315
{
@@ -38,6 +40,12 @@ public override void OnSelectMouseInspect()
3840
{
3941
LastHitObjects.Clear();
4042
LastHitObjects.AddRange(currentHitObjects);
43+
RuntimeHelper.StartCoroutine(SetPanelActiveCoro());
44+
}
45+
46+
IEnumerator SetPanelActiveCoro()
47+
{
48+
yield return null;
4149
var panel = UIManager.GetPanel<UiInspectorResultsPanel>(UIManager.Panels.UIInspectorResults);
4250
panel.SetActive(true);
4351
panel.ShowResults();

src/UI/Panels/UIPanel.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ public virtual void OnFinishDrag(RectTransform panel)
108108

109109
public override void SetActive(bool active)
110110
{
111-
if (this.Enabled == active)
112-
return;
113-
114-
base.SetActive(active);
111+
if (this.Enabled != active)
112+
{
113+
base.SetActive(active);
115114

116-
if (!ApplyingSaveData)
117-
SaveInternalData();
115+
if (!ApplyingSaveData)
116+
SaveInternalData();
118117

119-
if (NavButtonWanted)
120-
{
121-
var color = active ? UniversalUI.EnabledButtonColor : UniversalUI.DisabledButtonColor;
122-
RuntimeHelper.SetColorBlock(NavButton.Component, color, color * 1.2f);
118+
if (NavButtonWanted)
119+
{
120+
var color = active ? UniversalUI.EnabledButtonColor : UniversalUI.DisabledButtonColor;
121+
RuntimeHelper.SetColorBlock(NavButton.Component, color, color * 1.2f);
122+
}
123123
}
124124

125125
if (!active)

0 commit comments

Comments
 (0)