diff --git a/SHADE_Engine/src/Editor/SHEditor.cpp b/SHADE_Engine/src/Editor/SHEditor.cpp index 6d71f98d..cfdfbbd9 100644 --- a/SHADE_Engine/src/Editor/SHEditor.cpp +++ b/SHADE_Engine/src/Editor/SHEditor.cpp @@ -618,6 +618,7 @@ namespace SHADE } else if (editorState == State::PAUSE) { + SHWindow::SetMouseVisible(prevMouseVisibility); editorState = State::PLAY; } } @@ -626,11 +627,13 @@ namespace SHADE { if (editorState == State::PAUSE) return; + prevMouseVisibility = SHWindow::GetMouseVisible(); const SHEditorStateChangeEvent STATE_CHANGE_EVENT { .previousState = editorState }; editorState = State::PAUSE; + SHWindow::SetMouseVisible(true); SHEventManager::BroadcastEvent(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT); } @@ -643,6 +646,7 @@ namespace SHADE .previousState = editorState }; editorState = SHEditor::State::STOP; + SHWindow::SetMouseVisible(true); SHCommandManager::SwapStacks(); SHEventManager::BroadcastEvent(STATE_CHANGE_EVENT, SH_EDITOR_ON_STOP_EVENT); diff --git a/SHADE_Engine/src/Editor/SHEditor.h b/SHADE_Engine/src/Editor/SHEditor.h index 1cbc4f9d..960415fb 100644 --- a/SHADE_Engine/src/Editor/SHEditor.h +++ b/SHADE_Engine/src/Editor/SHEditor.h @@ -154,7 +154,7 @@ namespace SHADE SHEventHandle onEditorStateChanged(SHEventPtr eventPtr); bool isUnsavedChangesPromptOpen = false; - + bool prevMouseVisibility = true; static constexpr std::string_view sceneNamePromptName = "Save scene as..."; static constexpr std::string_view unsavedChangesPromptName = "Unsaved Changes";