From 5b4633e54c0d4a07d2e659f4ee744f202faca905 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sun, 21 Sep 2025 01:36:54 +0800 Subject: [PATCH] ui button fixes --- UXAssist/UI/MyFlatButton.cs | 1 + UXAssist/UI/MyWindow.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/UXAssist/UI/MyFlatButton.cs b/UXAssist/UI/MyFlatButton.cs index e183ce5..37fcda3 100644 --- a/UXAssist/UI/MyFlatButton.cs +++ b/UXAssist/UI/MyFlatButton.cs @@ -18,6 +18,7 @@ public class MyFlatButton : MonoBehaviour var panel = UIRoot.instance.uiGame.dysonEditor.controlPanel.hierarchy.layerPanel; var go = Instantiate(panel.layerButtons[0].gameObject); var btn = go.GetComponent(); + go.GetComponent().sprite = panel.buttonDefaultSprite; btn.gameObject.name = "my-flatbutton"; btn.highlighted = false; var img = btn.GetComponent(); diff --git a/UXAssist/UI/MyWindow.cs b/UXAssist/UI/MyWindow.cs index c49e280..4f42d8a 100644 --- a/UXAssist/UI/MyWindow.cs +++ b/UXAssist/UI/MyWindow.cs @@ -475,8 +475,11 @@ public class MyWindowWithTabs : MyWindow var swarmPanel = UIRoot.instance.uiGame.dysonEditor.controlPanel.hierarchy.swarmPanel; var src = swarmPanel.orbitButtons[0]; var btn = Instantiate(src); - var btnRect = Util.NormalizeRectWithTopLeft(btn, Margin, y, parent); + btn.gameObject.GetComponent().sprite = swarmPanel.buttonDefaultSprite; btn.name = "tab-btn-" + index; + btn.highlighted = false; + + var btnRect = Util.NormalizeRectWithTopLeft(btn, Margin, y, parent); btnRect.sizeDelta = new Vector2(TabWidth, TabHeight); btn.transform.Find("frame").gameObject.SetActive(false); if (btn.transitions.Length >= 3)