Ejemplo n.º 1
0
void CActor::IR_OnMouseMove(int dx, int dy)
{

	if(hud_adj_mode)
	{
		g_player_hud->tune	(Ivector().set(dx,dy,0));
		return;
	}

	PIItem iitem = inventory().ActiveItem();
	if(iitem && iitem->cast_hud_item())
		iitem->cast_hud_item()->ResetSubStateTime();

	if (Remote())		return;

	if(m_holder) 
	{
		m_holder->OnMouseMove(dx,dy);
		return;
	}

	float LookFactor = GetLookFactor();

	CCameraBase* C	= cameras	[cam_active];
	float scale		= (C->f_fov/g_fov)*psMouseSens * psMouseSensScale/50.f  / LookFactor;
	if (dx){
		float d = float(dx)*scale;
		cam_Active()->Move((d<0)?kLEFT:kRIGHT, _abs(d));
	}
	if (dy){
		float d = ((psMouseInvert.test(1))?-1:1)*float(dy)*scale*3.f/4.f;
		cam_Active()->Move((d>0)?kUP:kDOWN, _abs(d));
	}
}
CObjectPropertyEvaluatorNoItems::_value_type CObjectPropertyEvaluatorNoItems::evaluate	()
{
	PIItem I = object().inventory().ActiveItem();
	if (!I)
		return		(true);
	
	if (!I->cast_hud_item() || I->cast_hud_item()->IsHidden())
		return		(true);

	if (I->cast_hud_item() && I->cast_hud_item()->IsShowing())
		return		(true);

	return			(false);
}
Ejemplo n.º 3
0
void CCustomDetector::ToggleDetector(bool bFastMode)
{
	m_bFastAnimMode = bFastMode;
	m_bNeedActivation = false;
	if(GetState()==eHidden)
	{
		PIItem iitem = m_pInventory->ActiveItem();
		CHudItem* itm = (iitem)?iitem->cast_hud_item():NULL;
		if(CheckCompatibilityInt(itm))
		{
			SwitchState(eShowing);
			TurnDetectorInternal(true);
		}
		else
		{
			m_pInventory->Activate(BOLT_SLOT);//+
			m_bNeedActivation = true;//+
		};
	}else
	if(GetState()==eIdle)
		SwitchState					(eHiding);

}