fixed some bugs with auctionator messages and prevented auctionator from searching when in other tabs

This commit is contained in:
Manuel Simon Hirsig
2015-09-07 02:43:07 +02:00
parent 2d1a6f6ac3
commit e92fe865da
+10 -13
View File
@@ -50,8 +50,6 @@ local val2gsc, priceToString, ItemType2AuctionClass, SubType2AuctionSubclass
function Auctionator_EventHandler() function Auctionator_EventHandler()
-- log(event)
if event == "VARIABLES_LOADED" then Auctionator_OnLoad() end if event == "VARIABLES_LOADED" then Auctionator_OnLoad() end
if event == "ADDON_LOADED" then Auctionator_OnAddonLoaded() end if event == "ADDON_LOADED" then Auctionator_OnAddonLoaded() end
if event == "AUCTION_ITEM_LIST_UPDATE" then Auctionator_OnAuctionUpdate() end if event == "AUCTION_ITEM_LIST_UPDATE" then Auctionator_OnAuctionUpdate() end
@@ -117,6 +115,7 @@ function Auctionator_AuctionFrameTab_OnClick(index)
index = this:GetID() index = this:GetID()
end end
Auctionator_Scan_Abort()
Auctionator_Sell_Template:Hide() Auctionator_Sell_Template:Hide()
if index == 3 then if index == 3 then
@@ -126,7 +125,6 @@ function Auctionator_AuctionFrameTab_OnClick(index)
if index ~= AUCTIONATOR_TAB_INDEX then if index ~= AUCTIONATOR_TAB_INDEX then
Auctionator_Orig_AuctionFrameTab_OnClick(index) Auctionator_Orig_AuctionFrameTab_OnClick(index)
lastItemPosted = nil lastItemPosted = nil
elseif index == AUCTIONATOR_TAB_INDEX then elseif index == AUCTIONATOR_TAB_INDEX then
AuctionFrameTab_OnClick(3) AuctionFrameTab_OnClick(3)
@@ -134,12 +132,10 @@ function Auctionator_AuctionFrameTab_OnClick(index)
Auctionator_HideElems(auctionsTabElements) Auctionator_HideElems(auctionsTabElements)
Auctionator_HideElems(recommendationElements)
Auctionator_Sell_Template:Show() Auctionator_Sell_Template:Show()
AuctionFrame:EnableMouse(false) AuctionFrame:EnableMouse(false)
Auctionator_CalcBaseData() Auctionator_OnNewAuctionUpdate()
end end
end end
@@ -158,9 +154,7 @@ function Auctionator_ContainerFrameItemButton_OnClick(button)
ClearCursor() ClearCursor()
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= AUCTIONATOR_TAB_INDEX then if PanelTemplates_GetSelectedTab(AuctionFrame) ~= AUCTIONATOR_TAB_INDEX then
AuctionFrameTab_OnClick(AUCTIONATOR_TAB_INDEX) AuctionFrameTab_OnClick(AUCTIONATOR_TAB_INDEX)
end end
PickupContainerItem(this:GetParent():GetID(), this:GetID()) PickupContainerItem(this:GetParent():GetID(), this:GetID())
@@ -168,7 +162,6 @@ function Auctionator_ContainerFrameItemButton_OnClick(button)
end end
----------------------------------------- -----------------------------------------
function Auctionator_AuctionFrameAuctions_Update() function Auctionator_AuctionFrameAuctions_Update()
@@ -323,7 +316,7 @@ end
function Auctionator_Scan_Abort() function Auctionator_Scan_Abort()
if currentQuery.onAbort then if currentQuery and currentQuery.onAbort then
currentQuery.onAbort(); currentQuery.onAbort();
end end
@@ -409,6 +402,8 @@ end
function Auctionator_Scan_Start(query) function Auctionator_Scan_Start(query)
Auctionator_SetMessage("Scanning")
if processingState ~= KM_NULL_STATE then if processingState ~= KM_NULL_STATE then
Auctionator_Scan_Abort() Auctionator_Scan_Abort()
end end
@@ -423,8 +418,6 @@ end
function Auctionator_SetMessage(msg) function Auctionator_SetMessage(msg)
Auctionator_HideElems(recommendationElements) Auctionator_HideElems(recommendationElements)
Auctionator_HideElems(overallElements)
AuctionatorMessage:SetText(msg) AuctionatorMessage:SetText(msg)
AuctionatorMessage:Show() AuctionatorMessage:Show()
end end
@@ -532,8 +525,8 @@ function Auctionator_UpdateRecommendation()
local newStartPrice = calcNewPrice(round(newBuyoutPrice * 0.95)) local newStartPrice = calcNewPrice(round(newBuyoutPrice * 0.95))
Auctionator_ShowElems(recommendationElements)
AuctionatorMessage:Hide() AuctionatorMessage:Hide()
Auctionator_ShowElems(recommendationElements)
Auctionator_Recommend_Text:SetText("Recommended Buyout Price") Auctionator_Recommend_Text:SetText("Recommended Buyout Price")
Auctionator_RecommendPerStack_Text:SetText("for your stack of "..currentAuctionItemStackSize) Auctionator_RecommendPerStack_Text:SetText("for your stack of "..currentAuctionItemStackSize)
@@ -621,6 +614,10 @@ end
function Auctionator_OnNewAuctionUpdate() function Auctionator_OnNewAuctionUpdate()
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= AUCTIONATOR_TAB_INDEX then
return
end
if processingState ~= KM_NULL_STATE then if processingState ~= KM_NULL_STATE then
Auctionator_Scan_Abort() Auctionator_Scan_Abort()
end end