33
33
34
34
table.sort (quality_list , function (a , b ) return a .level <= b .level end )
35
35
36
+ local has_quality = # quality_list > 0
37
+
36
38
-- normal, uncommon, rare, epic, (unused in vanilla), legendary
37
39
local vanilla_quality_multipliers = {1 , 2.1 , 4.8 , 10.5 , 22 , 35 }
38
40
@@ -498,7 +500,7 @@ local function update_menu_trader( player, player_mem, update_orders )
498
500
if update_orders then
499
501
clean_gui (player_mem .scr_blkmkt_trader_orders )
500
502
local gui2
501
- if trader .type == trader_type .item then
503
+ if has_quality and trader .type == trader_type .item then
502
504
gui2 = player_mem .scr_blkmkt_trader_orders .add ({type = " table" , name = " tab_blkmkt_trader_orders" , column_count = 5 , style = " table_blkmkt_style" })
503
505
else
504
506
gui2 = player_mem .scr_blkmkt_trader_orders .add ({type = " table" , name = " tab_blkmkt_trader_orders" , column_count = 4 , style = " table_blkmkt_style" })
@@ -508,7 +510,7 @@ local function update_menu_trader( player, player_mem, update_orders )
508
510
gui2 .add ({type = " label" , caption = " name" , style = " label_blkmkt_style" })
509
511
gui2 .add ({type = " label" , caption = " count" , style = " label_blkmkt_style" })
510
512
gui2 .add ({type = " label" , caption = " price" , style = " label_blkmkt_style" })
511
- if trader .type == trader_type .item then
513
+ if has_quality and trader .type == trader_type .item then
512
514
gui2 .add ({type = " label" , caption = " quality" , style = " label_blkmkt_style" })
513
515
end
514
516
@@ -541,7 +543,7 @@ local function update_menu_trader( player, player_mem, update_orders )
541
543
gui2 .add ({type = " textfield" , name = " but_blkmkt_orc_" .. string.format (" %4d" ,n ) .. name , text = count , style = " textfield_blkmkt_style" })
542
544
gui2 .add ({type = " label" , caption = format_money (current ) .. " " .. format_evolution (evol ), style = " label_blkmkt_style" })
543
545
544
- if quality then
546
+ if has_quality and quality then
545
547
gui3 = gui2 .add ({type = " drop-down" , name = " dpn_blkmkt_qlt_" .. string.format (" %4d" ,n ) .. name })
546
548
547
549
for _ , proto in ipairs (quality_list ) do
0 commit comments