forked from minetest-mods/unified_inventory
Display conversion method symbolically and textually next to arrow
This commit is contained in:
parent
76a9efff71
commit
2fd9e59242
4
api.lua
4
api.lua
|
@ -152,6 +152,7 @@ end
|
|||
|
||||
unified_inventory.register_craft_type("normal", {
|
||||
description = "Crafting",
|
||||
icon = "ui_craftgrid_icon.png",
|
||||
width = 3,
|
||||
height = 3,
|
||||
get_shaped_craft_width = function (craft) return craft.width end,
|
||||
|
@ -167,6 +168,7 @@ unified_inventory.register_craft_type("normal", {
|
|||
|
||||
unified_inventory.register_craft_type("shapeless", {
|
||||
description = "Mixing",
|
||||
icon = "ui_craftgrid_icon.png",
|
||||
width = 3,
|
||||
height = 3,
|
||||
dynamic_display_size = function (craft)
|
||||
|
@ -181,6 +183,7 @@ unified_inventory.register_craft_type("shapeless", {
|
|||
|
||||
unified_inventory.register_craft_type("cooking", {
|
||||
description = "Cooking",
|
||||
icon = "default_furnace_front.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
})
|
||||
|
@ -188,6 +191,7 @@ unified_inventory.register_craft_type("cooking", {
|
|||
|
||||
unified_inventory.register_craft_type("digging", {
|
||||
description = "Digging",
|
||||
icon = "default_tool_steelpick.png",
|
||||
width = 1,
|
||||
height = 1,
|
||||
})
|
||||
|
|
|
@ -224,9 +224,10 @@ unified_inventory.register_page("craftguide", {
|
|||
|
||||
local craft_type = unified_inventory.registered_craft_types[craft.type] or
|
||||
unified_inventory.craft_type_defaults(craft.type, {})
|
||||
formspec = formspec.."label[6,3.35;" .. S("Method:") .. "]"
|
||||
formspec = formspec.."label[6,3.75;"
|
||||
..minetest.formspec_escape(craft_type.description).."]"
|
||||
if craft_type.icon then
|
||||
formspec = formspec..string.format(" image[%f,%f;%f,%f;%s]",5.2,0.85,0.5,0.5,craft_type.icon)
|
||||
end
|
||||
formspec = formspec.."label[5,1.50;" .. minetest.formspec_escape(craft_type.description).."]"
|
||||
formspec = formspec..stack_image_button(6, 1, 1.1, 1.1, "item_button_usage_", ItemStack(craft.output))
|
||||
local display_size = craft_type.dynamic_display_size and craft_type.dynamic_display_size(craft) or { width = craft_type.width, height = craft_type.height }
|
||||
local craft_width = craft_type.get_shaped_craft_width and craft_type.get_shaped_craft_width(craft) or display_size.width
|
||||
|
|
BIN
textures/ui_craftgrid_icon.png
Normal file
BIN
textures/ui_craftgrid_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 680 B |
Loading…
Reference in New Issue
Block a user