1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-11 00:43:29 +08:00
This commit is contained in:
2023-09-13 00:49:43 +08:00
parent e798055f7a
commit 19f3db5611
2 changed files with 20 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ public class MyWindow: ManualBehaviour
public void Open()
{
_Open();
transform.SetAsLastSibling();
transform.SetSiblingIndex(UIRoot.instance.uiMechaEditor.transform.GetSiblingIndex() + 1);
}
public void Close() => _Close();
@@ -68,6 +68,19 @@ public class MyWindow: ManualBehaviour
return txt;
}
protected static UIButton AddTipsButton(float x, float y, RectTransform parent, string label, string tip, string content, string objName = "tips-button")
{
var src = UIRoot.instance.galaxySelect.sandboxToggle.gameObject.transform.parent.Find("tip-button");
var dst = Instantiate(src);
dst.gameObject.name = objName;
var btn = dst.GetComponent<UIButton>();
Util.NormalizeRectWithTopLeft(btn, x, y, parent);
btn.tips.tipTitle = label;
btn.tips.tipText = tip;
btn.UpdateTip();
return btn;
}
protected UIButton AddButton(float x, float y, RectTransform parent, string text = "", int fontSize = 16, string objName = "button", UnityAction onClick = null)
{
var panel = UIRoot.instance.uiGame.statWindow.performancePanelUI;