Beispiel #1
0
DEFINE_ACTION_FUNCTION(_Translation, SetPlayerTranslation)
{
	PARAM_PROLOGUE;
	PARAM_UINT(tgroup);
	PARAM_UINT(tnum);
	PARAM_UINT(pnum);
	PARAM_POINTER(cls, FPlayerClass);

	if (pnum >= MAXPLAYERS || tgroup >= NUM_TRANSLATION_TABLES || tnum >= translationtables[tgroup].Size())
	{
		ACTION_RETURN_BOOL(false);
	}
	auto self = &players[pnum];
	int PlayerColor = self->userinfo.GetColor();
	int	PlayerSkin = self->userinfo.GetSkin();
	int PlayerColorset = self->userinfo.GetColorSet();

	if (cls != nullptr)
	{
		PlayerSkin = R_FindSkin(Skins[PlayerSkin].Name, int(cls - &PlayerClasses[0]));
		R_GetPlayerTranslation(PlayerColor, GetColorSet(cls->Type, PlayerColorset),
			&Skins[PlayerSkin], translationtables[tgroup][tnum]);
	}
	ACTION_RETURN_BOOL(true);
}
void CXTPTabPaintManager::DrawTabControlEx(CXTPTabManager* pTabManager, CDC* pDC, CRect rcClient)
{
	if (pTabManager->IsDrawStaticFrame())
	{
		pDC->Draw3dRect(rcClient, GetColorSet()->m_clrFrameBorder, GetColorSet()->m_clrFrameBorder);
		CAppearanceSet::DeflateRectEx(rcClient, CRect(1, 1, 1, 1), pTabManager->GetPosition());
		pDC->Draw3dRect(rcClient, GetColorSet()->m_clrControlFace, GetColorSet()->m_clrControlFace);
		CAppearanceSet::DeflateRectEx(rcClient, CRect(1, 0, 1, 1), pTabManager->GetPosition());
	}

	if (m_bFillBackground)
	{
		pDC->FillSolidRect(rcClient, GetColorSet()->m_clrControlFace);
	}

	CAppearanceSet::DeflateRectEx(rcClient, m_rcControlMargin, pTabManager->GetPosition());

	pDC->SetBkMode(TRANSPARENT);


	if (m_bFillBackground)
	{
		m_pAppearanceSet->FillTabControl(pTabManager, pDC, rcClient);
	}

	CRect rcClipBox;
	pDC->GetClipBox(rcClipBox);

	if (m_bClipHeader)
		rcClipBox = m_pAppearanceSet->GetHeaderClipBox(pDC, pTabManager);

	if (!rcClipBox.IsRectEmpty())
	{
		CRgn rgn;
		if (m_bClipHeader)
		{
			CRect rcClipBoxViewport(rcClipBox);
			rcClipBoxViewport.OffsetRect(-pDC->GetWindowOrg());

			rgn.CreateRectRgnIndirect(rcClipBoxViewport);
			pDC->SelectClipRgn(&rgn);

			m_pColorSet->SelectClipRgn(pDC, rcClient, pTabManager);
		}

		int nRowCont = pTabManager->GetRowCount();

		for (int j = nRowCont - 1; j >= 0; j--)
		{
			DrawRowItems(pTabManager, pDC, rcClipBox, j);
		}

		if (m_bClipHeader)
		{
			pDC->SelectClipRgn(NULL);
		}
	}

	for (int i = pTabManager->GetNavigateButtonCount() - 1; i >= 0; i--)
		pTabManager->GetNavigateButton(i)->Draw(pDC);

}