A few fixes for DashAbility. Default DoubleTapToDash is now set to false.
This commit is contained in:
@@ -54,6 +54,7 @@ protected:
|
|||||||
//specialabilitys
|
//specialabilitys
|
||||||
bool m_MovementKeyDown = false;
|
bool m_MovementKeyDown = false;
|
||||||
bool m_SpecialAbilityKeyDown = false;
|
bool m_SpecialAbilityKeyDown = false;
|
||||||
|
int m_NumberOfMovementKeysDown = 0;
|
||||||
|
|
||||||
EventRelay<EventContext, Events::LockMouse> m_ELockMouse;
|
EventRelay<EventContext, Events::LockMouse> m_ELockMouse;
|
||||||
bool OnLockMouse(const Events::LockMouse& e);
|
bool OnLockMouse(const Events::LockMouse& e);
|
||||||
@@ -131,6 +132,7 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
}
|
}
|
||||||
//if value = 0 then you have just released this key
|
//if value = 0 then you have just released this key
|
||||||
if (e.Value != 0) {
|
if (e.Value != 0) {
|
||||||
|
m_NumberOfMovementKeysDown++;
|
||||||
m_MovementKeyDown = true;
|
m_MovementKeyDown = true;
|
||||||
//if you pressed the same key within m_AssaultDashDoubleTapSensitivityTimer then you have doubletapped it
|
//if you pressed the same key within m_AssaultDashDoubleTapSensitivityTimer then you have doubletapped it
|
||||||
if (m_AssaultDashDoubleTapDeltaTime < m_AssaultDashDoubleTapSensitivityTimer && m_AssaultDashTapDirection == m_CurrentDirectionVector) {
|
if (m_AssaultDashDoubleTapDeltaTime < m_AssaultDashDoubleTapSensitivityTimer && m_AssaultDashTapDirection == m_CurrentDirectionVector) {
|
||||||
@@ -138,10 +140,14 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//== 0
|
//== 0
|
||||||
m_MovementKeyDown = false;
|
m_NumberOfMovementKeysDown--;
|
||||||
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
if (m_NumberOfMovementKeysDown == 0) {
|
||||||
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
m_MovementKeyDown = false;
|
||||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
}
|
||||||
|
//you have just released the key, store what key it was and reset the doubletap-sensitivity-timer
|
||||||
|
m_AssaultDashTapDirection = m_CurrentDirectionVector;
|
||||||
|
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,12 +207,6 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
|
|||||||
m_AssaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
|
m_AssaultDashCoolDownTimer = assaultDashCoolDownMaxTimer;
|
||||||
m_AssaultDashDoubleTapped = true;
|
m_AssaultDashDoubleTapped = true;
|
||||||
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
m_AssaultDashDoubleTapDeltaTime = 0.f;
|
||||||
//moving to the side has priority
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//dashing with doubletap - check if doubletap to dash enabled
|
|
||||||
if (ResourceManager::Load<ConfigFile>("Input.ini")->Get<bool>("Keyboard.DoubleTapToDash", false)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,6 +215,11 @@ void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool
|
|||||||
m_AssaultDashDoubleTapped = false;
|
m_AssaultDashDoubleTapped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//dashing with doubletap - check if doubletap to dash enabled
|
||||||
|
if (!ResourceManager::Load<ConfigFile>("Input.ini")->Get<bool>("Keyboard.DoubleTapToDash", false)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//check if we have received a valid doubletap
|
//check if we have received a valid doubletap
|
||||||
if (!m_ValidDoubleTap) {
|
if (!m_ValidDoubleTap) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
Sensitivity=0.5
|
Sensitivity=0.5
|
||||||
InvertPitch=false
|
InvertPitch=false
|
||||||
|
|
||||||
[KeyBoard]
|
[Keyboard]
|
||||||
DoubleTapToDash=true
|
DoubleTapToDash=false
|
||||||
|
|
||||||
[Bindings]
|
[Bindings]
|
||||||
MouseLeft=PrimaryFire
|
MouseLeft=PrimaryFire
|
||||||
|
|||||||
Reference in New Issue
Block a user