show 'Sold out' for the right trade

This commit is contained in:
Sokomine 2021-06-02 01:32:06 +02:00
parent a62b898020
commit 5381dfccbc

View File

@ -132,15 +132,15 @@ yl_speak_up.get_fs_trade_list = function(player, show_dialog_option_trades)
"gui_furnace_arrow_bg.png^[transformR270;"..kstr..";]"..
"item_image_button["..tostring(2.6+(col*4))..","..tostring(1+row)..";1,1;"..
tostring(v.buy[1])..";"..kstr..";]")
if(not(npc_inv:contains_item("npc_main", buy_stack))) then
table.insert(formspec,
"label["..tostring(1.7+(col*4))..","..tostring(1.2+row)..";Sold out]")
end
row = row + 1
if(row > yl_speak_up.trade_max_rows) then
row = 0
col = col + 1
end
if(not(npc_inv:contains_item("npc_main", buy_stack))) then
table.insert(formspec,
"label["..tostring(1.7+(col*4))..","..tostring(0.2+row)..";Sold out]")
end
end
end