View Single Post
04-30-10, 04:56 AM   #26
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Hmm, I'll try it but I have debug code at the top of the applyskin function and that doesn't execute so it doesn't even get that far to test the block you showed.

Code:
frame.applySkin = function( skin )
	
--	nUI_ProfileStart( ProfileCounter, "applySkin" );
	
	-- we don't allow the skin developer to not include HUD layouts... if they
	-- don't specify them, we use the default
	print("1. nUI_Hud: applySkin : ", skin);
	local skin = skin.HUDLayoutSelector or nUI_DefaultConfig.HUDLayoutSelector;
	
	if not skin or not skin.options.enabled then
		
		frame.enabled = false;
		background:Hide();
		
	else
		
		local have_selection   = false;
		local rotation         = {};
		local buttonbag_states = nil;
		
		frame.enabled = true;
		background:Show();

		frame.applyOptions( skin.options );
		frame.applyAnchor( skin.anchor );

		-- parse the list of available panels.
		
		for layout_name in pairs( nUI_HUDLayouts ) do
	
			local layout_config = nUI_HUDLayouts[layout_name];
			local layout_info   = nUI_HUDLayoutSelector.Layouts[layout_name];
			
			-- if it the layout is diabled, then make sure it's not longer visible
			-- or in the rotation
As you can see the debug message should execute the moment it hits the function but it doesn't when that error occurs.

And seeing as this seems to call the applyOptions and applyAnchor it looks like I need to find out what calls applySkin and debug back from there but every file has an applyskin but nothing seems to call it from what I can see. Ah found 2 blocks of applySkin codes. 1 in nUI.lua and 1 in nUI_Unit.lua.. might help track it down further.


edit 1:
Well, looks like I found something interesting ..
Code:
		-- apply the current skin
		print("nUI.lua - Skinning Frames...");
		for i=1, #nUI.SkinnedFrames do
			print("Skinning Frame ", i);
			nUI.SkinnedFrames[i].applySkin( nUI_CurrentSkin );
		end
When it errors out the for loop isn't executed which signifies that the skinned frames list isn't being created. This block of code is in the PlayerLogin event which I believe can happen before VariablesLoaded sometimes if I remember rightly which is the other event in use in the nUI.lua file.

Edit 2 : Interesting. Yep, seems to be a load order problem so far. sometimes it tries to skin the frames before the list is created and other times it creates the list before the frames are skinned so no problems. 2 more screenshots.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_043010_121156.jpg
Views:	644
Size:	252.5 KB
ID:	4211  Click image for larger version

Name:	WoWScrnShot_043010_121547.jpg
Views:	648
Size:	323.9 KB
ID:	4212  
__________________

Last edited by Xrystal : 04-30-10 at 05:17 AM.