From f5bc7a8aea82a2de27ae55d3950e46e309044f2a Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Tue, 24 Sep 2024 00:19:12 +0300 Subject: [PATCH] add toggle scale xy and warp keybinds + fix scale keybind --- changelog.md | 4 ++++ mod.json | 13 ++++++++++--- src/features/Keybinds.cpp | 32 +++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index 0f2cdfb..9d2663d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # BetterEdit 6 +## v6.8.0-beta.3 + * Add Toggle Scale X/Y Control and Toggle Warp Control keybinds + * Fix Toggle Scale Control keybind crashing + ## v6.8.0-beta.2 * Fix being able to place objects through the Z layer input diff --git a/mod.json b/mod.json index 2924730..c787dd1 100644 --- a/mod.json +++ b/mod.json @@ -1,6 +1,6 @@ { "geode": "3.7.1", - "version": "6.8.0-beta.2", + "version": "6.8.0-beta.3", "gd": { "win": "2.206", "mac": "2.206", @@ -196,12 +196,19 @@ "pro-section": { "type": "title", "name": "Supporter Settings", - "description": "These settings are only for Supporter Features." + "description": "These settings are for features only available to Supporters. Support BetterEdit to get access!" }, "better-select": { "type": "bool", "default": false, - "name": "Better Warp Selection (WIP + Supporter-Only)", + "name": "Better Warp Selection (WIP)", + "enable-if": "saved:has-pro" + }, + "enable-pro-ui": { + "type": "bool", + "default": true, + "name": "Enable Pro UI", + "description": "Give the Editor a New Look!", "enable-if": "saved:has-pro" } }, diff --git a/src/features/Keybinds.cpp b/src/features/Keybinds.cpp index de2cf66..d87a1ca 100644 --- a/src/features/Keybinds.cpp +++ b/src/features/Keybinds.cpp @@ -29,10 +29,20 @@ struct $modify(EditorUI) { this->transformObjectCall(EditCommand::RotateSnap); }); this->defineKeybind("show-scale"_spr, [this]() { - if (auto scaleBtn = m_editButtonBar->m_buttonArray->objectAtIndex(m_editButtonBar->m_buttonArray->count() - 3)) { + if (auto scaleBtn = this->querySelector("scale-button")) { this->activateScaleControl(scaleBtn); } }); + this->defineKeybind("show-scale-xy"_spr, [this]() { + if (auto scaleBtn = this->querySelector("scale-xy-button")) { + this->activateScaleControl(scaleBtn); + } + }); + this->defineKeybind("show-warp"_spr, [this]() { + if (auto btn = this->querySelector("warp-button")) { + this->activateTransformControl(btn); + } + }); this->defineKeybind("toggle-link-controls"_spr, [this]() { GameManager::get()->toggleGameVariable("0097"); m_editorLayer->updateOptions(); @@ -192,8 +202,24 @@ struct $modify(EditorUI) { )); BindManager::get()->registerBindable(BindableAction( "show-scale"_spr, - "Show Scale Control", - "Show the object scaling controls", + "Toggle Scale Control", + "Toggle the object scaling controls", + {}, + Category::EDITOR_UI, + false + )); + BindManager::get()->registerBindable(BindableAction( + "show-scale-xy"_spr, + "Toggle Scale X/Y Control", + "Toggle the object scaling by X/Y controls", + {}, + Category::EDITOR_UI, + false + )); + BindManager::get()->registerBindable(BindableAction( + "show-warp"_spr, + "Toggle Warp Control", + "Toggle the object warping controls", {}, Category::EDITOR_UI, false