Quantcast
SetBackdropBorderColor removed in 9.0? - Page 2 - WoWInterface
Thread Tools Display Modes
08-06-20, 02:46 AM   #21
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 95
Originally Posted by p3lim View Post
Lua Code:
  1. Mixin(yourFrame, BackdropTemplateMixin)
One question about this, can I also adapt it so that I have a table with all frames where I needed the backdrop template and add it here automatically with a for-loop?

Something like that?
Lua Code:
  1. AddOn.BackdropFrames = {
  2.     "frame1",
  3.     "frame2",
  4. }
  5. for i = 1, getn(AddOn.BackdropFrames) do
  6.     local BackdropFrames = AddOn.BackdropFrames[i]
  7.     if BackdropFrames then
  8.         Mixin(BackdropFrames, BackdropTemplateMixin)
  9.     end
  10. end

Last edited by liquidbase : 08-06-20 at 03:07 AM.
  Reply With Quote
08-06-20, 11:45 AM   #22
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,293
It would be
Code:
local BackdropFrames = _G[AddOn.BackdropFrames[i]]
unless the table stored the reference to the created frame rather than its name.

It would depend on whether the template (common method for adding a mixin) adds any frame elements required by the mixin. If all it's doing is applying a bunch of methods to an already existing (or created in the process) frame then that would work. Or you could add the template frame elements "manually" when you apply the mixin if you weren't responsible for creating the frame(s).

p3lim's post seems to indicate, for backdrops, that it's just applying the mixin methods.

You just need to make sure you've applied the mixin before any of your code calls any of the methods on the frames.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-07-20, 12:53 AM   #23
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 95
Thanks for the explanation.
In my UI I work with a set template function that controls the appearance of the frames. That's where I've added the mixin. Works well so far and so far there were no problems when testing.
  Reply With Quote
