Hi all
Since the 9.0 launch, my addon no longer displays the Swarm interface category frame.
The addon continues to work without a problem but the player can no longer change options.
Lua Code:
I do get the folowing lua error caught by bugsack;
1x Swarm\Swarm-SR 2.9.9.0.lua:357: attempt to call method 'SetBackdrop' (a nil value)
[string "@Swarm\Swarm-SR 2.9.9.0.lua"]:357: in main chunk
I have searched everywhere yet have not been able to find any reason that my interface category frame no longer displays; I tested my addons yesterday before 9.0 launched and can confirm that they were working without issue.
Here is my chunk;
Lua Code:
local SwarmInterfaceFrame = CreateFrame("Frame", "SwarmInterfaceFrame", UIParent)
SwarmInterfaceFrame.name = "Swarm"
SwarmInterfaceFrame:SetBackdrop( -- line 357
{
bgFile = "Interface\\Buttons\\WHITE8X8",
insets = {
left = NumberDimensionList.insetSize,
right = NumberDimensionList.insetSize,
top = NumberDimensionList.insetSize,
bottom = NumberDimensionList.insetSize
},
tileSize = nil,
tile = false,
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
edgeSize = NumberDimensionList.edgeSize
}
)
SwarmInterfaceFrame:SetBackdropColor(unpack(TextDimensionList.colourBackdrop))
SwarmInterfaceFrame:SetScript(
"OnEvent",
function(self, event, ...)
if event == "PLAYER_LOGIN" then -- fires when a player logs in or reloads
print(TextDimensionList.colourTextNPC .. " *** " .. addonName .. " - " .. versionNumber .. " Loaded *** \n") -- Load Message
swarmSelfPlayerGUID = UnitGUID("player")
initialiseVariables()
updateScrollTargetList()
togglePause()
togglePower()
SwarmMagicButton:Hide()
elseif event == "PLAYER_ENTERING_WORLD" then -- fires when the player sees a loading screen
SwarmMagicButton:Hide()
elseif event == "PLAYER_TARGET_CHANGED" then -- fires when player target changes
SwarmMagicButton:Hide()
if UnitExists("target") and not UnitIsDead("target") then -- must have an alive target
if UnitIsUnit("target", "player") and SwarmOptionsList.Power then -- if the player is the target the button displays
SwarmMagicButton:Show()
SwarmMagicButton:SetMovable(true)
elseif testTargetOnList(getTargetDetails()) and not SwarmOptionsList.Paused and SwarmOptionsList.Power then
SwarmMagicButton:Show()
SwarmMagicButton:SetMovable(false)
SwarmMagicButton:Disable()
if CheckInteractDistance("target", 4) then
SwarmMagicButton:Enable()
end
end
end
else
SwarmMagicButton:Hide()
end
SwarmMagicButton:SetScale(SwarmOptionsList.ButtonScale)
end
)
SwarmInterfaceFrame:RegisterEvent("PLAYER_LOGIN") -- fires when a player logs in or reloads
SwarmInterfaceFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -- fires when the player sees a loading screen
SwarmInterfaceFrame:RegisterEvent("PLAYER_TARGET_CHANGED") -- fires when the player target changes
InterfaceOptions_AddCategory(SwarmInterfaceFrame)
I am looking for some help in fixing and understanding what has happened here.
Cheers