From 663e42ca3f451ad9df33968f0c94b080a7e16591 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 4 Jan 2015 17:37:45 +0100 Subject: [PATCH] Fix forgotten favourite list image update of simple menu --- builtin/mainmenu/common.lua | 8 ++++++++ builtin/mainmenu/tab_multiplayer.lua | 6 ------ builtin/mainmenu/tab_simple_main.lua | 18 +++++++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index 384c083d..549c0967 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -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 = "" diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua index 1e41f68b..7f438774 100644 --- a/builtin/mainmenu/tab_multiplayer.lua +++ b/builtin/mainmenu/tab_multiplayer.lua @@ -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;" .. diff --git a/builtin/mainmenu/tab_simple_main.lua b/builtin/mainmenu/tab_simple_main.lua index b48e523f..cab1702c 100644 --- a/builtin/mainmenu/tab_simple_main.lua +++ b/builtin/mainmenu/tab_simple_main.lua @@ -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)