WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   New Portable Button Problems (https://www.wowinterface.com/forums/showthread.php?t=59311)

BloodDragon 11-02-22 03:23 PM

New Portable Button Problems
 
1 Attachment(s)
Hello folks,
I have a small problem that I just can't get any further. Since the Dragonflight update, I can no longer press any buttons in my addon. I've tried pretty much everything I knew, but I just can't do it.
Perhaps one of you can help me to solve the problem. I would be very very grateful.

I uploaded the addon in the attachment.

I think the problem is somewhere in this area in main.lua


Lua Code:
  1. -- Create the Clickable Portable Buttons
  2. function me:CreateUI_Buttons()
  3.     local n
  4.     -- Create each button using a Secure Action template
  5.     for n = 1, me.MAX_BUTTONS do
  6.         local button = "button"..tostring(n)
  7.        
  8.         -- Each "button" is really a Frame with a Button, Texture, and Text
  9.         me.ui[button] = CreateFrame("Frame", "PortableUIButton"..tostring(n), me.ui.container)
  10.         me.ui[button].ID = n
  11.         me.ui[button]:SetScript("OnEnter", function(self, ...)
  12.                 me:DoScript_OnEnter(self, ...)
  13.             end)
  14.         me.ui[button]:SetScript("OnLeave", function(self, ...)
  15.                 me:DoScript_OnLeave(self, ...)
  16.             end)
  17.        
  18.         -- The Secure Action Button
  19.         me.ui[button].sab = CreateFrame("Button", "PortableUIButton"..tostring(n).."SAB", me.ui[button], "SecureActionButtonTemplate")
  20.         me.ui[button].sab:RegisterForClicks("LeftButtonDown", "RightButtonDown")
  21.         me.ui[button].sab:SetScript("OnEnter", function(self, ...)
  22.                 me:DoScript_OnEnter(self, ...)
  23.             end)
  24.         me.ui[button].sab:SetScript("OnLeave", function(self, ...)
  25.                 me:DoScript_OnLeave(self, ...)
  26.             end)
  27.         me.ui[button].sab:HookScript("OnClick", function(self, ...)
  28.                 me:DoScript_OnClick(self, ...)
  29.             end)
  30.         me.ui[button].sab:SetAllPoints(me.ui[button])
  31.        
  32.         -- Disabled Texture (If a mage doesn't know a spell, it will be greyed out)
  33.         me.ui[button].disabled = me.ui[button]:CreateTexture(nil, "ARTWORK")
  34.         me.ui[button].disabled:SetAllPoints(me.ui[button])
  35.        
  36.         -- Text (Shows the name of the destination)
  37.         me.ui[button].text = CreateFrame("Frame", nil, me.ui[button])
  38.         me.ui[button].text:SetAllPoints(me.ui[button])
  39.         me.ui[button].text.name = me.ui[button].text:CreateFontString(nil)
  40.         me.ui[button].text.name:SetFont("Fonts\\ARHei.ttf", 12, "") -- Default font, we don't want a nil font
  41.         me.ui[button].text.name:SetJustifyV("TOP")
  42.     end
  43. end

Xrystal 11-02-22 03:43 PM

Earlier taint from say edit mode ? I think action buttons having issues are a common side affect after that happening.

BloodDragon 11-02-22 03:47 PM

The editing mode was not used by me. That nothing happens when you click on a teleport is not only with me but with everyone I know.

Xrystal 11-02-22 07:47 PM

Hmm, let me check my mage portal addon and see if that has similar issues since the expansion.

We are doing things differently so at least if mine works I can point you to that to see what might need changing now in yours.


Okay, mine appear to be working.
I am using xml files to set up frame templates and frames
I am using the secure set up type/spell and Requesting spell data prior to setting up the buttons
And instead of using spell1 and spell2 for left and right clicking I am just using spell and having the teleport and portal buttons separate.
But whether these are why mine are working I don't know.

My addon if you haven't already tracked it down is : https://www.wowinterface.com/downloa...gePortals.html

BloodDragon 11-02-22 11:18 PM

Hmmm my brain is broken.

Xrystal 11-03-22 05:35 AM

Hopefully someone else will see something that I am not.

BloodDragon 11-03-22 05:46 AM

I have teste now without all addons only Portable. But nothing.

Xrystal 11-03-22 08:40 AM

Okay, went through my addon and replaced all my SetAttribute and GetAttributes to use spell1 instead of spell and added RegisterForClicks and the buttons don't work.

Aha, the RegisterForClicks appears to be the problem. If I remove that line everything works fine.

Removed the line from your main.lua file of Portable and your spell buttons work on left click.

Doesn't solve it full for your addon which relies on the right click option but one step closer.

Also tried with "AnyDown" incase the two button option was an issue but that didn't help either.

Aha .. seems like this might be the problem...

https://github.com/Stanzilla/WoWUIBugs/issues/268

Just testing that theory out

It worked for my addon but not yours .. back to square one .. *very puzzled*

Although based on report https://github.com/Stanzilla/WoWUIBugs/issues/282 this was fixed several patches back..

BloodDragon 11-03-22 09:00 AM

That's how I feel since the Dragonflight release, I'm at the end of all ideas^^. I have to say that I'm not really a pro in the area of ​​lua either. But I really thank you for your efforts.

Xrystal 11-03-22 09:05 AM

I'm sorry I couldn't help further. If anything springs to mind at a later date and it resolves the issue I'll let you know.

BloodDragon 11-03-22 09:07 AM

No problem, very kind of you.

BloodDragon 11-04-22 10:54 AM

I solved the problem, a space was missing in the German translation. Thank you all for the help.

Xrystal 11-04-22 04:46 PM

ah whew .. glad you got it sorted :)

Although I would be on the US language and it didn't work for me either rofl. But hopefully it works for the people that matter :)


All times are GMT -6. The time now is 01:26 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI