Пример #1
0
void CUIStatsPlayerList::InitTeamHeader(CUIXml& xml_doc, LPCSTR path){
	string256 _path;
	m_header_team = new CUIWindow();
	m_header_team->SetAutoDelete(true);
	CUIXmlInit::InitWindow(xml_doc, strconcat(sizeof(_path),_path, path, ":team_header"), 0, m_header_team);
	m_header_team->SetWidth(this->GetDesiredChildWidth());

	CUIStatic* logo = new CUIStatic();
	logo->SetAutoDelete(true);
	CUIXmlInit::InitStatic(xml_doc, strconcat(sizeof(_path),_path, path, ":team_header:logo"), 0, logo);
	m_header_team->AttachChild(logo);

	if (1 == m_CurTeam)
        logo->InitTexture(pSettings->r_string("team_logo_small", "team1"));
	else if (2 == m_CurTeam)
		logo->InitTexture(pSettings->r_string("team_logo_small", "team2"));
	else
		R_ASSERT2(false, "invalid team");
	
	S_ELEMENT t;
	CUIXmlInit::InitFont(xml_doc, strconcat(sizeof(_path),_path, path, ":team_header:text_format"), 0, t.c, t.f);
	t.h = m_header_team->GetHeight();

	m_header_text = new CUIStatic();
	m_header_text->SetAutoDelete(true);
	CUIXmlInit::InitStatic(xml_doc, strconcat(sizeof(_path),_path, path, ":team_header:header"), 0, m_header_text);
	m_header_text->SetWidth(GetDesiredChildWidth());
	m_header_text->SetVTextAlignment(valCenter);
	m_header_team->AttachChild(m_header_text);
	if (t.f)
		m_header_text->SetFont(t.f);
	m_header_text->SetTextColor(t.c);
}
Пример #2
0
	CUITrashIcon()
	{
		m_icon.SetWndSize(Fvector2().set(29.0f * UI()->get_current_kx(), 36.0f));
		m_icon.SetStretchTexture(true);
		//		m_icon.SetAlignment		(waCenter);
		m_icon.InitTexture("ui_inGame2_inv_trash");
	}
Пример #3
0
CUIStatic* init_addon(
	CUIWeaponCellItem *cell_item,
	LPCSTR sect,
	float scale,
	float scale_x,
	eAddonType idx)
{
	CUIStatic *addon = xr_new<CUIStatic>();
	addon->SetAutoDelete(true);

	auto pos		= cell_item->get_addon_offset(idx); pos.x *= scale*scale_x; pos.y *= scale;
	auto width		= (float)pSettings->r_u32(sect, "inv_grid_width")*INV_GRID_WIDTH;
	auto height		= (float)pSettings->r_u32(sect, "inv_grid_height")*INV_GRID_HEIGHT;
	auto tex_x		= (float)pSettings->r_u32(sect, "inv_grid_x")*INV_GRID_WIDTH;
	auto tex_y		= (float)pSettings->r_u32(sect, "inv_grid_y")*INV_GRID_HEIGHT;

	addon->SetStretchTexture	(true);
	addon->InitTexture			("ui\\ui_icon_equipment");
	addon->SetOriginalRect		(tex_x, tex_y, width, height);
	addon->SetWndRect			(pos.x, pos.y, width*scale*scale_x, height*scale);
	addon->SetColor				(color_rgba(255,255,255,192));

	return addon;
}