View Single Post
04-13-20, 08:11 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Hmm, I'm not 100% sure, but I thought I found that the new SecureActionButtonTemplate isn't a visual template just handles the secure elements.

You would have to add in the visual elements or combine it with a visual template.

Granted the following is an XML version but the same thing should apply when creating by code.

Lua Code:
  1. <!-- Buttons that have textures  -->
  2.     <Button name = "XMP_IconTemplate" parentArray = "Buttons" virtual = "true">
  3.         <Size x="30" y="30"/>
  4.         <Layers>
  5.             <Layer level="BACKGROUND">
  6.                 <Texture parentKey="Icon" setAllPoints = "true"/>
  7.             </Layer>
  8.         </Layers>
  9.         <NormalTexture parentKey="NormalTexture" file="Interface\Buttons\UI-EmptySlot" setAllPoints = "true"/>
  10.         <PushedTexture parentKey ="PushedTexture" file="Interface\Buttons\CheckButtonHilight" alphaMode = "ADD" setAllPoints = "true"/>
  11.         <HighlightTexture parentKey = "HighlightTexture" file="Interface\Buttons\CheckButtonHilight"  alphaMode = "ADD" setAllPoints = "true"/>  
  12.     </Button>
  13.  
  14.     <!-- Buttons used to cast spells -->
  15.     <Button name = "XMP_SpellButtonTemplate" inherits = "XMP_IconTemplate,SecureActionButtonTemplate" virtual = "true">
  16.         <Attributes>
  17.             <Attribute name="type" value="spell" />
  18.             <Attribute name="spell" value="0" type="number" />
  19.         </Attributes>
  20.         <Frames>
  21.             <Cooldown inherits="CooldownFrameTemplate" parentKey="Cooldown" />
  22.         </Frames>
  23.     </Button>

As you can see by this my spell button is actually a combination of an icon button template and the secureactionbuttontemplate

As you can see from this link the secureactionbuttontemplate only handles the onclick event
https://www.townlong-yak.com/framexm...eTemplates.xml

So, moving from your old button template to the new button template you have inadvertently removed the visual functionality of the button.

This is a collection of Blizzards ActionButtonTemplates.
https://www.townlong-yak.com/framexm...onTemplate.xml

As you can see these don't have any onclick functionality as Blizzard has separated them.
__________________
  Reply With Quote