mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 03:40:50 +00:00
- Exhumed: Add crouch toggle mechanism.
This commit is contained in:
parent
7c8efde38c
commit
032db82f82
3 changed files with 19 additions and 7 deletions
|
@ -106,6 +106,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
|||
if (PlayerList[nLocalPlayer].nHealth == 0) localInput.actions &= SB_OPEN;
|
||||
}
|
||||
|
||||
Player* pPlayer = &PlayerList[nLocalPlayer];
|
||||
double const scaleAdjust = InputScale();
|
||||
InputPacket input {};
|
||||
|
||||
|
@ -119,10 +120,23 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
|
|||
processMovement(&input, &localInput, hidInput, scaleAdjust);
|
||||
}
|
||||
|
||||
// Handle crouch toggling.
|
||||
if (buttonMap.ButtonDown(gamefunc_Toggle_Crouch) || pPlayer->crouch_toggle)
|
||||
{
|
||||
localInput.actions |= SB_CROUCH;
|
||||
}
|
||||
if (buttonMap.ButtonDown(gamefunc_Toggle_Crouch))
|
||||
{
|
||||
pPlayer->crouch_toggle = !pPlayer->crouch_toggle;
|
||||
buttonMap.ClearButton(gamefunc_Toggle_Crouch);
|
||||
}
|
||||
if (buttonMap.ButtonDown(gamefunc_Crouch) || buttonMap.ButtonDown(gamefunc_Jump))
|
||||
{
|
||||
pPlayer->crouch_toggle = false;
|
||||
}
|
||||
|
||||
if (!cl_syncinput)
|
||||
{
|
||||
Player* pPlayer = &PlayerList[nLocalPlayer];
|
||||
|
||||
if (!nFreeze)
|
||||
{
|
||||
applylook(&pPlayer->angle, input.avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust, eyelevel[nLocalPlayer] > -14080);
|
||||
|
|
|
@ -75,6 +75,8 @@ struct Player
|
|||
PlayerHorizon horizon;
|
||||
PlayerAngle angle;
|
||||
vec3_t opos;
|
||||
|
||||
bool crouch_toggle;
|
||||
};
|
||||
|
||||
extern short PlayerCount;
|
||||
|
|
|
@ -514,11 +514,7 @@ OptionMenu "ActionControlsMenu" protected
|
|||
StaticText ""
|
||||
Control "$CNTRLMNU_JUMP" , "+jump"
|
||||
Control "$CNTRLMNU_CROUCH" , "+crouch"
|
||||
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides, Blood)
|
||||
{
|
||||
// Fixme: Make this work in all games
|
||||
Control "$CNTRLMNU_TOGGLECROUCH" , "+toggle_crouch"
|
||||
}
|
||||
Control "$CNTRLMNU_TOGGLECROUCH" , "+toggle_crouch"
|
||||
|
||||
StaticText ""
|
||||
Control "$CNTRLMNU_MOUSELOOK" , "+mouse_aiming"
|
||||
|
|
Loading…
Reference in a new issue