diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 21cfcde0f8..6f9722d496 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -587,8 +587,6 @@ void MainWindow::createMenus() ->addDisableState(UISTATE_MENU); debugMenu->add(new MenuAction(this, SLOT(dumpNextAct()), QT_TR_NOOP("D&ump next frame to log"))) ->addDisableState(UISTATE_MENU); - debugMenu->add(new MenuAction(this, SLOT(statsAct()), QT_TR_NOOP("Show debu&g statistics"))) - ->addEventChecked(&g_Config.bShowDebugStats); debugMenu->addSeparator(); debugMenu->add(new MenuAction(this, SLOT(consoleAct()), QT_TR_NOOP("&Log console"), Qt::CTRL + Qt::Key_L)) ->addDisableState(UISTATE_MENU); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 78981436c0..84b33bcf7a 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -178,10 +178,6 @@ private slots: void fullscrAct(); void raiseTopMost(); - void statsAct() { - g_Config.bShowDebugStats = !g_Config.bShowDebugStats; - System_PostUIMessage("clear jit", ""); - } // Help void websiteAct(); diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index 444124e208..57e38d55b5 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -217,7 +217,7 @@ void OSXOpenURL(const char *url) { item.state = [self controlStateForBool:g_Config.bIgnoreBadMemAccess]; break; case 12: - item.state = [self controlStateForBool:g_Config.bShowDebugStats]; + item.state = [self controlStateForBool:g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS]; break; default: item.enabled = state == UISTATE_INGAME ? YES : NO; @@ -405,7 +405,7 @@ void OSXOpenURL(const char *url) { copyBaseAddr.target = self; copyBaseAddr.tag = 11; - MENU_ITEM(showDebugStatsAction, DESKTOPUI_LOCALIZED("Show Debug Statistics"), @selector(toggleShowDebugStats:), g_Config.bShowDebugStats, 12) + MENU_ITEM(showDebugStatsAction, DESKTOPUI_LOCALIZED("Show Debug Statistics"), @selector(toggleShowDebugStats:), (g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS), 12) [parent addItem:loadSymbolMapAction]; [parent addItem:saveMapFileAction]; @@ -541,9 +541,18 @@ TOGGLE_METHOD(AutoFrameSkip, g_Config.bAutoFrameSkip, g_Config.UpdateAfterSettin TOGGLE_METHOD(SoftwareRendering, g_Config.bSoftwareRendering) TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequestType::TOGGLE_FULLSCREEN_STATE, 0, g_Config.UseFullScreen() ? "1" : "0", "", 3)) // TOGGLE_METHOD(VSync, g_Config.bVSync) -TOGGLE_METHOD(ShowDebugStats, g_Config.bShowDebugStats, System_PostUIMessage("clear jit", "")) #undef TOGGLE_METHOD +-(void)toggleShowDebugStats: (NSMenuItem *)item { \ + if (g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS) { + g_Config.iDebugOverlay = DebugOverlay::OFF; + } else { + g_Config.iDebugOverlay = DebugOverlay::DEBUG_STATS; + } + System_PostUIMessage("clear jit", ""); + item.state = [self controlStateForBool: g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS]; \ +} + -(void)setToggleShowCounterItem: (NSMenuItem *)item { [self addOrRemoveInteger:(int)(item.tag - 100) to:&g_Config.iShowStatusFlags]; item.state = [self controlStateForBool:g_Config.iShowStatusFlags & item.tag];