mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 04:23:44 +01:00
Add prettier group names in tooltip
This commit is contained in:
parent
689840d6f5
commit
4823a9dd62
40
init.lua
40
init.lua
@ -130,6 +130,41 @@ craftguide.group_stereotypes = {
|
||||
mesecon_conductor_craftable = "mesecons:wire_00000000_off",
|
||||
}
|
||||
|
||||
local GROUP_NAMES = {
|
||||
coal = S"Any coal",
|
||||
wool = S"Any wool",
|
||||
wood = S"Any wood planks",
|
||||
sand = S"Any sand",
|
||||
stick = S"Any stick",
|
||||
stone = S"Any kind of stone block",
|
||||
vessel = S"Any vessel",
|
||||
|
||||
["color_red,flower"] = S"Any red flower",
|
||||
["color_blue,flower"] = S"Any blue flower",
|
||||
["color_black,flower"] = S"Any black flower",
|
||||
["color_white,flower"] = S"Any white flower",
|
||||
["color_green,flower"] = S"Any green flower",
|
||||
["color_orange,flower"] = S"Any orange flower",
|
||||
["color_yellow,flower"] = S"Any yellow flower",
|
||||
["color_violet,flower"] = S"Any violet flower",
|
||||
|
||||
["color_red,dye"] = S"Any red dye",
|
||||
["color_blue,dye"] = S"Any blue dye",
|
||||
["color_grey,dye"] = S"Any grey dye",
|
||||
["color_pink,dye"] = S"Any pink dye",
|
||||
["color_cyan,dye"] = S"Any cyan dye",
|
||||
["color_black,dye"] = S"Any black dye",
|
||||
["color_white,dye"] = S"Any white dye",
|
||||
["color_brown,dye"] = S"Any brown dye",
|
||||
["color_green,dye"] = S"Any green dye",
|
||||
["color_orange,dye"] = S"Any orange dye",
|
||||
["color_yellow,dye"] = S"Any yellow dye",
|
||||
["color_violet,dye"] = S"Any violet dye",
|
||||
["color_magenta,dye"] = S"Any magenta dye",
|
||||
["color_dark_grey,dye"] = S"Any dark grey dye",
|
||||
["color_dark_green,dye"] = S"Any dark green dye",
|
||||
}
|
||||
|
||||
local function err(str)
|
||||
return log("error", str)
|
||||
end
|
||||
@ -672,6 +707,10 @@ local function get_tooltip(name, info)
|
||||
local tooltip
|
||||
|
||||
if info.groups then
|
||||
sort(info.groups)
|
||||
tooltip = GROUP_NAMES[concat(info.groups, ",")]
|
||||
|
||||
if not tooltip then
|
||||
local groupstr, c = {}, 0
|
||||
|
||||
for i = 1, #info.groups do
|
||||
@ -681,6 +720,7 @@ local function get_tooltip(name, info)
|
||||
|
||||
groupstr = concat(groupstr, ", ")
|
||||
tooltip = S("Any item belonging to the group(s): @1", groupstr)
|
||||
end
|
||||
else
|
||||
tooltip = get_desc(name)
|
||||
end
|
||||
|
@ -14,6 +14,36 @@ Replaced by @1 on burning=
|
||||
Replaced by @1 on crafting=
|
||||
Repairable by step of @1=
|
||||
Any item belonging to the group(s): @1=
|
||||
Any black dye=
|
||||
Any black flower=
|
||||
Any blue dye=
|
||||
Any blue flower=
|
||||
Any brown dye=
|
||||
Any coal=
|
||||
Any cyan dye=
|
||||
Any dark green dye=
|
||||
Any dark grey dye=
|
||||
Any green dye=
|
||||
Any green flower=
|
||||
Any grey dye=
|
||||
Any kind of stone block=
|
||||
Any magenta dye=
|
||||
Any orange dye=
|
||||
Any orange flower=
|
||||
Any pink dye=
|
||||
Any red dye=
|
||||
Any red flower=
|
||||
Any sand=
|
||||
Any stick=
|
||||
Any vessel=
|
||||
Any violet dye=
|
||||
Any violet flower=
|
||||
Any white dye=
|
||||
Any white flower=
|
||||
Any wood planks=
|
||||
Any wool=
|
||||
Any yellow dye=
|
||||
Any yellow flower=
|
||||
Recipe's too big to be displayed (@1x@2)=
|
||||
Shapeless=
|
||||
Cooking=
|
||||
|
Loading…
Reference in New Issue
Block a user