From a4a292f7b2193fbe8e3360ba88807fe7468dda5b Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 2 Jul 2021 17:14:34 +0200 Subject: [PATCH] completed get_fs_edit_option_precondition_trade --- fs_edit_general.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs_edit_general.lua b/fs_edit_general.lua index b56914c..a3202fe 100644 --- a/fs_edit_general.lua +++ b/fs_edit_general.lua @@ -1161,7 +1161,8 @@ yl_speak_up.get_fs_edit_option_related = function(player, table_click_result, -- (trade - only for preconditions; effects have something else here) elseif(data.what and id_prefix == "p_" and data.what == 4) then return yl_speak_up.get_fs_edit_option_precondition_trade( - pname, dialog, formspec, data, id_prefix, save_button, e) + pname, dialog, formspec, data, id_prefix, save_button, e, + values_trade, check_trade) -- "the inventory of the player", -- 5 -- "the inventory of the NPC", -- 6 @@ -1405,7 +1406,11 @@ yl_speak_up.get_fs_edit_option_p_and_e_block = function( end -yl_speak_up.get_fs_edit_option_precondition_trade = function(pname, dialog, formspec, data, id_prefix, save_button, e) +-- "a trade", -- 4 +-- (trade - only for preconditions; effects have something else here) +yl_speak_up.get_fs_edit_option_precondition_trade = function( + pname, dialog, formspec, data, id_prefix, save_button, e, + values_trade, check_trade) if(e) then data.trade = math.max(1,table.indexof(values_trade, e[ "p_value" ])) end @@ -1414,7 +1419,8 @@ yl_speak_up.get_fs_edit_option_precondition_trade = function(pname, dialog, form -- not enough selected yet for saving save_button = "" end - return "label[0.2,3.3;If the action is a trade, the following shall be true:]".. + return formspec.. + "label[0.2,3.3;If the action is a trade, the following shall be true:]".. "dropdown[4.0,3.5;16.0,0.6;select_trade;".. table.concat(check_trade, ",")..";".. tostring(data.trade)..";]"..