Thread Tools Display Modes
12-22-09, 08:01 AM   #1
Marthisdil
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 363
Quest Tracker Info Panel

Originally Posted by Xrystal View Post
Rofl, so which panels were you thinking of ? hmm hmm
Would be nice to have quest objective tracker as a panel Would get that hruge window off the screen
__________________

Marth



 
12-22-09, 08:23 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Originally Posted by Marthisdil View Post
Would be nice to have quest objective tracker as a panel Would get that hruge window off the screen
Not sure whether that is possible as I read that it was a fixed size but I will take a look at its innards and see how it works
__________________
 
12-22-09, 04:41 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Well, doing my usual infopanel set up and I have successfully got the watch frame linked to the infopanel. However, it doesn't seem to want to go in the panel. And once the infopanel is set up the watch frame is no longer moveable by nUI.

I'm reparenting WatchFrame which is the main frame for the Objectives window but it just refuses to keep the anchors I give it. I can't see where but perhaps nUI is re-anchoring after I have reparented it.

So, for now at least, it isn't possible to move the watchframe into an infopanel.
__________________
 
12-22-09, 05:26 PM   #4
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
You probably need to call nUI_Movers:lockFrame( WatchFrame, false, OBJECTIVES_TRACKER_LABEL ); to unlock the frame so you can move and/or size it. Also have a look in the [ nUI > Integration > nUI_Minimap.lua ] file at the bottom to see the handstands you have to do to move/resize the frame.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
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,877
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.
__________________

Last edited by Xrystal : 12-22-09 at 05:31 PM.
 
12-23-09, 05:11 AM   #6
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
I think the thing that may be an issue here is that you need a "StartMoving" and a "StartSizing" call after you unlock the frame and before you start trying to change the size. Then you need a "StopMovingOrSizing" when you're done.

Also, you should probably use the label to unlock the frame, but you are correct to not use the label when you lock it back. Otherwise it will appear in the movable frame list when you use '/nui movers'
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 05:12 AM   #7
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
One other thing... I suspect that resizing the tracking window to fit the info panel is going to cause issues with "not enough room to track more quests" etc.... not sure how that's going to play out.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 07:31 AM   #8
Marthisdil
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 363
Originally Posted by spiel2001 View Post
One other thing... I suspect that resizing the tracking window to fit the info panel is going to cause issues with "not enough room to track more quests" etc.... not sure how that's going to play out.
I thought about that as well and wondered if it's possible to have it scrollable in the infopanel, but i've not done much digging to see.
__________________

Marth



 
12-23-09, 08:15 AM   #9
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Yeah - you would have to make it a child of a scroll frame, but that should be doable.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 08:41 AM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
That will be a challenge. I've only managed to do a simple scroll list before.
__________________
 
12-23-09, 09:16 AM   #11
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
It's actuall fairly straight forward... you just need the scroll pane as a parent to the quest tracker frame and the vertical scroll bar. I have code I've written for nUI6 to do scroll frames for the configuration box. I'll dig it up and when I get home this evening and send it to you.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 09:21 AM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Hmm, WatchFrame is not movable. Adjusted the mover locking code and added the ismoving etc code thats in combatlog but no dice. And setting the frame as movable just breaks it even more with the mouse not responding to anything else.

Well, with the moving code taken out and just the addition of the frame name on the movers code and a ClearAllPoints call it is now in the right place but too big. As this screenshot shows.

Ah, with the FrameName in the movers code it keeps the tracker in the movers list but in the wrong place. Using the nil reference as usual it removes the tracker from the movers list which is what we want.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_122309_151945.jpg
Views:	915
Size:	297.8 KB
ID:	3740  
__________________

Last edited by Xrystal : 12-23-09 at 09:25 AM.
 
12-23-09, 10:12 AM   #13
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
You should be able to change the size of the watch frame after you unlock it and after you do the "StartSizing" call on it. Again, look at the "ResetWatchFrame()" method in [ nUI > Integration > nUI_Minimap ] and see how nUI is doing it. All you should have to do is basically copy and paste that method, then change where you are moving it to, what size you're making it and to "lose" the label when you lock it back down.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 10:16 AM   #14
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
*blush* was looking at the wrong file rofl.

Trying again
__________________
 
12-23-09, 10:52 AM   #15
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Scratch that, sigh, WatchFrame_Expand errors out due to WatchFrame:GetTop() and WatchFrame:GetBottom() both being nil and thus unable to be calculated on.

Although, I may be doing something wrong using it. The Minimap file isn't a great example, not being an infopanel file. Anyways. Here's what I have so far in the 3 main functions. Anything out of place in these functions ? Oh, and this is the version of nUI that fixes the no unit frames error when you login, which I can confirm works as I changed back and started getting the error again, so went back to your fixed version

