예제 #1
0
void CUIPdaWnd::Init()
{
    CUIXml					uiXml;
    uiXml.Load				(CONFIG_PATH, UI_PATH, PDA_XML);

    m_pActiveDialog			= NULL;
    m_sActiveSection		= "";

    CUIXmlInit::InitWindow	(uiXml, "main", 0, this);

    UIMainPdaFrame			= UIHelper::CreateStatic( uiXml, "background_static", this );
    m_caption				= UIHelper::CreateStatic( uiXml, "caption_static", this );
    m_caption_const._set	( m_caption->GetText() );

    m_anim_static			= new CUIAnimatedStatic();
    AttachChild				(m_anim_static);
    m_anim_static->SetAutoDelete(true);
    CUIXmlInit::InitAnimatedStatic(uiXml, "anim_static", 0, m_anim_static);

    m_btn_close				= UIHelper::Create3tButtonEx( uiXml, "close_button", this );
    m_hint_wnd				= UIHelper::CreateHint( uiXml, "hint_wnd" );
//	m_btn_close->set_hint_wnd( m_hint_wnd );


    if ( IsGameTypeSingle() )
    {
        pUITaskWnd					= new CUITaskWnd();
        pUITaskWnd->hint_wnd		= m_hint_wnd;
        pUITaskWnd->Init			();

        pUIFactionWarWnd				= new CUIFactionWarWnd();
        pUIFactionWarWnd->hint_wnd		= m_hint_wnd;
        pUIFactionWarWnd->Init			();

        pUIRankingWnd					= new CUIRankingWnd();
        pUIRankingWnd->Init				();

        pUILogsWnd						= new CUILogsWnd();
        pUILogsWnd->Init				();

    }

    UITabControl					= new CUITabControl();
    UITabControl->SetAutoDelete		(true);
    AttachChild						(UITabControl);
    CUIXmlInit::InitTabControl		(uiXml, "tab", 0, UITabControl);
    UITabControl->SetMessageTarget	(this);

    UINoice					= new CUIStatic();
    UINoice->SetAutoDelete	( true );
    CUIXmlInit::InitStatic	( uiXml, "noice_static", 0, UINoice );

    RearrangeTabButtons		(UITabControl);
}
예제 #2
0
void CUIPdaWnd::Init()
{
	CUIXml uiXml;
	bool xml_result			= uiXml.Init(CONFIG_PATH, UI_PATH,PDA_XML);
	R_ASSERT3				(xml_result, "xml file not found", PDA_XML);

	CUIXmlInit xml_init;
	
	m_pActiveDialog			= NULL;


	xml_init.InitWindow		(uiXml, "main", 0, this);

	UIMainPdaFrame			= xr_new<CUIStatic>(); UIMainPdaFrame->SetAutoDelete(true);
	AttachChild				(UIMainPdaFrame);
	xml_init.InitStatic		(uiXml, "background_static", 0, UIMainPdaFrame);

	//Ёлементы автоматического добавлени¤
	xml_init.InitAutoStatic	(uiXml, "auto_static", this);

	// Main buttons background
	UIMainButtonsBackground = xr_new<CUIFrameLineWnd>(); UIMainButtonsBackground->SetAutoDelete(true);
	UIMainPdaFrame->AttachChild(UIMainButtonsBackground);
	xml_init.InitFrameLine	(uiXml, "mbbackground_frame_line", 0, UIMainButtonsBackground);

	// Timer background
	UITimerBackground		= xr_new<CUIFrameLineWnd>(); UITimerBackground->SetAutoDelete(true);
	UIMainPdaFrame->AttachChild(UITimerBackground);
	xml_init.InitFrameLine	(uiXml, "timer_frame_line", 0, UITimerBackground);

	// Oкно карты
	UIMapWnd				= xr_new<CUIMapWnd>();
	UIMapWnd->Init			("pda_map.xml","map_wnd");

	if( IsGameTypeSingle() )
	{
		// Oкно коммуникaции
		UIPdaContactsWnd		= xr_new<CUIPdaContactsWnd>();
		UIPdaContactsWnd->Init	();


		// Oкно новостей
		UIDiaryWnd				= xr_new<CUIDiaryWnd>();
		UIDiaryWnd->Init		();

		// ќкно энциклопедии
		UIEncyclopediaWnd		= xr_new<CUIEncyclopediaWnd>();
		UIEncyclopediaWnd->Init	();

		// ќкно статистики о актере
		UIActorInfo				= xr_new<CUIActorInfoWnd>();
		UIActorInfo->Init		();

		// ќкно рейтинга сталкеров
		UIStalkersRanking		= xr_new<CUIStalkersRankingWnd>();
		UIStalkersRanking->Init	();

		UIEventsWnd				= xr_new<CUIEventsWnd>();
		UIEventsWnd->Init		();
	}
	// Tab control
	UITabControl				= xr_new<CUITabControl>(); UITabControl->SetAutoDelete(true);
	UIMainPdaFrame->AttachChild	(UITabControl);
	xml_init.InitTabControl		(uiXml, "tab", 0, UITabControl);
	UITabControl->SetMessageTarget(this);

	if(GameID()!=GAME_SINGLE){
		UITabControl->GetButtonsVector()->at(0)->Enable(false);
		UITabControl->GetButtonsVector()->at(2)->Enable(false);
		UITabControl->GetButtonsVector()->at(3)->Enable(false);
		UITabControl->GetButtonsVector()->at(4)->Enable(false);
		UITabControl->GetButtonsVector()->at(5)->Enable(false);
		UITabControl->GetButtonsVector()->at(6)->Enable(false);
	}
	
	m_updatedSectionImage			= xr_new<CUIStatic>();
	xml_init.InitStatic				(uiXml, "updated_section_static", 0, m_updatedSectionImage);

	m_oldSectionImage				= xr_new<CUIStatic>();
	xml_init.InitStatic				(uiXml, "old_section_static", 0, m_oldSectionImage);

	m_pActiveSection				= eptNoActiveTab;

	RearrangeTabButtons			(UITabControl, m_sign_places_main);
}