diff --git a/CHANGELOG b/CHANGELOG index c6edd463..18f96044 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,12 @@ [Eng] - All changes to this project will be documented in this file. The latest changes are at the top. [Ger] - Alle Änderungen an diesem Projekt werden in dieser Datei dokumentiert. Die neuesten Änderungen stehen ganz oben. +## [ver. 2.95.1] - 03.04.2023 +### Update +- FIX again Max Health Error in NP Healthmarker +- FIX Dock NoIcon +- UPDATE Interrupt color and code update + ## [ver. 2.95] - 01.04.2023 ### Update - FIX Healthmarker - if no Healthbar diff --git a/ElvUI_mMediaTag.toc b/ElvUI_mMediaTag.toc index c6b38700..ac617310 100644 --- a/ElvUI_mMediaTag.toc +++ b/ElvUI_mMediaTag.toc @@ -1,7 +1,7 @@ ## Interface: 100007 ## Title: |cff1784d1ElvUI|r |CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r ## Author: Blinkii -## Version: 2.95 +## Version: 2.95.1 ## Notes: ElvUI Plugin from Blinkii@Eu-Arygos | Support: mMediaTag@gmx.de ## RequiredDeps: ElvUI ## DefaultState: Enabled diff --git a/ElvUI_mMediaTag_Classic.toc b/ElvUI_mMediaTag_Classic.toc index 3c62a167..8c6d6964 100644 --- a/ElvUI_mMediaTag_Classic.toc +++ b/ElvUI_mMediaTag_Classic.toc @@ -1,7 +1,7 @@ ## Interface: 11403 ## Title: |cff1784d1ElvUI|r |CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r ## Author: Blinkii -## Version: 2.95 +## Version: 2.95.1 ## Notes: ElvUI Plugin from Blinkii@Eu-Arygos | Support: mMediaTag@gmx.de ## RequiredDeps: ElvUI ## DefaultState: Enabled diff --git a/ElvUI_mMediaTag_Mainline.toc b/ElvUI_mMediaTag_Mainline.toc index dc1dbb03..3a9dad82 100644 --- a/ElvUI_mMediaTag_Mainline.toc +++ b/ElvUI_mMediaTag_Mainline.toc @@ -1,7 +1,7 @@ ## Interface: 100007 ## Title: |cff1784d1ElvUI|r |CFF6559F1m|r|CFF7A4DEFM|r|CFF8845ECe|r|CFFA037E9d|r|CFFA435E8i|r|CFFB32DE6a|r|CFFBC26E5T|r|CFFCB1EE3a|r|CFFDD14E0g|r ## Author: Blinkii -## Version: 2.95 +## Version: 2.95.1 ## Notes: ElvUI Plugin from Blinkii@Eu-Arygos | Support: mMediaTag@gmx.de # RequiredDeps: ElvUI ## Dependencies: ElvUI diff --git a/ElvUI_mMediaTag_Wrath.toc b/ElvUI_mMediaTag_Wrath.toc index e91a4530..7faea02e 100644 --- a/ElvUI_mMediaTag_Wrath.toc +++ b/ElvUI_mMediaTag_Wrath.toc @@ -1,7 +1,7 @@ ## Interface: 30401 ## Title: |cff1784d1ElvUI|r |CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r ## Author: Blinkii -## Version: 2.95 +## Version: 2.95.1 ## Notes: ElvUI Plugin from Blinkii@Eu-Arygos | Support: mMediaTag@gmx.de ## RequiredDeps: ElvUI ## DefaultState: Enabled diff --git a/core/core.lua b/core/core.lua deleted file mode 100644 index 9a03a4e1..00000000 --- a/core/core.lua +++ /dev/null @@ -1,123 +0,0 @@ -local ElvUI_EltreumUI, E, L, V, P, G = unpack(select(2, ...)) - - -local E, _, V, P, G = unpack(ElvUI) -local EP = LibStub('LibElvUIPlugin-1.0') -local addon, Engine = ... -local _G = _G -local ElvUI_EltreumUI = E:NewModule(addon, 'AceHook-3.0', 'AceEvent-3.0', 'AceTimer-3.0', 'AceConsole-3.0') -local L = E.Libs.ACL:GetLocale("ElvUI", E.global.general.locale) -local GetAddOnMetadata = _G.GetAddOnMetadata - -Engine[1] = ElvUI_EltreumUI -Engine[2] = E --ElvUI Engine -Engine[3] = L --ElvUI Locales -Engine[4] = V --ElvUI PrivateDB -Engine[5] = P --ElvUI ProfileDB -Engine[6] = G --ElvUI GlobalDB -_G[addon] = Engine - - - - -local E, L, V, P, G = unpack(ElvUI) -local mPlugin = "mMediaTag" -local mMT = E:NewModule(mPlugin, "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0") -local EP = _G.LibStub("LibElvUIPlugin-1.0") -local addon, ns = ... - ---Variables -local wipe = table.wipe -ns.mName = "|CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r" -ns.mNameClassic = "|CFF8E44ADm|r|CFF2ECC71Media|r|CFF3498DBTag|r |cffff0066Classic|r" -ns.mColor1 = "|CFFFFFFFF" -- white -ns.mColor2 = "|CFFF7DC6F" -- yellow -ns.mColor3 = "|CFF8E44AD" -- purple -ns.mColor4 = "|CFFFE7B2C" -- orange -ns.mColor5 = "|CFFE74C3C" -- red -ns.mColor6 = "|CFF58D68D" -- green -ns.mColor7 = "|CFF3498DB" -- blue -ns.mColor8 = "|CFFB2BABB" -- gray -ns.normal = "|CFF82E0AA" -- nomral -ns.Heroic = "|CFF85C1E9 " -- HC -ns.Mythic = "|CFFBB8FCE" -- Mythic -ns.mVersion = GetAddOnMetadata(addon, "Version") -- addon version -ns.LeftButtonIcon = format("|T%s:16:16:0:0:32:32|t", "Interface\\AddOns\\ElvUI_mMediaTag\\media\\misc\\mouse_l.tga") -- maus icon für ttip -ns.RightButtonIcon = format("|T%s:16:16:0:0:32:32|t", "Interface\\AddOns\\ElvUI_mMediaTag\\media\\misc\\mouse_r.tga") -- maus icon für ttip -ns.MiddleButtonIcon = format("|T%s:16:16:0:0:32:32|t", "Interface\\AddOns\\ElvUI_mMediaTag\\media\\misc\\mouse_m.tga") -- maus icon für ttip -ns.Config = {} -- addon einstellung werden hier gesammelt - --- einstellungen in elvui eintragen -function mMT:AddOptions() - for _, func in pairs(ns.Config) do - func() - end -end - -function mMT:Check_ElvUI_EltreumUI() - return (IsAddOnLoaded("ElvUI_EltreumUI") and E.db.ElvUI_EltreumUI.unitframes.gradientmode.enable) -end - --- addon laden -function mMT:Initialize() - if E.db[mPlugin].mCustomClassColors.enable and not mMT:Check_ElvUI_EltreumUI() then - mMT:SetCustomColors() - end - - if E.db[mPlugin].mCustomClassColors.emediaenable then - mMT:SetElvUIMediaColor() - end - - mMT:mMisc() -- module laden - - if E.Retail then - if E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable then - mMT:StartNameplateTools() - end - - if E.db[mPlugin].mRoleSymbols.enable then - mMT:RegisterEvent("PLAYER_ENTERING_WORLD") -- events registrieren - end - - if E.db[mPlugin].mExecutemarker.auto or E.db[mPlugin].mCastbar.enable then - mMT:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") -- events registrieren - end - - if E.db[mPlugin].mInstanceDifficulty.enable then - mMT:RegisterEvent("UPDATE_INSTANCE_INFO") - mMT:RegisterEvent("CHALLENGE_MODE_START") - mMT:SetupInstanceDifficulty() - end - end - - EP:RegisterPlugin(addon, mMT:AddOptions()) -- einstellungen in elvui eintragen - ns.Config = wipe(ns.Config) -- tabele löschen -end - -function mMT:PLAYER_ENTERING_WORLD() - if E.db[mPlugin] then - if E.db[mPlugin].mRoleSymbols.enable then - mMT:mStartRoleSmbols() -- rolensymbole ändern - end - end -end - -function mMT:ACTIVE_TALENT_GROUP_CHANGED() - if E.db[mPlugin].mCastbar.enable then - mMT:mUpdateKick() -- castbar kick/ kick auf cd - end - - if E.db[mPlugin].mExecutemarker.auto then - mMT:updateAutoRange() - end -end - -function mMT:UPDATE_INSTANCE_INFO() - mMT:UpdateText() -end - -function mMT:CHALLENGE_MODE_START() - mMT:UpdateText() -end - -E:RegisterModule(mMT:GetName()) -- addon in elvui registrieren diff --git a/core/init.lua b/core/init.lua index 9833546d..7ee369d9 100644 --- a/core/init.lua +++ b/core/init.lua @@ -4,6 +4,16 @@ local mMT = E:NewModule(mPlugin, "AceHook-3.0", "AceEvent-3.0", "AceTimer-3.0") local EP = _G.LibStub("LibElvUIPlugin-1.0") local addon, ns = ... +E.Media.MailIcons.mMT1 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail1.tga]] +E.Media.MailIcons.mMT2 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail2.tga]] +E.Media.MailIcons.mMT3 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail3.tga]] +E.Media.MailIcons.mMT4 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail4.tga]] +E.Media.MailIcons.mMT5 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail5.tga]] +E.Media.MailIcons.mMT6 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail6.tga]] +E.Media.MailIcons.mMT7 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail7.tga]] +E.Media.MailIcons.mMT8 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail8.tga]] +E.Media.MailIcons.mMT9 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail9.tga]] +E.Media.MailIcons.mMT10 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail10.tga]] --Variables local wipe = table.wipe ns.mName = "|CFF6559F1m|r|CFF7A4DEFM|r|CFF8845ECe|r|CFFA037E9d|r|CFFA435E8i|r|CFFB32DE6a|r|CFFBC26E5T|r|CFFCB1EE3a|r|CFFDD14E0g|r" @@ -55,17 +65,6 @@ function mMT:Initialize() E.Media.CombatIcons.mMT5 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\lightning7.tga]] E.Media.CombatIcons.mMT6 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\lightning9.tga]] - E.Media.MailIcons.mMT1 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail1.tga]] - E.Media.MailIcons.mMT2 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail2.tga]] - E.Media.MailIcons.mMT3 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail3.tga]] - E.Media.MailIcons.mMT4 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail4.tga]] - E.Media.MailIcons.mMT5 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail5.tga]] - E.Media.MailIcons.mMT6 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail6.tga]] - E.Media.MailIcons.mMT7 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail7.tga]] - E.Media.MailIcons.mMT8 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail8.tga]] - E.Media.MailIcons.mMT9 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail9.tga]] - E.Media.MailIcons.mMT10 = [[Interface\AddOns\ElvUI_mMediaTag\media\mail\mail10.tga]] - if E.Retail then if E.private.nameplates.enable and E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable then mMT:StartNameplateTools() diff --git a/core/mSettings.lua b/core/mSettings.lua index d43ff3e8..1bfc54f2 100644 --- a/core/mSettings.lua +++ b/core/mSettings.lua @@ -416,8 +416,8 @@ P[mPlugin] = { }, ["kickintime"] = { ["r"] = 0.03, - ["g"] = 0.93, - ["b"] = 0.2, + ["g"] = 0.2, + ["b"] = 0.93, }, ["inactivetime"] = .8, ["kickintimeb"] = { diff --git a/media/icons/bigsword15.tga b/media/icons/bigsword15.tga new file mode 100644 index 00000000..56ef054d Binary files /dev/null and b/media/icons/bigsword15.tga differ diff --git a/misc/Dock/mNoIcon.lua b/misc/Dock/mNoIcon.lua index 71ac455a..7e47bef0 100644 --- a/misc/Dock/mNoIcon.lua +++ b/misc/Dock/mNoIcon.lua @@ -26,6 +26,8 @@ local function OnEvent(self, event, ...) wipe(self.mIcon) wipe(self.mSettings) + self.mIcon = nil + self.mSettings = nil end end diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index c94ace60..cc8d5dd1 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -9,7 +9,7 @@ local mInsert = table.insert local GetSpecializationInfo = GetSpecializationInfo local GetActiveSpecGroup = GetActiveSpecGroup local GetSpellCooldown = GetSpellCooldown -local interruptSpellId = nil +local interruptSpellID = nil _G.mMediaTag_interruptOnCD = false _G.mMediaTag_interruptinTime = false @@ -20,7 +20,7 @@ local interruptSpellList = { [72] = 6552, [73] = 6552, -- paladin - [65] = nil, + [65] = 96231, [66] = 96231, [70] = 96231, --HUNTER @@ -53,13 +53,13 @@ local interruptSpellList = { [267] = 119910, --MONK [268] = 116705, - [270] = nil, + [270] = 116705, [269] = 116705, --DRUID [102] = 78675, [103] = 106839, [104] = 106839, - [105] = nil, + [105] = 106839, --DEMONHUNTER [577] = 183752, [581] = 183752, @@ -68,10 +68,14 @@ local interruptSpellList = { [1468] = 351338, } +local function isTalentLearned(nodeID) + local talentConfig = C_ClassTalents.GetActiveConfigID() + local nodeInfo = talentConfig and nodeID and C_Traits.GetNodeInfo(talentConfig, nodeID) + return nodeInfo and nodeInfo.entryIDsWithCommittedRanks and nodeInfo.entryIDsWithCommittedRanks[1] and true or false +end _G.mMediaTag_interruptOnCD = function() - interruptSpellId = interruptSpellList[select(1, GetSpecializationInfo(GetSpecialization()))] - if interruptSpellId then - local cdStart = GetSpellCooldown(interruptSpellId) + if interruptSpellID then + local cdStart = GetSpellCooldown(interruptSpellID) if cdStart then return true else @@ -80,170 +84,101 @@ _G.mMediaTag_interruptOnCD = function() end end -function mMT:mUpdateKick() - interruptSpellId = interruptSpellList[select(1, GetSpecializationInfo(GetSpecialization()))] +local function CreateMarker(castbar) + castbar.InterruptMarker = castbar:CreateTexture(nil, "overlay") + castbar.InterruptMarker:SetDrawLayer("overlay", 4) + castbar.InterruptMarker:SetBlendMode("ADD") + castbar.InterruptMarker:SetSize(2, castbar:GetHeight()) + castbar.InterruptMarker:SetColorTexture( + E.db[mPlugin].mCastbar.readymarker.r, + E.db[mPlugin].mCastbar.readymarker.g, + E.db[mPlugin].mCastbar.readymarker.b + ) + castbar.InterruptMarker:Hide() end -function mMT:mSetupCastbar() - interruptSpellId = interruptSpellList[select(1, GetSpecializationInfo(GetSpecialization()))] - local colorKickonCD = E.db[mPlugin].mCastbar.kickcd - local colorKickonCDb = E.db[mPlugin].mCastbar.kickcdb - local colorKickinTime = E.db[mPlugin].mCastbar.kickintime - local colorKickinTimeb = E.db[mPlugin].mCastbar.kickintimeb +local function isSpellOrTalentKnown(spellId) + if IsSpellKnown(spellId) then + return true + elseif isTalentLearned(spellId) then + return true + end +end - if interruptSpellId then - hooksecurefunc(NP, "Castbar_CheckInterrupt", function(unit) - if unit.unit == "vehicle" or unit.unit == "player" then - return - end +local function InterruptChecker(castbar) + if castbar.unit == "vehicle" or castbar.unit == "player" then + return + end - if unit.InterruptMarker then - unit.InterruptMarker:Hide() - end + if castbar.InterruptMarker then + castbar.InterruptMarker:Hide() + end - if not unit.notInterruptible then - local interruptCD = nil - local interruptReadyInTime = false - local overlaySize = 0 - local inactivetime = E.db[mPlugin].mCastbar.inactivetime - if interruptSpellId then - local cdStart, cdDur = GetSpellCooldown(interruptSpellId) - local _, statusMax = unit:GetMinMaxValues() - local value = unit:GetValue() - interruptCD = (cdStart > 0 and cdDur - (GetTime() - cdStart)) or 0 + if not castbar.notInterruptible and interruptSpellID then + local interruptCD, interruptReadyInTime = nil, false + local interruptDur, interruptStart = 0, 0 - if unit.channeling then - interruptReadyInTime = (interruptCD + 0.5) < value - else - interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) - end + local cdStart, cdDur = GetSpellCooldown(interruptSpellID) + local tmpInterruptCD = (cdStart > 0 and cdDur - (GetTime() - cdStart)) or 0 + if not interruptCD or (tmpInterruptCD < interruptCD) then + interruptCD = tmpInterruptCD + interruptDur = cdDur + interruptStart = cdStart + end + local value = castbar:GetValue() - if not unit.InterruptMarker then - unit.InterruptMarker = unit:CreateTexture(nil, "overlay") - unit.InterruptMarker:SetColorTexture( - E.db[mPlugin].mCastbar.readymarker.r, - E.db[mPlugin].mCastbar.readymarker.g, - E.db[mPlugin].mCastbar.readymarker.b - ) - unit.InterruptMarker:Hide() - end - if interruptCD > inactivetime and interruptReadyInTime then - local range = (interruptCD / statusMax) - if range then - local width = unit:GetWidth() - local pos = "left" - overlaySize = width * range - unit.InterruptMarker:SetSize(2, unit:GetHeight()) - unit.InterruptMarker:SetPoint(pos, unit, pos, overlaySize, 0) - unit.InterruptMarker:SetVertexColor(1, 1, 1) - unit.InterruptMarker:Show() - end - end + if castbar.channeling then + interruptReadyInTime = (interruptCD + 0.5) < value + else + interruptReadyInTime = (interruptCD + 0.5) < (castbar.max - value) + end - if E.db[mPlugin].mCastbar.gardient then - if interruptCD > inactivetime and interruptReadyInTime then - unit:GetStatusBarTexture():SetGradient( - "HORIZONTAL", - { r = colorKickinTime.r, g = colorKickinTime.g, b = colorKickinTime.b, a = 1 }, - { r = colorKickinTimeb.r, g = colorKickinTimeb.g, b = colorKickinTimeb.b, a = 1 } - ) - elseif interruptCD > inactivetime then - unit:GetStatusBarTexture():SetGradient( - "HORIZONTAL", - { r = colorKickonCD.r, g = colorKickonCD.g, b = colorKickonCD.b, a = 1 }, - { r = colorKickonCDb.r, g = colorKickonCDb.g, b = colorKickonCDb.b, a = 1 } - ) - end - else - if interruptCD > inactivetime and interruptReadyInTime then - unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > inactivetime then - unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) - end - end - end - end - end) + local inactivetime = E.db[mPlugin].mCastbar.inactivetime + local colorInterruptonCD = E.db[mPlugin].mCastbar.kickcd + local colorInterruptonCDb = E.db[mPlugin].mCastbar.kickcdb + local colorInterruptinTime = E.db[mPlugin].mCastbar.kickintime + local colorInterruptinTimeb = E.db[mPlugin].mCastbar.kickintimeb - hooksecurefunc(UF, "PostCastStart", function(unit) - if unit.unit == "vehicle" or unit.unit == "player" then - return + if interruptCD and interruptCD > inactivetime and interruptReadyInTime then + if not castbar.InterruptMarker then + CreateMarker(castbar) end - if unit.InterruptMarker then - unit.InterruptMarker:Hide() + local sparkPosition = (interruptStart + interruptDur - castbar.startTime + 0.5) / castbar.max + if castbar.channeling or castbar:GetReverseFill() then + sparkPosition = 1 - sparkPosition end - if not unit.notInterruptible then - local db = unit:GetParent().db - if not db or not db.castbar then - return - end - - local interruptCD = 0 - local interruptReadyInTime = false - local overlaySize = 0 - local inactivetime = E.db[mPlugin].mCastbar.inactivetime - - if interruptSpellId then - local cdStart, cdDur = GetSpellCooldown(interruptSpellId) - local _, statusMax = unit:GetMinMaxValues() - local value = unit:GetValue() - interruptCD = (cdStart > 0 and cdDur - (GetTime() - cdStart)) or 0 - - if unit.channeling then - interruptReadyInTime = (interruptCD + 0.5) < value - else - interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) - end - - if not unit.InterruptMarker then - unit.InterruptMarker = unit:CreateTexture(nil, "overlay") - unit.InterruptMarker:SetColorTexture( - E.db[mPlugin].mCastbar.readymarker.r, - E.db[mPlugin].mCastbar.readymarker.g, - E.db[mPlugin].mCastbar.readymarker.b - ) - unit.InterruptMarker:Hide() - end - - if interruptCD > inactivetime and interruptReadyInTime then - local range = (interruptCD / statusMax) - if range then - local width = unit:GetWidth() - local pos = "left" - overlaySize = unit:GetReverseFill() and (width - (width * range)) or (width * range) - unit.InterruptMarker:SetSize(2, unit:GetHeight()) - unit.InterruptMarker:SetPoint(pos, unit, pos, overlaySize, 0) - unit.InterruptMarker:SetVertexColor(1, 1, 1) - unit.InterruptMarker:Show() - end - end + castbar.InterruptMarker:SetPoint("center", castbar, "left", sparkPosition * castbar:GetWidth(), 0) + castbar.InterruptMarker:Show() - if E.db[mPlugin].mCastbar.gardient then - if interruptCD > inactivetime and interruptReadyInTime then - unit:GetStatusBarTexture():SetGradient( - "HORIZONTAL", - { r = colorKickinTime.r, g = colorKickinTime.g, b = colorKickinTime.b, a = 1 }, - { r = colorKickinTimeb.r, g = colorKickinTimeb.g, b = colorKickinTimeb.b, a = 1 } - ) - elseif interruptCD > inactivetime then - unit:GetStatusBarTexture():SetGradient( - "HORIZONTAL", - { r = colorKickonCD.r, g = colorKickonCD.g, b = colorKickonCD.b, a = 1 }, - { r = colorKickonCDb.r, g = colorKickonCDb.g, b = colorKickonCDb.b, a = 1 } - ) - end - else - if interruptCD > inactivetime and interruptReadyInTime then - unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > inactivetime then - unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) - end - end - end + if E.db[mPlugin].mCastbar.gardient then + castbar:GetStatusBarTexture():SetGradient( + "HORIZONTAL", + { r = colorInterruptinTime.r, g = colorInterruptinTime.g, b = colorInterruptinTime.b, a = 1 }, + { r = colorInterruptinTimeb.r, g = colorInterruptinTimeb.g, b = colorInterruptinTimeb.b, a = 1 } + ) + else + castbar:SetStatusBarColor(colorInterruptinTime.r, colorInterruptinTime.g, colorInterruptinTime.b) end - end) + elseif interruptCD and interruptCD > inactivetime then + if E.db[mPlugin].mCastbar.gardient then + castbar:GetStatusBarTexture():SetGradient( + "HORIZONTAL", + { r = colorInterruptonCD.r, g = colorInterruptonCD.g, b = colorInterruptonCD.b, a = 1 }, + { r = colorInterruptonCDb.r, g = colorInterruptonCDb.g, b = colorInterruptonCDb.b, a = 1 } + ) + else + castbar:SetStatusBarColor(colorInterruptonCD.r, colorInterruptonCD.g, colorInterruptonCD.b) + end + end + end +end +function mMT:mSetupCastbar() + interruptSpellID = interruptSpellList[select(1, GetSpecializationInfo(GetSpecialization()))] + if interruptSpellID then + hooksecurefunc(NP, "Castbar_CheckInterrupt", InterruptChecker) + hooksecurefunc(UF, "PostCastStart", InterruptChecker) end end @@ -341,7 +276,7 @@ local function mCastbarOptions() type = "description", name = "\n\n", }, - colorkickintime = { + colorInterruptinTime = { type = "color", order = 15, name = L["Kick ready in Time"], @@ -355,7 +290,7 @@ local function mCastbarOptions() t.r, t.g, t.b = r, g, b end, }, - colorkickintimeb = { + colorInterruptinTimeb = { type = "color", order = 16, name = L["Gradient color"], diff --git a/misc/mNameplateTools.lua b/misc/mNameplateTools.lua index b20b42e6..f240ac80 100644 --- a/misc/mNameplateTools.lua +++ b/misc/mNameplateTools.lua @@ -9,6 +9,8 @@ local mInsert = table.insert local CreateFrame = CreateFrame local addon, ns = ... +local IsResting = IsResting + local HM_NPCs = { -- DF Dungeons [190485] = { 50 }, --Stormvein - Ruby Life pools @@ -113,7 +115,7 @@ local HM_NPCs = { [116410] = { 33 }, -- Karam Magespear } -local executeAutoRange = {enabel = false, range = 30} +local executeAutoRange = { enabel = false, range = 30 } function mMT:updateAutoRange() executeAutoRange.enabel = false @@ -306,16 +308,14 @@ local function healthMarkers(unit, percent) end local function mNameplateTools(table, event, frame) - if table.isNamePlate then - if table.Health and table.Health.max and E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable then - local percent = math.floor((table.Health.cur or 100) / table.Health.max * 100 + 0.5) - if E.db[mPlugin].mHealthmarker.enable then - healthMarkers(table, percent) - end + if table.isNamePlate and table.Health and table.Health.max and executeAutoRange.enabel then + local percent = math.floor((table.Health.cur or 100) / table.Health.max * 100 + 0.5) + if E.db[mPlugin].mHealthmarker.enable then + healthMarkers(table, percent) + end - if E.db[mPlugin].mExecutemarker.enable then - executeMarker(table, percent) - end + if E.db[mPlugin].mExecutemarker.enable then + executeMarker(table, percent) end end end diff --git a/misc/mRoleIcons.lua b/misc/mRoleIcons.lua index ff055010..cbf21727 100644 --- a/misc/mRoleIcons.lua +++ b/misc/mRoleIcons.lua @@ -71,7 +71,7 @@ local function mSetupIcons() end --bigsword - for i = 1, 14, 1 do + for i = 1, 15, 1 do path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\icons\\bigsword%s.tga", i) mIcons["bigsword" .. i] = { ["file"] = path, ["icon"] = E:TextureString(path, sizeString) .. "bigsword" .. i } @@ -121,12 +121,6 @@ local function mSetupIcons() mIcons["crown" .. i] = { ["file"] = path, ["icon"] = E:TextureString(path, sizeString) .. "crown" .. i } end - --colored - for i = 1, 13, 1 do - path = format("Interface\\AddOns\\ElvUI_mMediaTag\\media\\icons\\colored%s.tga", i) - mIcons["colored" .. i] = { ["file"] = path, ["icon"] = E:TextureString(path, sizeString) .. "colored" .. i } - end - wipe(mIconsList) for i in pairs(mIcons) do mIconsList[i] = mIcons[i].icon