small bugfixes
This commit is contained in:
+7
-7
@@ -2,10 +2,10 @@
|
|||||||
## Title: Aux
|
## Title: Aux
|
||||||
## Notes: A lightweight addon designed to help manage auctions
|
## Notes: A lightweight addon designed to help manage auctions
|
||||||
## SavedVariablesPerCharacter: AUCTIONATOR_ENABLE_ALT, AUCTIONATOR_OPEN_FIRST, AUCTIONATOR_INSTANT_BUYOUT
|
## SavedVariablesPerCharacter: AUCTIONATOR_ENABLE_ALT, AUCTIONATOR_OPEN_FIRST, AUCTIONATOR_INSTANT_BUYOUT
|
||||||
## SavedVariables: auxEntries
|
## SavedVariables: auxSellEntries
|
||||||
Core.xml
|
core.xml
|
||||||
Scan.xml
|
scan.xml
|
||||||
Sell.xml
|
sell.xml
|
||||||
Buy.xml
|
buy.xml
|
||||||
Options.xml
|
options.xml
|
||||||
About.xml
|
about.xml
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
auxEntries = {} -- persisted
|
auxSellEntries = {} -- persisted
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ end
|
|||||||
|
|
||||||
function Aux_SelectAuxEntry()
|
function Aux_SelectAuxEntry()
|
||||||
|
|
||||||
if not currentAuctionItemName or not auxEntries[currentAuctionItemName] then
|
if not currentAuctionItemName or not auxSellEntries[currentAuctionItemName] then
|
||||||
selectedAuxEntry = nil
|
selectedAuxEntry = nil
|
||||||
else
|
else
|
||||||
local bestPrice = {} -- a table with one entry per stacksize that is the cheapest auction for that particular stacksize
|
local bestPrice = {} -- a table with one entry per stacksize that is the cheapest auction for that particular stacksize
|
||||||
@@ -132,7 +132,7 @@ function Aux_SelectAuxEntry()
|
|||||||
|
|
||||||
----- find the best price per stacksize and overall -----
|
----- find the best price per stacksize and overall -----
|
||||||
|
|
||||||
for _,auxEntry in ipairs(auxEntries[currentAuctionItemName]) do
|
for _,auxEntry in ipairs(auxSellEntries[currentAuctionItemName]) do
|
||||||
if not bestPrice[auxEntry.stackSize] or bestPrice[auxEntry.stackSize].itemPrice >= auxEntry.itemPrice then
|
if not bestPrice[auxEntry.stackSize] or bestPrice[auxEntry.stackSize].itemPrice >= auxEntry.itemPrice then
|
||||||
bestPrice[auxEntry.stackSize] = auxEntry
|
bestPrice[auxEntry.stackSize] = auxEntry
|
||||||
end
|
end
|
||||||
@@ -194,14 +194,14 @@ function Aux_UpdateRecommendation()
|
|||||||
MoneyInputFrame_SetCopper(BuyoutPrice, newBuyoutPrice)
|
MoneyInputFrame_SetCopper(BuyoutPrice, newBuyoutPrice)
|
||||||
MoneyInputFrame_SetCopper(StartPrice, newStartPrice)
|
MoneyInputFrame_SetCopper(StartPrice, newStartPrice)
|
||||||
|
|
||||||
if selectedAuxEntry.stackSize == auxEntries[currentAuctionItemName][1].stackSize and selectedAuxEntry.buyoutPrice == auxEntries[currentAuctionItemName][1].buyoutPrice then
|
if selectedAuxEntry.stackSize == auxSellEntries[currentAuctionItemName][1].stackSize and selectedAuxEntry.buyoutPrice == auxSellEntries[currentAuctionItemName][1].buyoutPrice then
|
||||||
Aux_Recommend_Basis_Text:SetText("(based on cheapest)")
|
Aux_Recommend_Basis_Text:SetText("(based on cheapest)")
|
||||||
elseif bestPriceOurStackSize and selectedAuxEntry.stackSize == bestPriceOurStackSize.stackSize and selectedAuxEntry.buyoutPrice == bestPriceOurStackSize.buyoutPrice then
|
elseif bestPriceOurStackSize and selectedAuxEntry.stackSize == bestPriceOurStackSize.stackSize and selectedAuxEntry.buyoutPrice == bestPriceOurStackSize.buyoutPrice then
|
||||||
Aux_Recommend_Basis_Text:SetText("(based on cheapest stack of the same size)")
|
Aux_Recommend_Basis_Text:SetText("(based on cheapest stack of the same size)")
|
||||||
else
|
else
|
||||||
Aux_Recommend_Basis_Text:SetText("(based on auction selected below)")
|
Aux_Recommend_Basis_Text:SetText("(based on auction selected below)")
|
||||||
end
|
end
|
||||||
elseif auxEntries[currentAuctionItemName] then
|
elseif auxSellEntries[currentAuctionItemName] then
|
||||||
Aux_SetMessage("No auctions were found for \n\n"..currentAuctionItemName)
|
Aux_SetMessage("No auctions were found for \n\n"..currentAuctionItemName)
|
||||||
else
|
else
|
||||||
Aux_HideElems(Aux.tabs.sell.shownElements)
|
Aux_HideElems(Aux.tabs.sell.shownElements)
|
||||||
@@ -225,7 +225,7 @@ function Aux_OnNewAuctionUpdate()
|
|||||||
|
|
||||||
currentAuctionItemName, currentAuctionItemTexture, currentAuctionItemStackSize = GetAuctionSellItemInfo()
|
currentAuctionItemName, currentAuctionItemTexture, currentAuctionItemStackSize = GetAuctionSellItemInfo()
|
||||||
|
|
||||||
if currentAuctionItemName and not auxEntries[currentAuctionItemName] then
|
if currentAuctionItemName and not auxSellEntries[currentAuctionItemName] then
|
||||||
Aux_RefreshEntries()
|
Aux_RefreshEntries()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ end
|
|||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
function Aux_RefreshEntries()
|
function Aux_RefreshEntries()
|
||||||
auxEntries[currentAuctionItemName] = nil
|
auxSellEntries[currentAuctionItemName] = nil
|
||||||
selectedAuxEntry = nil
|
selectedAuxEntry = nil
|
||||||
|
|
||||||
local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = GetItemInfo(currentAuctionItemName)
|
local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = GetItemInfo(currentAuctionItemName)
|
||||||
@@ -263,10 +263,10 @@ end
|
|||||||
function Aux_ScrollbarUpdate()
|
function Aux_ScrollbarUpdate()
|
||||||
|
|
||||||
local numrows
|
local numrows
|
||||||
if not currentAuctionItemName or not auxEntries[currentAuctionItemName] then
|
if not currentAuctionItemName or not auxSellEntries[currentAuctionItemName] then
|
||||||
numrows = 0
|
numrows = 0
|
||||||
else
|
else
|
||||||
numrows = getn(auxEntries[currentAuctionItemName])
|
numrows = getn(auxSellEntries[currentAuctionItemName])
|
||||||
end
|
end
|
||||||
|
|
||||||
FauxScrollFrame_Update(AuxScrollFrame, numrows, 12, 16);
|
FauxScrollFrame_Update(AuxScrollFrame, numrows, 12, 16);
|
||||||
@@ -284,9 +284,9 @@ function Aux_ScrollbarUpdate()
|
|||||||
|
|
||||||
lineEntry:SetID(dataOffset)
|
lineEntry:SetID(dataOffset)
|
||||||
|
|
||||||
if currentAuctionItemName and dataOffset <= numrows and auxEntries[currentAuctionItemName] then
|
if currentAuctionItemName and dataOffset <= numrows and auxSellEntries[currentAuctionItemName] then
|
||||||
|
|
||||||
local entry = auxEntries[currentAuctionItemName][dataOffset]
|
local entry = auxSellEntries[currentAuctionItemName][dataOffset]
|
||||||
|
|
||||||
local lineEntry_avail = getglobal("AuxSellEntry"..line.."_Availability")
|
local lineEntry_avail = getglobal("AuxSellEntry"..line.."_Availability")
|
||||||
local lineEntry_comm = getglobal("AuxSellEntry"..line.."_Comment")
|
local lineEntry_comm = getglobal("AuxSellEntry"..line.."_Comment")
|
||||||
@@ -331,7 +331,7 @@ end
|
|||||||
function AuxSellEntry_OnClick()
|
function AuxSellEntry_OnClick()
|
||||||
local entryIndex = this:GetID()
|
local entryIndex = this:GetID()
|
||||||
|
|
||||||
selectedAuxEntry = auxEntries[currentAuctionItemName][entryIndex]
|
selectedAuxEntry = auxSellEntries[currentAuctionItemName][entryIndex]
|
||||||
|
|
||||||
Aux_UpdateRecommendation()
|
Aux_UpdateRecommendation()
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ end
|
|||||||
|
|
||||||
function processScanResults(rawData, auctionItemName)
|
function processScanResults(rawData, auctionItemName)
|
||||||
|
|
||||||
auxEntries[auctionItemName] = {}
|
auxSellEntries[auctionItemName] = {}
|
||||||
|
|
||||||
----- Condense the scan rawData into a table that has only a single entry per stacksize/price combo
|
----- Condense the scan rawData into a table that has only a single entry per stacksize/price combo
|
||||||
|
|
||||||
@@ -394,11 +394,11 @@ function processScanResults(rawData, auctionItemName)
|
|||||||
|
|
||||||
local n = 1
|
local n = 1
|
||||||
for _,condDatum in pairs(condData) do
|
for _,condDatum in pairs(condData) do
|
||||||
auxEntries[auctionItemName][n] = condDatum
|
auxSellEntries[auctionItemName][n] = condDatum
|
||||||
n = n + 1
|
n = n + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(auxEntries[auctionItemName], function(a,b) return a.itemPrice < b.itemPrice end)
|
table.sort(auxSellEntries[auctionItemName], function(a,b) return a.itemPrice < b.itemPrice end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user