Add debug menu item for spawning nested mapgen #37788
Merged
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.
Summary
SUMMARY: Infrastructure "Add debug menu item for spawning nested mapgen"
Purpose of change
Makes it easier to develop and test nested mapgen by allowing them to be spawned from the debug menu.
Describe the solution
Add a new entry to the debug menu that lists all of the nested mapgens and allow selecting one, plus a target location to spawn it. Then load a map for that area and run the nested mapgen on it. Note that this code will get cleaner once we refactor all of mapgen to support multi-z-level and multi-omt mapgen, but for now nested mapgen can only target a single omt (and thus a single z-level), so to ensure this works we basically load a larger slice of map with a single z-level to run the nested mapgen on because the user selected location won't necessarily align to the omt grid and the nesting requires a single z-level.
Testing
Loaded the game and spawned a variety of nested mapgens (with things like NPCs and vehicles in addition to standard terrain and furniture) on various z-levels.
Additional context