Skip to content

Commit ff0c144

Browse files
committed
add transform keybind + fix some platform controls
1 parent 4227073 commit ff0c144

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/EditorUI.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using namespace keybinds;
1414
#if defined(GEODE_IS_MACOS)
1515
static constexpr auto PLATFORM_CONTROL = Modifier::Command;
1616
#else
17-
static constexpr auto PLATFORM_CONTROL = Modifier::Control;
17+
static constexpr auto PLATFORM_CONTROL = PLATFORM_CONTROL;
1818
#endif
1919

2020
class EvilBypass : public CCKeyboardDispatcher {
@@ -128,26 +128,29 @@ struct $modify(EditorUI) {
128128
this->passThroughKeyDown(KEY_Delete);
129129
});
130130
this->defineKeybind("robtop.geometry-dash/undo", [=] {
131-
this->passThroughKeyDown(KEY_Z, Modifier::Control);
131+
this->passThroughKeyDown(KEY_Z, PLATFORM_CONTROL);
132132
});
133133
this->defineKeybind("robtop.geometry-dash/redo", [=] {
134-
this->passThroughKeyDown(KEY_Z, Modifier::Control | Modifier::Shift);
134+
this->passThroughKeyDown(KEY_Z, PLATFORM_CONTROL | Modifier::Shift);
135135
});
136136
this->defineKeybind("robtop.geometry-dash/deselect-all", [=] {
137137
this->passThroughKeyDown(KEY_D, Modifier::Alt);
138138
});
139139
this->defineKeybind("robtop.geometry-dash/copy", [=] {
140-
this->passThroughKeyDown(KEY_C, Modifier::Control);
140+
this->passThroughKeyDown(KEY_C, PLATFORM_CONTROL);
141141
});
142142
this->defineKeybind("robtop.geometry-dash/paste", [=] {
143-
this->passThroughKeyDown(KEY_V, Modifier::Control);
143+
this->passThroughKeyDown(KEY_V, PLATFORM_CONTROL);
144144
});
145145
this->defineKeybind("robtop.geometry-dash/copy-paste", [=] {
146-
this->passThroughKeyDown(KEY_D, Modifier::Control);
146+
this->passThroughKeyDown(KEY_D, PLATFORM_CONTROL);
147147
});
148148
this->defineKeybind("robtop.geometry-dash/toggle-rotate", [=] {
149149
this->passThroughKeyDown(KEY_R);
150150
});
151+
this->defineKeybind("robtop.geometry-dash/toggle-transform", [=] {
152+
this->passThroughKeyDown(KEY_T, PLATFORM_CONTROL);
153+
});
151154
this->defineKeybind("robtop.geometry-dash/toggle-free-move", [=] {
152155
this->passThroughKeyDown(KEY_F);
153156
});
@@ -161,7 +164,7 @@ struct $modify(EditorUI) {
161164
this->passThroughKeyDown(KEY_Enter);
162165
});
163166
this->defineKeybind("robtop.geometry-dash/playback-music", [=] {
164-
this->passThroughKeyDown(KEY_Enter, Modifier::Control);
167+
this->passThroughKeyDown(KEY_Enter, PLATFORM_CONTROL);
165168
});
166169
this->defineKeybind("robtop.geometry-dash/prev-build-tab", [=] {
167170
// not passthrough because this is different from vanilla
@@ -243,7 +246,7 @@ struct $modify(EditorUI) {
243246
auto x = std::to_string(i);
244247
auto key = static_cast<enumKeyCodes>(KEY_Zero + i);
245248
this->defineKeybind("robtop.geometry-dash/save-editor-position-" + x, [=] {
246-
this->passThroughKeyDown(key, Modifier::Control);
249+
this->passThroughKeyDown(key, PLATFORM_CONTROL);
247250
});
248251
this->defineKeybind("robtop.geometry-dash/load-editor-position-" + x, [=] {
249252
this->passThroughKeyDown(key, Modifier::Alt);
@@ -412,6 +415,13 @@ struct $modify(EditorUI) {
412415
{ Keybind::create(KEY_R, Modifier::None) },
413416
Category::EDITOR_UI, false
414417
});
418+
BindManager::get()->registerBindable({
419+
"robtop.geometry-dash/toggle-transform",
420+
"Transform",
421+
"Toggle Transform Control",
422+
{ Keybind::create(KEY_T, PLATFORM_CONTROL) },
423+
Category::EDITOR_UI, false
424+
});
415425
BindManager::get()->registerBindable({
416426
"robtop.geometry-dash/toggle-free-move",
417427
"Free Move",
@@ -614,7 +624,7 @@ struct $modify(EditorUI) {
614624
"Save Editor Position " + x,
615625
"Save the current editor camera position in the slot " + x + ". "
616626
"You can reload this slot back with Load Editor Position " + x,
617-
{ Keybind::create(static_cast<enumKeyCodes>(KEY_Zero + i), Modifier::Control) },
627+
{ Keybind::create(static_cast<enumKeyCodes>(KEY_Zero + i), PLATFORM_CONTROL) },
618628
Category::EDITOR_UI, false
619629
});
620630
BindManager::get()->registerBindable({

0 commit comments

Comments
 (0)