mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
Fix forgotten favourite list image update of simple menu
This commit is contained in:
parent
21ee434832
commit
663e42ca3f
@ -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 = ""
|
||||
|
@ -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;" ..
|
||||
|
@ -36,9 +36,21 @@ local function get_formspec(tabview, name, tabdata)
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user