Thread Tools Display Modes
06-19-09, 12:48 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
Secure Action Buttons for Spell Casting

I've been trying to figure this out all day so far and despite searching and looking at the official forums and trying the examples in wowwiki and searching and reading here I cannot see what is going wrong with this bit of code.

If I comment out the Inherited Frames from the CreateFrame method and comment out the SetAttribute lines the addon I have displays the action buttons as I expect them. However, with this code as it is, nothing is displayed. I know I will later have to implement special functions to handle clicks ( unless the inherited frames does that too ) but for now I just want to get them displayed.

Can anyone see anything to explain why secure action buttons are not even displayed when normal action buttons do ?

Thanks in advance.

Code:
local function MagePorts_InitPortalButtons()
	MagePorts_PortalButtons = {};
	for i,v in pairs(MagePorts_PortalDB) do
		if ( string.find(v.faction,MagePorts_Faction) ) then
			local SpellName = select(1,GetSpellInfo(v.spell));
			local Available = ( GetSpellInfo(SpellName) ~= nil );
			local ButtonName = "P_" .. v.spell;
			local TextureName = ButtonName .. "_Texture";			
			local IconFile = select(3,GetSpellInfo(v.spell));
			local Button = CreateFrame("Button", ButtonName, UIParent,"ActionButtonTemplate,SecureActionButtonTemplate");			
			Button:SetWidth(36);
			Button:SetHeight(36);			
			local texture = Button:CreateTexture(TextureName,"BACKGROUND");
			texture:SetAllPoints(Button);
			texture:SetTexture(IconFile);
			Button:SetNormalTexture("Interface\\Buttons\\UI-Quickslot2");
			Button:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square", add);
			Button:SetPushedTexture("Interface\\Buttons\\UI-Quickslot-Depress");
			Button:SetAlpha(1.0);
			Button:SetAttribute("type","spell");
			Button:SetAttribute("spell",SpellName);
			table.insert(MagePorts_PortalButtons,Button);
		end
	end
end
__________________


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
06-20-09, 05:12 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
For those that have wondered the same thing I have spent the day hammering back and forth with a Blizzard MVP on the official forums and finally tracked down the problem that secure frames cannot be anchored to font strings.

Which of course wasn't part of the code I posted *grimace*.
__________________


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

WoWInterface » Developer Discussions » General Authoring Discussion » Secure Action Buttons for Spell Casting


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