-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reloading resources from "Debug" menu #2928
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank the gato gods 🙏🏼
My train of thought to test this was to load the game, and remove an image. If it works then it should display a missing texture, because the images are no longer there, which resulted in this:
(The game closed after this was printed.)
I found another thing, which Im not sure if its related directly to this PR, but I might as well mention it. When this happened I thought "Well that sucks, but if I open the game again I should be able to add the images back in after opening and hit reload resources to make them appear.", but when I opened the level again, the scripted object which had the image was not there at all. I closed the game, added the images back in, and reopened the level, and the scripted object was back again. |
It reloads everything loaded since the start of the game.
Doesn't matter where the script object is, the resource is loaded into the game separately in its own manager. |
src/supertux/menu/debug_menu.cpp
Outdated
SpriteManager::current()->reload(); | ||
TileManager::current()->reload(); | ||
}) | ||
.set_help(_("Reloads all fonts, textures, sprites and tilesets.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fonts don't reload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resources::load()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fonts don't reload, but because most modders don't care about changing the fonts, this should be good to go.
It's not, because it's supposed to do that too. Will look into it. |
TTF fonts now properly reload. |
The new "Reload Resources" option in the "Debug" menu allows for reloading all fonts, textures, sprites and tilesets.
Additionally:
name
field for sprites. I honestly didn't know it existed before, and don't know what the point of it is, considering it's not referenced anywhere in the code, other than in logs, where a filename can be used instead.Closes #2901.