module refactoring

This commit is contained in:
Simon Hirsig
2017-11-01 15:01:41 +01:00
parent 9989ceb42f
commit 8823b34904
36 changed files with 669 additions and 646 deletions
+17 -17
View File
@@ -61,8 +61,8 @@ do
if arg1 == 'LeftButton' then
update_item(this.item_record)
elseif arg1 == 'RightButton' then
tab = 1
search_tab.filter = strlower(info.item(this.item_record.item_id).name) .. '/exact'
set_tab(1)
search_tab.set_filter(strlower(info.item(this.item_record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end,
@@ -81,13 +81,13 @@ bid_listing:SetColInfo{
{name='% Hist.\nValue', width=.21, align='CENTER'},
}
bid_listing:SetSelection(function(data)
return data.record == bid_selection or data.record.historical_value and bid_selection and bid_selection.historical_value
return data.record == get_bid_selection() or data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value
end)
bid_listing:SetHandler('OnClick', function(table, row_data, column, button)
if row_data.record == bid_selection or row_data.record.historical_value and bid_selection and bid_selection.historical_value then
bid_selection = nil
if row_data.record == get_bid_selection() or row_data.record.historical_value and get_bid_selection() and get_bid_selection().historical_value then
set_bid_selection()
else
bid_selection = row_data.record
set_bid_selection(row_data.record)
end
refresh = true
end)
@@ -105,13 +105,13 @@ buyout_listing:SetColInfo{
{name='% Hist.\nValue', width=.20, align='CENTER'},
}
buyout_listing:SetSelection(function(data)
return data.record == buyout_selection or data.record.historical_value and buyout_selection and buyout_selection.historical_value
return data.record == get_buyout_selection() or data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value
end)
buyout_listing:SetHandler('OnClick', function(table, row_data, column, button)
if row_data.record == buyout_selection or row_data.record.historical_value and buyout_selection and buyout_selection.historical_value then
buyout_selection = nil
if row_data.record == get_buyout_selection() or row_data.record.historical_value and get_buyout_selection() and get_buyout_selection().historical_value then
set_buyout_selection()
else
buyout_selection = row_data.record
set_buyout_selection(row_data.record)
end
refresh = true
end)
@@ -248,12 +248,12 @@ do
unit_buyout_price_input:SetFocus()
end
end)
editbox.formatter = function() return money.to_string(unit_start_price, true) end
editbox.char = function() bid_selection, buyout_selection = nil, nil; unit_start_price = money.from_string(this:GetText()) end
editbox.formatter = function() return money.to_string(get_unit_start_price(), true) end
editbox.char = function() set_bid_selection(); set_buyout_selection(); set_unit_start_price(money.from_string(this:GetText())) end
editbox.change = function() refresh = true end
editbox.enter = function() this:ClearFocus() end
editbox.focus_loss = function()
this:SetText(money.to_string(unit_start_price, true, nil, nil, true))
this:SetText(money.to_string(get_unit_start_price(), true, nil, nil, true))
end
do
local label = gui.label(editbox, gui.font_size.small)
@@ -283,12 +283,12 @@ do
stack_size_slider.editbox:SetFocus()
end
end)
editbox.formatter = function() return money.to_string(unit_buyout_price, true) end
editbox.char = function() buyout_selection = nil; unit_buyout_price = money.from_string(this:GetText()) end
editbox.formatter = function() return money.to_string(get_unit_buyout_price(), true) end
editbox.char = function() set_buyout_selection(); set_unit_buyout_price(money.from_string(this:GetText())) end
editbox.change = function() refresh = true end
editbox.enter = function() this:ClearFocus() end
editbox.focus_loss = function()
this:SetText(money.to_string(unit_buyout_price, true, nil, nil, true))
this:SetText(money.to_string(get_unit_buyout_price(), true, nil, nil, true))
end
do
local label = gui.label(editbox, gui.font_size.small)
@@ -310,7 +310,7 @@ do
deposit = label
end
function LOAD()
function handle.LOAD()
if not aux_post_bid then
frame.bid_listing:Hide()
frame.buyout_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', 2.5, 0)