forked from Sokomine/yl_speak_up
sort trade limit list by item name
This commit is contained in:
parent
0b26af1287
commit
fe3b4c80df
@ -176,11 +176,16 @@ yl_speak_up.get_fs_trade_limit = function(player, selected)
|
|||||||
|
|
||||||
-- the table event selection returns a row index - we need to translate that to our table
|
-- the table event selection returns a row index - we need to translate that to our table
|
||||||
local item_list = {}
|
local item_list = {}
|
||||||
local row = 2
|
local descr_list = {}
|
||||||
local selected_row = 1
|
|
||||||
-- TODO: sort this list in some way? alphabeticly? by limit?
|
|
||||||
for k,v in pairs( items ) do
|
for k,v in pairs( items ) do
|
||||||
table.insert(item_list, k)
|
table.insert(item_list, k)
|
||||||
|
end
|
||||||
|
-- avoid total chaos by sorting this list
|
||||||
|
table.sort(item_list)
|
||||||
|
local row = 2
|
||||||
|
local selected_row = 1
|
||||||
|
for i, k in ipairs( item_list ) do
|
||||||
|
local v = items[k]
|
||||||
if(selected and k == selected) then
|
if(selected and k == selected) then
|
||||||
selected_row = #item_list + 1
|
selected_row = #item_list + 1
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user