editor set mouse visibility
This commit is contained in:
parent
90dd589430
commit
fff2c73994
|
@ -618,6 +618,7 @@ namespace SHADE
|
||||||
}
|
}
|
||||||
else if (editorState == State::PAUSE)
|
else if (editorState == State::PAUSE)
|
||||||
{
|
{
|
||||||
|
SHWindow::SetMouseVisible(prevMouseVisibility);
|
||||||
editorState = State::PLAY;
|
editorState = State::PLAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -626,11 +627,13 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
if (editorState == State::PAUSE)
|
if (editorState == State::PAUSE)
|
||||||
return;
|
return;
|
||||||
|
prevMouseVisibility = SHWindow::GetMouseVisible();
|
||||||
const SHEditorStateChangeEvent STATE_CHANGE_EVENT
|
const SHEditorStateChangeEvent STATE_CHANGE_EVENT
|
||||||
{
|
{
|
||||||
.previousState = editorState
|
.previousState = editorState
|
||||||
};
|
};
|
||||||
editorState = State::PAUSE;
|
editorState = State::PAUSE;
|
||||||
|
SHWindow::SetMouseVisible(true);
|
||||||
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT);
|
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_PAUSE_EVENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,6 +646,7 @@ namespace SHADE
|
||||||
.previousState = editorState
|
.previousState = editorState
|
||||||
};
|
};
|
||||||
editorState = SHEditor::State::STOP;
|
editorState = SHEditor::State::STOP;
|
||||||
|
SHWindow::SetMouseVisible(true);
|
||||||
SHCommandManager::SwapStacks();
|
SHCommandManager::SwapStacks();
|
||||||
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_STOP_EVENT);
|
SHEventManager::BroadcastEvent<SHEditorStateChangeEvent>(STATE_CHANGE_EVENT, SH_EDITOR_ON_STOP_EVENT);
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace SHADE
|
||||||
SHEventHandle onEditorStateChanged(SHEventPtr eventPtr);
|
SHEventHandle onEditorStateChanged(SHEventPtr eventPtr);
|
||||||
|
|
||||||
bool isUnsavedChangesPromptOpen = false;
|
bool isUnsavedChangesPromptOpen = false;
|
||||||
|
bool prevMouseVisibility = true;
|
||||||
static constexpr std::string_view sceneNamePromptName = "Save scene as...";
|
static constexpr std::string_view sceneNamePromptName = "Save scene as...";
|
||||||
static constexpr std::string_view unsavedChangesPromptName = "Unsaved Changes";
|
static constexpr std::string_view unsavedChangesPromptName = "Unsaved Changes";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue