Skip to content

Commit

Permalink
Fix Tradeskill Merge on WoW 10.0
Browse files Browse the repository at this point in the history
Fixes #61
  • Loading branch information
Nevcairiel committed Nov 15, 2022
1 parent e8d0229 commit 36d29ae
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions modules/Tradeskill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ local MODNAME = "Tradeskill"
local Tradeskill = Quartz3:NewModule(MODNAME, "AceEvent-3.0", "AceHook-3.0")
local Player = Quartz3:GetModule("Player")

local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)

local TimeFmt = Quartz3.Util.TimeFormat

----------------------------
Expand Down Expand Up @@ -89,10 +91,12 @@ function Tradeskill:OnEnable()
self:RegisterEvent("UNIT_SPELLCAST_STOP")
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED")
if C_TradeSkillUI then
self:SecureHook(C_TradeSkillUI, "CraftRecipe", "DoTradeSkill")
if WoWRetail then
self:SecureHook(ProfessionsFrame.CraftingPage, "CreateInternal", "DoTradeSkill")
elseif C_TradeSkillUI then
self:SecureHook(C_TradeSkillUI, "CraftRecipe", "DoTradeSkillClassic")
else
self:SecureHook("DoTradeSkill")
self:SecureHook("DoTradeSkill", "DoTradeSkillClassic")
end
end

Expand Down Expand Up @@ -161,11 +165,15 @@ function Tradeskill:UNIT_SPELLCAST_INTERRUPTED(event, unit)
bail = true
end

function Tradeskill:DoTradeSkill(index, num)
function Tradeskill:DoTradeSkill(_, id, num)
completedcasts = 0
repeattimes = tonumber(num) or 1
end

function Tradeskill:DoTradeSkillClassic(id, num)
self:DoTradeSkill(nil, id, num)
end

function Tradeskill:ApplySettings()
castBarParent = Player.Bar
castBar = Player.Bar.Bar
Expand Down

0 comments on commit 36d29ae

Please sign in to comment.