Compare commits

..
9 Commits
Author SHA1 Message Date
omicron eaebe470b9 Add multiple spell ids support to AuraTrigger
Before AuraTrigger only supported a single spell id but now multiple
spells can activate the same trigger.

Related changes:
- Change the glue between AuraList and AuraTrigger to match this new functionality.
- Update the default frame config
2026-06-26 01:25:10 +02:00
omicron 8be0732930 Replace Trigger:SetState by Trigger:SetStateAndData
Update the use of the old API in most triggers except AuraTrigger. This
means the code isn't in a working state at this commit.
2026-06-25 21:58:04 +02:00
omicron 86e5ed78b0 Change the sort algorithm to use UnitExist instead of frame:IsShown
When UNIT_PET fires, pet units will exist but the UnitWatch will not yet
have shown the frame.
2026-06-24 00:37:15 +02:00
omicron 77ae4ddad3 Make UnitGroup trigger sort on UNIT_PET 2026-06-20 00:24:18 +02:00
omicron 5ac84782d2 Add raid pets to the hardcoded configuration 2026-06-20 00:21:25 +02:00
omicron 24a72cb02f Fixed typos and logic error in UnitFrame:Disable
This function is currently unused so these changes are not tested. The
Disable function now always hides the UnitFrame and calls
UnregisterUnitWatch with the correct parameters.
2026-03-18 02:41:39 +01:00
omicron 851fb5740b Fix type in AuraList:UpdateAura
Due to a typo AuraTrigger:UpdateAura always received nil as its first
(before) parameter. This parameter is currently unused so it did not
trigger an error.
2026-03-18 01:29:43 +01:00
omicron b9d16f5ba2 update config for TBC shaman play 2026-03-18 01:27:07 +01:00
omicron 90d71a54cf temporary enhancement hack: show debuffs in a suboptimal way
In new dungeons you don't really know what debuffs you want to see so
it's hard to configure them. To deal with this I added a quick but
suboptimal feature to show up to 5 debuffs automatically on the unit
frames. It's not great, but it's not terrible either. A hardcoded list
of debuffs to ignore is added too.
2026-03-07 13:21:12 +01:00
3 changed files with 102 additions and 214 deletions

No files matched your search

