Fix: Respect the Better Save Menu enable toggle - #6970
Merged
serprex merged 1 commit intoJul 23, 2026
Conversation
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>
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. |
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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