diff --git a/EventListener.lua b/EventListener.lua index d280e99..f6cfdd9 100644 --- a/EventListener.lua +++ b/EventListener.lua @@ -134,7 +134,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED() end end -- death detection - if (Gladdy.buttons[destUnit] and eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then + if (eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then if not Gladdy:isFeignDeath(destUnit) then Gladdy:SendMessage("UNIT_DEATH", destUnit) end @@ -167,7 +167,7 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED() if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman) spellId = spellID end - if Gladdy.db.cooldownCooldowns[tostring(spellId)] and (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_MISSED") then + if Gladdy.db.cooldownCooldowns[tostring(spellId)] and (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_MISSED" or eventType == "SPELL_DODGED") then if (Gladdy:GetCooldownList()[Gladdy.buttons[srcUnit].class][spellId]) then unitClass = Gladdy.buttons[srcUnit].class else @@ -393,6 +393,18 @@ function EventListener:UNIT_SPELLCAST_SUCCEEDED(...) Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - RACIAL_USED", unit, spellID) Gladdy:SendMessage("RACIAL_USED", unit) end + + --cooldown + local unitClass + if (Gladdy:GetCooldownList()[Gladdy.buttons[unit].class][unit]) then + unitClass = Gladdy.buttons[unit].class + else + unitClass = Gladdy.buttons[unit].race + end + if spellID ~= 16188 and spellID ~= 17116 and spellID ~= 16166 and spellID ~= 12043 and spellID ~= 5384 then -- Nature's Swiftness CD starts when buff fades + Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED", "- CooldownUsed", unit, "spellID:", spellID) + Cooldowns:CooldownUsed(unit, unitClass, spellID) + end end end diff --git a/Gladdy.lua b/Gladdy.lua index fabed6f..a988d13 100644 --- a/Gladdy.lua +++ b/Gladdy.lua @@ -27,11 +27,11 @@ local LibStub = LibStub --------------------------- -local MAJOR, MINOR = "Gladdy", 9 +local MAJOR, MINOR = "Gladdy", 10 local Gladdy = LibStub:NewLibrary(MAJOR, MINOR) local L Gladdy.version_major_num = 2 -Gladdy.version_minor_num = 0.20 +Gladdy.version_minor_num = 0.21 Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num Gladdy.version_releaseType = RELEASE_TYPES.release Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType diff --git a/Gladdy.toc b/Gladdy.toc index 6b0610b..01a26f2 100644 --- a/Gladdy.toc +++ b/Gladdy.toc @@ -1,5 +1,5 @@ ## Title: Gladdy |cFFFF0000 game client not supported|r -## Version: 2.20-Release +## Version: 2.21-Release ## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK ## Author: XiconQoo, DnB_Junkee, Knall ## X-Email: contact me on discord Knall#1751 diff --git a/Gladdy_BCC.toc b/Gladdy_BCC.toc index 60f4d13..68f04a5 100644 --- a/Gladdy_BCC.toc +++ b/Gladdy_BCC.toc @@ -1,6 +1,6 @@ ## Interface: 20504 ## Title: Gladdy - TBC -## Version: 2.20-Release +## Version: 2.21-Release ## Notes: The most powerful arena AddOn for WoW 2.5.4 ## Author: XiconQoo, DnB_Junkee, Knall ## X-Email: contact me on discord Knall#1751 diff --git a/Gladdy_Wrath.toc b/Gladdy_Wrath.toc index 0070ee1..7984195 100644 --- a/Gladdy_Wrath.toc +++ b/Gladdy_Wrath.toc @@ -1,6 +1,6 @@ ## Interface: 30400 ## Title: Gladdy - WotLK -## Version: 2.20-Release +## Version: 2.21-Release ## Notes: The most powerful arena AddOn for WoW 3.4.0 ## Author: XiconQoo, DnB_Junkee, Knall ## X-Email: contact me on discord Knall#1751 diff --git a/Modules/Cooldowns.lua b/Modules/Cooldowns.lua index 8bb398c..9b90688 100644 --- a/Modules/Cooldowns.lua +++ b/Modules/Cooldowns.lua @@ -347,7 +347,7 @@ function Cooldowns:ClearIcon(button, index, spellId, icon) end end icon:Show() - LCG:PixelGlow_Stop(icon.glow) + LCG.PixelGlow_Stop(icon.glow) if icon.timer then icon.timer:Cancel() end @@ -366,6 +366,8 @@ end -- Test --------------------- +-- /run LibStub("Gladdy").modules["Cooldowns"]:AURA_GAIN(_, AURA_TYPE_BUFF, 22812, "Barkskin", _, 20, _, _, _, _, "arena1", true) +-- /run LibStub("Gladdy").modules["Cooldowns"]:AURA_FADE("arena1", 22812) function Cooldowns:Test(unit) if Gladdy.frame.testing then self:UpdateTestCooldowns(unit) diff --git a/Modules/Pets.lua b/Modules/Pets.lua index f51c65c..3fa8b20 100644 --- a/Modules/Pets.lua +++ b/Modules/Pets.lua @@ -1,6 +1,6 @@ local string_gsub, floor, pairs = string.gsub, math.floor, pairs local CreateFrame, SetPortraitTexture = CreateFrame, SetPortraitTexture -local UnitHealthMax, UnitHealth, UnitGUID = UnitHealthMax, UnitHealth, UnitGUID +local UnitHealthMax, UnitHealth, UnitGUID, UnitExists = UnitHealthMax, UnitHealth, UnitGUID, UnitExists local Gladdy = LibStub("Gladdy") local L = Gladdy.L @@ -47,6 +47,7 @@ function Pets:UpdateFrameOnce() self:RegisterMessage("PET_DESTROYED") self:RegisterMessage("PET_STEALTH") self:RegisterMessage("ENEMY_SPOTTED") + self:RegisterMessage("UNIT_DEATH") else self:UnregisterAllMessages() end @@ -56,6 +57,11 @@ function Pets:JOINED_ARENA() for _,v in pairs(self.frames) do v.healthBar:SetAlpha(0) end + for i=1,Gladdy.curBracket do + if UnitExists("arenapet" .. i) then + Gladdy:SendMessage("PET_SPOTTED", "arenapet" .. i) + end + end if Gladdy.db.petEnabled then self:RegisterEvent("UNIT_PET") self:SetScript("OnEvent", function(_, event, unitId) @@ -91,15 +97,20 @@ function Pets:PET_SPOTTED(unit) Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit)) end) end + Gladdy:Print(self.frames[unit].healthBar:GetAlpha()) end function Pets:PET_DESTROYED(unit) - if Gladdy.db.petEnabled then + if Gladdy.db.petEnabled and self.frames[unit] then self.frames[unit].healthBar:SetAlpha(0) self.frames[unit].healthBar:SetScript("OnUpdate", nil) end end +function Pets:UNIT_DEATH(unit) + self:PET_DESTROYED(unit) +end + function Pets:PET_STEALTH(unit) if Gladdy.db.petEnabled then self.frames[unit].healthBar.hp:SetStatusBarColor(0.66, 0.66, 0.66, 1) @@ -123,6 +134,7 @@ function Pets:CheckUnitPet(unitId) petFrame.healthBar.hp:SetMinMaxValues(0, UnitHealthMax(unit)) petFrame.healthBar.hp:SetValue(UnitHealth(unit)) Pets:SetHealthText(petFrame.healthBar, UnitHealth(unit), UnitHealthMax(unit)) + SetPortraitTexture(petFrame.healthBar.portrait, unit) petFrame.healthBar:SetScript("OnUpdate", function(self) self.hp:SetValue(UnitHealth(self.unit)) Pets:SetHealthText(self, UnitHealth(unit), UnitHealthMax(unit)) diff --git a/README.md b/README.md index fd04a11..3dfd079 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ --- -## [v2.20-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.20-Release/Gladdy_Classic_v2.20-Release.zip) +## [v2.21-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.21-Release/Gladdy_Classic_v2.21-Release.zip) ###### Please consider donating if you like my work @@ -79,6 +79,14 @@ Thank you! ### Changes +### v2.21-Release +- **Cooldowns** + - glows minor fix again... + - more tracking +- **Pets** + - death detection improved + - detection improved + ### v2.20-Release - **Cooldowns** - glow changed to PixelGlow