From 19f3db561157f1a2e32e0082152b2e3fb96e9c64 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Wed, 13 Sep 2023 00:49:43 +0800 Subject: [PATCH] WIP --- CheatEnabler/UI/MyWindow.cs | 15 ++++++++++++++- CheatEnabler/UIConfigWindow.cs | 6 ++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CheatEnabler/UI/MyWindow.cs b/CheatEnabler/UI/MyWindow.cs index caeb8e9..29d7f4c 100644 --- a/CheatEnabler/UI/MyWindow.cs +++ b/CheatEnabler/UI/MyWindow.cs @@ -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(); + 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; diff --git a/CheatEnabler/UIConfigWindow.cs b/CheatEnabler/UIConfigWindow.cs index 05a2c78..1a8be1d 100644 --- a/CheatEnabler/UIConfigWindow.cs +++ b/CheatEnabler/UIConfigWindow.cs @@ -15,6 +15,9 @@ public class UIConfigWindow : UI.MyWindowWithTabs I18N.Add("Enable Dev Shortcuts", "Enable Dev Shortcuts", "启用开发模式快捷键"); I18N.Add("Disable Abnormal Checks", "Disable Abnormal Checks", "关闭数据异常检查"); I18N.Add("Hotkey", "Hotkey", "快捷键"); + I18N.Add("Dev Shortcuts", "Dev Shortcuts", "开发模式快捷键"); + I18N.Add("Dev Shortcuts Tips", "Numpad 1: Gets all items and extends bag.\nNumpad 2: Boosts walk speed, gathering speed and mecha energy restoration.\nNumpad 3: Fills planet with foundations and bury all veins.\nNumpad 4: +1 construction drone.\nNumpad 5: Upgrades drone engine tech to full.\nNumpad 6: Unlocks researching tech.\nNumpad 7: Unlocks Drive Engine 1.\nNumpad 8: Unlocks Drive Engine 2 and maximize energy.\nNumpad 9: Unlocks ability to warp.\nNumpad 0: No costs for Logistic Storages' output.\nLCtrl + T: Unlocks all techs (not upgrades).\nLCtrl + A: Resets all local achievements.\nLCtrl + Q: Adds 10000 to every metadata.\nLCtrl + W: Enters Sandbox Mode.\nLCtrl + Shift + W: Leaves Sandbox Mode.\nNumpad *: Proliferates items on hand.\nNumpad /: Removes proliferations from items on hand.\nPageDown: Remembers Pose of game camera.\nPageUp: Locks game camera using remembered Pose.", + "小键盘1:获得所有物品并扩展背包\n小键盘2:加快行走速度及采集速度,加快能量恢复速度\n小键盘3:将地基铺设整个星球并掩埋所有矿物\n小键盘4:建设机器人 +1\n小键盘5:建设机器人满级\n小键盘6:解锁当前科技\n小键盘7:解锁驱动技术I\n小键盘8:解锁驱动技术II 最大化能量\n小键盘9:机甲曲速解锁\n小键盘0:物流站通过传送带出物品无消耗\n左Ctrl + T:解锁所有非升级科技\n左Ctrl + A:重置所有本地成就\n左Ctrl + Q:增加各项元数据10000点\n左Ctrl + W:进入沙盒模式\n左Ctrl + Shift + W:离开沙盒模式\n小键盘乘号 *:给手上物品喷涂增产剂\n小键盘除号 /:清除手上物品的增产剂\nPageDown:记录摄像机当前的Pose\nPageUp:用记录的Pose锁定摄像机"); I18N.Add("Build", "Build", "建造"); I18N.Add("Finish build immediately", "Finish build immediately", "建造秒完成"); I18N.Add("Infinite buildings", "Infinite buildings", "无限建筑"); @@ -72,6 +75,9 @@ public class UIConfigWindow : UI.MyWindowWithTabs UI.MyCheckBox.CreateCheckBox(x, y, tab1, AbnormalDisabler.Enabled, "Disable Abnormal Checks"); y += 86f; UI.MyKeyBinder.CreateKeyBinder(x, y, tab1, CheatEnabler.Hotkey, "Hotkey"); + x = 180f; + y = 16f; + AddTipsButton(x, y, tab1, "Dev Shortcuts", "Dev Shortcuts Tips", "dev-shortcuts-tips"); var tab2 = AddTab(136f, 1, _windowTrans, "Build"); x = 0f;