some ui improvements

This commit is contained in:
Manuel Simon Hirsig
2016-08-06 16:07:31 +02:00
parent 135ebbd536
commit b94cabfc08
22 changed files with 379 additions and 318 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ function public.FRAMES(f)
private.create_frames = f
end
function public.LOAD()
function m.LOAD()
m.create_frames(m, public, private)
end
@@ -92,7 +92,7 @@ do
m.cancel_button:SetScript('OnClick', function()
if m.test(record)(index) and m.listing:ContainsRecord(record) then
aux.cancel_auction(index, aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
aux.cancel_auction(index, aux._(m.listing.RemoveAuctionRecord, m.listing, record))
end
end)
m.cancel_button:Enable()
+3 -3
View File
@@ -6,7 +6,7 @@ function public.FRAMES(f)
private.create_frames = f
end
function public.LOAD()
function m.LOAD()
m.create_frames(m, public, private)
end
@@ -96,7 +96,7 @@ do
aux.place_bid('bidder', index, record.bid_price, record.bid_price < record.buyout_price and function()
aux.info.bid_update(record)
m.listing:SetDatabase()
end or aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
end or aux._(m.listing.RemoveAuctionRecord, m.listing, record))
end
end)
m.bid_button:Enable()
@@ -105,7 +105,7 @@ do
if record.buyout_price > 0 then
m.buyout_button:SetScript('OnClick', function()
if m.test(record)(index) and m.listing:ContainsRecord(record) then
aux.place_bid('bidder', index, record.buyout_price, aux.f(m.listing.RemoveAuctionRecord, m.listing, record))
aux.place_bid('bidder', index, record.buyout_price, aux._(m.listing.RemoveAuctionRecord, m.listing, record))
end
end)
m.buyout_button:Enable()
+4 -4
View File
@@ -13,14 +13,14 @@ function public.FRAMES(f)
private.create_frames = f
end
function public.LOAD()
function m.LOAD()
m.create_frames(m, public, private)
end
function public.OPEN()
m.frame:Show()
m.deposit:SetText('Deposit: '..aux.money.to_string(0, nil, nil, nil, aux.gui.inline_color({255, 254, 250, 1})))
m.deposit:SetText('Deposit: '..aux.money.to_string(0, nil, nil, nil, aux.gui.inline_color.text.enabled))
m.set_unit_start_price(0)
m.set_unit_buyout_price(0)
@@ -278,7 +278,7 @@ function private.update_item_configuration()
m.item.texture:SetTexture(nil)
m.item.count:SetText()
m.item.name:SetTextColor(unpack(aux.gui.config.label_color.enabled))
m.item.name:SetTextColor(unpack(aux.gui.color.label.enabled))
m.item.name:SetText('No item selected')
m.unit_start_price:Hide()
@@ -319,7 +319,7 @@ function private.update_item_configuration()
stack_count = m.stack_count_slider:GetValue()
local deposit = floor(m.selected_item.unit_vendor_price * deposit_factor * (m.selected_item.max_charges and 1 or stack_size)) * stack_count * UIDropDownMenu_GetSelectedValue(m.duration_dropdown) / 120
m.deposit:SetText('Deposit: '..aux.money.to_string(deposit, nil, nil, nil, aux.gui.inline_color({255, 254, 250, 1})))
m.deposit:SetText('Deposit: '..aux.money.to_string(deposit, nil, nil, nil, aux.gui.inline_color.text.enabled))
end
m.refresh_button:Enable()
+6 -10
View File
@@ -25,15 +25,13 @@ aux.post_tab.FRAMES(function(m, public, private)
m.frame.auctions:SetPoint('BOTTOMRIGHT', 0, 0)
do
local checkbox = CreateFrame('CheckButton', nil, m.frame.inventory, 'UICheckButtonTemplate')
checkbox:SetWidth(22)
checkbox:SetHeight(22)
checkbox:SetPoint('TOPLEFT', 45, -15)
local checkbox = aux.gui.checkbox(m.frame.inventory)
checkbox:SetPoint('TOPLEFT', 49, -16)
checkbox:SetScript('OnClick', function()
m.refresh = true
end)
local label = aux.gui.label(checkbox, aux.gui.config.small_font_size)
label:SetPoint('LEFT', checkbox, 'RIGHT', 2, 1)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Show hidden items')
private.show_hidden_checkbox = checkbox
end
@@ -224,10 +222,8 @@ aux.post_tab.FRAMES(function(m, public, private)
private.duration_dropdown = dropdown
end
do
local checkbox = CreateFrame('CheckButton', nil, m.frame.parameters, 'UICheckButtonTemplate')
checkbox:SetWidth(22)
checkbox:SetHeight(22)
checkbox:SetPoint('TOPRIGHT', -85, -6)
local checkbox = aux.gui.checkbox(m.frame.parameters)
checkbox:SetPoint('TOPRIGHT', -83, -6)
checkbox:SetScript('OnClick', function()
local settings = m.read_settings()
settings.hidden = this:GetChecked()
@@ -235,7 +231,7 @@ aux.post_tab.FRAMES(function(m, public, private)
m.refresh = true
end)
local label = aux.gui.label(checkbox, aux.gui.config.small_font_size)
label:SetPoint('LEFT', checkbox, 'RIGHT', 2, 1)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Hide this item')
private.hide_checkbox = checkbox
end
+7 -7
View File
@@ -66,7 +66,7 @@ function public.FRAMES(f)
private.create_frames = f
end
function public.LOAD()
function m.LOAD()
m.create_frames(m, public, private)
m.new_search('')
m.update_tab(m.SAVED)
@@ -233,8 +233,8 @@ function private.start_real_time_scan(query, search, continuation)
if not ignore_page then
if search.auto_buy then
ctrl.suspend()
aux.place_bid('list', auction_record.index, auction_record.buyout_price, aux.f(ctrl.resume, true))
aux.control.thread(aux.control.when, aux.util.later(GetTime(), 10), aux.f(ctrl.resume, false))
aux.place_bid('list', auction_record.index, auction_record.buyout_price, aux._(ctrl.resume, true))
aux.control.thread(aux.control.when, aux.util.later(GetTime(), 10), aux._(ctrl.resume, false))
else
tinsert(new_records, auction_record)
end
@@ -329,8 +329,8 @@ function private.start_search(queries, continuation)
on_auction = function(auction_record, ctrl)
if search.auto_buy then
ctrl.suspend()
aux.place_bid('list', auction_record.index, auction_record.buyout_price, aux.f(ctrl.resume, true))
aux.control.thread(aux.control.when, aux.util.later(GetTime(), 10), aux.f(ctrl.resume, false))
aux.place_bid('list', auction_record.index, auction_record.buyout_price, aux._(ctrl.resume, true))
aux.control.thread(aux.control.when, aux.util.later(GetTime(), 10), aux._(ctrl.resume, false))
elseif getn(search.records) < 1000 then
tinsert(search.records, auction_record)
if getn(search.records) == 1000 then
@@ -488,7 +488,7 @@ do
aux.place_bid('list', index, record.bid_price, record.bid_price < record.buyout_price and function()
aux.info.bid_update(record)
search.table:SetDatabase()
end or aux.f(search.table.RemoveAuctionRecord, search.table, record))
end or aux._(search.table.RemoveAuctionRecord, search.table, record))
end
end)
m.bid_button:Enable()
@@ -497,7 +497,7 @@ do
if record.buyout_price > 0 then
m.buyout_button:SetScript('OnClick', function()
if m.test(record)(index) and search.table:ContainsRecord(record) then
aux.place_bid('list', index, record.buyout_price, aux.f(search.table.RemoveAuctionRecord, search.table, record))
aux.place_bid('list', index, record.buyout_price, aux._(search.table.RemoveAuctionRecord, search.table, record))
end
end)
m.buyout_button:Enable()
+16 -20
View File
@@ -50,7 +50,7 @@ aux.search_tab.FRAMES(function(m, public, private)
do
local panel = CreateFrame('Frame', nil, m.frame)
panel:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]]}
panel:SetBackdropColor(unpack(aux.gui.config.content_color.backdrop))
panel:SetBackdropColor(unpack(aux.gui.color.content.backdrop))
panel:SetPoint('LEFT', m.settings_button, 'RIGHT', 0, 0)
panel:SetPoint('RIGHT', 0, 0)
panel:SetHeight(42)
@@ -79,15 +79,15 @@ aux.search_tab.FRAMES(function(m, public, private)
end)
editbox:SetScript('OnTextChanged', function()
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
this:SetBackdropColor(unpack(aux.gui.config.on_color))
this:SetBackdropColor(unpack(aux.gui.color.state.enabled))
else
this:SetBackdropColor(unpack(aux.gui.config.off_color))
this:SetBackdropColor(unpack(aux.gui.color.state.disabled))
end
end)
local label = aux.gui.label(editbox, aux.gui.config.medium_font_size)
label:SetPoint('RIGHT', editbox, 'LEFT', -6, 0)
label:SetText('Pages')
label:SetTextColor(unpack(aux.gui.config.text_color.enabled))
label:SetTextColor(unpack(aux.gui.color.text.enabled))
private.first_page_input = editbox
end
do
@@ -105,15 +105,15 @@ aux.search_tab.FRAMES(function(m, public, private)
end)
editbox:SetScript('OnTextChanged', function()
if m.blizzard_page_index(this:GetText()) and not m.real_time_button:GetChecked() then
this:SetBackdropColor(unpack(aux.gui.config.on_color))
this:SetBackdropColor(unpack(aux.gui.color.state.enabled))
else
this:SetBackdropColor(unpack(aux.gui.config.off_color))
this:SetBackdropColor(unpack(aux.gui.color.state.disabled))
end
end)
local label = aux.gui.label(editbox, aux.gui.config.medium_font_size)
label:SetPoint('RIGHT', editbox, 'LEFT', -3.5, 0)
label:SetText('-')
label:SetTextColor(unpack(aux.gui.config.text_color.enabled))
label:SetTextColor(unpack(aux.gui.color.text.enabled))
private.last_page_input = editbox
end
do
@@ -379,19 +379,17 @@ aux.search_tab.FRAMES(function(m, public, private)
m.min_level_input:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', aux.f(editbox.ClearFocus, editbox))
editbox:SetScript('OnEnterPressed', aux._(editbox.ClearFocus, editbox))
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Name')
private.name_input = editbox
end
do
local checkbox = CreateFrame('CheckButton', nil, m.frame.filter, 'UICheckButtonTemplate')
checkbox:SetWidth(22)
checkbox:SetHeight(22)
checkbox:SetPoint('TOPLEFT', m.name_input, 'TOPRIGHT', 10, 0)
local checkbox = aux.gui.checkbox(m.frame.filter)
checkbox:SetPoint('TOPLEFT', m.name_input, 'TOPRIGHT', 16, 0)
local label = aux.gui.label(checkbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', 1, -3)
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
label:SetText('Exact')
private.exact_checkbox = checkbox
end
@@ -408,7 +406,7 @@ aux.search_tab.FRAMES(function(m, public, private)
m.max_level_input:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', aux.f(editbox.ClearFocus, editbox))
editbox:SetScript('OnEnterPressed', aux._(editbox.ClearFocus, editbox))
local label = aux.gui.label(editbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Level Range')
@@ -427,19 +425,17 @@ aux.search_tab.FRAMES(function(m, public, private)
m.name_input:SetFocus()
end
end)
editbox:SetScript('OnEnterPressed', aux.f(editbox.ClearFocus, editbox))
editbox:SetScript('OnEnterPressed', aux._(editbox.ClearFocus, editbox))
local label = aux.gui.label(editbox, aux.gui.config.medium_font_size)
label:SetPoint('RIGHT', editbox, 'LEFT', -3, 0)
label:SetText('-')
private.max_level_input = editbox
end
do
local checkbox = CreateFrame('CheckButton', nil, m.frame.filter, 'UICheckButtonTemplate')
checkbox:SetWidth(22)
checkbox:SetHeight(22)
checkbox:SetPoint('TOPLEFT', m.max_level_input, 'TOPRIGHT', 10, 0)
local checkbox = aux.gui.checkbox(m.frame.filter)
checkbox:SetPoint('TOPLEFT', m.max_level_input, 'TOPRIGHT', 16, 0)
local label = aux.gui.label(checkbox, aux.gui.config.small_font_size)
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', 1, -3)
label:SetPoint('BOTTOMLEFT', checkbox, 'TOPLEFT', -2, 1)
label:SetText('Usable')
private.usable_checkbox = checkbox
end