mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commitbc67fc97c3
, except for the changes in BaseConfigLoader.cpp, which caused the bug that made us revert72cf2bdb87
. PR 12917 contains an improved change to BaseConfigLoader.cpp, which can be merged (or rejected) independently. A few changes have also been made based on review comments.
This commit is contained in:
@ -910,7 +910,7 @@ void MainWindow::OnStopComplete()
|
||||
|
||||
bool MainWindow::RequestStop()
|
||||
{
|
||||
if (!Core::IsRunning(Core::System::GetInstance()))
|
||||
if (Core::IsUninitialized(Core::System::GetInstance()))
|
||||
{
|
||||
Core::QueueHostJob([this](Core::System&) { OnStopComplete(); }, true);
|
||||
return true;
|
||||
@ -1118,7 +1118,7 @@ void MainWindow::StartGame(std::unique_ptr<BootParameters>&& parameters)
|
||||
}
|
||||
|
||||
// If we're running, only start a new game once we've stopped the last.
|
||||
if (Core::GetState(Core::System::GetInstance()) != Core::State::Uninitialized)
|
||||
if (!Core::IsUninitialized(Core::System::GetInstance()))
|
||||
{
|
||||
if (!RequestStop())
|
||||
return;
|
||||
@ -1542,7 +1542,7 @@ void MainWindow::NetPlayInit()
|
||||
|
||||
bool MainWindow::NetPlayJoin()
|
||||
{
|
||||
if (Core::IsRunning(Core::System::GetInstance()))
|
||||
if (!Core::IsUninitialized(Core::System::GetInstance()))
|
||||
{
|
||||
ModalMessageBox::critical(nullptr, tr("Error"),
|
||||
tr("Can't start a NetPlay Session while a game is still running!"));
|
||||
@ -1609,7 +1609,7 @@ bool MainWindow::NetPlayJoin()
|
||||
|
||||
bool MainWindow::NetPlayHost(const UICommon::GameFile& game)
|
||||
{
|
||||
if (Core::IsRunning(Core::System::GetInstance()))
|
||||
if (!Core::IsUninitialized(Core::System::GetInstance()))
|
||||
{
|
||||
ModalMessageBox::critical(nullptr, tr("Error"),
|
||||
tr("Can't start a NetPlay Session while a game is still running!"));
|
||||
@ -1856,7 +1856,7 @@ void MainWindow::OnImportNANDBackup()
|
||||
|
||||
result.wait();
|
||||
|
||||
m_menu_bar->UpdateToolsMenu(Core::IsRunning(Core::System::GetInstance()));
|
||||
m_menu_bar->UpdateToolsMenu(Core::State::Uninitialized);
|
||||
}
|
||||
|
||||
void MainWindow::OnPlayRecording()
|
||||
@ -1888,7 +1888,8 @@ void MainWindow::OnStartRecording()
|
||||
{
|
||||
auto& system = Core::System::GetInstance();
|
||||
auto& movie = system.GetMovie();
|
||||
if (Core::GetState(system) == Core::State::Starting || movie.IsRecordingInput() ||
|
||||
if (Core::GetState(system) == Core::State::Starting ||
|
||||
Core::GetState(system) == Core::State::Stopping || movie.IsRecordingInput() ||
|
||||
movie.IsPlayingInput())
|
||||
{
|
||||
return;
|
||||
@ -1920,7 +1921,7 @@ void MainWindow::OnStartRecording()
|
||||
{
|
||||
emit RecordingStatusChanged(true);
|
||||
|
||||
if (!Core::IsRunning(system))
|
||||
if (Core::IsUninitialized(system))
|
||||
Play();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user