|
|
|
@ -15,6 +15,7 @@ local priceTextCache = { lastClear = 0 } |
|
|
|
local private = {} |
|
|
|
local private = {} |
|
|
|
private.gather = {} |
|
|
|
private.gather = {} |
|
|
|
private.shown = {} |
|
|
|
private.shown = {} |
|
|
|
|
|
|
|
private.eventObj = nil |
|
|
|
|
|
|
|
|
|
|
|
-- list of profession skills that do not have crafting. used by UpdateTradeSkills |
|
|
|
-- list of profession skills that do not have crafting. used by UpdateTradeSkills |
|
|
|
local invalidTrade = { |
|
|
|
local invalidTrade = { |
|
|
|
@ -63,6 +64,7 @@ function GUI:OnEnable() |
|
|
|
GUI:RegisterEvent("UPDATE_PENDING_MAIL", "GatheringEventHandler") |
|
|
|
GUI:RegisterEvent("UPDATE_PENDING_MAIL", "GatheringEventHandler") |
|
|
|
GUI:RegisterEvent("AUCTION_HOUSE_SHOW", "GatheringEventHandler") |
|
|
|
GUI:RegisterEvent("AUCTION_HOUSE_SHOW", "GatheringEventHandler") |
|
|
|
GUI:RegisterEvent("AUCTION_HOUSE_CLOSED", "GatheringEventHandler") |
|
|
|
GUI:RegisterEvent("AUCTION_HOUSE_CLOSED", "GatheringEventHandler") |
|
|
|
|
|
|
|
GUI:RegisterEvent("MAIL_INBOX_UPDATE", "QueueUpdateHandler") |
|
|
|
TSMAPI:CreateTimeDelay("craftingUpdateTradeSkill", 1, function() GUI:UpdateSelectedTradeSkill() end, 0.1) |
|
|
|
TSMAPI:CreateTimeDelay("craftingUpdateTradeSkill", 1, function() GUI:UpdateSelectedTradeSkill() end, 0.1) |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:RegisterForBagChange(function() |
|
|
|
TSMAPI:RegisterForBagChange(function() |
|
|
|
@ -75,6 +77,9 @@ function GUI:OnEnable() |
|
|
|
TSMAPI:CreateTimeDelay("gatheringUpdateThrottle", 0.3, GUI.UpdateGathering) |
|
|
|
TSMAPI:CreateTimeDelay("gatheringUpdateThrottle", 0.3, GUI.UpdateGathering) |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private.eventObj = private.eventObj or TSMAPI:GetEventObject() |
|
|
|
|
|
|
|
private.eventObj:SetCallback("TSM:AUCTIONCONTROL:ITEMBOUGHT", private.OnAuctionBought) |
|
|
|
|
|
|
|
|
|
|
|
GUI:UpdateTradeSkills() |
|
|
|
GUI:UpdateTradeSkills() |
|
|
|
GUI.gatheringFrame = GUI:CreateGatheringFrame() |
|
|
|
GUI.gatheringFrame = GUI:CreateGatheringFrame() |
|
|
|
if next(TSM.db.realm.gathering.neededMats) then |
|
|
|
if next(TSM.db.realm.gathering.neededMats) then |
|
|
|
@ -82,6 +87,18 @@ function GUI:OnEnable() |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function private.OnAuctionBought() |
|
|
|
|
|
|
|
if not GUI.frame or not GUI.frame:IsVisible() then return end |
|
|
|
|
|
|
|
TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.1, GUI.UpdateQueue) |
|
|
|
|
|
|
|
TSMAPI:CreateTimeDelay("craftingProfessionUpdateThrottle", 0.2, GUI.UpdateProfessionsTabST) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GUI:QueueUpdateHandler() |
|
|
|
|
|
|
|
if not GUI.frame or not GUI.frame:IsVisible() then return end |
|
|
|
|
|
|
|
TSMAPI:CreateTimeDelay("craftingQueueUpdateThrottle", 0.1, GUI.UpdateQueue) |
|
|
|
|
|
|
|
TSMAPI:CreateTimeDelay("craftingProfessionUpdateThrottle", 0.2, GUI.UpdateProfessionsTabST) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function GUI:ShowGatheringFrame() |
|
|
|
function GUI:ShowGatheringFrame() |
|
|
|
if GUI.gatheringFrame then |
|
|
|
if GUI.gatheringFrame then |
|
|
|
GUI.gatheringFrame:Show() |
|
|
|
GUI.gatheringFrame:Show() |
|
|
|
|