Crafting: Highlight group items

This commit is contained in:
Wuzzy 2019-08-29 07:45:20 +02:00
parent 2f5fc6ef80
commit 045c99d915
3 changed files with 32 additions and 5 deletions

View File

@ -26,6 +26,13 @@ default.ui.group_defaults = {
stone = "default:stone",
tree = "default:tree",
}
default.ui.group_names = {
fuzzy = { S("Fuzzy"), S("Any fuzzy block") },
planks = { S("Planks"), S("Any planks") },
soil = { S("Soil"), S("Any soil") },
stone = { S("Stone"), S("Any stone") },
tree = { S("Tree"), S("Any tree") },
}
-- Itemslot backgrounds
@ -190,13 +197,19 @@ function default.ui.item_group(x, y, group, count, name)
local result = ""
if itemname ~= "" then
result = result .. "image_button["..x..","..y..";1,1;blank.png;"
..name..";;false;false;blank.png]"
result = result .. "item_image["..x..","..y..";1,1;"
result = result
.."box["..x..","..y..";0.85,0.9;#00000040]"
.."item_image["..x..","..y..";1,1;"
..minetest.formspec_escape(itemname .. " " .. count).."]"
result = result .. "tooltip["..name..";"..
minetest.formspec_escape(S("Group: @1", group)).."]"
local group_prettyprint
if default.ui.group_names[group] then
group_prettyprint = minetest.colorize("#ffecb6", default.ui.group_names[group][2])
else
group_prettyprint = S("Group: @1", minetest.colorize("#ffecb6", group))
end
result = result .. "tooltip["..x..","..y..";1,1;"..
minetest.formspec_escape(group_prettyprint).."]"
end
return result

View File

@ -142,3 +142,10 @@ Wrought Iron Shears=Schmiedeeisenschere
Flint and Steel=Feuerstein und Stahl
""=„“
"@1"=„@1“
Fuzzy=Flausch
Soil=Boden
Any fuzzy block=Beliebiger flauschiger Block
Any planks=Beliebige Planken
Any soil=Beliebiger Boden
Any stone=Beliebiger Stein
Any tree=Beliebiger Baum

View File

@ -142,3 +142,10 @@ Wrought Iron Shears=
Flint and Steel=
""=
"@1"=
Fuzzy=
Soil=
Any fuzzy block=
Any planks=
Any soil=
Any stone=
Any tree=