refactoring
This commit is contained in:
+5
-5
@@ -14,7 +14,7 @@ do
|
|||||||
__call = function(self, name)
|
__call = function(self, name)
|
||||||
if not modules[name] then
|
if not modules[name] then
|
||||||
module(aux.core)
|
module(aux.core)
|
||||||
aux = self
|
private.aux = self
|
||||||
modules[name] = {env=M, interface=I}
|
modules[name] = {env=M, interface=I}
|
||||||
end
|
end
|
||||||
setfenv(2, modules[name].env)
|
setfenv(2, modules[name].env)
|
||||||
@@ -176,7 +176,7 @@ function public.log(...) temp=arg
|
|||||||
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE..msg)
|
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE..msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
local event_frame = CreateFrame 'Frame'
|
local event_frame = CreateFrame('Frame')
|
||||||
for event in -temp-set('ADDON_LOADED', 'VARIABLES_LOADED', 'PLAYER_LOGIN', 'AUCTION_HOUSE_SHOW', 'AUCTION_HOUSE_CLOSED', 'AUCTION_BIDDER_LIST_UPDATE', 'AUCTION_OWNED_LIST_UPDATE') do
|
for event in -temp-set('ADDON_LOADED', 'VARIABLES_LOADED', 'PLAYER_LOGIN', 'AUCTION_HOUSE_SHOW', 'AUCTION_HOUSE_CLOSED', 'AUCTION_BIDDER_LIST_UPDATE', 'AUCTION_OWNED_LIST_UPDATE') do
|
||||||
event_frame:RegisterEvent(event)
|
event_frame:RegisterEvent(event)
|
||||||
end
|
end
|
||||||
@@ -297,12 +297,12 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function public.is_player(name, current)
|
function public.is_player(name, current)
|
||||||
local realm = GetCVar 'realmName'
|
local realm = GetCVar('realmName')
|
||||||
return not current and index(_G.aux_characters, realm, name) or UnitName 'player' == name
|
return not current and index(_G.aux_characters, realm, name) or UnitName 'player' == name
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.neutral_faction()
|
function public.neutral_faction()
|
||||||
return not UnitFactionGroup 'npc'
|
return not UnitFactionGroup('npc')
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.min_bid_increment(current_bid)
|
function public.min_bid_increment(current_bid)
|
||||||
@@ -342,7 +342,7 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ADDON_LOADED.Blizzard_AuctionUI()
|
function ADDON_LOADED.Blizzard_AuctionUI()
|
||||||
AuctionFrame:UnregisterEvent 'AUCTION_HOUSE_SHOW'
|
AuctionFrame:UnregisterEvent('AUCTION_HOUSE_SHOW')
|
||||||
AuctionFrame:SetScript('OnHide', nil)
|
AuctionFrame:SetScript('OnHide', nil)
|
||||||
hook('ShowUIPanel', function(...) temp=arg
|
hook('ShowUIPanel', function(...) temp=arg
|
||||||
if arg[1] == AuctionFrame then return AuctionFrame:Show() end
|
if arg[1] == AuctionFrame then return AuctionFrame:Show() end
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
aux 'core'
|
aux 'core'
|
||||||
|
|
||||||
event_frame = CreateFrame 'Frame'
|
event_frame = CreateFrame('Frame')
|
||||||
|
|
||||||
local listeners, threads = t, t
|
local listeners, threads = t, t
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ do
|
|||||||
local time = 0
|
local time = 0
|
||||||
function private.next_push.get()
|
function private.next_push.get()
|
||||||
if time() > time then
|
if time() > time then
|
||||||
local date = date '*t'
|
local date = date('*t')
|
||||||
date.hour, date.min, date.sec = 24, 0, 0
|
date.hour, date.min, date.sec = 24, 0, 0
|
||||||
time = time(date)
|
time = time(date)
|
||||||
end
|
end
|
||||||
|
|||||||
+3
-3
@@ -51,7 +51,7 @@ function _G.SlashCmdList.AUX(command)
|
|||||||
_G.aux_ignore_owner = not _G.aux_ignore_owner
|
_G.aux_ignore_owner = not _G.aux_ignore_owner
|
||||||
log('Ignoring of owner '..(_G.aux_ignore_owner and 'enabled' or 'disabled')..'.')
|
log('Ignoring of owner '..(_G.aux_ignore_owner and 'enabled' or 'disabled')..'.')
|
||||||
elseif arguments[1] == 'chars' and arguments[2] == 'add' then
|
elseif arguments[1] == 'chars' and arguments[2] == 'add' then
|
||||||
local realm = GetCVar 'realmName'
|
local realm = GetCVar('realmName')
|
||||||
_G.aux_characters[realm] = _G.aux_characters[realm] or {}
|
_G.aux_characters[realm] = _G.aux_characters[realm] or {}
|
||||||
for i = 3, getn(arguments) do
|
for i = 3, getn(arguments) do
|
||||||
local name = gsub(strlower(arguments[i]), '^%l', strupper)
|
local name = gsub(strlower(arguments[i]), '^%l', strupper)
|
||||||
@@ -61,7 +61,7 @@ function _G.SlashCmdList.AUX(command)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif arguments[1] == 'chars' and arguments[2] == 'remove' then
|
elseif arguments[1] == 'chars' and arguments[2] == 'remove' then
|
||||||
local realm = GetCVar 'realmName'
|
local realm = GetCVar('realmName')
|
||||||
if not _G.aux_characters[realm] then
|
if not _G.aux_characters[realm] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -73,7 +73,7 @@ function _G.SlashCmdList.AUX(command)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif arguments[1] == 'chars' then
|
elseif arguments[1] == 'chars' then
|
||||||
local realm = GetCVar 'realmName'
|
local realm = GetCVar('realmName')
|
||||||
local chars = {}
|
local chars = {}
|
||||||
for name in _G.aux_characters[realm] or {} do
|
for name in _G.aux_characters[realm] or {} do
|
||||||
tinsert(chars, name)
|
tinsert(chars, name)
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ function LOAD()
|
|||||||
return unpack(ret)
|
return unpack(ret)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
local orig = GameTooltip:GetScript 'OnTooltipAddMoney'
|
local orig = GameTooltip:GetScript('OnTooltipAddMoney')
|
||||||
GameTooltip:SetScript('OnTooltipAddMoney', function(...) temp=arg
|
GameTooltip:SetScript('OnTooltipAddMoney', function(...) temp=arg
|
||||||
if inside_hook then
|
if inside_hook then
|
||||||
game_tooltip_money = arg1
|
game_tooltip_money = arg1
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ do
|
|||||||
frame:SetMovable(true)
|
frame:SetMovable(true)
|
||||||
frame:EnableMouse(true)
|
frame:EnableMouse(true)
|
||||||
frame:SetClampedToScreen(true)
|
frame:SetClampedToScreen(true)
|
||||||
frame:RegisterForDrag 'LeftButton'
|
frame:RegisterForDrag('LeftButton')
|
||||||
frame:SetScript('OnDragStart', function() this:StartMoving() end)
|
frame:SetScript('OnDragStart', function() this:StartMoving() end)
|
||||||
frame:SetScript('OnDragStop', function() this:StopMovingOrSizing() end)
|
frame:SetScript('OnDragStop', function() this:StopMovingOrSizing() end)
|
||||||
frame:SetScript('OnShow', function() PlaySound 'AuctionWindowOpen' end)
|
frame:SetScript('OnShow', function() PlaySound 'AuctionWindowOpen' end)
|
||||||
@@ -34,7 +34,7 @@ do
|
|||||||
local btn = gui.button(aux_frame, 16)
|
local btn = gui.button(aux_frame, 16)
|
||||||
btn:SetPoint('BOTTOMRIGHT', -6, 6)
|
btn:SetPoint('BOTTOMRIGHT', -6, 6)
|
||||||
gui.set_size(btn, 65, 24)
|
gui.set_size(btn, 65, 24)
|
||||||
btn:SetText 'Close'
|
btn:SetText('Close')
|
||||||
btn:SetScript('OnClick', L(aux_frame.Hide, aux_frame))
|
btn:SetScript('OnClick', L(aux_frame.Hide, aux_frame))
|
||||||
public.close_button = btn
|
public.close_button = btn
|
||||||
end
|
end
|
||||||
@@ -42,7 +42,7 @@ do
|
|||||||
local btn = gui.button(aux_frame, 16)
|
local btn = gui.button(aux_frame, 16)
|
||||||
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
|
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
|
||||||
gui.set_size(btn, 65, 24)
|
gui.set_size(btn, 65, 24)
|
||||||
btn:SetText 'Default UI'
|
btn:SetText('Default UI')
|
||||||
btn:SetScript('OnClick',function()
|
btn:SetScript('OnClick',function()
|
||||||
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
|
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ public.bids_config = {
|
|||||||
fill = function(cell, record)
|
fill = function(cell, record)
|
||||||
local status
|
local status
|
||||||
if record.high_bidder then
|
if record.high_bidder then
|
||||||
status = color.yellow 'High Bidder'
|
status = color.yellow('High Bidder')
|
||||||
else
|
else
|
||||||
status = color.red 'Outbid'
|
status = color.red 'Outbid'
|
||||||
end
|
end
|
||||||
@@ -732,9 +732,9 @@ local methods = {
|
|||||||
-- update sorting highlights
|
-- update sorting highlights
|
||||||
for _, cell in self.headCells do
|
for _, cell in self.headCells do
|
||||||
local tex = cell:GetNormalTexture()
|
local tex = cell:GetNormalTexture()
|
||||||
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
|
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
|
||||||
tex:SetTexCoord(.017, 1, .083, .909)
|
tex:SetTexCoord(.017, 1, .083, .909)
|
||||||
tex:SetAlpha(0.5)
|
tex:SetAlpha(.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
if getn(self.sorts) > 0 then
|
if getn(self.sorts) > 0 then
|
||||||
@@ -1062,8 +1062,8 @@ function public.CreateAuctionResultsTable(parent, config)
|
|||||||
cell:SetScript('OnClick', rt.OnHeadColumnClick)
|
cell:SetScript('OnClick', rt.OnHeadColumnClick)
|
||||||
|
|
||||||
local text = cell:CreateFontString()
|
local text = cell:CreateFontString()
|
||||||
text:SetJustifyH 'CENTER'
|
text:SetJustifyH('CENTER')
|
||||||
text:SetJustifyV 'CENTER'
|
text:SetJustifyV('CENTER')
|
||||||
text:SetFont(gui.font, 12)
|
text:SetFont(gui.font, 12)
|
||||||
text:SetTextColor(color.label.enabled())
|
text:SetTextColor(color.label.enabled())
|
||||||
cell:SetFontString(text)
|
cell:SetFontString(text)
|
||||||
@@ -1072,14 +1072,14 @@ function public.CreateAuctionResultsTable(parent, config)
|
|||||||
|
|
||||||
local tex = cell:CreateTexture()
|
local tex = cell:CreateTexture()
|
||||||
tex:SetAllPoints()
|
tex:SetAllPoints()
|
||||||
tex:SetTexture [[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
|
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
|
||||||
tex:SetTexCoord(.017, 1, .083, .909)
|
tex:SetTexCoord(.017, 1, .083, .909)
|
||||||
tex:SetAlpha(.5)
|
tex:SetAlpha(.5)
|
||||||
cell:SetNormalTexture(tex)
|
cell:SetNormalTexture(tex)
|
||||||
|
|
||||||
local tex = cell:CreateTexture()
|
local tex = cell:CreateTexture()
|
||||||
tex:SetAllPoints()
|
tex:SetAllPoints()
|
||||||
tex:SetTexture [[Interface\Buttons\UI-Listbox-Highlight]]
|
tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
|
||||||
tex:SetTexCoord(.025, .957, .087, .931)
|
tex:SetTexCoord(.025, .957, .087, .931)
|
||||||
tex:SetAlpha(.2)
|
tex:SetAlpha(.2)
|
||||||
cell:SetHighlightTexture(tex)
|
cell:SetHighlightTexture(tex)
|
||||||
@@ -1112,7 +1112,7 @@ function public.CreateAuctionResultsTable(parent, config)
|
|||||||
local text = cell:CreateFontString()
|
local text = cell:CreateFontString()
|
||||||
text:SetFont(gui.font, min(14, rt.ROW_HEIGHT))
|
text:SetFont(gui.font, min(14, rt.ROW_HEIGHT))
|
||||||
text:SetJustifyH(rt.config[j].align or 'LEFT')
|
text:SetJustifyH(rt.config[j].align or 'LEFT')
|
||||||
text:SetJustifyV 'CENTER'
|
text:SetJustifyV('CENTER')
|
||||||
text:SetPoint('TOPLEFT', 1, -1)
|
text:SetPoint('TOPLEFT', 1, -1)
|
||||||
text:SetPoint('BOTTOMRIGHT', -1, 1)
|
text:SetPoint('BOTTOMRIGHT', -1, 1)
|
||||||
cell:SetFontString(text)
|
cell:SetFontString(text)
|
||||||
|
|||||||
+22
-22
@@ -8,7 +8,7 @@ function LOAD()
|
|||||||
aux_border:SetTexture(1, 1, 1, .02)
|
aux_border:SetTexture(1, 1, 1, .02)
|
||||||
aux_border:SetPoint('TOPLEFT', DropDownList1Backdrop, 'TOPLEFT', -2, 2)
|
aux_border:SetPoint('TOPLEFT', DropDownList1Backdrop, 'TOPLEFT', -2, 2)
|
||||||
aux_border:SetPoint('BOTTOMRIGHT', DropDownList1Backdrop, 'BOTTOMRIGHT', 1.5, -1.5)
|
aux_border:SetPoint('BOTTOMRIGHT', DropDownList1Backdrop, 'BOTTOMRIGHT', 1.5, -1.5)
|
||||||
aux_border:SetBlendMode 'ADD'
|
aux_border:SetBlendMode('ADD')
|
||||||
aux_background = DropDownList1:CreateTexture(nil, 'OVERLAY')
|
aux_background = DropDownList1:CreateTexture(nil, 'OVERLAY')
|
||||||
aux_background:SetTexture(color.content.background())
|
aux_background:SetTexture(color.content.background())
|
||||||
aux_background:SetAllPoints(DropDownList1Backdrop)
|
aux_background:SetAllPoints(DropDownList1Backdrop)
|
||||||
@@ -42,7 +42,7 @@ function LOAD()
|
|||||||
text:SetPoint('BOTTOMRIGHT', -8, 0)
|
text:SetPoint('BOTTOMRIGHT', -8, 0)
|
||||||
local highlight = _G['DropDownList1Button'..i..'Highlight']
|
local highlight = _G['DropDownList1Button'..i..'Highlight']
|
||||||
highlight:ClearAllPoints()
|
highlight:ClearAllPoints()
|
||||||
highlight:SetDrawLayer 'OVERLAY'
|
highlight:SetDrawLayer('OVERLAY')
|
||||||
highlight:SetHeight(14)
|
highlight:SetHeight(14)
|
||||||
highlight:SetPoint('LEFT', 5, 0)
|
highlight:SetPoint('LEFT', 5, 0)
|
||||||
highlight:SetPoint('RIGHT', -3, 0)
|
highlight:SetPoint('RIGHT', -3, 0)
|
||||||
@@ -64,7 +64,7 @@ function LOAD()
|
|||||||
text:SetShadowOffset(1, -1)
|
text:SetShadowOffset(1, -1)
|
||||||
local highlight = _G['DropDownList1Button'..i..'Highlight']
|
local highlight = _G['DropDownList1Button'..i..'Highlight']
|
||||||
highlight:SetAllPoints()
|
highlight:SetAllPoints()
|
||||||
highlight:SetDrawLayer 'BACKGROUND'
|
highlight:SetDrawLayer('BACKGROUND')
|
||||||
local check = _G['DropDownList1Button'..i..'Check']
|
local check = _G['DropDownList1Button'..i..'Check']
|
||||||
check:SetWidth(24)
|
check:SetWidth(24)
|
||||||
check:SetHeight(24)
|
check:SetHeight(24)
|
||||||
@@ -97,7 +97,7 @@ end
|
|||||||
do
|
do
|
||||||
local menu, structure, orig
|
local menu, structure, orig
|
||||||
menu = CreateFrame('Frame', name, UIParent, 'UIMenuTemplate')
|
menu = CreateFrame('Frame', name, UIParent, 'UIMenuTemplate')
|
||||||
orig = menu:GetScript 'OnShow'
|
orig = menu:GetScript('OnShow')
|
||||||
menu:SetScript('OnShow', function()
|
menu:SetScript('OnShow', function()
|
||||||
UIMenu_Initialize()
|
UIMenu_Initialize()
|
||||||
for i = 1, getn(structure) do
|
for i = 1, getn(structure) do
|
||||||
@@ -171,14 +171,14 @@ function public.button(parent, text_height)
|
|||||||
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
|
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
|
||||||
highlight:SetAllPoints()
|
highlight:SetAllPoints()
|
||||||
highlight:SetTexture(1, 1, 1, .2)
|
highlight:SetTexture(1, 1, 1, .2)
|
||||||
highlight:SetBlendMode 'BLEND'
|
highlight:SetBlendMode('BLEND')
|
||||||
button.highlight = highlight
|
button.highlight = highlight
|
||||||
do
|
do
|
||||||
local label = button:CreateFontString()
|
local label = button:CreateFontString()
|
||||||
label:SetFont(font, text_height)
|
label:SetFont(font, text_height)
|
||||||
label:SetPoint('CENTER', 0, 0)
|
label:SetPoint('CENTER', 0, 0)
|
||||||
label:SetJustifyH 'CENTER'
|
label:SetJustifyH('CENTER')
|
||||||
label:SetJustifyV 'CENTER'
|
label:SetJustifyV('CENTER')
|
||||||
label:SetHeight(text_height)
|
label:SetHeight(text_height)
|
||||||
label:SetTextColor(color.text.enabled())
|
label:SetTextColor(color.text.enabled())
|
||||||
button:SetFontString(label)
|
button:SetFontString(label)
|
||||||
@@ -226,14 +226,14 @@ do
|
|||||||
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
|
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
|
||||||
highlight:SetAllPoints()
|
highlight:SetAllPoints()
|
||||||
highlight:SetTexture(1, 1, 1, .2)
|
highlight:SetTexture(1, 1, 1, .2)
|
||||||
highlight:SetBlendMode 'BLEND'
|
highlight:SetBlendMode('BLEND')
|
||||||
tab.highlight = highlight
|
tab.highlight = highlight
|
||||||
|
|
||||||
tab.text = tab:CreateFontString()
|
tab.text = tab:CreateFontString()
|
||||||
tab.text:SetPoint('LEFT', 3, -1)
|
tab.text:SetPoint('LEFT', 3, -1)
|
||||||
tab.text:SetPoint('RIGHT', -3, -1)
|
tab.text:SetPoint('RIGHT', -3, -1)
|
||||||
tab.text:SetJustifyH 'CENTER'
|
tab.text:SetJustifyH('CENTER')
|
||||||
tab.text:SetJustifyV 'CENTER'
|
tab.text:SetJustifyV('CENTER')
|
||||||
tab.text:SetFont(font, font_size.large2)
|
tab.text:SetFont(font, font_size.large2)
|
||||||
tab:SetFontString(tab.text)
|
tab:SetFontString(tab.text)
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ do
|
|||||||
|
|
||||||
tab:SetScript('OnClick', function()
|
tab:SetScript('OnClick', function()
|
||||||
if this.id ~= this.group.selected then
|
if this.id ~= this.group.selected then
|
||||||
PlaySound 'igCharacterInfoTab'
|
PlaySound('igCharacterInfoTab')
|
||||||
this.group:select(this.id)
|
this.group:select(this.id)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -373,11 +373,11 @@ function public.editbox(parent)
|
|||||||
display:SetTextColor(color.text.enabled())
|
display:SetTextColor(color.text.enabled())
|
||||||
editbox.display = display
|
editbox.display = display
|
||||||
local cursor = label(editbox, font_size.large)
|
local cursor = label(editbox, font_size.large)
|
||||||
cursor:SetText '|'
|
cursor:SetText('|')
|
||||||
cursor:SetTextColor(color.text.enabled())
|
cursor:SetTextColor(color.text.enabled())
|
||||||
cursor:SetAlpha(0)
|
cursor:SetAlpha(0)
|
||||||
editbox.cursor = cursor
|
editbox.cursor = cursor
|
||||||
editbox:SetAlignment 'LEFT'
|
editbox:SetAlignment('LEFT')
|
||||||
editbox:SetFontSize(font_size.medium)
|
editbox:SetFontSize(font_size.medium)
|
||||||
return editbox
|
return editbox
|
||||||
end
|
end
|
||||||
@@ -389,10 +389,10 @@ function public.status_bar(parent)
|
|||||||
do
|
do
|
||||||
-- minor status bar (gray one)
|
-- minor status bar (gray one)
|
||||||
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
|
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
|
||||||
status_bar:SetOrientation 'HORIZONTAL'
|
status_bar:SetOrientation('HORIZONTAL')
|
||||||
status_bar:SetMinMaxValues(0, 100)
|
status_bar:SetMinMaxValues(0, 100)
|
||||||
status_bar:SetAllPoints()
|
status_bar:SetAllPoints()
|
||||||
status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]]
|
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
|
||||||
status_bar:SetStatusBarColor(.42, .42, .42, .7)
|
status_bar:SetStatusBarColor(.42, .42, .42, .7)
|
||||||
status_bar:SetFrameLevel(level + 2)
|
status_bar:SetFrameLevel(level + 2)
|
||||||
status_bar:SetScript('OnUpdate', function()
|
status_bar:SetScript('OnUpdate', function()
|
||||||
@@ -407,10 +407,10 @@ function public.status_bar(parent)
|
|||||||
do
|
do
|
||||||
-- major status bar (main blue one)
|
-- major status bar (main blue one)
|
||||||
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
|
local status_bar = CreateFrame('STATUSBAR', nil, self, 'TextStatusBar')
|
||||||
status_bar:SetOrientation 'HORIZONTAL'
|
status_bar:SetOrientation('HORIZONTAL')
|
||||||
status_bar:SetMinMaxValues(0, 100)
|
status_bar:SetMinMaxValues(0, 100)
|
||||||
status_bar:SetAllPoints()
|
status_bar:SetAllPoints()
|
||||||
status_bar:SetStatusBarTexture [[Interface\Buttons\WHITE8X8]]
|
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
|
||||||
status_bar:SetStatusBarColor(.19, .22, .33, .9)
|
status_bar:SetStatusBarColor(.19, .22, .33, .9)
|
||||||
status_bar:SetFrameLevel(level + 3)
|
status_bar:SetFrameLevel(level + 3)
|
||||||
status_bar:SetScript('OnUpdate', function()
|
status_bar:SetScript('OnUpdate', function()
|
||||||
@@ -456,7 +456,7 @@ function public.item(parent)
|
|||||||
item.texture = _G[btn:GetName()..'Icon']
|
item.texture = _G[btn:GetName()..'Icon']
|
||||||
item.texture:SetTexCoord(.06, .94, .06, .94)
|
item.texture:SetTexCoord(.06, .94, .06, .94)
|
||||||
item.name = label(btn, 15)
|
item.name = label(btn, 15)
|
||||||
item.name:SetJustifyH 'LEFT'
|
item.name:SetJustifyH('LEFT')
|
||||||
item.name:SetPoint('LEFT', btn, 'RIGHT', 10, 0)
|
item.name:SetPoint('LEFT', btn, 'RIGHT', 10, 0)
|
||||||
item.name:SetPoint('RIGHT', item, 'RIGHT', -10, .5)
|
item.name:SetPoint('RIGHT', item, 'RIGHT', -10, .5)
|
||||||
item.count = _G[btn:GetName()..'Count']
|
item.count = _G[btn:GetName()..'Count']
|
||||||
@@ -524,7 +524,7 @@ end
|
|||||||
function public.slider(parent)
|
function public.slider(parent)
|
||||||
|
|
||||||
local slider = CreateFrame('Slider', nil, parent)
|
local slider = CreateFrame('Slider', nil, parent)
|
||||||
slider:SetOrientation 'HORIZONTAL'
|
slider:SetOrientation('HORIZONTAL')
|
||||||
slider:SetHeight(6)
|
slider:SetHeight(6)
|
||||||
slider:SetHitRectInsets(0, 0, -12, -12)
|
slider:SetHitRectInsets(0, 0, -12, -12)
|
||||||
slider:SetValue(0)
|
slider:SetValue(0)
|
||||||
@@ -541,7 +541,7 @@ function public.slider(parent)
|
|||||||
local label = slider:CreateFontString(nil, 'OVERLAY')
|
local label = slider:CreateFontString(nil, 'OVERLAY')
|
||||||
label:SetPoint('BOTTOMLEFT', slider, 'TOPLEFT', -3, 8)
|
label:SetPoint('BOTTOMLEFT', slider, 'TOPLEFT', -3, 8)
|
||||||
label:SetPoint('BOTTOMRIGHT', slider, 'TOPRIGHT', 6, 8)
|
label:SetPoint('BOTTOMRIGHT', slider, 'TOPRIGHT', 6, 8)
|
||||||
label:SetJustifyH 'LEFT'
|
label:SetJustifyH('LEFT')
|
||||||
label:SetHeight(13)
|
label:SetHeight(13)
|
||||||
label:SetFont(font, font_size.small)
|
label:SetFont(font, font_size.small)
|
||||||
label:SetTextColor(color.label.enabled())
|
label:SetTextColor(color.label.enabled())
|
||||||
@@ -549,7 +549,7 @@ function public.slider(parent)
|
|||||||
local editbox = editbox(slider)
|
local editbox = editbox(slider)
|
||||||
editbox:SetPoint('LEFT', slider, 'RIGHT', 5, 0)
|
editbox:SetPoint('LEFT', slider, 'RIGHT', 5, 0)
|
||||||
set_size(editbox, 45, 18)
|
set_size(editbox, 45, 18)
|
||||||
editbox:SetAlignment 'CENTER'
|
editbox:SetAlignment('CENTER')
|
||||||
editbox:SetFontSize(17)
|
editbox:SetFontSize(17)
|
||||||
|
|
||||||
slider.label = label
|
slider.label = label
|
||||||
@@ -567,6 +567,6 @@ function public.checkbox(parent)
|
|||||||
checkbox:GetHighlightTexture():SetAllPoints()
|
checkbox:GetHighlightTexture():SetAllPoints()
|
||||||
checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2)
|
checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2)
|
||||||
checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88)
|
checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88)
|
||||||
checkbox:GetHighlightTexture 'BLEND'
|
checkbox:GetHighlightTexture('BLEND')
|
||||||
return checkbox
|
return checkbox
|
||||||
end
|
end
|
||||||
+1
-1
@@ -334,7 +334,7 @@ local methods = {
|
|||||||
local col = CreateFrame('Button', nil, row)
|
local col = CreateFrame('Button', nil, row)
|
||||||
local text = col:CreateFontString()
|
local text = col:CreateFontString()
|
||||||
text:SetFont(gui.font, ST_ROW_TEXT_SIZE)
|
text:SetFont(gui.font, ST_ROW_TEXT_SIZE)
|
||||||
text:SetJustifyV 'CENTER'
|
text:SetJustifyV('CENTER')
|
||||||
text:SetPoint('TOPLEFT', 1, -1)
|
text:SetPoint('TOPLEFT', 1, -1)
|
||||||
text:SetPoint('BOTTOMRIGHT', -1, 1)
|
text:SetPoint('BOTTOMRIGHT', -1, 1)
|
||||||
col.text = text
|
col.text = text
|
||||||
|
|||||||
+3
-3
@@ -446,7 +446,7 @@ function refresh_entries()
|
|||||||
existing_auctions[item_key] = nil
|
existing_auctions[item_key] = nil
|
||||||
local query = scan_util.item_query(item_id)
|
local query = scan_util.item_query(item_id)
|
||||||
status_bar:update_status(0,0)
|
status_bar:update_status(0,0)
|
||||||
status_bar:set_text 'Scanning auctions...'
|
status_bar:set_text('Scanning auctions...')
|
||||||
|
|
||||||
scan_id = scan.start{
|
scan_id = scan.start{
|
||||||
type = 'list',
|
type = 'list',
|
||||||
@@ -472,13 +472,13 @@ function refresh_entries()
|
|||||||
existing_auctions[item_key] = nil
|
existing_auctions[item_key] = nil
|
||||||
update_historical_value_button()
|
update_historical_value_button()
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text 'Scan aborted'
|
status_bar:set_text('Scan aborted')
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
existing_auctions[item_key] = existing_auctions[item_key] or t
|
existing_auctions[item_key] = existing_auctions[item_key] or t
|
||||||
refresh = true
|
refresh = true
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text 'Scan complete'
|
status_bar:set_text('Scan complete')
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
+17
-17
@@ -34,7 +34,7 @@ function create_frames()
|
|||||||
end)
|
end)
|
||||||
local label = gui.label(checkbox, gui.font_size.small)
|
local label = gui.label(checkbox, gui.font_size.small)
|
||||||
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
||||||
label:SetText 'Show hidden items'
|
label:SetText('Show hidden items')
|
||||||
show_hidden_checkbox = checkbox
|
show_hidden_checkbox = checkbox
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -86,14 +86,14 @@ function create_frames()
|
|||||||
status_bar:SetHeight(25)
|
status_bar:SetHeight(25)
|
||||||
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
|
status_bar:SetPoint('TOPLEFT', aux_frame.content, 'BOTTOMLEFT', 0, -6)
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text ''
|
status_bar:set_text('')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local btn = gui.button(frame.parameters, 16)
|
local btn = gui.button(frame.parameters, 16)
|
||||||
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Post'
|
btn:SetText('Post')
|
||||||
btn:SetScript('OnClick', post_auctions)
|
btn:SetScript('OnClick', post_auctions)
|
||||||
post_button = btn
|
post_button = btn
|
||||||
end
|
end
|
||||||
@@ -102,7 +102,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Refresh'
|
btn:SetText('Refresh')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
scan.abort(scan_id)
|
scan.abort(scan_id)
|
||||||
refresh_entries()
|
refresh_entries()
|
||||||
@@ -150,7 +150,7 @@ function create_frames()
|
|||||||
end)
|
end)
|
||||||
slider.editbox:SetNumeric(true)
|
slider.editbox:SetNumeric(true)
|
||||||
slider.editbox:SetMaxLetters(3)
|
slider.editbox:SetMaxLetters(3)
|
||||||
slider.label:SetText 'Stack Size'
|
slider.label:SetText('Stack Size')
|
||||||
stack_size_slider = slider
|
stack_size_slider = slider
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -173,7 +173,7 @@ function create_frames()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
slider.editbox:SetNumeric(true)
|
slider.editbox:SetNumeric(true)
|
||||||
slider.label:SetText 'Stack Count'
|
slider.label:SetText('Stack Count')
|
||||||
stack_count_slider = slider
|
stack_count_slider = slider
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -205,7 +205,7 @@ function create_frames()
|
|||||||
end)
|
end)
|
||||||
local label = gui.label(checkbox, gui.font_size.small)
|
local label = gui.label(checkbox, gui.font_size.small)
|
||||||
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
|
||||||
label:SetText 'Hide this item'
|
label:SetText('Hide this item')
|
||||||
hide_checkbox = checkbox
|
hide_checkbox = checkbox
|
||||||
end
|
end
|
||||||
local function money_input()
|
local function money_input()
|
||||||
@@ -221,7 +221,7 @@ function create_frames()
|
|||||||
frame:SetHeight(22)
|
frame:SetHeight(22)
|
||||||
local editbox = gui.editbox(frame)
|
local editbox = gui.editbox(frame)
|
||||||
editbox:SetAllPoints()
|
editbox:SetAllPoints()
|
||||||
editbox:SetAlignment 'RIGHT'
|
editbox:SetAlignment('RIGHT')
|
||||||
editbox:SetFontSize(17)
|
editbox:SetFontSize(17)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() and stack_count_slider.editbox:IsVisible() then
|
if IsShiftKeyDown() and stack_count_slider.editbox:IsVisible() then
|
||||||
@@ -250,18 +250,18 @@ function create_frames()
|
|||||||
editbox.pretty = gui.label(frame, 17)
|
editbox.pretty = gui.label(frame, 17)
|
||||||
editbox.pretty:SetPoint('LEFT', 1, 0)
|
editbox.pretty:SetPoint('LEFT', 1, 0)
|
||||||
editbox.pretty:SetPoint('RIGHT', -2, 0)
|
editbox.pretty:SetPoint('RIGHT', -2, 0)
|
||||||
editbox.pretty:SetJustifyH 'RIGHT'
|
editbox.pretty:SetJustifyH('RIGHT')
|
||||||
editbox.pretty:SetTextColor(color.text.enabled())
|
editbox.pretty:SetTextColor(color.text.enabled())
|
||||||
do
|
do
|
||||||
local label = gui.label(frame, gui.font_size.small)
|
local label = gui.label(frame, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
|
||||||
label:SetText 'Unit Starting Price'
|
label:SetText('Unit Starting Price')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = gui.label(frame, 14)
|
local label = gui.label(frame, 14)
|
||||||
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
|
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
|
||||||
label:SetWidth(50)
|
label:SetWidth(50)
|
||||||
label:SetJustifyH 'CENTER'
|
label:SetJustifyH('CENTER')
|
||||||
start_price_percentage = label
|
start_price_percentage = label
|
||||||
end
|
end
|
||||||
unit_start_price = editbox
|
unit_start_price = editbox
|
||||||
@@ -275,7 +275,7 @@ function create_frames()
|
|||||||
frame:SetHeight(22)
|
frame:SetHeight(22)
|
||||||
local editbox = gui.editbox(frame)
|
local editbox = gui.editbox(frame)
|
||||||
editbox:SetAllPoints()
|
editbox:SetAllPoints()
|
||||||
editbox:SetAlignment 'RIGHT'
|
editbox:SetAlignment('RIGHT')
|
||||||
editbox:SetFontSize(17)
|
editbox:SetFontSize(17)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
@@ -302,18 +302,18 @@ function create_frames()
|
|||||||
editbox.pretty = gui.label(frame, 17)
|
editbox.pretty = gui.label(frame, 17)
|
||||||
editbox.pretty:SetPoint('LEFT', 1, 0)
|
editbox.pretty:SetPoint('LEFT', 1, 0)
|
||||||
editbox.pretty:SetPoint('RIGHT', -2, 0)
|
editbox.pretty:SetPoint('RIGHT', -2, 0)
|
||||||
editbox.pretty:SetJustifyH 'RIGHT'
|
editbox.pretty:SetJustifyH('RIGHT')
|
||||||
editbox.pretty:SetTextColor(color.text.enabled())
|
editbox.pretty:SetTextColor(color.text.enabled())
|
||||||
do
|
do
|
||||||
local label = gui.label(frame, gui.font_size.small)
|
local label = gui.label(frame, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT', -2, 1)
|
||||||
label:SetText 'Unit Buyout Price'
|
label:SetText('Unit Buyout Price')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local label = gui.label(frame, 14)
|
local label = gui.label(frame, 14)
|
||||||
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
|
label:SetPoint('LEFT', frame, 'RIGHT', 8, 0)
|
||||||
label:SetWidth(50)
|
label:SetWidth(50)
|
||||||
label:SetJustifyH 'CENTER'
|
label:SetJustifyH('CENTER')
|
||||||
buyout_price_percentage = label
|
buyout_price_percentage = label
|
||||||
end
|
end
|
||||||
unit_buyout_price = editbox
|
unit_buyout_price = editbox
|
||||||
@@ -322,7 +322,7 @@ function create_frames()
|
|||||||
local btn = gui.button(frame.parameters, 14)
|
local btn = gui.button(frame.parameters, 14)
|
||||||
btn:SetPoint('TOPRIGHT', -10, -146)
|
btn:SetPoint('TOPRIGHT', -10, -146)
|
||||||
gui.set_size(btn, 150, 20)
|
gui.set_size(btn, 150, 20)
|
||||||
btn:GetFontString():SetJustifyH 'RIGHT'
|
btn:GetFontString():SetJustifyH('RIGHT')
|
||||||
btn:GetFontString():SetPoint('RIGHT', -2, 0)
|
btn:GetFontString():SetPoint('RIGHT', -2, 0)
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
if this.amount then
|
if this.amount then
|
||||||
@@ -332,7 +332,7 @@ function create_frames()
|
|||||||
end)
|
end)
|
||||||
local label = gui.label(btn, gui.font_size.small)
|
local label = gui.label(btn, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', btn, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', btn, 'TOPLEFT', -2, 1)
|
||||||
label:SetText 'Historical Value'
|
label:SetText('Historical Value')
|
||||||
historical_value_button = btn
|
historical_value_button = btn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -53,7 +53,7 @@ function LOAD()
|
|||||||
create_frames()
|
create_frames()
|
||||||
subtab = SAVED
|
subtab = SAVED
|
||||||
update_auto_buy_filter()
|
update_auto_buy_filter()
|
||||||
new_search ''
|
new_search('')
|
||||||
current_search.placeholder = true
|
current_search.placeholder = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ function public.formatted_post_filter(components)
|
|||||||
elseif i > 1 then
|
elseif i > 1 then
|
||||||
str = str..'</p><p>'
|
str = str..'</p><p>'
|
||||||
for _=1,getn(stack) do
|
for _=1,getn(stack) do
|
||||||
str = str..color.content.background '----'
|
str = str..color.content.background('----')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
no_line_break = component[1] == 'operator' and component[2] == 'not'
|
no_line_break = component[1] == 'operator' and component[2] == 'not'
|
||||||
@@ -269,7 +269,7 @@ function add_post_filter()
|
|||||||
if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then
|
if components and getn(components.blizzard) == 0 and getn(components.post) == 1 then
|
||||||
add_component(components.post[1])
|
add_component(components.post[1])
|
||||||
update_filter_display()
|
update_filter_display()
|
||||||
filter_parameter_input:SetText ''
|
filter_parameter_input:SetText('')
|
||||||
filter_input:HighlightText()
|
filter_input:HighlightText()
|
||||||
filter_input:SetFocus()
|
filter_input:SetFocus()
|
||||||
elseif error then
|
elseif error then
|
||||||
|
|||||||
+12
-12
@@ -246,7 +246,7 @@ function create_frames()
|
|||||||
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
|
btn:SetPoint('BOTTOMLEFT', aux_frame.content, 'TOPLEFT', 10, 8)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText 'Search Results'
|
btn:SetText('Search Results')
|
||||||
btn:SetScript('OnClick', function() subtab = RESULTS end)
|
btn:SetScript('OnClick', function() subtab = RESULTS end)
|
||||||
search_results_button = btn
|
search_results_button = btn
|
||||||
end
|
end
|
||||||
@@ -255,7 +255,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', search_results_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText 'Saved Searches'
|
btn:SetText('Saved Searches')
|
||||||
btn:SetScript('OnClick', function() subtab = SAVED end)
|
btn:SetScript('OnClick', function() subtab = SAVED end)
|
||||||
saved_searches_button = btn
|
saved_searches_button = btn
|
||||||
end
|
end
|
||||||
@@ -264,7 +264,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', saved_searches_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(243)
|
btn:SetWidth(243)
|
||||||
btn:SetHeight(22)
|
btn:SetHeight(22)
|
||||||
btn:SetText 'Filter Builder'
|
btn:SetText('Filter Builder')
|
||||||
btn:SetScript('OnClick', function() subtab = FILTER end)
|
btn:SetScript('OnClick', function() subtab = FILTER end)
|
||||||
new_filter_button = btn
|
new_filter_button = btn
|
||||||
end
|
end
|
||||||
@@ -280,7 +280,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Bid'
|
btn:SetText('Bid')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
bid_button = btn
|
bid_button = btn
|
||||||
end
|
end
|
||||||
@@ -289,7 +289,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Buyout'
|
btn:SetText('Buyout')
|
||||||
btn:Disable()
|
btn:Disable()
|
||||||
buyout_button = btn
|
buyout_button = btn
|
||||||
end
|
end
|
||||||
@@ -298,7 +298,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Clear'
|
btn:SetText('Clear')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
while tremove(current_search.records) do end
|
while tremove(current_search.records) do end
|
||||||
current_search.table:SetDatabase()
|
current_search.table:SetDatabase()
|
||||||
@@ -309,7 +309,7 @@ function create_frames()
|
|||||||
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
btn:SetWidth(80)
|
btn:SetWidth(80)
|
||||||
btn:SetHeight(24)
|
btn:SetHeight(24)
|
||||||
btn:SetText 'Favorite'
|
btn:SetText('Favorite')
|
||||||
btn:SetScript('OnClick', function()
|
btn:SetScript('OnClick', function()
|
||||||
local filters = filter_util.queries(search_box:GetText())
|
local filters = filter_util.queries(search_box:GetText())
|
||||||
if filters then
|
if filters then
|
||||||
@@ -325,7 +325,7 @@ function create_frames()
|
|||||||
local btn1 = gui.button(frame.filter, 16)
|
local btn1 = gui.button(frame.filter, 16)
|
||||||
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
btn1:SetPoint('TOPLEFT', status_bar_frame, 'TOPRIGHT', 5, 0)
|
||||||
gui.set_size(btn1, 80, 24)
|
gui.set_size(btn1, 80, 24)
|
||||||
btn1:SetText 'Search'
|
btn1:SetText('Search')
|
||||||
btn1:SetScript('OnClick', function()
|
btn1:SetScript('OnClick', function()
|
||||||
export_query_string()
|
export_query_string()
|
||||||
execute()
|
execute()
|
||||||
@@ -334,13 +334,13 @@ function create_frames()
|
|||||||
local btn2 = gui.button(frame.filter, 16)
|
local btn2 = gui.button(frame.filter, 16)
|
||||||
btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0)
|
btn2:SetPoint('LEFT', btn1, 'RIGHT', 5, 0)
|
||||||
gui.set_size(btn2, 80, 24)
|
gui.set_size(btn2, 80, 24)
|
||||||
btn2:SetText 'Export'
|
btn2:SetText('Export')
|
||||||
btn2:SetScript('OnClick', export_query_string)
|
btn2:SetScript('OnClick', export_query_string)
|
||||||
|
|
||||||
local btn3 = gui.button(frame.filter, 16)
|
local btn3 = gui.button(frame.filter, 16)
|
||||||
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
|
btn3:SetPoint('LEFT', btn2, 'RIGHT', 5, 0)
|
||||||
gui.set_size(btn3, 80, 24)
|
gui.set_size(btn3, 80, 24)
|
||||||
btn3:SetText 'Import'
|
btn3:SetText('Import')
|
||||||
btn3:SetScript('OnClick', import_query_string)
|
btn3:SetScript('OnClick', import_query_string)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -367,7 +367,7 @@ function create_frames()
|
|||||||
editbox.enter = L(editbox.ClearFocus, editbox)
|
editbox.enter = L(editbox.ClearFocus, editbox)
|
||||||
local label = gui.label(editbox, gui.font_size.small)
|
local label = gui.label(editbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText 'Name'
|
label:SetText('Name')
|
||||||
name_input = editbox
|
name_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -401,7 +401,7 @@ function create_frames()
|
|||||||
end
|
end
|
||||||
local label = gui.label(editbox, gui.font_size.small)
|
local label = gui.label(editbox, gui.font_size.small)
|
||||||
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
|
||||||
label:SetText 'Level Range'
|
label:SetText('Level Range')
|
||||||
min_level_input = editbox
|
min_level_input = editbox
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ do
|
|||||||
|
|
||||||
search.status_bar = status_bars[getn(searches)]
|
search.status_bar = status_bars[getn(searches)]
|
||||||
search.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
search.status_bar:set_text ''
|
search.status_bar:set_text('')
|
||||||
|
|
||||||
search.table = tables[getn(searches)]
|
search.table = tables[getn(searches)]
|
||||||
search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
search.table:SetSort(1, 2, 3, 4, 5, 6, 7, 8, 9)
|
||||||
@@ -192,7 +192,7 @@ function start_real_time_scan(query, search, continuation)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if getn(new_records) > 1000 then
|
if getn(new_records) > 1000 then
|
||||||
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
|
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||||
else
|
else
|
||||||
search.records = new_records
|
search.records = new_records
|
||||||
search.table:SetDatabase(search.records)
|
search.table:SetDatabase(search.records)
|
||||||
@@ -204,7 +204,7 @@ function start_real_time_scan(query, search, continuation)
|
|||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
search.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
search.status_bar:set_text 'Scan paused'
|
search.status_bar:set_text('Scan paused')
|
||||||
|
|
||||||
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
search.continuation = next_page or not ignore_page and query.blizzard_query.first_page or true
|
||||||
|
|
||||||
@@ -244,9 +244,9 @@ function start_search(queries, continuation)
|
|||||||
on_scan_start = function()
|
on_scan_start = function()
|
||||||
search.status_bar:update_status(0,0)
|
search.status_bar:update_status(0,0)
|
||||||
if continuation then
|
if continuation then
|
||||||
search.status_bar:set_text 'Resuming scan...'
|
search.status_bar:set_text('Resuming scan...')
|
||||||
else
|
else
|
||||||
search.status_bar:set_text 'Scanning auctions...'
|
search.status_bar:set_text('Scanning auctions...')
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_page_loaded = function(_, total_scan_pages)
|
on_page_loaded = function(_, total_scan_pages)
|
||||||
@@ -272,13 +272,13 @@ function start_search(queries, continuation)
|
|||||||
elseif getn(search.records) < 1000 then
|
elseif getn(search.records) < 1000 then
|
||||||
tinsert(search.records, auction_record)
|
tinsert(search.records, auction_record)
|
||||||
if getn(search.records) == 1000 then
|
if getn(search.records) == 1000 then
|
||||||
StaticPopup_Show 'AUX_SEARCH_TABLE_FULL'
|
StaticPopup_Show('AUX_SEARCH_TABLE_FULL')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
search.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
search.status_bar:set_text 'Scan complete'
|
search.status_bar:set_text('Scan complete')
|
||||||
|
|
||||||
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
|
if current_search == search and frame.results:IsVisible() and getn(search.records) == 0 then
|
||||||
subtab = SAVED
|
subtab = SAVED
|
||||||
@@ -289,7 +289,7 @@ function start_search(queries, continuation)
|
|||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
search.status_bar:update_status(100, 100)
|
search.status_bar:update_status(100, 100)
|
||||||
search.status_bar:set_text 'Scan paused'
|
search.status_bar:set_text('Scan paused')
|
||||||
|
|
||||||
if current_query then
|
if current_query then
|
||||||
search.continuation = {current_query, current_page + 1}
|
search.continuation = {current_query, current_page + 1}
|
||||||
|
|||||||
+4
-4
@@ -37,7 +37,7 @@ function public.find(auction_record, status_bar, on_abort, on_failure, on_succes
|
|||||||
queries = queries,
|
queries = queries,
|
||||||
on_scan_start = function()
|
on_scan_start = function()
|
||||||
status_bar:update_status(0, 0)
|
status_bar:update_status(0, 0)
|
||||||
status_bar:set_text 'Searching auction...'
|
status_bar:set_text('Searching auction...')
|
||||||
end,
|
end,
|
||||||
on_start_query = function(query_index)
|
on_start_query = function(query_index)
|
||||||
status_bar:update_status((query_index - 1) / getn(queries) * 100, 0)
|
status_bar:update_status((query_index - 1) / getn(queries) * 100, 0)
|
||||||
@@ -47,20 +47,20 @@ function public.find(auction_record, status_bar, on_abort, on_failure, on_succes
|
|||||||
found = true
|
found = true
|
||||||
ctrl.suspend()
|
ctrl.suspend()
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text 'Auction found'
|
status_bar:set_text('Auction found')
|
||||||
return on_success(auction_record.index)
|
return on_success(auction_record.index)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
if not found then
|
if not found then
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text 'Auction not found'
|
status_bar:set_text('Auction not found')
|
||||||
return on_abort()
|
return on_abort()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
status_bar:update_status(100, 100)
|
status_bar:update_status(100, 100)
|
||||||
status_bar:set_text 'Auction not found'
|
status_bar:set_text('Auction not found')
|
||||||
return on_failure()
|
return on_failure()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user