aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/mainmenu/common.lua8
-rw-r--r--builtin/mainmenu/tab_multiplayer.lua6
-rw-r--r--builtin/mainmenu/tab_simple_main.lua18
3 files changed, 23 insertions, 9 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua
index 384c083d6..549c0967b 100644
--- a/builtin/mainmenu/common.lua
+++ b/builtin/mainmenu/common.lua
@@ -35,6 +35,14 @@ local function render_client_count(n)
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 1e41f68b1..7f4387746 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 b48e523f3..cab1702cf 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)