Code:
function ResetObjectivesFrame(parent, width, height)
			
	nUI_Options.movedWatchFrame = true;
	
	WatchFrame.moving = true;
	WatchFrame.sizing = true;
	
	WatchFrame:SetMovable( true );
	WatchFrame:SetResizable( true );
	WatchFrame:StartMoving();
	WatchFrame:StartSizing( "BOTTOMRIGHT" );
	
	WatchFrame:ClearAllPoints();
	WatchFrame:SetPoint( "BOTTOMRIGHT", parent, "BOTTOMRIGHT", 0, 0 );
	WatchFrame:SetPoint( "TOPLEFT", parent, "TOPLEFT", 0, 0 );
	WatchFrame:SetHeight( height );
	WatchFrame:SetWidth( width );

	WatchFrame.moving = nil;
	WatchFrame.sizing = nil;

	WATCHFRAME_IGNORECURSOR = "1";			
	WATCHFRAME_LASTWIDTH    = width;
	
	WatchFrame:StopMovingOrSizing();
	WatchFrame:SetUserPlaced( true );
	print("Top:",WatchFrame:GetTop(), "Bottom:", WatchFrame:GetBottom());
	WatchFrame_Expand( WatchFrame );

end
Code:
plugin.sizeChanged = function( scale, height, width )
	local options  = plugin.options;
	local Objectives   = plugin.Objectives;
	plugin.scale = scale;
	nUI_Movers:lockFrame( Objectives, false, OBJECTIVES_TRACKER_LABEL   );
	ResetObjectivesFrame(plugin.container, width, height);
	nUI_Movers:lockFrame( Objectives, true, nil );
end
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
			nUI_Movers:lockFrame( Objectives, false, OBJECTIVES_TRACKER_LABEL   );
			Objectives:SetParent( plugin.container );
			Objectives:ClearAllPoints();
			Objectives:SetPoint( "BOTTOMRIGHT", plugin.container, "BOTTOMRIGHT", 0, 0 );
			Objectives:SetPoint( "TOPLEFT", plugin.container, "TOPLEFT", 0, 0 );
			Objectives:Show();
			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
Errors Received:
Code:
[2009/12/23 16:50:10-231-x1]: Interface\FrameXML\WatchFrame.lua:341: attempt to perform arithmetic on a nil value:
Interface\FrameXML\WatchFrame.lua:297: in function `WatchFrame_Expand':
...UI_InfoPanel_Objectives\nUI_InfoPanel_Objectives.lua:62: in function `ResetObjectivesFrame':
...UI_InfoPanel_Objectives\nUI_InfoPanel_Objectives.lua:102: in function `sizeChanged':
nUI-5.06.06 (Lite)\Integration\nUI_InfoPanel.lua:803: in function `applyScale'
nUI-5.06.06 (Lite)\Integration\nUI_InfoPanel.lua:908: in function `applyOptions'
nUI-5.06.06 (Lite)\Integration\nUI_InfoPanel.lua:937: in function `applySkin'
nUI-5.06.06 (Lite)\Main\nUI.lua:248: in function <Interface\AddOns\nUI\Main\nUI.lua:137>
__________________
 
12-23-09, 04:12 PM   #16
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Xrystal --

Here's the scroll frame from nUI6's viewport configuration panel.

In short, you want to create a "UIPanelScrollFrameTemplate" frame as the "parent" that you size to fit the info panel. You then would make it the parent to WatchFrame and call the SetScrollChild() method to make WatchFrame the scroll child. Size the Watch frame the way you want it -- not the size of the info panel, but the size of the watch frame "inside" the scroll frame.

If you look at the attached code, the master frame you create is the same as the "ViewportConfig" frame in my code. The WatchFrame is the same as the "ViewportConfig.scroller" frame in my code. You should be able to work out what you need from there.

.
Attached Files
File Type: lua UIViewportConfig.lua (17.3 KB, 835 views)
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
12-23-09, 04:18 PM   #17
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Thanks Scott, will work on that attempt next see if that helps
__________________
 
12-24-09, 12:03 PM   #18
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Well, so thought I'd start over kinda and start with tying the WatchFrame to this new ScrollFrame thingy

For some reason it isn't parenting the WatchFrame properly, which could be why it didn't work with the infopanel as I expected.

Apart from some slight positioning offsets it is positioning itself correctly but the moment I move the scroll frame the WatchFrame doesn't move with it despite me setting its new parent to it.

