Update discord state
This commit is contained in:
parent
67fc5630f7
commit
c3f7976ed3
@ -2,12 +2,15 @@
|
||||
#include <discord_rpc.h>
|
||||
#include "loader/module_loader.hpp"
|
||||
#include "scheduler.hpp"
|
||||
#include "game/game.hpp"
|
||||
|
||||
class discord final : public module
|
||||
{
|
||||
public:
|
||||
void post_load() override
|
||||
{
|
||||
if (game::is_dedi()) return;
|
||||
|
||||
DiscordEventHandlers handlers;
|
||||
ZeroMemory(&handlers, sizeof(handlers));
|
||||
handlers.ready = ready;
|
||||
@ -33,12 +36,12 @@ private:
|
||||
DiscordRichPresence discord_presence;
|
||||
ZeroMemory(&discord_presence, sizeof(discord_presence));
|
||||
|
||||
discord_presence.state = "Cake!";
|
||||
discord_presence.state = game::is_mp() ? "Multiplayer" : "Singleplayer";
|
||||
discord_presence.instance = 1;
|
||||
Discord_UpdatePresence(&discord_presence);
|
||||
}
|
||||
|
||||
static void errored(int error_code, const char* message)
|
||||
static void errored(const int error_code, const char* message)
|
||||
{
|
||||
printf("Discord: (%i) %s", error_code, message);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user