garrysmod
garrysmod copied to clipboard
Animations update
Changes:
- Added ToggleNoClipAnim hook for updating the noclip layer
- Added CalcPlaybackRate hook for overriding the player's playback rate
- Added GM:HandlePlayerAirWalking for airwalking
- Added GM:HandlePlayerMoving for run/walk animations
- Added Player:AnimResetGestureSlots
- GM:DoAnimationEvent now support all PLAYERANIMEVENT enums (except PLAYERANIMEVENT_SNAP_YAW) - this now means addons can call Player:DoCustomAnimEvent with PLAYERANIMEVENT_CUSTOM(_SEQUENCE) to override the player's current animation.
- Moved GM:GrabEarAnimation to shared
- GM:HandlePlayerDriving now sets the driving activity and sequence for proper layering
- Added ACT_MP_SWIM_IDLE activity support
- Changed the velocity function used for vehicle pose params - fixes incorrect driving velocity on a moving platform
- GM:MouthMoveAnimation and GM:GrabEarAnimation are now called on the passed gamemode table instead of GAMEMODE
- Changed holdtype table generation to use ACT enums instead of offsets
- Added sitting activities, idle swimming, and more ACT_MP enum translations to the holdtype table
- Various optimisations, the greatest being caching player __index calls where the same function was called multiple times in a row
This PR is contingent upon https://github.com/Facepunch/garrysmod-requests/issues/704, https://github.com/Facepunch/garrysmod-requests/issues/1069, https://github.com/Facepunch/garrysmod-requests/issues/1090, and https://github.com/Facepunch/garrysmod-issues/issues/3075 being completed. https://github.com/Facepunch/garrysmod-requests/issues/1034 would allow GM:MouthMoveAnimation to be made shared.
This PR also merges part of https://github.com/Facepunch/garrysmod/pull/1173; and supersedes https://github.com/Facepunch/garrysmod/pull/1191, https://github.com/Facepunch/garrysmod/pull/1230, https://github.com/Facepunch/garrysmod/pull/1231, and https://github.com/Facepunch/garrysmod/pull/1399.
Player:AnimResetGestureSlots could also be binded in the engine.
I love you kefta.
Conflicts resolved and added PLAYERANIMEVENT_CANCEL_RELOAD support, so the dev branch is the best place to test the PR (but it'll still work on live).
Devs, please merge this.
👍 for merge if backwards compatible.
Still merge this, please.
At least fulfilling the requests would make testing this PR properly possible.
animations.lua, specifically MouthMoveAnimation
is still the biggest abuser of __index
calls of any addon or gamemode I've profiled. It's being called more than 10,000 times a second in default code, and that's just with one player.
The problem is you put so much into one pr that none of them wanna review it
@thegrb93 https://github.com/Facepunch/garrysmod/pull/1191 hasn't been merged either.