Thread Tools Display Modes
04-21-22, 12:52 AM   #1
Kupotek
An Aku'mai Servant
 
Kupotek's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 38
Working on updating my UI

Hello, I'm the author of longtime game UI, Panther, right here on Wowinterface since 2008... I came back to WOW after a few years and am running into a few errors I'm hoping someone can help me fix as I hope to release a new version of the UI soon.

1. In my welcome screen bugsack is giving me a SetBackdrop error, this is the code in my welcome screen addon:

f:SetBackdrop( { bgFile="Interface\\Addons\\DialogFrame\\Smoke", insets={left=4,right=4,top=4,bottom=4}, tileSize=16, tile=false, edgeFile="Interface\\Addons\\DialogFrame\\Border", edgeSize = 8 } )

THE ERROR ITSELF IS:

6x PantherWelcome\PantherWelcome.lua:13: attempt to call method 'SetBackdrop' (a nil value)
[string "@PantherWelcome\PantherWelcome.lua"]:13: in function <PantherWelcome\PantherWelcome.lua:8>

Locals:
(*temporary) = nil
(*temporary) = PantherWelcome {
0 = <userdata>
}
(*temporary) = <table> {
bgFile = "Addons\DialogFrame\Smoke"
tileSize = 16
tile = false
edgeSize = 8
edgeFile = "Addons\DialogFrame\Border"
insets = <table> {
}
}
(*temporary) = "attempt to call method 'SetBackdrop' (a nil value)"
f = PantherWelcome {
0 = <userdata>
}
__________________
Panther UI | My Home on the Web
  Reply With Quote
04-21-22, 01:09 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Every frame used to have a backdrop if it was needed or not. Now they are optional (at least in retail, I don't think change has been backported to the classics yet but...?).

In retail, your frames that require backdrops can inherit the the new BackdropTemplate

Code:
<Frame name="somename" inherits="BackdropTemplate">
    ...
</Frame>

Code:
local f = CreateFrame("Frame", "somename", UIParent, "BackdropTemplate")
and if you want to add a backdrop to a frame that has already been created but hasn't interited the template then you can add the backdrop mixin (code) before setting the backdrop
Code:
if not frame.SetBackdrop then
  Mixin(frame, BackdropTemplateMixin)
end
frame:SetBackdrop(...)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 04-21-22 at 01:18 AM.
  Reply With Quote
04-21-22, 01:28 AM   #3
Kupotek
An Aku'mai Servant
 
Kupotek's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 38
Can you help if I post the addon's code?

PantherWelcomeShow = true -- savedvar

local f = CreateFrame("Frame","PantherWelcome",UIParent)
f:RegisterEvent("PLAYER_LOGIN")


f:SetFrameStrata("dialog")
f:SetScript("OnEvent",function()
if PantherWelcomeShow then
-- main background frame (you can apply your blue border to this backdrop)
f:SetSize(400,350)
f:SetPoint("CENTER")
f:SetBackdrop( { bgFile="Interface\\Addons\\DialogFrame\\Smoke", insets={left=4,right=4,top=4,bottom=4}, tileSize=16, tile=false, edgeFile="Interface\\Addons\\DialogFrame\\Border", edgeSize = 8 } )
-- logo to left
f.image = f.image or f:CreateTexture(nil,"ARTWORK")
f.image:SetSize(150,150)
f.image:SetPoint("LEFT",8,0)
f.image:SetTexture("Interface\\Addons\\DialogFrame\\Border-Cat-Round2")
-- title at top
f.title = f.title or f:CreateFontString(nil,"ARTWORK","GameFontNormalLarge")
f.title:SetPoint("TOP",0,-16)
f.title:SetText("Panther")
f.title:SetFont("Interface\\AddOns\\SharedMedia_MyMedia\\font\\BlackChancery.ttf", 20)
-- place to put a paragraph or two of text
f.text = f.text or f:CreateFontString(nil,"ARTWORK","GameFontHighlight")
f.text:SetPoint("TOPRIGHT",-32,-42)
f.text:SetPoint("BOTTOMRIGHT",-32,42)
f.text:SetPoint("LEFT",f.image,"RIGHT",16,0)
f.text:SetJustifyH("LEFT")
f.text:SetText("Welcome to Panther UI v.15.0\n\n04/21/2022\n\nŠ 2008-2022\n\nDarwinsradio - Area 52\n\nI am so happy you decided to try my UI.\n\nIf you are having any problems, post a comment at Wowinterface or email me at \n\n-Jonathan")
-- checkbutton in bottomleft
f.prompt = f.prompt or CreateFrame("CheckButton",nil,f,"UICheckButtonTemplate")
f.prompt:SetPoint("BOTTOMLEFT",12,10)
f.prompt.text:SetText("Don't show this again")
f.prompt.text:SetFontObject("GameFontHighlightSmall")
-- okay button
f.okay = f.okay or CreateFrame("Button",nil,f,"UIPanelButtonTemplate")
f.okay:SetSize(96,22)
f.okay:SetPoint("BOTTOMRIGHT",-12,12)
f.okay:SetText(OKAY)
-- when okay clicked, set savedvar to whether prompt not checked and hide window
f.okay:SetScript("OnClick",function(self)
local parent = self:GetParent()
PantherWelcomeShow = not parent.prompt:GetChecked()
parent:Hide()
end)
end
end)
__________________
Panther UI | My Home on the Web
  Reply With Quote
04-21-22, 01:33 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Lua Code:
  1. local f = CreateFrame("Frame","PantherWelcome",UIParent, "BackdropTemplate")
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
04-21-22, 01:39 AM   #5
Kupotek
An Aku'mai Servant
 
Kupotek's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 38
I thought that might be part of it, didn't realize that's it! Thanks! so much.
__________________
Panther UI | My Home on the Web
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Working on updating my UI

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