Merge pull request #3 from OldManAlpha/dev

Add Blizzard Theme
This commit is contained in:
gwetchen
2025-06-26 21:45:10 +02:00
committed by GitHub
12 changed files with 1431 additions and 1152 deletions
+12 -5
View File
@@ -2,6 +2,7 @@ module 'aux'
local T = require 'T'
local post = require 'aux.tabs.post'
local gui = require 'aux.gui'
M.print = T.vararg-function(arg)
DEFAULT_CHAT_FRAME:AddMessage(LIGHTYELLOW_FONT_COLOR_CODE .. '<aux> ' .. join(map(arg, tostring), ' '))
@@ -22,12 +23,15 @@ local set_handler = {}
M.handle = setmetatable({}, {__metatable=false, __newindex=function(_, k, v) set_handler[k](v) end})
do
local handlers, handlers2 = {}, {}
local handlers_INIT_UI, handlers_LOAD, handlers_LOAD2 = {}, {}, {}
function set_handler.INIT_UI(f)
tinsert(handlers_INIT_UI, f)
end
function set_handler.LOAD(f)
tinsert(handlers, f)
tinsert(handlers_LOAD, f)
end
function set_handler.LOAD2(f)
tinsert(handlers2, f)
tinsert(handlers_LOAD2, f)
end
event_frame:SetScript('OnEvent', function()
if event == 'ADDON_LOADED' then
@@ -35,9 +39,11 @@ do
auction_ui_loaded()
end
elseif event == 'VARIABLES_LOADED' then
for _, f in handlers do f() end
gui.set_global_theme(aux and aux.account and aux.account.theme)
for _, f in handlers_INIT_UI do f() end
for _, f in handlers_LOAD do f() end
elseif event == 'PLAYER_LOGIN' then
for _, f in handlers2 do f() end
for _, f in handlers_LOAD2 do f() end
print('loaded - /aux')
else
_M[event]()
@@ -66,6 +72,7 @@ function handle.LOAD()
merchant_buy = {},
merchant_sell = {},
sharing = true,
theme = 'blizzard',
})
do
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
+11
View File
@@ -9,6 +9,10 @@ function status(enabled)
return (enabled and aux.color.green'on' or aux.color.red'off')
end
function warn_reload()
aux.print(aux.color.orange('A relog or reload is required for this change to take effect.'))
end
_G.SLASH_AUX1 = '/aux'
function SlashCmdList.AUX(command)
if not command then return end
@@ -27,6 +31,7 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'post' and arguments[2] == 'bid' then
aux.account_data.post_bid = not aux.account_data.post_bid
aux.print('post bid ' .. status(aux.account_data.post_bid))
warn_reload()
elseif arguments[1] == 'post' and arguments[2] == 'duration' and T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]] then
aux.account_data.post_duration = T.map('6', post.DURATION_2, '24', post.DURATION_8, '72', post.DURATION_24)[arguments[3]]
aux.print('post duration ' .. aux.color.blue(aux.account_data.post_duration / 60 * 3 .. 'h'))
@@ -61,6 +66,10 @@ function SlashCmdList.AUX(command)
elseif arguments[1] == 'sharing' then
aux.account_data.sharing = not aux.account_data.sharing
aux.print('sharing ' .. status(aux.account_data.sharing))
elseif arguments[1] == 'theme' and (arguments[2] == nil or (arguments[2] == 'legacy' or arguments[2] == 'blizzard')) then
aux.account_data.theme = arguments[2] or (aux.account_data.theme == 'blizzard' and 'legacy' or 'blizzard')
aux.print('theme ' .. aux.color.blue(aux.account_data.theme))
warn_reload()
elseif arguments[1] == 'show' and arguments[2] == 'hidden' then
aux.account_data.showhidden = not aux.account_data.showhidden
aux.print('show hidden ' .. status(aux.account_data.showhidden))
@@ -81,6 +90,8 @@ function SlashCmdList.AUX(command)
aux.print('- clear item cache')
aux.print('- populate wdb')
aux.print('- sharing [' .. status(aux.account_data.sharing) .. ']')
aux.print('- theme [' .. aux.color[aux.account_data.theme == 'blizzard' and 'green' or 'red']('blizzard') .. ' | ' ..
aux.color[aux.account_data.theme == 'legacy' and 'green' or 'red']('legacy') .. ']')
aux.print('- show hidden [' .. status(aux.account_data.showhidden) .. ']')
end
end
+56 -40
View File
@@ -8,44 +8,60 @@ function handle.LOAD()
end
end
do
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
tinsert(UISpecialFrames, 'aux_frame')
gui.set_window_style(frame)
gui.set_size(frame, 768, 447)
frame:SetPoint('LEFT', 100, 0)
frame:SetToplevel(true)
frame:SetMovable(true)
frame:EnableMouse(true)
frame:SetClampedToScreen(true)
frame:CreateTitleRegion():SetAllPoints()
frame:SetScript('OnShow', function() PlaySound('AuctionWindowOpen') end)
frame:SetScript('OnHide', function() PlaySound('AuctionWindowClose'); CloseAuctionHouse() end)
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOPLEFT', 4, -80)
frame.content:SetPoint('BOTTOMRIGHT', -4, 35)
frame:Hide()
M.frame = frame
end
do
tabs = gui.tabs(frame, 'DOWN')
tabs._on_select = on_tab_click
function M.set_tab(id) tabs:select(id) end
end
do
local btn = gui.button(frame)
btn:SetPoint('BOTTOMRIGHT', -5, 5)
gui.set_size(btn, 60, 24)
btn:SetText('Close')
btn:SetScript('OnClick', function() frame:Hide() end)
close_button = btn
end
do
local btn = gui.button(frame, gui.font_size.small)
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
gui.set_size(btn, 60, 24)
btn:SetText(color.blizzard'Blizzard UI')
btn:SetScript('OnClick',function()
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
end)
function handle.INIT_UI()
do
local frame = CreateFrame('Frame', 'aux_frame', UIParent)
tinsert(UISpecialFrames, 'aux_frame')
if not gui.is_blizzard() then
gui.set_window_style(frame)
end
gui.set_size(frame, 768, 447)
if gui.is_blizzard() then
local frameBorder = CreateFrame('Frame', '$parentBorder', frame)
frameBorder:SetWidth(frame:GetWidth() + 24)
frameBorder:SetHeight(frame:GetHeight() + 24)
frameBorder:SetPoint('CENTER', frame, 'CENTER')
frameBorder:SetBackdrop({edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 24,
tile = true, tileSize = 24, bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
insets = {
left = 6, right = 6, top = 6, bottom = 6 }})
end
frame:SetPoint('LEFT', 100, 0)
frame:SetToplevel(true)
frame:SetMovable(true)
frame:EnableMouse(true)
frame:SetClampedToScreen(true)
frame:CreateTitleRegion():SetAllPoints()
frame:SetScript('OnShow', function() PlaySound('AuctionWindowOpen') end)
frame:SetScript('OnHide', function() PlaySound('AuctionWindowClose'); CloseAuctionHouse() end)
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOPLEFT', 4, -80)
frame.content:SetPoint('BOTTOMRIGHT', -4, 35)
frame:Hide()
M.frame = frame
end
do
tabs = gui.tabs(frame, 'DOWN')
tabs._on_select = on_tab_click
function M.set_tab(id) tabs:select(id) end
end
do
local btn = gui.button(frame)
btn:SetPoint('BOTTOMRIGHT', -5, 5)
gui.set_size(btn, 60, 24)
btn:SetText('Close')
btn:SetScript('OnClick', function() frame:Hide() end)
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
close_button = btn
end
do
local btn = gui.button(frame, gui.font_size.small)
btn:SetPoint('RIGHT', close_button, 'LEFT' , -5, 0)
gui.set_size(btn, gui.is_blizzard() and 80 or 60, 24)
btn:SetText(color.blizzard'Blizzard UI')
btn:SetFrameLevel(btn:GetFrameLevel() + 2)
btn:SetScript('OnClick',function()
if AuctionFrame:IsVisible() then HideUIPanel(AuctionFrame) else ShowUIPanel(AuctionFrame) end
end)
end
end
+58 -32
View File
@@ -681,7 +681,7 @@ local methods = {
UpdateRows = function(self)
if self.rowInfo.numDisplayRows > getn(self.rows) then
self.contentFrame:SetPoint('BOTTOMRIGHT', -15, 0)
self.contentFrame:SetPoint('BOTTOMRIGHT', gui.is_blizzard() and -30 or -15, 0)
else
self.contentFrame:SetPoint('BOTTOMRIGHT', 0, 0)
end
@@ -696,17 +696,32 @@ local methods = {
for _, cell in self.headCells do
local tex = cell:GetNormalTexture()
tex:SetTexture[[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
if not gui.is_blizzard() then
tex:SetTexture[[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]]
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
else
tex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
tex:SetTexCoord(0.1, 0.8, 0, 1)
tex:SetVertexColor(1, 1, 1)
end
end
if getn(self.sorts) > 0 then
local last_sort = self.sorts[1]
local tex = self.headCells[last_sort.index]:GetNormalTexture()
if last_sort.descending then
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(.8, .6, 1, .8)
if not gui.is_blizzard() then
tex:SetTexture(.8, .6, 1, .8)
else
tex:SetVertexColor(0.75, .5, 1)
end
else
self.headCells[last_sort.index]:GetNormalTexture():SetTexture(.6, .8, 1, .8)
if not gui.is_blizzard() then
tex:SetTexture(.6, .8, 1, .8)
else
tex:SetVertexColor(.5, .75, 1)
end
end
end
@@ -920,19 +935,12 @@ function M.new(parent, rows, columns)
scrollFrame:SetAllPoints(contentFrame)
rt.scrollFrame = scrollFrame
FauxScrollFrame_Update(rt.scrollFrame, 0, rows, rt.ROW_HEIGHT)
local scrollBar = _G[scrollFrame:GetName() .. 'ScrollBar']
scrollBar:ClearAllPoints()
scrollBar:SetPoint('TOPRIGHT', rt, -4, -HEAD_HEIGHT)
scrollBar:SetPoint('BOTTOMRIGHT', rt, -4, 4)
scrollBar:SetWidth(10)
local thumbTex = scrollBar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
thumbTex:SetTexture(aux.color.content.background())
thumbTex:SetHeight(150)
thumbTex:SetWidth(scrollBar:GetWidth())
_G[scrollBar:GetName() .. 'ScrollUpButton']:Hide()
_G[scrollBar:GetName() .. 'ScrollDownButton']:Hide()
gui.set_scrollbar_style(scrollFrame, not gui.is_blizzard() and {
{'TOPRIGHT', parent, -4, -HEAD_HEIGHT}, {'BOTTOMRIGHT', parent, -4, 4} -- Default
} or {
{'TOPRIGHT', parent, -7, -20}, {'BOTTOMRIGHT', parent, -7, 18} -- Blizzard
})
rt.headCells = {}
for i, column in ipairs(rt.columns) do
@@ -959,18 +967,26 @@ function M.new(parent, rows, columns)
text:SetAllPoints()
local tex = cell:CreateTexture()
local highlight = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
cell:SetNormalTexture(tex)
highlight:SetAllPoints()
if not gui.is_blizzard() then
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
tex:SetTexCoord(.025, .957, .087, .931)
tex:SetAlpha(.2)
cell:SetHighlightTexture(tex)
highlight:SetTexture([[Interface\Buttons\UI-Listbox-Highlight]])
highlight:SetTexCoord(.025, .957, .087, .931)
else
tex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
tex:SetTexCoord(0.1, 0.8, 0, 1)
highlight:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
highlight:SetTexCoord(0.1, 0.8, 0, 1)
end
highlight:SetAlpha(.2)
cell:SetNormalTexture(tex)
cell:SetHighlightTexture(highlight)
tinsert(rt.headCells, cell)
end
@@ -994,7 +1010,11 @@ function M.new(parent, rows, columns)
end
local highlight = row:CreateTexture()
highlight:SetAllPoints()
highlight:SetTexture(1, .9, 0, .5)
if not gui.is_blizzard() then
highlight:SetTexture(1, .9, 0, .5)
else
highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
end
highlight:Hide()
row.highlight = highlight
@@ -1018,10 +1038,16 @@ function M.new(parent, rows, columns)
cell:SetPoint('TOPLEFT', row.cells[j - 1], 'TOPRIGHT')
end
if mod(j, 2) == 1 then
if gui.is_blizzard() or mod(j, 2) == 1 then
local tex = cell:CreateTexture()
tex:SetAllPoints()
tex:SetTexture(.3, .3, .3, .2)
if not gui.is_blizzard() then
tex:SetTexture(.3, .3, .3, .2)
else
tex:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight")
tex:SetTexCoord(0.1, 0.8, 0, 1)
tex:SetAlpha(0.3)
end
end
if column.init then
+295 -105
View File
@@ -107,15 +107,45 @@ do
end
end
local using_blizzard_theme = false
function M.set_global_theme(theme)
using_blizzard_theme = theme == 'blizzard'
end
function M.is_blizzard()
return using_blizzard_theme
end
function M.set_size(frame, width, height)
frame:SetWidth(width)
frame:SetHeight(height or width)
end
function M.set_frame_style(frame, backdrop_color, border_color, left, right, top, bottom)
frame:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=1.5, tile=true, insets={left=left, right=right, top=top, bottom=bottom}}
frame:SetBackdropColor(backdrop_color())
frame:SetBackdropBorderColor(border_color())
if not is_blizzard() then
frame:SetBackdrop{bgFile=[[Interface\Buttons\WHITE8X8]], edgeFile=[[Interface\Buttons\WHITE8X8]], edgeSize=1.5, tile=true, insets={left=left, right=right, top=top, bottom=bottom}}
frame:SetBackdropColor(backdrop_color())
frame:SetBackdropBorderColor(border_color())
else
frame:SetBackdrop({
bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
edgeSize = 11,
tile = true
})
frame:SetBackdropColor(0.09, 0.09, 0.19)
local border = CreateFrame('Frame', nil, frame)
border:SetPoint('TOPLEFT', frame, 'TOPLEFT', -3, 3)
border:SetPoint('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3)
border:SetBackdrop({
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
edgeSize = 11,
tileSize = 11,
tile = true
})
border:SetBackdropBorderColor(0.6, 0.6, 0.6)
end
end
function M.set_window_style(frame, left, right, top, bottom)
@@ -130,6 +160,66 @@ function M.set_content_style(frame, left, right, top, bottom)
set_frame_style(frame, aux.color.content.background, aux.color.content.border, left, right, top, bottom)
end
function M.set_scrollbar_style(scrollFrame, points)
local scrollBar = _G[scrollFrame:GetName() .. 'ScrollBar']
scrollBar:ClearAllPoints()
for _, pt in ipairs(points) do
scrollBar:SetPoint(unpack(pt))
end
if not is_blizzard() then
scrollBar:SetWidth(10)
local thumbTex = scrollBar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
thumbTex:SetTexture(aux.color.content.background())
thumbTex:SetHeight(150)
thumbTex:SetWidth(scrollBar:GetWidth())
_G[scrollBar:GetName() .. 'ScrollUpButton']:Hide()
_G[scrollBar:GetName() .. 'ScrollDownButton']:Hide()
else
-- A hacky dynamicly sized scrollbar background
local scrollUpButton = _G[scrollBar:GetName() .. 'ScrollUpButton']
local scrollDownButton = _G[scrollBar:GetName() .. 'ScrollDownButton']
local backgroundTop = scrollFrame:CreateTexture(nil, 'BACKGROUND')
backgroundTop:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-ScrollBar]])
backgroundTop:SetWidth(31)
backgroundTop:SetHeight(128)
backgroundTop:SetPoint('BOTTOM', scrollUpButton, 'TOP', 0, -128 + 4)
backgroundTop:SetTexCoord(0, 0.484375, 0, 0.5)
local backgroundBottom = scrollFrame:CreateTexture(nil, 'BACKGROUND')
backgroundBottom:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-ScrollBar]])
backgroundBottom:SetWidth(31)
backgroundBottom:SetHeight(106)
backgroundBottom:SetPoint('TOP', scrollDownButton, 'BOTTOM', 0, 106 - 2)
backgroundBottom:SetTexCoord(0.515625, 1.0, 0, 0.4140625)
local backgroundMiddle = scrollFrame:CreateTexture(nil, 'BACKGROUND')
backgroundMiddle:SetTexture([[Interface\PaperDollInfoFrame\UI-Character-ScrollBar]])
backgroundMiddle:SetWidth(31)
backgroundMiddle:SetPoint('TOP', backgroundTop, 'BOTTOM', 0, 0)
backgroundMiddle:SetTexCoord(0, 0.484375, 0.125, 0.875)
backgroundMiddle:Hide()
scrollBar:SetScript('OnSizeChanged', function()
-- Scrollbar height value is scaled, but the button heights aren't..
local missingSpace = (scrollBar:GetHeight() / scrollBar:GetEffectiveScale()) +
scrollUpButton:GetHeight() + scrollDownButton:GetHeight() + 10 -
(backgroundTop:GetHeight() + backgroundBottom:GetHeight())
if missingSpace > 0 then
backgroundMiddle:SetHeight(missingSpace)
backgroundMiddle:SetTexCoord(0, 0.484375, 0.125, 0.125 + (missingSpace / 256))
backgroundMiddle:Show()
else
backgroundMiddle:Hide()
end
end)
end
end
function M.panel(parent)
local panel = CreateFrame('Frame', nil, parent)
set_panel_style(panel)
@@ -139,13 +229,19 @@ end
function M.checkbutton(parent, text_height)
local button = button(parent, text_height)
button.state = false
button:SetBackdropColor(aux.color.state.disabled())
if not is_blizzard() then
button:SetBackdropColor(aux.color.state.disabled())
end
function button:SetChecked(state)
if state then
self:SetBackdropColor(aux.color.state.enabled())
if not is_blizzard() then
self:SetBackdropColor(aux.color.state.enabled())
end
self.state = true
else
self:SetBackdropColor(aux.color.state.disabled())
if not is_blizzard() then
self:SetBackdropColor(aux.color.state.disabled())
end
self.state = false
end
end
@@ -157,32 +253,56 @@ end
function M.button(parent, text_height)
text_height = text_height or font_size.large
local button = CreateFrame('Button', nil, parent)
local button = CreateFrame('Button', unique_name(), parent, is_blizzard() and "UIPanelButtonTemplate2" or nil)
set_size(button, 80, 24)
set_content_style(button)
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
button.highlight = highlight
do
local label = button:CreateFontString()
label:SetFont(font, text_height)
label:SetAllPoints(button)
label:SetJustifyH('CENTER')
label:SetJustifyV('CENTER')
label:SetTextColor(aux.color.text.enabled())
button:SetFontString(label)
if not is_blizzard() then
set_content_style(button)
local highlight = button:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
button.highlight = highlight
do
local label = button:CreateFontString()
label:SetFont(font, text_height)
label:SetAllPoints(button)
label:SetJustifyH('CENTER')
label:SetJustifyV('CENTER')
label:SetTextColor(aux.color.text.enabled())
button:SetFontString(label)
end
end
local buttonParts = is_blizzard() and {_G[button:GetName() .. "Left"],
_G[button:GetName() .. "Middle"], _G[button:GetName() .. "Right"]}
-- Shenanigans to make UIPanelButtonTemplate2 use the disabled texture when disabled
local realSetTexture = is_blizzard() and buttonParts[1].SetTexture
local textureLock = function() end
button.default_Enable = button.Enable
function button:Enable()
if self:IsEnabled() == 1 then return end
self:GetFontString():SetTextColor(aux.color.text.enabled())
if not is_blizzard() then
self:GetFontString():SetTextColor(aux.color.text.enabled())
else
for _, part in ipairs(buttonParts) do
part.SetTexture = realSetTexture
part:SetTexture([[Interface\Buttons\UI-Panel-Button-Up]])
end
end
return self:default_Enable()
end
button.default_Disable = button.Disable
function button:Disable()
if self:IsEnabled() == 0 then return end
self:GetFontString():SetTextColor(aux.color.text.disabled())
if not is_blizzard() then
self:GetFontString():SetTextColor(aux.color.text.disabled())
else
for _, part in ipairs(buttonParts) do
part:SetTexture([[Interface\Buttons\UI-Panel-Button-Disabled]])
part.SetTexture = textureLock
end
end
return self:default_Disable()
end
@@ -194,33 +314,38 @@ do
function mt.__index:create_tab(text)
local id = getn(self._tabs) + 1
local tab = CreateFrame('Button', unique_name(), self._frame)
local tab = CreateFrame('Button', "$parentTab"..id, self._frame, is_blizzard() and "CharacterFrameTabButtonTemplate" or nil)
tab.id = id
tab.group = self
tab:SetHeight(24)
set_panel_style(tab)
local dock = tab:CreateTexture(nil, 'OVERLAY')
dock:SetHeight(3)
if self._orientation == 'UP' then
dock:SetPoint('BOTTOMLEFT', 1, -1)
dock:SetPoint('BOTTOMRIGHT', -1, -1)
elseif self._orientation == 'DOWN' then
dock:SetPoint('TOPLEFT', 1, 1)
dock:SetPoint('TOPRIGHT', -1, 1)
end
dock:SetTexture(aux.color.panel.background())
tab.dock = dock
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
tab.highlight = highlight
tab.text = tab:CreateFontString()
tab.text:SetAllPoints()
tab.text:SetJustifyH('CENTER')
tab.text:SetJustifyV('CENTER')
tab.text:SetFont(font, font_size.large)
tab:SetFontString(tab.text)
if not is_blizzard() then
tab:SetHeight(24)
set_panel_style(tab)
local dock = tab:CreateTexture(nil, 'OVERLAY')
dock:SetHeight(3)
if self._orientation == 'UP' then
dock:SetPoint('BOTTOMLEFT', 1, -1)
dock:SetPoint('BOTTOMRIGHT', -1, -1)
elseif self._orientation == 'DOWN' then
dock:SetPoint('TOPLEFT', 1, 1)
dock:SetPoint('TOPRIGHT', -1, 1)
end
dock:SetTexture(aux.color.panel.background())
tab.dock = dock
local highlight = tab:CreateTexture(nil, 'HIGHLIGHT')
highlight:SetAllPoints()
highlight:SetTexture(1, 1, 1, .2)
tab.highlight = highlight
tab.text = tab:CreateFontString()
tab.text:SetAllPoints()
tab.text:SetJustifyH('CENTER')
tab.text:SetJustifyV('CENTER')
tab.text:SetFont(font, font_size.large)
tab:SetFontString(tab.text)
else
tab:RegisterForClicks("LeftButtonUp")
end
tab:SetText(text)
@@ -228,48 +353,63 @@ do
if this.id ~= this.group.selected then
PlaySound('igCharacterInfoTab')
this.group:select(this.id)
if is_blizzard() then
PanelTemplates_SetTab(self._frame, this.id)
end
end
end)
if getn(self._tabs) == 0 then
if self._orientation == 'UP' then
tab:SetPoint('BOTTOMLEFT', self._frame, 'TOPLEFT', 4, -1)
tab:SetPoint('BOTTOMLEFT', self._frame, 'TOPLEFT', 4, is_blizzard() and -8 or -1)
elseif self._orientation == 'DOWN' then
tab:SetPoint('TOPLEFT', self._frame, 'BOTTOMLEFT', 4, 1)
end
tab:SetPoint('TOPLEFT', self._frame, 'BOTTOMLEFT', 4, is_blizzard() and -8 or 1)
end
else
if self._orientation == 'UP' then
tab:SetPoint('BOTTOMLEFT', self._tabs[getn(self._tabs)], 'BOTTOMRIGHT', 4, 0)
tab:SetPoint('BOTTOMLEFT', self._tabs[getn(self._tabs)], 'BOTTOMRIGHT', is_blizzard() and 0 or 4, 0)
elseif self._orientation == 'DOWN' then
tab:SetPoint('TOPLEFT', self._tabs[getn(self._tabs)], 'TOPRIGHT', 4, 0)
tab:SetPoint('TOPLEFT', self._tabs[getn(self._tabs)], 'TOPRIGHT', is_blizzard() and 0 or 4, 0)
end
end
tab:SetWidth(tab:GetFontString():GetStringWidth() + 14)
if not is_blizzard() then
tab:SetWidth(tab:GetFontString():GetStringWidth() + 14)
end
tinsert(self._tabs, tab)
if is_blizzard() then
PanelTemplates_SetNumTabs(self._frame, getn(self._tabs))
PanelTemplates_SetTab(self._frame, 1)
end
end
function mt.__index:select(id)
self._selected = id
self:update()
if is_blizzard() then
PanelTemplates_SetTab(self._frame, id)
end
do (self._on_select or pass)(id) end
end
function mt.__index:update()
for _, tab in self._tabs do
if tab.group._selected == tab.id then
tab.text:SetTextColor(aux.color.label.enabled())
tab:Disable()
tab:SetBackdropColor(aux.color.panel.background())
tab.dock:Show()
tab:SetHeight(29)
else
tab.text:SetTextColor(aux.color.text.enabled())
tab:Enable()
tab:SetBackdropColor(aux.color.content.background())
tab.dock:Hide()
tab:SetHeight(24)
end
end
if not is_blizzard() then
for _, tab in self._tabs do
if tab.group._selected == tab.id then
tab.text:SetTextColor(aux.color.label.enabled())
tab:Disable()
tab:SetBackdropColor(aux.color.panel.background())
tab.dock:Show()
tab:SetHeight(29)
else
tab.text:SetTextColor(aux.color.text.enabled())
tab:Enable()
tab:SetBackdropColor(aux.color.content.background())
tab.dock:Hide()
tab:SetHeight(24)
end
end
end
end
function M.tabs(parent, orientation)
local self = {
@@ -282,13 +422,15 @@ do
end
function M.editbox(parent)
local editbox = CreateFrame('EditBox', nil, parent)
local editbox = CreateFrame('EditBox', unique_name(), parent, is_blizzard() and "InputBoxTemplate" or nil)
editbox:SetAutoFocus(false)
editbox:SetTextInsets(1.5, 1.5, 3, 3)
editbox:SetMaxLetters(nil)
editbox:SetHeight(24)
editbox:SetTextColor(0, 0, 0, 0)
set_content_style(editbox)
if not is_blizzard() then
set_content_style(editbox)
end
editbox:SetScript('OnEscapePressed', function()
this:ClearFocus()
do (this.escape or pass)() end
@@ -375,8 +517,11 @@ do
status_bar:SetOrientation('HORIZONTAL')
status_bar:SetMinMaxValues(0, 1)
status_bar:SetAllPoints()
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
status_bar:SetStatusBarColor(.42, .42, .42, .7)
status_bar:SetStatusBarTexture(is_blizzard() and [[Interface\Glues\LoadingBar\Loading-BarFill]] or
[[Interface\Buttons\WHITE8X8]])
if not is_blizzard() then
status_bar:SetStatusBarColor(.42, .42, .42, 1)
end
status_bar:SetFrameLevel(level + 2)
status_bar:SetScript('OnUpdate', update_bar)
self.secondary_status_bar = status_bar
@@ -386,8 +531,11 @@ do
status_bar:SetOrientation('HORIZONTAL')
status_bar:SetMinMaxValues(0, 1)
status_bar:SetAllPoints()
status_bar:SetStatusBarTexture([[Interface\Buttons\WHITE8X8]])
status_bar:SetStatusBarColor(.19, .22, .33, .9)
status_bar:SetStatusBarTexture(is_blizzard() and [[Interface\Glues\LoadingBar\Loading-BarFill]] or
[[Interface\Buttons\WHITE8X8]])
if not is_blizzard() then
status_bar:SetStatusBarColor(.19, .22, .33, 1)
end
status_bar:SetFrameLevel(level + 3)
status_bar:SetScript('OnUpdate', update_bar)
self.primary_status_bar = status_bar
@@ -401,6 +549,17 @@ do
text:SetPoint('CENTER', 0, 0)
self.text = text
end
if is_blizzard() then
local statusBarBorder = CreateFrame("Frame", nil, self)
statusBarBorder:SetPoint("TOPLEFT", self, "TOPLEFT", -4, 4)
statusBarBorder:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 4, -4)
statusBarBorder:SetFrameLevel(level + 5)
statusBarBorder:SetBackdrop({edgeFile="Interface\\DialogFrame\\UI-DialogBox-Border", edgeSize = 20,
tile = true, tileSize = 20})
end
function self:update_status(primary_status, secondary_status)
if primary_status then
self.primary_status_bar:SetValue(primary_status)
@@ -470,44 +629,72 @@ end
function M.dropdown(parent)
local dropdown = CreateFrame('Frame', unique_name(), parent, 'UIDropDownMenuTemplate')
set_content_style(dropdown, 0, 0, 4, 4)
_G[dropdown:GetName() .. 'Left']:Hide()
_G[dropdown:GetName() .. 'Middle']:Hide()
_G[dropdown:GetName() .. 'Right']:Hide()
if not is_blizzard() then
set_content_style(dropdown, 0, 0, 4, 4)
_G[dropdown:GetName() .. 'Left']:Hide()
_G[dropdown:GetName() .. 'Middle']:Hide()
_G[dropdown:GetName() .. 'Right']:Hide()
else
local left = _G[dropdown:GetName() .. 'Left']
local a,b,c,d,e = left:GetPoint(1)
left:ClearAllPoints()
left:SetPoint(a,b,c, -20, e - 1)
end
local dropdownSetWidth = dropdown.SetWidth
dropdown.SetWidth = function(self, width)
_G[dropdown:GetName() .. 'Middle']:SetWidth(width - 15)
dropdownSetWidth(self, width)
_G[dropdown:GetName() .. 'Text']:SetWidth(width - 25)
dropdown.noResize = 1
end
local button = _G[dropdown:GetName() .. 'Button']
button:ClearAllPoints()
button:SetScale(.9)
button:SetPoint('RIGHT', dropdown, 0, 0)
dropdown.button = button
local text = _G[dropdown:GetName() .. 'Text']
text:ClearAllPoints()
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
text:SetPoint('LEFT', 8, 0)
text:SetFont(font, font_size.medium)
text:SetShadowColor(0, 0, 0, 0)
if not is_blizzard() then
button:ClearAllPoints()
button:SetScale(.9)
button:SetPoint('RIGHT', dropdown, 0, 0)
local text = _G[dropdown:GetName() .. 'Text']
text:ClearAllPoints()
text:SetPoint('RIGHT', button, 'LEFT', -2, 0)
text:SetPoint('LEFT', 8, 0)
text:SetFont(font, font_size.medium)
text:SetShadowColor(0, 0, 0, 0)
end
return dropdown
end
function M.slider(parent)
local slider = CreateFrame('Slider', nil, parent)
local slider = CreateFrame('Slider', unique_name(), parent, is_blizzard() and "OptionsSliderTemplate" or nil)
slider:SetOrientation('HORIZONTAL')
slider:SetHeight(6)
if not is_blizzard() then
slider:SetHeight(6)
end
slider:SetHitRectInsets(0, 0, -12, -12)
slider:SetValue(0)
set_panel_style(slider)
local thumb_texture = slider:CreateTexture(nil, 'ARTWORK')
thumb_texture:SetPoint('CENTER', 0, 0)
thumb_texture:SetTexture(aux.color.content.background())
thumb_texture:SetHeight(18)
thumb_texture:SetWidth(8)
set_size(thumb_texture, 8, 18)
slider:SetThumbTexture(thumb_texture)
if not is_blizzard() then
set_panel_style(slider)
local thumb_texture = slider:CreateTexture(nil, 'ARTWORK')
thumb_texture:SetPoint('CENTER', 0, 0)
thumb_texture:SetTexture(aux.color.content.background())
thumb_texture:SetHeight(18)
thumb_texture:SetWidth(8)
set_size(thumb_texture, 8, 18)
slider:SetThumbTexture(thumb_texture)
else
slider.low = _G[slider:GetName() .. 'Low']
slider.low:SetText("")
slider.high = _G[slider:GetName() .. 'High']
slider.high:SetText("")
end
local label = slider:CreateFontString(nil, 'OVERLAY')
label:SetPoint('BOTTOMLEFT', slider, 'TOPLEFT', -3, 8)
@@ -530,15 +717,18 @@ end
function M.checkbox(parent)
local checkbox = CreateFrame('CheckButton', nil, parent, 'UICheckButtonTemplate')
checkbox:SetWidth(16)
checkbox:SetHeight(16)
set_content_style(checkbox)
checkbox:SetNormalTexture(nil)
checkbox:SetPushedTexture(nil)
checkbox:GetHighlightTexture():SetAllPoints()
checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2)
checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88)
checkbox:GetHighlightTexture('BLEND')
local size = is_blizzard() and 24 or 16
checkbox:SetWidth(size)
checkbox:SetHeight(size)
if not is_blizzard() then
set_content_style(checkbox)
checkbox:SetNormalTexture(nil)
checkbox:SetPushedTexture(nil)
checkbox:GetHighlightTexture():SetAllPoints()
checkbox:GetHighlightTexture():SetTexture(1, 1, 1, .2)
checkbox:GetCheckedTexture():SetTexCoord(.12, .88, .12, .88)
checkbox:GetHighlightTexture('BLEND')
end
return checkbox
end
+12 -14
View File
@@ -10,7 +10,7 @@ local ROW_HEIGHT = 39
function M:render()
if getn(self.item_records or T.empty) > getn(self.rows) then
self.content_frame:SetPoint('BOTTOMRIGHT', -15, 0)
self.content_frame:SetPoint('BOTTOMRIGHT', gui.is_blizzard() and -30 or -15, 0)
else
self.content_frame:SetPoint('BOTTOMRIGHT', 0, 0)
end
@@ -57,18 +57,11 @@ function M.new(parent, on_click, selected)
scroll_frame:SetPoint('TOPLEFT', content_frame, 'TOPLEFT', 0, 29)
scroll_frame:SetPoint('BOTTOMRIGHT', content_frame, 'BOTTOMRIGHT', 0, 0)
local scroll_bar = _G[scroll_frame:GetName() .. 'ScrollBar']
scroll_bar:ClearAllPoints()
scroll_bar:SetPoint('TOPRIGHT', parent, -4, 2)
scroll_bar:SetPoint('BOTTOMRIGHT', parent, -4, 4)
scroll_bar:SetWidth(10)
local thumbTex = scroll_bar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
thumbTex:SetTexture(aux.color.content.background())
thumbTex:SetHeight(150)
thumbTex:SetWidth(scroll_bar:GetWidth())
_G[scroll_bar:GetName() .. 'ScrollUpButton']:Hide()
_G[scroll_bar:GetName() .. 'ScrollDownButton']:Hide()
gui.set_scrollbar_style(scroll_frame, not gui.is_blizzard() and {
{'TOPRIGHT', parent, -4, 2}, {'BOTTOMRIGHT', parent, -4, 4} -- Default
} or {
{'TOPRIGHT', parent, -7, -14}, {'BOTTOMRIGHT', parent, -7, 18} -- Blizzard
})
local rows = T.acquire()
local row_index = 1
@@ -104,7 +97,12 @@ function M.new(parent, on_click, selected)
local highlight = row:CreateTexture()
highlight:SetAllPoints(row)
highlight:Hide()
highlight:SetTexture(1, .9, 0, .4)
if not gui.is_blizzard() then
highlight:SetTexture(1, .9, 0, .4)
else
highlight:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
highlight:SetTexCoord(0.1, 0.8, 0, 1)
end
row.highlight = highlight
rows[row_index] = row
+19 -17
View File
@@ -64,7 +64,7 @@ local methods = {
end
if getn(self.rowData or T.empty) > self.numRows then
self.contentFrame:SetPoint('BOTTOMRIGHT', -15, 0)
self.contentFrame:SetPoint('BOTTOMRIGHT', gui.is_blizzard() and -30 or -15, 0)
else
self.contentFrame:SetPoint('BOTTOMRIGHT', 0, 0)
end
@@ -178,9 +178,14 @@ local methods = {
local tex = col:CreateTexture()
tex:SetAllPoints()
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
if not gui.is_blizzard() then
tex:SetTexture([[Interface\AddOns\aux-AddOn\WorldStateFinalScore-Highlight]])
tex:SetTexCoord(.017, 1, .083, .909)
tex:SetAlpha(.5)
else
tex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
tex:SetTexCoord(0.1, 0.8, 0, 1)
end
tinsert(self.headCols, col)
@@ -229,7 +234,11 @@ local methods = {
end
local highlight = row:CreateTexture()
highlight:SetAllPoints()
highlight:SetTexture(1, .9, 0, .4)
if not gui.is_blizzard() then
highlight:SetTexture(1, .9, 0, .4)
else
highlight:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
end
highlight:Hide()
row.highlight = highlight
row.st = self
@@ -274,18 +283,11 @@ function M.new(parent)
scrollFrame:SetAllPoints(contentFrame)
st.scrollFrame = scrollFrame
local scroll_bar = _G[scrollFrame:GetName() .. 'ScrollBar']
scroll_bar:ClearAllPoints()
scroll_bar:SetPoint('TOPRIGHT', st, -4, -HEAD_HEIGHT)
scroll_bar:SetPoint('BOTTOMRIGHT', st, -4, 4)
scroll_bar:SetWidth(10)
local thumbTex = scroll_bar:GetThumbTexture()
thumbTex:SetPoint('CENTER', 0, 0)
thumbTex:SetTexture(aux.color.content.background())
thumbTex:SetHeight(150)
thumbTex:SetWidth(scroll_bar:GetWidth())
_G[scroll_bar:GetName() .. 'ScrollUpButton']:Hide()
_G[scroll_bar:GetName() .. 'ScrollDownButton']:Hide()
gui.set_scrollbar_style(scrollFrame, not gui.is_blizzard() and {
{'TOPRIGHT', parent, -4, -HEAD_HEIGHT}, {'BOTTOMRIGHT', parent, -4, 4} -- Default
} or {
{'TOPRIGHT', parent, -7, -20}, {'BOTTOMRIGHT', parent, -7, 18} -- Blizzard
})
for name, func in methods do
st[name] = func
+52 -50
View File
@@ -6,57 +6,59 @@ local gui = require 'aux.gui'
local auction_listing = require 'aux.gui.auction_listing'
local search_tab = require 'aux.tabs.search'
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
function aux.handle.INIT_UI()
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
listing = auction_listing.new(frame.listing, 20, auction_listing.auctions_columns)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnClick', function(row, button)
if IsAltKeyDown() then
if listing:GetSelection().record == row.record then
if IsAltKeyDown() and listing:GetSelection().record == row.record then
cancel_button:Click()
end
end
elseif button == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end)
listing:SetHandler('OnSelectionChanged', function(rt, datum)
if not datum then return end
find_auction(datum.record)
end)
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 1)
status_bar:set_text('')
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Cancel')
btn:Disable()
cancel_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', cancel_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', function()
scan_auctions()
listing = auction_listing.new(frame.listing, 20, auction_listing.auctions_columns)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnClick', function(row, button)
if IsAltKeyDown() then
if listing:GetSelection().record == row.record then
if IsAltKeyDown() and listing:GetSelection().record == row.record then
cancel_button:Click()
end
end
elseif button == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end)
listing:SetHandler('OnSelectionChanged', function(rt, datum)
if not datum then return end
find_auction(datum.record)
end)
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 1)
status_bar:set_text('')
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Cancel')
btn:Disable()
cancel_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', cancel_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', function()
scan_auctions()
end)
end
end
+61 -59
View File
@@ -6,66 +6,68 @@ local gui = require 'aux.gui'
local auction_listing = require 'aux.gui.auction_listing'
local search_tab = require 'aux.tabs.search'
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
function aux.handle.INIT_UI()
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
frame.listing = gui.panel(frame)
frame.listing:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.listing:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.listing:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnClick', function(row, button)
if IsAltKeyDown() then
if listing:GetSelection().record == row.record then
if button == 'LeftButton' then
buyout_button:Click()
elseif button == 'RightButton' then
bid_button:Click()
end
end
elseif button == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end)
listing:SetHandler('OnSelectionChanged', function(rt, datum)
if not datum then return end
find_auction(datum.record)
end)
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 0)
status_bar:set_text('')
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Bid')
btn:Disable()
bid_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
btn:SetText('Buyout')
btn:Disable()
buyout_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', function()
scan_bids()
listing = auction_listing.new(frame.listing, 20, auction_listing.bids_columns)
listing:SetSort(1, 2, 3, 4, 5, 6, 7, 8)
listing:Reset()
listing:SetHandler('OnClick', function(row, button)
if IsAltKeyDown() then
if listing:GetSelection().record == row.record then
if button == 'LeftButton' then
buyout_button:Click()
elseif button == 'RightButton' then
bid_button:Click()
end
end
elseif button == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end)
listing:SetHandler('OnSelectionChanged', function(rt, datum)
if not datum then return end
find_auction(datum.record)
end)
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 0)
status_bar:set_text('')
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Bid')
btn:Disable()
bid_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', bid_button, 'TOPRIGHT', 5, 0)
btn:SetText('Buyout')
btn:Disable()
buyout_button = btn
end
do
local btn = gui.button(frame)
btn:SetPoint('TOPLEFT', buyout_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', function()
scan_bids()
end)
end
end
+307 -297
View File
@@ -8,324 +8,334 @@ local listing = require 'aux.gui.listing'
local item_listing = require 'aux.gui.item_listing'
local search_tab = require 'aux.tabs.search'
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
function aux.handle.INIT_UI()
local THEME_PADDING = gui.is_blizzard() and 6.5 or 2.5
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.content:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.content:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
frame = CreateFrame('Frame', nil, aux.frame)
frame:SetAllPoints()
frame:SetScript('OnUpdate', on_update)
frame:Hide()
frame.inventory = gui.panel(frame.content)
frame.inventory:SetWidth(212)
frame.inventory:SetPoint('TOPLEFT', 0, 0)
frame.inventory:SetPoint('BOTTOMLEFT', 0, 0)
frame.content = CreateFrame('Frame', nil, frame)
frame.content:SetPoint('TOP', frame, 'TOP', 0, -8)
frame.content:SetPoint('BOTTOMLEFT', aux.frame.content, 'BOTTOMLEFT', 0, 0)
frame.content:SetPoint('BOTTOMRIGHT', aux.frame.content, 'BOTTOMRIGHT', 0, 0)
frame.parameters = gui.panel(frame.content)
frame.parameters:SetHeight(173)
frame.parameters:SetPoint('TOPLEFT', frame.inventory, 'TOPRIGHT', 2.5, 0)
frame.parameters:SetPoint('TOPRIGHT', 0, 0)
frame.inventory = gui.panel(frame.content)
frame.inventory:SetWidth(212)
frame.inventory:SetPoint('TOPLEFT', 0, 0)
frame.inventory:SetPoint('BOTTOMLEFT', 0, 0)
frame.bid_listing = gui.panel(frame.content)
frame.bid_listing:SetHeight(228)
frame.bid_listing:SetWidth(271.5)
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', 2.5, 0)
frame.parameters = gui.panel(frame.content)
frame.parameters:SetHeight(173)
frame.parameters:SetPoint('TOPLEFT', frame.inventory, 'TOPRIGHT', THEME_PADDING, 0)
frame.parameters:SetPoint('TOPRIGHT', 0, 0)
frame.buyout_listing = gui.panel(frame.content)
frame.buyout_listing:SetHeight(228)
frame.buyout_listing:SetWidth(271.5)
frame.buyout_listing:SetPoint('BOTTOMRIGHT', 0, 0)
frame.bid_listing = gui.panel(frame.content)
frame.bid_listing:SetHeight(228)
frame.bid_listing:SetWidth(271.5)
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
do
local checkbox = gui.checkbox(frame.inventory)
checkbox:SetPoint('TOPLEFT', 49, -15)
checkbox:SetScript('OnClick', function()
frame.buyout_listing = gui.panel(frame.content)
frame.buyout_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
frame.buyout_listing:SetPoint('BOTTOMRIGHT', 0, 0)
do
local checkbox = gui.checkbox(frame.inventory)
checkbox:SetPoint('TOPLEFT', 49, -15)
checkbox:SetScript('OnClick', function()
refresh = true
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Show hidden items')
show_hidden_checkbox = checkbox
end
gui.horizontal_line(frame.inventory, -45)
do
local f = CreateFrame('Frame', nil, frame.inventory)
f:SetPoint('TOPLEFT', 0, -51)
f:SetPoint('BOTTOMRIGHT', 0, 0)
inventory_listing = item_listing.new(
f,
function()
if arg1 == 'LeftButton' then
update_item(this.item_record)
elseif arg1 == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.item_record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end,
function(item_record)
return item_record == selected_item
end
)
end
bid_listing = listing.new(frame.bid_listing)
bid_listing:SetColInfo{
{name='Auctions', width=.17, align='CENTER'},
{name='Time\nLeft', width=.11, align='CENTER'},
{name='Stack\nSize', width=.11, align='CENTER'},
{name='Auction Bid\n(per item)', width=.4, align='RIGHT'},
{name='% Hist.\nValue', width=.21, align='CENTER'},
}
bid_listing:SetSelection(function(data)
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 button == 'RightButton' and 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
set_bid_selection(row_data.record)
end
refresh = true
end)
bid_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
stack_size_slider:SetValue(row_data.record.stack_size)
refresh = true
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Show hidden items')
show_hidden_checkbox = checkbox
end
gui.horizontal_line(frame.inventory, -45)
do
local f = CreateFrame('Frame', nil, frame.inventory)
f:SetPoint('TOPLEFT', 0, -51)
f:SetPoint('BOTTOMRIGHT', 0, 0)
inventory_listing = item_listing.new(
f,
function()
if arg1 == 'LeftButton' then
update_item(this.item_record)
elseif arg1 == 'RightButton' then
aux.set_tab(1)
search_tab.set_filter(strlower(info.item(this.item_record.item_id).name) .. '/exact')
search_tab.execute(nil, false)
end
end,
function(item_record)
return item_record == selected_item
end
)
end
bid_listing = listing.new(frame.bid_listing)
bid_listing:SetColInfo{
{name='Auctions', width=.17, align='CENTER'},
{name='Time\nLeft', width=.11, align='CENTER'},
{name='Stack\nSize', width=.11, align='CENTER'},
{name='Auction Bid\n(per item)', width=.4, align='RIGHT'},
{name='% Hist.\nValue', width=.21, align='CENTER'},
}
bid_listing:SetSelection(function(data)
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 button == 'RightButton' and 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
set_bid_selection(row_data.record)
end
refresh = true
end)
bid_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
stack_size_slider:SetValue(row_data.record.stack_size)
refresh = true
end)
buyout_listing = listing.new(frame.buyout_listing)
buyout_listing:SetColInfo{
{name='Auctions', width=.17, align='CENTER'},
{name='Time\nLeft', width=.11, align='CENTER'},
{name='Stack\nSize', width=.12, align='CENTER'},
{name='Auction Buyout\n(per item)', width=.4, align='RIGHT'},
{name='% Hist.\nValue', width=.20, align='CENTER'},
}
buyout_listing:SetSelection(function(data)
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 button == 'RightButton' and 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
set_buyout_selection(row_data.record)
end
refresh = true
end)
buyout_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
stack_size_slider:SetValue(row_data.record.stack_size)
refresh = true
end)
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 1)
status_bar:set_text('')
end
do
local btn = gui.button(frame.parameters)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Post')
btn:SetScript('OnClick', post_auctions)
post_button = btn
end
do
local btn = gui.button(frame.parameters)
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', refresh_button_click)
refresh_button = btn
end
do
item = gui.item(frame.parameters)
item:SetPoint('TOPLEFT', 10, -6)
item.button:SetScript('OnEnter', function()
if selected_item then
info.set_tooltip(selected_item.itemstring, this, 'ANCHOR_RIGHT')
buyout_listing = listing.new(frame.buyout_listing)
buyout_listing:SetColInfo{
{name='Auctions', width=.17, align='CENTER'},
{name='Time\nLeft', width=.11, align='CENTER'},
{name='Stack\nSize', width=.12, align='CENTER'},
{name='Auction Buyout\n(per item)', width=.4, align='RIGHT'},
{name='% Hist.\nValue', width=.20, align='CENTER'},
}
buyout_listing:SetSelection(function(data)
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 button == 'RightButton' and 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
set_buyout_selection(row_data.record)
end
refresh = true
end)
item.button:SetScript('OnLeave', function()
GameTooltip:Hide()
buyout_listing:SetHandler('OnDoubleClick', function(table, row_data, column, button)
stack_size_slider:SetValue(row_data.record.stack_size)
refresh = true
end)
end
do
local slider = gui.slider(frame.parameters)
slider:SetValueStep(1)
slider:SetPoint('TOPLEFT', 13, -73)
slider:SetWidth(190)
slider:SetScript('OnValueChanged', function()
quantity_update(true)
end)
slider.editbox.change = function()
slider:SetValue(this:GetNumber())
quantity_update(true)
if selected_item then
do
status_bar = gui.status_bar(frame)
status_bar:SetWidth(265)
status_bar:SetHeight(25)
status_bar:SetPoint('TOPLEFT', aux.frame.content, 'BOTTOMLEFT', 0, -6)
status_bar:update_status(1, 1)
status_bar:set_text('')
end
do
local btn = gui.button(frame.parameters)
btn:SetPoint('TOPLEFT', status_bar, 'TOPRIGHT', 5, 0)
btn:SetText('Post')
btn:SetScript('OnClick', post_auctions)
post_button = btn
end
do
local btn = gui.button(frame.parameters)
btn:SetPoint('TOPLEFT', post_button, 'TOPRIGHT', 5, 0)
btn:SetText('Refresh')
btn:SetScript('OnClick', refresh_button_click)
refresh_button = btn
end
do
item = gui.item(frame.parameters)
item:SetPoint('TOPLEFT', 10, -6)
item.button:SetScript('OnEnter', function()
if selected_item then
info.set_tooltip(selected_item.itemstring, this, 'ANCHOR_RIGHT')
end
end)
item.button:SetScript('OnLeave', function()
GameTooltip:Hide()
end)
end
do
local slider = gui.slider(frame.parameters)
slider:SetValueStep(1)
slider:SetPoint('TOPLEFT', 13, -73)
slider:SetWidth(190)
slider:SetScript('OnValueChanged', function()
quantity_update(true)
end)
slider.editbox.change = function()
slider:SetValue(this:GetNumber())
quantity_update(true)
if selected_item then
local settings = read_settings()
write_settings(settings)
end
end
slider.editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
unit_buyout_price_input:SetFocus()
elseif stack_count_slider.editbox:IsVisible() then
stack_count_slider.editbox:SetFocus()
else
unit_start_price_input:SetFocus()
end
end)
slider.editbox:SetNumeric(true)
slider.editbox:SetMaxLetters(3)
slider.label:SetText('Stack Size')
stack_size_slider = slider
end
do
local slider = gui.slider(frame.parameters)
slider:SetValueStep(1)
slider:SetPoint('TOPLEFT', stack_size_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -25 or -32)
slider:SetWidth(190)
slider:SetScript('OnValueChanged', function()
quantity_update()
end)
slider.editbox.change = function()
slider:SetValue(this:GetNumber())
quantity_update()
end
slider.editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
stack_size_slider.editbox:SetFocus()
else
unit_start_price_input:SetFocus()
end
end)
slider.editbox:SetNumeric(true)
slider.label:SetText('Stack Count')
stack_count_slider = slider
end
do
local dropdown = gui.dropdown(frame.parameters)
dropdown:SetPoint('TOPLEFT', stack_count_slider, 'BOTTOMLEFT', 0, gui.is_blizzard() and -10 or -22)
dropdown:SetWidth(90)
local label = gui.label(dropdown, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Duration')
UIDropDownMenu_Initialize(dropdown, initialize_duration_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, initialize_duration_dropdown)
end)
duration_dropdown = dropdown
end
do
local checkbox = gui.checkbox(frame.parameters)
checkbox:SetPoint('TOPRIGHT', -83, -6)
checkbox:SetScript('OnClick', function()
local settings = read_settings()
settings.hidden = this:GetChecked()
write_settings(settings)
end
end
slider.editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
unit_buyout_price_input:SetFocus()
elseif stack_count_slider.editbox:IsVisible() then
stack_count_slider.editbox:SetFocus()
else
unit_start_price_input:SetFocus()
end
end)
slider.editbox:SetNumeric(true)
slider.editbox:SetMaxLetters(3)
slider.label:SetText('Stack Size')
stack_size_slider = slider
end
do
local slider = gui.slider(frame.parameters)
slider:SetValueStep(1)
slider:SetPoint('TOPLEFT', stack_size_slider, 'BOTTOMLEFT', 0, -32)
slider:SetWidth(190)
slider:SetScript('OnValueChanged', function()
quantity_update()
end)
slider.editbox.change = function()
slider:SetValue(this:GetNumber())
quantity_update()
end
slider.editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
stack_size_slider.editbox:SetFocus()
else
unit_start_price_input:SetFocus()
end
end)
slider.editbox:SetNumeric(true)
slider.label:SetText('Stack Count')
stack_count_slider = slider
end
do
local dropdown = gui.dropdown(frame.parameters)
dropdown:SetPoint('TOPLEFT', stack_count_slider, 'BOTTOMLEFT', 0, -22)
dropdown:SetWidth(90)
local label = gui.label(dropdown, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', dropdown, 'TOPLEFT', -2, -3)
label:SetText('Duration')
UIDropDownMenu_Initialize(dropdown, initialize_duration_dropdown)
dropdown:SetScript('OnShow', function()
UIDropDownMenu_Initialize(this, initialize_duration_dropdown)
end)
duration_dropdown = dropdown
end
do
local checkbox = gui.checkbox(frame.parameters)
checkbox:SetPoint('TOPRIGHT', -83, -6)
checkbox:SetScript('OnClick', function()
local settings = read_settings()
settings.hidden = this:GetChecked()
write_settings(settings)
refresh = true
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Hide this item')
hide_checkbox = checkbox
end
do
local editbox = gui.editbox(frame.parameters)
editbox:SetPoint('TOPRIGHT', -71, -60)
editbox:SetWidth(180)
editbox:SetHeight(22)
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
stack_count_slider.editbox:SetFocus()
else
unit_buyout_price_input:SetFocus()
end
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(get_unit_start_price(), true, nil, nil, true))
refresh = true
end)
local label = gui.label(checkbox, gui.font_size.small)
label:SetPoint('LEFT', checkbox, 'RIGHT', 4, 1)
label:SetText('Hide this item')
hide_checkbox = checkbox
end
do
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Unit Starting Price')
end
do
local label = gui.label(editbox, 14)
label:SetPoint('LEFT', editbox, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
start_price_percentage = label
end
unit_start_price_input = editbox
end
do
local editbox = gui.editbox(frame.parameters)
editbox:SetPoint('TOPRIGHT', unit_start_price_input, 'BOTTOMRIGHT', 0, -19)
editbox:SetWidth(180)
editbox:SetHeight(22)
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
unit_start_price_input:SetFocus()
else
stack_size_slider.editbox:SetFocus()
local editbox = gui.editbox(frame.parameters)
editbox:SetPoint('TOPRIGHT', -71, -60)
editbox:SetWidth(180)
editbox:SetHeight(22)
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
stack_count_slider.editbox:SetFocus()
else
unit_buyout_price_input:SetFocus()
end
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(get_unit_start_price(), true, nil, nil, true))
end
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(get_unit_buyout_price(), true, nil, nil, true))
do
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Unit Starting Price')
end
do
local label = gui.label(editbox, 14)
label:SetPoint('LEFT', editbox, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
start_price_percentage = label
end
unit_start_price_input = editbox
end
do
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Unit Buyout Price')
local editbox = gui.editbox(frame.parameters)
editbox:SetPoint('TOPRIGHT', unit_start_price_input, 'BOTTOMRIGHT', 0, -19)
editbox:SetWidth(180)
editbox:SetHeight(22)
editbox:SetAlignment('RIGHT')
editbox:SetFontSize(17)
editbox:SetScript('OnTabPressed', function()
if IsShiftKeyDown() then
unit_start_price_input:SetFocus()
else
stack_size_slider.editbox:SetFocus()
end
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(get_unit_buyout_price(), true, nil, nil, true))
end
do
local label = gui.label(editbox, gui.font_size.small)
label:SetPoint('BOTTOMLEFT', editbox, 'TOPLEFT', -2, 1)
label:SetText('Unit Buyout Price')
end
do
local label = gui.label(editbox, 14)
label:SetPoint('LEFT', editbox, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
buyout_price_percentage = label
end
unit_buyout_price_input = editbox
end
do
local label = gui.label(editbox, 14)
label:SetPoint('LEFT', editbox, 'RIGHT', 8, 0)
label:SetWidth(50)
label:SetJustifyH('CENTER')
buyout_price_percentage = label
local label = gui.label(frame.parameters, gui.font_size.medium)
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', -180, -24)
deposit = label
end
do
local label = gui.label(frame.parameters, gui.font_size.medium)
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', 0, -24)
vendor_price_label = label
end
unit_buyout_price_input = editbox
end
do
local label = gui.label(frame.parameters, gui.font_size.medium)
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', -180, -24)
deposit = label
end
do
local label = gui.label(frame.parameters, gui.font_size.medium)
label:SetPoint('TOPLEFT', unit_buyout_price_input, 'BOTTOMLEFT', 0, -24)
vendor_price_label = label
end
function aux.handle.LOAD()
if not aux.account_data.post_bid then
frame.bid_listing:Hide()
frame.buyout_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', 2.5, 0)
buyout_listing:SetColInfo{
{name='Auctions', width=.15, align='CENTER'},
{name='Time Left', width=.15, align='CENTER'},
{name='Stack Size', width=.15, align='CENTER'},
{name='Auction Buyout (per item)', width=.4, align='RIGHT'},
{name='% Hist. Value', width=.15, align='CENTER'},
}
end
function aux.handle.LOAD()
if aux.account_data.post_bid then
frame.bid_listing:SetPoint('TOPLEFT', frame.parameters, 'BOTTOMLEFT', 0, -THEME_PADDING)
frame.bid_listing:SetPoint('BOTTOMLEFT', frame.inventory, 'BOTTOMRIGHT', THEME_PADDING, 0)
frame.bid_listing:SetWidth(271.5 - (THEME_PADDING / 2))
frame.buyout_listing:ClearAllPoints()
frame.buyout_listing:SetPoint('TOPLEFT', frame.bid_listing, 'TOPRIGHT', THEME_PADDING, 0)
frame.buyout_listing:SetPoint('BOTTOMRIGHT', 0, 0)
else
frame.bid_listing:Hide()
buyout_listing:SetColInfo{
{name='Auctions', width=.15, align='CENTER'},
{name='Time Left', width=.15, align='CENTER'},
{name='Stack Size', width=.15, align='CENTER'},
{name='Auction Buyout (per item)', width=.4, align='RIGHT'},
{name='% Hist. Value', width=.15, align='CENTER'},
}
end
end
end
+545 -531
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -6,6 +6,7 @@ local info = require 'aux.util.info'
local filter_util = require 'aux.util.filter'
local scan_util = require 'aux.util.scan'
local scan = require 'aux.core.scan'
local gui = require 'aux.gui'
search_scan_id = 0
@@ -17,11 +18,11 @@ function update_real_time(enable)
if enable then
range_button:Hide()
real_time_button:Show()
search_box:SetPoint('LEFT', real_time_button, 'RIGHT', 4, 0)
search_box:SetPoint('LEFT', real_time_button, 'RIGHT', gui.is_blizzard() and 8 or 4, 0)
else
real_time_button:Hide()
range_button:Show()
search_box:SetPoint('LEFT', last_page_input, 'RIGHT', 4, 0)
search_box:SetPoint('LEFT', last_page_input, 'RIGHT', gui.is_blizzard() and 8 or 4, 0)
end
end