08-17-20, 04:49 AM   #24
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
Can someone explain the SetBackdrop-fuckup for a dummie like me and how to fix LibQTip (https://www.wowace.com/projects/libqtip-1-0/) as an example?

I tried replacing line 364
tooltip = CreateFrame("Frame", nil, UIParent)
with
tooltip = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")

and as this didnt worked I added ', "BackdropTemplate"' to every CreateFrame which doesnt work either.

What am I doing wrong?

TIA!
  Reply With Quote
08-17-20, 07:56 AM   #25
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 790
I've tested it with a simple tooltip and it works with only the line 364 changed.
Make sure you load your altered version and no other older version is available.

Edit: My test was too simple. Had no release implemented. There is more to it.
Edit2: Function in Line 179 (only clear backdrop if the frame has it implemented)

Lua Code:
  1. local function ReleaseFrame(frame)
  2.     frame:Hide()
  3.     frame:SetParent(nil)
  4.     frame:ClearAllPoints()
  5.     if(frame.SetBackdrop) then
  6.         frame:SetBackdrop(nil)
  7.     end
  8.     ClearFrameScripts(frame)
  9.  
  10.     tinsert(frameHeap, frame)
  11.     --[===[@[email protected]
  12.     usedFrames = usedFrames - 1
  13.     [email protected]@]===]
  14. end

Line 226

Lua Code:
  1. cell = setmetatable(CreateFrame("Frame", nil, UIParent, "BackdropTemplate"), self.cellMetatable)
__________________
The cataclysm broke the world ... and the pandas could not fix it!

Last edited by Rilgamon : 08-17-20 at 08:34 AM.
  Reply With Quote
08-17-20, 08:45 AM   #26
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,293
There a several places the library would need to be updated depending on which parts you are using.

Things like around line 517 in InitializeTooltip(tooltip, key)
Code:
local backdrop = GameTooltip:GetBackdrop()
would be followed by
Code:
if not tooltip.SetBackdrop then
	Mixin(tooltip, BackdropTemplateMixin)
end
tooltip:SetBackdrop(backdrop)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
08-17-20, 12:00 PM   #27
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
@Rilgamon and @Fizzlemizz
thank you both very much

@Fizzlemizz:
yes I noticed and did so following your example
end result here: https://pastebin.com/DxRyHy9C
  Reply With Quote
08-17-20, 01:19 PM   #28
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,293
A side note for future travelers, applying the Mixin directly would primarily be used for frames you didn't create but wanted to set a backdrop on (as p3lim pointed out earlier in the thread).

In the library, because lines are created by it, instead of applying the Mixin at
Code:
tipPrototype:AddSeparator(height, r, g, b, a)
you could inherit the template where the line is created

Code:
local function AcquireFrame(parent)
	local frame = tremove(frameHeap) or CreateFrame("Frame", nil, nil, "BackdropTemplate")
Both methods work but the second might save some code if after frame creation, you branch into different functions that also apply backdrops but possibly using different styles etc. (the template does the job of applying the mixin without extra lines of code)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 08-17-20 at 02:19 PM.
  Reply With Quote
09-02-20, 08:48 PM   #29
Drudatz
A Fallenroot Satyr
Join Date: Aug 2009
Posts: 20
Sorry for another dumb question but how do I get the BackdropTemplate when the frame is created in an xml?

Code:
<Frame name="PTFrameTemplate" frameStrata="LOW" enablemouse="true" movable="true" clampedtoscreen="true" hidden="true" virtual="true" ???="BackdropTemplate">
I need to know what to write in place of the ???.

TIA
  Reply With Quote
09-02-20, 09:16 PM   #30
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 946
Code:
inherits="BackdropTemplate"
https://github.com/Stanzilla/WoWUIBu...es#xml-changes
  Reply With Quote
10-15-20, 07:13 AM   #31
Alysh
A Kobold Labourer
Join Date: Mar 2017
Posts: 1
Sorry if I intrude .. Could someone help me understand how to fix the LUA errors resulting from the "backdrop" on the Stuf Unit Frames addon? (https://www.wowinterface.com/downloa...?id=11182#info)
Thanks a lot..
  Reply With Quote
10-15-20, 01:43 PM   #32
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,537
Did everyone else get a darkened frame after applying the new backdrop template ?

If you did, where did you find the issue was ?


Edit:
Nevermind, it appears the addition of the backdrops to certain frames on nUI affected the current alpha state visual. Simply changing them from 0.75 to 0.35 allowed the text to display easier.
__________________

Last edited by Xrystal : 10-15-20 at 02:16 PM.
  Reply With Quote
10-15-20, 04:21 PM   #33
Spyro
A Fallenroot Satyr
 
Spyro's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2011
Posts: 22
I have noticed that SetBackdrop() now creates 9 textures instead of the typical 8 (4 edges + 4 borders). I have no idea what the last texture is.

I have noticed this because I use backdrops to create 1px borders on casting bars, and I need to access those textures to change the backdrop's Layer (so it doesn't get covered by the StatusBar filling texture).
  Reply With Quote
10-15-20, 05:23 PM   #34
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 429
Originally Posted by Spyro View Post
I have noticed that SetBackdrop() now creates 9 textures instead of the typical 8 (4 edges + 4 borders). I have no idea what the last texture is.
8 textures for edges, 9th for background.
__________________
  Reply With Quote
10-15-20, 05:38 PM   #35
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,537
Originally Posted by MunkDev View Post
8 textures for edges, 9th for background.
Maybe the background is the texture messing up some of nUI's click buttons. Thankfully so far thats all that is affected but I wouldn't be surprised if something appears sooner or later.
__________________
  Reply With Quote
10-18-20, 02:31 AM   #36
Zorcan
A Kobold Labourer
Join Date: Oct 2020
Posts: 1
When using the addon ItemRack https://www.curseforge.com/wow/addons/itemrack I am getting the following error:

Message: ..\AddOns\ItemRack\ItemRack.lua line 1733:
attempt to call method 'SetBackdropBorderColor' (a nil value)

I tried updating ItemRack.lua but I've had no success whatsoever. Is there some kind soul out there who could take a quick look and see what might possibly have to be changed to get this addon working correctly once more?

Thanks in advance!

---------------------

Never mind, I managed to figure it out myself.

Last edited by Zorcan : 10-18-20 at 08:53 PM. Reason: Fixed it myself
  Reply With Quote
11-13-20, 02:18 PM   #37
XeeLiao
A Murloc Raider
 
XeeLiao's Avatar
Join Date: Nov 2020
Posts: 5
Hi,

is there anyway to fix the Backdrop for (https://www.curseforge.com/wow/addon...alui-bossskins)?
Since the 9.0.1 update the Background for Bars and Icons with this DBM skin is gone
  Reply With Quote
11-13-20, 04:19 PM   #38
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,357
First thing is is your installation of RealUI up to date? The second thing is that addon hasn't been updated since 2016, so, it's probably a bit out of date by now (what with the updates to the game (9.0.1 changedthebackdrop coding so...)).
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!

Last edited by jeffy162 : 11-13-20 at 04:30 PM. Reason: more blahblahblah
  Reply With Quote
11-13-20, 04:35 PM   #39
XeeLiao
A Murloc Raider
 
XeeLiao's Avatar
Join Date: Nov 2020
Posts: 5
This Addon always ran without RealUI, wich i dont use, also it ran perfectly fine until the 9.0 update, it still works perfect actually, only the background of the bar and icon is missing now
  Reply With Quote
11-13-20, 09:47 PM   #40
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,357
Originally Posted by jeffy162 View Post
(9.0.1 changedthebackdrop coding so...)).
Like I said ^^^^... I'm sorry that I can't help you with code, but if you search around a little I'm sure you'll find the information. I know there's a thread here for backdrop problems, I just don't know where it is. In fact ... this is one of the threads for backdrop problems. DOH!!!
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!

Last edited by jeffy162 : 11-13-20 at 09:53 PM.
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » SetBackdropBorderColor removed in 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