mirror of
https://github.com/brues-code/Vanilla_MikScrollingBattleText.git
synced 2026-10-10 07:30:02 +00:00
Replace Babble-Spell library with Nampower GetSpellRecField
Drop the bundled Babble-Spell-2.2 localization library and resolve spell names from their IDs via Nampower's GetSpellRecField(id, "name"). Adds a shared MikSBT.SpellName(id, fallback) helper that returns the client's localized name when Nampower is present and falls back to the English name otherwise, so DEFAULT_CONFIG still builds without a Lua error when Nampower is absent. Also removes the now-redundant BS:GetSpellIcon fallback in the icon resolver (the Nampower spellIconID path already covers it) and drops the lib from the .toc.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -133,9 +133,6 @@ NO_ICON_CACHE = {}
|
||||
-- Cache for spellId-based icon lookups (bypasses Babble-Spell and tooltip scanning).
|
||||
local spellIdIconCache = {}
|
||||
|
||||
-- Babble-Spell pour les icones des spells de classe
|
||||
local BS = AceLibrary("Babble-Spell-2.2")
|
||||
|
||||
-- Damage type → color prefix lookup (lazily initialized after globals are available).
|
||||
local damageTypeColors
|
||||
local function GetDamageTypeColor(dt)
|
||||
@@ -1343,7 +1340,7 @@ function MikSBT.UpdateProfiles()
|
||||
if (profile.CreationVersion < 4.1) then
|
||||
|
||||
if profile.Triggers.MSBT_TRIGGER_WINDFURY then -- Fix Windfury Trigger
|
||||
profile.Triggers.MSBT_TRIGGER_WINDFURY.TriggerSettings.SearchPatterns[1] = string.format(AURAADDEDSELFHELPFUL, string_gsub(BS["Windfury Totem"], "-", "%%-"))
|
||||
profile.Triggers.MSBT_TRIGGER_WINDFURY.TriggerSettings.SearchPatterns[1] = string.format(AURAADDEDSELFHELPFUL, string_gsub(MikSBT.SpellName(8512, "Windfury Totem"), "-", "%%-"))
|
||||
end
|
||||
|
||||
if profile.Triggers.MSBT_TRIGGER_HAND_OF_JUSTICE then -- Delete Hand of Justice Trigger
|
||||
@@ -1870,7 +1867,6 @@ function MikSBT.AddAnimation(animationEvent)
|
||||
local name = string_gsub(animationEvent.EffectName, " %(%d+%)", "")
|
||||
-- DEFAULT_CHAT_FRAME:AddMessage(animationEvent.EffectName)
|
||||
-- DEFAULT_CHAT_FRAME:AddMessage(name)
|
||||
-- texture = BS:GetSpellIcon(name)
|
||||
if ICON_CACHE[strlower(name)] then
|
||||
texture = ICON_CACHE[strlower(name)]
|
||||
elseif not texture and MikSBT.FindBuff(name) then
|
||||
@@ -1897,8 +1893,6 @@ function MikSBT.AddAnimation(animationEvent)
|
||||
if ok3 and tex then texture = tex; ICON_CACHE[strlower(name)] = tex end
|
||||
end
|
||||
end
|
||||
elseif not texture and BS and BS.GetSpellIcon and BS:GetSpellIcon(name) then
|
||||
texture = BS:GetSpellIcon(name)
|
||||
elseif not texture and MikSBT.FindItemIcon(name) then
|
||||
texture = MikSBT.FindItemIcon(name)
|
||||
ICON_CACHE[strlower(name)] = MikSBT.FindItemIcon(name)
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
Libs\AceLibrary\AceLibrary.lua
|
||||
Libs\AceLocale-2.2\AceLocale-2.2.lua
|
||||
Libs\BabbleSpell-2.2\Babble-Spell-2.2.lua
|
||||
|
||||
MikScrollingBattleText-enUS.lua
|
||||
MikScrollingBattleText-frFR.lua
|
||||
|
||||
@@ -18,9 +18,20 @@ MikSBT.WINDOW_TITLE = "Mik's Scrolling Battle Text " .. MikSBT.VERSION_STRING ..
|
||||
|
||||
MikSBT.COMMAND = "/msbt";
|
||||
|
||||
local BS = AceLibrary("Babble-Spell-2.2")
|
||||
local L = AceLibrary("AceLocale-2.2"):new(MikSBT.MOD_NAME)
|
||||
|
||||
-- Resolves a spell's localized name from its ID via Nampower's GetSpellRecField,
|
||||
-- replacing the old Babble-Spell library. Falls back to the given English name when
|
||||
-- Nampower is absent (vanilla has no built-in spellId->name lookup). Shared across
|
||||
-- files via the MikSBT namespace; localization.lua loads first per the .toc.
|
||||
function MikSBT.SpellName(id, fallback)
|
||||
if GetSpellRecField then
|
||||
local ok, n = pcall(GetSpellRecField, id, "name")
|
||||
if ok and n and n ~= "" then return n end
|
||||
end
|
||||
return fallback
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- English (Default)
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -1134,7 +1145,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_EXECUTE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Execute"].."!",
|
||||
Message = MikSBT.SpellName(5308, "Execute").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1151,7 +1162,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_HAMMER_OF_WRATH = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Hammer of Wrath"].."!",
|
||||
Message = MikSBT.SpellName(24275, "Hammer of Wrath").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1168,7 +1179,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_COUNTER_ATTACK = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Counterattack"].."!",
|
||||
Message = MikSBT.SpellName(19306, "Counterattack").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1187,7 +1198,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_MONGOOSE_BITE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Mongoose Bite"].."!",
|
||||
Message = MikSBT.SpellName(1495, "Mongoose Bite").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1206,7 +1217,7 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
MSBT_TRIGGER_CLEARCAST = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Clearcasting"].."!",
|
||||
Message = MikSBT.SpellName(16246, "Clearcasting").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1217,14 +1228,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
Classes = {MAGE=true,SHAMAN=true},
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Clearcasting"])},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, MikSBT.SpellName(16246, "Clearcasting"))},
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_shadow_manaburn"
|
||||
},
|
||||
MSBT_TRIGGER_RIPOSTE = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Riposte"].."!",
|
||||
Message = MikSBT.SpellName(14251, "Riposte").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
@@ -1253,14 +1264,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
TriggerSettings = {
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(BS["Windfury Totem"], "-", "%%-"))}, --"Vous gagnez Totem Furie-des-vents" -- escape char !
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, string.gsub(MikSBT.SpellName(8512, "Windfury Totem"), "-", "%%-"))}, --"Vous gagnez Totem Furie-des-vents" -- escape char !
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_nature_cyclone"
|
||||
},
|
||||
MSBT_TRIGGER_NIGHTFALL = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Nightfall"].."!",
|
||||
Message = MikSBT.SpellName(18094, "Nightfall").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=0.709, g=0, b=0.709},
|
||||
@@ -1271,14 +1282,14 @@ MikSBT.DEFAULT_CONFIG = {
|
||||
Classes = {WARLOCK=true},
|
||||
TriggerType = 6,
|
||||
TriggerEvents = {"CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS"},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, BS["Shadow Trance"])},
|
||||
SearchPatterns = {string.format(AURAADDEDSELFHELPFUL, MikSBT.SpellName(17941, "Shadow Trance"))},
|
||||
},
|
||||
Texture = "Interface\\Icons\\spell_shadow_twilight"
|
||||
},
|
||||
MSBT_TRIGGER_OVERPOWER = {
|
||||
EventSettings = {
|
||||
Show = true,
|
||||
Message = BS["Overpower"].."!",
|
||||
Message = MikSBT.SpellName(7384, "Overpower").."!",
|
||||
IsSticky = true,
|
||||
FontSettings = {
|
||||
Color = {r=1, g=1, b=0},
|
||||
|
||||
Reference in New Issue
Block a user