@@ -24,7 +24,7 @@ After embedding you will be able to use the following methods:
2424]]
2525
2626local MAJOR = " LibMagicUtil-1.0"
27- local MINOR = 2024081801
27+ local MINOR = 2024081802
2828
2929local lib = LibStub :NewLibrary (MAJOR , MINOR )
3030local media = LibStub (" LibSharedMedia-3.0" )
@@ -35,7 +35,8 @@ if not lib then return end
3535local embeddables = {
3636 " GetConfigTemplate" , " _GetColorOpt" , " _SetColorOpt" , " _SetOption" , " _GetOption" ,
3737 " _HideOption" , " _DisableTiling" , " FixBackdrop" , " _SetBackgroundOption" ,
38- " InterfaceOptions_AddCategory" , " InterfaceOptionsFrame_OpenToCategory" , " Dump"
38+ " InterfaceOptions_AddCategory" , " InterfaceOptionsFrame_OpenToCategory" , " Dump" ,
39+ " GetSpellInfo"
3940}
4041
4142lib .optionTemplates = lib .optionTemplates or {}
@@ -44,6 +45,17 @@ lib.embeddedAddons = lib.embeddedAddons or {}
4445local optionTemplates = lib .optionTemplates
4546local embeddedAddons = lib .embeddedAddons
4647
48+ lib .GetSpellInfo = GetSpellInfo or function (id )
49+ local spellInfo = C_Spell .GetSpellInfo (id )
50+ if spellInfo then
51+ -- Returning the values in the same order as the original GetSpellInfo
52+ return spellInfo .name , nil , spellInfo .iconID , spellInfo .castTime , spellInfo .minRange , spellInfo .maxRange , spellInfo .spellID , spellInfo .originalIconID
53+ else
54+ -- If the spell is not found, return nil
55+ return nil
56+ end
57+ end
58+
4759function lib :GetConfigTemplate (config , get , set )
4860 assert (self ~= lib , " GetConfigTemplate can only be called when embedded." )
4961 assert (optionTemplates [config ] ~= nil , " Unknown config template: " .. config )
0 commit comments