From a55fbf92ebe16090291f3a21e234c774ef23ee3c Mon Sep 17 00:00:00 2001 From: Continuity Date: Thu, 14 Nov 2024 21:36:20 +0100 Subject: [PATCH] - fix options and glow --- Plater_BossModsSupport.lua | 25 +++++++++++++++--------- Plater_DefaultSettings.lua | 7 ++++--- options/Plater_O_BossMod.lua | 38 +++++++++++++++++++++++------------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/Plater_BossModsSupport.lua b/Plater_BossModsSupport.lua index 8dfe87b0..0a7b491e 100644 --- a/Plater_BossModsSupport.lua +++ b/Plater_BossModsSupport.lua @@ -138,10 +138,10 @@ local function StartGlow(self, glowType) } Plater.StartButtonGlow(self, self.bmData.color or "orange", options, "BM_ImportantIconGlow") end - self.isGlowing = true end local function StopGlow(self, glowType) + --print("StopGlow", glowType) if not glowType then Plater.StopGlow(self, "BM_ImportantIconGlow") elseif glowType == 1 then @@ -153,7 +153,6 @@ local function StopGlow(self, glowType) elseif glowType == 4 then Plater.StopButtonGlow(self, "BM_ImportantIconGlow") end - self.isGlowing = false end function Plater.CreateBossModAuraFrame(unitFrame) @@ -195,14 +194,21 @@ function Plater.CreateBossModAuraFrame(unitFrame) end local profile = Plater.db.profile - local canGlow = profile.bossmod_aura_glow_expiring and (not profile.bossmod_aura_glow_important_only or profile.bossmod_aura_glow_important_only and self.bmData and self.bmData.isPriority) and self.timeRemaining < 4 and self.timeRemaining > 0 - local stopGlow = self.timeRemaining < 0 - local glowType = self.bmData and self.bmData.isPriority and profile.bossmod_aura_glow_important_glow_type or profile.bossmod_aura_glow_expiring_glow_type + local bmData = self.bmData or {} + local canGlow = false + if bmData.barType ~= "castnp" and (profile.bossmod_aura_glow_cooldown and (not bossmod_aura_glow_important_only or bmData.isPriority)) and self.timeRemaining < 4 and self.timeRemaining > 0 then + canGlow = true + elseif bmData.barType == "castnp" and profile.bossmod_aura_glow_casts and self.timeRemaining < 4 and self.timeRemaining > 0 then + canGlow = true + end + local glowType = bmData.barType == "castnp" and profile.bossmod_aura_glow_casts_glow_type or profile.bossmod_aura_glow_cooldown_glow_type --print(canGlow, self.isGlowing) if canGlow and not self.isGlowing then StartGlow(self, glowType) - elseif not canGlow and self.isGlowing or stopGlow then - StopGlow(self, glowType) + self.isGlowing = glowType + elseif not canGlow and self.isGlowing ~= false or self.timeRemaining < 0 then + StopGlow(self, self.isGlowing) + self.isGlowing = false end self.lastUpdateCooldown = now @@ -269,8 +275,10 @@ function Plater.UpdateBossModAuras(unitFrame) -- spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff icon.Texture:SetDesaturated(values.desaturate) icon.bmData = values - icon.isGlowing = icon.isGlowing and true or false icon.lastUpdateCooldown = icon.lastUpdateCooldown or 0 + if self.isGlowing ~= false then + StopGlow(self, self.isGlowing) + end iconFrame.OnIconTick(icon) --icon.Cooldown:SetDesaturated(values.desaturate) @@ -347,7 +355,6 @@ function Plater.UpdateBossModAuras(unitFrame) -- spellId, borderColor, startTime, duration, forceTexture, descText, count, debuffType, caster, canStealOrPurge, spellName, isBuff --DF:TruncateText(icon.Desc, Plater.db.profile.bossmod_aura_width) icon.bmData = data - icon.isGlowing = icon.isGlowing and true or false icon.lastUpdateCooldown = icon.lastUpdateCooldown or 0 iconFrame.OnIconTick(icon) if data.paused then diff --git a/Plater_DefaultSettings.lua b/Plater_DefaultSettings.lua index b4a03d25..e43e2f76 100644 --- a/Plater_DefaultSettings.lua +++ b/Plater_DefaultSettings.lua @@ -955,10 +955,11 @@ PLATER_DEFAULT_SETTINGS = { bossmod_cooldown_text_size = 16, bossmod_cooldown_text_enabled = true, bossmod_icons_anchor = {side = 2, x = -5, y = 25}, + bossmod_aura_glow_cooldown = true, bossmod_aura_glow_important_only = true, - bossmod_aura_glow_expiring = true, - bossmod_aura_glow_important_glow_type = 4, - bossmod_aura_glow_expiring_glow_type = 1, + bossmod_aura_glow_casts = true, + bossmod_aura_glow_casts_glow_type = 4, + bossmod_aura_glow_cooldown_glow_type = 1, not_affecting_combat_enabled = false, not_affecting_combat_alpha = 0.6, diff --git a/options/Plater_O_BossMod.lua b/options/Plater_O_BossMod.lua index e24cda64..c19e1946 100644 --- a/options/Plater_O_BossMod.lua +++ b/options/Plater_O_BossMod.lua @@ -272,13 +272,13 @@ function platerInternal.CreateBossModOptions() }, { type = "toggle", - get = function() return Plater.db.profile.bossmod_aura_glow_expiring end, + get = function() return Plater.db.profile.bossmod_aura_glow_cooldown end, set = function (self, fixedparam, value) - Plater.db.profile.bossmod_aura_glow_expiring = value + Plater.db.profile.bossmod_aura_glow_cooldown = value Plater.UpdateAllPlates() end, - name = "Expiring Icon Glow", - desc = "Enable glow on expiring timer icons.", + name = "Cooldown Icon Glow", + desc = "Enable glow on expiring cooldown timer icons.", }, { type = "toggle", @@ -287,22 +287,32 @@ function platerInternal.CreateBossModOptions() Plater.db.profile.bossmod_aura_glow_important_only = value Plater.UpdateAllPlates() end, - name = "Expiring Icon Glow (important only)", - desc = "Enable glow on important expiring timer icons.", + name = "Glow only important cooldowns", + desc = "Enable glow on important expiring timer icons only.", + }, + { + type = "toggle", + get = function() return Plater.db.profile.bossmod_aura_glow_casts end, + set = function (self, fixedparam, value) + Plater.db.profile.bossmod_aura_glow_casts = value + Plater.UpdateAllPlates() + end, + name = "Cast Icon Glow", + desc = "Enable glow on expiring cast timer icons.", }, { type = "select", - get = function() return Plater.db.profile.bossmod_aura_glow_expiring_glow_type end, - values = function() return build_glow_types_table ("bossmod_aura_glow_expiring_glow_type") end, - name = "Expiring Icon Glow Type", - desc = "Select glow type for expiring timer icons.", + get = function() return Plater.db.profile.bossmod_aura_glow_cooldown_glow_type end, + values = function() return build_glow_types_table ("bossmod_aura_glow_cooldown_glow_type") end, + name = "Cooldown Icon Glow Type", + desc = "Select glow type for important expiring timer icons.", }, { type = "select", - get = function() return Plater.db.profile.bossmod_aura_glow_important_glow_type end, - values = function() return build_glow_types_table ("bossmod_aura_glow_important_glow_type") end, - name = "Important Icon Glow Type", - desc = "Select glow type for important expiring timer icons.", + get = function() return Plater.db.profile.bossmod_aura_glow_casts_glow_type end, + values = function() return build_glow_types_table ("bossmod_aura_glow_casts_glow_type") end, + name = "Cast Icon Glow Type", + desc = "Select glow type for expiring timer icons.", }, }