added button back to trade list for dialog option trades

This commit is contained in:
Sokomine 2021-06-02 03:54:30 +02:00
parent d70c94f2d7
commit 33c79b4af0

View File

@ -29,6 +29,12 @@ yl_speak_up.input_do_trade_simple = function(player, formname, fields)
return
end
-- get from a dialog option trade back to the list of all these trades
if(fields.show_trade_list_dialog_options) then
yl_speak_up.show_fs(player, "trade_list", true)
return
end
-- a new trade has been stored - show it
if(fields.trade_simple_stored) then
yl_speak_up.show_fs(player, "trade_simple", yl_speak_up.speak_to[pname].trade_id)
@ -465,6 +471,8 @@ yl_speak_up.do_trade_simple = function(player, count)
yl_speak_up.save_npc_inventory( trade.n_id )
-- store for statistics how many times the player has executed this trade
-- (this is also necessary to switch to the right target dialog when
-- dealing with dialog options trades)
yl_speak_up.trade[pname].trade_done = yl_speak_up.trade[pname].trade_done + 1
-- log the trade
@ -574,6 +582,12 @@ yl_speak_up.get_fs_trade_simple = function(player, trade_id)
"button[0.2,1.6;1.2,0.9;delete_trade_simple;Delete]"..
"tooltip[delete_trade_simple;Delete this trade. You can do so only "..
"if you can edit the NPC as such (i.e. own it).]"
else
formspec = formspec..
"button[0.2,1.0;2.0,0.9;show_trade_list_dialog_options;Back to list]"..
"tooltip[show_trade_list_dialog_options;"..
"Click here to get back to the list of all trades\n"..
"associated with dialog options (like this one).]"
end
end