From b5fa3dd4c2c50202a25d988d24156965631cea03 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 26 Sep 2022 04:58:30 +0200 Subject: [PATCH] always show let's trade or show me your inventory --- fs_talkdialog.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs_talkdialog.lua b/fs_talkdialog.lua index f43bcd7..cbbea61 100644 --- a/fs_talkdialog.lua +++ b/fs_talkdialog.lua @@ -893,8 +893,8 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec -- add a Let's trade button to the first dialog if the NPC has trades + local has_trades = nil if(is_a_start_dialog and dialog.trades) then - local has_trades = nil for k, v in pairs(dialog.trades) do -- has the NPC any *public* trades that are not effects/results? if(not(v.hide) and not(v.d_id)) then @@ -902,6 +902,8 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec break end end + end + if(has_trades) then h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h, "show_trade_list", "Show a list of trades the NPC has to offer.",