diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-04-08 20:33:55 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-05-01 08:54:17 -0700 |
| commit | 0df401b164bbe2b0314b74f1fd6385e852bbe098 (patch) | |
| tree | 9f23d7d5cb33fb3a092d641da621cc9331577b73 /Source/Core/DolphinQt/MainWindow.cpp | |
| parent | b71fdef356caf6ca376c0df474212a192951e810 (diff) | |
Core::IsRunning: Avoid Global System Accessor
Diffstat (limited to 'Source/Core/DolphinQt/MainWindow.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/MainWindow.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index f1c6951595..a96b8be809 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -901,7 +901,7 @@ void MainWindow::OnStopComplete() bool MainWindow::RequestStop() { - if (!Core::IsRunning()) + if (!Core::IsRunning(Core::System::GetInstance())) { Core::QueueHostJob([this](Core::System&) { OnStopComplete(); }, true); return true; @@ -1532,7 +1532,7 @@ void MainWindow::NetPlayInit() bool MainWindow::NetPlayJoin() { - if (Core::IsRunning()) + if (Core::IsRunning(Core::System::GetInstance())) { ModalMessageBox::critical(nullptr, tr("Error"), tr("Can't start a NetPlay Session while a game is still running!")); @@ -1599,7 +1599,7 @@ bool MainWindow::NetPlayJoin() bool MainWindow::NetPlayHost(const UICommon::GameFile& game) { - if (Core::IsRunning()) + if (Core::IsRunning(Core::System::GetInstance())) { ModalMessageBox::critical(nullptr, tr("Error"), tr("Can't start a NetPlay Session while a game is still running!")); @@ -1846,7 +1846,7 @@ void MainWindow::OnImportNANDBackup() result.wait(); - m_menu_bar->UpdateToolsMenu(Core::IsRunning()); + m_menu_bar->UpdateToolsMenu(Core::IsRunning(Core::System::GetInstance())); } void MainWindow::OnPlayRecording() @@ -1876,8 +1876,9 @@ void MainWindow::OnPlayRecording() void MainWindow::OnStartRecording() { - auto& movie = Core::System::GetInstance().GetMovie(); - if ((!Core::IsRunningAndStarted() && Core::IsRunning()) || movie.IsRecordingInput() || + auto& system = Core::System::GetInstance(); + auto& movie = system.GetMovie(); + if ((!Core::IsRunningAndStarted() && Core::IsRunning(system)) || movie.IsRecordingInput() || movie.IsPlayingInput()) { return; @@ -1909,7 +1910,7 @@ void MainWindow::OnStartRecording() { emit RecordingStatusChanged(true); - if (!Core::IsRunning()) + if (!Core::IsRunning(system)) Play(); } } @@ -1970,10 +1971,11 @@ void MainWindow::ShowTASInput() } } + auto& system = Core::System::GetInstance(); for (int i = 0; i < num_wii_controllers; i++) { if (Config::Get(Config::GetInfoForWiimoteSource(i)) == WiimoteSource::Emulated && - (!Core::IsRunning() || Core::System::GetInstance().IsWii())) + (!Core::IsRunning(system) || system.IsWii())) { SetQWidgetWindowDecorations(m_wii_tas_input_windows[i]); m_wii_tas_input_windows[i]->show(); |
