small improvement

This commit is contained in:
Manuel Simon Hirsig
2015-09-08 04:38:13 +02:00
parent e51eae0a8a
commit 74de431b70
3 changed files with 32 additions and 36 deletions
+10 -14
View File
@@ -151,23 +151,19 @@ end
function Auctionator_ContainerFrameItemButton_OnClick(button)
if (not AUCTIONATOR_ENABLE_ALT
or not AuctionFrame:IsShown()
or not IsAltKeyDown())
then
return Auctionator_Orig_ContainerFrameItemButton_OnClick(button)
end
local origResult = Auctionator_Orig_ContainerFrameItemButton_OnClick(button)
ClickAuctionSellItemButton()
ClearCursor()
if AUCTIONATOR_ENABLE_ALT and AuctionFrame:IsShown() and IsAltKeyDown() and button == "LeftButton" then
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= AUCTIONATOR_TAB_INDEX then
AuctionFrameTab_OnClick(AUCTIONATOR_TAB_INDEX)
ClickAuctionSellItemButton()
ClearCursor()
if PanelTemplates_GetSelectedTab(AuctionFrame) ~= AUCTIONATOR_TAB_INDEX then
AuctionFrameTab_OnClick(AUCTIONATOR_TAB_INDEX)
end
end
PickupContainerItem(this:GetParent():GetID(), this:GetID())
ClickAuctionSellItemButton()
return origResult
end
-----------------------------------------
@@ -176,7 +172,7 @@ function Auctionator_AuctionFrameAuctions_Update()
Auctionator_Orig_AuctionFrameAuctions_Update()
if PanelTemplates_GetSelectedTab(AuctionFrame) == AUCTIONATOR_TAB_INDEX and AuctionFrame:IsShown() then
if PanelTemplates_GetSelectedTab(AuctionFrame) == AUCTIONATOR_TAB_INDEX and AuctionFrame:IsShown() then
Auctionator_HideElems(auctionsTabElements)
end
end
+1 -1
View File
@@ -3,7 +3,7 @@
<Script file="Auctionator.lua"/>
<!-- Frame to handle all core events -->
<Frame name="Auctionator_Core">
<Frame name="Auctionator_Core">
<Scripts>
<OnLoad>
this:RegisterEvent("VARIABLES_LOADED")
+21 -21
View File
@@ -17,26 +17,6 @@ local submitQuery, processQueryResults
-----------------------------------------
local eventFrame = CreateFrame("Frame")
eventFrame:SetScript("OnUpdate", function()
if state == STATE_PREQUERY and GetTime() - timeOfLastUpdate > 0.5 then
timeOfLastUpdate = GetTime()
if CanSendAuctionQuery() then
submitQuery()
end
end
end)
eventFrame:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
eventFrame:SetScript("OnEvent", function(event)
if state == STATE_POSTQUERY then
processQueryResults()
end
end)
-----------------------------------------
function Auctionator_Scan_Idle()
return state == STATE_IDLE
end
@@ -174,4 +154,24 @@ function processQueryResults()
else
Auctionator_Scan_Complete()
end
end
end
-----------------------------------------
local eventFrame = CreateFrame("Frame")
eventFrame:SetScript("OnUpdate", function()
if state == STATE_PREQUERY and GetTime() - timeOfLastUpdate > 0.5 then
timeOfLastUpdate = GetTime()
if CanSendAuctionQuery() then
submitQuery()
end
end
end)
eventFrame:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
eventFrame:SetScript("OnEvent", function(event)
if state == STATE_POSTQUERY then
processQueryResults()
end
end)