added quick way from trade list to access inventory
This commit is contained in:
parent
90269a7e4f
commit
7c8ccd066f
@ -36,6 +36,13 @@ yl_speak_up.input_trade_list = function(player, formname, fields)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- show the inventory of the NPC
|
||||
if(fields.show_inventory) then
|
||||
minetest.show_formspec(pname, "yl_speak_up:inventory",
|
||||
yl_speak_up.get_fs_inventory(player))
|
||||
return
|
||||
end
|
||||
-- TODO: and otherwise?
|
||||
end
|
||||
|
||||
@ -113,10 +120,13 @@ yl_speak_up.get_fs_trade_list = function(player)
|
||||
end
|
||||
|
||||
-- button "add trade" for those who can edit the NPC (entering edit mode is not required)
|
||||
-- also add a quick way to access the inventory of the npc
|
||||
if(yl_speak_up.may_edit_npc(player, n_id)) then
|
||||
table.insert(formspec,
|
||||
"button["..tostring(yl_speak_up.trade_max_cols * 4 - 2.2)..
|
||||
",0.2;2.0,0.9;trade_list_add_trade;Add trade]")
|
||||
",0.2;2.0,0.9;trade_list_add_trade;Add trade]"..
|
||||
"button["..tostring(yl_speak_up.trade_max_cols * 4 - 4.2)..
|
||||
",-0.5;4.0,0.9;show_inventory;Show inventory of NPC]")
|
||||
end
|
||||
|
||||
return "size["..
|
||||
|
Loading…
Reference in New Issue
Block a user