Threat Plates

Threat Plates

31M Downloads

Replacing `GetSpellTexture` with `C_Spell.GetSpellTexture`

kyano opened this issue · 1 comments

commented

Like GetSpellInfo, the global API GetSpellTexture must also change to C_Spell.GetSpellTexture.

--- TidyPlatesInternal/TidyPlatesStatusbar.lua.orig     2024-08-16 02:14:27.192476400 +0900
+++ TidyPlatesInternal/TidyPlatesStatusbar.lua  2024-08-16 02:14:52.422972500 +0900
@@ -9,7 +9,7 @@ local ThreatPlates = Addon.ThreatPlates
 local ceil, string_format = ceil, string.format

 -- WoW APIs
-local GetSpellTexture = GetSpellTexture
+local GetSpellTexture = C_Spell.GetSpellTexture
 local GetNamePlateForUnit = C_NamePlate.GetNamePlateForUnit
 local InCombatLockdown = InCombatLockdown
 local UnitName, UnitIsUnit, UnitClass = UnitName, UnitIsUnit, UnitClass
--- Widgets/BossModsWidget.lua.orig     2024-08-16 02:15:25.288662000 +0900
+++ Widgets/BossModsWidget.lua  2024-08-16 02:15:38.943542700 +0900
@@ -14,7 +14,7 @@ local Widget = Addon.Widgets:NewWidget("
 local floor = math.floor

 -- WoW APIs
-local GetSpellTexture = GetSpellTexture
+local GetSpellTexture = C_Spell.GetSpellTexture
 local GetTime = GetTime
 local tremove = tremove

I found this by getting a Lua error when I enabled Castbar -> Configuration mode -> Toggle on target to adjust nameplate sizes.

from BugSack
410x ...eatPlates/TidyPlatesInternal/TidyPlatesStatusbar.lua:436: attempt to call upvalue 'GetSpellTexture' (a nil value)
[string "@TidyPlates_ThreatPlates/TidyPlatesInternal/TidyPlatesStatusbar.lua"]:436: in function <...eatPlates/TidyPlatesInternal/TidyPlatesStatusbar.lua:430>

Locals:
self = StatusBar {
 Border = Frame {
 }
 Value = 0.217000
 Background = Texture {
 }
 InterruptBorder = Frame {
 }
 IsChanneling = false
 IsCasting = true
 MaxValue = 2
 InterruptOverlay = Texture {
 }
 InterruptShield = Texture {
 }
 Spark = Texture {
 }
 FlashTime = 0
 casttime = FontString {
 }
 CastTarget = FontString {
 }
}
elapsed = 0.017000
db = <table> {
 customtext = <table> {
 }
 highlight = <table> {
 }
 eliteicon = <table> {
 }
 spellicon = <table> {
 }
 unique = <table> {
 }
 elitehealthborder = <table> {
 }
 spelltext = <table> {
 }
 level = <table> {
 }
 normal = <table> {
 }
 customart = <table> {
 }
 healthbar = <table> {
 }
 castbar = <table> {
 }
 threatborder = <table> {
 }
 skullicon = <table> {
 }
 totem = <table> {
 }
 dps = <table> {
 }
 tank = <table> {
 }
 name = <table> {
 }
 castborder = <table> {
 }
 raidicon = <table> {
 }
 frame = <table> {
 }
 healthborder = <table> {
 }
 castnostop = <table> {
 }
}
(*temporary) = Texture {
}
(*temporary) = nil
(*temporary) = 116
(*temporary) = "attempt to call upvalue 'GetSpellTexture' (a nil value)"
plate = NamePlate3 {
 driverFrame = NamePlateDriverFrame {
 }
 template = "NamePlateUnitFrameTemplate"
 namePlateUnitToken = "nameplate2"
 UnitFrame = Button {
 }
 UpdateMe = false
 TPFrame = ThreatPlatesFrameNamePlate3 {
 }
 TimeSinceLastUpdate = 0.017000
}
Addon = <table> {
 IS_WRATH_CLASSIC = false
 Theme = <table> {
 }
 UseUniqueWidget = true
 TotemCreatureType = "토템"
 AurasFilterMode = <table> {
 }
 IS_CATA_CLASSIC = false
 ANCHOR_POINT_SETPOINT = <table> {
 }
 CVars = <table> {
 }
 THREAT_VALUE_TYPE = <table> {
 }
 Font = <table> {
 }
 WOW_USES_CLASSIC_NAMEPLATES = false
 IGNORED_STYLES = <table> {
 }
 PlatesByUnit = <table> {
 }
 Animations = <table> {
 }
 ThreatPlates = <table> {
 }
 ANCHOR_POINT_TEXT = <table> {
 }
 IS_TBC_CLASSIC = false
 MODE_FOR_STYLE = <table> {
 }
 TotemInformation = <table> {
 }
 ON_UPDATE_PER_FRAME = 0.017833
 CUSTOM_PLATES_GLOW_FRAMES = <table> {
 }
 Debug = <table> {
 }
 PlatesByGUID = <table> {
 }
 EventHandler = <table> {
 }
 LibUTF8 = <table> {
 }
 Logging = <table> {
 }
 PLATE_FADE_IN_TIME = 0.500000
 ANCHOR_POINT = <table> {
 }
 CASTBAR_INTERRUPT_HOLD_TIME = 1
 PlayerName = "의빈언니"
 TOTEMS = <table> {
 }
 ActiveWildcardTriggers = false
 SCRIPT_FUNCTIONS = <table> {
 }
 IsInPvEInstance = false
 ActiveScriptTrigger = false
 ActiveCastTriggers = false
 IS_MAINLINE = true
 ON_UPDATE_INTERVAL = 0.250000
 LibAceConfigRegistry = <table> {
 }
 LibAceConfigDialog = <table> {
 }
 IS_CLASSIC = false
 db = <table> {
 }
 WIDGET_EVENTS = <table> {
 }
 IGNORED_STYLES_WITH_NAMEMODE = <table> {
 }
 IS_CLASSIC_SOD = false
 Widgets = <table> {
 }
 CUSTOM_GLOW_WRAPPER_FUNCTIONS = <table> {
 }
 CUSTOM_GLOW_FUNCTIONS = <table> {
 }
 LEGACY_CUSTOM_NAMEPLATES = <table> {
 }
 TARGET_TEXTURES = <table> {
 }
 Cache = <table> {
 }
 LibCustomGlow = <table> {
 }
 DEFAULT_FONT = "기본 글꼴"
 UIScale = 1
 ADDON_DIRECTORY = "Interface\AddOns\TidyPlates_ThreatPlates\"
 DEBUG = true
 BackdropTemplate = "BackdropTemplate"
 LibSharedMedia = <table> {
 }
 PlatesCreated = <table> {
 }
 Data = <table> {
 }
 IsInPvPInstance = false
 DEFAULT_SMALL_FONT = "기본 글꼴"
 PlayerClass = "MAGE"
 ActiveAuraTriggers = false
 GLOW_TYPES = <table> {
 }
 PlatesVisible = <table> {
 }
}
visual = <table> {
 absorbbar = Texture {
 }
 customtext = FontString {
 }
 healthbar = StatusBar {
 }
 healthborder = Frame {
 }
 Highlight = Frame {
 }
 threatborder = Frame {
 }
 skullicon = Texture {
 }
 eliteicon = Texture {
 }
 spellicon = Texture {
 }
 level = FontString {
 }
 name = FontString {
 }
 spelltext = FontString {
 }
 textframe = Frame {
 }
 eliteborder = Frame {
 }
 castbar = StatusBar {
 }
 raidicon = Texture {
 }
}
GetSpellTexture = nil
commented

You are right. Hopefully, these were the last API changes missing. At least I checked that there are not any other GetSpell... functions used wrongly. Thanks for reporting this. It is fixed in the newly released version 12.0.7.