Thread Tools Display Modes
11-18-22, 08:31 AM   #1
Dave B
A Defias Bandit
Join Date: Jul 2018
Posts: 3
LUA Halp with code removed in 9.x.x

Hi,

I'm having some trouble tracking down what code was changed to to try and fix an addon, the removed code was from this subset

Frame:GetBackdrop
Frame:GetBackdropBorderColor
Frame:GetBackdropColor
Frame:SetBackdrop
Frame:SetBackdropBorderColor
Frame:SetBackdropColor

The code in the addon (YSSDROP, for reference) is

frame:SetBackdrop(GameTooltip:GetBackdrop())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetScale(GameTooltip:GetScale())

my question is: what do I need to change it to to get it working? I've tried the option of NineSlice and that didn't help, there's scant information on what the set/getbackdrop code was changed to, any experts that can shed some light?

TYIA
  Reply With Quote
11-18-22, 10:40 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Either of these two:
1. At frame creation:
Lua Code:
  1. local frame = CreateFrame("frame", "frameName" or nil, frameParent or nil, "BackdropTemplate")
If the code you're fixing already has a fourth argument, add BackdropTemplate in the string after a comma, like this: "GameTooltipTemplate,BackdropTemplate"
2. Just before any backdrop method usage:
Lua Code:
  1. if not frame.SetBackdrop then
  2.     Mixin(frame,BackdropTemplateMixin)
  3. end
https://github.com/Stanzilla/WoWUIBu...system-changes

Last edited by Kanegasi : 11-18-22 at 10:42 AM.
  Reply With Quote
11-18-22, 11:23 AM   #3
Dave B
A Defias Bandit
Join Date: Jul 2018
Posts: 3
Hiya, thanks for the feedback, the entire code of the section in question is

local function PrepareTooltip(frame, cell)
if frame == YssTooltip then
frame.YssDrop_OnLeave = frame:GetScript("OnLeave")
frame:EnableMouse(true)
frame:SetScript("OnLeave", GT_OnLeave)
-- copy look and scale of GameTooltip to keep things consistent
frame:SetBackdrop(_G.GameTooltip:GetBackdrop())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetScale(GameTooltip:GetScale())
end
frame:SetOwner(cell, "ANCHOR_NONE")
frame:ClearAllPoints()
local a1, a2 = GetAnchors(cell)
frame:SetPoint(a1, cell, a2)
end

I modified (based my reading of your comment) per below but getting an error message about line 61 (set owner) so clearly haven't got it in the right place

local function PrepareTooltip(frame, cell)
local frame = CreateFrame("frame", "frameName" or nil, frameParent or nil, "BackdropTemplate")
if frame == YssTooltip then
frame.YssDrop_OnLeave = frame:GetScript("OnLeave")
frame:EnableMouse(true)
frame:SetScript("OnLeave", GT_OnLeave)
-- copy look and scale of GameTooltip to keep things consistent
if not frame.SetBackdrop then
Mixin(frame,BackdropTemplateMixin)
end
frame:SetBackdrop(_G.GameTooltip:GetBackdrop())
frame:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
frame:SetBackdropColor(GameTooltip:GetBackdropColor())
frame:SetScale(GameTooltip:GetScale())
end
frame:SetOwner(cell, "ANCHOR_NONE")
frame:ClearAllPoints()
local a1, a2 = GetAnchors(cell)
frame:SetPoint(a1, cell, a2)
end
  Reply With Quote
11-18-22, 01:06 PM   #4
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Don't do both. There is no frame creation in the code you provided so remove the local frame = CreateFrame line you added.
  Reply With Quote
11-18-22, 01:12 PM   #5
Dave B
A Defias Bandit
Join Date: Jul 2018
Posts: 3
I did that and now get a totally new error message

3x StatusBar:GetPoint(): Action[FrameMeasurement] failed because[Can't measure restricted regions]: attempted from: StatusBar:GetPoint().
[string "=[C]"]: in function `GetPoint'
[string "@Interface/AddOns/YssDrop/YssDrop.lua"]:146: in function `_OnEnter_func'
[string "@Interface/AddOns/Decursive/Libs/LibQTip-1.0-49/LibQTip-1.0.lua"]:1357: in function <...ce/AddOns/Decursive/Libs/LibQTip-1.0/LibQTip-1.0.lua:1351>

Locals:
(*temporary) = StatusBar {
0 = <userdata>
spark = Texture {
}
AnimGroup = AnimationGroup {
}
highlight = Texture {
}
orig_Hide = <function> defined =[C]:-1
Hide = <function> defined @Interface/AddOns/Kui_Nameplates_Core/create.lua:93
orig_SetStatusBarColor = <function> defined =[C]:-1
orig_Show = <function> defined =[C]:-1
SetStatusBarColor = <function> defined @Interface/AddOns/Kui_Nameplates_Core/create.lua:78
Show = <function> defined @Interface/AddOns/Kui_Nameplates_Core/create.lua:89
bg = Texture {
}
fill = Texture {
}
}

I'm starting to think I might have to give up on this one
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » LUA Halp with code removed in 9.x.x


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