mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
nampower v2_71 compatibility
This commit is contained in:
+30
-1
@@ -54,11 +54,16 @@
|
|||||||
- SPELL_ENERGIZE_BY_SELF / SPELL_ENERGIZE_BY_OTHER / SPELL_ENERGIZE_ON_SELF
|
- SPELL_ENERGIZE_BY_SELF / SPELL_ENERGIZE_BY_OTHER / SPELL_ENERGIZE_ON_SELF
|
||||||
- Requires NP_EnableSpellHealEvents=1 and NP_EnableSpellEnergizeEvents=1 CVars
|
- Requires NP_EnableSpellHealEvents=1 and NP_EnableSpellEnergizeEvents=1 CVars
|
||||||
|
|
||||||
|
Texture Lookup API Changes (v2.71+):
|
||||||
|
- GetSpellTexture now REQUIRES bookType for slot-based lookups
|
||||||
|
- New formats: "spellId:number" prefix, spell name lookup
|
||||||
|
- This file includes compatibility shim to maintain backwards compatibility
|
||||||
|
|
||||||
Settings Integration:
|
Settings Integration:
|
||||||
- Reads from NampowerSettings addon when available
|
- Reads from NampowerSettings addon when available
|
||||||
- Falls back to CVars when addon not present
|
- Falls back to CVars when addon not present
|
||||||
|
|
||||||
Current version: v2.26.0
|
Current version: v2.71.0
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local _G = _G or getfenv(0)
|
local _G = _G or getfenv(0)
|
||||||
@@ -317,6 +322,30 @@ local function DetectEnhancedSpellFunctions()
|
|||||||
return API.features.hasEnhancedSpellFunctions
|
return API.features.hasEnhancedSpellFunctions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if GetSpellTexture and GetNampowerVersion then
|
||||||
|
local originalGetSpellTexture = GetSpellTexture
|
||||||
|
local BOOKTYPE_SPELL_DEFAULT = BOOKTYPE_SPELL or "spell"
|
||||||
|
|
||||||
|
-- Check version - only apply shim for v2.71+
|
||||||
|
local major, minor = GetNampowerVersion()
|
||||||
|
local version = (major or 0) * 100 + (minor or 0)
|
||||||
|
|
||||||
|
if version >= 271 then
|
||||||
|
_G.GetSpellTexture = function(arg1, arg2)
|
||||||
|
-- If numeric arg1 (slot) without bookType, add default BOOKTYPE_SPELL
|
||||||
|
if type(arg1) == "number" and arg2 == nil then
|
||||||
|
return originalGetSpellTexture(arg1, BOOKTYPE_SPELL_DEFAULT)
|
||||||
|
end
|
||||||
|
-- Otherwise pass through as-is
|
||||||
|
return originalGetSpellTexture(arg1, arg2)
|
||||||
|
end
|
||||||
|
|
||||||
|
API._getSpellTextureShimInstalled = true
|
||||||
|
API._getSpellTextureShimVersion = "v2.71+"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Initialize features immediately on load
|
-- Initialize features immediately on load
|
||||||
InitializeFeatures()
|
InitializeFeatures()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user