Handle mouse center/visible when editor play/pause/stop
This commit is contained in:
parent
9f57ed1ef1
commit
77e3fe376b
|
@ -55,6 +55,7 @@
|
|||
#include "Scene/SHSceneManager.h"
|
||||
#include "Serialization/SHSerialization.h"
|
||||
#include "Tools/SHDebugDraw.h"
|
||||
#include "Input/SHInputManager.h"
|
||||
|
||||
RTTR_REGISTRATION
|
||||
{
|
||||
|
@ -618,6 +619,8 @@ namespace SHADE
|
|||
}
|
||||
else if (editorState == State::PAUSE)
|
||||
{
|
||||
|
||||
SHWindow::SetMouseVisible(prevCursorVisibleState);
|
||||
editorState = State::PLAY;
|
||||
}
|
||||
}
|
||||
|
@ -631,6 +634,8 @@ namespace SHADE
|
|||
.previousState = editorState
|
||||
};
|
||||
editorState = State::PAUSE;
|
||||
SHInputManager::SetMouseCentering(false);
|
||||
prevCursorVisibleState = SHWindow::GetMouseVisible();
|
||||
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT);
|
||||
}
|
||||
|
||||
|
@ -642,6 +647,9 @@ namespace SHADE
|
|||
{
|
||||
.previousState = editorState
|
||||
};
|
||||
SHWindow::SetMouseVisible(true);
|
||||
prevCursorVisibleState = true;
|
||||
SHInputManager::SetMouseCentering(false);
|
||||
editorState = SHEditor::State::STOP;
|
||||
SHCommandManager::SwapStacks();
|
||||
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_STOP_EVENT);
|
||||
|
|
|
@ -154,7 +154,7 @@ namespace SHADE
|
|||
SHEventHandle onEditorStateChanged(SHEventPtr eventPtr);
|
||||
|
||||
bool isUnsavedChangesPromptOpen = false;
|
||||
|
||||
bool prevCursorVisibleState = true;
|
||||
static constexpr std::string_view sceneNamePromptName = "Save scene as...";
|
||||
static constexpr std::string_view unsavedChangesPromptName = "Unsaved Changes";
|
||||
|
||||
|
|
Loading…
Reference in New Issue