mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
CheatsManager: Create ARCodeWidget and GeckoCodeWidget only once.
Create ARCodeWidget and GeckoCodeWidget once on startup rather than every time a game is launched or shutdown. In addition to losing focus on the tab (since the previous widget and tab no longer existed), the behavior prior to this commit could cause a crash if the user initiated a game shutdown and then opened a code edit window since the AR/GeckoCodeWidget would get deleted in the meantime.
This commit is contained in:
@ -15,6 +15,7 @@ namespace ActionReplay
|
||||
struct ARCode;
|
||||
}
|
||||
|
||||
class CheatCodeEditor;
|
||||
class CheatWarningWidget;
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
class HardcoreWarningWidget;
|
||||
@ -31,6 +32,7 @@ public:
|
||||
explicit ARCodeWidget(std::string game_id, u16 game_revision, bool restart_required = true);
|
||||
~ARCodeWidget() override;
|
||||
|
||||
void ChangeGame(std::string game_id, u16 game_revision);
|
||||
void AddCode(ActionReplay::ARCode code);
|
||||
|
||||
signals:
|
||||
@ -71,6 +73,8 @@ private:
|
||||
QPushButton* m_code_edit;
|
||||
QPushButton* m_code_remove;
|
||||
|
||||
CheatCodeEditor* m_cheat_code_editor;
|
||||
|
||||
std::vector<ActionReplay::ARCode> m_ar_codes;
|
||||
bool m_restart_required;
|
||||
};
|
||||
|
Reference in New Issue
Block a user