Skip to content

Fix: Respect the Better Save Menu enable toggle - #6970

Merged
serprex merged 1 commit into
HarbourMasters:developfrom
meldridge:fix-better-save-menu-toggle
Jul 23, 2026
Merged

Fix: Respect the Better Save Menu enable toggle#6970
serprex merged 1 commit into
HarbourMasters:developfrom
meldridge:fix-better-save-menu-toggle

Conversation

@meldridge

@meldridge meldridge commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

RegisterBetterSave registered its VB_LOAD_SAVE_MENU and VB_DRAW_SAVE_MENU hooks unconditionally, and hardcoded the save/continue text overrides to true, so the feature applied regardless of the enable checkbox and toggling it off did nothing. CVAR_BETTERSAVE_VALUE was defined but never read.

Gate all five hooks on CVAR_BETTERSAVE_VALUE (COND_VB_SHOULD for the two vanilla-behavior hooks, the condition arg for the three OnOpenText hooks). RegisterShipInitFunc already re-runs RegisterBetterSave when CVAR_BETTERSAVE changes, so the COND_* macros unregister the hooks when it is off and re-register them when it is on.

Build Artifacts

RegisterBetterSave registered its VB_LOAD_SAVE_MENU and VB_DRAW_SAVE_MENU
hooks unconditionally, and hardcoded the save/continue text overrides to
`true`, so the feature applied regardless of the enable checkbox and
toggling it off did nothing. CVAR_BETTERSAVE_VALUE was defined but never
read.

Gate all five hooks on CVAR_BETTERSAVE_VALUE (COND_VB_SHOULD for the two
vanilla-behavior hooks, the condition arg for the three OnOpenText hooks).
RegisterShipInitFunc already re-runs RegisterBetterSave when CVAR_BETTERSAVE
changes, so the COND_* macros unregister the hooks when it is off and
re-register them when it is on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serprex
serprex merged commit c71203a into HarbourMasters:develop Jul 23, 2026
5 checks passed
@leggettc18

leggettc18 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

I guess I misunderstood the shipinit stuff, I thought that having the CVar in the RegisterShipInitFunc would've handled only registering the hooks when the CVar was on.

@meldridge
meldridge deleted the fix-better-save-menu-toggle branch July 23, 2026 20:56
@garrettjoecox

Copy link
Copy Markdown
Contributor

I guess I misunderstood the shipinit stuff, I thought that having the CVar in the RegisterShipInitFunc would've handled only registering the hooks when the CVar was on.

Having the CVAR in the ShipInit register portion means the entire block will fire when that cvar changes, whether it changes to be on or off (or changes to a different state for ints etc)

So inside the block you use the COND_'s which will do the unregister/register appropriately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants