From 3c4734d69a44aea133e5bd7df66a5dedb87785fb Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 20 Aug 2013 22:38:14 +0200 Subject: 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". --- builtin/mainmenu.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'builtin/mainmenu.lua') diff --git a/builtin/mainmenu.lua b/builtin/mainmenu.lua index 787a5e280..5a1b6e929 100644 --- a/builtin/mainmenu.lua +++ b/builtin/mainmenu.lua @@ -1047,16 +1047,17 @@ function tabbuilder.tab_texture_packs() return retval .. menu.render_texture_pack_list(list) .. ";" .. index .. "]" .. - "image[0.65,0.25;4.0,3.7;"..(screenfile or no_screenshot).."]".. + "image[0.65,0.25;4.0,3.7;"..engine.formspec_escape(screenfile or no_screenshot).."]".. "textarea[1.0,3.25;3.7,1.5;;"..engine.formspec_escape(infotext or "")..";]" end -------------------------------------------------------------------------------- function tabbuilder.tab_credits() + local logofile = menu.defaulttexturedir .. "logo.png" return "vertlabel[0,-0.5;CREDITS]" .. "label[0.5,3;Minetest " .. engine.get_version() .. "]" .. "label[0.5,3.3;http://minetest.net]" .. - "image[0.5,1;" .. menu.defaulttexturedir .. "logo.png]" .. + "image[0.5,1;" .. engine.formspec_escape(logofile) .. "]" .. "textlist[3.5,-0.25;8.5,5.8;list_credits;" .. "#FFFF00" .. fgettext("Core Developers") .."," .. "Perttu Ahola (celeron55) ,".. -- cgit v1.2.3