mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 04:23:44 +01:00
Fix tooltip
This commit is contained in:
parent
8c3efefd92
commit
ce59bd35d4
13
init.lua
13
init.lua
@ -830,10 +830,6 @@ local function strip_newline(str)
|
||||
return match(str, "[^\n]*")
|
||||
end
|
||||
|
||||
local function strip_prefix(str)
|
||||
return match(str, ".*@.*%)(.*)()") or str
|
||||
end
|
||||
|
||||
local function get_desc(item)
|
||||
if sub(item, 1, 1) == "_" then
|
||||
item = sub(item, 2)
|
||||
@ -846,7 +842,6 @@ local function get_desc(item)
|
||||
if true_str(desc) then
|
||||
desc = desc:trim()
|
||||
desc = strip_newline(desc)
|
||||
desc = strip_prefix(desc)
|
||||
|
||||
if not find(desc, "%u") then
|
||||
desc = toupper(desc)
|
||||
@ -1109,13 +1104,7 @@ local function get_grid_fs(fs, rcp, spacing)
|
||||
fs[#fs + 1] = fmt(FMT.image, X, Y, btn_size, btn_size, PNG.selected)
|
||||
end
|
||||
|
||||
local btn_name = ""
|
||||
|
||||
if groups then
|
||||
btn_name = fmt("group|%s|%s", groups[1], item)
|
||||
elseif item ~= "" then
|
||||
btn_name = item
|
||||
end
|
||||
local btn_name = groups and fmt("group|%s|%s", groups[1], item) or item
|
||||
|
||||
fs[#fs + 1] = fmt(FMT.item_image_button,
|
||||
X, Y, btn_size, btn_size, item, btn_name, label)
|
||||
|
Loading…
Reference in New Issue
Block a user