Feature/global world settings#49
Closed
bohemianjack wants to merge 8 commits intorockfactory:mainfrom
Closed
Conversation
- Add Game.allowedBuildings to track globally unlocked buildings per save - Add Factory.allowedBuildings for factory-specific building overrides for the global settings - Supports Satisfactory-style persistent building unlocks
- Initialize new games with empty allowedBuildings array - Add toggleGameBuilding() to manage individual buildings - Add setGameAllowedBuildings() for batch updates - Add enableAllGameBuildings() and disableAllGameBuildings() helpers - Add useGameAllowedBuildings() hook for UI access
- Add setFactoryAllowedBuildings() to enable/disable factory overrides - Add toggleFactoryBuilding() for granular factory building control - Allows factories to have custom building settings independent of game
- Update createSolver() to accept allowedBuildings parameter - Calculate blockedBuildings based on allowedBuildings - Solvers inherit factory-specific buildings or fall back to game-level - Ensures solver respects building availability constraints
- Add syncGameBuildingsToFactories() to propagate game building changes - Respects factory-level overrides when syncing - Keeps all factories aligned with game settings unless overridden
- Add Available Buildings section with checkboxes for each building - Add Enable All / Disable All buttons for quick configuration - Buildings automatically sync to all factories on change - Provides clear explanation of Satisfactory-style unlock system
- Add Factory Override toggle switch in solver limitations - Allow factories to override global building settings - Checkboxes disabled when using global settings - Shows contextual help text based on override state - Enables specialized factory configurations
Author
|
Sorry meant to do this in my forked project, will push when changes are finalized. |
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.
Code Changes Summary: feature/global-world-settings (2025-11-15)
TL;DR
Why This Matters
Players and planners often want to impose rules on which buildings are permissible (challenge runs, milestones, server rules, or performance limits). Until now, these constraints were manual and easy to violate by accident. With global building permissions and factory-level overrides:
Scope
Introduce world-level building management with per-factory overrides; ensure solver enforcement; add intuitive UI and syncing so settings persist and travel with the save.
Key Changes (by commit message)
allowedBuildingsfield to Game and Factory interfaces (older base commit; later rewritten for author)Functional Highlights
allowedBuildingsdefine the baseline set of permissible buildings.UX Details
Modules/Areas Touched (high-level)
src/games/settings/— settings UI for building managementsrc/factories/— per-factory override controls and statesrc/recipes/andsrc/solver/— enforcement of building restrictionssrc/core/andsrc/games/— data shapes (allowedBuildings) and store slicesBackward Compatibility & Migration
allowedBuildingsis present where needed without user action.Verification