Thread Tools Display Modes
11-01-22, 07:16 PM   #1
Kyrgune
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 14
SetParent("UIParent")

Having an issue with an addon I have been trying to keep going and of course with 10.0 like many others I have run into an issue. I am by no means an lua expert so I am looking for a little help if an easy fix is possible.

button:SetParent("UIParent")

The script up above is on line 769 and is throwing errors and not letting the addon to load to it's full potential. If I comment out the line the buttons do show up but they don't do anything.

The addon is ShardAce Cataclysm which is on this website. I know there is alot of left overs in the lua and it's a bit messy but it has worked until 10.0.

Any help would be appreciated, thanks!

Kyrgune

https://www.wowinterface.com/downloa...Cataclysm.html
  Reply With Quote
11-01-22, 07:57 PM   #2
L3n1n
A Fallenroot Satyr
 
L3n1n's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 20
Argument should be object, but now that's string. Replace this line of code to:

button:SetParent(UIParent)
  Reply With Quote
11-01-22, 08:52 PM   #3
Kyrgune
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 14
I did try that before but it just works just the same as if I would comment out the line. The buttons show up but they don't do what they are supposed to do like summon pets etc.

The buttons are supposed to cast a spell according to spellids. It doesn't look like they have changed according to wowhead.
  Reply With Quote
11-02-22, 03:11 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
Does it show any errors ?

Or just doesn't seem to work ?

Have you got an error report addon like buggrabber/bugsack ?
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
11-02-22, 08:20 AM   #5
Kyrgune
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 14
No errors show up except for the one I listed, but changing that line did not work.

Last edited by Kyrgune : 11-02-22 at 12:00 PM.
  Reply With Quote
11-02-22, 03:03 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Blizzard changed how the OnClick script works for SecureActionButtons in Dragon Flight. You need to register both up and down events through Button:RegisterForClicks() for it to work. Which one the handler uses is based on the user's ActionButtonUseKeyDown CVar setting.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
11-02-22, 08:30 PM   #7
Kyrgune
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 14
Thankyou for the reply, this is what it looks like at the moment. I tried to change the "AnyUp" to different mouse settings on the RegisterForClicks part but couldn't get it to work. I am assuming this is the chunk that needs to be fixed. Any ideas on what do do here?



self.buttons[1]:RegisterForClicks("AnyUp")
self.buttons[1]:SetAttribute("_onclick", [[

if FlyOutButtonsOpen then
for i, button in ipairs(MenuButtons) do
button:Hide()
end
FlyOutButtonsOpen = false
else

for i, button in ipairs(MenuButtons) do
button:Show()
end
FlyOutButtonsOpen = true
end
]])


Again thanks everyone for their help! I really do appreciate it.
Attached Files
File Type: lua ShardAceCata.lua (43.6 KB, 42 views)

Last edited by Kyrgune : 11-02-22 at 10:17 PM.
  Reply With Quote
11-03-22, 03:00 PM   #8
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
For example, you need to call :RegisterForClicks("AnyUp","AnyDown") on all of your buttons that inherit from SecureActionButtonTemplate. The link I posted previously has all of the button event options. Whichever buttons you choose, you need both up and down events for it.

Lua Code:
  1. for _, tbl in ipairs({self.buttons, self.firstrow, self.secondrow, self.thirdrow, self.forthrow}) do
  2.     for _, button in ipairs(tbl) do button:RegisterForClicks("AnyUp", "AnyDown") end
  3. end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-03-22 at 03:13 PM.
  Reply With Quote
11-04-22, 12:16 PM   #9
Kyrgune
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 14
Thankyou, that worked.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » SetParent("UIParent")


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