1
0
Fork 0

Fix /help formspec background

main-2-0-3
luk3yx 2022-10-13 09:28:30 +13:00 committed by GitHub
parent a6b126e91f
commit b8f3c0c177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -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 <cmd>)",
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"