Skip to content

Commit

Permalink
- fix options and glow
Browse files Browse the repository at this point in the history
  • Loading branch information
cont1nuity committed Nov 14, 2024
1 parent 673b271 commit a55fbf9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 26 deletions.
25 changes: 16 additions & 9 deletions Plater_BossModsSupport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions Plater_DefaultSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
38 changes: 24 additions & 14 deletions options/Plater_O_BossMod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.",
},
}

Expand Down

0 comments on commit a55fbf9

Please sign in to comment.