Exemplo n.º 1
0
//-----------------------------------------------------------------------------
// Draws the puppy
//-----------------------------------------------------------------------------
void CBitmapButton::Paint( void )
{
	// Determine the image to use based on the state
	int nCurrentImage = BUTTON_ENABLED;
	if (IsArmed())
	{
		if (IsDepressed())
		{
			nCurrentImage = BUTTON_PRESSED;
		}
		else
		{
			nCurrentImage = BUTTON_ENABLED_MOUSE_OVER;
		}
	}
	else if (!IsEnabled())
	{
		nCurrentImage = BUTTON_DISABLED;
	}

	if (m_bImageLoaded[nCurrentImage])
	{
		//m_pImage[nCurrentImage].DoPaint( GetVPanel() );
		//JL
		/*m_pImage[nCurrentImage].SetPos(m_fX0,-m_fY0);
		m_pImage[nCurrentImage].SetRenderSize(m_fX1-m_fX0,m_fY1-m_fY0);*/
		m_pImage[nCurrentImage].DoPaint( GetVPanel(), m_fX0, m_fY0, m_fX1, m_fY1 );
	}

	BaseClass::Paint();
}
Exemplo n.º 2
0
BOOL ErrorTrigger::Trigger(U32 _ID, U32 _parameter)
{ 
	// see if we're armed and the right trigger. 
	if ( IsArmed() && ID == _ID && parameter == _parameter)
		{
		  	// This is the right trigger, so increment the iteration count 
		  	++triggerIteration;
		  	if (iteration == triggerIteration) // if this is the right iteration, trigger it.
			{
				SetTriggered(); 
				return true;
			}
		}
	return false;
}
Exemplo n.º 3
0
bool C_ASW_T75::GetUseAction(ASWUseAction &action, C_ASW_Marine *pUser)
{
	if ( IsArmed() )
	{
		action.iUseIconTexture = GetT75IconTextureID();
		TryLocalize( "#asw_t75_armed", action.wszText, sizeof( action.wszText ) );
		action.UseTarget = this;
		action.fProgress = -1;
	}
	else
	{
		action.iUseIconTexture = GetT75IconTextureID();
		TryLocalize( "#asw_t75_arm", action.wszText, sizeof( action.wszText ) );
		action.UseTarget = this;
		action.fProgress = GetArmProgress();
	}
	action.UseIconRed = 255;
	action.UseIconGreen = 255;
	action.UseIconBlue = 255;
	action.bShowUseKey = true;
	action.iInventorySlot = -1;
	return true;
}