mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-27 03:15:29 +01:00
Change mainmenu texture handling + small misc changes
Texture names must now be escaped in formspec elements image[], background[], image_button[], image_button_exit[]. Instead of special-case handling of texture loading (and unloading which was missing) in guiFormSpecMenu.cpp, use the newly created ISimpleTextureSource interface which is a minimal subset of ITextureSource. There is an implementation of this interface used by GUIEngine (MenuTextureSource). Fix an off-by-one bug in unescape_string; it caused requests for a texture called "\0".
This commit is contained in:
@@ -225,7 +225,8 @@ function gamemgr.tab()
|
||||
if current_game.menuicon_path ~= nil and
|
||||
current_game.menuicon_path ~= "" then
|
||||
retval = retval ..
|
||||
"image[5.8,-0.25;2,2;" .. current_game.menuicon_path .. "]"
|
||||
"image[5.8,-0.25;2,2;" ..
|
||||
engine.formspec_escape(current_game.menuicon_path) .. "]"
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
@@ -251,7 +252,8 @@ function gamemgr.dialog_edit_game()
|
||||
if current_game.menuicon_path ~= nil and
|
||||
current_game.menuicon_path ~= "" then
|
||||
retval = retval ..
|
||||
"image[5.25,0;2,2;" .. current_game.menuicon_path .. "]"
|
||||
"image[5.25,0;2,2;" ..
|
||||
engine.formspec_escape(current_game.menuicon_path) .. "]"
|
||||
end
|
||||
|
||||
retval = retval ..
|
||||
|
||||
Reference in New Issue
Block a user