-175
View File
@@ -26,12 +26,9 @@ local colors = {
disease = { 0.4, 0.2, 0.0 }, disease = { 0.4, 0.2, 0.0 },
poison = { 0.0, 0.7, 0.7 }, poison = { 0.0, 0.7, 0.7 },
curse = { 0.7, 0.0, 0.7 }, curse = { 0.7, 0.0, 0.7 },
immune = { 0.0, 0.2, 0.4 },
bomb = { 1.0, 0.7, 0.7 },
red = { 1, 0, 0 }, red = { 1, 0, 0 },
blue = { 0.4, 0.4, 1 }, blue = { 0.4, 0.4, 1 },
light_blue = { 0.7, 0.7, 1 }, light_blue = { 0.7, 0.7, 1 },
green = { 0.2, 0.9, 0.2 },
} }
---@param list number[] ---@param list number[]
@@ -46,9 +43,6 @@ end
local AURAS_PRIEST_RENEW = set({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222 }) local AURAS_PRIEST_RENEW = set({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222 })
local AURAS_PRIEST_PWS = set({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218 }) local AURAS_PRIEST_PWS = set({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218 })
local AURAS_DRUID_LIFEBLOOM = set({ 33763 })
local AURAS_DRUID_REJUV = set({ 774, 1058, 1430, 2090, 2091, 3627, 8910, 9839, 9840, 9841, 25299, 26981, 26982 })
local AURAS_DRUID_REGROWTH = set({ 8936, 8938, 8939, 8940, 8941, 9750, 9856, 9857, 9858, 26980 })
local function RangeConfig() local function RangeConfig()
local _, class = UnitClass("player") local _, class = UnitClass("player")
@@ -64,12 +58,6 @@ local function RangeConfig()
enemy = "Smite", enemy = "Smite",
fade = 0.2, fade = 0.2,
} }
elseif class == "DRUID" then
return {
friendly = "Rejuvenation",
enemy = "Wrath",
fade = 0.2,
}
else else
return { return {
fade = 0.2, fade = 0.2,
@@ -185,66 +173,6 @@ local function MouseConfig()
data = "/cast [@UNIT,help]Leap of Faith;\n/stopspelltarget", data = "/cast [@UNIT,help]Leap of Faith;\n/stopspelltarget",
}, },
} }
elseif class == "DRUID" then
return {
-- No modifier
{ button = "mouse1", mods = {}, kind = "target" },
{
button = "mouse2",
mods = {},
kind = "macro",
data = "/use [@UNIT,help]Rejuvenation",
},
{
button = "wheel-up",
mods = {},
kind = "macro",
data = "/use [@UNIT,help]Lifebloom",
},
{
button = "wheel-down",
mods = {},
kind = "macro",
data = "/use [@UNIT,help]Regrowth",
},
-- ctrl
{
button = "wheel-up",
mods = { ctrl = true },
kind = "macro",
data = "/use [@UNIT,help]Abolish Poison"
},
{
button = "wheel-down",
mods = { ctrl = true },
kind = "macro",
data = "/use [@UNIT,help]Remove Curse"
},
-- alt
{
button = "mouse1",
mods = { alt = true },
kind = "macro",
data = "/use [@UNIT,help]Innervate",
},
{
button = "mouse2",
mods = { alt = true },
kind = "macro",
data = "/use [@UNIT,dead,help]Rebirth",
},
-- Shift
{
button = "wheel-down",
mods = { shift = true },
kind = "macro",
data = "/use [@UNIT,help]Swiftmend",
},
{ button = "mouse2", mods = { shift = true }, kind = "togglemenu" },
}
elseif class == "MONK" then elseif class == "MONK" then
return { return {
-- No modifier -- No modifier
@@ -519,64 +447,6 @@ local function TriggerClassConfig()
}, },
}, },
} }
elseif class == "DRUID" then
return {
{
kind = "AuraTrigger",
spellIds = AURAS_DRUID_LIFEBLOOM,
own = true, -- Lifebloom
indicator = {
kind = "SquareIndicator",
size = 17,
point = "BOTTOMLEFT",
x = 3,
y = 3,
color = colors.green,
showStacks = true,
fadeTime = 7.0,
flashTime = 2,
},
},
{
kind = "AuraTrigger",
spellIds = AURAS_DRUID_REGROWTH,
own = true, -- Regrowth
indicator = {
kind = "SquareIndicator",
size = 17,
point = "BOTTOMLEFT",
x = 22,
y = 3,
color = colors.yellow,
fadeTime = 21.0,
},
},
{
kind = "AuraTrigger",
spellIds = AURAS_DRUID_REJUV,
own = true, -- Rejuvenation
indicator = {
kind = "SquareIndicator",
size = 17,
point = "BOTTOMLEFT",
x = 41,
y = 3,
color = colors.violet,
fadeTime = 12.0,
},
},
{
kind = "StatusTrigger",
status = "Burn",
invert = false,
indicator = {
kind = "BorderIndicator",
thickness = 3.0,
color = colors.red,
level = 0,
},
},
}
elseif class == "PALADIN" then elseif class == "PALADIN" then
return { return {
{ {
@@ -835,51 +705,6 @@ local function TriggerConfig()
return triggers return triggers
end end
local function StatusColorClassConfig()
local _, class = UnitClass("player")
if class == "DRUID" then
return {
{ status = "Curse", color = colors.curse },
{ status = "Poison", color = colors.poison },
}
elseif class == "MAGE" then
return {
{ status = "Curse", color = colors.curse },
}
elseif class == "PALADIN" then
return {
{ status = "Magic", color = colors.magic },
{ status = "Poison", color = colors.poison },
{ status = "Disease", color = colors.disease },
}
elseif class == "PRIEST" then
return {
{ status = "Magic", color = colors.magic },
{ status = "Disease", color = colors.disease },
}
elseif class == "SHAMAN" then
return {
{ status = "Poison", color = colors.poison },
{ status = "Disease", color = colors.disease },
}
end
return {}
end
local function StatusColorConfig()
local statusColors = {
{ status = "Immune", color = colors.immune },
{ status = "Bomb", color = colors.bomb },
}
for _, entry in ipairs(StatusColorClassConfig()) do
table.insert(statusColors, entry)
end
return statusColors
end
local types = omif.GetModule("types") local types = omif.GetModule("types")
local UnitFrame = types.UnitFrame local UnitFrame = types.UnitFrame
local UnitGroup = types.UnitGroup local UnitGroup = types.UnitGroup
+100 -37
View File
@@ -17,11 +17,6 @@
local omif = select(2, ...) local omif = select(2, ...)
local types = omif.GetModule("types") local types = omif.GetModule("types")
local NameFont = CreateFont("OicronFrames_NameFont")
NameFont:SetFont("Interface\\AddOns\\OmicronFrames\\media\\fonts\\roboto\\Roboto-Bold.ttf", 13, "")
NameFont:SetShadowColor(0, 0, 0)
NameFont:SetShadowOffset(1, -1)
---@class StatusBar ---@class StatusBar
local StatusBar = types.StatusBar local StatusBar = types.StatusBar
@@ -50,6 +45,12 @@ local colors = {
low = { 1.0, 0.0, 0 }, low = { 1.0, 0.0, 0 },
offline = { 0.7, 0.7, 0.7 }, offline = { 0.7, 0.7, 0.7 },
dead = { 0.7, 0.7, 0.7 }, dead = { 0.7, 0.7, 0.7 },
magic = { 0.4, 0.4, 1.0 },
disease = { 0.4, 0.2, 0.0 },
poison = { 0.0, 0.7, 0.7 },
curse = { 0.7, 0.0, 0.7 },
immune = { 0.0, 0.2, 0.4 },
bomb = { 1.0, 0.7, 0.7 },
cyan = { 0.0, 0.8, 0.8 }, cyan = { 0.0, 0.8, 0.8 },
white = { 1.0, 1.0, 1.0 }, white = { 1.0, 1.0, 1.0 },
shield = { 0.85, 0.95, 1.0 }, shield = { 0.85, 0.95, 1.0 },
@@ -84,8 +85,6 @@ function UnitFrame:Init(unit, config)
self.rangeEnemy = config.range.enemy self.rangeEnemy = config.range.enemy
self.rangeFade = config.range.fade self.rangeFade = config.range.fade
self.statusColors = config.statusColors
local secure = self:CreateSecureFrame(width, height) local secure = self:CreateSecureFrame(width, height)
secure:Hide() secure:Hide()
@@ -102,13 +101,13 @@ function UnitFrame:Init(unit, config)
self.absorb = StatusBar:new(self, width, height, 1, true, texture_top) self.absorb = StatusBar:new(self, width, height, 1, true, texture_top)
self.absorb:SetColor(unpack(colors.absorb)) self.absorb:SetColor(unpack(colors.absorb))
self.absorb:SetFillStyle(Enum.StatusBarFillStyle.Reverse) self.absorb:SetFillStyle("REVERSE")
self.shield = StatusBar:new(self, width, height, 1, true, texture_bot) self.shield = StatusBar:new(self, width, height, 1, true, texture_bot)
self.shield:SetColor(unpack(colors.shield)) self.shield:SetColor(unpack(colors.shield))
self.shield:SetRange(0, 1) self.shield:SetRange(0, 1)
self.shield:SetValue(0.6) self.shield:SetValue(0.6)
self.shield:SetFillStyle(Enum.StatusBarFillStyle.Reverse) self.shield:SetFillStyle("REVERSE")
self.auras = AuraList:new(self) self.auras = AuraList:new(self)
@@ -122,6 +121,8 @@ function UnitFrame:Init(unit, config)
self:CreateTriggers(config.triggers) self:CreateTriggers(config.triggers)
self:InitDebuffs()
self:RegisterEvents() self:RegisterEvents()
self:Enable() self:Enable()
end end
@@ -183,8 +184,10 @@ function UnitFrame:CreateName()
local name = self.overlays:CreateFontString(nil, "BACKGROUND") local name = self.overlays:CreateFontString(nil, "BACKGROUND")
self.name = name self.name = name
name:SetFontObject(NameFont) name:SetFont("Interface\\AddOns\\OmicronFrames\\media\\fonts\\roboto\\Roboto-Bold.ttf", 13, "")
name:SetTextColor(0.8, 0.6, 0.1) name:SetTextColor(0.8, 0.6, 0.1)
name:SetShadowColor(0, 0, 0)
name:SetShadowOffset(1, -1)
name:SetPoint("CENTER") name:SetPoint("CENTER")
name:SetText("") name:SetText("")
name:Show() name:Show()
@@ -487,6 +490,74 @@ function UnitFrame:GROUP_ROSTER_UPDATE()
end end
end end
-- FIXME: This is a total hack job, just quickly want to get debuffs rendering on my unit frames to learn new dungeons
function UnitFrame:InitDebuffs()
local icons = {}
self.debuffIndicators = icons
for i = 1, 5 do
local icon = IconIndicator:new(self, 17, "BOTTOMRIGHT", -2 - (i - 1) * 19, 2, true, 10.0, nil, true)
icons[i] = icon
end
end
local ignoredDebuffs = {
[57723] = true, -- Sated, shaman lust debuff (alliance)
[57724] = true, -- Sated, shaman lust debuff (horde)
[80354] = true, -- Temporal displacement
[390435] = true, -- Exhausstion
[264689] = true, -- Fatigued
[87024] = true, -- Cauterized
[45181] = true, -- Cheated Death
[41425] = true, -- hypothermia
[124275] = true, -- Light stagger
[124274] = true, -- moderate stagger
[124273] = true, -- heavy stagger
[25771] = true, -- Forbearance
[456447] = true, -- Battle-Scarred Veteran
[382912] = true, -- Well-Honed Instincts
[1223611] = true, -- Ethereal Exhaustion
[456779] = true, -- Will of the Dawn
[448005] = true, -- Light of the Martyr
[157131] = true, -- Recently Saved by the Light
[387847] = true,
[206151] = true, -- Challenger's Burden
[113942] = true, -- Demonic Gateway
[1216943] = true, -- void pulsar
[462661] = true, -- Voidbinding
[1239229] = true, -- k'areshi surge
[449042] = true, -- Radiant Light
-- blood draw
}
function UnitFrame:UpdateDebuffs()
local auras = {}
local i = 1
while #auras < 5 do
local aura = C_UnitAuras.GetAuraDataByIndex(self.unit, i, "HARMFUL")
if aura == nil then
break
end
if not ignoredDebuffs[aura.spellId] then
table.insert(auras, aura)
end
i = i + 1
end
for i = 1, 5 do
local aura = auras[i]
local icon = self.debuffIndicators[i]
if aura then
if icon.frame then
icon:Update(aura)
else
icon:Show(aura)
end
elseif icon.frame then
icon:Hide()
end
end
end
function UnitFrame:UNIT_AURA(unit, info) function UnitFrame:UNIT_AURA(unit, info)
if self:HasUnitChanged() then if self:HasUnitChanged() then
self:UpdateAll(true) self:UpdateAll(true)
@@ -495,6 +566,8 @@ function UnitFrame:UNIT_AURA(unit, info)
if self.auras:Update(info) then if self.auras:Update(info) then
self:UpdateHealthColor() self:UpdateHealthColor()
end end
self:UpdateDebuffs()
end end
function UnitFrame:UNIT_HEALTH() function UnitFrame:UNIT_HEALTH()
@@ -537,20 +610,10 @@ function UnitFrame:UNIT_POWER_UPDATE()
self:UpdatePower() self:UpdatePower()
end end
function UnitFrame:GetRole(role) function UnitFrame:UpdateRole(role)
if role == nil then if role == nil then
role = UnitGroupRolesAssigned(self.unit) role = UnitGroupRolesAssigned(self.unit)
end end
if GetPartyAssignment("MAINTANK", self.unit) then
role = "TANK"
end
return role
end
function UnitFrame:UpdateRole(role)
role = self:GetRole(role)
if role == "HEALER" then if role == "HEALER" then
self:EnablePower(Enum.PowerType.Mana) self:EnablePower(Enum.PowerType.Mana)
elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then elseif role == "TANK" and select(3, UnitClass(self.unit)) == 6 then
@@ -608,6 +671,7 @@ function UnitFrame:UpdateAll(unitChanged)
self:UpdateRange() self:UpdateRange()
self:UpdateName() self:UpdateName()
self:UpdateRole() -- Also calls UpdatePower if power is visible self:UpdateRole() -- Also calls UpdatePower if power is visible
self:UpdateDebuffs()
end end
function UnitFrame:UpdateHealth() function UnitFrame:UpdateHealth()
@@ -658,24 +722,23 @@ function UnitFrame:UpdateHealthColor()
if not isFriend then if not isFriend then
self.hp:SetColor(unpack(colors.hostile)) self.hp:SetColor(unpack(colors.hostile))
return elseif self.auras.statusCount["Immune"] then
end self.hp:SetColor(unpack(colors.immune))
elseif self.auras.statusCount["Bomb"] then
local statusColor = nil self.hp:SetColor(unpack(colors.bomb))
for _, entry in ipairs(self.statusColors) do elseif self.auras.statusCount["Magic"] then
if self.auras.statusCount[entry.status] then self.hp:SetColor(unpack(colors.magic))
statusColor = entry.color elseif self.auras.statusCount["Curse"] then
break self.hp:SetColor(unpack(colors.curse))
end elseif self.auras.statusCount["Poison"] then
end self.hp:SetColor(unpack(colors.poison))
elseif self.auras.statusCount["Disease"] then
if statusColor then self.hp:SetColor(unpack(colors.disease))
self.hp:SetColor(unpack(statusColor)) elseif isFriend and UnitIsDead(unit) then
elseif UnitIsDead(unit) then
self.hp:SetColor(unpack(colors.dead)) self.hp:SetColor(unpack(colors.dead))
elseif pct >= 0.90 then elseif isFriend and pct >= 0.90 then
self.hp:SetColor(unpack(colors.healthy)) self.hp:SetColor(unpack(colors.healthy))
elseif pct >= 0.75 then elseif isFriend and pct >= 0.75 then
local progress = (pct - 0.75) / (0.90 - 0.75) local progress = (pct - 0.75) / (0.90 - 0.75)
self.hp:SetInterpolatedColor(colors.mid, colors.high, progress) self.hp:SetInterpolatedColor(colors.mid, colors.high, progress)
else else
+2 -2
View File
@@ -53,8 +53,8 @@ local function UnitFrameDefaultCompare(lhs, rhs)
end end
-- tank < healer < damage < ? -- tank < healer < damage < ?
local lrole = RoleValue(lhs:GetRole()) local lrole = RoleValue(UnitGroupRolesAssigned(lunit))
local rrole = RoleValue(rhs:GetRole()) local rrole = RoleValue(UnitGroupRolesAssigned(runit))
if lrole ~= rrole then if lrole ~= rrole then
return lrole < rrole return lrole < rrole