Exemplo n.º 1
0
void UI_SaberDrawBlades( itemDef_t *item, vec3_t origin, float curYaw )
{
	//NOTE: only allows one saber type in view at a time
	char saber[MAX_QPATH];
	int saberNum = 0;
	int saberModel = 0;
	int	numSabers = 1;

	if ( (item->flags&ITF_ISCHARACTER)//hacked sabermoves sabers in character's hand
		&& uiInfo.movesTitleIndex == 4 /*MD_DUAL_SABERS*/ )
	{
		numSabers = 2;
	}

	for ( saberNum = 0; saberNum < numSabers; saberNum++ )
	{
		if ( (item->flags&ITF_ISCHARACTER) )//hacked sabermoves sabers in character's hand
		{
			UI_GetSaberForMenu( saber, saberNum );
			saberModel = saberNum + 1;
		}
		else if ( (item->flags&ITF_ISSABER) )
		{
			DC->getCVarString( "ui_saber", saber, sizeof(saber) );
			saberModel = 0;
		}
		else if ( (item->flags&ITF_ISSABER2) )
		{
			DC->getCVarString( "ui_saber2", saber, sizeof(saber) );
			saberModel = 0;
		}
		else
		{
			return;
		}
		if ( saber[0] )
		{
			int numBlades = UI_SaberNumBladesForSaber( saber );
			if ( numBlades )
			{//okay, here we go, time to draw each blade...
				char	saberTypeString[MAX_QPATH]={0};
				UI_SaberTypeForSaber( saber, saberTypeString );
				saberType_t saberType = TranslateSaberType( saberTypeString );
				for ( int curBlade = 0; curBlade < numBlades; curBlade++ )
				{
					if ( UI_SaberShouldDrawBlade( saber, curBlade ) )
					{
						UI_SaberDrawBlade( item, saber, saberModel, saberType, origin, curYaw, curBlade );
					}
				}
			}
		}
	}
}
Exemplo n.º 2
0
void UI_SaberDrawBlades( itemDef_t *item, vector3 *origin, vector3 *angles ) {
	//NOTE: only allows one saber type in view at a time
	char saber[MAX_QPATH];
	int saberNum = 0;
	int saberModel = 0;
	int	numSabers = 1;

	if ( (item->flags&ITF_ISCHARACTER)//hacked sabermoves sabers in character's hand
		&& uiInfo.movesTitleIndex == 4 /*MD_DUAL_SABERS*/ ) {
		numSabers = 2;
	}

	for ( saberNum = 0; saberNum < numSabers; saberNum++ ) {
		if ( (item->flags&ITF_ISCHARACTER) )//hacked sabermoves sabers in character's hand
		{
			UI_GetSaberForMenu( saber, saberNum );
			saberModel = saberNum + 1;
		}
		else if ( (item->flags&ITF_ISSABER) ) {
			trap->Cvar_VariableStringBuffer( "ui_saber", saber, sizeof(saber) );
			if ( !UI_SaberValidForPlayerInMP( saber ) ) {
				trap->Cvar_Set( "ui_saber", "kyle" );
				trap->Cvar_VariableStringBuffer( "ui_saber", saber, sizeof(saber) );
			}
			saberModel = 0;
		}
		else if ( (item->flags&ITF_ISSABER2) ) {
			trap->Cvar_VariableStringBuffer( "ui_saber2", saber, sizeof(saber) );
			if ( !UI_SaberValidForPlayerInMP( saber ) ) {
				trap->Cvar_Set( "ui_saber2", "kyle" );
				trap->Cvar_VariableStringBuffer( "ui_saber2", saber, sizeof(saber) );
			}
			saberModel = 0;
		}
		else {
			return;
		}
		if ( saber[0] ) {
			saberType_t saberType;
			int curBlade = 0;
			int numBlades = UI_SaberNumBladesForSaber( saber );
			if ( numBlades ) {//okay, here we go, time to draw each blade...
				char	saberTypeString[MAX_QPATH] = { 0 };
				UI_SaberTypeForSaber( saber, saberTypeString );
				saberType = TranslateSaberType( saberTypeString );
				for ( curBlade = 0; curBlade < numBlades; curBlade++ ) {
					if ( UI_SaberShouldDrawBlade( saber, curBlade ) ) {
						UI_SaberDrawBlade( item, saber, saberModel, saberType, origin, angles, curBlade );
					}
				}
			}
		}
	}
}