Skip to content

Commit

Permalink
Ensure ProfessionFrame is hooked only once it's been loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Caerdon committed Sep 8, 2023
1 parent eed96de commit b035014
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CaerdonWardrobe.toc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Title: Caerdon Wardrobe
## Notes: Shows BOE / BOA, openable, and unlearned pets, toys, mounts and wardrobe indicator on bank / bag / auction / merchant / guild bank / loot frame / loot roll / encounter journal slots
## Author: Caerdon
## Version: v3.4.2
## Version: v3.4.3
## SavedVariables: CaerdonWardrobeConfig
## OptionalDeps: WagoAnalytics, WoWUnit, AdiBags, AngrierWorldQuests, ArkInventory, Bagnon, BaudBag, cargBags_Nivaya, Combuctor, ElvUI, Inventorian, KkthnxUI, LiteBag, Pawn, Skillet, Sorted, VenturePlan, WorldQuestsList, WorldQuestTracker, ZygorGuidesViewer

Expand Down
12 changes: 7 additions & 5 deletions features/TradeSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ function TradeSkillMixin:GetName()
end

function TradeSkillMixin:Init()
return { "TRADE_SKILL_SHOW" }
return { "ADDON_LOADED", "TRADE_SKILL_SHOW" }
end

function TradeSkillMixin:TRADE_SKILL_SHOW(name)
if not self.isHooked then
self.isHooked = true
function TradeSkillMixin:ADDON_LOADED(name)
if name == "Blizzard_Professions" then
ScrollUtil.AddInitializedFrameCallback(ProfessionsFrame.CraftingPage.RecipeList.ScrollBox, function (...) self:OnInitializedFrame(...) end, ProfessionsFrame.CraftingPage.RecipeList, false)
hooksecurefunc(ProfessionsFrame.CraftingPage.SchematicForm, "Init", function (...) self:OnSchematicFormInit(...) end)
-- hooksecurefunc(ProfessionsFrame, "Refresh", function (...) self:Refresh(...) end)
end
end
end

function TradeSkillMixin:TRADE_SKILL_SHOW(name)
end

function TradeSkillMixin:OnInitializedFrame(listFrame, frame, elementData)
Expand Down

0 comments on commit b035014

Please sign in to comment.