Core::IsRunning: Avoid Global System Accessor

This commit is contained in:
mitaclaw
2024-04-08 20:33:55 -07:00
parent b71fdef356
commit 0df401b164
25 changed files with 90 additions and 74 deletions

View File

@ -1265,14 +1265,17 @@ void MenuBar::OnSelectionChanged(std::shared_ptr<const UICommon::GameFile> game_
{
m_game_selected = !!game_file;
m_recording_play->setEnabled(m_game_selected && !Core::IsRunning());
m_recording_start->setEnabled((m_game_selected || Core::IsRunning()) &&
!Core::System::GetInstance().GetMovie().IsPlayingInput());
auto& system = Core::System::GetInstance();
const bool core_is_running = Core::IsRunning(system);
m_recording_play->setEnabled(m_game_selected && !core_is_running);
m_recording_start->setEnabled((m_game_selected || core_is_running) &&
!system.GetMovie().IsPlayingInput());
}
void MenuBar::OnRecordingStatusChanged(bool recording)
{
m_recording_start->setEnabled(!recording && (m_game_selected || Core::IsRunning()));
auto& system = Core::System::GetInstance();
m_recording_start->setEnabled(!recording && (m_game_selected || Core::IsRunning(system)));
m_recording_stop->setEnabled(recording);
m_recording_export->setEnabled(recording);
}