aboutsummaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2016-01-08 15:59:36 +0100
committerparamat <mat.gregory@virginmedia.com>2016-01-18 17:21:41 +0000
commit87291ea44a61614d5bd9efc0657926da3f867b5f (patch)
treec5c046e5dc74211532f0fd88434283e49e190d98 /builtin/game
parenteb6e2c11b16c9ef5287bda224fa965a37ef49131 (diff)
downloadminetest-87291ea44a61614d5bd9efc0657926da3f867b5f.tar.gz
minetest-87291ea44a61614d5bd9efc0657926da3f867b5f.tar.bz2
minetest-87291ea44a61614d5bd9efc0657926da3f867b5f.zip
Show infotext with description for item entities
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/item_entity.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/game/item_entity.lua b/builtin/game/item_entity.lua
index be158c119..a66bf33d0 100644
--- a/builtin/game/item_entity.lua
+++ b/builtin/game/item_entity.lua
@@ -31,6 +31,7 @@ core.register_entity(":__builtin:item", {
spritediv = {x = 1, y = 1},
initial_sprite_basepos = {x = 0, y = 0},
is_visible = false,
+ infotext = "",
},
itemstring = '',
@@ -50,6 +51,7 @@ core.register_entity(":__builtin:item", {
local c = s
local itemtable = stack:to_table()
local itemname = nil
+ local description = ""
if itemtable then
itemname = stack:to_table().name
end
@@ -58,6 +60,7 @@ core.register_entity(":__builtin:item", {
if core.registered_items[itemname] then
item_texture = core.registered_items[itemname].inventory_image
item_type = core.registered_items[itemname].type
+ description = core.registered_items[itemname].description
end
local prop = {
is_visible = true,
@@ -66,6 +69,7 @@ core.register_entity(":__builtin:item", {
visual_size = {x = s, y = s},
collisionbox = {-c, -c, -c, c, c, c},
automatic_rotate = math.pi * 0.5,
+ infotext = description,
}
self.object:set_properties(prop)
end,