Browse Source

refresh crafting queue on buyout

dev
Jørgen Lien Sellæg 4 months ago
parent
commit
e938497873
  1. 2
      TradeSkillMaster/TradeSkillMaster.toc
  2. 4
      TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc
  3. 17
      TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

2
TradeSkillMaster/TradeSkillMaster.toc

@ -2,7 +2,7 @@
## Title: |cff00fe00TradeSkillMaster: Revived|r ## Title: |cff00fe00TradeSkillMaster: Revived|r
## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed. ## Notes: Core addon for the TradeSkillMaster suite, revived for Wrath of the Lich King. Does nothing without modules installed.
## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors... ## Author: Sapu94, Bart39, Gnomezilla [Warmane-Icecrown(A)], BlueAo [Warmane], andrew6180, Yoshiyuka, DimaSheiko, and other contributors...
## Version: 2.3.19 ## Version: 2.3.20
## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB ## SavedVariables: TradeSkillMasterAppDB, AscensionTSMDB
## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE ## OptionalDeps: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0, SharedMedia, TheUndermineJournal, TheUndermineJournalGE
## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0 ## X-Embeds: AccurateTime, Ace3, LibDataBroker-1.1, LibDBIcon-1.0, LibExtraTip, TipHelper, LibParse, LibCompress, LibGraph-2.0

4
TradeSkillMaster_AuctionDB/TradeSkillMaster_AuctionDB.toc

@ -2,10 +2,10 @@
## Title: |cff00ff00TradeSkillMaster_AuctionDB|r ## Title: |cff00ff00TradeSkillMaster_AuctionDB|r
## Notes: Stores auction house data and calculates market prices. ## Notes: Stores auction house data and calculates market prices.
## Author: Sapu94, Bart39 ## Author: Sapu94, Bart39
## Version: 2.3.19 ## Version: 2.3.20
## SavedVariables: AscensionTSM_AuctionDB ## SavedVariables: AscensionTSM_AuctionDB
## Dependency: TradeSkillMaster ## Dependency: TradeSkillMaster
## X-Curse-Packaged-Version: 2.3.19 ## X-Curse-Packaged-Version: 2.3.20
## X-Curse-Project-Name: TradeSkillMaster_AuctionDB ## X-Curse-Project-Name: TradeSkillMaster_AuctionDB
## X-Curse-Project-ID: tradeskillmaster_auctiondb ## X-Curse-Project-ID: tradeskillmaster_auctiondb
## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline ## X-Curse-Repository-ID: wow/tradeskillmaster_auctiondb/mainline

17
TradeSkillMaster_Crafting/Modules/CraftingGUI.lua

@ -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()

Loading…
Cancel
Save