Thread Tools Display Modes
10-13-20, 11:00 PM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Interface category frame no displaying 9.0

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:
  1. I do get the folowing lua error caught by bugsack;
  2. 1x Swarm\Swarm-SR 2.9.9.0.lua:357: attempt to call method 'SetBackdrop' (a nil value)
  3. [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:
  1. local SwarmInterfaceFrame = CreateFrame("Frame", "SwarmInterfaceFrame", UIParent)
  2. SwarmInterfaceFrame.name = "Swarm"
  3. SwarmInterfaceFrame:SetBackdrop( -- line 357
  4.     {
  5.         bgFile = "Interface\\Buttons\\WHITE8X8",
  6.         insets = {
  7.             left = NumberDimensionList.insetSize,
  8.             right = NumberDimensionList.insetSize,
  9.             top = NumberDimensionList.insetSize,
  10.             bottom = NumberDimensionList.insetSize
  11.         },
  12.         tileSize = nil,
  13.         tile = false,
  14.         edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
  15.         edgeSize = NumberDimensionList.edgeSize
  16.     }
  17. )
  18. SwarmInterfaceFrame:SetBackdropColor(unpack(TextDimensionList.colourBackdrop))
  19. SwarmInterfaceFrame:SetScript(
  20.     "OnEvent",
  21.     function(self, event, ...)
  22.         if event == "PLAYER_LOGIN" then -- fires when a player logs in or reloads
  23.             print(TextDimensionList.colourTextNPC .. " *** " .. addonName .. " - " .. versionNumber .. " Loaded *** \n") -- Load Message
  24.             swarmSelfPlayerGUID = UnitGUID("player")
  25.             initialiseVariables()
  26.             updateScrollTargetList()
  27.             togglePause()
  28.             togglePower()
  29.             SwarmMagicButton:Hide()
  30.         elseif event == "PLAYER_ENTERING_WORLD" then -- fires when the player sees a loading screen
  31.             SwarmMagicButton:Hide()
  32.         elseif event == "PLAYER_TARGET_CHANGED" then -- fires when player target changes
  33.             SwarmMagicButton:Hide()
  34.             if UnitExists("target") and not UnitIsDead("target") then -- must have an alive target
  35.                 if UnitIsUnit("target", "player") and SwarmOptionsList.Power then -- if the player is the target the button displays
  36.                     SwarmMagicButton:Show()
  37.                     SwarmMagicButton:SetMovable(true)
  38.                 elseif testTargetOnList(getTargetDetails()) and not SwarmOptionsList.Paused and SwarmOptionsList.Power then
  39.                     SwarmMagicButton:Show()
  40.                     SwarmMagicButton:SetMovable(false)
  41.                     SwarmMagicButton:Disable()
  42.                     if CheckInteractDistance("target", 4) then
  43.                         SwarmMagicButton:Enable()
  44.                     end
  45.                 end
  46.             end
  47.         else
  48.             SwarmMagicButton:Hide()
  49.         end
  50.         SwarmMagicButton:SetScale(SwarmOptionsList.ButtonScale)
  51.     end
  52. )
  53. SwarmInterfaceFrame:RegisterEvent("PLAYER_LOGIN") -- fires when a player logs in or reloads
  54. SwarmInterfaceFrame:RegisterEvent("PLAYER_ENTERING_WORLD") -- fires when the player sees a loading screen
  55. SwarmInterfaceFrame:RegisterEvent("PLAYER_TARGET_CHANGED") -- fires when the player target changes
  56. InterfaceOptions_AddCategory(SwarmInterfaceFrame)

I am looking for some help in fixing and understanding what has happened here.

Cheers
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
10-13-20, 11:29 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
9.0 Changes

Backdrops have moved to their own template.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 10-13-20 at 11:31 PM.
  Reply With Quote
10-14-20, 03:00 AM   #3
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Hi Fizzlemizz

Thanks for the link.

From what I have read frames no longer have a backdrop unless the frame inherits a backdrop template.

As self-taught programming noob these changes can be very confusing, and hard to find fixes for.

Thanks for your help.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Interface category frame no displaying 9.0

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off