Fix forgotten favourite list image update of simple menu

experimental
sapier 2015-01-04 17:37:45 +01:00
parent 21ee434832
commit 663e42ca3f
3 changed files with 23 additions and 9 deletions

View File

@ -34,6 +34,14 @@ local function render_client_count(n)
end
end
--------------------------------------------------------------------------------
function image_column(tooltip, flagname)
return "image," ..
"tooltip=" .. core.formspec_escape(tooltip) .. "," ..
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_" .. flagname .. ".png")
end
--------------------------------------------------------------------------------
function render_favorite(spec,render_details)
local text = ""

View File

@ -52,12 +52,6 @@ local function get_formspec(tabview, name, tabdata)
";]"
--favourites
local function image_column(tooltip, flagname)
return "image," ..
"tooltip=" .. core.formspec_escape(tooltip) .. "," ..
"0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") .. "," ..
"1=" .. core.formspec_escape(defaulttexturedir .. "server_flags_" .. flagname .. ".png")
end
if render_details then
retval = retval .. "tablecolumns[" ..
"color,span=3;" ..

View File

@ -35,10 +35,22 @@ local function get_formspec(tabview, name, tabdata)
"field[8.75,1.5;3.5,0.5;te_name;;" ..
core.formspec_escape(core.setting_get("name")) .."]" ..
"pwdfield[8.75,2.3;3.5,0.5;te_pwd;]"
--favourites
if render_details then
retval = retval .. "tablecolumns[" ..
"color,span=3;" ..
"text,align=right;" .. -- clients
"text,align=center,padding=0.25;" .. -- "/"
"text,align=right,padding=0.25;" .. -- clients_max
image_column("Creative mode", "creative") .. ",padding=1;" ..
image_column("Damage enabled", "damage") .. ",padding=0.25;" ..
image_column("PvP enabled", "pvp") .. ",padding=0.25;" ..
"text,padding=1]" -- name
else
retval = retval .. "tablecolumns[text]"
end
retval = retval ..
"textlist[-0.05,0.0;7.55,2.75;favourites;"
"table[-0.05,0;7.55,2.75;favourites;"
if #menudata.favorites > 0 then
retval = retval .. render_favorite(menudata.favorites[1],render_details)