perfected the buying mechanism
This commit is contained in:
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
## Interface: 11200
|
## Interface: 11200
|
||||||
## Title: Aux
|
## Title: Aux
|
||||||
## Notes: A lightweight addon designed to help manage auctions
|
## Notes: A lightweight addon designed to help manage auctions
|
||||||
## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, AUX_AUCTION_DURATION
|
## SavedVariablesPerCharacter: aux_recent_searches, aux_favorite_searches, aux_auction_duration, aux_scale
|
||||||
## SavedVariables: aux_database, aux_auctionable_items
|
## SavedVariables: aux_database, aux_auctionable_items
|
||||||
|
|
||||||
slash.lua
|
slash.lua
|
||||||
@@ -11,7 +11,6 @@ control.xml
|
|||||||
persistence.lua
|
persistence.lua
|
||||||
util.lua
|
util.lua
|
||||||
money.lua
|
money.lua
|
||||||
groups.lua
|
|
||||||
|
|
||||||
scan.lua
|
scan.lua
|
||||||
scan_util.lua
|
scan_util.lua
|
||||||
@@ -25,12 +24,13 @@ history.lua
|
|||||||
info.xml
|
info.xml
|
||||||
completion.xml
|
completion.xml
|
||||||
|
|
||||||
item_search_frame.xml
|
search_frame.xml
|
||||||
filter_search_frame.xml
|
|
||||||
post_frame.xml
|
post_frame.xml
|
||||||
auctions_frame.xml
|
auctions_frame.xml
|
||||||
bids_frame.xml
|
bids_frame.xml
|
||||||
scan_frame.xml
|
|
||||||
|
|
||||||
static.xml
|
static.xml
|
||||||
|
|
||||||
|
test.lua
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+77
-67
@@ -119,7 +119,19 @@ local methods = {
|
|||||||
OnCellClick = function()
|
OnCellClick = function()
|
||||||
local button = arg1
|
local button = arg1
|
||||||
if this.rt.disabled then return end
|
if this.rt.disabled then return end
|
||||||
this.rt:SetSelectedRecord(this.row.data.record)
|
if IsControlKeyDown() then
|
||||||
|
DressUpItemLink(this.row.data.record.hyperlink)
|
||||||
|
elseif IsShiftKeyDown() then
|
||||||
|
if ChatFrameEditBox:IsVisible() then
|
||||||
|
ChatFrameEditBox:Insert(this.row.data.record.hyperlink)
|
||||||
|
end
|
||||||
|
elseif IsAltKeyDown() then
|
||||||
|
if this.rt.handlers.OnCellAltClick then
|
||||||
|
this.rt.handlers.OnCellAltClick(this, button)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
this.rt:SetSelectedRecord(this.row.data.record)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
OnCellDoubleClick = function()
|
OnCellDoubleClick = function()
|
||||||
@@ -152,10 +164,10 @@ local methods = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
||||||
GetRecordPercent = function(rt, record)
|
GetRecordPercent = function(self, record)
|
||||||
if not record then return end
|
if not record then return end
|
||||||
-- cache the market value on the record
|
-- cache the market value on the record
|
||||||
-- record.market_value = record.market_value or rt.GetMarketValue(record.item_key) or 0
|
-- record.market_value = record.market_value or self.GetMarketValue(record.item_key) or 0
|
||||||
-- if record.marketValue > 0 then
|
-- if record.marketValue > 0 then
|
||||||
-- if record.itemBuyout > 0 then
|
-- if record.itemBuyout > 0 then
|
||||||
-- return Aux.round(100 * record.itemBuyout / record.marketValue, 1)
|
-- return Aux.round(100 * record.itemBuyout / record.marketValue, 1)
|
||||||
@@ -172,15 +184,15 @@ local methods = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
UpdateRowInfo = function(rt)
|
UpdateRowInfo = function(self)
|
||||||
Aux.util.wipe(rt.rowInfo)
|
Aux.util.wipe(self.rowInfo)
|
||||||
rt.rowInfo.numDisplayRows = 0
|
self.rowInfo.numDisplayRows = 0
|
||||||
rt.sortInfo.isSorted = nil
|
self.sortInfo.isSorted = nil
|
||||||
rt:SetSelectedRecord(nil, true)
|
self:SetSelectedRecord(nil, true)
|
||||||
|
|
||||||
sort(rt.records, function(a,b) return a.search_signature < b.search_signature end)
|
sort(self.records, function(a,b) return a.search_signature < b.search_signature end)
|
||||||
|
|
||||||
local records = rt.records
|
local records = self.records
|
||||||
if getn(records) == 0 then return end
|
if getn(records) == 0 then return end
|
||||||
|
|
||||||
-- Populate the row info from the database by combining identical auctions and auctions
|
-- Populate the row info from the database by combining identical auctions and auctions
|
||||||
@@ -190,21 +202,21 @@ local methods = {
|
|||||||
local prevRecord = records[i-1]
|
local prevRecord = records[i-1]
|
||||||
if prevRecord and record.search_signature == prevRecord.search_signature then
|
if prevRecord and record.search_signature == prevRecord.search_signature then
|
||||||
-- it's an identical auction to the previous row so increment the number of auctions
|
-- it's an identical auction to the previous row so increment the number of auctions
|
||||||
rt.rowInfo[getn(rt.rowInfo)].children[getn(rt.rowInfo[getn(rt.rowInfo)].children)].numAuctions = rt.rowInfo[getn(rt.rowInfo)].children[getn(rt.rowInfo[getn(rt.rowInfo)].children)].numAuctions + 1
|
self.rowInfo[getn(self.rowInfo)].children[getn(self.rowInfo[getn(self.rowInfo)].children)].numAuctions = self.rowInfo[getn(self.rowInfo)].children[getn(self.rowInfo[getn(self.rowInfo)].children)].numAuctions + 1
|
||||||
elseif prevRecord and record.item_key == prevRecord.item_key then
|
elseif prevRecord and record.item_key == prevRecord.item_key then
|
||||||
-- it's the same base item as the previous row so insert a new auction
|
-- it's the same base item as the previous row so insert a new auction
|
||||||
tinsert(rt.rowInfo[getn(rt.rowInfo)].children, {numAuctions=1, record=record})
|
tinsert(self.rowInfo[getn(self.rowInfo)].children, {numAuctions=1, record=record})
|
||||||
if rt.expanded[rt.rowInfo[getn(rt.rowInfo)].expandKey] then
|
if self.expanded[self.rowInfo[getn(self.rowInfo)].expandKey] then
|
||||||
rt.rowInfo.numDisplayRows = rt.rowInfo.numDisplayRows + 1
|
self.rowInfo.numDisplayRows = self.rowInfo.numDisplayRows + 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- it's a different base item from the previous row
|
-- it's a different base item from the previous row
|
||||||
tinsert(rt.rowInfo, {item_key=record.item_key, expandKey=record.item_key, children={{numAuctions=1, record=record}}})
|
tinsert(self.rowInfo, {item_key=record.item_key, expandKey=record.item_key, children={{numAuctions=1, record=record}}})
|
||||||
rt.rowInfo.numDisplayRows = rt.rowInfo.numDisplayRows + 1
|
self.rowInfo.numDisplayRows = self.rowInfo.numDisplayRows + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, info in ipairs(rt.rowInfo) do
|
for _, info in ipairs(self.rowInfo) do
|
||||||
local totalAuctions, totalPlayerAuctions = 0, 0
|
local totalAuctions, totalPlayerAuctions = 0, 0
|
||||||
for _, childInfo in ipairs(info.children) do
|
for _, childInfo in ipairs(info.children) do
|
||||||
totalAuctions = totalAuctions + childInfo.numAuctions
|
totalAuctions = totalAuctions + childInfo.numAuctions
|
||||||
@@ -217,36 +229,36 @@ local methods = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
UpdateRows = function(rt)
|
UpdateRows = function(self)
|
||||||
-- hide all the rows
|
-- hide all the rows
|
||||||
for _, row in ipairs(rt.rows) do row:Hide() end
|
for _, row in ipairs(self.rows) do row:Hide() end
|
||||||
|
|
||||||
-- update sorting highlights
|
-- update sorting highlights
|
||||||
for _, cell in ipairs(rt.headCells) do
|
for _, cell in ipairs(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(0.017, 1, 0.083, 0.909)
|
tex:SetTexCoord(0.017, 1, 0.083, 0.909)
|
||||||
tex:SetAlpha(0.5)
|
tex:SetAlpha(0.5)
|
||||||
end
|
end
|
||||||
if rt.sortInfo.descending then
|
if self.sortInfo.descending then
|
||||||
rt.headCells[rt.sortInfo.columnIndex]:GetNormalTexture():SetTexture(0.8, 0.6, 1, 0.8)
|
self.headCells[self.sortInfo.columnIndex]:GetNormalTexture():SetTexture(0.8, 0.6, 1, 0.8)
|
||||||
else
|
else
|
||||||
rt.headCells[rt.sortInfo.columnIndex]:GetNormalTexture():SetTexture(0.6, 0.8, 1, 0.8)
|
self.headCells[self.sortInfo.columnIndex]:GetNormalTexture():SetTexture(0.6, 0.8, 1, 0.8)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update the scroll frame
|
-- update the scroll frame
|
||||||
FauxScrollFrame_Update(rt.scrollFrame, rt.rowInfo.numDisplayRows, getn(rt.rows), rt.ROW_HEIGHT)
|
FauxScrollFrame_Update(self.scrollFrame, self.rowInfo.numDisplayRows, getn(self.rows), self.ROW_HEIGHT)
|
||||||
|
|
||||||
-- make sure the offset is not too high
|
-- make sure the offset is not too high
|
||||||
local maxOffset = max(rt.rowInfo.numDisplayRows - getn(rt.rows), 0)
|
local maxOffset = max(self.rowInfo.numDisplayRows - getn(self.rows), 0)
|
||||||
if FauxScrollFrame_GetOffset(rt.scrollFrame) > maxOffset then
|
if FauxScrollFrame_GetOffset(self.scrollFrame) > maxOffset then
|
||||||
FauxScrollFrame_SetOffset(rt.scrollFrame, maxOffset)
|
FauxScrollFrame_SetOffset(self.scrollFrame, maxOffset)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not rt.sortInfo.isSorted then
|
if not self.sortInfo.isSorted then
|
||||||
local function SortHelperFunc(a, b, sortKey)
|
local function SortHelperFunc(a, b, sortKey)
|
||||||
local hadSortKey = sortKey and true or false
|
local hadSortKey = sortKey and true or false
|
||||||
sortKey = sortKey or rt.sortInfo.sortKey
|
sortKey = sortKey or self.sortInfo.sortKey
|
||||||
local aVal, bVal
|
local aVal, bVal
|
||||||
if a.children then
|
if a.children then
|
||||||
aVal = a.children[1].record
|
aVal = a.children[1].record
|
||||||
@@ -261,17 +273,17 @@ local methods = {
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if sortKey == "percent" then
|
if sortKey == "percent" then
|
||||||
aVal = rt:GetRecordPercent(aVal)
|
aVal = self:GetRecordPercent(aVal)
|
||||||
bVal = rt:GetRecordPercent(bVal)
|
bVal = self:GetRecordPercent(bVal)
|
||||||
elseif sortKey == "numAuctions" then
|
elseif sortKey == "numAuctions" then
|
||||||
aVal = a.totalAuctions
|
aVal = a.totalAuctions
|
||||||
bVal = b.totalAuctions
|
bVal = b.totalAuctions
|
||||||
elseif sortKey == "itemDisplayedBid" or sortKey == "displayedBid" then
|
elseif sortKey == "itemDisplayedBid" or sortKey == "displayedBid" then
|
||||||
aVal = rt.GetRowPrices(aVal, sortKey == "itemDisplayedBid")
|
aVal = self.GetRowPrices(aVal, sortKey == "itemDisplayedBid")
|
||||||
bVal = rt.GetRowPrices(bVal, sortKey == "itemDisplayedBid")
|
bVal = self.GetRowPrices(bVal, sortKey == "itemDisplayedBid")
|
||||||
elseif sortKey == "itemBuyout" or sortKey == "buyout" then
|
elseif sortKey == "itemBuyout" or sortKey == "buyout" then
|
||||||
aVal = ({ rt.GetRowPrices(aVal, sortKey == "itemBuyout") })[2]
|
aVal = ({ self.GetRowPrices(aVal, sortKey == "itemBuyout") })[2]
|
||||||
bVal = ({ rt.GetRowPrices(bVal, sortKey == "itemBuyout") })[2]
|
bVal = ({ self.GetRowPrices(bVal, sortKey == "itemBuyout") })[2]
|
||||||
else
|
else
|
||||||
aVal = aVal[sortKey]
|
aVal = aVal[sortKey]
|
||||||
bVal = bVal[sortKey]
|
bVal = bVal[sortKey]
|
||||||
@@ -279,15 +291,15 @@ local methods = {
|
|||||||
if sortKey == 'buyout' or sortKey == 'itemBuyout' then
|
if sortKey == 'buyout' or sortKey == 'itemBuyout' then
|
||||||
-- for buyout, put bid-only auctions at the bottom
|
-- for buyout, put bid-only auctions at the bottom
|
||||||
if not aVal or aVal == 0 then
|
if not aVal or aVal == 0 then
|
||||||
aVal = (rt.sortInfo.descending and -1 or 1) * Aux.huge
|
aVal = (self.sortInfo.descending and -1 or 1) * Aux.huge
|
||||||
end
|
end
|
||||||
if not bVal or bVal == 0 then
|
if not bVal or bVal == 0 then
|
||||||
bVal = (rt.sortInfo.descending and -1 or 1) * Aux.huge
|
bVal = (self.sortInfo.descending and -1 or 1) * Aux.huge
|
||||||
end
|
end
|
||||||
elseif sortKey == "percent" then
|
elseif sortKey == "percent" then
|
||||||
-- for percent, put bid-only auctions at the bottom
|
-- for percent, put bid-only auctions at the bottom
|
||||||
aVal = aVal or ((rt.sortInfo.descending and -1 or 1) * Aux.huge)
|
aVal = aVal or ((self.sortInfo.descending and -1 or 1) * Aux.huge)
|
||||||
bVal = bVal or ((rt.sortInfo.descending and -1 or 1) * Aux.huge)
|
bVal = bVal or ((self.sortInfo.descending and -1 or 1) * Aux.huge)
|
||||||
end
|
end
|
||||||
if type(aVal) == "string" or type(bVal) == "string" then
|
if type(aVal) == "string" or type(bVal) == "string" then
|
||||||
aVal = aVal or ""
|
aVal = aVal or ""
|
||||||
@@ -321,43 +333,43 @@ local methods = {
|
|||||||
-- sort arbitrarily, but make sure the sort is stable
|
-- sort arbitrarily, but make sure the sort is stable
|
||||||
return tostring(a) < tostring(b)
|
return tostring(a) < tostring(b)
|
||||||
end
|
end
|
||||||
if rt.sortInfo.descending then
|
if self.sortInfo.descending then
|
||||||
return aVal > bVal
|
return aVal > bVal
|
||||||
else
|
else
|
||||||
return aVal < bVal
|
return aVal < bVal
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- sort the row info
|
-- sort the row info
|
||||||
for i, info in ipairs(rt.rowInfo) do
|
for i, info in ipairs(self.rowInfo) do
|
||||||
sort(info.children, SortHelperFunc)
|
sort(info.children, SortHelperFunc)
|
||||||
end
|
end
|
||||||
sort(rt.rowInfo, SortHelperFunc)
|
sort(self.rowInfo, SortHelperFunc)
|
||||||
rt.sortInfo.isSorted = true
|
self.sortInfo.isSorted = true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update all the rows
|
-- update all the rows
|
||||||
local rowIndex = 1 - FauxScrollFrame_GetOffset(rt.scrollFrame)
|
local rowIndex = 1 - FauxScrollFrame_GetOffset(self.scrollFrame)
|
||||||
for i, info in ipairs(rt.rowInfo) do
|
for i, info in ipairs(self.rowInfo) do
|
||||||
if rt.expanded[info.expandKey] then
|
if self.expanded[info.expandKey] then
|
||||||
-- show each of the rows for this base item since it's expanded
|
-- show each of the rows for this base item since it's expanded
|
||||||
for j, childInfo in ipairs(info.children) do
|
for j, childInfo in ipairs(info.children) do
|
||||||
rt:SetRowInfo(rowIndex, childInfo.record, childInfo.numAuctions, 0, j > 1, false, info.expandKey, childInfo.numAuctions)
|
self:SetRowInfo(rowIndex, childInfo.record, childInfo.numAuctions, 0, j > 1, false, info.expandKey, childInfo.numAuctions)
|
||||||
rowIndex = rowIndex + 1
|
rowIndex = rowIndex + 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- just show one row for this base item since it's not expanded
|
-- just show one row for this base item since it's not expanded
|
||||||
rt:SetRowInfo(rowIndex, info.children[1].record, info.totalAuctions, getn(info.children) > 1 and info.totalPlayerAuctions or 0, false, getn(info.children) > 1, info.expandKey, info.children[1].numAuctions)
|
self:SetRowInfo(rowIndex, info.children[1].record, info.totalAuctions, getn(info.children) > 1 and info.totalPlayerAuctions or 0, false, getn(info.children) > 1, info.expandKey, info.children[1].numAuctions)
|
||||||
rowIndex = rowIndex + 1
|
rowIndex = rowIndex + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
SetRowInfo = function(rt, rowIndex, record, displayNumAuctions, numPlayerAuctions, indented, expandable, expandKey, numAuctions)
|
SetRowInfo = function(self, rowIndex, record, displayNumAuctions, numPlayerAuctions, indented, expandable, expandKey, numAuctions)
|
||||||
if rowIndex <= 0 or rowIndex > getn(rt.rows) then return end
|
if rowIndex <= 0 or rowIndex > getn(self.rows) then return end
|
||||||
local row = rt.rows[rowIndex]
|
local row = self.rows[rowIndex]
|
||||||
-- show this row
|
-- show this row
|
||||||
row:Show()
|
row:Show()
|
||||||
if rt.selected and record.search_signature == rt.selected.search_signature then
|
if self.selected and record.search_signature == self.selected.search_signature then
|
||||||
row.highlight:Show()
|
row.highlight:Show()
|
||||||
else
|
else
|
||||||
row.highlight:Hide()
|
row.highlight:Hide()
|
||||||
@@ -394,10 +406,10 @@ local methods = {
|
|||||||
row.cells[4]:SetText(record.aux_quantity)
|
row.cells[4]:SetText(record.aux_quantity)
|
||||||
row.cells[5]:SetText(TIME_LEFT_STRINGS[record.duration or 0] or "---")
|
row.cells[5]:SetText(TIME_LEFT_STRINGS[record.duration or 0] or "---")
|
||||||
row.cells[6]:SetText(Aux.is_player(record.owner) and ("|cffffff00"..record.owner.."|r") or record.owner)
|
row.cells[6]:SetText(Aux.is_player(record.owner) and ("|cffffff00"..record.owner.."|r") or record.owner)
|
||||||
local bid, buyout, colorBid, colorBuyout = rt.GetRowPrices(record, aux_price_per_unit)
|
local bid, buyout, colorBid, colorBuyout = self.GetRowPrices(record, aux_price_per_unit)
|
||||||
row.cells[7]:SetText(bid > 0 and Aux.money.to_string(bid, true, false, colorBid) or "---")
|
row.cells[7]:SetText(bid > 0 and Aux.money.to_string(bid, true, false, colorBid) or "---")
|
||||||
row.cells[8]:SetText(buyout > 0 and Aux.money.to_string(buyout, true, false, colorBuyout) or "---")
|
row.cells[8]:SetText(buyout > 0 and Aux.money.to_string(buyout, true, false, colorBuyout) or "---")
|
||||||
local pct, bidPct = rt:GetRecordPercent(record)
|
local pct, bidPct = self:GetRecordPercent(record)
|
||||||
local pctColor = '|cffffffff'
|
local pctColor = '|cffffffff'
|
||||||
if pct then
|
if pct then
|
||||||
for i=1, getn(AUCTION_PCT_COLORS) do
|
for i=1, getn(AUCTION_PCT_COLORS) do
|
||||||
@@ -417,25 +429,25 @@ local methods = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
SetSelectedRecord = function(rt, record, silent)
|
SetSelectedRecord = function(self, record, silent)
|
||||||
if rt.disabled then return end
|
if self.disabled then return end
|
||||||
|
|
||||||
-- make sure the selected record still exists and get the data for the callback
|
-- make sure the selected record still exists and get the data for the callback
|
||||||
rt.selected = record
|
self.selected = record
|
||||||
local selectedData = rt:GetSelection()
|
local selectedData = self:GetSelection()
|
||||||
rt.selected = selectedData and rt.selected or nil
|
self.selected = selectedData and self.selected or nil
|
||||||
|
|
||||||
-- show / hide highlight accordingly
|
-- show / hide highlight accordingly
|
||||||
for _, row in ipairs(rt.rows) do
|
for _, row in ipairs(self.rows) do
|
||||||
if rt.selected and row.data and row.data.record.search_signature == rt.selected.search_signature then
|
if self.selected and row.data and row.data.record.search_signature == self.selected.search_signature then
|
||||||
row.highlight:Show()
|
row.highlight:Show()
|
||||||
else
|
else
|
||||||
row.highlight:Hide()
|
row.highlight:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not silent and rt.handlers.OnSelectionChanged and not rt.scrollDisabled then
|
if not silent and self.handlers.OnSelectionChanged and not self.scrollDisabled then
|
||||||
rt.handlers.OnSelectionChanged(rt, selectedData or nil)
|
self.handlers.OnSelectionChanged(self, selectedData or nil)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -463,7 +475,7 @@ local methods = {
|
|||||||
-- rt.dbView:SetFilter(filterFunc, filterHash) -- TODO
|
-- rt.dbView:SetFilter(filterFunc, filterHash) -- TODO
|
||||||
|
|
||||||
-- get index of selected row
|
-- get index of selected row
|
||||||
local prevSelectedIndex = nil
|
local prevSelectedIndex
|
||||||
if rt.selected then
|
if rt.selected then
|
||||||
for index, row in ipairs(rt.rows) do
|
for index, row in ipairs(rt.rows) do
|
||||||
if row:IsVisible() and row.data and row.data.record == rt.selected then
|
if row:IsVisible() and row.data and row.data.record == rt.selected then
|
||||||
@@ -494,7 +506,6 @@ local methods = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
RemoveSelectedRecord = function(rt, count)
|
RemoveSelectedRecord = function(rt, count)
|
||||||
-- TSMAPI:Assert(rt.selected)
|
|
||||||
count = count or 1
|
count = count or 1
|
||||||
for i=1, count do
|
for i=1, count do
|
||||||
local index = Aux.util.index_of(rt.selected, rt.records)
|
local index = Aux.util.index_of(rt.selected, rt.records)
|
||||||
@@ -537,7 +548,6 @@ local methods = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
SetHandler = function(rt, event, handler)
|
SetHandler = function(rt, event, handler)
|
||||||
-- TSMAPI:Assert(event == "OnSelectionChanged")
|
|
||||||
rt.handlers[event] = handler
|
rt.handlers[event] = handler
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -718,7 +728,7 @@ function CreateAuctionResultsTable(parent)
|
|||||||
local text = cell:CreateFontString()
|
local text = cell:CreateFontString()
|
||||||
text:SetFont(Aux.gui.config.content_font, min(14, rt.ROW_HEIGHT))
|
text:SetFont(Aux.gui.config.content_font, min(14, rt.ROW_HEIGHT))
|
||||||
text:SetJustifyH(colInfo[j].align or 'LEFT')
|
text:SetJustifyH(colInfo[j].align or 'LEFT')
|
||||||
text:SetJustifyV('MIDDLE')
|
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)
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
AuxVersion = '2.4.0'
|
AuxVersion = '2.4.0'
|
||||||
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
AuxAuthors = 'shirsig; Zerf; Zirco (Auctionator); Nimeral (Auctionator backport)'
|
||||||
|
|
||||||
local lastRightClickAction = GetTime()
|
|
||||||
|
|
||||||
Aux = {
|
Aux = {
|
||||||
blizzard_ui_shown = false,
|
blizzard_ui_shown = false,
|
||||||
loaded = false,
|
loaded = false,
|
||||||
orig = {},
|
orig = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
function Aux_OnLoad()
|
function Aux.on_load()
|
||||||
Aux.log('Aux v'..AuxVersion..' loaded.')
|
Aux.log('Aux v'..AuxVersion..' loaded.')
|
||||||
Aux.loaded = true
|
Aux.loaded = true
|
||||||
tinsert(UISpecialFrames, 'AuxFrame')
|
tinsert(UISpecialFrames, 'AuxFrame')
|
||||||
@@ -88,22 +86,21 @@ function Aux_OnLoad()
|
|||||||
-- AuxFrameContent:SetBackdropColor(unpack(Aux.gui.config.content_color))
|
-- AuxFrameContent:SetBackdropColor(unpack(Aux.gui.config.content_color))
|
||||||
-- AuxFrameContent:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
|
-- AuxFrameContent:SetBackdropBorderColor(unpack(Aux.gui.config.content_border_color))
|
||||||
|
|
||||||
-- Aux.item_search_frame.on_load()
|
Aux.search_frame.on_load()
|
||||||
Aux.filter_search_frame.on_load()
|
|
||||||
Aux.post_frame.on_load()
|
Aux.post_frame.on_load()
|
||||||
Aux.auctions_frame.on_load()
|
Aux.auctions_frame.on_load()
|
||||||
Aux.bids_frame.on_load()
|
Aux.bids_frame.on_load()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnEvent()
|
function Aux.on_event()
|
||||||
if event == 'VARIABLES_LOADED' then
|
if event == 'VARIABLES_LOADED' then
|
||||||
Aux_OnLoad()
|
Aux.on_load()
|
||||||
elseif event == 'ADDON_LOADED' then
|
elseif event == 'ADDON_LOADED' then
|
||||||
Aux_OnAddonLoaded()
|
Aux.on_addon_loaded()
|
||||||
elseif event == 'AUCTION_HOUSE_SHOW' then
|
elseif event == 'AUCTION_HOUSE_SHOW' then
|
||||||
Aux_OnAuctionHouseShow()
|
Aux.on_auction_house_show()
|
||||||
elseif event == 'AUCTION_HOUSE_CLOSED' then
|
elseif event == 'AUCTION_HOUSE_CLOSED' then
|
||||||
Aux_OnAuctionHouseClosed()
|
Aux.on_auction_house_closed()
|
||||||
Aux.bids_loaded = false
|
Aux.bids_loaded = false
|
||||||
Aux.current_owner_page = nil
|
Aux.current_owner_page = nil
|
||||||
elseif event == 'AUCTION_BIDDER_LIST_UPDATE' then
|
elseif event == 'AUCTION_BIDDER_LIST_UPDATE' then
|
||||||
@@ -113,12 +110,9 @@ function Aux_OnEvent()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnAddonLoaded()
|
function Aux.on_addon_loaded()
|
||||||
if string.lower(arg1) == "blizzard_auctionui" then
|
if string.lower(arg1) == 'blizzard_auctionui' then
|
||||||
Aux_SetupHookFunctions()
|
Aux.setup_hooks()
|
||||||
end
|
|
||||||
if string.lower(arg1) == "EnhTooltip" then
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -146,53 +140,11 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux.log_frame_load()
|
|
||||||
this:SetFading(false)
|
|
||||||
this:EnableMouseWheel()
|
|
||||||
-- this.flashTimer = 0 TODO remove
|
|
||||||
end
|
|
||||||
|
|
||||||
function Aux.log_frame_update(elapsedSec)
|
|
||||||
if not this:IsVisible() then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local flash = getglobal(this:GetName()..'BottomButtonFlash')
|
|
||||||
|
|
||||||
if not flash then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if this:AtBottom() then
|
|
||||||
if flash:IsVisible() then
|
|
||||||
flash:Hide()
|
|
||||||
end
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local flashTimer = this.flashTimer + elapsedSec
|
|
||||||
if flashTimer < CHAT_BUTTON_FLASH_TIME then
|
|
||||||
this.flashTimer = flashTimer
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
while flashTimer >= CHAT_BUTTON_FLASH_TIME do
|
|
||||||
flashTimer = flashTimer - CHAT_BUTTON_FLASH_TIME
|
|
||||||
end
|
|
||||||
this.flashTimer = flashTimer
|
|
||||||
|
|
||||||
if flash:IsVisible() then
|
|
||||||
flash:Hide()
|
|
||||||
else
|
|
||||||
flash:Show()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Aux.log(msg)
|
function Aux.log(msg)
|
||||||
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0)
|
DEFAULT_CHAT_FRAME:AddMessage(msg, 1, 1, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_SetupHookFunctions()
|
function Aux.setup_hooks()
|
||||||
|
|
||||||
local blizzard_ui_on_hide = function()
|
local blizzard_ui_on_hide = function()
|
||||||
Aux.blizzard_ui_shown = false
|
Aux.blizzard_ui_shown = false
|
||||||
@@ -216,7 +168,7 @@ function Aux_SetupHookFunctions()
|
|||||||
PickupContainerItem = Aux.PickupContainerItem
|
PickupContainerItem = Aux.PickupContainerItem
|
||||||
|
|
||||||
Aux.orig.ContainerFrameItemButton_OnClick = ContainerFrameItemButton_OnClick
|
Aux.orig.ContainerFrameItemButton_OnClick = ContainerFrameItemButton_OnClick
|
||||||
ContainerFrameItemButton_OnClick = Aux_ContainerFrameItemButton_OnClick
|
ContainerFrameItemButton_OnClick = Aux.ContainerFrameItemButton_OnClick
|
||||||
|
|
||||||
Aux.orig.AuctionFrameAuctions_OnEvent = AuctionFrameAuctions_OnEvent
|
Aux.orig.AuctionFrameAuctions_OnEvent = AuctionFrameAuctions_OnEvent
|
||||||
AuctionFrameAuctions_OnEvent = Aux.AuctionFrameAuctions_OnEvent
|
AuctionFrameAuctions_OnEvent = Aux.AuctionFrameAuctions_OnEvent
|
||||||
@@ -237,23 +189,21 @@ function Aux.AuctionFrameAuctions_OnEvent()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnAuctionHouseShow()
|
function Aux.on_auction_house_show()
|
||||||
AuxFrame:Show()
|
AuxFrame:Show()
|
||||||
Aux.tab_group:set_tab(1)
|
Aux.tab_group:set_tab(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_OnAuctionHouseClosed()
|
function Aux.on_auction_house_closed()
|
||||||
Aux.post.stop()
|
Aux.post.stop()
|
||||||
Aux.stack.stop()
|
Aux.stack.stop()
|
||||||
Aux.scan.abort()
|
Aux.scan.abort()
|
||||||
|
|
||||||
-- Aux.item_search_frame.on_close()
|
Aux.search_frame.on_close()
|
||||||
Aux.filter_search_frame.on_close()
|
|
||||||
Aux.post_frame.on_close()
|
Aux.post_frame.on_close()
|
||||||
Aux.auctions_frame.on_close()
|
Aux.auctions_frame.on_close()
|
||||||
Aux.bids_frame.on_close()
|
Aux.bids_frame.on_close()
|
||||||
Aux.history_frame.on_close()
|
|
||||||
|
|
||||||
AuxFrame:Hide()
|
AuxFrame:Hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -261,23 +211,19 @@ function Aux.on_tab_click(index)
|
|||||||
Aux.post.stop()
|
Aux.post.stop()
|
||||||
Aux.stack.stop()
|
Aux.stack.stop()
|
||||||
Aux.scan.abort(function()
|
Aux.scan.abort(function()
|
||||||
-- Aux.item_search_frame.on_close()
|
Aux.search_frame.on_close()
|
||||||
Aux.filter_search_frame.on_close()
|
|
||||||
Aux.post_frame.on_close()
|
Aux.post_frame.on_close()
|
||||||
Aux.auctions_frame.on_close()
|
Aux.auctions_frame.on_close()
|
||||||
Aux.bids_frame.on_close()
|
Aux.bids_frame.on_close()
|
||||||
Aux.history_frame.on_close()
|
|
||||||
|
|
||||||
-- AuxItemSearchFrame:Hide()
|
|
||||||
AuxFilterSearchFrame:Hide()
|
AuxFilterSearchFrame:Hide()
|
||||||
AuxPostFrame:Hide()
|
AuxPostFrame:Hide()
|
||||||
AuxAuctionsFrame:Hide()
|
AuxAuctionsFrame:Hide()
|
||||||
AuxBidsFrame:Hide()
|
AuxBidsFrame:Hide()
|
||||||
AuxHistoryFrame:Hide()
|
|
||||||
|
|
||||||
if index == 1 then
|
if index == 1 then
|
||||||
AuxFilterSearchFrame:Show()
|
AuxFilterSearchFrame:Show()
|
||||||
Aux.filter_search_frame.on_open()
|
Aux.search_frame.on_open()
|
||||||
elseif index == 2 then
|
elseif index == 2 then
|
||||||
AuxPostFrame:Show()
|
AuxPostFrame:Show()
|
||||||
Aux.post_frame.on_open()
|
Aux.post_frame.on_open()
|
||||||
@@ -287,9 +233,6 @@ function Aux.on_tab_click(index)
|
|||||||
elseif index == 4 then
|
elseif index == 4 then
|
||||||
AuxBidsFrame:Show()
|
AuxBidsFrame:Show()
|
||||||
Aux.bids_frame.on_open()
|
Aux.bids_frame.on_open()
|
||||||
-- elseif index == 5 then
|
|
||||||
-- AuxItemSearchFrame:Show()
|
|
||||||
-- Aux.item_search_frame.on_open()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Aux.active_panel = index
|
Aux.active_panel = index
|
||||||
@@ -314,25 +257,6 @@ function Aux.price_level_color(pct)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_AuctionsButton_OnClick(button)
|
|
||||||
if arg1 == "LeftButton" then -- because we additionally registered right clicks we only let left ones pass here
|
|
||||||
Aux.orig.BrowseButton_OnClick(button)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function Aux_AuctionsButton_OnMouseDown()
|
|
||||||
if arg1 == "RightButton" and GetTime() - lastRightClickAction > 0.5 then
|
|
||||||
local index = this:GetID() + FauxScrollFrame_GetOffset(AuctionsScrollFrame)
|
|
||||||
|
|
||||||
SetSelectedAuctionItem("owner", index)
|
|
||||||
|
|
||||||
CancelAuction(index)
|
|
||||||
|
|
||||||
AuctionFrameAuctions_Update()
|
|
||||||
lastRightClickAction = GetTime()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local last_picked_up
|
local last_picked_up
|
||||||
function Aux.PickupContainerItem(bag, slot)
|
function Aux.PickupContainerItem(bag, slot)
|
||||||
@@ -346,7 +270,7 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Aux_ContainerFrameItemButton_OnClick(button)
|
function Aux.ContainerFrameItemButton_OnClick(button)
|
||||||
local bag, slot = this:GetParent():GetID(), this:GetID()
|
local bag, slot = this:GetParent():GetID(), this:GetID()
|
||||||
local item_info = Aux.info.container_item(bag, slot)
|
local item_info = Aux.info.container_item(bag, slot)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
|
this:RegisterEvent('AUCTION_OWNED_LIST_UPDATE')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnEvent>
|
<OnEvent>
|
||||||
Aux_OnEvent()
|
Aux.on_event()
|
||||||
</OnEvent>
|
</OnEvent>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||||
|
|
||||||
<Script file="item_search_frame.lua"/>
|
<Script file="search_frame.lua"/>
|
||||||
|
|
||||||
<Frame>
|
<Frame>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
|
|||||||
+4
-5
@@ -206,7 +206,6 @@ local methods = {
|
|||||||
st.sizes.headHeight = 0
|
st.sizes.headHeight = 0
|
||||||
end
|
end
|
||||||
st.sizes.numRows = max(floor((st:GetParent():GetHeight() - st.sizes.headHeight - ST_HEAD_SPACE) / ST_ROW_HEIGHT), 0)
|
st.sizes.numRows = max(floor((st:GetParent():GetHeight() - st.sizes.headHeight - ST_HEAD_SPACE) / ST_ROW_HEIGHT), 0)
|
||||||
snipe.log(st.sizes.numRows)
|
|
||||||
|
|
||||||
-- update the frame
|
-- update the frame
|
||||||
st.scrollBar:ClearAllPoints()
|
st.scrollBar:ClearAllPoints()
|
||||||
@@ -347,11 +346,11 @@ local methods = {
|
|||||||
row:SetHeight(ST_ROW_HEIGHT)
|
row:SetHeight(ST_ROW_HEIGHT)
|
||||||
local rowNum = getn(st.rows) + 1
|
local rowNum = getn(st.rows) + 1
|
||||||
if rowNum == 1 then
|
if rowNum == 1 then
|
||||||
row:SetPoint('TOPLEFT', 0, -(st.sizes.headHeight+ST_HEAD_SPACE))
|
row:SetPoint('TOPLEFT', 0, -(st.sizes.headHeight + ST_HEAD_SPACE))
|
||||||
row:SetPoint('TOPRIGHT', 0, -(st.sizes.headHeight+ST_HEAD_SPACE))
|
row:SetPoint('TOPRIGHT', 0, -(st.sizes.headHeight + ST_HEAD_SPACE))
|
||||||
else
|
else
|
||||||
row:SetPoint('TOPLEFT', st.rows[rowNum-1], 'BOTTOMLEFT')
|
row:SetPoint('TOPLEFT', 0, -(st.sizes.headHeight + ST_HEAD_SPACE + (rowNum - 1) * ST_ROW_HEIGHT))
|
||||||
row:SetPoint('TOPRIGHT', st.rows[rowNum-1], 'BOTTOMRIGHT')
|
row:SetPoint('TOPRIGHT', 0, -(st.sizes.headHeight + ST_HEAD_SPACE + (rowNum - 1) * ST_ROW_HEIGHT))
|
||||||
end
|
end
|
||||||
local highlight = row:CreateTexture()
|
local highlight = row:CreateTexture()
|
||||||
highlight:SetAllPoints()
|
highlight:SetAllPoints()
|
||||||
|
|||||||
+4
-4
@@ -344,7 +344,7 @@ function public.on_open()
|
|||||||
AuxSellAuctions:SetWidth(AuxSellAuctionsListing:GetWidth() + 40)
|
AuxSellAuctions:SetWidth(AuxSellAuctionsListing:GetWidth() + 40)
|
||||||
|
|
||||||
-- UIDropDownMenu_SetSelectedValue(AuxSellParametersStrategyDropDown, LIVE)
|
-- UIDropDownMenu_SetSelectedValue(AuxSellParametersStrategyDropDown, LIVE)
|
||||||
private.set_auction_duration(AUX_AUCTION_DURATION)
|
private.set_auction_duration(aux_auction_duration)
|
||||||
|
|
||||||
-- so that it's initialized with zeroes, not sometimes zero, sometimes empty
|
-- so that it's initialized with zeroes, not sometimes zero, sometimes empty
|
||||||
private.start_price:SetText(Aux.money.to_string(0))
|
private.start_price:SetText(Aux.money.to_string(0))
|
||||||
@@ -370,15 +370,15 @@ function public.duration_radio_button_on_click(index)
|
|||||||
if index == 1 then
|
if index == 1 then
|
||||||
AuxSellParametersShortDurationRadio:SetChecked(true)
|
AuxSellParametersShortDurationRadio:SetChecked(true)
|
||||||
AuctionFrameAuctions.duration = 120
|
AuctionFrameAuctions.duration = 120
|
||||||
AUX_AUCTION_DURATION = 'short'
|
aux_auction_duration = 'short'
|
||||||
elseif index == 2 then
|
elseif index == 2 then
|
||||||
AuxSellParametersMediumDurationRadio:SetChecked(true)
|
AuxSellParametersMediumDurationRadio:SetChecked(true)
|
||||||
AuctionFrameAuctions.duration = 480
|
AuctionFrameAuctions.duration = 480
|
||||||
AUX_AUCTION_DURATION = 'medium'
|
aux_auction_duration = 'medium'
|
||||||
else
|
else
|
||||||
AuxSellParametersLongDurationRadio:SetChecked(true)
|
AuxSellParametersLongDurationRadio:SetChecked(true)
|
||||||
AuctionFrameAuctions.duration = 1440
|
AuctionFrameAuctions.duration = 1440
|
||||||
AUX_AUCTION_DURATION = 'long'
|
aux_auction_duration = 'long'
|
||||||
end
|
end
|
||||||
private.update_recommendation()
|
private.update_recommendation()
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -232,7 +232,7 @@ function m.validator(filter)
|
|||||||
if filter.discard then
|
if filter.discard then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if filter.exact and strupper(record.name) ~= strupper(filter.name) then
|
if filter.exact and strupper(Aux.static.item_info(record.item_id).name) ~= strupper(filter.name) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if filter.min_level and record.level < filter.min_level then
|
if filter.min_level and record.level < filter.min_level then
|
||||||
|
|||||||
@@ -1,11 +1,34 @@
|
|||||||
local private, public = {}, {}
|
local private, public = {}, {}
|
||||||
Aux.filter_search_frame = public
|
Aux.search_frame = public
|
||||||
|
|
||||||
aux_favorite_searches = {}
|
aux_favorite_searches = {}
|
||||||
aux_recent_searches = {}
|
aux_recent_searches = {}
|
||||||
|
|
||||||
local tooltip_patterns = {}
|
private.popup_info = {
|
||||||
local selected_auction
|
rename = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
StaticPopupDialogs['AUX_SEARCH_SAVED_RENAME'] = {
|
||||||
|
text = 'Enter a new name for this search.',
|
||||||
|
button1 = 'Accept',
|
||||||
|
button2 = 'Cancel',
|
||||||
|
hasEditBox = 1,
|
||||||
|
OnShow = function()
|
||||||
|
local rename_info = private.popup_info.rename
|
||||||
|
local edit_box = getglobal(this:GetName()..'EditBox')
|
||||||
|
edit_box:SetText(rename_info.name or '')
|
||||||
|
edit_box:HighlightText()
|
||||||
|
edit_box:SetFocus()
|
||||||
|
edit_box:SetScript('OnEscapePressed', function() StaticPopup_Hide('AUX_SEARCH_SAVED_RENAME') end)
|
||||||
|
edit_box:SetScript('OnEnterPressed', function() this.button1:Click() end)
|
||||||
|
end,
|
||||||
|
OnAccept = function()
|
||||||
|
private.popup_info.rename.name = getglobal(this:GetParent():GetName()..'EditBox'):GetText()
|
||||||
|
private.update_search_listings()
|
||||||
|
end,
|
||||||
|
timeout = 0,
|
||||||
|
hideOnEscape = 1,
|
||||||
|
}
|
||||||
|
|
||||||
local RESULTS, SAVED, FILTER = {}, {}, {}
|
local RESULTS, SAVED, FILTER = {}, {}, {}
|
||||||
|
|
||||||
@@ -18,7 +41,7 @@ private.elements = {
|
|||||||
function private.update_search_listings()
|
function private.update_search_listings()
|
||||||
local favorite_search_rows = {}
|
local favorite_search_rows = {}
|
||||||
for i, favorite_search in ipairs(aux_favorite_searches) do
|
for i, favorite_search in ipairs(aux_favorite_searches) do
|
||||||
local name = Aux.test.prettify_search(favorite_search)
|
local name = favorite_search.name or Aux.test.prettify_search(favorite_search.filter_string)
|
||||||
tinsert(favorite_search_rows, {
|
tinsert(favorite_search_rows, {
|
||||||
cols = {{value=name}},
|
cols = {{value=name}},
|
||||||
search = favorite_search,
|
search = favorite_search,
|
||||||
@@ -30,7 +53,7 @@ function private.update_search_listings()
|
|||||||
|
|
||||||
local recent_search_rows = {}
|
local recent_search_rows = {}
|
||||||
for i, recent_search in ipairs(aux_recent_searches) do
|
for i, recent_search in ipairs(aux_recent_searches) do
|
||||||
local name = Aux.test.prettify_search(recent_search)
|
local name = recent_search.name or Aux.test.prettify_search(recent_search.filter_string)
|
||||||
tinsert(recent_search_rows, {
|
tinsert(recent_search_rows, {
|
||||||
cols = {{value=name}},
|
cols = {{value=name}},
|
||||||
search = recent_search,
|
search = recent_search,
|
||||||
@@ -93,24 +116,11 @@ function private.get_form_filter()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.select_auction(entry)
|
function public.on_open()
|
||||||
selected_auction = entry
|
private.update_search_listings()
|
||||||
RESULTS.buyout_button:Disable()
|
|
||||||
private.bid_button:Disable()
|
|
||||||
end
|
|
||||||
|
|
||||||
function private.clear_selection(entry)
|
|
||||||
selected_auction = nil
|
|
||||||
RESULTS.buyout_button:Disable()
|
|
||||||
private.bid_button:Disable()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.on_close()
|
function public.on_close()
|
||||||
private.clear_selection()
|
|
||||||
end
|
|
||||||
|
|
||||||
function public.on_open()
|
|
||||||
private.update_search_listings()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.on_load()
|
function public.on_load()
|
||||||
@@ -125,7 +135,7 @@ function public.on_load()
|
|||||||
btn:SetWidth(60)
|
btn:SetWidth(60)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('Search')
|
btn:SetText('Search')
|
||||||
btn:SetScript('OnClick', Aux.filter_search_frame.start_search)
|
btn:SetScript('OnClick', Aux.search_frame.start_search)
|
||||||
private.search_button = btn
|
private.search_button = btn
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
@@ -134,7 +144,7 @@ function public.on_load()
|
|||||||
btn:SetWidth(60)
|
btn:SetWidth(60)
|
||||||
btn:SetHeight(25)
|
btn:SetHeight(25)
|
||||||
btn:SetText('Stop')
|
btn:SetText('Stop')
|
||||||
btn:SetScript('OnClick', Aux.filter_search_frame.stop_search)
|
btn:SetScript('OnClick', Aux.search_frame.stop_search)
|
||||||
btn:Hide()
|
btn:Hide()
|
||||||
private.stop_button = btn
|
private.stop_button = btn
|
||||||
end
|
end
|
||||||
@@ -392,14 +402,14 @@ function public.on_load()
|
|||||||
|
|
||||||
-- Tooltip 1
|
-- Tooltip 1
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox1')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip1InputBox1')
|
||||||
editbox:SetPoint('TOPLEFT', 300, -20)
|
editbox:SetPoint('TOPLEFT', 300, -20)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox2'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -414,14 +424,14 @@ function public.on_load()
|
|||||||
label:SetText('Tooltip')
|
label:SetText('Tooltip')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox2')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip1InputBox2')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox1 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip1InputBox1 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox1'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -433,14 +443,14 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox3')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip1InputBox3')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox2 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip1InputBox2 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox2'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox4'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -452,12 +462,12 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox4')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip1InputBox4')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox3 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip1InputBox3 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip1InputBox3'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
end
|
end
|
||||||
@@ -473,14 +483,14 @@ function public.on_load()
|
|||||||
|
|
||||||
-- Tooltip 2
|
-- Tooltip 2
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox1')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip2InputBox1')
|
||||||
editbox:SetPoint('TOPLEFT', 300, -200)
|
editbox:SetPoint('TOPLEFT', 300, -200)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox2'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -495,14 +505,14 @@ function public.on_load()
|
|||||||
label:SetText('Tooltip')
|
label:SetText('Tooltip')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox2')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip2InputBox2')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox1 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip2InputBox1 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox1'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox3'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -514,14 +524,14 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox3')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip2InputBox3')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox2 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip2InputBox2 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox2'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox4'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -533,12 +543,12 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox4')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip2InputBox4')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox3 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip2InputBox3 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip2InputBox3'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
end
|
end
|
||||||
@@ -554,14 +564,14 @@ function public.on_load()
|
|||||||
|
|
||||||
-- Tooltip 3
|
-- Tooltip 3
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox1')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip3InputBox1')
|
||||||
editbox:SetPoint('TOPLEFT', 600, -20)
|
editbox:SetPoint('TOPLEFT', 600, -20)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox2'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -576,14 +586,14 @@ function public.on_load()
|
|||||||
label:SetText('Tooltip')
|
label:SetText('Tooltip')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox2')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip3InputBox2')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox1 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip3InputBox1 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox1'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox3'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -595,14 +605,14 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox3')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip3InputBox3')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox2 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip3InputBox2 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox2'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox4'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -614,12 +624,12 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox4')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip3InputBox4')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox3 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip3InputBox3 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip3InputBox3'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
end
|
end
|
||||||
@@ -635,14 +645,14 @@ function public.on_load()
|
|||||||
|
|
||||||
-- Tooltip 4
|
-- Tooltip 4
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox1')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip4InputBox1')
|
||||||
editbox:SetPoint('TOPLEFT', 300, -300)
|
editbox:SetPoint('TOPLEFT', 600, -200)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
getglobal(this:GetParent():GetName()..'MaxLevel'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox2'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -657,14 +667,14 @@ function public.on_load()
|
|||||||
label:SetText('Tooltip')
|
label:SetText('Tooltip')
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox2')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip4InputBox2')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox1 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip4InputBox1 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox1'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox1'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox3'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -676,14 +686,14 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox3')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip4InputBox3')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox2 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip4InputBox2 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox2'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox2'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox4'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox4'):SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
editbox:SetScript('OnEnterPressed', function()
|
editbox:SetScript('OnEnterPressed', function()
|
||||||
@@ -695,12 +705,12 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltipInputBox4')
|
local editbox = Aux.gui.editbox(private.elements[FILTER].filters, '$parentTooltip4InputBox4')
|
||||||
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltipInputBox3 , 'BOTTOMLEFT', 0, -3)
|
editbox:SetPoint('TOPLEFT', AuxFilterSearchFrameFilterTooltip4InputBox3 , 'BOTTOMLEFT', 0, -3)
|
||||||
editbox:SetWidth(250)
|
editbox:SetWidth(250)
|
||||||
editbox:SetScript('OnTabPressed', function()
|
editbox:SetScript('OnTabPressed', function()
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
getglobal(this:GetParent():GetName()..'TooltipInputBox3'):SetFocus()
|
getglobal(this:GetParent():GetName()..'Tooltip4InputBox3'):SetFocus()
|
||||||
else
|
else
|
||||||
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
getglobal(this:GetParent():GetName()..'NameInputBox'):SetFocus()
|
||||||
end
|
end
|
||||||
@@ -714,32 +724,41 @@ function public.on_load()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
private.testlisting = CreateAuctionResultsTable(AuxFilterSearchFrameResults)
|
private.results_listing = CreateAuctionResultsTable(AuxFilterSearchFrameResults)
|
||||||
private.testlisting:Show()
|
private.results_listing:Show()
|
||||||
private.testlisting:SetSort(9)
|
private.results_listing:SetSort(9)
|
||||||
private.testlisting:Clear()
|
private.results_listing:Clear()
|
||||||
private.testlisting:SetHandler('OnSelectionChanged', private.on_selection_changed)
|
private.results_listing:SetHandler('OnCellAltClick', function(cell, button)
|
||||||
|
private.find_auction(cell.row.data.record, true, button == 'LeftButton')
|
||||||
|
end)
|
||||||
|
private.results_listing:SetHandler('OnSelectionChanged', function(rt, datum)
|
||||||
|
if not datum then return end
|
||||||
|
private.find_auction(datum.record)
|
||||||
|
end)
|
||||||
|
|
||||||
local handlers = {
|
local handlers = {
|
||||||
OnClick = function(st, data, _, button)
|
OnClick = function(st, data, _, button)
|
||||||
if not data then return end
|
if not data then return end
|
||||||
if button == 'LeftButton' then
|
if button == 'LeftButton' then
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
-- private.popupInfo.export = data.search
|
private.search_box:SetText(data.search.filter_string)
|
||||||
|
-- private.popupInfo.export = data.search
|
||||||
-- TSMAPI.Util:ShowStaticPopupDialog('TSM_SHOPPING_SAVED_EXPORT_POPUP')
|
-- TSMAPI.Util:ShowStaticPopupDialog('TSM_SHOPPING_SAVED_EXPORT_POPUP')
|
||||||
elseif IsControlKeyDown() then
|
elseif IsControlKeyDown() then
|
||||||
-- private.popupInfo.renameInfo = data.searchInfo
|
|
||||||
-- TSMAPI.Util:ShowStaticPopupDialog('TSM_SHOPPING_SAVED_RENAME_POPUP')
|
|
||||||
else
|
else
|
||||||
private.search_box:SetText(data.search)
|
private.search_box:SetText(data.search.filter_string)
|
||||||
public.start_search()
|
public.start_search()
|
||||||
end
|
end
|
||||||
elseif button == 'RightButton' then
|
elseif button == 'RightButton' then
|
||||||
if st == private.recent_searches_listing then
|
if IsShiftKeyDown() then
|
||||||
|
private.popup_info.rename = data.search
|
||||||
|
StaticPopup_Show('AUX_SEARCH_SAVED_RENAME')
|
||||||
|
elseif st == private.recent_searches_listing then
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
tremove(TSM.db.global.savedSearches, data.index)
|
-- tremove(TSM.db.global.savedSearches, data.index)
|
||||||
-- TSM:Printf('Removed '%s' from your recent searches.', data.searchInfo.name)
|
-- TSM:Printf('Removed '%s' from your recent searches.', data.searchInfo.name)
|
||||||
private.UpdateSTData()
|
-- private.UpdateSTData()
|
||||||
else
|
else
|
||||||
tinsert(aux_favorite_searches, data.search)
|
tinsert(aux_favorite_searches, data.search)
|
||||||
-- data.searchInfo.isFavorite = true
|
-- data.searchInfo.isFavorite = true
|
||||||
@@ -757,7 +776,7 @@ function public.on_load()
|
|||||||
OnEnter = function(st, data, self)
|
OnEnter = function(st, data, self)
|
||||||
if not data then return end
|
if not data then return end
|
||||||
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
GameTooltip_SetDefaultAnchor(GameTooltip, UIParent)
|
||||||
GameTooltip:AddLine(gsub(data.name, ';', '\n'), 255/255, 254/255, 250/255)
|
GameTooltip:AddLine(gsub(Aux.test.prettify_search(data.search.filter_string), ';', '\n'), 255/255, 254/255, 250/255)
|
||||||
GameTooltip:Show()
|
GameTooltip:Show()
|
||||||
-- GameTooltip:SetOwner(self, 'ANCHOR_RIGHT')
|
-- GameTooltip:SetOwner(self, 'ANCHOR_RIGHT')
|
||||||
-- GameTooltip:AddLine(data.search, 1, 1, 1, true)
|
-- GameTooltip:AddLine(data.search, 1, 1, 1, true)
|
||||||
@@ -787,6 +806,7 @@ function public.on_load()
|
|||||||
private.recent_searches_listing:SetColInfo({{name='Recent Searches', width=1}})
|
private.recent_searches_listing:SetColInfo({{name='Recent Searches', width=1}})
|
||||||
private.recent_searches_listing:SetHandler('OnClick', handlers.OnClick)
|
private.recent_searches_listing:SetHandler('OnClick', handlers.OnClick)
|
||||||
private.recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
private.recent_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
||||||
|
private.recent_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
|
||||||
|
|
||||||
Aux.gui.vertical_line(AuxFilterSearchFrameSaved, 379)
|
Aux.gui.vertical_line(AuxFilterSearchFrameSaved, 379)
|
||||||
|
|
||||||
@@ -794,6 +814,7 @@ function public.on_load()
|
|||||||
private.favorite_searches_listing:SetColInfo({{name='Favorite Searches', width=1}})
|
private.favorite_searches_listing:SetColInfo({{name='Favorite Searches', width=1}})
|
||||||
private.favorite_searches_listing:SetHandler('OnClick', handlers.OnClick)
|
private.favorite_searches_listing:SetHandler('OnClick', handlers.OnClick)
|
||||||
private.favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
private.favorite_searches_listing:SetHandler('OnEnter', handlers.OnEnter)
|
||||||
|
private.favorite_searches_listing:SetHandler('OnLeave', handlers.OnLeave)
|
||||||
|
|
||||||
|
|
||||||
private.update_tab(SAVED)
|
private.update_tab(SAVED)
|
||||||
@@ -831,13 +852,12 @@ function public.start_search()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
tinsert(aux_recent_searches, 1, private.search_box:GetText())
|
tinsert(aux_recent_searches, 1, { filter_string = private.search_box:GetText() })
|
||||||
while getn(aux_recent_searches) > 50 do
|
while getn(aux_recent_searches) > 50 do
|
||||||
tremove(aux_recent_searches)
|
tremove(aux_recent_searches)
|
||||||
end
|
end
|
||||||
private.update_search_listings()
|
private.update_search_listings()
|
||||||
|
|
||||||
private.clear_selection()
|
|
||||||
private.search_button:Hide()
|
private.search_button:Hide()
|
||||||
private.stop_button:Show()
|
private.stop_button:Show()
|
||||||
|
|
||||||
@@ -847,7 +867,7 @@ function public.start_search()
|
|||||||
private.status_bar:set_text('Scanning auctions...')
|
private.status_bar:set_text('Scanning auctions...')
|
||||||
|
|
||||||
local scanned_records = {}
|
local scanned_records = {}
|
||||||
private.testlisting:SetDatabase(scanned_records)
|
private.results_listing:SetDatabase(scanned_records)
|
||||||
|
|
||||||
Aux.scan.start{
|
Aux.scan.start{
|
||||||
queries = queries,
|
queries = queries,
|
||||||
@@ -856,7 +876,7 @@ function public.start_search()
|
|||||||
private.status_bar:set_text(format('Scanning (Page %d / %d)', page + 1, total_pages))
|
private.status_bar:set_text(format('Scanning (Page %d / %d)', page + 1, total_pages))
|
||||||
end,
|
end,
|
||||||
on_page_complete = function()
|
on_page_complete = function()
|
||||||
private.testlisting:SetDatabase()
|
private.results_listing:SetDatabase()
|
||||||
end,
|
end,
|
||||||
on_start_query = function(query_index)
|
on_start_query = function(query_index)
|
||||||
private.status_bar:update_status(0, 100 * (query_index - 1) / getn(queries)) -- TODO
|
private.status_bar:update_status(0, 100 * (query_index - 1) / getn(queries)) -- TODO
|
||||||
@@ -867,7 +887,7 @@ function public.start_search()
|
|||||||
tinsert(scanned_records, auction_info)
|
tinsert(scanned_records, auction_info)
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
private.testlisting:SetDatabase()
|
private.results_listing:SetDatabase()
|
||||||
private.status_bar:update_status(100, 100)
|
private.status_bar:update_status(100, 100)
|
||||||
private.status_bar:set_text('Done Scanning')
|
private.status_bar:set_text('Done Scanning')
|
||||||
|
|
||||||
@@ -875,7 +895,7 @@ function public.start_search()
|
|||||||
private.search_button:Show()
|
private.search_button:Show()
|
||||||
end,
|
end,
|
||||||
on_abort = function()
|
on_abort = function()
|
||||||
private.testlisting:SetDatabase()
|
private.results_listing:SetDatabase()
|
||||||
private.status_bar:update_status(100, 100)
|
private.status_bar:update_status(100, 100)
|
||||||
private.status_bar:set_text('Done Scanning')
|
private.status_bar:set_text('Done Scanning')
|
||||||
private.stop_button:Hide()
|
private.stop_button:Hide()
|
||||||
@@ -885,84 +905,80 @@ function public.start_search()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
function private.process_request(entry, express_mode, buyout_mode)
|
do
|
||||||
|
local found_index
|
||||||
|
|
||||||
if entry.gone or (buyout_mode and not entry.buyout_price) or (express_mode and not buyout_mode and entry.high_bidder) or entry.owner == UnitName('player') then
|
function private.find_auction(entry, express_mode, buyout_mode)
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
PlaySound('igMainMenuOptionCheckBoxOn')
|
if entry.gone or (buyout_mode and not entry.buyout_price) or (express_mode and not buyout_mode and entry.high_bidder) or entry.owner == UnitName('player') then
|
||||||
|
return
|
||||||
local function test(index)
|
end
|
||||||
local auction_record = Aux.info.auction(index)
|
|
||||||
return auction_record.signature == entry.signature and auction_record.bid_price == entry.bid_price and auction_record.duration == entry.duration and auction_record.owner ~= UnitName('player')
|
local function test(index)
|
||||||
end
|
return Aux.info.auction(index).search_signature == entry.search_signature
|
||||||
|
end
|
||||||
local function remove_entry()
|
|
||||||
entry.gone = true
|
local function remove_entry()
|
||||||
private.clear_selection()
|
private.results_listing:RemoveSelectedRecord()
|
||||||
end
|
entry.gone = true
|
||||||
|
end
|
||||||
if express_mode then
|
|
||||||
Aux.scan_util.find(test, entry.query, entry.page, private.status_bar, remove_entry, function(index)
|
if express_mode then
|
||||||
if not entry.gone then
|
Aux.scan_util.find(test, entry.query, entry.page, private.status_bar, remove_entry, function(index)
|
||||||
Aux.place_bid('list', index, buyout_mode and entry.buyout_price or entry.bid_price, remove_entry)
|
if not entry.gone then
|
||||||
end
|
Aux.place_bid('list', index, buyout_mode and entry.buyout_price or entry.bid_price, remove_entry)
|
||||||
end)
|
end
|
||||||
else
|
end)
|
||||||
private.select_auction(entry)
|
else
|
||||||
|
found_index = nil
|
||||||
Aux.scan_util.find(test, entry.query, entry.page, private.status_bar, remove_entry, function(index)
|
|
||||||
|
Aux.scan_util.find(test, entry.query, entry.page, private.status_bar, remove_entry, function(index)
|
||||||
if not entry.high_bidder then
|
|
||||||
private.bid_button:SetScript('OnClick', function()
|
found_index = index
|
||||||
if test(index) and not entry.gone then
|
|
||||||
Aux.place_bid('list', index, entry.bid_price, remove_entry)
|
if not entry.high_bidder then
|
||||||
end
|
private.bid_button:SetScript('OnClick', function()
|
||||||
private.clear_selection()
|
if test(index) and not entry.gone then
|
||||||
end)
|
Aux.place_bid('list', index, entry.bid_price, remove_entry)
|
||||||
private.bid_button:Enable()
|
end
|
||||||
end
|
end)
|
||||||
|
private.bid_button:Enable()
|
||||||
if entry.buyout_price then
|
end
|
||||||
RESULTS.buyout_button:SetScript('OnClick', function()
|
|
||||||
if test(index) and not entry.gone then
|
if entry.buyout_price > 0 then
|
||||||
Aux.place_bid('list', index, entry.buyout_price, remove_entry)
|
RESULTS.buyout_button:SetScript('OnClick', function()
|
||||||
end
|
if test(index) and not entry.gone then
|
||||||
private.clear_selection()
|
Aux.place_bid('list', index, entry.buyout_price, remove_entry)
|
||||||
end)
|
end
|
||||||
RESULTS.buyout_button:Enable()
|
end)
|
||||||
end
|
RESULTS.buyout_button:Enable()
|
||||||
end)
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
function private.on_selection_changed(rt, datum)
|
|
||||||
|
|
||||||
if not datum then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local entry = datum.record
|
|
||||||
|
|
||||||
if IsControlKeyDown() then
|
function public.on_update()
|
||||||
DressUpItemLink(entry.hyperlink)
|
-- if not (RESULTS.buyout_button:IsEnabled() or private.bid_button:IsEnabled()) then
|
||||||
elseif IsShiftKeyDown() then
|
-- return
|
||||||
if ChatFrameEditBox:IsVisible() then
|
-- end
|
||||||
ChatFrameEditBox:Insert(entry.hyperlink)
|
|
||||||
|
local selection = private.results_listing:GetSelection()
|
||||||
|
if not selection then
|
||||||
|
RESULTS.buyout_button:Disable()
|
||||||
|
private.bid_button:Disable()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if found_index and selection.record.search_signature ~= Aux.info.auction(found_index).search_signature then
|
||||||
|
RESULTS.buyout_button:Disable()
|
||||||
|
private.bid_button:Disable()
|
||||||
|
private.find_auction(selection.record)
|
||||||
end
|
end
|
||||||
else
|
|
||||||
local express_mode = IsAltKeyDown()
|
|
||||||
local buyout_mode = express_mode and arg1 == 'LeftButton'
|
|
||||||
private.process_request(entry, express_mode, buyout_mode)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--function private.create_auction_record(auction_info)
|
--function private.create_auction_record(auction_info)
|
||||||
--
|
--
|
||||||
-- local buyout_price = auction_info.buyout_price > 0 and auction_info.buyout_price or nil
|
|
||||||
-- local unit_buyout_price = buyout_price and auction_info.buyout_price / auction_info.aux_quantity
|
|
||||||
-- local status
|
|
||||||
-- if auction_info.current_bid == 0 then
|
-- if auction_info.current_bid == 0 then
|
||||||
-- status = 'No Bid'
|
-- status = 'No Bid'
|
||||||
-- elseif auction_info.high_bidder then
|
-- elseif auction_info.high_bidder then
|
||||||
@@ -971,37 +987,6 @@ end
|
|||||||
-- status = 'Other Bidder'
|
-- status = 'Other Bidder'
|
||||||
-- end
|
-- end
|
||||||
--
|
--
|
||||||
-- return {
|
|
||||||
-- query = auction_info.query,
|
|
||||||
-- page = auction_info.page,
|
|
||||||
--
|
|
||||||
-- item_id = auction_info.item_id,
|
|
||||||
-- suffix_id = auction_info.suffix_id,
|
|
||||||
-- unique_id = auction_info.unique_id,
|
|
||||||
-- enchant_id = auction_info.enchant_id,
|
|
||||||
--
|
|
||||||
-- item_key = auction_info.item_key,
|
|
||||||
-- signature = auction_info.signature,
|
|
||||||
--
|
|
||||||
-- name = auction_info.name,
|
|
||||||
-- level = auction_info.level,
|
|
||||||
-- tooltip = auction_info.tooltip,
|
|
||||||
-- aux_quantity = auction_info.aux_quantity,
|
|
||||||
-- buyout_price = buyout_price,
|
|
||||||
-- unit_buyout_price = unit_buyout_price,
|
|
||||||
-- quality = auction_info.quality,
|
|
||||||
-- hyperlink = auction_info.hyperlink,
|
|
||||||
-- itemstring = auction_info.itemstring,
|
|
||||||
-- bid_price = auction_info.bid_price,
|
|
||||||
-- unit_bid_price = auction_info.bid_price / auction_info.aux_quantity,
|
|
||||||
-- owner = auction_info.owner,
|
|
||||||
-- duration = auction_info.duration,
|
|
||||||
-- usable = auction_info.usable,
|
|
||||||
-- high_bidder = auction_info.high_bidder,
|
|
||||||
-- status = status,
|
|
||||||
--
|
|
||||||
-- EnhTooltip_info = auction_info.EnhTooltip_info,
|
|
||||||
-- }
|
|
||||||
--end
|
--end
|
||||||
|
|
||||||
function private.initialize_class_dropdown()
|
function private.initialize_class_dropdown()
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
|
||||||
|
|
||||||
<Script file="filter_search_frame.lua"/>
|
<Script file="search_frame.lua"/>
|
||||||
|
|
||||||
|
<Frame name="AuxControlFrame">
|
||||||
|
<Scripts>
|
||||||
|
<OnUpdate>
|
||||||
|
Aux.search_frame.on_update()
|
||||||
|
</OnUpdate>
|
||||||
|
</Scripts>
|
||||||
|
</Frame>
|
||||||
|
|
||||||
<Frame name="AuxFilterSearchFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
<Frame name="AuxFilterSearchFrame" hidden="true" parent="AuxFrame" setAllPoints="true">
|
||||||
<Frames>
|
<Frames>
|
||||||
@@ -28,27 +36,26 @@
|
|||||||
<Frame name="$parentListing" hidden="true">
|
<Frame name="$parentListing" hidden="true">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="5"/></Offset></Anchor>
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="-8" y="5"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOM"><Offset><AbsDimension x="-8" y="-15"/></Offset></Anchor>
|
<!--<Anchor point="BOTTOM"><Offset><AbsDimension x="-8" y="-15"/></Offset></Anchor>-->
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame name="$parentSaved" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentSaved" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="985" y="278"/></Size>
|
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="AuxFrameContent"></Anchor>
|
<Anchor point="TOPLEFT" relativeTo="AuxFrameContent"></Anchor>
|
||||||
<Anchor point="BOTTOMRIGHT" relativeTo="AuxFrameContent"></Anchor>
|
<Anchor point="BOTTOMRIGHT" relativeTo="AuxFrameContent"></Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Frame name="$parentFavorite" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentFavorite" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="373" y="270"/></Size>
|
<Size><AbsDimension x="373"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT"><Offset><AbsDimension x="4" y="-4"/></Offset></Anchor>
|
<Anchor point="TOPLEFT"><Offset><AbsDimension x="4" y="-4"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="4" y="4"/></Offset></Anchor>
|
<Anchor point="BOTTOMLEFT"><Offset><AbsDimension x="4" y="4"/></Offset></Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame name="$parentRecent" inherits="AuxFrameBoxTemplate">
|
<Frame name="$parentRecent" inherits="AuxFrameBoxTemplate">
|
||||||
<Size><AbsDimension x="373" y="270"/></Size>
|
<Size><AbsDimension x="373"/></Size>
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="-4" y="-4"/></Offset></Anchor>
|
<Anchor point="TOPRIGHT"><Offset><AbsDimension x="-4" y="-4"/></Offset></Anchor>
|
||||||
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-4" y="4"/></Offset></Anchor>
|
<Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-4" y="4"/></Offset></Anchor>
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
SLASH_AUX1 = '/aux'
|
SLASH_AUX1 = '/aux'
|
||||||
function SlashCmdList.AUX(parameter)
|
function SlashCmdList.AUX(parameter)
|
||||||
if parameter == 'scan' then
|
if parameter == 'clear snapshot' then
|
||||||
Aux.history_frame.start_scan()
|
|
||||||
elseif parameter == 'clear snapshot' then
|
|
||||||
Aux.persistence.load_dataset().snapshot = {}
|
Aux.persistence.load_dataset().snapshot = {}
|
||||||
Aux.log('Snapshot cleared.')
|
Aux.log('Snapshot cleared.')
|
||||||
elseif parameter == 'clear history' then
|
elseif parameter == 'clear history' then
|
||||||
|
|||||||
+26
-46
@@ -22,7 +22,7 @@ function m:complete()
|
|||||||
|
|
||||||
local filter_string = this:GetText()
|
local filter_string = this:GetText()
|
||||||
|
|
||||||
local completed_filter_string = ({strfind(filter_string, '([^;]*)/[^/]*$')})[3]
|
local completed_filter_string = ({strfind(filter_string, '([^;]*)/[^/;]*$')})[3]
|
||||||
local current_filter = completed_filter_string and Aux.scan_util.filter_from_string(completed_filter_string)
|
local current_filter = completed_filter_string and Aux.scan_util.filter_from_string(completed_filter_string)
|
||||||
|
|
||||||
local options = {}
|
local options = {}
|
||||||
@@ -39,6 +39,7 @@ function m:complete()
|
|||||||
and not current_filter.slot
|
and not current_filter.slot
|
||||||
and not current_filter.quality
|
and not current_filter.quality
|
||||||
and not current_filter.usable
|
and not current_filter.usable
|
||||||
|
and not current_filter.exact
|
||||||
then
|
then
|
||||||
tinsert(options, 'exact')
|
tinsert(options, 'exact')
|
||||||
end
|
end
|
||||||
@@ -83,14 +84,14 @@ function m:complete()
|
|||||||
|
|
||||||
-- item names
|
-- item names
|
||||||
if not completed_filter_string then
|
if not completed_filter_string then
|
||||||
local item_names = {}
|
local item_filters = {}
|
||||||
for key, value in Aux.static.auctionable_items do
|
for key, value in Aux.static.auctionable_items do
|
||||||
if type(key) == 'number' then
|
if type(key) == 'number' then
|
||||||
tinsert(item_names, value.name)
|
tinsert(item_filters, value.name..'/exact')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
sort(item_names)
|
sort(item_filters)
|
||||||
for _, item_name in ipairs(item_names) do
|
for _, item_name in ipairs(item_filters) do
|
||||||
tinsert(options, item_name)
|
tinsert(options, item_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -99,7 +100,7 @@ function m:complete()
|
|||||||
current_modifier = current_modifier or ''
|
current_modifier = current_modifier or ''
|
||||||
|
|
||||||
for _, option in ipairs(options) do
|
for _, option in ipairs(options) do
|
||||||
if strfind(strupper(option), '^'..strupper(current_modifier)) then
|
if string.sub(strupper(option), 1, strlen(current_modifier)) == strupper(current_modifier) then
|
||||||
this:SetText(string.sub(filter_string, 1, start_index - 1)..option)
|
this:SetText(string.sub(filter_string, 1, start_index - 1)..option)
|
||||||
this:HighlightText(strlen(filter_string), -1)
|
this:HighlightText(strlen(filter_string), -1)
|
||||||
return
|
return
|
||||||
@@ -108,27 +109,27 @@ function m:complete()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--StaticPopupDialogs["TSM_SHOPPING_SAVED_RENAME_POPUP"] = {
|
--StaticPopupDialogs["CANCEL_AUCTION"] = {
|
||||||
-- text = L["Type in the new name for this saved search and hit the 'Save' button."],
|
-- text = TEXT(CANCEL_AUCTION_CONFIRMATION),
|
||||||
-- button1 = SAVE,
|
-- button1 = TEXT(ACCEPT),
|
||||||
-- OnShow = function(self)
|
-- button2 = TEXT(CANCEL),
|
||||||
-- local renameInfo = private.popupInfo.renameInfo
|
-- OnAccept = function()
|
||||||
-- self.editBox:SetText(renameInfo.name)
|
-- CancelAuction(GetSelectedAuctionItem("owner"));
|
||||||
-- self.editBox:HighlightText()
|
|
||||||
-- self.editBox:SetFocus()
|
|
||||||
-- self.editBox:SetWidth(self.editBox:GetWidth() * 2)
|
|
||||||
-- self.editBox:SetScript("OnEscapePressed", function() StaticPopup_Hide("TSM_SHOPPING_SAVED_RENAME_POPUP") end)
|
|
||||||
-- self.editBox:SetScript("OnEnterPressed", function() self.button1:Click() end)
|
|
||||||
-- end,
|
-- end,
|
||||||
-- OnAccept = function(self)
|
-- OnShow = function()
|
||||||
-- private.popupInfo.renameInfo.name = self.editBox:GetText()
|
-- MoneyFrame_Update(this:GetName().."MoneyFrame", AuctionFrameAuctions.cancelPrice);
|
||||||
-- private.UpdateSTData()
|
-- if ( AuctionFrameAuctions.cancelPrice > 0 ) then
|
||||||
|
-- getglobal(this:GetName().."Text"):SetText(CANCEL_AUCTION_CONFIRMATION_MONEY);
|
||||||
|
-- else
|
||||||
|
-- getglobal(this:GetName().."Text"):SetText(CANCEL_AUCTION_CONFIRMATION);
|
||||||
|
-- end
|
||||||
|
--
|
||||||
-- end,
|
-- end,
|
||||||
-- hasEditBox = true,
|
-- hasMoneyFrame = 1,
|
||||||
|
-- showAlert = 1,
|
||||||
-- timeout = 0,
|
-- timeout = 0,
|
||||||
-- hideOnEscape = true,
|
--};
|
||||||
-- preferredIndex = 3,
|
|
||||||
--}
|
|
||||||
--StaticPopupDialogs["TSM_SHOPPING_SAVED_EXPORT_POPUP"] = {
|
--StaticPopupDialogs["TSM_SHOPPING_SAVED_EXPORT_POPUP"] = {
|
||||||
-- text = L["Press Ctrl-C to copy this saved search."],
|
-- text = L["Press Ctrl-C to copy this saved search."],
|
||||||
-- button1 = OKAY,
|
-- button1 = OKAY,
|
||||||
@@ -179,25 +180,4 @@ end
|
|||||||
-- timeout = 0,
|
-- timeout = 0,
|
||||||
-- hideOnEscape = true,
|
-- hideOnEscape = true,
|
||||||
-- preferredIndex = 3,
|
-- preferredIndex = 3,
|
||||||
--}
|
--}
|
||||||
|
|
||||||
--StaticPopupDialogs["CANCEL_AUCTION"] = {
|
|
||||||
-- text = TEXT(CANCEL_AUCTION_CONFIRMATION),
|
|
||||||
-- button1 = TEXT(ACCEPT),
|
|
||||||
-- button2 = TEXT(CANCEL),
|
|
||||||
-- OnAccept = function()
|
|
||||||
-- CancelAuction(GetSelectedAuctionItem("owner"));
|
|
||||||
-- end,
|
|
||||||
-- OnShow = function()
|
|
||||||
-- MoneyFrame_Update(this:GetName().."MoneyFrame", AuctionFrameAuctions.cancelPrice);
|
|
||||||
-- if ( AuctionFrameAuctions.cancelPrice > 0 ) then
|
|
||||||
-- getglobal(this:GetName().."Text"):SetText(CANCEL_AUCTION_CONFIRMATION_MONEY);
|
|
||||||
-- else
|
|
||||||
-- getglobal(this:GetName().."Text"):SetText(CANCEL_AUCTION_CONFIRMATION);
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- end,
|
|
||||||
-- hasMoneyFrame = 1,
|
|
||||||
-- showAlert = 1,
|
|
||||||
-- timeout = 0,
|
|
||||||
--};
|
|
||||||
Reference in New Issue
Block a user