Merge pull request #4134 from RisingFog/move_advancepane_disable

Fix advanced config panel staying disabled after TAS recording
This commit is contained in:
Scott Mansell 2016-09-07 14:18:00 +12:00 committed by GitHub
commit ac6013bff3
3 changed files with 19 additions and 2 deletions

View File

@ -22,6 +22,7 @@ AdvancedConfigPane::AdvancedConfigPane(wxWindow* parent, wxWindowID id) : wxPane
{ {
InitializeGUI(); InitializeGUI();
LoadGUIValues(); LoadGUIValues();
RefreshGUI();
} }
void AdvancedConfigPane::InitializeGUI() void AdvancedConfigPane::InitializeGUI()
@ -208,3 +209,20 @@ void AdvancedConfigPane::UpdateCustomRTC(time_t date, time_t time)
m_custom_rtc_date_picker->SetValue(custom_rtc); m_custom_rtc_date_picker->SetValue(custom_rtc);
m_custom_rtc_time_picker->SetValue(custom_rtc); m_custom_rtc_time_picker->SetValue(custom_rtc);
} }
void AdvancedConfigPane::RefreshGUI()
{
// Don't allow users to edit the RTC while the game is running
if (Core::IsRunning())
{
m_custom_rtc_checkbox->Disable();
m_custom_rtc_date_picker->Disable();
m_custom_rtc_time_picker->Disable();
}
// Allow users to edit CPU clock speed in game, but not while needing determinism
if (Core::IsRunning() && Core::g_want_determinism)
{
m_clock_override_checkbox->Disable();
m_clock_override_slider->Disable();
}
}

View File

@ -20,6 +20,7 @@ public:
private: private:
void InitializeGUI(); void InitializeGUI();
void LoadGUIValues(); void LoadGUIValues();
void RefreshGUI();
void OnClockOverrideCheckBoxChanged(wxCommandEvent&); void OnClockOverrideCheckBoxChanged(wxCommandEvent&);
void OnClockOverrideSliderChanged(wxCommandEvent&); void OnClockOverrideSliderChanged(wxCommandEvent&);

View File

@ -75,8 +75,6 @@ void CConfigMain::CreateGUIControls()
Notebook->AddPage(wii_pane, _("Wii")); Notebook->AddPage(wii_pane, _("Wii"));
Notebook->AddPage(path_pane, _("Paths")); Notebook->AddPage(path_pane, _("Paths"));
Notebook->AddPage(advanced_pane, _("Advanced")); Notebook->AddPage(advanced_pane, _("Advanced"));
if (Core::g_want_determinism)
advanced_pane->Disable();
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
main_sizer->Add(Notebook, 1, wxEXPAND | wxALL, 5); main_sizer->Add(Notebook, 1, wxEXPAND | wxALL, 5);