From f2065abcfc4ff0b8c07ab25e631bfa1ef3a3c952 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Wed, 11 Feb 2026 18:25:01 -0500 Subject: [PATCH] change spell dmg color by type outgoing only --- .../MikScrollingBattleText.lua | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/MikScrollingBattleText/MikScrollingBattleText.lua b/MikScrollingBattleText/MikScrollingBattleText.lua index 6aefdd9..06765b6 100644 --- a/MikScrollingBattleText/MikScrollingBattleText.lua +++ b/MikScrollingBattleText/MikScrollingBattleText.lua @@ -138,17 +138,32 @@ local function GetDamageTypeColor(dt) if not damageTypeColors then damageTypeColors = { [SPELL_SCHOOL1_CAP] = "\124cffF6F99E\124h", - [SPELL_SCHOOL2_CAP] = "\124cffFF8080\124h", - [SPELL_SCHOOL3_CAP] = "\124cff80FF80\124h", - [SPELL_SCHOOL4_CAP] = "\124cff8080FF\124h", - [SPELL_SCHOOL5_CAP] = "\124cffA000A0\124h", - [SPELL_SCHOOL6_CAP] = "\124cffFFB9FF\124h", - ["Inconnu"] = "\124cffFFB9FF\124h", + [SPELL_SCHOOL2_CAP] = "\124cffFF4444\124h", + [SPELL_SCHOOL3_CAP] = "\124cff44FF44\124h", + [SPELL_SCHOOL4_CAP] = "\124cff4488FF\124h", + [SPELL_SCHOOL5_CAP] = "\124cff6600CC\124h", + [SPELL_SCHOOL6_CAP] = "\124cffCC66FF\124h", + ["Inconnu"] = "\124cffCC66FF\124h", } end return damageTypeColors[dt] end +-- Damage type → {r, g, b} float lookup for SetTextColor (lazily initialized). +local damageTypeFontColors +local function GetDamageTypeFontColor(dt) + if not damageTypeFontColors then + damageTypeFontColors = { + [SPELL_SCHOOL2_CAP] = { r=1.0, g=0.27, b=0.27 }, -- Fire (red) + [SPELL_SCHOOL3_CAP] = { r=0.27, g=1.0, b=0.27 }, -- Nature (green) + [SPELL_SCHOOL4_CAP] = { r=0.27, g=0.53, b=1.0 }, -- Frost (blue) + [SPELL_SCHOOL5_CAP] = { r=0.4, g=0.0, b=0.8 }, -- Shadow (deep purple) + [SPELL_SCHOOL6_CAP] = { r=0.8, g=0.4, b=1.0 }, -- Arcane (purple/pink) + } + end + return damageTypeFontColors[dt] +end + -- Number of font strings. local NUM_FONT_STRINGS = 20; @@ -1728,6 +1743,17 @@ function MikSBT.AddAnimation(animationEvent) animDisplayInfo.ColorG = animationEvent.EventSettings.FontSettings.Color.g; animDisplayInfo.ColorB = animationEvent.EventSettings.FontSettings.Color.b; + -- Override font color based on spell school damage type (outgoing only). + if animationEvent.DamageType and animationEvent.EventType + and string_find(animationEvent.EventType, "OUTGOING") then + local dtColor = GetDamageTypeFontColor(animationEvent.DamageType) + if dtColor then + animDisplayInfo.ColorR = dtColor.r + animDisplayInfo.ColorG = dtColor.g + animDisplayInfo.ColorB = dtColor.b + end + end + -- No event type associated with the event so get the display info from the animation event itself. else -- Get the font size for the event.