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 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 08:51:57 -05:00
parent 7fc21407c3
commit f00f464e9f
3 changed files with 9 additions and 8 deletions

View File

@@ -590,13 +590,14 @@ class App:
def discord_row(self, game_dir): 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 """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): def on(v):
try: try:
gameini.put(game_dir, 'discord', 'discord_rpc', '1' if v else '0') gameini.put(game_dir, 'discord', 'discord_rpc', '1' if v else '0')
except OSError as e: except OSError as e:
self.message = f'The game\'s settings could not be written: {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. ' 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).',)) 'The game\'s menu switches it too (Game tab).',))

View File

@@ -334,9 +334,9 @@
[discord] [discord]
# Rich Presence: "Playing NX2navi" with the play time in your Discord status while the game runs, through the # 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 # local IPC of a running Discord client; without one it does nothing. 0 = off. The Game tab of the settings menu (F1)
# switch it too, and a change in the menu reaches the presence thread at once. # and the launcher's Settings switch it too, and a change in the menu reaches the presence thread at once.
# discord_rpc = 0 # discord_rpc = 1
# The Discord application whose name ("Playing <name>") and artwork the status shows: its Application ID from # The Discord application whose name ("Playing <name>") and artwork the status shows: its Application ID from
# discord.com/developers/applications (General Information), digits only. Default: the NX2navi application, built # 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 # in from runtime/discord_app.h (NX2NAVI_DISCORD_APP_ID_DEFAULT). Register your own application to choose another

View File

@@ -182,9 +182,9 @@ static const CfgMeta metas[] = {
{"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE}, {"WALK_KEY", "none", NULL, LIVE}, {"WALK_SCALE", "0.51", "0.2..0.9", LIVE},
{"MENU_LANG", "", "en|ru|pt-BR|zh-Hans", LIVE}, {"MENU_LANG", "", "en|ru|pt-BR|zh-Hans", LIVE},
{"AMIIBO_DIR", "", NULL, 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 // Discord Rich Presence (discord_rpc.c): on by default (it only talks to a Discord client running on this PC, and
// Settings switch it. The application's id and art key default to discord_app.h's NX2NAVI_DISCORD_*_DEFAULT. // 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", "0", "0|1", LIVE}, {"DISCORD_RPC", "1", "0|1", LIVE},
{"DISCORD_APP_ID", NX2NAVI_DISCORD_APP_ID_DEFAULT, NULL, LIVE}, {"DISCORD_APP_ID", NX2NAVI_DISCORD_APP_ID_DEFAULT, NULL, LIVE},
{"DISCORD_IMAGE", NX2NAVI_DISCORD_IMAGE_DEFAULT, NULL, LIVE}, {"DISCORD_IMAGE", NX2NAVI_DISCORD_IMAGE_DEFAULT, NULL, LIVE},
// Advanced: scheduling // Advanced: scheduling