diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2016-11-27 13:30:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-27 13:30:52 -0500 |
commit | 2fb61ca7fb70b07f8386380934acf6c0ec6d549c (patch) | |
tree | 908f0802506fcac828d80c50e7a58c1b6720866f | |
parent | 41e9d43608b9e68a415f34e2f8a73dcfc1501e2a (diff) | |
parent | 8e98b000213558401eb34b26eacd872d5d608d70 (diff) |
Merge pull request #79 from Wuzzy2/realname2
Show “real” item name AND itemstring in craft result
-rw-r--r-- | register.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/register.lua b/register.lua index ff38168..ed81dbf 100644 --- a/register.lua +++ b/register.lua @@ -249,6 +249,12 @@ unified_inventory.register_page("craftguide", { formspec = formspec.."listcolors[#00000000;#00000000]" local item_name = unified_inventory.current_item[player_name] if not item_name then return {formspec=formspec} end + local item_name_shown + if minetest.registered_items[item_name] and minetest.registered_items[item_name].description then + item_name_shown = string.format(S("%s (%s)"), minetest.registered_items[item_name].description, item_name) + else + item_name_shown = item_name + end local dir = unified_inventory.current_craft_direction[player_name] local rdir @@ -264,7 +270,7 @@ unified_inventory.register_page("craftguide", { formspec = formspec.."background[0.5,"..(formspecy + 0.2)..";8,3;ui_craftguide_form.png]" formspec = formspec.."textarea["..craftresultx..","..craftresulty - ..";10,1;;"..minetest.formspec_escape(F(role_text[dir])..": "..item_name)..";]" + ..";10,1;;"..minetest.formspec_escape(F(role_text[dir])..": "..item_name_shown)..";]" formspec = formspec..stack_image_button(0, formspecy, 1.1, 1.1, "item_button_" .. rdir .. "_", ItemStack(item_name)) |