Refresh world list to show newly created worlds #176#373
Draft
ModMaker101 wants to merge 5 commits intosmartcmd:mainfrom
Draft
Refresh world list to show newly created worlds #176#373ModMaker101 wants to merge 5 commits intosmartcmd:mainfrom
ModMaker101 wants to merge 5 commits intosmartcmd:mainfrom
Conversation
void2012
requested changes
Mar 4, 2026
Contributor
|
My PR adds logic to rread the LevelName from the level.dat NBT inside the saveData.ms. Perhaps we could merge the architectural improvements (using smart pointers and std::vector for LevelStorageSource) from your PR with the Windows pathng/NBT logic from mine? Since they address some of the same issues |
Collaborator
|
#201 partially resolved this but it would be useful to still have this as it seems like a general improvement over the current way the world list works |
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.
Description
Ensure newly created or saved worlds appear immediately in the world section UIs without requiring a full game restart. This PR forces a refresh of save metadata and level lists in the affected menus and modernizes
LeveStorageSourcelist APIs to use smart pointers and value returnedstd::vectores.Changes
Previous Behavior
-The lists were populated from cached data and only refreshed on first use or after a game restart.
SelectWorldScreenheld a vector<LevelSummary*>* and dereferenced entries via->at(i)making refresh logic awkward.McRegionLevelStorageSource::getLevelList()returned an empty vector or didn't enumerate filesystem entries for levels, so the in-session refresh had nothing new to display.Root Cause
SelectWorldScreen::postInit()did not refetch the level list when returning from a play session.LevelSummary*made ownership unclear and discouraged repopulation. The lack of a consistent value returned container led to stale data persisting across screen lifecycles.MCRegionLevelStorageSource::getLevelLis()previously contained disabled directory logic, as a result of this it didn't rebuild the list during a refresh.New Behavior
Fix Implementation
Related Issues
#176
#201
2026-03-03.22-22-06.mp4
if the video doesn't make sense there were 4 worlds before then I made a new one then it created the new one then I scrolled back down and there were 5 because it refreshed.