コード例 #1
0
ファイル: UIDialogWnd.cpp プロジェクト: OLR-xray/XRay-NEW
bool CUIDialogWnd::IR_OnKeyboardRelease(int dik)
{
	if(!IR_process()) return false;
	
	//mouse click
	if(dik==MOUSE_1 || dik==MOUSE_2 || dik==MOUSE_3)
	{
		Fvector2 cp = GetUICursor()->GetPos();
		EUIMessages action = (dik==MOUSE_1)?WINDOW_LBUTTON_UP :(dik==MOUSE_2)?WINDOW_RBUTTON_UP:WINDOW_CBUTTON_UP;
		if (OnMouse(cp.x, cp.y, action))
            return true;
	}

	if (OnKeyboard(dik,	WINDOW_KEY_RELEASED))
		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_OnKeyboardRelease(get_binded_action(dik));
		}
	}
	return false;
}
コード例 #2
0
ファイル: Level_input.cpp プロジェクト: AntonioModer/xray-16
void CLevel::IR_OnKeyboardRelease(int key)
{
	if (!bReady || g_bDisableAllInput	)								return;
	if ( CurrentGameUI() && CurrentGameUI()->IR_UIOnKeyboardRelease(key)) return;
	if (game && game->OnKeyboardRelease(get_binded_action(key)) )		return;
	if (Device.Paused() 
#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_OnKeyboardRelease			(get_binded_action(key));
	}
}
コード例 #3
0
void CLevel::IR_OnKeyboardRelease(int key)
{
	bool b_ui_exist = (pHUD && pHUD->GetUI());

	if (!bReady || g_bDisableAllInput	) return;
	
	if (g_actor) Actor()->callback(GameObject::eOnKeyRelease)(key, get_binded_action(key));//+
	if ( b_ui_exist && pHUD->GetUI()->IR_OnKeyboardRelease(key)) return;
	if (Device.Paused()		) return;
	if (game && Game().OnKeyboardRelease(get_binded_action(key)) ) return;

	if( b_ui_exist && HUD().GetUI()->MainInputReceiver() )return;
	if (CURRENT_ENTITY())		{
		IInputReceiver*		IR	= smart_cast<IInputReceiver*>	(smart_cast<CGameObject*>(CURRENT_ENTITY()));
		if (IR)				IR->IR_OnKeyboardRelease			(get_binded_action(key));
	}
}
コード例 #4
0
ファイル: Level_input.cpp プロジェクト: Karlan88/xray
void CLevel::IR_OnKeyboardRelease(int key)
{
	bool b_ui_exist = (pHUD && pHUD->GetUI());

	if (g_bDisableAllInput	) return;

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

	if ( b_ui_exist && pHUD->GetUI()->IR_OnKeyboardRelease(key)) return;
	if (Device.Paused()		) return;
	if (game && Game().OnKeyboardRelease(get_binded_action(key)) ) return;

	if( b_ui_exist && HUD().GetUI()->MainInputReceiver() )return;
	if (CURRENT_ENTITY())		{
		IInputReceiver*		IR	= smart_cast<IInputReceiver*>	(smart_cast<CGameObject*>(CURRENT_ENTITY()));
		if (IR)				IR->IR_OnKeyboardRelease			(get_binded_action(key));
	}
}
コード例 #5
0
ファイル: Level_input.cpp プロジェクト: denanden/xray-16
void CLevel::IR_OnKeyboardRelease(int key)
{
    if (!bReady || g_bDisableAllInput)								return;

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

    if (CurrentGameUI() && CurrentGameUI()->IR_UIOnKeyboardRelease(key)) return;
    if (game && game->OnKeyboardRelease(get_binded_action(key)))		return;
    if (Device.Paused()
#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_OnKeyboardRelease(get_binded_action(key));
    }
}