Commits

Neive committed 0c57471

Fixed game specific settings (breakpoints) not always saving

  • Participants
  • Parent commits ef19045

Comments (0)

Files changed (2)

debugger/debuggerframe.cpp

 
     CreateMenubar();
 
-    Bind(wxEVT_COMMAND_MENU_SELECTED, &DebuggerFrame::MenuClose, this, wxID_CLOSE);
+    Bind(wxEVT_COMMAND_MENU_SELECTED, &DebuggerFrame::Close, this, wxID_CLOSE);
     Bind(wxEVT_CLOSE_WINDOW, &DebuggerFrame::Close, this);
     Bind(wxEVT_COMMAND_MENU_SELECTED, &DebuggerFrame::MenuAddPanel, this, break_panel_id, last_panel_id - 1);
     Bind(wxEVT_COMMAND_MENU_SELECTED, &DebuggerFrame::MenuState, this, state_run_id, last_state_id - 1);
     if (!g_debugger)
         return;
     g_debugger->SaveConfig();
-    // I don't think this is necessary?
-    //g_debugger->SaveGameValues();
     g_debugger->breakpoints->Clear(); // Destroy() is delayed, but this uses functions that will be unloaded
     g_debugger->Destroy();
 }
 
-void DebuggerFrame::Close(wxCloseEvent &evt)
+// Called when debugger was closed but game is still running
+void DebuggerFrame::Close(wxEvent &evt)
 {
+    g_debugger->SaveGameValues();
     Delete();
 }
 
         printf("Debugger: %s\n", (const char *)msg);
 }
 
-void DebuggerFrame::MenuClose(wxCommandEvent &evt)
-{
-    Delete();
-}
-
 void DebuggerFrame::UpdatePanels(bool vi)
 {
     wxAuiPaneInfoArray &panes = aui->GetAllPanes();

debugger/debuggerframe.h

         static void GameClosed();
 
         void ProcessCallback(wxCommandEvent &evt);
-        void Close(wxCloseEvent &evt);
-        void MenuClose(wxCommandEvent &evt);
+        void Close(wxEvent &evt);
         void MenuAddPanel(wxCommandEvent &evt);
         void MenuState(wxCommandEvent &evt);
         void MenuOption(wxCommandEvent &evt);