From f00f464e9f68903c89b56f5beeb8a1a65b1e7f4e Mon Sep 17 00:00:00 2001 From: chrg6 Date: Mon, 9 Nov 2026 08:51:57 -0500 Subject: [PATCH] Turn Discord Rich Presence on by default. It talks only to a Discord client running on the same PC and does nothing without one; discord_rpc = 0, the Game tab of the settings menu or the launcher's Discord Status row turns it off. The launcher's row reads an empty or missing value as on, as the game does. Co-Authored-By: Claude Opus 5.5 --- launcher/ui/app.py | 5 +++-- nx2navi.ini.example | 6 +++--- runtime/cfg.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/launcher/ui/app.py b/launcher/ui/app.py index cb6619aa..03bccb8d 100644 --- a/launcher/ui/app.py +++ b/launcher/ui/app.py @@ -590,13 +590,14 @@ class App: def discord_row(self, game_dir): """The game's discord_rpc setting (runtime/discord_rpc.c), kept in the game's nx2navi.ini as the game's own - menu keeps it; the game reads it when it starts.""" + menu keeps it; the game reads it when it starts. On unless the file says 0, as the game reads it (cfg_bool, default + on).""" def on(v): try: gameini.put(game_dir, 'discord', 'discord_rpc', '1' if v else '0') except OSError as e: self.message = f'The game\'s settings could not be written: {e}' - return Row('toggle', 'Discord Status', on=on, get=lambda: gameini.get(game_dir, 'discord_rpc') == '1', + return Row('toggle', 'Discord Status', on=on, get=lambda: gameini.get(game_dir, 'discord_rpc') != '0', desc=('Show "Playing NX2navi" with your play time in your Discord status while the game runs. ' 'The game\'s menu switches it too (Game tab).',)) diff --git a/nx2navi.ini.example b/nx2navi.ini.example index 8f0e912a..7ed61917 100644 --- a/nx2navi.ini.example +++ b/nx2navi.ini.example @@ -334,9 +334,9 @@ [discord] # Rich Presence: "Playing NX2navi" with the play time in your Discord status while the game runs, through the -# local IPC of a running Discord client. 1 = on; the Game tab of the settings menu (F1) and the launcher's Settings -# switch it too, and a change in the menu reaches the presence thread at once. -# discord_rpc = 0 +# local IPC of a running Discord client; without one it does nothing. 0 = off. The Game tab of the settings menu (F1) +# and the launcher's Settings switch it too, and a change in the menu reaches the presence thread at once. +# discord_rpc = 1 # The Discord application whose name ("Playing ") and artwork the status shows: its Application ID from # discord.com/developers/applications (General Information), digits only. Default: the NX2navi application, built # in from runtime/discord_app.h (NX2NAVI_DISCORD_APP_ID_DEFAULT). Register your own application to choose another diff --git a/runtime/cfg.c b/runtime/cfg.c index 4dec61ad..caee76be 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -182,9 +182,9 @@ static const CfgMeta metas[] = { {"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE}, {"MENU_LANG", "", "en|ru|pt-BR|zh-Hans", LIVE}, {"AMIIBO_DIR", "", NULL, LIVE}, - // Discord Rich Presence (discord_rpc.c): off by default, the Game tab of the settings menu and the launcher's - // Settings switch it. The application's id and art key default to discord_app.h's NX2NAVI_DISCORD_*_DEFAULT. - {"DISCORD_RPC", "0", "0|1", LIVE}, + // Discord Rich Presence (discord_rpc.c): on by default (it only talks to a Discord client running on this PC, and + // does nothing without one); the Game tab of the settings menu and the launcher's Settings switch it. The application's id and art key default to discord_app.h's NX2NAVI_DISCORD_*_DEFAULT. + {"DISCORD_RPC", "1", "0|1", LIVE}, {"DISCORD_APP_ID", NX2NAVI_DISCORD_APP_ID_DEFAULT, NULL, LIVE}, {"DISCORD_IMAGE", NX2NAVI_DISCORD_IMAGE_DEFAULT, NULL, LIVE}, // Advanced: scheduling