Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-02-22, 03:23 PM   #1
BloodDragon
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2017
Posts: 32
Question New Portable Button Problems

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
Attached Files
File Type: zip Portable.v.7.4.zip (2.12 MB, 41 views)
  Reply With Quote
 

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » New Portable Button Problems


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