Thread Tools Display Modes
04-13-07, 10:13 AM   #1
shiin
A Fallenroot Satyr
Join Date: Feb 2005
Posts: 23
Problem with SecureButtons and 2.1.0

With the 2.1.0 testrealm available I've been trying to update my addons for the upcoming patch. Here, I've encountered a strange problem with SecureActionButtons. The following XML-Code draws a rectangle on the screen that targets the player when clicked on - at least it does it in 2.0.x; in 2.1.0 I get the "Your Addon is not allowed to do this" message. All other addons were disabled while testing.
Maybe someone has an answer to this problem since I'm totally at a loss here; I also didn't see anything in the patchnotes that could provoke this behaviour.

(PS: I would also post this on the US WoW UI&Macro forums but only having an European account I cannot)


Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">

	
	<Button name="TestFrame" inherits="SecureActionButtonTemplate">
	
		<Size>
			<AbsDimension x="128" y="32"/>
		</Size>
		
		<Anchors>
			<Anchor point="CENTER"/>
		</Anchors>
		
		<Layers>
			<Layer level="BACKGROUND">
				<Texture>
					<Color r="0.0" g="0.0" b="0.0" a="0.5"/>
				</Texture>
			</Layer>			
		</Layers>

		<Scripts>
			<OnLoad>
				this:SetAttribute("type","target");
				this:SetAttribute("unit","player");
			</OnLoad>
		</Scripts>
		
	</Button>
</Ui>
  Reply With Quote
04-13-07, 02:16 PM   #2
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Aye, I'm having troubles with RDX and I know of quite a few others that are having troubles as well. What's strange is that issecurevariable() suggests that it's the addon tainting the code, but it doesn't appear to be that way. I'm thinking that it's a Blizzard bug, after trying to sort this out in RDX for the past few hours, and hoping that Blizzard will comment on it soon.

Your code looks perfect.
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote
04-18-07, 09:20 AM   #3
shiin
A Fallenroot Satyr
Join Date: Feb 2005
Posts: 23
Most of the afore mentioned problems with SecureButtons and blocked addons have been resolved with the new testrealm patch (a wronng variable name in SecureStateDriver.lua was the cause). But when using SecureStateDrivers the UI is still blocked.
Therefore I made a small sample code that creates an empty button which maps to action 1 normally and to action 2 when stealthed. This works fine on live-servers but gives the UI-blocked error on test-servers. Does anyone see any problems with this code that would make it disfunctional with 2.1? If not, would someone with an US account be so kind and post this problem on the WoW US UI&Macros forum?

Code:
local header = CreateFrame("Frame", "TestHeader", UIParent, "SecureStateDriverTemplate");
header:SetAttribute("statemap-stealth-1",  "2");		
header:SetAttribute("statemap-stealth-0",  "1");
	
local button = CreateFrame("CheckButton", "TestButton", UIParent, "SecureActionButtonTemplate, ActionButtonTemplate");
	
button:SetAttribute("type", "action");	
button:SetAttribute("showstates","*");
button:SetAttribute("statebutton","1:state1;2:state2");
button:SetAttribute("*action-state1", 1);
button:SetAttribute("*action-state2", 2);	

header:SetAttribute("addChild", button );	
header:SetAttribute("state","1");

button:ClearAllPoints();
button:SetPoint("CENTER",0,-50);
button:Show();

header:ClearAllPoints();
header:SetPoint("CENTER",0,-50);
header:Show();
  Reply With Quote
04-18-07, 09:29 AM   #4
Aznamir
A Fallenroot Satyr
 
Aznamir's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 26
That is a confirmed bug by Blizzard, will be fixed in next PTR update.
  Reply With Quote
04-18-07, 11:26 AM   #5
shiin
A Fallenroot Satyr
Join Date: Feb 2005
Posts: 23
Really? That's good to hear since I thought Blizzard only confirmed the problem in my first post which is now corrected on testrealms.
  Reply With Quote
04-26-07, 01:41 AM   #6
shiin
A Fallenroot Satyr
Join Date: Feb 2005
Posts: 23
New patch, new tests:
The example posted above (the lua one) works now, but only if executed after the ADDON_LOADED/VARIABLES_LOADED event - any one will do but I don't know the exact order in which they are done. Executing it during the OnLoad block will still yield the "Addon Blocked" message when clicking on the button.
I can work around this one but maybe someone does know the exact reason why I have to create secure drivers after the addon is loaded (I've checked it, TestButton can still be created during OnLoad, only TestHeader has to be created after the ADDON_LOADED event fired) ?
  Reply With Quote
04-26-07, 09:54 AM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
http://www.wowwiki.com/Events_that_f...oading_Process
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Problem with SecureButtons and 2.1.0


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