mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Frame: Make cheat dialog private
Rather than destroy and reinitialize the dialog whenever it's closed, and opened this dialog can just be hidden from view when it's not needed, and shown again when it is needed. Also, a dialog should really not be managing any live instances of itself, including the one directly in the main frame. This gets rid of another usage of the main frame global.
This commit is contained in:
@ -1169,10 +1169,11 @@ void CFrame::OnImportSave(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void CFrame::OnShowCheatsWindow(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (!g_CheatsWindow)
|
||||
g_CheatsWindow = new wxCheatsWindow(this);
|
||||
else
|
||||
g_CheatsWindow->Raise();
|
||||
if (!m_cheats_window)
|
||||
m_cheats_window = new wxCheatsWindow(this);
|
||||
|
||||
m_cheats_window->Show();
|
||||
m_cheats_window->Raise();
|
||||
}
|
||||
|
||||
void CFrame::OnLoadWiiMenu(wxCommandEvent& WXUNUSED(event))
|
||||
@ -1514,12 +1515,12 @@ void CFrame::UpdateGUI()
|
||||
m_Mgr->Update();
|
||||
|
||||
// Update non-modal windows
|
||||
if (g_CheatsWindow)
|
||||
if (m_cheats_window)
|
||||
{
|
||||
if (SConfig::GetInstance().bEnableCheats)
|
||||
g_CheatsWindow->UpdateGUI();
|
||||
m_cheats_window->UpdateGUI();
|
||||
else
|
||||
g_CheatsWindow->Close();
|
||||
m_cheats_window->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user