forked from Sokomine/yl_speak_up
made edit button in trade in dialog options work again
This commit is contained in:
parent
71d4db6219
commit
f772f6aa64
@ -104,7 +104,7 @@ yl_speak_up.input_do_trade_simple = function(player, formname, fields)
|
|||||||
-- show the edit trade formspec
|
-- show the edit trade formspec
|
||||||
if(fields.edit_trade_simple) then
|
if(fields.edit_trade_simple) then
|
||||||
minetest.show_formspec(pname, "yl_speak_up:add_trade_simple",
|
minetest.show_formspec(pname, "yl_speak_up:add_trade_simple",
|
||||||
yl_speak_up.get_fs_add_trade_simple(player))
|
yl_speak_up.get_fs_add_trade_simple(player, trade.trade_id))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -360,7 +360,9 @@ yl_speak_up.input_add_trade_simple = function(player, formname, fields)
|
|||||||
"Dialog "..d_id..": Trade "..tostring(trade_id).." deleted from option "..
|
"Dialog "..d_id..": Trade "..tostring(trade_id).." deleted from option "..
|
||||||
tostring(o_id)..".")
|
tostring(o_id)..".")
|
||||||
-- delete the trade type result
|
-- delete the trade type result
|
||||||
dialog.trades[ trade_id ] = nil
|
if(trade_id) then
|
||||||
|
dialog.trades[ trade_id ] = nil
|
||||||
|
end
|
||||||
-- do not return yet - the items still need to be given back!
|
-- do not return yet - the items still need to be given back!
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -511,10 +513,14 @@ yl_speak_up.get_fs_trade_simple = function(player, trade_id)
|
|||||||
trade.player_gives = dialog.trades[ trade_id ].pay[1]
|
trade.player_gives = dialog.trades[ trade_id ].pay[1]
|
||||||
trade.npc_gives = dialog.trades[ trade_id ].buy[1]
|
trade.npc_gives = dialog.trades[ trade_id ].buy[1]
|
||||||
trade.trade_is_trade_list = not(dialog.trades[ trade_id ].d_id)
|
trade.trade_is_trade_list = not(dialog.trades[ trade_id ].d_id)
|
||||||
|
yl_speak_up.speak_to[pname].trade_id = trade_id
|
||||||
else
|
else
|
||||||
trade.edit_trade = true
|
trade.edit_trade = true
|
||||||
end
|
end
|
||||||
yl_speak_up.trade[pname] = trade
|
yl_speak_up.trade[pname] = trade
|
||||||
|
else
|
||||||
|
trade_id = yl_speak_up.speak_to[pname].trade_id
|
||||||
|
trade.trade_id = trade_id
|
||||||
end
|
end
|
||||||
|
|
||||||
-- do we have all the necessary data?
|
-- do we have all the necessary data?
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user