open and focus game view when game mode is started
This commit is contained in:
parent
605c6d62c7
commit
e1520564cd
2 changed files with 8 additions and 0 deletions
|
@ -271,6 +271,13 @@ void GameView::onWindowGUI()
|
|||
WorldEditor& editor = m_app.getWorldEditor();
|
||||
m_pipeline->setUniverse(editor.getUniverse());
|
||||
|
||||
const bool is_game_mode = m_app.getWorldEditor().isGameMode();
|
||||
if (is_game_mode && !m_was_game_mode) {
|
||||
ImGui::SetNextWindowFocus();
|
||||
m_is_open = true;
|
||||
}
|
||||
m_was_game_mode = is_game_mode;
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
if (m_is_mouse_captured && (io.KeysDown[ImGui::GetKeyIndex(ImGuiKey_Escape)] || !editor.isGameMode())) {
|
||||
captureMouse(false);
|
||||
|
|
|
@ -65,6 +65,7 @@ private:
|
|||
bool m_is_ingame_cursor;
|
||||
bool m_is_fullscreen;
|
||||
bool m_show_stats;
|
||||
bool m_was_game_mode = false;
|
||||
os::CursorType m_cursor_type = os::CursorType::DEFAULT;
|
||||
struct
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue