From 27922b54a0fe31d6f5589f726a06cc53417ca22d Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Tue, 28 Mar 2023 19:14:43 +0200 Subject: [PATCH 01/12] gardient interrupt colors and fix talent menu button --- .vscode/settings.json | 3 +- core/mSettings.lua | 11 ++++++ media/textures/r1.tga | Bin 21967 -> 21967 bytes misc/mCastbar.lua | 86 +++++++++++++++++++++++++++++++++++++----- misc/mSystemMenu.lua | 14 ++++--- 5 files changed, 97 insertions(+), 17 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2d5126c5..2aeef50e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -118,7 +118,8 @@ "ShowOptionsPanel", "STAT_CATEGORY_ENHANCEMENTS", "STAT_MASTERY", - "CreateBaseTooltipInfo" + "CreateBaseTooltipInfo", + "class" ], "Lua.diagnostics.disable": [ "redundant-parameter", diff --git a/core/mSettings.lua b/core/mSettings.lua index 4e5c5446..f1626f61 100644 --- a/core/mSettings.lua +++ b/core/mSettings.lua @@ -398,16 +398,27 @@ P[mPlugin] = { }, ["mCastbar"] = { ["enable"] = true, + ["gardient"] = true, ["kickcd"] = { ["r"] = 0.545098, ["g"] = 0, ["b"] = 0.545098, }, + ["kickcdb"] = { + ["r"] = 0.545098, + ["g"] = 0, + ["b"] = 0.545098, + }, ["kickintime"] = { ["r"] = 0, ["g"] = 0.74902, ["b"] = 1, }, + ["kickintimeb"] = { + ["r"] = 0, + ["g"] = 0.74902, + ["b"] = 1, + }, }, ["mHealthmarker"] = { ["enable"] = false, diff --git a/media/textures/r1.tga b/media/textures/r1.tga index d4044248cc5310c3959b4b7ca34c45bfd7dfb545..8c68721642febf2528387f5c87a658e0156fde0a 100644 GIT binary patch delta 43 ycmX@Vn(_Q<#to*S+{_FT4A0pG7>pSVCSMFTm|PIb#cHZ&pl1Z+$xNOdY61W(^9_Rl delta 44 zcmX@Vn(_Q<#to*S+&m0y4A0p47&I7^CtnOUm|PIb#b%;stY>Hh 0 and interruptReadyInTime then - unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > 0 then - unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) + if E.db[mPlugin].mCastbar.gardient then + if interruptCD > 0 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 > 0 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 > 0 and interruptReadyInTime then + unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) + elseif interruptCD > 0 then + unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) + end end end end @@ -146,10 +158,20 @@ function mMT:mSetupCastbar() end if not unit.notInterruptible then - if interruptCD > 0 and interruptReadyInTime then - unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > 0 then - unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) + if E.db[mPlugin].mCastbar.gardient then + if interruptCD > 0 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 > 0 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 > 0 and interruptReadyInTime then + unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) + elseif interruptCD > 0 then + unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) + end end end end @@ -187,6 +209,22 @@ local function mCastbarOptions() type = "description", name = "\n\n", }, + gardient = { + order = 5, + type = "toggle", + name = L["Gardient Mode"], + get = function(info) + return E.db[mPlugin].mCastbar.gardient + end, + set = function(info, value) + E.db[mPlugin].mCastbar.gardient = value + end, + }, + spacer4 = { + order = 6, + type = "description", + name = "\n\n", + }, colorkickcd = { type = "color", order = 11, @@ -201,14 +239,28 @@ local function mCastbarOptions() t.r, t.g, t.b = r, g, b end, }, - spacer3 = { + colorkickcdb = { + type = "color", order = 13, + name = L["Gardient color"], + hasAlpha = false, + get = function(info) + local t = E.db[mPlugin].mCastbar.kickcdb + return t.r, t.g, t.b + end, + set = function(info, r, g, b) + local t = E.db[mPlugin].mCastbar.kickcdb + t.r, t.g, t.b = r, g, b + end, + }, + spacer3 = { + order = 14, type = "description", name = "\n\n", }, colorkickintime = { type = "color", - order = 14, + order = 15, name = L["Kick ready in Time"], hasAlpha = false, get = function(info) @@ -220,6 +272,20 @@ local function mCastbarOptions() t.r, t.g, t.b = r, g, b end, }, + colorkickintimeb = { + type = "color", + order = 16, + name = L["Gardient color"], + hasAlpha = false, + get = function(info) + local t = E.db[mPlugin].mCastbar.kickintimeb + return t.r, t.g, t.b + end, + set = function(info, r, g, b) + local t = E.db[mPlugin].mCastbar.kickintimeb + t.r, t.g, t.b = r, g, b + end, + }, } end diff --git a/misc/mSystemMenu.lua b/misc/mSystemMenu.lua index e842788f..40e5bd13 100644 --- a/misc/mSystemMenu.lua +++ b/misc/mSystemMenu.lua @@ -300,14 +300,16 @@ local function OnClick(self, button) text = format("%s%s|r", mColor(2), TALENTS_BUTTON), isTitle = false, func = function() - if not PlayerTalentFrame then - TalentFrame_LoadUI() + local frame = _G.ClassTalentFrame + if not frame then + LoadAddOn('Blizzard_ClassTalentUI') + frame = _G.ClassTalentFrame end - - if not PlayerTalentFrame:IsShown() then - ShowUIPanel(PlayerTalentFrame) + + if frame:IsShown() then + HideUIPanel(frame) else - HideUIPanel(PlayerTalentFrame) + ShowUIPanel(frame) end end, }, From 3815b2bb82022a33f6074f0056cae0f1e12d89ed Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Tue, 28 Mar 2023 19:31:37 +0200 Subject: [PATCH 02/12] fix talent menu --- misc/mSystemMenu.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/misc/mSystemMenu.lua b/misc/mSystemMenu.lua index 40e5bd13..4871ba35 100644 --- a/misc/mSystemMenu.lua +++ b/misc/mSystemMenu.lua @@ -121,14 +121,16 @@ local function OnClick(self, button) text = format("%s %s%s|r", mMenuIcons(mIconTALENTS), mColor(2), TALENTS_BUTTON), isTitle = false, func = function() - if not PlayerTalentFrame then - TalentFrame_LoadUI() + local frame = _G.ClassTalentFrame + if not frame then + LoadAddOn('Blizzard_ClassTalentUI') + frame = _G.ClassTalentFrame end - if not PlayerTalentFrame:IsShown() then - ShowUIPanel(PlayerTalentFrame) + if frame:IsShown() then + HideUIPanel(frame) else - HideUIPanel(PlayerTalentFrame) + ShowUIPanel(frame) end end, }, @@ -300,16 +302,14 @@ local function OnClick(self, button) text = format("%s%s|r", mColor(2), TALENTS_BUTTON), isTitle = false, func = function() - local frame = _G.ClassTalentFrame - if not frame then - LoadAddOn('Blizzard_ClassTalentUI') - frame = _G.ClassTalentFrame + if not PlayerTalentFrame then + TalentFrame_LoadUI() end - - if frame:IsShown() then - HideUIPanel(frame) + + if not PlayerTalentFrame:IsShown() then + ShowUIPanel(PlayerTalentFrame) else - ShowUIPanel(frame) + HideUIPanel(PlayerTalentFrame) end end, }, From a6c2e684f1d354a76a077c03d9fb6b78f87d0025 Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Wed, 29 Mar 2023 16:11:32 +0200 Subject: [PATCH 03/12] interrupt ready marker --- core/mSettings.lua | 5 ++ misc/mCastbar.lua | 122 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 102 insertions(+), 25 deletions(-) diff --git a/core/mSettings.lua b/core/mSettings.lua index f1626f61..4d0d3d77 100644 --- a/core/mSettings.lua +++ b/core/mSettings.lua @@ -404,6 +404,11 @@ P[mPlugin] = { ["g"] = 0, ["b"] = 0.545098, }, + ["readymarker"] = { + ["r"] = 0.545098, + ["g"] = 0, + ["b"] = 0.545098, + }, ["kickcdb"] = { ["r"] = 0.545098, ["g"] = 0, diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index f2a16496..16f8e8bc 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -87,39 +87,65 @@ 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 colorKickonCDb = E.db[mPlugin].mCastbar.kickcdb local colorKickinTime = E.db[mPlugin].mCastbar.kickintime local colorKickinTimeb = E.db[mPlugin].mCastbar.kickintimeb if interruptSpellId then hooksecurefunc(NP, "Castbar_CheckInterrupt", function(unit) - if unit.unit == "vehicle" or unit.unit == "player" then - return - end + if not unit.notInterruptible then + if unit.unit == "vehicle" or unit.unit == "player" then + return + end - local interruptCD = nil - local interruptReadyInTime = false + local interruptCD = nil + local interruptReadyInTime = false - 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 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 unit.channeling then + interruptReadyInTime = (interruptCD + 0.5) < value + else + interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) + end + + if not unit.IntterruptMarker then + unit.IntterruptMarker = unit:CreateTexture(nil, "overlay") + unit.IntterruptMarker:SetColorTexture(E.db[mPlugin].mCastbar.readymarker.r, E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b) + end + + unit.IntterruptMarker:Hide() + + if interruptCD > 0 and interruptReadyInTime then + local range = (interruptCD / statusMax) + if range then + local overlaySize = unit:GetWidth() * range + unit.IntterruptMarker:SetSize(2, unit:GetHeight()) + unit.IntterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) + unit.IntterruptMarker:SetVertexColor(1, 1, 1) + unit.IntterruptMarker:Show() + end + else + unit.IntterruptMarker:Hide() + end - if not unit.notInterruptible then if E.db[mPlugin].mCastbar.gardient then if interruptCD > 0 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}) + 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 > 0 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}) + 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 > 0 and interruptReadyInTime then @@ -157,14 +183,41 @@ function mMT:mSetupCastbar() interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) end + if not unit.IntterruptMarker then + unit.IntterruptMarker = unit:CreateTexture(nil, "overlay") + unit.IntterruptMarker:SetColorTexture(E.db[mPlugin].mCastbar.readymarker.r, E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b) + unit.IntterruptMarker:SetBlendMode("ADD") + end + + unit.IntterruptMarker:Hide() + + if interruptCD > 0 and interruptReadyInTime then + local range = (interruptCD / statusMax) + if range then + local overlaySize = unit:GetWidth() * range + unit.IntterruptMarker:SetSize(2, unit:GetHeight()) + unit.IntterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) + unit.IntterruptMarker:SetVertexColor(1, 1, 1) + unit.IntterruptMarker:Show() + end + else + unit.IntterruptMarker:Hide() + end + if not unit.notInterruptible then if E.db[mPlugin].mCastbar.gardient then if interruptCD > 0 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}) + 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 > 0 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}) + 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 > 0 and interruptReadyInTime then @@ -286,6 +339,25 @@ local function mCastbarOptions() t.r, t.g, t.b = r, g, b end, }, + spacer5 = { + order = 20, + type = "description", + name = "\n\n", + }, + marker = { + type = "color", + order = 11, + name = L["Readymarker"], + hasAlpha = false, + get = function(info) + local t = E.db[mPlugin].mCastbar.readymarker + return t.r, t.g, t.b + end, + set = function(info, r, g, b) + local t = E.db[mPlugin].mCastbar.readymarker + t.r, t.g, t.b = r, g, b + end, + }, } end From b59c337dda13655513c10db0ceae942da61d1e06 Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Wed, 29 Mar 2023 16:12:25 +0200 Subject: [PATCH 04/12] update settings --- misc/mCastbar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index 16f8e8bc..6554add3 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -346,7 +346,7 @@ local function mCastbarOptions() }, marker = { type = "color", - order = 11, + order = 21, name = L["Readymarker"], hasAlpha = false, get = function(info) From 00f08f57825c65c3c8e91f02fb56aaf8224668eb Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Wed, 29 Mar 2023 20:24:32 +0200 Subject: [PATCH 05/12] hide marker if not interrupteble --- misc/mCastbar.lua | 108 ++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 46 deletions(-) diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index 6554add3..e248f849 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -93,11 +93,15 @@ function mMT:mSetupCastbar() if interruptSpellId then hooksecurefunc(NP, "Castbar_CheckInterrupt", function(unit) - if not unit.notInterruptible then - if unit.unit == "vehicle" or unit.unit == "player" then - return - end + if unit.unit == "vehicle" or unit.unit == "player" then + return + end + + if unit.InterruptMarker then + unit.InterruptMarker:Hide() + end + if not unit.notInterruptible then local interruptCD = nil local interruptReadyInTime = false @@ -113,24 +117,28 @@ function mMT:mSetupCastbar() interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) end - if not unit.IntterruptMarker then - unit.IntterruptMarker = unit:CreateTexture(nil, "overlay") - unit.IntterruptMarker:SetColorTexture(E.db[mPlugin].mCastbar.readymarker.r, E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b) + 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 + ) end - unit.IntterruptMarker:Hide() + unit.InterruptMarker:Hide() if interruptCD > 0 and interruptReadyInTime then local range = (interruptCD / statusMax) if range then local overlaySize = unit:GetWidth() * range - unit.IntterruptMarker:SetSize(2, unit:GetHeight()) - unit.IntterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) - unit.IntterruptMarker:SetVertexColor(1, 1, 1) - unit.IntterruptMarker:Show() + unit.InterruptMarker:SetSize(2, unit:GetHeight()) + unit.InterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) + unit.InterruptMarker:SetVertexColor(1, 1, 1) + unit.InterruptMarker:Show() end else - unit.IntterruptMarker:Hide() + unit.InterruptMarker:Hide() end if E.db[mPlugin].mCastbar.gardient then @@ -163,48 +171,56 @@ function mMT:mSetupCastbar() return end - local db = unit:GetParent().db - if not db or not db.castbar then - return + if unit.InterruptMarker then + unit.InterruptMarker:Hide() end - local interruptCD = 0 - local interruptReadyInTime = false + if not unit.notInterruptible then + local db = unit:GetParent().db + if not db or not db.castbar then + return + end - 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 + local interruptCD = 0 + local interruptReadyInTime = false - if unit.channeling then - interruptReadyInTime = (interruptCD + 0.5) < value - else - interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) - end + 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 unit.IntterruptMarker then - unit.IntterruptMarker = unit:CreateTexture(nil, "overlay") - unit.IntterruptMarker:SetColorTexture(E.db[mPlugin].mCastbar.readymarker.r, E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b) - unit.IntterruptMarker:SetBlendMode("ADD") - end + if unit.channeling then + interruptReadyInTime = (interruptCD + 0.5) < value + else + interruptReadyInTime = (interruptCD + 0.5) < (statusMax - value) + end - unit.IntterruptMarker:Hide() + 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:SetBlendMode("ADD") + end - if interruptCD > 0 and interruptReadyInTime then - local range = (interruptCD / statusMax) - if range then - local overlaySize = unit:GetWidth() * range - unit.IntterruptMarker:SetSize(2, unit:GetHeight()) - unit.IntterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) - unit.IntterruptMarker:SetVertexColor(1, 1, 1) - unit.IntterruptMarker:Show() + unit.InterruptMarker:Hide() + + if interruptCD > 0 and interruptReadyInTime then + local range = (interruptCD / statusMax) + if range then + local overlaySize = unit:GetWidth() * range + unit.InterruptMarker:SetSize(2, unit:GetHeight()) + unit.InterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) + unit.InterruptMarker:SetVertexColor(1, 1, 1) + unit.InterruptMarker:Show() + end + else + unit.InterruptMarker:Hide() end - else - unit.IntterruptMarker:Hide() - end - if not unit.notInterruptible then if E.db[mPlugin].mCastbar.gardient then if interruptCD > 0 and interruptReadyInTime then unit:GetStatusBarTexture():SetGradient( From a7858659b38a9b372531695cb808a822f0cca9c6 Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Thu, 30 Mar 2023 19:13:06 +0200 Subject: [PATCH 06/12] fix marker position if reversfill is active add Inactivetime --- core/mSettings.lua | 1 + misc/mCastbar.lua | 72 +++++++++++++++++++++++++++------------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/core/mSettings.lua b/core/mSettings.lua index 4d0d3d77..08837eb0 100644 --- a/core/mSettings.lua +++ b/core/mSettings.lua @@ -419,6 +419,7 @@ P[mPlugin] = { ["g"] = 0.74902, ["b"] = 1, }, + ["inactivetime"] = .8, ["kickintimeb"] = { ["r"] = 0, ["g"] = 0.74902, diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index e248f849..fae93cc1 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -104,7 +104,8 @@ function mMT:mSetupCastbar() 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() @@ -124,31 +125,29 @@ function mMT:mSetupCastbar() E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b ) + unit.InterruptMarker:Hide() end - - unit.InterruptMarker:Hide() - - if interruptCD > 0 and interruptReadyInTime then + if interruptCD > inactivetime and interruptReadyInTime then local range = (interruptCD / statusMax) if range then - local overlaySize = unit:GetWidth() * range + local width = unit:GetWidth() + local pos = "left" + overlaySize = width * range unit.InterruptMarker:SetSize(2, unit:GetHeight()) - unit.InterruptMarker:SetPoint("left", unit, "left", overlaySize, 0) + unit.InterruptMarker:SetPoint(pos, unit, pos, overlaySize, 0) unit.InterruptMarker:SetVertexColor(1, 1, 1) unit.InterruptMarker:Show() end - else - unit.InterruptMarker:Hide() end if E.db[mPlugin].mCastbar.gardient then - if interruptCD > 0 and interruptReadyInTime 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 > 0 then + elseif interruptCD > inactivetime then unit:GetStatusBarTexture():SetGradient( "HORIZONTAL", { r = colorKickonCD.r, g = colorKickonCD.g, b = colorKickonCD.b, a = 1 }, @@ -156,9 +155,9 @@ function mMT:mSetupCastbar() ) end else - if interruptCD > 0 and interruptReadyInTime then + if interruptCD > inactivetime and interruptReadyInTime then unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > 0 then + elseif interruptCD > inactivetime then unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) end end @@ -183,6 +182,8 @@ function mMT:mSetupCastbar() local interruptCD = 0 local interruptReadyInTime = false + local overlaySize = 0 + local inactivetime = E.db[mPlugin].mCastbar.inactivetime if interruptSpellId then local cdStart, cdDur = GetSpellCooldown(interruptSpellId) @@ -203,32 +204,30 @@ function mMT:mSetupCastbar() E.db[mPlugin].mCastbar.readymarker.g, E.db[mPlugin].mCastbar.readymarker.b ) - unit.InterruptMarker:SetBlendMode("ADD") + unit.InterruptMarker:Hide() end - unit.InterruptMarker:Hide() - - if interruptCD > 0 and interruptReadyInTime then + if interruptCD > inactivetime and interruptReadyInTime then local range = (interruptCD / statusMax) if range then - local overlaySize = unit:GetWidth() * range + 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("left", unit, "left", overlaySize, 0) + unit.InterruptMarker:SetPoint(pos, unit, pos, overlaySize, 0) unit.InterruptMarker:SetVertexColor(1, 1, 1) unit.InterruptMarker:Show() end - else - unit.InterruptMarker:Hide() end if E.db[mPlugin].mCastbar.gardient then - if interruptCD > 0 and interruptReadyInTime 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 > 0 then + elseif interruptCD > inactivetime then unit:GetStatusBarTexture():SetGradient( "HORIZONTAL", { r = colorKickonCD.r, g = colorKickonCD.g, b = colorKickonCD.b, a = 1 }, @@ -236,9 +235,9 @@ function mMT:mSetupCastbar() ) end else - if interruptCD > 0 and interruptReadyInTime then + if interruptCD > inactivetime and interruptReadyInTime then unit:SetStatusBarColor(colorKickinTime.r, colorKickinTime.g, colorKickinTime.b) - elseif interruptCD > 0 then + elseif interruptCD > inactivetime then unit:SetStatusBarColor(colorKickonCD.r, colorKickonCD.g, colorKickonCD.b) end end @@ -281,7 +280,7 @@ local function mCastbarOptions() gardient = { order = 5, type = "toggle", - name = L["Gardient Mode"], + name = L["Gradient Mode"], get = function(info) return E.db[mPlugin].mCastbar.gardient end, @@ -289,8 +288,23 @@ local function mCastbarOptions() E.db[mPlugin].mCastbar.gardient = value end, }, - spacer4 = { + inactivetime = { order = 6, + name = L["Inactivetime"], + desc = L["do not show when the interrupt cast is ready in x seconds"], + type = "range", + min = 0, + max = 40, + step = 0.1, + get = function(info) + return E.db[mPlugin].mCastbar.inactivetime + end, + set = function(info, value) + E.db[mPlugin].mCastbar.inactivetime = value + end, + }, + spacer4 = { + order = 7, type = "description", name = "\n\n", }, @@ -311,7 +325,7 @@ local function mCastbarOptions() colorkickcdb = { type = "color", order = 13, - name = L["Gardient color"], + name = L["Gradient color"], hasAlpha = false, get = function(info) local t = E.db[mPlugin].mCastbar.kickcdb @@ -344,7 +358,7 @@ local function mCastbarOptions() colorkickintimeb = { type = "color", order = 16, - name = L["Gardient color"], + name = L["Gradient color"], hasAlpha = false, get = function(info) local t = E.db[mPlugin].mCastbar.kickintimeb From df3b6ba50584deba180b992f5ef8c5c156264f45 Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Thu, 30 Mar 2023 20:13:18 +0200 Subject: [PATCH 07/12] range update --- misc/mCastbar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/mCastbar.lua b/misc/mCastbar.lua index fae93cc1..c94ace60 100644 --- a/misc/mCastbar.lua +++ b/misc/mCastbar.lua @@ -294,7 +294,7 @@ local function mCastbarOptions() desc = L["do not show when the interrupt cast is ready in x seconds"], type = "range", min = 0, - max = 40, + max = 4, step = 0.1, get = function(info) return E.db[mPlugin].mCastbar.inactivetime From 609ee6be300e580156be99f0c5bd938b0b92b143 Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Thu, 30 Mar 2023 20:21:14 +0200 Subject: [PATCH 08/12] fix for no helth max --- core/init.lua | 2 +- misc/mNameplateTools.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/init.lua b/core/init.lua index 861a165a..09973144 100644 --- a/core/init.lua +++ b/core/init.lua @@ -49,7 +49,7 @@ function mMT:Initialize() mMT:mMisc() -- module laden if E.Retail then - if E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable then + if E.private.nameplates.enable and E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable then mMT:StartNameplateTools() end diff --git a/misc/mNameplateTools.lua b/misc/mNameplateTools.lua index bb6a2f56..b20b42e6 100644 --- a/misc/mNameplateTools.lua +++ b/misc/mNameplateTools.lua @@ -307,7 +307,7 @@ end local function mNameplateTools(table, event, frame) if table.isNamePlate then - if table.Health and E.db[mPlugin].mHealthmarker.enable or E.db[mPlugin].mExecutemarker.enable 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) From 0d476a79991ad0d6dabf72802b662946f87eea8e Mon Sep 17 00:00:00 2001 From: mBlinkii Date: Fri, 31 Mar 2023 19:19:53 +0200 Subject: [PATCH 09/12] add combat icons to elvui dropdown - thx eltreum --- core/init.lua | 7 +++++++ core/settings/defaultSettings.lua | 5 ----- core/settings/load_settings.xml | 4 ---- core/settings/main.lua | 0 4 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 core/settings/defaultSettings.lua delete mode 100644 core/settings/load_settings.xml delete mode 100644 core/settings/main.lua diff --git a/core/init.lua b/core/init.lua index 09973144..b10973d3 100644 --- a/core/init.lua +++ b/core/init.lua @@ -48,6 +48,13 @@ function mMT:Initialize() mMT:mMisc() -- module laden + E.Media.CombatIcons.mMT1 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\combat1.tga]] + E.Media.CombatIcons.mMT2 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\combat2.tga]] + E.Media.CombatIcons.mMT3 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\fire1.tga]] + E.Media.CombatIcons.mMT4 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\fire9.tga]] + E.Media.CombatIcons.mMT5 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\lightning7.tga]] + E.Media.CombatIcons.mMT6 = [[Interface\AddOns\ElvUI_mMediaTag\media\icons\lightning9.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/settings/defaultSettings.lua b/core/settings/defaultSettings.lua deleted file mode 100644 index 0a8d3157..00000000 --- a/core/settings/defaultSettings.lua +++ /dev/null @@ -1,5 +0,0 @@ -local mMT, E, L, V, P, G = unpack(select(2, ...)) - -P["mMT"] = { - -} \ No newline at end of file diff --git a/core/settings/load_settings.xml b/core/settings/load_settings.xml deleted file mode 100644 index acd3bfc3..00000000 --- a/core/settings/load_settings.xml +++ /dev/null @@ -1,4 +0,0 @@ - -