Fix campaign save isolation bug and add JSON menu loader infrastructure#27
Draft
Copilot wants to merge 6 commits intofeature/ui-campaign-refactorfrom
Draft
Fix campaign save isolation bug and add JSON menu loader infrastructure#27Copilot wants to merge 6 commits intofeature/ui-campaign-refactorfrom
Copilot wants to merge 6 commits intofeature/ui-campaign-refactorfrom
Conversation
Co-authored-by: Cerwym <1760289+Cerwym@users.noreply.github.com>
Co-authored-by: Cerwym <1760289+Cerwym@users.noreply.github.com>
Co-authored-by: Cerwym <1760289+Cerwym@users.noreply.github.com>
Co-authored-by: Cerwym <1760289+Cerwym@users.noreply.github.com>
Co-authored-by: Cerwym <1760289+Cerwym@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement JSON menu system and fix campaign save bug
Fix campaign save isolation bug and add JSON menu loader infrastructure
Feb 7, 2026
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.
Problem
Campaign progress corruption when switching campaigns. Root cause: single shared continue file
fx1contn.savused by all campaigns, causing Campaign A save loads to overwrite Campaign B'scontinue_level_number.Changes
Campaign Save Isolation (Critical Fix)
fx1_<campaign>_contn.savinstead of shared file[a-zA-Z0-9_-]to prevent path traversalget_safe_campaign_name()for consistent sanitization across save/loadFiles:
src/game_saves.c(+40 lines)JSON Menu Loader (Phase 1)
Foundation for data-driven menu system to replace hardcoded
GuiButtonInitarrays.GuiButtonInitarrays using existing centijson library"center"→POS_SCRCTR), size, sprites, text, callbacksFiles:
src/menu_loader.{c,h}(396 lines),Makefiledependency chainIntegration deferred: Frontend wiring, callback registry, string mapping require additional work.
Breaking Change
fx1contn.savfiles won't be used. Players need to replay campaigns or add migration helper on first run.Security
Path traversal blocked via input sanitization. Campaign names like
../../etc/passwd→etcpasswd.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.