fix trinket racial tracking

This commit is contained in:
Sumsebrum 2022-07-31 21:48:09 +02:00
parent e86acf0cb2
commit a9247e1f76
2 changed files with 3 additions and 6 deletions

View File

@ -223,11 +223,9 @@ function Racial:TRINKET_USED(unit) -- Wrath only
if racial.active and racial.timeLeft >= 45 then if racial.active and racial.timeLeft >= 45 then
-- do nothing -- do nothing
else else
racial.active = false
self:Used(unit, GetTime(), 45) self:Used(unit, GetTime(), 45)
end end
elseif button.race == "Human" then elseif button.race == "Human" then
racial.active = false
self:Used(unit, GetTime(), 120) self:Used(unit, GetTime(), 120)
end end
end end

View File

@ -33,6 +33,7 @@ function Trinket:Initialize()
self.frames = {} self.frames = {}
if Gladdy.db.trinketEnabled then if Gladdy.db.trinketEnabled then
self:RegisterMessage("JOINED_ARENA") self:RegisterMessage("JOINED_ARENA")
self:RegisterMessage("TRINKET_USED")
if Gladdy.expansion == "Wrath" then if Gladdy.expansion == "Wrath" then
self:RegisterMessage("RACIAL_USED") self:RegisterMessage("RACIAL_USED")
end end
@ -289,11 +290,9 @@ function Trinket:RACIAL_USED(unit) -- Wrath only
if trinket.active and trinket.timeLeft >= 45 then if trinket.active and trinket.timeLeft >= 45 then
-- do nothing -- do nothing
else else
trinket.active = false
self:Used(unit, GetTime() * 1000, 45000) self:Used(unit, GetTime() * 1000, 45000)
end end
elseif Gladdy.buttons[unit].race == "Human" then elseif Gladdy.buttons[unit].race == "Human" then
trinket.active = false
self:Used(unit, GetTime() * 1000, 120000) self:Used(unit, GetTime() * 1000, 120000)
end end
end end
@ -319,14 +318,14 @@ function Trinket:Used(unit, startTime, duration)
if (not trinket or not Gladdy.db.trinketEnabled) then if (not trinket or not Gladdy.db.trinketEnabled) then
return return
end end
if not trinket.active then --if not trinket.active then
trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime() trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime()
if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end
trinket.active = true trinket.active = true
if Gladdy.db.trinketColored then if Gladdy.db.trinketColored then
trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd)) trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
end end
end --end
end end
function Trinket:GetOptions() function Trinket:GetOptions()