Merge pull request #7564 from Techjar/netplay-sync-wii-shutdown

NetPlay: Sync power button event
This commit is contained in:
Pierre Bourdon
2018-11-13 22:33:59 +01:00
committed by GitHub
7 changed files with 44 additions and 0 deletions

View File

@ -744,6 +744,10 @@ bool MainWindow::RequestStop()
if (Core::GetState() == Core::State::Paused)
Core::SetState(Core::State::Running);
// Tell NetPlay about the power event
if (NetPlay::IsNetPlayRunning())
NetPlay::SendPowerButtonEvent();
return true;
}

View File

@ -54,6 +54,7 @@
#include "UICommon/DiscordPresence.h"
#include "UICommon/GameFile.h"
#include "UICommon/UICommon.h"
#include "VideoCommon/VideoConfig.h"
@ -797,6 +798,13 @@ void NetPlayDialog::OnMsgStopGame()
QueueOnObject(this, [this] { UpdateDiscordPresence(); });
}
void NetPlayDialog::OnMsgPowerButton()
{
if (!Core::IsRunning())
return;
QueueOnObject(this, [] { UICommon::TriggerSTMPowerEvent(); });
}
void NetPlayDialog::OnPadBufferChanged(u32 buffer)
{
QueueOnObject(this, [this, buffer] {

View File

@ -46,6 +46,7 @@ public:
void OnMsgChangeGame(const std::string& filename) override;
void OnMsgStartGame() override;
void OnMsgStopGame() override;
void OnMsgPowerButton() override;
void OnPadBufferChanged(u32 buffer) override;
void OnHostInputAuthorityChanged(bool enabled) override;
void OnDesync(u32 frame, const std::string& player) override;