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:
Brues
2026-07-19 02:46:43 -05:00
parent 496979f486
commit 73fd6803ab
4 changed files with 24 additions and 10351 deletions
+23 -12
View File
@@ -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},