Skip to content

Commit

Permalink
add toggle scale xy and warp keybinds + fix scale keybind
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Sep 23, 2024
1 parent e1095c9 commit f5bc7a8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# BetterEdit 6

## v6.8.0-beta.3
* Add <co>Toggle Scale X/Y Control</c> and <cp>Toggle Warp Control</c> keybinds
* Fix <cr>Toggle Scale Control</c> keybind crashing

## v6.8.0-beta.2
* Fix being able to place objects through the Z layer input

Expand Down
13 changes: 10 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -196,12 +196,19 @@
"pro-section": {
"type": "title",
"name": "Supporter Settings",
"description": "These settings are only for <cp>Supporter Features</c>."
"description": "These settings are for features only available to <cp>Supporters</c>. 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 <cy>New Look</c>!",
"enable-if": "saved:has-pro"
}
},
Expand Down
32 changes: 29 additions & 3 deletions src/features/Keybinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f5bc7a8

Please sign in to comment.