diff options
| -rw-r--r-- | editor/editor.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index ee35d27..14b2777 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -52,6 +52,7 @@ const char* const dbgCtrl_CameraButtonMask = "debug-camera-button-mask"; const char* const dbgCtrl_SelectHovered = "debug-select-hovered"; const char* const dbgCtrl_ClearSelection = "debug-clear-selection"; const char* const dbgCtrl_DeleteSelectedItem = "debug-delete-selected-item"; +const char* const dbgCtrl_ImGui_Toggle = "debug-imgui-toggle"; ThreadPoolHandle threadPoolHandle = ThreadPoolHandle_MAX; @@ -447,6 +448,15 @@ void PkeEditor_Tick(double delta) { selectedEntity = nullptr; } } + + holder = PkeInput_Query(dbgCtrl_ImGui_Toggle); + if (holder.type != InputEventHash{0}) { + PkeKeyEvent *key; + key = static_cast<PkeKeyEvent *>(holder.ptr); + if (key->isPressed && key->thisTick == true) { + pkeSettings.isShowingEditor = !pkeSettings.isShowingEditor; + } + } } void RecordImGui_GLM(const char *label, glm::mat4 &mat) { @@ -1744,7 +1754,7 @@ void PkeEditor_Teardown() { void PkeEditor_Init() { PkeInputSet debugControlsSet; debugControlsSet.title = "debug-editor-controls"; - debugControlsSet.actionCount = 13; + debugControlsSet.actionCount = 14; debugControlsSet.actions = pk_new<PkeInputAction>(debugControlsSet.actionCount); debugControlsSet.actions[0].name = dbgCtrl_CameraLeft; @@ -1811,6 +1821,11 @@ void PkeEditor_Init() { .computedHash = PKE_INPUT_HASH_ALL_KEY_EVENTS, .button = GLFW_KEY_DELETE, }; + debugControlsSet.actions[13].name = dbgCtrl_ImGui_Toggle; + debugControlsSet.actions[13].primaryHash = PkeInputEventMask { + .computedHash = PKE_INPUT_HASH_ALL_KEY_EVENTS, + .button = GLFW_KEY_F1, + }; debugControlsHandle = PkeInput_RegisterSet(debugControlsSet); |
