View Single Post
12-22-09, 05:28 PM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,932
Hmm, thanks Scott.

I'm doing this at present for resizing so I guess I need to use the title instead of nil.
Code:
plugin.sizeChanged = function( scale, height, width )
	local options  = plugin.options;
	local Objectives   = plugin.Objectives;
	plugin.scale = scale;
	nUI_Movers:lockFrame( Objectives, false, nil );
	Objectives:SetWidth( width ); 
	Objectives:SetHeight( height ); 
	nUI_Movers:lockFrame( Objectives, true, nil );
end
And this is the code I have set up for enabling it.
Code:
plugin.setEnabled = function( enabled )
	if plugin.enabled ~= enabled then
		plugin.enabled = enabled;
		if not enabled then
			local Objectives = plugin.Objectives;
			if Objectives.saved_parent then
				nUI_Movers:lockFrame( Objectives, false, nil );
				Objectives:SetParent( Objectives.saved_parent );
				Objectives:SetPoint( "TOPRIGHT", MinimapCluster, "BOTTOMRIGHT", 0, 0 );
				Objectives:SetBackdropBorderColor( Objectives.border_color );
				Objectives:SetBackdropColor( Objectives.backdrop_color );
			end
		else
			local Objectives = WatchFrame;
			print(Objectives);
			plugin.Objectives = Objectives;
			if not Objectives.saved_parent then
				Objectives.saved_parent   = Objectives:GetParent();
				Objectives.border_color   = Objectives:GetBackdropBorderColor();
				Objectives.backdrop_color =Objectives:GetBackdropColor();
			end
			Objectives:SetParent( plugin.container );
			Objectives:SetPoint( "TOPLEFT", plugin.container, "TOPLEFT", 10, -10 );
			Objectives:SetPoint( "BOTTOMRIGHT", plugin.container, "BOTTOMRIGHT", 0, 0 );
			Objectives:SetFrameStrata( plugin.container:GetFrameStrata() );
			Objectives:SetFrameLevel( plugin.container:GetFrameLevel()+1 );
			Objectives:SetBackdropBorderColor( 0, 0, 0, 0 );
			Objectives:SetBackdropColor( 0, 0, 0, 0 );
								
			nUI_Movers:lockFrame( Objectives, true, nil );
		end				
	end			
end
It's the same code I use for my other info panels but I guess the big time resizing we need for the watchframe needs an extra set of change ?

Will try it out again tomorrow though.
__________________


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

Last edited by Xrystal : 12-22-09 at 05:31 PM.