fixed a bug with the selection of results and added a refresh button

This commit is contained in:
Manuel Simon Hirsig
2015-09-06 01:39:07 +02:00
parent fb8222f095
commit 892f66c476
2 changed files with 40 additions and 28 deletions
+27 -22
View File
@@ -32,6 +32,7 @@ local forceMsgAreaUpdate = false
local scandata local scandata
local sorteddata = {} local sorteddata = {}
sorteddata[""] = {}
local basedata local basedata
local currentAuctionItemName = "" local currentAuctionItemName = ""
@@ -493,7 +494,6 @@ end
----------------------------------------- -----------------------------------------
function Auctionator_UpdateRecommendation() function Auctionator_UpdateRecommendation()
--AuctionFrame:setTopLevel (false); --AuctionFrame:setTopLevel (false);
if basedata then if basedata then
local newBuyoutPrice = basedata.itemPrice * currentAuctionStackSize local newBuyoutPrice = basedata.itemPrice * currentAuctionStackSize
@@ -528,8 +528,6 @@ function Auctionator_UpdateRecommendation()
MoneyInputFrame_SetCopper (BuyoutPrice, newBuyoutPrice) MoneyInputFrame_SetCopper (BuyoutPrice, newBuyoutPrice)
MoneyInputFrame_SetCopper (StartPrice, newStartPrice) MoneyInputFrame_SetCopper (StartPrice, newStartPrice)
Auctionator_ScrollbarUpdate()
if basedata.stackSize == sorteddata[currentAuctionItemName][1].stackSize and basedata.buyoutPrice == sorteddata[currentAuctionItemName][1].buyoutPrice then if basedata.stackSize == sorteddata[currentAuctionItemName][1].stackSize and basedata.buyoutPrice == sorteddata[currentAuctionItemName][1].buyoutPrice then
Auctionator_Recommend_Basis_Text:SetText("(based on cheapest)") Auctionator_Recommend_Basis_Text:SetText("(based on cheapest)")
elseif bestPriceOurStackSize and basedata.stackSize == bestPriceOurStackSize.stackSize and basedata.buyoutPrice == bestPriceOurStackSize.buyoutPrice then elseif bestPriceOurStackSize and basedata.stackSize == bestPriceOurStackSize.stackSize and basedata.buyoutPrice == bestPriceOurStackSize.buyoutPrice then
@@ -538,6 +536,8 @@ function Auctionator_UpdateRecommendation()
Auctionator_Recommend_Basis_Text:SetText("(based on auction selected below)") Auctionator_Recommend_Basis_Text:SetText("(based on auction selected below)")
end end
end end
Auctionator_ScrollbarUpdate()
end end
@@ -607,30 +607,30 @@ function Auctionator_Idle(self, elapsed)
local auctionItemName, auctionTexture, auctionCount = GetAuctionSellItemInfo(); local auctionItemName, auctionTexture, auctionCount = GetAuctionSellItemInfo();
if auctionItemName == nil then if auctionItemName ~= currentAuctionItemName or forceMsgAreaUpdate then
currentAuctionItemName = ""
if auctionator_pending_message then
Auctionator_SetMessage(auctionator_pending_message)
auctionator_pending_message = nil
elseif auctionator_last_item_posted == nil then
Auctionator_SetMessage("Drag an item to the Auction Item area\n\nto see recommended pricing information");
end
processing_state = KM_NULL_STATE
else
currentAuctionItemName = auctionItemName currentAuctionItemName = auctionItemName
currentAuctionStackSize = auctionCount currentAuctionStackSize = auctionCount
currentAuctionTexture = auctionTexture currentAuctionTexture = auctionTexture
if forceMsgAreaUpdate or sorteddata[currentAuctionItemName] == nil then if auctionItemName == nil then
currentAuctionItemName = ""
if auctionator_pending_message then
Auctionator_SetMessage(auctionator_pending_message)
auctionator_pending_message = nil
elseif auctionator_last_item_posted == nil then
Auctionator_SetMessage("Drag an item to the Auction Item area\n\nto see recommended pricing information");
end
processing_state = KM_NULL_STATE
elseif forceMsgAreaUpdate or sorteddata[currentAuctionItemName] == nil then
forceMsgAreaUpdate = false forceMsgAreaUpdate = false
sorteddata[currentAuctionItemName] = {} sorteddata[currentAuctionItemName] = {}
Auctionator_ScrollbarUpdate()
-- Auctionator_RecommendPerItem_Price:Hide() -- Auctionator_RecommendPerItem_Price:Hide()
-- Auctionator_RecommendPerStack_Price:Hide() -- Auctionator_RecommendPerStack_Price:Hide()
@@ -652,6 +652,7 @@ function Auctionator_Idle(self, elapsed)
processing_state = KM_PREQUERY processing_state = KM_PREQUERY
scandata = {} scandata = {}
end end
Auctionator_CalcBaseData() Auctionator_CalcBaseData()
@@ -722,7 +723,7 @@ function Auctionator_ScrollbarUpdate()
for line = 1,12 do for line = 1,12 do
dataOffset = line + FauxScrollFrame_GetOffset (AuctionatorScrollFrame) dataOffset = line + FauxScrollFrame_GetOffset(AuctionatorScrollFrame)
local lineEntry = getglobal("AuctionatorEntry"..line) local lineEntry = getglobal("AuctionatorEntry"..line)
@@ -736,7 +737,7 @@ function Auctionator_ScrollbarUpdate()
local lineEntry_comm = getglobal("AuctionatorEntry"..line.."_Comment") local lineEntry_comm = getglobal("AuctionatorEntry"..line.."_Comment")
local lineEntry_stack = getglobal("AuctionatorEntry"..line.."_StackPrice") local lineEntry_stack = getglobal("AuctionatorEntry"..line.."_StackPrice")
if data.itemPrice == basedata.itemPrice and data.stackSize == basedata.stackSize then if basedata ~= nil and data.itemPrice == basedata.itemPrice and data.stackSize == basedata.stackSize then
lineEntry:LockHighlight() lineEntry:LockHighlight()
else else
lineEntry:UnlockHighlight() lineEntry:UnlockHighlight()
@@ -772,7 +773,7 @@ end
function Auctionator_EntryOnClick() function Auctionator_EntryOnClick()
local entryIndex = this:GetID() local entryIndex = this:GetID()
-- chatmsg (entryIndex) -- chatmsg(entryIndex)
basedata = sorteddata[currentAuctionItemName][entryIndex] basedata = sorteddata[currentAuctionItemName][entryIndex]
@@ -781,6 +782,10 @@ function Auctionator_EntryOnClick()
PlaySound("igMainMenuOptionCheckBoxOn") PlaySound("igMainMenuOptionCheckBoxOn")
end end
function Auctionator_RefreshButtonOnClick()
forceMsgAreaUpdate = true
end
----------------------------------------- -----------------------------------------
function AuctionatorMoneyFrame_OnLoad() function AuctionatorMoneyFrame_OnLoad()
+9 -2
View File
@@ -315,8 +315,6 @@
</Scripts> </Scripts>
</ScrollFrame> </ScrollFrame>
<Button name="AuctionatorEntry1" inherits="AuctionatorEntryTemplate"> <Button name="AuctionatorEntry1" inherits="AuctionatorEntryTemplate">
<Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorScrollFrame" relativePoint="TOPLEFT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor></Anchors> <Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorScrollFrame" relativePoint="TOPLEFT"><Offset><AbsDimension x="8" y="0"/></Offset></Anchor></Anchors>
</Button> </Button>
@@ -335,6 +333,15 @@
<Button name="AuctionatorEntry14" inherits="AuctionatorEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorEntry13" relativePoint="BOTTOMLEFT"/></Anchors></Button> <Button name="AuctionatorEntry14" inherits="AuctionatorEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorEntry13" relativePoint="BOTTOMLEFT"/></Anchors></Button>
<Button name="AuctionatorEntry15" inherits="AuctionatorEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorEntry14" relativePoint="BOTTOMLEFT"/></Anchors></Button> <Button name="AuctionatorEntry15" inherits="AuctionatorEntryTemplate"><Anchors><Anchor point="TOPLEFT" relativeTo="AuctionatorEntry14" relativePoint="BOTTOMLEFT"/></Anchors></Button>
<Button name="AuctionatorRefreshButton" inherits="UIPanelButtonTemplate" text="Refresh">
<Size><AbsDimension x="126" y="22"/> </Size>
<Anchors><Anchor point="BOTTOMRIGHT"><Offset><AbsDimension x="-87" y="-38"/></Offset></Anchor></Anchors>
<Scripts>
<OnClick>
Auctionator_RefreshButtonOnClick();
</OnClick>
</Scripts>
</Button>
</Frames> </Frames>
</Frame> </Frame>