예제 #1
0
void CLevel::IR_OnKeyboardHold(int key)
{
    if (g_bDisableAllInput) return;

#ifdef KEY_HOLD_CALLBACK
    /* avo: script callback */
    if (g_actor) g_actor->callback(GameObject::eKeyHold)(key);
    /* avo: end */
#endif // KEY_HOLD_CALLBACK


#ifdef DEBUG
    // Lain: added
    if ( key == DIK_UP )
    {
        static u32 time = Device.dwTimeGlobal;
        if ( Device.dwTimeGlobal - time > 20 )
        {
            if ( CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()) )
            {
                DBG().debug_info_up();
                time = Device.dwTimeGlobal;
            }
        }
    }
    else if ( key == DIK_DOWN )
    {
        static u32 time = Device.dwTimeGlobal;
        if ( Device.dwTimeGlobal - time > 20 )
        {
            if ( CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()) )
            {
                DBG().debug_info_down();
                time = Device.dwTimeGlobal;
            }
        }
    }

#endif // DEBUG

    if (CurrentGameUI() && CurrentGameUI()->IR_UIOnKeyboardHold(key)) return;
    if (Device.Paused() && !Level().IsDemoPlay()
#ifdef DEBUG
        && !psActorFlags.test(AF_NO_CLIP)
#endif //DEBUG
        ) return;
    if (CURRENT_ENTITY())
    {
        IInputReceiver*		IR = smart_cast<IInputReceiver*>	(smart_cast<CGameObject*>(CURRENT_ENTITY()));
        if (IR)				IR->IR_OnKeyboardHold(get_binded_action(key));
    }
}
예제 #2
0
bool CUIDialogWnd::IR_OnKeyboardHold(int dik)
{
	if(!IR_process()) return false;
	if (OnKeyboardHold(dik)) 
		return true;

	if( !StopAnyMove() && g_pGameLevel ){
		CObject* O = Level().CurrentEntity();
		if( O ){
			IInputReceiver*		IR	= smart_cast<IInputReceiver*>( smart_cast<CGameObject*>(O) );
			if (!IR)
				return			(false);
			IR->IR_OnKeyboardHold(get_binded_action(dik));
		}
	}
	return false;
}
예제 #3
0
void CLevel::IR_OnKeyboardHold(int key)
{
	if(g_bDisableAllInput) return;
	if (g_actor) Actor()->callback(GameObject::eOnKeyHold)(key, get_binded_action(key));//+

#ifdef DEBUG
	// Lain: added
	if ( key == DIK_UP )
	{
		static uint time = Device.dwTimeGlobal;
		if ( Device.dwTimeGlobal - time > 20 )
		{
			if ( CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()) )
			{
				DBG().debug_info_up();
				time = Device.dwTimeGlobal;
			}
		}
	}
	else if ( key == DIK_DOWN )
	{
		static uint time = Device.dwTimeGlobal;
		if ( Device.dwTimeGlobal - time > 20 )
		{
			if ( CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()) )
			{
				DBG().debug_info_down();
				time = Device.dwTimeGlobal;
			}
		}
	}

#endif // DEBUG

	bool b_ui_exist = (pHUD && pHUD->GetUI());

	if (b_ui_exist && pHUD->GetUI()->IR_OnKeyboardHold(key)) return;
	if ( b_ui_exist && HUD().GetUI()->MainInputReceiver() )return;
	if ( Device.Paused() && !Level().IsDemoPlay()) return;
	if (CURRENT_ENTITY())		{
		IInputReceiver*		IR	= smart_cast<IInputReceiver*>	(smart_cast<CGameObject*>(CURRENT_ENTITY()));
		if (IR)				IR->IR_OnKeyboardHold				(get_binded_action(key));
	}
}
예제 #4
0
void CLevel::IR_OnKeyboardHold(int key)
{
	if(g_bDisableAllInput) return;

	/************************************************** added by Ray Twitty (aka Shadows) START **************************************************/
	// Колбек на удерживание клавиши
	if(g_actor) Actor()->callback(GameObject::eOnKeyHold)(key);
	/*************************************************** added by Ray Twitty (aka Shadows) END ***************************************************/

	bool b_ui_exist = (pHUD && pHUD->GetUI());

	if (b_ui_exist && pHUD->GetUI()->IR_OnKeyboardHold(key)) return;
	if ( b_ui_exist && HUD().GetUI()->MainInputReceiver() )return;
	if ( Device.Paused() ) return;
	if (CURRENT_ENTITY())		{
		IInputReceiver*		IR	= smart_cast<IInputReceiver*>	(smart_cast<CGameObject*>(CURRENT_ENTITY()));
		if (IR)				IR->IR_OnKeyboardHold				(get_binded_action(key));
	}
}