mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 19:33:27 +08:00
ui button fixes
This commit is contained in:
@@ -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<UIButton>();
|
||||
go.GetComponent<Image>().sprite = panel.buttonDefaultSprite;
|
||||
btn.gameObject.name = "my-flatbutton";
|
||||
btn.highlighted = false;
|
||||
var img = btn.GetComponent<Image>();
|
||||
|
||||
@@ -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<Image>().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)
|
||||
|
||||
Reference in New Issue
Block a user