Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Togglable inputs; toggle_duck, toggle_jump, toggle_sprint, toggle_walk #929

Merged
merged 9 commits into from
Sep 16, 2020

Conversation

braem
Copy link
Member

@braem braem commented Sep 8, 2020

Closes #921
Closes #923

  • Adds toggle_jump, toggle_sprint, and toggle_walk commands.
  • Unlocks toggle_duck from being ahop only.
  • Locks toggle_jump to gamemodes with autohop
  • Locks toggle_sprint and toggle_walk for gamemodes that have those (using GameModeHUDCapability)
  • Moved toggle_duck into mom_player to better centralize the togglable inputs.
  • Overrides PlayerRunCommand, appending inputs if they have been toggled on.
  • Connected with the hud keypress display. Have to network all toggles besides duck for more accurate display.
  • toggle_sprint and toggle_walk untoggle when player is stopped from sprinting/walking.
  • Removed unused code from player and in_main & minorly fixed up the keypress display (OVERRIDE -> override, moving multi-line method out of class declaration, changed bgcolor to be an animation var instead of hardcoded).
  • Added to keybinds:
    image

Checklist

  • I have thoroughly tested all of the code I have modified/added/removed to ensure something else did not break
  • If there is a localization token change, I have updated the momentum_english_ref.res file with the changes, ran tokenizer.py to generate an up-to-date localization file, and have committed both the .res file changes and the new localization .txt file
  • If I introduced new h/cpp files, I have added them to the appropriate project's VPC file (server_momentum.vpc / client_momentum.vpc / etc)
  • If I have added or modified any visual assets (models, materials, panels, effects, etc), I have taken screenshots / videos of them and attached them to this PR directly (screenshots uploaded through github, videos uploaded to youtube and linked)
  • If I have modified any console command, console variable, or momentum entity, I have opened an issue (or a PR) for it in the Momentum Mod documentation repository
  • My commits are relatively small and scoped to the best of my ability
  • My branch has a clear history of changes that can be easy to follow when being reviewed commit-by-commit
  • My branch is functionally complete; the only changes to be done will be those potentially requested in code review

mp/src/game/client/momentum/c_mom_player.h Outdated Show resolved Hide resolved
@braem
Copy link
Member Author

braem commented Sep 9, 2020

Did the proposed change, nicely simplifies things. Also added a check for duck toggled in keypress hud to properly display that; captures the time between pressing and fully ducking.

mp/src/game/shared/momentum/mom_system_gamemode.cpp Outdated Show resolved Hide resolved
mp/src/game/server/momentum/mom_player.cpp Outdated Show resolved Hide resolved
mp/src/game/client/momentum/ui/HUD/hud_keypress.cpp Outdated Show resolved Hide resolved
@braem
Copy link
Member Author

braem commented Sep 14, 2020

Implemented the requested changes. Also I found that the run safeguards are hit when inputs are toggled on, should this be the case? For now I changed it to only safeguard if the button is held down, not toggled.
Maybe a cvar?

@Gocnak
Copy link
Member

Gocnak commented Sep 15, 2020

I'm inclined to say yes; it's still movement keys, and they took the easy way out of toggling it instead of holding it, so I would expect it to behave as if they have it pressed (as does the hud_keypress panel).

brae added 9 commits September 14, 2020 23:53
Implements toggle_jump.

Moved toggle_duck into mom_player to centralize toggling inputs

Networked jump toggle as it is required for the keypress hud to display
correctly.
OVERRIDE -> override

Remove `ApplySchemeSettings` by specifying `bgcolor_override` in
`HudLayout.res`.
Implemented similar to the jump toggle. Networked to connect to keypress
hud.

Untoggles when not able to walk/sprint.
Also found that the run safeguards are triggered on toggled inputs.
@Gocnak Gocnak merged commit c23b025 into develop Sep 16, 2020
@Gocnak Gocnak deleted the feature/toggle-inputs branch September 16, 2020 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unlock toggle_duck from being ahop only toggle_jump
2 participants