Skip to content

Commit

Permalink
for new hxdiscord_rpc, lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Jan 12, 2025
1 parent 10b5fd6 commit 597ad52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/backend/Discord.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DiscordClient
public static var isInitialized:Bool = false;
private static final _defaultID:String = "863222024192262205";
public static var clientID(default, set):String = _defaultID;
private static var presence:DiscordRichPresence = DiscordRichPresence.create();
private static var presence:DiscordRichPresence = #if (hxdiscord_rpc > "1.2.4") new DiscordRichPresence(); #else DiscordRichPresence.create(); #end

public static function check()
{
Expand Down Expand Up @@ -54,11 +54,11 @@ class DiscordClient

public static function initialize()
{
var discordHandlers:DiscordEventHandlers = DiscordEventHandlers.create();
var discordHandlers:DiscordEventHandlers = #if (hxdiscord_rpc > "1.2.4") new DiscordEventHandlers(); #else DiscordEventHandlers.create(); #end
discordHandlers.ready = cpp.Function.fromStaticFunction(onReady);
discordHandlers.disconnected = cpp.Function.fromStaticFunction(onDisconnected);
discordHandlers.errored = cpp.Function.fromStaticFunction(onError);
Discord.Initialize(clientID, cpp.RawPointer.addressOf(discordHandlers), 1, null);
Discord.Initialize(clientID, cpp.RawPointer.addressOf(discordHandlers), #if (hxdiscord_rpc > "1.2.4") false #else 1 #end, null);

if(!isInitialized) trace("Discord Client initialized");

Expand Down

0 comments on commit 597ad52

Please sign in to comment.