Merge pull request #7596 from Techjar/netplay-fix-force-stop
NetPlay: Allow force stopping
This commit is contained in:
commit
754d934a18
|
@ -245,6 +245,10 @@ void Stop() // - Hammertime!
|
||||||
|
|
||||||
s_is_stopping = true;
|
s_is_stopping = true;
|
||||||
|
|
||||||
|
// Notify state changed callback
|
||||||
|
if (s_on_state_changed_callback)
|
||||||
|
s_on_state_changed_callback(State::Stopping);
|
||||||
|
|
||||||
// Dump left over jobs
|
// Dump left over jobs
|
||||||
HostDispatchJobs();
|
HostDispatchJobs();
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,11 @@ void NetPlayDialog::ConnectWidgets()
|
||||||
if (isVisible())
|
if (isVisible())
|
||||||
{
|
{
|
||||||
GameStatusChanged(state != Core::State::Uninitialized);
|
GameStatusChanged(state != Core::State::Uninitialized);
|
||||||
|
if ((state == Core::State::Uninitialized || state == Core::State::Stopping) &&
|
||||||
|
!m_got_stop_request)
|
||||||
|
{
|
||||||
|
Settings::Instance().GetNetPlayClient()->RequestStopGame();
|
||||||
|
}
|
||||||
if (state == Core::State::Uninitialized)
|
if (state == Core::State::Uninitialized)
|
||||||
DisplayMessage(tr("Stopped game"), "red");
|
DisplayMessage(tr("Stopped game"), "red");
|
||||||
}
|
}
|
||||||
|
@ -808,9 +813,6 @@ void NetPlayDialog::OnMsgChangeGame(const std::string& title)
|
||||||
|
|
||||||
void NetPlayDialog::GameStatusChanged(bool running)
|
void NetPlayDialog::GameStatusChanged(bool running)
|
||||||
{
|
{
|
||||||
if (!running && !m_got_stop_request)
|
|
||||||
Settings::Instance().GetNetPlayClient()->RequestStopGame();
|
|
||||||
|
|
||||||
QueueOnObject(this, [this, running] { SetOptionsEnabled(!running); });
|
QueueOnObject(this, [this, running] { SetOptionsEnabled(!running); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue