summaryrefslogtreecommitdiff
path: root/builtin/mm_menubar.lua
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-08-20 22:38:14 +0200
committerKahrl <kahrl@gmx.net>2013-09-11 00:08:56 +0200
commit3c4734d69a44aea133e5bd7df66a5dedb87785fb (patch)
treef3961c8855c0d864b672ae79857de9b993c3e95c /builtin/mm_menubar.lua
parentda9fe6485134ec81cc3628b1bc4847c3b2226c76 (diff)
downloadminetest-3c4734d69a44aea133e5bd7df66a5dedb87785fb.tar.gz
minetest-3c4734d69a44aea133e5bd7df66a5dedb87785fb.tar.bz2
minetest-3c4734d69a44aea133e5bd7df66a5dedb87785fb.zip
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".
Diffstat (limited to 'builtin/mm_menubar.lua')
-rw-r--r--builtin/mm_menubar.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/mm_menubar.lua b/builtin/mm_menubar.lua
index faba92a8f..c3ddbb289 100644
--- a/builtin/mm_menubar.lua
+++ b/builtin/mm_menubar.lua
@@ -51,7 +51,8 @@ function menubar.refresh()
menubar.formspec = menubar.formspec ..
"image_button[" .. buttonpos .. ",5.7;1.3,1.3;" ..
- gamemgr.games[i].menuicon_path .. ";" .. btn_name .. ";;true;false]"
+ engine.formspec_escape(gamemgr.games[i].menuicon_path) .. ";" ..
+ btn_name .. ";;true;false]"
else
local part1 = gamemgr.games[i].id:sub(1,5)
@@ -75,4 +76,4 @@ function menubar.refresh()
table.insert(menubar.buttons,toadd)
end
-end \ No newline at end of file
+end