Exemple #1
0
void CCharacterInfo::load_shared	(LPCSTR)
{
    const ITEM_DATA& item_data = *id_to_index::GetById(m_ProfileId);

    CUIXml*		pXML		= item_data._xml;
    pXML->SetLocalRoot		(pXML->GetRoot());

    XML_NODE* item_node = pXML->NavigateToNode(id_to_index::tag_name, item_data.pos_in_file);
    R_ASSERT3(item_node, "profile id=", *item_data.id);

    pXML->SetLocalRoot(item_node);



    LPCSTR spec_char = pXML->Read("specific_character", 0, NULL);
    if(!spec_char)
    {
        data()->m_CharacterId	= NULL;

        LPCSTR char_class			= pXML->Read	("class",		0,	NULL);

        if(char_class)
        {
            char* buf_str = xr_strdup(char_class);
            xr_strlwr(buf_str);
            data()->m_Class				= buf_str;
            xr_free(buf_str);
        }
        else
            data()->m_Class				= NO_CHARACTER_CLASS;

        data()->m_Rank = pXML->ReadInt			("rank",		0,	NO_RANK);
        data()->m_Reputation = pXML->ReadInt	("reputation",	0,	NO_REPUTATION);
    }
    else
        data()->m_CharacterId = spec_char;
}
Exemple #2
0
void CUISequencer::Start(LPCSTR tutor_name)
{
	VERIFY(m_items.size()==0);
	Device.seqFrame.Add			(this, REG_PRIORITY_LOW-10000);
	Device.seqRender.Add		(this, 3);
	
	m_UIWindow					= xr_new<CUIWindow>();

	CUIXml uiXml;
	uiXml.Init					(CONFIG_PATH, UI_PATH, "game_tutorials.xml");
	
	int items_count				= uiXml.GetNodesNum	(tutor_name,0,"item");	VERIFY(items_count>0);
	uiXml.SetLocalRoot			(uiXml.NavigateToNode(tutor_name,0));

	m_bPlayEachItem				= !!uiXml.ReadInt("play_each_item",0,0);

	CUIXmlInit xml_init;
	xml_init.InitWindow			(uiXml, "global_wnd", 0,	m_UIWindow);
//.	xml_init.InitAutoStaticGroup(uiXml, "global_wnd",		m_UIWindow);

	for(int i=0;i<items_count;++i){
		LPCSTR	_tp				= uiXml.ReadAttrib			("item",i,"type","");
		bool bVideo				= 0==_stricmp(_tp,"video");
		CUISequenceItem* pItem	= 0;
		if (bVideo)	pItem		= xr_new<CUISequenceVideoItem>(this);
		else		pItem		= xr_new<CUISequenceSimpleItem>(this);
		m_items.push_back		(pItem);
		pItem->Load				(&uiXml,i);
	}

	CUISequenceItem* pCurrItem	= m_items.front();
	pCurrItem->Start			();
	m_pStoredInputReceiver		= pInput->CurrentIR();
	IR_Capture					();
	m_bActive					= true;
}