diff --git a/src/core/devtools/layer.cpp b/src/core/devtools/layer.cpp index 6f163b4f5..0c5993632 100644 --- a/src/core/devtools/layer.cpp +++ b/src/core/devtools/layer.cpp @@ -3,7 +3,7 @@ #include "layer.h" -#include +#include "SDL3/SDL_events.h" #include "SDL3/SDL_log.h" #include "common/config.h" @@ -30,7 +30,7 @@ static bool show_simple_fps = false; static bool visibility_toggled = false; static bool show_fullscreen_tip = true; -static float fullscreen_tip_timer = 5.0f; +static float fullscreen_tip_timer = 8.0f; static float fps_scale = 1.0f; static int dump_frame_count = 1; @@ -362,6 +362,11 @@ void L::SetupSettings() { void L::Draw() { const auto io = GetIO(); PushID("DevtoolsLayer"); + if (IsKeyPressed(ImGuiKey_F4, false)) { + SDL_Event quitEvent; + quitEvent.type = SDL_EVENT_QUIT; + SDL_PushEvent(&quitEvent); + } if (show_fullscreen_tip) { fullscreen_tip_timer -= io.DeltaTime; @@ -371,8 +376,10 @@ void L::Draw() { // Display the fullscreen tip near the top-left corner, below pause message if needed ImVec2 pos(10, 30); // adjust Y so it doesn't overlap pause text at y=10 ImU32 color = IM_COL32(255, 255, 255, 255); - ImGui::GetForegroundDrawList()->AddText( - pos, color, "Press F11 to toggle FullScreen and F9 to Pause Emulation"); + ImGui::GetForegroundDrawList()->AddText(pos, color, + "Press F11 to toggle FullScreen\n" + "F9 to Pause Emulation\n" + "F4 to Stop Game"); } } if (!DebugState.IsGuestThreadsPaused()) { @@ -452,4 +459,4 @@ void L::Draw() { } PopID(); -} +} \ No newline at end of file diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 8390ee5a1..403bad354 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -801,6 +801,12 @@ void MainWindow::CreateConnects() { } void MainWindow::StartGame() { + if (isGameRunning) { + QMessageBox::critical(nullptr, tr("Run Game"), tr("Game is already running!")); + return; + } + + isGameRunning = false; BackgroundMusicPlayer::getInstance().stopMusic(); QString gamePath = ""; int table_mode = m_gui_settings->GetValue(gui::gl_mode).toInt();