#include "stdafx.h"
#include "ServerUIManager.h"
#include "UIBackWindow.h"
#include "ServerWindow.h"

cServerUIManager::cServerUIManager()
{
	mpServerWindow = 0;
}

cServerUIManager::~cServerUIManager()
{
	mpServerWindow = 0;
}

void cServerUIManager::Init()
{
	UIMAN->SetCurrentStage( eStage_Server );

	/// 서버 리스트 창 생성 
	mpServerWindow = new cServerWindow;
	mpServerWindow->CreateByPropertyName( "P_ServerWindow", 0 );
}

void cServerUIManager::Open()
{
	UIMAN->SetCurrentStage( eStage_Server );

    mpServerWindow->Hide();
}

void cServerUIManager::Close()
{
	UIMAN->SetCurrentStage( eStage_Server );

	mpServerWindow->Hide();
}

void cServerUIManager::Process( unsigned long /*accumtime*/ )
{

}

void cServerUIManager::Visible()
{
	if( mpServerWindow )
	{
		mpServerWindow->SetEnabled( true );
		mpServerWindow->ShowTop();
	}
}

void cServerUIManager::EnableConnectBtn( bool enable )
{
	if( mpServerWindow )
	{
		cUINode* pNode = mpServerWindow->GetChild( eUIID_SERVER_CONNECT_BUTTON );
		if( pNode )
			pNode->SetEnabled( enable );
	}
}