Thread: LUA Error
View Single Post
04-24-10, 10:41 AM   #11
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Woot .. my changes seemed to have gotten rid of the chatframe error

Here's a pic to show the error gone from the list and the chatframe appearing as normal

And this is the function I touched so that you can compare with the existing code Scott The TJK marks are the ones I added yesterday but can't remember if anything else is different rofl.

Code:
local function onChatFrameEvent()

--	nUI_ProfileStart( ProfileCounter, "onChatFrameEvent", event );
	
	if event == "VARIABLES_LOADED" then

		nUI:registerScalableFrame( frame );		
		nUI_ChatFrame:configFrame();
		
	else

        frame:UnregisterEvent( "PLAYER_ENTERING_WORLD" );
        
		frame.texture = frame:CreateTexture();
		frame.texture:SetAllPoints( nUI.chat_frame );
	
		-- relocate the chat frame to the area we have set aside for it on the dashboard
		-- TJK, probably will want to download a proper version to get back on track :D 
		FCF_SetLocked( DEFAULT_CHAT_FRAME, nil );
		MOVING_CHAT_FRAME = DEFAULT_CHAT_FRAME;
		DEFAULT_CHAT_FRAME:StartMoving();
		DEFAULT_CHAT_FRAME:StartSizing();
		DEFAULT_CHAT_FRAME:Hide();						-- TJK
		DEFAULT_CHAT_FRAME:SetParent(nil);				-- TJK
		--DEFAULT_CHAT_FRAME:ClearAllPoints();			-- TJK Trying to turn off that annoying error.
		DEFAULT_CHAT_FRAME:SetParent( nUI.chat_frame );	-- TJK
		DEFAULT_CHAT_FRAME:SetPoint( "BOTTOMRIGHT", nUI.chat_frame, "BOTTOMRIGHT", -5, 6 );
		DEFAULT_CHAT_FRAME:SetPoint( "TOPLEFT", nUI.chat_frame, "TOPLEFT", 4, -5 );
		--DEFAULT_CHAT_FRAME:Hide();
		DEFAULT_CHAT_FRAME:StopMovingOrSizing();
		
		MOVING_CHAT_FRAME = nil;
	
		-- set strata, etc, for all defined frames, make sure they're all docked
		
		for i=1, NUM_CHAT_WINDOWS do
			
			if i ~= 2 then -- we handle the combat log separately
				
				local cframe  = _G["ChatFrame"..i];
		
				cframe.is_chat_frame = i == 1;

				if i == 1 or cframe.isDocked then
								
					cframe:SetUserPlaced( true );
					
					FCF_SetLocked( cframe, 1 );
					FCF_SetWindowAlpha( cframe, 0 );
					
				end
				
				-- relocate the chat frame buttons
		
				local bottom  = _G["ChatFrame"..i.."BottomButton"];
				local down    = _G["ChatFrame"..i.."DownButton"];
				local up      = _G["ChatFrame"..i.."UpButton"];
				
				if cframe.is_chat_frame then
					ChatFrameMenuButton:SetAlpha( 0 );
				end
				
				bottom:SetAlpha( 0 );			
				down:SetAlpha( 0 );			
				up:SetAlpha( 0 );
					
				-- set method to show or hide the scroll buttons based on whether or
				-- not the mouse is in the frame
				
				cframe.showButtons = function( enabled )
	
					if enabled ~= cframe.buttons_visible then
						
						cframe.buttons_visible = enabled;
						if cframe.is_chat_frame then
							ChatFrameMenuButton:SetAlpha( enabled and 1 or 0 );
						end
						bottom:SetAlpha( enabled and 1 or 0 );
						down:SetAlpha( enabled and 1 or 0 );
						up:SetAlpha( enabled and 1 or 0 );
											
					end
				end
				
				-- allow scrolling of the combat log frame with the mouse wheel
				
				cframe:EnableMouseWheel( true );	
				
				cframe:SetScript( "OnMouseWheel", 
					function()
						if arg1 > 0 then cframe:ScrollUp();
						else cframe:ScrollDown();
						end	
					end	
				);		
				
			end
		end
		
		-- relocate the chat frame edit box in the same manner
		
		if not IsAddOnLoaded( "Chatter" ) 
		and not IsAddOnLoaded( "Prat-3.0" )
		and not IsAddOnLoaded( "Prat-3.3" )
		then
			
			local right = ChatFrameEditBox:GetRight() + 0;
			local left  = ChatFrameEditBox:GetLeft() + 0;
			local scale = ChatFrameEditBox:GetEffectiveScale() + 0;
			local width = ( right - left) / scale;
			
			ChatFrameEditBox:SetParent( nUI.chat_frame );
			ChatFrameEditBox:SetScale( 0.75 / UIParent:GetScale() );
			ChatFrameEditBox:ClearAllPoints();
			ChatFrameEditBox:SetPoint( "TOPLEFT", nUI.chat_frame, "TOPLEFT", 0, 1 );
			ChatFrameEditBox:SetPoint( "TOPRIGHT", nUI.chat_frame, "TOPRIGHT", 0, 1 );
			ChatFrameEditBox:SetFrameStrata( "DIALOG" );
			ChatFrameEditBox:SetFrameLevel( 1 );
		end
				
		ChatFrameMenuButton:ClearAllPoints();
		ChatFrameMenuButton:SetScale( 0.8 );
		ChatFrameMenuButton:SetPoint( "BOTTOM", ChatFrame1UpButton, "TOP", 0, -6 );
		
	end
	
--	nUI_ProfileStop();
	
end
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_042410_173523.jpg
Views:	725
Size:	246.9 KB
ID:	4179  
__________________


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