Here's the code portion that creates the ScrollFrame and Scroller:
Code:
	-- Create Main Scroll Frame
	local f = CreateFrame( "ScrollFrame", "WatchFrameScrollFrame", UIParent, "UIPanelScrollFrameTemplate" );
	f:SetWidth(400);
	f:SetHeight(200);
	f:SetClampedToScreen(true);
	f:SetPoint("CENTER",UIParent,"CENTER",0,0);
	f:SetBackdrop(ObjectivesBackdrop);
	f:SetBackdropColor(ObjectivesBackcolor.red,ObjectivesBackcolor.green,ObjectivesBackcolor.blue, ObjectivesBackcolor.alpha);
	f:SetBackdropBorderColor(ObjectivesBordercolor.red, ObjectivesBordercolor.green,ObjectivesBordercolor.blue, ObjectivesBordercolor.alpha);
	f:RegisterForDrag(button);
	f:EnableMouse(true);
	f:SetMovable(true);
	f:SetScript("OnMouseDown",ObjectivesOnMouseDown);
	f:SetScript("OnMouseUp",ObjectivesOnMouseUp);
	f:SetScript("OnHide",ObjectivesOnHide);

	-- Create Scroll Frame Scroller Frame
	f.scroller      = CreateFrame( "Frame", "$parent_Scroller", f );	
	f.scroller:SetWidth( f:GetWidth() );
	f.scroller:SetWidth( f:GetHeight() );

	-- Tell WoW Which Frame is the Scroll child
	f:SetScrollChild( f.scroller );

	return f;
And here's the WatchFrame Resize Function :
Code:
local function ResetWatchFrame()
	nUI_Options.movedWatchFrame = true;
	
	WatchFrame.moving = true;
	WatchFrame.sizing = true;
	
	WatchFrame:SetMovable( true );
	WatchFrame:SetResizable( true );
	WatchFrame:StartMoving();
	WatchFrame:StartSizing( "BOTTOMRIGHT" );
	
	WatchFrame:ClearAllPoints();
	WatchFrame:SetParent(WatchFrameScrollFrame);
	WatchFrame:SetPoint( "BOTTOMRIGHT", WatchFrameScrollFrame, "BOTTOMRIGHT", 0, 0 );
	WatchFrame:SetPoint( "TOPLEFT", WatchFrameScrollFrame, "TOPLEFT", 0, 0 );
	WatchFrame:SetHeight( 640 ); -- WatchFrameScrollFrame:GetHeight() );
	WatchFrame:SetWidth( WatchFrameScrollFrame:GetWidth() );

	WatchFrame.moving = nil;
	WatchFrame.sizing = nil;

	WATCHFRAME_IGNORECURSOR = "1";			
	WATCHFRAME_LASTWIDTH    = WatchFrameScrollFrame:GetWidth() ;
	
	WatchFrame:StopMovingOrSizing();
	WatchFrame:SetUserPlaced( true );
	print("Top:",WatchFrame:GetTop(), "Bottom:", WatchFrame:GetBottom());
	WatchFrame_Expand( WatchFrame );
end
And finally, the piece of code that the addon executes :
Code:
local plugin    = CreateFrame( "Frame", "Mini_ObjectiveFrame", UIParent );

local function onEvent()
	if event == "VARIABLES_LOADED" then
		WatchFrameScrollFrame = CreateScrollFrame();
		nUI_Movers:lockFrame( WatchFrame, false, nil  );
		ResetWatchFrame();
		nUI_Movers:lockFrame( WatchFrame, true, nil );
	end	
end

plugin:SetScript( "OnEvent", onEvent );
plugin:RegisterEvent( "VARIABLES_LOADED" );
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_122409_175735.jpg
Views:	883
Size:	206.3 KB
ID:	3753  
__________________

Last edited by Xrystal : 12-24-09 at 12:09 PM.
 
12-24-09, 12:21 PM   #19
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Okay, managed to get the WatchFrame to reset itself everytime the scroll frame is moved. However, despite the initial alignment being almost correct the moment the scroll frame is moved the alignment returns back to the non scrollframe way.

Edit: Woot, got it to move and stay inside the frame when it moved. Which works until the scrollframe is moved so that the height I specified to the watch frame means the watchframe has to move outside of the box to stay its height. So it looks like it is ignoring the fact it is in a scroll frame or there is something I am missing from your code Scott.

Edit2: Well, thought I would test it on a character with more than 1 quest to track Screenshot 3 is the result. I guess there is more involved in getting the scroll frame to scroll But I'm not sure which of the rest of your code is relevant.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_122409_181926.jpg
Views:	863
Size:	211.4 KB
ID:	3754  Click image for larger version

Name:	WoWScrnShot_122409_183238.jpg
Views:	851
Size:	209.4 KB
ID:	3755  Click image for larger version

Name:	WoWScrnShot_122409_184306.jpg
Views:	889
Size:	257.8 KB
ID:	3756  
__________________

Last edited by Xrystal : 12-24-09 at 12:44 PM.
 
12-24-09, 01:34 PM   #20
spiel2001
nUI's Author
 
spiel2001's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2008
Posts: 7,724
Xrystal --

If you want, zip up the code you have so far and attach it as a message here -- I'll take a look at it and see if I can sort out what's missing and then post it back to you.
__________________

What people don't get is that I am, ultimately, an artist at heart.
My brush has two colors, 1 and 0, and my canvas is made of silicon.



Official nUI Web Site: http://www.nUIaddon.com
Official nUI Support Forum: http://forums.nUIaddon.com
My day job: http://www.presidio.com/
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Developer Chat » Quest Tracker Info Panel

Thread Tools
Display Modes

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