aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/discord_impl.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-10-14 14:12:22 -0400
committerGitHub <noreply@github.com>2021-10-14 14:12:22 -0400
commitb02d662980a401057d2ff7c1522d47f9f6538d81 (patch)
tree2717ff56b111eb1adfcb712e14ad69f25ab76b68 /src/yuzu/discord_impl.cpp
parent894b483a0d619c3ceaa79fa0ff4cef6d37301f9c (diff)
parentb6894bfc5b86c2fae0b401f2cfc294a08994781d (diff)
Merge pull request #6774 from lat9nq/remove-global-yuzu
yuzu qt: Remove global system instances
Diffstat (limited to 'src/yuzu/discord_impl.cpp')
-rw-r--r--src/yuzu/discord_impl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/yuzu/discord_impl.cpp b/src/yuzu/discord_impl.cpp
index a93733b26..66f928af6 100644
--- a/src/yuzu/discord_impl.cpp
+++ b/src/yuzu/discord_impl.cpp
@@ -13,7 +13,7 @@
namespace DiscordRPC {
-DiscordImpl::DiscordImpl() {
+DiscordImpl::DiscordImpl(Core::System& system_) : system{system_} {
DiscordEventHandlers handlers{};
// The number is the client ID for yuzu, it's used for images and the
@@ -35,12 +35,13 @@ void DiscordImpl::Update() {
std::chrono::system_clock::now().time_since_epoch())
.count();
std::string title;
- if (Core::System::GetInstance().IsPoweredOn())
- Core::System::GetInstance().GetAppLoader().ReadTitle(title);
+ if (system.IsPoweredOn()) {
+ system.GetAppLoader().ReadTitle(title);
+ }
DiscordRichPresence presence{};
presence.largeImageKey = "yuzu_logo";
presence.largeImageText = "yuzu is an emulator for the Nintendo Switch";
- if (Core::System::GetInstance().IsPoweredOn()) {
+ if (system.IsPoweredOn()) {
presence.state = title.c_str();
presence.details = "Currently in game";
} else {