Ejemplo n.º 1
0
CUIListBox::CUIListBox()
{
	m_pFont					= NULL;
	m_flags.set				(eItemsSelectabe, TRUE);

	m_def_item_height		 = 20;
	m_text_color			= 0xff000000;

	m_bImmediateSelection	= false;

	SetFixedScrollBar		(false);
	InitScrollView			();
}
Ejemplo n.º 2
0
void CUIStatsPlayerList::Init(CUIXml& xml_doc, LPCSTR path)
{
	// init window
	CUIXmlInit::InitScrollView	(xml_doc, path, 0, this);
	SetFixedScrollBar			(false);


	m_bStatus_mode				= xml_doc.ReadAttribInt(path,0,"status_mode",0)? true: false;
	m_bSpectator				= xml_doc.ReadAttribInt(path,0,"spectator",0)? true: m_bStatus_mode;
	SetSpectator				(m_bSpectator);

	// init item structure
	int tabsCount				= xml_doc.GetNodesNum(path, 0, "field");
	XML_NODE* tab_node			= xml_doc.NavigateToNode(path,0);
	xml_doc.SetLocalRoot		(tab_node);

	for (int i = 0; i < tabsCount; ++i)
	{
		LPCSTR name 			= xml_doc.ReadAttrib("field",i,"name");
		float width 			= xml_doc.ReadAttribFlt("field",i,"width");

		if (0 == xr_strcmp(name, "artefacts") && GameID() != eGameIDArtefactHunt)
			continue;
		
		AddField				(name,width);
	}
	xml_doc.SetLocalRoot		(xml_doc.GetRoot());
	string256					 _path;
	// init item text params
	CUIXmlInit::InitFont		(xml_doc, strconcat(sizeof(_path),_path, path, ":text_format"), 0, m_i.c, m_i.f);
	m_i.h						= xml_doc.ReadAttribFlt(strconcat(sizeof(_path),_path, path, ":text_format"), 0, "height", 25);

	// init list header
	switch (GameID())
	{
	case eGameIDCaptureTheArtefact:
	case eGameIDArtefactHunt:
	case eGameIDTeamDeathmatch:
		if (!m_bSpectator || m_bStatus_mode)
            InitTeamHeader(xml_doc, path);
	case eGameIDDeathmatch:
		InitHeader(xml_doc, path);
	default:
		break;
	}
}