From e17a0d047ab985d7a0bf9530cf8e4f4e9c773278 Mon Sep 17 00:00:00 2001 From: sector-a Date: Thu, 12 Mar 2026 16:41:16 +0300 Subject: [PATCH] Update the presence after enabling the RPC in Preferences --- source/funkin/Preferences.hx | 7 ++++++- source/funkin/api/discord/DiscordClient.hx | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index a7f5fcfda..ea2b2d83d 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -431,7 +431,7 @@ class Preferences static function get_enabledDiscordRPC():Bool { - return Save?.instance?.options?.enabledDiscordRPC ?? false; + return Save?.instance?.options?.enabledDiscordRPC ?? true; } static function set_enabledDiscordRPC(value:Bool):Bool @@ -454,6 +454,11 @@ class Preferences if (enable) { DiscordClient.instance.init(); + + if (DiscordClient.presenceParamsCache != null) + { + DiscordClient.instance.setPresence(DiscordClient.presenceParamsCache); + } } else { diff --git a/source/funkin/api/discord/DiscordClient.hx b/source/funkin/api/discord/DiscordClient.hx index 396a0a862..865a7c0dc 100644 --- a/source/funkin/api/discord/DiscordClient.hx +++ b/source/funkin/api/discord/DiscordClient.hx @@ -33,6 +33,11 @@ class DiscordClient var handlers:DiscordEventHandlers; + /** + * Latest passed parameters for the presence. + */ + public static var presenceParamsCache:Null; + private function new() { trace(' DISCORD '.bold().bg_blue() + ' Initializing event handlers...'); @@ -99,6 +104,8 @@ class DiscordClient public function setPresence(params:DiscordClientPresenceParams):Void { + presenceParamsCache = params; + var presence:DiscordRichPresence = new DiscordRichPresence(); // Presence should always be playing the game.