Esempio n. 1
0
bool ForceGroupBar::addVehicle( Mover* pMover )
{
	if ( iconCount >= MAX_ICONS )
	{
		gosASSERT( false );
		return 0;
	}
	
	VehicleIcon* pIcon = new VehicleIcon;
	bool bRetVal = pIcon->init( pMover );

	icons[iconCount++] = pIcon;

	return bRetVal;
}
Esempio n. 2
0
void InfoWindow::setUnit(Mover* pNewMover)
{

	if ( pNewMover && ( pNewMover->getTeamId() != Team::home->getId() &&
		( CONTACT_VISUAL != pNewMover->getContactStatus(Team::home->getId(), true)) 
		&& !pNewMover->isDisabled() ))
	{
		return;
	}

	if ( pUnit != pNewMover )
	{
		pUnit = pNewMover;
		bUnitChanged = true;

		if ( icon )
		{
			delete icon;
			icon = NULL;
		}

		icon = NULL;

		scrollPos = 0;
		infoLength = 0;

		if ( pNewMover )
		{

			if ( pNewMover->getObjectType()->getObjectTypeClass() == BATTLEMECH_TYPE )
			{
				MechIcon* pIcon = new MechIcon;
				pIcon->setLocationIndex( 16 );
				pIcon->init( pNewMover );
				pIcon->setDrawBack( true );
				icon = pIcon;
			}
			else
			{
				VehicleIcon* pIcon = new VehicleIcon;
				pIcon->setLocationIndex( 16 );
				pIcon->setDrawBack( 1 );
				pIcon->init( pNewMover );
				icon = pIcon;
			}
		}
	}
}