Skip to content
This repository was archived by the owner on Aug 9, 2023. It is now read-only.

Commit 0e90d85

Browse files
committed
Fix messages in craft command
1 parent 5446e0d commit 0e90d85

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

init.lua

+13-13
Original file line numberDiff line numberDiff line change
@@ -1745,24 +1745,24 @@ function craftguide.show(name, item, show_usages)
17451745
reset_data(data)
17461746

17471747
item = reg_items[item] and item or query_item
1748+
local recipes, usages = get_recipes(item, data, player)
17481749

1749-
data.query_item = item
1750-
data.recipes, data.usages = get_recipes(item, data, player)
1751-
1752-
if not data.recipes and not data.usages then
1753-
if recipes_cache[item] then
1754-
return false, msg(name, S("You don't know a recipe for this node"))
1755-
end
1756-
1757-
if usages_cache[item] then
1758-
return false, msg(name, S("You don't know an usage for this node"))
1759-
end
1760-
1750+
if not recipes and not usages then
17611751
if not recipes_cache[item] and not usages_cache[item] then
1762-
return false, msg(name, S("No recipe or usage for this node"))
1752+
return false, msg(name, fmt("%s: %s",
1753+
S("No recipe or usage for this item"),
1754+
get_desc(item)))
17631755
end
1756+
1757+
return false, msg(name, fmt("%s: %s",
1758+
S("You don't know a recipe or usage for this item"),
1759+
get_desc(item)))
17641760
end
17651761

1762+
data.query_item = item
1763+
data.recipes = recipes
1764+
data.usages = usages
1765+
17661766
if sfinv_only then
17671767
data.show_usages = show_usages
17681768
end

locale/template

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ No item to show=
1919
Collect items to reveal more recipes=
2020
Show recipe(s) of the pointed node=
2121
No node pointed=
22-
You don't know a recipe for this node=
23-
You don't know an usage for this node=
24-
No recipe or usage for this node=
22+
You don't know a recipe or usage for this item=
23+
No recipe or usage for this item=
2524
Node=
2625
Entity=
2726
Craftitem=

0 commit comments

Comments
 (0)