mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 00:13:08 +00:00
added minor suggestions from pr
This commit is contained in:
parent
9e9cd41c27
commit
05c98bc4f3
@ -7,10 +7,10 @@
|
|||||||
|
|
||||||
namespace DiscordRPCHandler {
|
namespace DiscordRPCHandler {
|
||||||
|
|
||||||
void RPC::init() {
|
void RPC::init(const std::string& appId) {
|
||||||
DiscordEventHandlers handlers{};
|
DiscordEventHandlers handlers{};
|
||||||
std::string discordAppId = "1290207945476280360";
|
|
||||||
Discord_Initialize(discordAppId.c_str(), &handlers, 1, nullptr);
|
Discord_Initialize(appId.c_str(), &handlers, 1, nullptr);
|
||||||
startTimestamp = time(nullptr);
|
startTimestamp = time(nullptr);
|
||||||
enabled = true;
|
enabled = true;
|
||||||
}
|
}
|
||||||
@ -18,7 +18,7 @@ void RPC::init() {
|
|||||||
void RPC::setStatusIdling() {
|
void RPC::setStatusIdling() {
|
||||||
DiscordRichPresence rpc{};
|
DiscordRichPresence rpc{};
|
||||||
rpc.largeImageKey = "https://github.com/shadps4-emu/shadPS4/raw/main/.github/shadps4.png";
|
rpc.largeImageKey = "https://github.com/shadps4-emu/shadPS4/raw/main/.github/shadps4.png";
|
||||||
rpc.largeImageText = "ShadPS4 is a PS4 emulator";
|
rpc.largeImageText = "shadPS4 is a PS4 emulator";
|
||||||
rpc.startTimestamp = startTimestamp;
|
rpc.startTimestamp = startTimestamp;
|
||||||
rpc.details = "Idle";
|
rpc.details = "Idle";
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class RPC {
|
|||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void init();
|
void init(const std::string& appId);
|
||||||
void setStatusIdling();
|
void setStatusIdling();
|
||||||
void setStatusPlaying(const std::string& game_name, const std::string& game_id);
|
void setStatusPlaying(const std::string& game_name, const std::string& game_id);
|
||||||
};
|
};
|
||||||
|
@ -71,7 +71,7 @@ bool MainWindow::Init() {
|
|||||||
statusBar->showMessage(statusMessage);
|
statusBar->showMessage(statusMessage);
|
||||||
|
|
||||||
// Initialize Discord RPC
|
// Initialize Discord RPC
|
||||||
discordRPC.init();
|
discordRPC.init("1290207945476280360");
|
||||||
discordRPC.setStatusIdling();
|
discordRPC.setStatusIdling();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user