Skip to content

Commit

Permalink
Add Discord RPC reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Dec 1, 2024
1 parent f5d4667 commit 4b841e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/discord_rpc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Discord {
void init();
void update(RPCStatus status, const std::string& title);
void stop();

bool running() const { return enabled; }
};
} // namespace Discord

Expand Down
13 changes: 13 additions & 0 deletions src/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,17 @@ void Emulator::reloadSettings() {
if (Renderdoc::isSupported() && config.enableRenderdoc && !Renderdoc::isLoaded()) {
loadRenderdoc();
}

#ifdef PANDA3DS_ENABLE_DISCORD_RPC
// Reload RPC setting if we're compiling with RPC support

if (discordRpc.running() != config.discordRpcEnabled) {
if (config.discordRpcEnabled) {
discordRpc.init();
updateDiscord();
} else {
discordRpc.stop();
}
}
#endif
}

0 comments on commit 4b841e6

Please sign in to comment.