From b8f3c0c177697380679824c9aa5050dfe3a42b51 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Thu, 13 Oct 2022 09:28:30 +1300 Subject: [PATCH] Fix /help formspec background --- builtin/common/information_formspecs.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/builtin/common/information_formspecs.lua b/builtin/common/information_formspecs.lua index 0994f2793..79adfd333 100644 --- a/builtin/common/information_formspecs.lua +++ b/builtin/common/information_formspecs.lua @@ -2,9 +2,14 @@ local COLOR_BLUE = "#7AF" local COLOR_GREEN = "#7F7" local COLOR_GRAY = "#BBB" +-- Only use bg_common.png with MultiCraft clients +local function get_background(name) + local info = minetest.get_player_information(name) + return info.major == 2 and "background9[0,0;14,8;bg_common.png;true;40]" or "" +end + local LIST_FORMSPEC = [[ - size[13,6.5] - background9[0,0;14,8;bg_common.png;true;40] + size[13,6.5]%s label[0,-0.1;%s] tablecolumns[color;tree;text;text] table[0,0.5;12.8,5.5;list;%s;0] @@ -12,8 +17,7 @@ local LIST_FORMSPEC = [[ ]] local LIST_FORMSPEC_DESCRIPTION = [[ - size[13,7.5] - background9[0,0;14,8;bg_common.png;true;40] + size[13,7.5]%s label[0,-0.1;%s] tablecolumns[color;tree;text;text] table[0,0.5;12.8,4.8;list;%s;%i] @@ -85,6 +89,7 @@ local function build_chatcommands_formspec(name, sel, copy) end return LIST_FORMSPEC_DESCRIPTION:format( + get_background(name), "Available commands: (see also: /help )", table.concat(rows, ","), sel or 0, description, "Close" @@ -112,6 +117,7 @@ local function build_privs_formspec(name) end return LIST_FORMSPEC:format( + get_background(name), "Available privileges:", table.concat(rows, ","), "Close"