refactorings

This commit is contained in:
Manuel Simon Hirsig
2016-08-03 19:56:49 +02:00
parent b374c7946f
commit 9da474c616
7 changed files with 223 additions and 240 deletions
+3 -3
View File
@@ -91,10 +91,10 @@ function private.update_inventory_listing()
return
end
Aux.item_listing.populate(m.item_listing, Aux.util.filter(m.inventory_records, function(record)
Aux.item_listing.populate(m.item_listing, Aux.util.values(Aux.util.filter(m.inventory_records, function(record)
local settings = m.read_settings(record.key)
return record.aux_quantity > 0 and (not settings.hidden or m.show_hidden_checkbox:GetChecked())
end))
end)))
end
function private.update_auction_listing()
@@ -174,7 +174,7 @@ function private.update_auction_listing()
end
function public.select_item(item_key)
for _, inventory_record in ipairs(Aux.util.filter(m.inventory_records, function(record) return record.aux_quantity > 0 end)) do
for _, inventory_record in Aux.util.filter(m.inventory_records, function(record) return record.aux_quantity > 0 end) do
if inventory_record.key == item_key then
m.set_item(inventory_record)
break
+1 -1
View File
@@ -902,7 +902,7 @@ function private.remove_post_filter()
end
function private.update_filter_display()
local lines = getn(Aux.util.filter(m.post_components, function(component) return component[1] == 'operator' and component[2] ~= 'not' end))
local lines = Aux.util.size(Aux.util.filter(m.post_components, function(component) return component[1] == 'operator' and component[2] ~= 'not' end))
local width_scale = max(200/m.filter_display:GetStringWidth())
local height_scale = min((200 / lines) / 18)
m.filter_display.scale_frame:SetScale(min(1, width_scale, height_scale))