This commit is contained in:
Nayla Hanegan 2024-05-12 02:17:59 -04:00
commit 98c174edc4
520 changed files with 74815 additions and 58942 deletions

View file

@ -43,6 +43,7 @@
#include "Core/IOS/FS/FileSystem.h"
#include "Core/NetPlayServer.h"
#include "Core/SyncIdentifier.h"
#include "Core/System.h"
#include "DolphinQt/NetPlay/ChunkedProgressDialog.h"
#include "DolphinQt/NetPlay/GameDigestDialog.h"
@ -584,7 +585,7 @@ void NetPlayDialog::UpdateDiscordPresence()
m_current_game_name);
};
if (Core::IsRunning())
if (Core::IsRunning(Core::System::GetInstance()))
return use_default();
if (IsHosting())
@ -808,7 +809,7 @@ void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color,
QColor c(color.empty() ? QStringLiteral("white") : QString::fromStdString(color));
if (g_ActiveConfig.bShowNetPlayMessages && Core::IsRunning())
if (g_ActiveConfig.bShowNetPlayMessages && Core::IsRunning(Core::System::GetInstance()))
g_netplay_chat_ui->AppendChat(msg.toStdString(),
{static_cast<float>(c.redF()), static_cast<float>(c.greenF()),
static_cast<float>(c.blueF())});
@ -908,7 +909,7 @@ void NetPlayDialog::OnMsgStopGame()
void NetPlayDialog::OnMsgPowerButton()
{
if (!Core::IsRunning())
if (!Core::IsRunning(Core::System::GetInstance()))
return;
QueueOnObject(this, [] { UICommon::TriggerSTMPowerEvent(); });
}
@ -972,9 +973,13 @@ void NetPlayDialog::OnHostInputAuthorityChanged(bool enabled)
void NetPlayDialog::OnDesync(u32 frame, const std::string& player)
{
DisplayMessage(tr("Possible desync detected: %1 might have desynced at frame %2")
DisplayMessage(tr("Possible desync detected: %1 might have desynced at frame %2. Game restart advised.")
.arg(QString::fromStdString(player), QString::number(frame)),
"red", OSD::Duration::VERY_LONG);
OSD::AddTypedMessage(OSD::MessageType::NetPlayDesync,
"Possible desync detected. Game restart advised.",
OSD::Duration::VERY_LONG, OSD::Color::RED);
}
void NetPlayDialog::OnConnectionLost()
@ -1283,3 +1288,13 @@ void NetPlayDialog::SetHostWiiSyncData(std::vector<u64> titles, std::string redi
if (client)
client->SetWiiSyncData(nullptr, std::move(titles), std::move(redirect_folder));
}
void NetPlayDialog::OnActiveGeckoCodes(std::string codeStr)
{
DisplayMessage(QString::fromStdString(codeStr), "cornflowerblue");
}
void NetPlayDialog::OnActiveARCodes(std::string codeStr)
{
DisplayMessage(QString::fromStdString(codeStr), "cornflowerblue");
}