update infotext of treasure chests

This commit is contained in:
Sokomine 2023-12-27 07:23:52 +01:00
parent 49e745e023
commit 69a24ed8a0

View File

@ -1,7 +1,3 @@
-- TODO: update infotext of a chest when assigning a treasure -- meta:set_string("infotext", "Locked Chest")
-- who is allowed to edit and create new reward inventories?
-- works with player object and player name
reward_inv.may_edit = function(pname)
@ -70,6 +66,8 @@ reward_inv.input_handler = function(player, formname, fields)
if(reward_inv.clicked_at_chest[pname]) then
local meta = minetest.get_meta(reward_inv.clicked_at_chest[pname])
meta:set_string("reward_id", reward_id)
-- update infotext as well
meta:set_string("infotext", "Treasure chest")
end
-- the player is working on this reward and editing it (until the Store button is clicked)