Modularize Discord RPC (#247)

This commit delegates all Discord-related functions to DiscordManager.gd and adds a project setting bool to toggle using Discord RPC at all. Toggling off will reduce cpu and memory overhead when Discord is not needed.
This commit is contained in:
Jeod
2025-09-26 09:56:44 -04:00
committed by GitHub
parent c2eafee352
commit 1c309ce731
9 changed files with 72 additions and 29 deletions

View File

@@ -75,7 +75,7 @@ func _ready() -> void:
if Global.current_game_mode == Global.GameMode.CAMPAIGN:
SaveManager.write_save(Global.current_campaign)
Global.set_discord_status("Playing " + Global.current_campaign + ": " + str(world_num) + "-" + str(Global.level_num))
DiscordManager.set_discord_status("Playing " + Global.current_campaign + ": " + str(world_num) + "-" + str(Global.level_num))
$BG/Control/WorldNum.text = str(world_num) +"-" + str(Global.level_num)
if Settings.file.difficulty.inf_lives:
$BG/Control/LivesCount.text = "* ∞"