From f53d301bcf5a29301451a0a4b8cac2026b706a42 Mon Sep 17 00:00:00 2001 From: luttje <2738114+luttje@users.noreply.github.com> Date: Sun, 11 Aug 2024 08:41:22 +0200 Subject: [PATCH] Remove duplicate CBaseAnimating code and document it --- .../CBaseAnimating/CalculateIKLocks.md | 6 +- .../ComputeEntitySpaceHitboxSurroundingBox.md | 6 +- .../ComputeHitboxSurroundingBox.md | 6 +- docs/classes/CBaseAnimating/DoMuzzleFlash.md | 6 +- docs/classes/CBaseAnimating/Extinguish.md | 23 + .../CBaseAnimating/FindTransitionSequence.md | 6 +- .../CBaseAnimating/GetAnimTimeInterval.md | 6 +- .../CBaseAnimating/GetAttachmentLocal.md | 6 +- .../CBaseAnimating/GetBaseAnimating.md | 6 +- .../classes/CBaseAnimating/GetBonePosition.md | 6 +- docs/classes/CBaseAnimating/GetCycle.md | 6 +- .../classes/CBaseAnimating/GetFlexDescFacs.md | 6 +- docs/classes/CBaseAnimating/GetHitboxSet.md | 6 +- .../CBaseAnimating/GetHitboxSetCount.md | 6 +- .../CBaseAnimating/GetHitboxSetName.md | 6 +- .../CBaseAnimating/GetNumFlexControllers.md | 6 +- .../classes/CBaseAnimating/GetPlaybackRate.md | 6 +- .../CBaseAnimating/GetPoseParameter.md | 6 +- .../CBaseAnimating/GetPoseParameterRange.md | 6 +- docs/classes/CBaseAnimating/GetSequence.md | 6 +- .../CBaseAnimating/GetSequenceActivity.md | 6 +- .../CBaseAnimating/GetSequenceActivityName.md | 6 +- .../CBaseAnimating/GetSequenceGroundSpeed.md | 6 +- .../CBaseAnimating/GetSequenceLinearMotion.md | 6 +- .../classes/CBaseAnimating/GetSequenceName.md | 6 +- docs/classes/CBaseAnimating/Ignite.md | 28 + .../CBaseAnimating/InvalidateBoneCache.md | 6 +- .../CBaseAnimating/InvalidateMdlCache.md | 23 - .../CBaseAnimating/InvalidateModelCache.md | 23 + .../CBaseAnimating/IsActivityFinished.md | 6 +- docs/classes/CBaseAnimating/IsOnFire.md | 6 +- docs/classes/CBaseAnimating/IsRagdoll.md | 6 +- .../CBaseAnimating/IsSequenceFinished.md | 6 +- .../CBaseAnimating/IsSequenceLooping.md | 6 +- docs/classes/CBaseAnimating/LookupActivity.md | 6 +- .../CBaseAnimating/LookupAttachment.md | 6 +- docs/classes/CBaseAnimating/LookupBone.md | 6 +- .../CBaseAnimating/LookupPoseParameter.md | 6 +- docs/classes/CBaseAnimating/LookupSequence.md | 6 +- docs/classes/CBaseAnimating/ResetSequence.md | 6 +- .../CBaseAnimating/ResetSequenceInfo.md | 6 +- .../CBaseAnimating/SelectWeightedSequence.md | 6 +- .../CBaseAnimating/SequenceDuration.md | 13 +- docs/classes/CBaseAnimating/SequenceLoops.md | 6 +- .../CBaseAnimating/SetBoneController.md | 6 +- docs/classes/CBaseAnimating/SetCycle.md | 6 +- docs/classes/CBaseAnimating/SetHitboxSet.md | 6 +- .../CBaseAnimating/SetHitboxSetByName.md | 6 +- .../CBaseAnimating/SetPoseParameter.md | 6 +- docs/classes/CBaseAnimating/SetSequence.md | 6 +- .../CBaseAnimating/StudioFrameAdvance.md | 6 +- .../CBaseAnimating/TransferDissolveFrom.md | 6 +- .../CBaseAnimating/UseClientSideAnimation.md | 6 +- src/game/client/lc_baseanimating.cpp | 614 +---------------- src/game/server/lbaseanimating.cpp | 438 +----------- src/game/shared/lbaseanimating_shared.cpp | 624 ++++++++++++++++++ src/game/shared/lsrcinit.cpp | 2 +- 57 files changed, 867 insertions(+), 1209 deletions(-) create mode 100644 docs/classes/CBaseAnimating/Extinguish.md create mode 100644 docs/classes/CBaseAnimating/Ignite.md delete mode 100644 docs/classes/CBaseAnimating/InvalidateMdlCache.md create mode 100644 docs/classes/CBaseAnimating/InvalidateModelCache.md diff --git a/docs/classes/CBaseAnimating/CalculateIKLocks.md b/docs/classes/CBaseAnimating/CalculateIKLocks.md index 85e1983a26..ddfbd8525a 100644 --- a/docs/classes/CBaseAnimating/CalculateIKLocks.md +++ b/docs/classes/CBaseAnimating/CalculateIKLocks.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: CalculateIKLocks -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: CalculateIKLocks - realm: client + realm: shared description: "Calculate IK locks." arguments: diff --git a/docs/classes/CBaseAnimating/ComputeEntitySpaceHitboxSurroundingBox.md b/docs/classes/CBaseAnimating/ComputeEntitySpaceHitboxSurroundingBox.md index 3965580db4..e88618d980 100644 --- a/docs/classes/CBaseAnimating/ComputeEntitySpaceHitboxSurroundingBox.md +++ b/docs/classes/CBaseAnimating/ComputeEntitySpaceHitboxSurroundingBox.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: ComputeEntitySpaceHitboxSurroundingBox -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: ComputeEntitySpaceHitboxSurroundingBox - realm: client + realm: shared description: "Compute the entity space hitbox surrounding box." diff --git a/docs/classes/CBaseAnimating/ComputeHitboxSurroundingBox.md b/docs/classes/CBaseAnimating/ComputeHitboxSurroundingBox.md index 7cf47d1331..51ee6b2ccd 100644 --- a/docs/classes/CBaseAnimating/ComputeHitboxSurroundingBox.md +++ b/docs/classes/CBaseAnimating/ComputeHitboxSurroundingBox.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: ComputeHitboxSurroundingBox -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: ComputeHitboxSurroundingBox - realm: client + realm: shared description: "Compute the hitbox surrounding box." diff --git a/docs/classes/CBaseAnimating/DoMuzzleFlash.md b/docs/classes/CBaseAnimating/DoMuzzleFlash.md index ea7c003b16..b3104160c0 100644 --- a/docs/classes/CBaseAnimating/DoMuzzleFlash.md +++ b/docs/classes/CBaseAnimating/DoMuzzleFlash.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: DoMuzzleFlash -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: DoMuzzleFlash - realm: client + realm: shared description: "Sets up muzzle flash parity." diff --git a/docs/classes/CBaseAnimating/Extinguish.md b/docs/classes/CBaseAnimating/Extinguish.md new file mode 100644 index 0000000000..327d96eea4 --- /dev/null +++ b/docs/classes/CBaseAnimating/Extinguish.md @@ -0,0 +1,23 @@ +--- +template: lua-class-function.html +title: Extinguish +icon: lua-server +tags: + - lua + - server + - needs-verification + - needs-example +lua: + library: CBaseAnimating + function: Extinguish + realm: server + description: "Extinguish the entity." + + + returns: + +--- + +
+CBaseAnimating:Extinguish – Extinguish the entity. +
diff --git a/docs/classes/CBaseAnimating/FindTransitionSequence.md b/docs/classes/CBaseAnimating/FindTransitionSequence.md index fbfd6d724a..928e6c674a 100644 --- a/docs/classes/CBaseAnimating/FindTransitionSequence.md +++ b/docs/classes/CBaseAnimating/FindTransitionSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: FindTransitionSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: FindTransitionSequence - realm: client + realm: shared description: "Find the transition sequence." arguments: diff --git a/docs/classes/CBaseAnimating/GetAnimTimeInterval.md b/docs/classes/CBaseAnimating/GetAnimTimeInterval.md index cec5665636..971ddd28c2 100644 --- a/docs/classes/CBaseAnimating/GetAnimTimeInterval.md +++ b/docs/classes/CBaseAnimating/GetAnimTimeInterval.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetAnimTimeInterval -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetAnimTimeInterval - realm: client + realm: shared description: "Get the animation time interval." diff --git a/docs/classes/CBaseAnimating/GetAttachmentLocal.md b/docs/classes/CBaseAnimating/GetAttachmentLocal.md index 1561504f03..00dc62129e 100644 --- a/docs/classes/CBaseAnimating/GetAttachmentLocal.md +++ b/docs/classes/CBaseAnimating/GetAttachmentLocal.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetAttachmentLocal -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetAttachmentLocal - realm: client + realm: shared description: "Get the local attachment." arguments: diff --git a/docs/classes/CBaseAnimating/GetBaseAnimating.md b/docs/classes/CBaseAnimating/GetBaseAnimating.md index 877b031cfe..0f13e10d3e 100644 --- a/docs/classes/CBaseAnimating/GetBaseAnimating.md +++ b/docs/classes/CBaseAnimating/GetBaseAnimating.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetBaseAnimating -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetBaseAnimating - realm: client + realm: shared description: "Get the base animating entity." diff --git a/docs/classes/CBaseAnimating/GetBonePosition.md b/docs/classes/CBaseAnimating/GetBonePosition.md index 2a9db45ae6..27db13001f 100644 --- a/docs/classes/CBaseAnimating/GetBonePosition.md +++ b/docs/classes/CBaseAnimating/GetBonePosition.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetBonePosition -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetBonePosition - realm: client + realm: shared description: "Get the bone position." arguments: diff --git a/docs/classes/CBaseAnimating/GetCycle.md b/docs/classes/CBaseAnimating/GetCycle.md index 2f64cd5a5d..7ecb3d8a21 100644 --- a/docs/classes/CBaseAnimating/GetCycle.md +++ b/docs/classes/CBaseAnimating/GetCycle.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetCycle -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetCycle - realm: client + realm: shared description: "Get the current cycle." diff --git a/docs/classes/CBaseAnimating/GetFlexDescFacs.md b/docs/classes/CBaseAnimating/GetFlexDescFacs.md index 0732487c01..e4c15a57cf 100644 --- a/docs/classes/CBaseAnimating/GetFlexDescFacs.md +++ b/docs/classes/CBaseAnimating/GetFlexDescFacs.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetFlexDescFacs -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetFlexDescFacs - realm: client + realm: shared description: "Get the flex desc facs." arguments: diff --git a/docs/classes/CBaseAnimating/GetHitboxSet.md b/docs/classes/CBaseAnimating/GetHitboxSet.md index dfd928df15..9fc84916f1 100644 --- a/docs/classes/CBaseAnimating/GetHitboxSet.md +++ b/docs/classes/CBaseAnimating/GetHitboxSet.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetHitboxSet -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetHitboxSet - realm: client + realm: shared description: "Get the index of the hitbox set in use." diff --git a/docs/classes/CBaseAnimating/GetHitboxSetCount.md b/docs/classes/CBaseAnimating/GetHitboxSetCount.md index 4aa526f62b..6add903e04 100644 --- a/docs/classes/CBaseAnimating/GetHitboxSetCount.md +++ b/docs/classes/CBaseAnimating/GetHitboxSetCount.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetHitboxSetCount -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetHitboxSetCount - realm: client + realm: shared description: "Get the hitbox set count." diff --git a/docs/classes/CBaseAnimating/GetHitboxSetName.md b/docs/classes/CBaseAnimating/GetHitboxSetName.md index 072f255a6b..3adfaad7ec 100644 --- a/docs/classes/CBaseAnimating/GetHitboxSetName.md +++ b/docs/classes/CBaseAnimating/GetHitboxSetName.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetHitboxSetName -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetHitboxSetName - realm: client + realm: shared description: "Get the hitbox set name." diff --git a/docs/classes/CBaseAnimating/GetNumFlexControllers.md b/docs/classes/CBaseAnimating/GetNumFlexControllers.md index 450ea73701..56afa244dd 100644 --- a/docs/classes/CBaseAnimating/GetNumFlexControllers.md +++ b/docs/classes/CBaseAnimating/GetNumFlexControllers.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetNumFlexControllers -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetNumFlexControllers - realm: client + realm: shared description: "Get the number of flex controllers." diff --git a/docs/classes/CBaseAnimating/GetPlaybackRate.md b/docs/classes/CBaseAnimating/GetPlaybackRate.md index fac8d39a92..cc403f80d9 100644 --- a/docs/classes/CBaseAnimating/GetPlaybackRate.md +++ b/docs/classes/CBaseAnimating/GetPlaybackRate.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetPlaybackRate -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetPlaybackRate - realm: client + realm: shared description: "Get the playback rate." diff --git a/docs/classes/CBaseAnimating/GetPoseParameter.md b/docs/classes/CBaseAnimating/GetPoseParameter.md index 922bf4b3dd..c19a9b7be3 100644 --- a/docs/classes/CBaseAnimating/GetPoseParameter.md +++ b/docs/classes/CBaseAnimating/GetPoseParameter.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetPoseParameter -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetPoseParameter - realm: client + realm: shared description: "Get the pose parameter." arguments: diff --git a/docs/classes/CBaseAnimating/GetPoseParameterRange.md b/docs/classes/CBaseAnimating/GetPoseParameterRange.md index 352db8345b..c2a03286e7 100644 --- a/docs/classes/CBaseAnimating/GetPoseParameterRange.md +++ b/docs/classes/CBaseAnimating/GetPoseParameterRange.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetPoseParameterRange -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetPoseParameterRange - realm: client + realm: shared description: "Get the pose parameter range." arguments: diff --git a/docs/classes/CBaseAnimating/GetSequence.md b/docs/classes/CBaseAnimating/GetSequence.md index 52dc994ee6..7fd7593804 100644 --- a/docs/classes/CBaseAnimating/GetSequence.md +++ b/docs/classes/CBaseAnimating/GetSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequence - realm: client + realm: shared description: "Get the sequence." diff --git a/docs/classes/CBaseAnimating/GetSequenceActivity.md b/docs/classes/CBaseAnimating/GetSequenceActivity.md index d646b40928..f8c1f1dfdf 100644 --- a/docs/classes/CBaseAnimating/GetSequenceActivity.md +++ b/docs/classes/CBaseAnimating/GetSequenceActivity.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequenceActivity -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequenceActivity - realm: client + realm: shared description: "Get the sequence activity." arguments: diff --git a/docs/classes/CBaseAnimating/GetSequenceActivityName.md b/docs/classes/CBaseAnimating/GetSequenceActivityName.md index 61ee7ba0e0..1125fb9c3d 100644 --- a/docs/classes/CBaseAnimating/GetSequenceActivityName.md +++ b/docs/classes/CBaseAnimating/GetSequenceActivityName.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequenceActivityName -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequenceActivityName - realm: client + realm: shared description: "Get the sequence activity name." arguments: diff --git a/docs/classes/CBaseAnimating/GetSequenceGroundSpeed.md b/docs/classes/CBaseAnimating/GetSequenceGroundSpeed.md index 392338fc7b..4856e0a3f9 100644 --- a/docs/classes/CBaseAnimating/GetSequenceGroundSpeed.md +++ b/docs/classes/CBaseAnimating/GetSequenceGroundSpeed.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequenceGroundSpeed -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequenceGroundSpeed - realm: client + realm: shared description: "Get the sequence ground speed." arguments: diff --git a/docs/classes/CBaseAnimating/GetSequenceLinearMotion.md b/docs/classes/CBaseAnimating/GetSequenceLinearMotion.md index 8d64115f2b..2b1761294e 100644 --- a/docs/classes/CBaseAnimating/GetSequenceLinearMotion.md +++ b/docs/classes/CBaseAnimating/GetSequenceLinearMotion.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequenceLinearMotion -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequenceLinearMotion - realm: client + realm: shared description: "Get the sequence linear motion." arguments: diff --git a/docs/classes/CBaseAnimating/GetSequenceName.md b/docs/classes/CBaseAnimating/GetSequenceName.md index b4deee790c..c92e51093e 100644 --- a/docs/classes/CBaseAnimating/GetSequenceName.md +++ b/docs/classes/CBaseAnimating/GetSequenceName.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: GetSequenceName -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: GetSequenceName - realm: client + realm: shared description: "Get the sequence name." arguments: diff --git a/docs/classes/CBaseAnimating/Ignite.md b/docs/classes/CBaseAnimating/Ignite.md new file mode 100644 index 0000000000..36ed679340 --- /dev/null +++ b/docs/classes/CBaseAnimating/Ignite.md @@ -0,0 +1,28 @@ +--- +template: lua-class-function.html +title: Ignite +icon: lua-server +tags: + - lua + - server + - needs-verification + - needs-example +lua: + library: CBaseAnimating + function: Ignite + realm: server + description: "Ignite the entity." + + arguments: + - name: "lifetimeInSeconds" + type: number + - name: "spreadRadius" + type: number + default: "0.0f" + returns: + +--- + +
+CBaseAnimating:Ignite – Ignite the entity. +
diff --git a/docs/classes/CBaseAnimating/InvalidateBoneCache.md b/docs/classes/CBaseAnimating/InvalidateBoneCache.md index 9527e0ec7d..5709036846 100644 --- a/docs/classes/CBaseAnimating/InvalidateBoneCache.md +++ b/docs/classes/CBaseAnimating/InvalidateBoneCache.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: InvalidateBoneCache -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: InvalidateBoneCache - realm: client + realm: shared description: "Invalidate the bone cache." diff --git a/docs/classes/CBaseAnimating/InvalidateMdlCache.md b/docs/classes/CBaseAnimating/InvalidateMdlCache.md deleted file mode 100644 index 6590695b87..0000000000 --- a/docs/classes/CBaseAnimating/InvalidateMdlCache.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -template: lua-class-function.html -title: InvalidateMdlCache -icon: lua-client -tags: - - lua - - client - - needs-verification - - needs-example -lua: - library: CBaseAnimating - function: InvalidateMdlCache - realm: client - description: "Invalidate the MDL cache." - - - returns: - ---- - -
-CBaseAnimating:InvalidateMdlCache – Invalidate the MDL cache. -
diff --git a/docs/classes/CBaseAnimating/InvalidateModelCache.md b/docs/classes/CBaseAnimating/InvalidateModelCache.md new file mode 100644 index 0000000000..4cb6d14aae --- /dev/null +++ b/docs/classes/CBaseAnimating/InvalidateModelCache.md @@ -0,0 +1,23 @@ +--- +template: lua-class-function.html +title: InvalidateModelCache +icon: lua-shared +tags: + - lua + - shared + - needs-verification + - needs-example +lua: + library: CBaseAnimating + function: InvalidateModelCache + realm: shared + description: "Invalidate the model cache." + + + returns: + +--- + +
+CBaseAnimating:InvalidateModelCache – Invalidate the model cache. +
diff --git a/docs/classes/CBaseAnimating/IsActivityFinished.md b/docs/classes/CBaseAnimating/IsActivityFinished.md index c82447aced..bfb1b52741 100644 --- a/docs/classes/CBaseAnimating/IsActivityFinished.md +++ b/docs/classes/CBaseAnimating/IsActivityFinished.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: IsActivityFinished -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: IsActivityFinished - realm: client + realm: shared description: "Check if the activity is finished." diff --git a/docs/classes/CBaseAnimating/IsOnFire.md b/docs/classes/CBaseAnimating/IsOnFire.md index b86fc4bd48..c7d8ad1e00 100644 --- a/docs/classes/CBaseAnimating/IsOnFire.md +++ b/docs/classes/CBaseAnimating/IsOnFire.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: IsOnFire -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: IsOnFire - realm: client + realm: shared description: "Check if the entity is on fire." diff --git a/docs/classes/CBaseAnimating/IsRagdoll.md b/docs/classes/CBaseAnimating/IsRagdoll.md index 697db1b932..1c1375c9fa 100644 --- a/docs/classes/CBaseAnimating/IsRagdoll.md +++ b/docs/classes/CBaseAnimating/IsRagdoll.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: IsRagdoll -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: IsRagdoll - realm: client + realm: shared description: "Check if the entity is a ragdoll." diff --git a/docs/classes/CBaseAnimating/IsSequenceFinished.md b/docs/classes/CBaseAnimating/IsSequenceFinished.md index 408d7f3c0c..b4118a880a 100644 --- a/docs/classes/CBaseAnimating/IsSequenceFinished.md +++ b/docs/classes/CBaseAnimating/IsSequenceFinished.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: IsSequenceFinished -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: IsSequenceFinished - realm: client + realm: shared description: "Check if the sequence is finished." diff --git a/docs/classes/CBaseAnimating/IsSequenceLooping.md b/docs/classes/CBaseAnimating/IsSequenceLooping.md index 71f1141e5f..7cc7602d51 100644 --- a/docs/classes/CBaseAnimating/IsSequenceLooping.md +++ b/docs/classes/CBaseAnimating/IsSequenceLooping.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: IsSequenceLooping -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: IsSequenceLooping - realm: client + realm: shared description: "Check if the sequence is looping." arguments: diff --git a/docs/classes/CBaseAnimating/LookupActivity.md b/docs/classes/CBaseAnimating/LookupActivity.md index ba2e978891..6aa8007f8d 100644 --- a/docs/classes/CBaseAnimating/LookupActivity.md +++ b/docs/classes/CBaseAnimating/LookupActivity.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: LookupActivity -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: LookupActivity - realm: client + realm: shared description: "Looks up an activity by name." arguments: diff --git a/docs/classes/CBaseAnimating/LookupAttachment.md b/docs/classes/CBaseAnimating/LookupAttachment.md index 9d998be35f..ae57213961 100644 --- a/docs/classes/CBaseAnimating/LookupAttachment.md +++ b/docs/classes/CBaseAnimating/LookupAttachment.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: LookupAttachment -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: LookupAttachment - realm: client + realm: shared description: "Lookup the attachment." arguments: diff --git a/docs/classes/CBaseAnimating/LookupBone.md b/docs/classes/CBaseAnimating/LookupBone.md index 9e45cbbc5c..c8ea0e4eef 100644 --- a/docs/classes/CBaseAnimating/LookupBone.md +++ b/docs/classes/CBaseAnimating/LookupBone.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: LookupBone -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: LookupBone - realm: client + realm: shared description: "Lookup the bone." arguments: diff --git a/docs/classes/CBaseAnimating/LookupPoseParameter.md b/docs/classes/CBaseAnimating/LookupPoseParameter.md index 93a34740d5..6e721652ba 100644 --- a/docs/classes/CBaseAnimating/LookupPoseParameter.md +++ b/docs/classes/CBaseAnimating/LookupPoseParameter.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: LookupPoseParameter -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: LookupPoseParameter - realm: client + realm: shared description: "Lookup the pose parameter." arguments: diff --git a/docs/classes/CBaseAnimating/LookupSequence.md b/docs/classes/CBaseAnimating/LookupSequence.md index 3042ab979b..ffb2ef0658 100644 --- a/docs/classes/CBaseAnimating/LookupSequence.md +++ b/docs/classes/CBaseAnimating/LookupSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: LookupSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: LookupSequence - realm: client + realm: shared description: "Lookup the sequence." arguments: diff --git a/docs/classes/CBaseAnimating/ResetSequence.md b/docs/classes/CBaseAnimating/ResetSequence.md index 8ce1a7461e..b84259fcfa 100644 --- a/docs/classes/CBaseAnimating/ResetSequence.md +++ b/docs/classes/CBaseAnimating/ResetSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: ResetSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: ResetSequence - realm: client + realm: shared description: "Reset the sequence." arguments: diff --git a/docs/classes/CBaseAnimating/ResetSequenceInfo.md b/docs/classes/CBaseAnimating/ResetSequenceInfo.md index 33e1d10298..3fe056042f 100644 --- a/docs/classes/CBaseAnimating/ResetSequenceInfo.md +++ b/docs/classes/CBaseAnimating/ResetSequenceInfo.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: ResetSequenceInfo -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: ResetSequenceInfo - realm: client + realm: shared description: "Reset the sequence info." diff --git a/docs/classes/CBaseAnimating/SelectWeightedSequence.md b/docs/classes/CBaseAnimating/SelectWeightedSequence.md index e756d2dc6e..f4b0c37cd8 100644 --- a/docs/classes/CBaseAnimating/SelectWeightedSequence.md +++ b/docs/classes/CBaseAnimating/SelectWeightedSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SelectWeightedSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SelectWeightedSequence - realm: client + realm: shared description: "Select the weighted sequence." arguments: diff --git a/docs/classes/CBaseAnimating/SequenceDuration.md b/docs/classes/CBaseAnimating/SequenceDuration.md index bdf89bb305..1fc0ab413d 100644 --- a/docs/classes/CBaseAnimating/SequenceDuration.md +++ b/docs/classes/CBaseAnimating/SequenceDuration.md @@ -1,27 +1,26 @@ --- template: lua-class-function.html title: SequenceDuration -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SequenceDuration - realm: client - description: "Get the sequence duration." + realm: shared + description: "Sequence duration." arguments: - name: "sequence" type: number nillable: true returns: - - type: number - description: "The sequence duration" + ---
-CBaseAnimating:SequenceDuration – Get the sequence duration. +CBaseAnimating:SequenceDuration – Sequence duration.
diff --git a/docs/classes/CBaseAnimating/SequenceLoops.md b/docs/classes/CBaseAnimating/SequenceLoops.md index 0b196679e5..dd7055615f 100644 --- a/docs/classes/CBaseAnimating/SequenceLoops.md +++ b/docs/classes/CBaseAnimating/SequenceLoops.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SequenceLoops -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SequenceLoops - realm: client + realm: shared description: "Check if the sequence loops." diff --git a/docs/classes/CBaseAnimating/SetBoneController.md b/docs/classes/CBaseAnimating/SetBoneController.md index 82ad860757..e2285ed776 100644 --- a/docs/classes/CBaseAnimating/SetBoneController.md +++ b/docs/classes/CBaseAnimating/SetBoneController.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetBoneController -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetBoneController - realm: client + realm: shared description: "Set the value for the specified bone controller." arguments: diff --git a/docs/classes/CBaseAnimating/SetCycle.md b/docs/classes/CBaseAnimating/SetCycle.md index daf3cd4393..6b962ac57c 100644 --- a/docs/classes/CBaseAnimating/SetCycle.md +++ b/docs/classes/CBaseAnimating/SetCycle.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetCycle -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetCycle - realm: client + realm: shared description: "Set the cycle." arguments: diff --git a/docs/classes/CBaseAnimating/SetHitboxSet.md b/docs/classes/CBaseAnimating/SetHitboxSet.md index 8d2c53f022..c942c91bea 100644 --- a/docs/classes/CBaseAnimating/SetHitboxSet.md +++ b/docs/classes/CBaseAnimating/SetHitboxSet.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetHitboxSet -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetHitboxSet - realm: client + realm: shared description: "Set the hitbox set." arguments: diff --git a/docs/classes/CBaseAnimating/SetHitboxSetByName.md b/docs/classes/CBaseAnimating/SetHitboxSetByName.md index 3239ac00e9..a27e4ab2de 100644 --- a/docs/classes/CBaseAnimating/SetHitboxSetByName.md +++ b/docs/classes/CBaseAnimating/SetHitboxSetByName.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetHitboxSetByName -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetHitboxSetByName - realm: client + realm: shared description: "Set the hitbox set by name." arguments: diff --git a/docs/classes/CBaseAnimating/SetPoseParameter.md b/docs/classes/CBaseAnimating/SetPoseParameter.md index 6257164fe7..6c481a7fda 100644 --- a/docs/classes/CBaseAnimating/SetPoseParameter.md +++ b/docs/classes/CBaseAnimating/SetPoseParameter.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetPoseParameter -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetPoseParameter - realm: client + realm: shared description: "Set the pose parameter." argumentSets: diff --git a/docs/classes/CBaseAnimating/SetSequence.md b/docs/classes/CBaseAnimating/SetSequence.md index da4c02fe7b..92f9cd7700 100644 --- a/docs/classes/CBaseAnimating/SetSequence.md +++ b/docs/classes/CBaseAnimating/SetSequence.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: SetSequence -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: SetSequence - realm: client + realm: shared description: "Set the sequence." arguments: diff --git a/docs/classes/CBaseAnimating/StudioFrameAdvance.md b/docs/classes/CBaseAnimating/StudioFrameAdvance.md index 49cc903ff2..6ddd4b6005 100644 --- a/docs/classes/CBaseAnimating/StudioFrameAdvance.md +++ b/docs/classes/CBaseAnimating/StudioFrameAdvance.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: StudioFrameAdvance -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: StudioFrameAdvance - realm: client + realm: shared description: "Advances the animation frame." diff --git a/docs/classes/CBaseAnimating/TransferDissolveFrom.md b/docs/classes/CBaseAnimating/TransferDissolveFrom.md index 0e928c0dd2..b4a8512057 100644 --- a/docs/classes/CBaseAnimating/TransferDissolveFrom.md +++ b/docs/classes/CBaseAnimating/TransferDissolveFrom.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: TransferDissolveFrom -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: TransferDissolveFrom - realm: client + realm: shared description: "Transfer the dissolve from." arguments: diff --git a/docs/classes/CBaseAnimating/UseClientSideAnimation.md b/docs/classes/CBaseAnimating/UseClientSideAnimation.md index dcad863c2e..b7868dbb86 100644 --- a/docs/classes/CBaseAnimating/UseClientSideAnimation.md +++ b/docs/classes/CBaseAnimating/UseClientSideAnimation.md @@ -1,16 +1,16 @@ --- template: lua-class-function.html title: UseClientSideAnimation -icon: lua-client +icon: lua-shared tags: - lua - - client + - shared - needs-verification - needs-example lua: library: CBaseAnimating function: UseClientSideAnimation - realm: client + realm: shared description: "Use the client side animation." diff --git a/src/game/client/lc_baseanimating.cpp b/src/game/client/lc_baseanimating.cpp index 00dacc94ec..3573f46a1d 100644 --- a/src/game/client/lc_baseanimating.cpp +++ b/src/game/client/lc_baseanimating.cpp @@ -16,31 +16,7 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -/* -** access functions (stack -> C) -*/ - -LUA_API lua_CBaseAnimating *lua_toanimating( lua_State *L, int idx ) -{ - CBaseHandle *hEntity = - dynamic_cast< CBaseHandle * >( ( CBaseHandle * )lua_touserdata( L, idx ) ); - if ( hEntity == NULL ) - return NULL; - return dynamic_cast< lua_CBaseAnimating * >( hEntity->Get() ); -} - -/* -** push functions (C -> stack) -*/ -LUALIB_API lua_CBaseAnimating *luaL_checkanimating( lua_State *L, int narg ) -{ - lua_CBaseAnimating *d = lua_toanimating( L, narg ); - if ( d == NULL ) /* avoid extra test when d is not 0 */ - luaL_argerror( L, narg, "CBaseAnimating expected, got NULL entity" ); - return d; -} - -LUA_REGISTRATION_INIT( CBaseAnimating ) +LUA_REGISTRATION_INIT( CBaseAnimating ) LUA_BINDING_BEGIN( CBaseAnimating, AddEntityToVisibleList, "class", "Add the entity to the visible entity list. Seems to only call CreateLightEffects internally." ) { @@ -72,17 +48,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, BecomeRagdollOnClient, "class", "Become a rag } LUA_BINDING_END( "entity", "The ragdoll entity" ) -LUA_BINDING_BEGIN( CBaseAnimating, CalculateIKLocks, "class", "Calculate IK locks." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - float flTime = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "currentTime" ); - - pAnimating->CalculateIKLocks( flTime ); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, ClampCycle, "class", "Clamp the cycle." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -135,32 +100,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, ComputeClientSideAnimationFlags, "class", "Co } LUA_BINDING_END( "number", "The client side animation flags" ) -LUA_BINDING_BEGIN( CBaseAnimating, ComputeEntitySpaceHitboxSurroundingBox, "class", "Compute the entity space hitbox surrounding box." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - Vector pVecWorldMins, pVecWorldMaxs; - lua_pushboolean( L, pAnimating->ComputeEntitySpaceHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); - lua_pushvector( L, pVecWorldMins ); - lua_pushvector( L, pVecWorldMaxs ); - - return 3; -} -LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The world mins", "vector", "The world maxs" ) - -LUA_BINDING_BEGIN( CBaseAnimating, ComputeHitboxSurroundingBox, "class", "Compute the hitbox surrounding box." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - Vector pVecWorldMins, pVecWorldMaxs; - lua_pushboolean( L, pAnimating->ComputeHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); - lua_pushvector( L, pVecWorldMins ); - lua_pushvector( L, pVecWorldMaxs ); - - return 3; -} -LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The world mins", "vector", "The world maxs" ) - LUA_BINDING_BEGIN( CBaseAnimating, CreateRagdollCopy, "class", "Create a ragdoll copy of the entity." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -204,16 +143,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, DispatchMuzzleEffect, "class", "Dispatch the } LUA_BINDING_END( "boolean", "Whether the operation was successful" ) -LUA_BINDING_BEGIN( CBaseAnimating, DoMuzzleFlash, "class", "Sets up muzzle flash parity." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->DoMuzzleFlash(); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, DrawClientHitboxes, "class", "Draw the client hitboxes." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -247,20 +176,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, FindFollowedEntity, "class", "Find the follow } LUA_BINDING_END( "entity", "The followed entity" ) -LUA_BINDING_BEGIN( CBaseAnimating, FindTransitionSequence, "class", "Find the transition sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - int iGoalSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "goalSequence" ); - - int piDir; - lua_pushinteger( L, pAnimating->FindTransitionSequence( iSequence, iGoalSequence, &piDir ) ); - lua_pushinteger( L, piDir ); - - return 2; -} -LUA_BINDING_END( "number", "The transition sequence", "number", "The direction" ) - LUA_BINDING_BEGIN( CBaseAnimating, FireEvent, "class", "Fire an event." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -326,31 +241,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetAimEntOrigin, "class", "Get the aim entity } LUA_BINDING_END( "vector", "The aim entity origin", "angle", "The aim entity angles" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetAnimTimeInterval, "class", "Get the animation time interval." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushnumber( L, pAnimating->GetAnimTimeInterval() ); - - return 1; -} -LUA_BINDING_END( "number", "The animation time interval" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetAttachmentLocal, "class", "Get the local attachment." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iAttachment = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "attachment" ); - Vector pVecOrigin; - QAngle pAngAngles; - - lua_pushboolean( L, pAnimating->GetAttachmentLocal( iAttachment, pVecOrigin, pAngAngles ) ); - lua_pushvector( L, pVecOrigin ); - lua_pushangle( L, pAngAngles ); - - return 3; -} -LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The origin", "angle", "The angles" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetAttachmentVelocity, "class", "Get the attachment velocity." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -366,16 +256,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetAttachmentVelocity, "class", "Get the atta } LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The origin velocity" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetBaseAnimating, "class", "Get the base animating entity." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - CBaseEntity::PushLuaInstanceSafe( L, pAnimating->GetBaseAnimating() ); - - return 1; -} -LUA_BINDING_END( "entity", "The base animating entity" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetBlendedLinearVelocity, "class", "Get the blended linear velocity." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -415,22 +295,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetBoneControllers, "class", "Get all bone co } LUA_BINDING_END( "number", "The bone controllers" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetBonePosition, "class", "Get the bone position." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iBone = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "bone" ); - Vector pVecOrigin; - QAngle pAngAngles; - - pAnimating->GetBonePosition( iBone, pVecOrigin, pAngAngles ); - - lua_pushvector( L, pVecOrigin ); - lua_pushangle( L, pAngAngles ); - - return 2; -} -LUA_BINDING_END( "vector", "The origin", "angle", "The angles" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetClientSideFade, "class", "Get the client side fade." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -451,16 +315,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetCollideType, "class", "Get the collide typ } LUA_BINDING_END( "integer|CollideType_t", "The collide type" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetCycle, "class", "Get the current cycle." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushnumber( L, pAnimating->GetCycle() ); - - return 1; -} -LUA_BINDING_END( "number", "The cycle" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetFlexControllerName, "class", "Get the flex controller name." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -485,97 +339,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetFlexControllerType, "class", "Get the flex } LUA_BINDING_END( "string", "The flex controller type" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetFlexDescFacs, "class", "Get the flex desc facs." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iFlexDescIndex = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "flexDescIndex" ); - - lua_pushstring( L, pAnimating->GetFlexDescFacs( iFlexDescIndex ) ); - - return 1; -} -LUA_BINDING_END( "string", "The flex desc facs" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSet, "class", "Get the index of the hitbox set in use." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushinteger( L, pAnimating->GetHitboxSet() ); - - return 1; -} -LUA_BINDING_END( "number", "The hitbox set" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSetCount, "class", "Get the hitbox set count." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushinteger( L, pAnimating->GetHitboxSetCount() ); - - return 1; -} -LUA_BINDING_END( "number", "The hitbox set count" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSetName, "class", "Get the hitbox set name." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushstring( L, pAnimating->GetHitboxSetName() ); - - return 1; -} -LUA_BINDING_END( "string", "The hitbox set name" ) - -// static int CBaseAnimating_GetModelWidthScale (lua_State *L) { -// lua_pushnumber(L, luaL_checkanimating(L, 1)->GetModelWidthScale()); -// return 1; -// } - -LUA_BINDING_BEGIN( CBaseAnimating, GetNumFlexControllers, "class", "Get the number of flex controllers." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushinteger( L, pAnimating->GetNumFlexControllers() ); - - return 1; -} -LUA_BINDING_END( "number", "The number of flex controllers" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetPlaybackRate, "class", "Get the playback rate." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushnumber( L, pAnimating->GetPlaybackRate() ); - - return 1; -} -LUA_BINDING_END( "number", "The playback rate" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetPoseParameter, "class", "Get the pose parameter." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iPoseParameter = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ); - - lua_pushnumber( L, pAnimating->GetPoseParameter( iPoseParameter ) ); - - return 1; -} -LUA_BINDING_END( "number", "The pose parameter" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetPoseParameterRange, "class", "Get the pose parameter range." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iPoseParameter = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ); - float minValue, maxValue; - - lua_pushboolean( L, pAnimating->GetPoseParameterRange( iPoseParameter, minValue, maxValue ) ); - lua_pushnumber( L, minValue ); - lua_pushnumber( L, maxValue ); - - return 3; -} -LUA_BINDING_END( "boolean", "Whether the operation was successful", "number", "The minimum value", "number", "The maximum value" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetRenderAngles, "class", "Get the render angles." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -614,74 +377,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetRenderOrigin, "class", "Get the render ori } LUA_BINDING_END( "vector", "The render origin" ) -LUA_BINDING_BEGIN( CBaseAnimating, GetSequence, "class", "Get the sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushinteger( L, pAnimating->GetSequence() ); - - return 1; -} -LUA_BINDING_END( "number", "The sequence" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceActivity, "class", "Get the sequence activity." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - lua_pushinteger( L, pAnimating->GetSequenceActivity( iSequence ) ); - - return 1; -} -LUA_BINDING_END( "number", "The sequence activity" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceActivityName, "class", "Get the sequence activity name." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - lua_pushstring( L, pAnimating->GetSequenceActivityName( iSequence ) ); - - return 1; -} -LUA_BINDING_END( "string", "The sequence activity name" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceGroundSpeed, "class", "Get the sequence ground speed." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - lua_pushnumber( L, pAnimating->GetSequenceGroundSpeed( iSequence ) ); - - return 1; -} -LUA_BINDING_END( "number", "The sequence ground speed" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceLinearMotion, "class", "Get the sequence linear motion." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - Vector pVec; - - pAnimating->GetSequenceLinearMotion( iSequence, &pVec ); - - lua_pushvector( L, pVec ); - - return 1; -} -LUA_BINDING_END( "vector", "The sequence linear motion" ) - -LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceName, "class", "Get the sequence name." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - lua_pushstring( L, pAnimating->GetSequenceName( iSequence ) ); - - return 1; -} -LUA_BINDING_END( "string", "The sequence name" ) - LUA_BINDING_BEGIN( CBaseAnimating, GetServerIntendedCycle, "class", "Get the server intended cycle." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -753,16 +448,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, Interpolate, "class", "Interpolate the entity } LUA_BINDING_END( "boolean", "Whether the operation was successful" ) -LUA_BINDING_BEGIN( CBaseAnimating, InvalidateBoneCache, "class", "Invalidate the bone cache." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->InvalidateBoneCache(); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, InvalidateBoneCaches, "class|static", "Invalidate the bone caches." ) { CBaseAnimating::InvalidateBoneCaches(); @@ -771,26 +456,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, InvalidateBoneCaches, "class|static", "Invali } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, InvalidateMdlCache, "class", "Invalidate the MDL cache." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->InvalidateMdlCache(); - - return 0; -} -LUA_BINDING_END() - -LUA_BINDING_BEGIN( CBaseAnimating, IsActivityFinished, "class", "Check if the activity is finished." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushboolean( L, pAnimating->IsActivityFinished() ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the activity is finished" ) - LUA_BINDING_BEGIN( CBaseAnimating, IsBoneCacheValid, "class", "Check if the bone cache is valid." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -801,26 +466,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, IsBoneCacheValid, "class", "Check if the bone } LUA_BINDING_END( "boolean", "Whether the bone cache is valid" ) -LUA_BINDING_BEGIN( CBaseAnimating, IsOnFire, "class", "Check if the entity is on fire." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushboolean( L, pAnimating->IsOnFire() ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the entity is on fire" ) - -LUA_BINDING_BEGIN( CBaseAnimating, IsRagdoll, "class", "Check if the entity is a ragdoll." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushboolean( L, pAnimating->IsRagdoll() ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the entity is a ragdoll" ) - LUA_BINDING_BEGIN( CBaseAnimating, IsSelfAnimating, "class", "Check if the entity is self animating." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -831,27 +476,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, IsSelfAnimating, "class", "Check if the entit } LUA_BINDING_END( "boolean", "Whether the entity is self animating" ) -LUA_BINDING_BEGIN( CBaseAnimating, IsSequenceFinished, "class", "Check if the sequence is finished." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushboolean( L, pAnimating->IsSequenceFinished() ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the sequence is finished" ) - -LUA_BINDING_BEGIN( CBaseAnimating, IsSequenceLooping, "class", "Check if the sequence is looping." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - lua_pushboolean( L, pAnimating->IsSequenceLooping( iSequence ) ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the sequence is looping" ) - LUA_BINDING_BEGIN( CBaseAnimating, IsViewModel, "class", "Check if the entity is a view model." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -862,50 +486,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, IsViewModel, "class", "Check if the entity is } LUA_BINDING_END( "boolean", "Whether the entity is a view model" ) -LUA_BINDING_BEGIN( CBaseAnimating, LookupActivity, "class", "Looks up an activity by name." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszActivityName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "activityName" ); - - lua_pushinteger( L, pAnimating->LookupActivity( pszActivityName ) ); - - return 1; -} -LUA_BINDING_END( "integer|ACT", "The activity" ) - -LUA_BINDING_BEGIN( CBaseAnimating, LookupAttachment, "class", "Lookup the attachment." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszAttachmentName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "attachmentName" ); - - lua_pushinteger( L, pAnimating->LookupAttachment( pszAttachmentName ) ); - - return 1; -} -LUA_BINDING_END( "number", "The attachment" ) - -LUA_BINDING_BEGIN( CBaseAnimating, LookupBone, "class", "Lookup the bone." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszBoneName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "boneName" ); - - lua_pushinteger( L, pAnimating->LookupBone( pszBoneName ) ); - - return 1; -} -LUA_BINDING_END( "number", "The bone" ) - -LUA_BINDING_BEGIN( CBaseAnimating, LookupPoseParameter, "class", "Lookup the pose parameter." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszPoseParameterName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "poseParameterName" ); - - lua_pushinteger( L, pAnimating->LookupPoseParameter( pszPoseParameterName ) ); - - return 1; -} -LUA_BINDING_END( "number", "The pose parameter" ) - LUA_BINDING_BEGIN( CBaseAnimating, LookupRandomAttachment, "class", "Get a random index of an attachment point with the specified substring in its name." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -917,17 +497,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, LookupRandomAttachment, "class", "Get a rando } LUA_BINDING_END( "number", "The random attachment" ) -LUA_BINDING_BEGIN( CBaseAnimating, LookupSequence, "class", "Lookup the sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszSequenceName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "sequenceName" ); - - lua_pushinteger( L, pAnimating->LookupSequence( pszSequenceName ) ); - - return 1; -} -LUA_BINDING_END( "number", "The sequence" ) - LUA_BINDING_BEGIN( CBaseAnimating, NotifyShouldTransmit, "class", "Notify should transmit." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -1061,41 +630,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, ResetLatched, "class", "Reset the latched." ) } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, ResetSequence, "class", "Reset the sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - auto model = pAnimating->GetModelPtr(); - - if ( !model ) - { - Warning( "CBaseAnimating::ResetSequence failed: no model\n" ); - return 0; - } - - if ( iSequence >= model->GetNumSeq() ) - { - Warning( "CBaseAnimating::ResetSequence failed: invalid sequence %d\n", iSequence ); - return 0; - } - - pAnimating->ResetSequence( iSequence ); - - return 0; -} -LUA_BINDING_END() - -LUA_BINDING_BEGIN( CBaseAnimating, ResetSequenceInfo, "class", "Reset the sequence info." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->ResetSequenceInfo(); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, RetrieveRagdollInfo, "class", "Retrieve the ragdoll info." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -1111,110 +645,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, RetrieveRagdollInfo, "class", "Retrieve the r } LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The position" ) -LUA_BINDING_BEGIN( CBaseAnimating, SelectWeightedSequence, "class", "Select the weighted sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iActivity = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "activity" ); - - lua_pushinteger( L, pAnimating->SelectWeightedSequence( iActivity ) ); - - return 1; -} -LUA_BINDING_END( "number", "The weighted sequence" ) - -LUA_BINDING_BEGIN( CBaseAnimating, SequenceDuration, "class", "Get the sequence duration." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - if ( lua_isnoneornil( L, 2 ) ) - lua_pushnumber( L, pAnimating->SequenceDuration() ); - else - lua_pushnumber( L, pAnimating->SequenceDuration( LUA_BINDING_ARGUMENT_NILLABLE( luaL_checknumber, 2, "sequence" ) ) ); - - return 1; -} -LUA_BINDING_END( "number", "The sequence duration" ) - -LUA_BINDING_BEGIN( CBaseAnimating, SequenceLoops, "class", "Check if the sequence loops." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - lua_pushboolean( L, pAnimating->SequenceLoops() ); - - return 1; -} -LUA_BINDING_END( "boolean", "Whether the sequence loops" ) - -LUA_BINDING_BEGIN( CBaseAnimating, SetBoneController, "class", "Set the value for the specified bone controller." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iBoneController = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "boneController" ); - float flValue = LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ); - - lua_pushnumber( L, pAnimating->SetBoneController( iBoneController, flValue ) ); - - return 1; -} -LUA_BINDING_END( "number", "The bone controller" ) - -LUA_BINDING_BEGIN( CBaseAnimating, SetCycle, "class", "Set the cycle." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - float flCycle = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "cycle" ); - - pAnimating->SetCycle( flCycle ); - - return 0; -} -LUA_BINDING_END() - -LUA_BINDING_BEGIN( CBaseAnimating, SetHitboxSet, "class", "Set the hitbox set." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iHitboxSet = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "hitboxSet" ); - - pAnimating->SetHitboxSet( iHitboxSet ); - - return 0; -} -LUA_BINDING_END() - -LUA_BINDING_BEGIN( CBaseAnimating, SetHitboxSetByName, "class", "Set the hitbox set by name." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - const char *pszHitboxSetName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "hitboxSetName" ); - - pAnimating->SetHitboxSetByName( pszHitboxSetName ); - - return 0; -} -LUA_BINDING_END() - -// TODO: -// static int CBaseAnimating_SetModelWidthScale (lua_State *L) { -// luaL_checkanimating(L, 1)->SetModelWidthScale(luaL_checknumber(L, 2)); -// return 0; -// } - -LUA_BINDING_BEGIN( CBaseAnimating, SetPoseParameter, "class", "Set the pose parameter." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - switch ( lua_type( L, 2 ) ) - { - case LUA_TNUMBER: - lua_pushnumber( L, pAnimating->SetPoseParameter( LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ), LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ) ) ); - break; - case LUA_TSTRING: - default: - lua_pushnumber( L, pAnimating->SetPoseParameter( LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "poseParameter" ), LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ) ) ); - break; - } - - return 1; -} -LUA_BINDING_END( "number", "The pose parameter" ) - LUA_BINDING_BEGIN( CBaseAnimating, SetPredictable, "class", "Set predictable." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -1257,17 +687,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, SetReceivedSequence, "class", "Set the receiv } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, SetSequence, "class", "Set the sequence." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); - - pAnimating->SetSequence( iSequence ); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, SetServerIntendedCycle, "class", "Set the server intended cycle." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -1327,16 +746,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, Simulate, "class", "Simulate." ) } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, StudioFrameAdvance, "class", "Advances the animation frame." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->StudioFrameAdvance(); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, ThreadedBoneSetup, "class|static", "Threaded bone setup." ) { CBaseAnimating::ThreadedBoneSetup(); @@ -1345,17 +754,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, ThreadedBoneSetup, "class|static", "Threaded } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, TransferDissolveFrom, "class", "Transfer the dissolve from." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - C_BaseAnimating *pAnimatingFrom = LUA_BINDING_ARGUMENT( luaL_checkanimating, 2, "entityFrom" ); - - pAnimating->TransferDissolveFrom( pAnimatingFrom ); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, UncorrectViewModelAttachment, "class", "All view model attachments origins are stretched so you can place entities at them an dthey will match up with where the attachment winds up being drawn on the view model, since the view models are drawn with a different FOV.\n\nIf you're drawing something inside of a view model's DrawModel() function, then you want the original attachment origin instead of the adjusted one. To get that, call this on the adjusted attachment origin. \nThis only works for C_BaseViewModel entities." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -1397,16 +795,6 @@ LUA_BINDING_BEGIN( CBaseAnimating, UpdateIKLocks, "class", "Update the IK locks. } LUA_BINDING_END() -LUA_BINDING_BEGIN( CBaseAnimating, UseClientSideAnimation, "class", "Use the client side animation." ) -{ - lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); - - pAnimating->UseClientSideAnimation(); - - return 0; -} -LUA_BINDING_END() - LUA_BINDING_BEGIN( CBaseAnimating, UsesPowerOfTwoFrameBufferTexture, "class", "Check if the entity uses a power of two frame buffer texture." ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); diff --git a/src/game/server/lbaseanimating.cpp b/src/game/server/lbaseanimating.cpp index c4c44cefdf..c7b912fb13 100644 --- a/src/game/server/lbaseanimating.cpp +++ b/src/game/server/lbaseanimating.cpp @@ -14,435 +14,29 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -/* -** access functions (stack -> C) -*/ - -LUA_API lua_CBaseAnimating *lua_toanimating( lua_State *L, int idx ) -{ - CBaseHandle *hEntity = - dynamic_cast< CBaseHandle * >( ( CBaseHandle * )lua_touserdata( L, idx ) ); - if ( hEntity == NULL ) - return NULL; - return dynamic_cast< lua_CBaseAnimating * >( hEntity->Get() ); -} - -/* -** push functions (C -> stack) -*/ -LUALIB_API lua_CBaseAnimating *luaL_checkanimating( lua_State *L, int narg ) -{ - lua_CBaseAnimating *d = lua_toanimating( L, narg ); - if ( d == NULL ) /* avoid extra test when d is not 0 */ - luaL_argerror( L, narg, "CBaseAnimating expected, got NULL entity" ); - return d; -} - -static int CBaseAnimating_CalculateIKLocks( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->CalculateIKLocks( luaL_checknumber( L, 2 ) ); - return 0; -} +LUA_REGISTRATION_INIT( CBaseAnimating ) -static int CBaseAnimating_ComputeEntitySpaceHitboxSurroundingBox( lua_State *L ) +LUA_BINDING_BEGIN( CBaseAnimating, Ignite, "class", "Ignite the entity." ) { - Vector pVecWorldMins, pVecWorldMaxs; - lua_pushboolean( - L, luaL_checkanimating( L, 1 )->ComputeEntitySpaceHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); - lua_pushvector( L, pVecWorldMins ); - lua_pushvector( L, pVecWorldMaxs ); - return 3; -} + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + float flFlameLifetime = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "lifetimeInSeconds" ); + float flFlameSize = LUA_BINDING_ARGUMENT_WITH_DEFAULT( luaL_optnumber, 3, 0.0f, "spreadRadius" ); -static int CBaseAnimating_ComputeHitboxSurroundingBox( lua_State *L ) -{ - Vector pVecWorldMins, pVecWorldMaxs; - lua_pushboolean( L, luaL_checkanimating( L, 1 )->ComputeHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); - lua_pushvector( L, pVecWorldMins ); - lua_pushvector( L, pVecWorldMaxs ); - return 3; -} + pAnimating->Ignite( flFlameLifetime, false, flFlameSize ); -static int CBaseAnimating_DoMuzzleFlash( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->DoMuzzleFlash(); return 0; } +LUA_BINDING_END() -static int CBaseAnimating_FindTransitionSequence( lua_State *L ) -{ - lua_pushinteger( - L, luaL_checkanimating( L, 1 )->FindTransitionSequence( luaL_checkinteger( L, 2 ), luaL_checkinteger( L, 3 ), NULL ) ); - return 1; -} - -static int CBaseAnimating_GetAnimTimeInterval( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->GetAnimTimeInterval() ); - return 1; -} - -static int CBaseAnimating_GetAttachmentLocal( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->GetAttachmentLocal( luaL_checknumber( L, 2 ), luaL_checkvector( L, 3 ), luaL_checkangle( L, 4 ) ) ); - return 1; -} - -static int CBaseAnimating_GetBaseAnimating( lua_State *L ) -{ - CBaseEntity::PushLuaInstanceSafe( L, luaL_checkanimating( L, 1 )->GetBaseAnimating() ); - return 1; -} - -static int CBaseAnimating_GetBonePosition( lua_State *L ) -{ - Vector origin; - QAngle angles; - luaL_checkanimating( L, 1 )->GetBonePosition( luaL_checkinteger( L, 2 ), origin, angles ); - lua_pushvector( L, origin ); - lua_pushangle( L, angles ); - return 2; -} - -static int CBaseAnimating_GetCycle( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->GetCycle() ); - return 1; -} - -static int CBaseAnimating_GetFlexDescFacs( lua_State *L ) -{ - lua_pushstring( - L, luaL_checkanimating( L, 1 )->GetFlexDescFacs( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_GetHitboxSet( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->GetHitboxSet() ); - return 1; -} - -static int CBaseAnimating_GetHitboxSetCount( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->GetHitboxSetCount() ); - return 1; -} - -static int CBaseAnimating_GetHitboxSetName( lua_State *L ) -{ - lua_pushstring( L, luaL_checkanimating( L, 1 )->GetHitboxSetName() ); - return 1; -} - -// static int CBaseAnimating_GetModelWidthScale (lua_State *L) { -// lua_pushnumber(L, luaL_checkanimating(L, 1)->GetModelWidthScale()); -// return 1; -// } - -static int CBaseAnimating_GetNumFlexControllers( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->GetNumFlexControllers() ); - return 1; -} - -static int CBaseAnimating_GetPlaybackRate( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->GetPlaybackRate() ); - return 1; -} - -static int CBaseAnimating_GetPoseParameter( lua_State *L ) +LUA_BINDING_BEGIN( CBaseAnimating, Extinguish, "class", "Extinguish the entity." ) { - lua_pushnumber( L, luaL_checkanimating( L, 1 )->GetPoseParameter( luaL_checkinteger( L, 2 ) ) ); - return 1; -} + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); -static int CBaseAnimating_GetPoseParameterRange( lua_State *L ) -{ - float minValue, maxValue; - lua_pushboolean( L, luaL_checkanimating( L, 1 )->GetPoseParameterRange( luaL_checkinteger( L, 2 ), minValue, maxValue ) ); - lua_pushnumber( L, minValue ); - lua_pushnumber( L, maxValue ); - return 3; -} + pAnimating->Extinguish(); -static int CBaseAnimating_GetSequence( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->GetSequence() ); - return 1; -} - -static int CBaseAnimating_GetSequenceActivity( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->GetSequenceActivity( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_GetSequenceActivityName( lua_State *L ) -{ - lua_pushstring( L, luaL_checkanimating( L, 1 )->GetSequenceActivityName( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_GetSequenceGroundSpeed( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->GetSequenceGroundSpeed( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_GetSequenceLinearMotion( lua_State *L ) -{ - Vector pVec; - luaL_checkanimating( L, 1 )->GetSequenceLinearMotion( luaL_checkinteger( L, 2 ), - &pVec ); - lua_pushvector( L, pVec ); - return 1; -} - -static int CBaseAnimating_GetSequenceName( lua_State *L ) -{ - lua_pushstring( - L, luaL_checkanimating( L, 1 )->GetSequenceName( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_InvalidateBoneCache( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->InvalidateBoneCache(); - return 0; -} - -static int CBaseAnimating_InvalidateMdlCache( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->InvalidateMdlCache(); return 0; } - -static int CBaseAnimating_IsActivityFinished( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->IsActivityFinished() ); - return 1; -} - -static int CBaseAnimating_IsOnFire( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->IsOnFire() ); - return 1; -} - -static int CBaseAnimating_IsRagdoll( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->IsRagdoll() ); - return 1; -} - -static int CBaseAnimating_IsSequenceFinished( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->IsSequenceFinished() ); - return 1; -} - -static int CBaseAnimating_IsSequenceLooping( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->IsSequenceLooping( luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_LookupActivity( lua_State *L ) -{ - lua_pushinteger( - L, luaL_checkanimating( L, 1 )->LookupActivity( luaL_checkstring( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_LookupAttachment( lua_State *L ) -{ - lua_pushinteger( - L, luaL_checkanimating( L, 1 )->LookupAttachment( luaL_checkstring( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_LookupBone( lua_State *L ) -{ - lua_pushinteger( - L, luaL_checkanimating( L, 1 )->LookupBone( luaL_checkstring( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_LookupPoseParameter( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->LookupPoseParameter( luaL_checkstring( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_LookupSequence( lua_State *L ) -{ - lua_pushinteger( - L, luaL_checkanimating( L, 1 )->LookupSequence( luaL_checkstring( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_ResetSequence( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->ResetSequence( luaL_checkinteger( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_ResetSequenceInfo( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->ResetSequenceInfo(); - return 0; -} - -static int CBaseAnimating_SelectWeightedSequence( lua_State *L ) -{ - lua_pushinteger( L, luaL_checkanimating( L, 1 )->SelectWeightedSequence( ( Activity )luaL_checkinteger( L, 2 ) ) ); - return 1; -} - -static int CBaseAnimating_SequenceDuration( lua_State *L ) -{ - switch ( lua_type( L, 2 ) ) - { - case LUA_TNONE: - default: - lua_pushnumber( L, luaL_checkanimating( L, 1 )->SequenceDuration() ); - break; - case LUA_TNUMBER: - lua_pushnumber( L, luaL_checkanimating( L, 1 )->SequenceDuration( luaL_checknumber( L, 2 ) ) ); - break; - } - return 1; -} - -static int CBaseAnimating_SequenceLoops( lua_State *L ) -{ - lua_pushboolean( L, luaL_checkanimating( L, 1 )->SequenceLoops() ); - return 1; -} - -static int CBaseAnimating_SetBoneController( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->SetBoneController( luaL_checkinteger( L, 2 ), luaL_checknumber( L, 3 ) ) ); - return 1; -} - -static int CBaseAnimating_SetCycle( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->SetCycle( luaL_checknumber( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_SetHitboxSet( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->SetHitboxSet( luaL_checkinteger( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_SetHitboxSetByName( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->SetHitboxSetByName( luaL_checkstring( L, 2 ) ); - return 0; -} - -// static int CBaseAnimating_SetModelWidthScale (lua_State *L) { -// luaL_checkanimating(L, 1)->SetModelWidthScale(luaL_checknumber(L, 2)); -// return 0; -// } - -static int CBaseAnimating_SetPlaybackRate( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->SetPlaybackRate( luaL_checknumber( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_SetPoseParameter( lua_State *L ) -{ - lua_pushnumber( L, luaL_checkanimating( L, 1 )->SetPoseParameter( luaL_checkinteger( L, 2 ), luaL_checknumber( L, 3 ) ) ); - return 1; -} - -static int CBaseAnimating_SetSequence( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->SetSequence( luaL_checkinteger( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_StudioFrameAdvance( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->StudioFrameAdvance(); - return 0; -} - -static int CBaseAnimating_TransferDissolveFrom( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->TransferDissolveFrom( luaL_checkanimating( L, 2 ) ); - return 0; -} - -static int CBaseAnimating_UseClientSideAnimation( lua_State *L ) -{ - luaL_checkanimating( L, 1 )->UseClientSideAnimation(); - return 0; -} - -static const luaL_Reg CBaseAnimatingmeta[] = { - { "CalculateIKLocks", CBaseAnimating_CalculateIKLocks }, - { "ComputeEntitySpaceHitboxSurroundingBox", - CBaseAnimating_ComputeEntitySpaceHitboxSurroundingBox }, - { "ComputeHitboxSurroundingBox", CBaseAnimating_ComputeHitboxSurroundingBox }, - { "DoMuzzleFlash", CBaseAnimating_DoMuzzleFlash }, - { "FindTransitionSequence", CBaseAnimating_FindTransitionSequence }, - { "GetAnimTimeInterval", CBaseAnimating_GetAnimTimeInterval }, - { "GetAttachmentLocal", CBaseAnimating_GetAttachmentLocal }, - { "GetBaseAnimating", CBaseAnimating_GetBaseAnimating }, - { "GetBonePosition", CBaseAnimating_GetBonePosition }, - { "GetCycle", CBaseAnimating_GetCycle }, - { "GetFlexDescFacs", CBaseAnimating_GetFlexDescFacs }, - { "GetHitboxSet", CBaseAnimating_GetHitboxSet }, - { "GetHitboxSetCount", CBaseAnimating_GetHitboxSetCount }, - { "GetHitboxSetName", CBaseAnimating_GetHitboxSetName }, - //{"GetModelWidthScale", CBaseAnimating_GetModelWidthScale}, - { "GetNumFlexControllers", CBaseAnimating_GetNumFlexControllers }, - { "GetPlaybackRate", CBaseAnimating_GetPlaybackRate }, - { "GetPoseParameter", CBaseAnimating_GetPoseParameter }, - { "GetPoseParameterRange", CBaseAnimating_GetPoseParameterRange }, - { "GetSequence", CBaseAnimating_GetSequence }, - { "GetSequenceActivity", CBaseAnimating_GetSequenceActivity }, - { "GetSequenceActivityName", CBaseAnimating_GetSequenceActivityName }, - { "GetSequenceGroundSpeed", CBaseAnimating_GetSequenceGroundSpeed }, - { "GetSequenceLinearMotion", CBaseAnimating_GetSequenceLinearMotion }, - { "GetSequenceName", CBaseAnimating_GetSequenceName }, - { "InvalidateBoneCache", CBaseAnimating_InvalidateBoneCache }, - { "InvalidateMdlCache", CBaseAnimating_InvalidateMdlCache }, - { "IsActivityFinished", CBaseAnimating_IsActivityFinished }, - { "IsOnFire", CBaseAnimating_IsOnFire }, - { "IsRagdoll", CBaseAnimating_IsRagdoll }, - { "IsSequenceFinished", CBaseAnimating_IsSequenceFinished }, - { "IsSequenceLooping", CBaseAnimating_IsSequenceLooping }, - { "LookupActivity", CBaseAnimating_LookupActivity }, - { "LookupAttachment", CBaseAnimating_LookupAttachment }, - { "LookupBone", CBaseAnimating_LookupBone }, - { "LookupPoseParameter", CBaseAnimating_LookupPoseParameter }, - { "LookupSequence", CBaseAnimating_LookupSequence }, - { "ResetSequence", CBaseAnimating_ResetSequence }, - { "ResetSequenceInfo", CBaseAnimating_ResetSequenceInfo }, - { "SelectWeightedSequence", CBaseAnimating_SelectWeightedSequence }, - { "SequenceDuration", CBaseAnimating_SequenceDuration }, - { "SequenceLoops", CBaseAnimating_SequenceLoops }, - { "SetBoneController", CBaseAnimating_SetBoneController }, - { "SetCycle", CBaseAnimating_SetCycle }, - { "SetHitboxSet", CBaseAnimating_SetHitboxSet }, - { "SetHitboxSetByName", CBaseAnimating_SetHitboxSetByName }, - //{"SetModelWidthScale", CBaseAnimating_SetModelWidthScale}, - { "SetPlaybackRate", CBaseAnimating_SetPlaybackRate }, - { "SetPoseParameter", CBaseAnimating_SetPoseParameter }, - { "SetSequence", CBaseAnimating_SetSequence }, - { "StudioFrameAdvance", CBaseAnimating_StudioFrameAdvance }, - { "TransferDissolveFrom", CBaseAnimating_TransferDissolveFrom }, - { "UseClientSideAnimation", CBaseAnimating_UseClientSideAnimation }, - { NULL, NULL } }; +LUA_BINDING_END() /* ** Open CBaseAnimating object @@ -450,9 +44,11 @@ static const luaL_Reg CBaseAnimatingmeta[] = { LUALIB_API int luaopen_CBaseAnimating( lua_State *L ) { LUA_PUSH_METATABLE_TO_EXTEND( L, LUA_BASEANIMATINGLIBNAME ); - luaL_register( L, NULL, CBaseAnimatingmeta ); - lua_pushstring( L, "Entity" ); - lua_setfield( L, -2, "__type" ); /* metatable.__type = "Entity" */ - lua_pop( L, 1 ); + + // luaL_register( L, NULL, CBaseAnimatingmeta ); + // lua_pushstring( L, "Entity" ); + // lua_setfield( L, -2, "__type" ); /* metatable.__type = "Entity" */ // moved to lbaseanimating_shared + LUA_REGISTRATION_COMMIT( CBaseAnimating ); + return 1; } diff --git a/src/game/shared/lbaseanimating_shared.cpp b/src/game/shared/lbaseanimating_shared.cpp index e48147b6b4..c3278556c5 100644 --- a/src/game/shared/lbaseanimating_shared.cpp +++ b/src/game/shared/lbaseanimating_shared.cpp @@ -12,8 +12,161 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" +/* +** access functions (stack -> C) +*/ + +LUA_API lua_CBaseAnimating *lua_toanimating( lua_State *L, int idx ) +{ + CBaseHandle *hEntity = + dynamic_cast< CBaseHandle * >( ( CBaseHandle * )lua_touserdata( L, idx ) ); + if ( hEntity == NULL ) + return NULL; + return dynamic_cast< lua_CBaseAnimating * >( hEntity->Get() ); +} + +/* +** push functions (C -> stack) +*/ +LUALIB_API lua_CBaseAnimating *luaL_checkanimating( lua_State *L, int narg ) +{ + lua_CBaseAnimating *d = lua_toanimating( L, narg ); + if ( d == NULL ) /* avoid extra test when d is not 0 */ + luaL_argerror( L, narg, "CBaseAnimating expected, got NULL entity" ); + return d; +} + LUA_REGISTRATION_INIT( CBaseAnimating ) +LUA_BINDING_BEGIN( CBaseAnimating, CalculateIKLocks, "class", "Calculate IK locks." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + float flTime = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "currentTime" ); + + pAnimating->CalculateIKLocks( flTime ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, ComputeHitboxSurroundingBox, "class", "Compute the hitbox surrounding box." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + Vector pVecWorldMins, pVecWorldMaxs; + lua_pushboolean( L, pAnimating->ComputeHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); + lua_pushvector( L, pVecWorldMins ); + lua_pushvector( L, pVecWorldMaxs ); + + return 3; +} +LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The world mins", "vector", "The world maxs" ) + +LUA_BINDING_BEGIN( CBaseAnimating, ComputeEntitySpaceHitboxSurroundingBox, "class", "Compute the entity space hitbox surrounding box." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + Vector pVecWorldMins, pVecWorldMaxs; + lua_pushboolean( L, pAnimating->ComputeEntitySpaceHitboxSurroundingBox( &pVecWorldMins, &pVecWorldMaxs ) ); + lua_pushvector( L, pVecWorldMins ); + lua_pushvector( L, pVecWorldMaxs ); + + return 3; +} +LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The world mins", "vector", "The world maxs" ) + +LUA_BINDING_BEGIN( CBaseAnimating, DoMuzzleFlash, "class", "Sets up muzzle flash parity." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->DoMuzzleFlash(); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, GetBonePosition, "class", "Get the bone position." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iBone = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "bone" ); + Vector pVecOrigin; + QAngle pAngAngles; + + pAnimating->GetBonePosition( iBone, pVecOrigin, pAngAngles ); + + lua_pushvector( L, pVecOrigin ); + lua_pushangle( L, pAngAngles ); + + return 2; +} +LUA_BINDING_END( "vector", "The origin", "angle", "The angles" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetCycle, "class", "Get the current cycle." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushnumber( L, pAnimating->GetCycle() ); + + return 1; +} +LUA_BINDING_END( "number", "The cycle" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetFlexDescFacs, "class", "Get the flex desc facs." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iFlexDescIndex = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "flexDescIndex" ); + + lua_pushstring( L, pAnimating->GetFlexDescFacs( iFlexDescIndex ) ); + + return 1; +} +LUA_BINDING_END( "string", "The flex desc facs" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSet, "class", "Get the index of the hitbox set in use." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushinteger( L, pAnimating->GetHitboxSet() ); + + return 1; +} +LUA_BINDING_END( "number", "The hitbox set" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSetCount, "class", "Get the hitbox set count." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushinteger( L, pAnimating->GetHitboxSetCount() ); + + return 1; +} +LUA_BINDING_END( "number", "The hitbox set count" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetHitboxSetName, "class", "Get the hitbox set name." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushstring( L, pAnimating->GetHitboxSetName() ); + + return 1; +} +LUA_BINDING_END( "string", "The hitbox set name" ) + +// static int CBaseAnimating_GetModelWidthScale (lua_State *L) { +// lua_pushnumber(L, luaL_checkanimating(L, 1)->GetModelWidthScale()); +// return 1; +// } + +LUA_BINDING_BEGIN( CBaseAnimating, GetNumFlexControllers, "class", "Get the number of flex controllers." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushinteger( L, pAnimating->GetNumFlexControllers() ); + + return 1; +} +LUA_BINDING_END( "number", "The number of flex controllers" ) + LUA_BINDING_BEGIN( CBaseAnimating, GetModelName, "class", "Get the model path of the entity" ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -24,6 +177,16 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetModelName, "class", "Get the model path of } LUA_BINDING_END( "string", "The model name" ) +LUA_BINDING_BEGIN( CBaseAnimating, GetAnimTimeInterval, "class", "Get the animation time interval." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushnumber( L, pAnimating->GetAnimTimeInterval() ); + + return 1; +} +LUA_BINDING_END( "number", "The animation time interval" ) + // static int CBaseAnimating_GetAttachment( lua_State *L ) LUA_BINDING_BEGIN( CBaseAnimating, GetAttachment, "class", "Get the attachment table for the specified attachment (by bone id or attachment name)" ) { @@ -76,6 +239,21 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetAttachment, "class", "Get the attachment t } LUA_BINDING_END( "table", "The attachment information" ) +LUA_BINDING_BEGIN( CBaseAnimating, GetAttachmentLocal, "class", "Get the local attachment." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iAttachment = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "attachment" ); + Vector pVecOrigin; + QAngle pAngAngles; + + lua_pushboolean( L, pAnimating->GetAttachmentLocal( iAttachment, pVecOrigin, pAngAngles ) ); + lua_pushvector( L, pVecOrigin ); + lua_pushangle( L, pAngAngles ); + + return 3; +} +LUA_BINDING_END( "boolean", "Whether the operation was successful", "vector", "The origin", "angle", "The angles" ) + LUA_BINDING_BEGIN( CBaseAnimating, FindBodyGroupByName, "class", "Find the bodygroup id by the bodygroup name" ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -87,6 +265,31 @@ LUA_BINDING_BEGIN( CBaseAnimating, FindBodyGroupByName, "class", "Find the bodyg } LUA_BINDING_END( "number", "The bodygroup id" ) +LUA_BINDING_BEGIN( CBaseAnimating, FindTransitionSequence, "class", "Find the transition sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + int iGoalSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "goalSequence" ); + + int piDir; + lua_pushinteger( L, pAnimating->FindTransitionSequence( iSequence, iGoalSequence, &piDir ) ); + lua_pushinteger( L, piDir ); + + return 2; +} +LUA_BINDING_END( "number", "The transition sequence", "number", "The direction" ) + +// Experiment; Returns 'this', so pretty useless in Lua I imagine. Disabled: +// LUA_BINDING_BEGIN( CBaseAnimating, GetBaseAnimating, "class", "Get the base animating entity." ) +//{ +// lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); +// +// CBaseEntity::PushLuaInstanceSafe( L, pAnimating->GetBaseAnimating() ); +// +// return 1; +//} +// LUA_BINDING_END( "entity", "The base animating entity" ) + LUA_BINDING_BEGIN( CBaseAnimating, GetBodyGroup, "class", "Get the bodygroup value by the bodygroup id" ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -130,6 +333,385 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetNumBodyGroups, "class", "Get the number of } LUA_BINDING_END( "number", "The number of bodygroups" ) +LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceName, "class", "Get the sequence name." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + lua_pushstring( L, pAnimating->GetSequenceName( iSequence ) ); + + return 1; +} +LUA_BINDING_END( "string", "The sequence name" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceLinearMotion, "class", "Get the sequence linear motion." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + Vector pVec; + + pAnimating->GetSequenceLinearMotion( iSequence, &pVec ); + + lua_pushvector( L, pVec ); + + return 1; +} +LUA_BINDING_END( "vector", "The sequence linear motion" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceGroundSpeed, "class", "Get the sequence ground speed." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + lua_pushnumber( L, pAnimating->GetSequenceGroundSpeed( iSequence ) ); + + return 1; +} +LUA_BINDING_END( "number", "The sequence ground speed" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceActivityName, "class", "Get the sequence activity name." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + lua_pushstring( L, pAnimating->GetSequenceActivityName( iSequence ) ); + + return 1; +} +LUA_BINDING_END( "string", "The sequence activity name" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetSequenceActivity, "class", "Get the sequence activity." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + lua_pushinteger( L, pAnimating->GetSequenceActivity( iSequence ) ); + + return 1; +} +LUA_BINDING_END( "number", "The sequence activity" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetSequence, "class", "Get the sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushinteger( L, pAnimating->GetSequence() ); + + return 1; +} +LUA_BINDING_END( "number", "The sequence" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetPoseParameter, "class", "Get the pose parameter." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iPoseParameter = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ); + + lua_pushnumber( L, pAnimating->GetPoseParameter( iPoseParameter ) ); + + return 1; +} +LUA_BINDING_END( "number", "The pose parameter" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetPoseParameterRange, "class", "Get the pose parameter range." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iPoseParameter = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ); + float minValue, maxValue; + + lua_pushboolean( L, pAnimating->GetPoseParameterRange( iPoseParameter, minValue, maxValue ) ); + lua_pushnumber( L, minValue ); + lua_pushnumber( L, maxValue ); + + return 3; +} +LUA_BINDING_END( "boolean", "Whether the operation was successful", "number", "The minimum value", "number", "The maximum value" ) + +LUA_BINDING_BEGIN( CBaseAnimating, GetPlaybackRate, "class", "Get the playback rate." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushnumber( L, pAnimating->GetPlaybackRate() ); + + return 1; +} +LUA_BINDING_END( "number", "The playback rate" ) + +LUA_BINDING_BEGIN( CBaseAnimating, IsOnFire, "class", "Check if the entity is on fire." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushboolean( L, pAnimating->IsOnFire() ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the entity is on fire" ) + +LUA_BINDING_BEGIN( CBaseAnimating, IsActivityFinished, "class", "Check if the activity is finished." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushboolean( L, pAnimating->IsActivityFinished() ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the activity is finished" ) + +LUA_BINDING_BEGIN( CBaseAnimating, InvalidateModelCache, "class", "Invalidate the model cache." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->InvalidateMdlCache(); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, InvalidateBoneCache, "class", "Invalidate the bone cache." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->InvalidateBoneCache(); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, IsRagdoll, "class", "Check if the entity is a ragdoll." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushboolean( L, pAnimating->IsRagdoll() ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the entity is a ragdoll" ) + +LUA_BINDING_BEGIN( CBaseAnimating, IsSequenceFinished, "class", "Check if the sequence is finished." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushboolean( L, pAnimating->IsSequenceFinished() ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the sequence is finished" ) + +LUA_BINDING_BEGIN( CBaseAnimating, IsSequenceLooping, "class", "Check if the sequence is looping." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + lua_pushboolean( L, pAnimating->IsSequenceLooping( iSequence ) ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the sequence is looping" ) + +LUA_BINDING_BEGIN( CBaseAnimating, LookupActivity, "class", "Looks up an activity by name." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszActivityName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "activityName" ); + + lua_pushinteger( L, pAnimating->LookupActivity( pszActivityName ) ); + + return 1; +} +LUA_BINDING_END( "integer|ACT", "The activity" ) + +LUA_BINDING_BEGIN( CBaseAnimating, LookupAttachment, "class", "Lookup the attachment." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszAttachmentName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "attachmentName" ); + + lua_pushinteger( L, pAnimating->LookupAttachment( pszAttachmentName ) ); + + return 1; +} +LUA_BINDING_END( "number", "The attachment" ) + +LUA_BINDING_BEGIN( CBaseAnimating, LookupBone, "class", "Lookup the bone." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszBoneName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "boneName" ); + + lua_pushinteger( L, pAnimating->LookupBone( pszBoneName ) ); + + return 1; +} +LUA_BINDING_END( "number", "The bone" ) + +LUA_BINDING_BEGIN( CBaseAnimating, LookupPoseParameter, "class", "Lookup the pose parameter." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszPoseParameterName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "poseParameterName" ); + + lua_pushinteger( L, pAnimating->LookupPoseParameter( pszPoseParameterName ) ); + + return 1; +} +LUA_BINDING_END( "number", "The pose parameter" ) + +LUA_BINDING_BEGIN( CBaseAnimating, LookupSequence, "class", "Lookup the sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszSequenceName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "sequenceName" ); + + lua_pushinteger( L, pAnimating->LookupSequence( pszSequenceName ) ); + + return 1; +} +LUA_BINDING_END( "number", "The sequence" ) + +LUA_BINDING_BEGIN( CBaseAnimating, ResetSequence, "class", "Reset the sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + auto model = pAnimating->GetModelPtr(); + + if ( !model ) + { + Warning( "CBaseAnimating::ResetSequence failed: no model\n" ); + return 0; + } + + if ( iSequence >= model->GetNumSeq() ) + { + Warning( "CBaseAnimating::ResetSequence failed: invalid sequence %d\n", iSequence ); + return 0; + } + + pAnimating->ResetSequence( iSequence ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, ResetSequenceInfo, "class", "Reset the sequence info." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->ResetSequenceInfo(); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, SelectWeightedSequence, "class", "Select the weighted sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iActivity = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "activity" ); + +#ifdef CLIENT_DLL + lua_pushinteger( L, pAnimating->SelectWeightedSequence( iActivity ) ); +#else + lua_pushinteger( L, pAnimating->SelectWeightedSequence( ( Activity )iActivity ) ); +#endif + + return 1; +} +LUA_BINDING_END( "number", "The weighted sequence" ) + +LUA_BINDING_BEGIN( CBaseAnimating, SequenceDuration, "class", "Sequence duration." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + switch ( lua_type( L, 2 ) ) + { + case LUA_TNONE: + default: + lua_pushnumber( L, pAnimating->SequenceDuration() ); + break; + case LUA_TNUMBER: + int iSequence = LUA_BINDING_ARGUMENT_NILLABLE( luaL_checknumber, 2, "sequence" ); + lua_pushnumber( L, pAnimating->SequenceDuration( iSequence ) ); + break; + } + + return 1; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, SequenceLoops, "class", "Check if the sequence loops." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + lua_pushboolean( L, pAnimating->SequenceLoops() ); + + return 1; +} +LUA_BINDING_END( "boolean", "Whether the sequence loops" ) + +LUA_BINDING_BEGIN( CBaseAnimating, SetBoneController, "class", "Set the value for the specified bone controller." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iBoneController = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "boneController" ); + float flValue = LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ); + + lua_pushnumber( L, pAnimating->SetBoneController( iBoneController, flValue ) ); + + return 1; +} +LUA_BINDING_END( "number", "The bone controller" ) + +LUA_BINDING_BEGIN( CBaseAnimating, SetCycle, "class", "Set the cycle." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + float flCycle = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "cycle" ); + + pAnimating->SetCycle( flCycle ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, SetHitboxSet, "class", "Set the hitbox set." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iHitboxSet = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "hitboxSet" ); + + pAnimating->SetHitboxSet( iHitboxSet ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, SetHitboxSetByName, "class", "Set the hitbox set by name." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + const char *pszHitboxSetName = LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "hitboxSetName" ); + + pAnimating->SetHitboxSetByName( pszHitboxSetName ); + + return 0; +} +LUA_BINDING_END() + +// TODO: +// static int CBaseAnimating_SetModelWidthScale (lua_State *L) { +// luaL_checkanimating(L, 1)->SetModelWidthScale(luaL_checknumber(L, 2)); +// return 0; +// } + +LUA_BINDING_BEGIN( CBaseAnimating, SetPoseParameter, "class", "Set the pose parameter." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + switch ( lua_type( L, 2 ) ) + { + case LUA_TNUMBER: + lua_pushnumber( L, pAnimating->SetPoseParameter( LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "poseParameter" ), LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ) ) ); + break; + case LUA_TSTRING: + default: + lua_pushnumber( L, pAnimating->SetPoseParameter( LUA_BINDING_ARGUMENT( luaL_checkstring, 2, "poseParameter" ), LUA_BINDING_ARGUMENT( luaL_checknumber, 3, "value" ) ) ); + break; + } + + return 1; +} +LUA_BINDING_END( "number", "The pose parameter" ) + LUA_BINDING_BEGIN( CBaseAnimating, SetBodyGroup, "class", "Set the bodygroup value by the bodygroup id" ) { lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); @@ -271,6 +853,48 @@ LUA_BINDING_BEGIN( CBaseAnimating, GetFlexName, "class", "Get the flex controlle } LUA_BINDING_END( "string", "The flex controller name" ) +LUA_BINDING_BEGIN( CBaseAnimating, SetSequence, "class", "Set the sequence." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + int iSequence = LUA_BINDING_ARGUMENT( luaL_checknumber, 2, "sequence" ); + + pAnimating->SetSequence( iSequence ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, StudioFrameAdvance, "class", "Advances the animation frame." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->StudioFrameAdvance(); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, TransferDissolveFrom, "class", "Transfer the dissolve from." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + lua_CBaseAnimating *pAnimatingFrom = LUA_BINDING_ARGUMENT( luaL_checkanimating, 2, "entityFrom" ); + + pAnimating->TransferDissolveFrom( pAnimatingFrom ); + + return 0; +} +LUA_BINDING_END() + +LUA_BINDING_BEGIN( CBaseAnimating, UseClientSideAnimation, "class", "Use the client side animation." ) +{ + lua_CBaseAnimating *pAnimating = LUA_BINDING_ARGUMENT( luaL_checkanimating, 1, "entity" ); + + pAnimating->UseClientSideAnimation(); + + return 0; +} +LUA_BINDING_END() + // static int CBaseAnimating___index( lua_State *L ) //{ // CBaseAnimating *pEntity = lua_toanimating( L, 1 ); diff --git a/src/game/shared/lsrcinit.cpp b/src/game/shared/lsrcinit.cpp index 305ee616ec..786a3eed4b 100644 --- a/src/game/shared/lsrcinit.cpp +++ b/src/game/shared/lsrcinit.cpp @@ -34,7 +34,7 @@ static const luaL_RegForState luasrclibs[] = { // Shared // { LUA_BASEANIMATINGLIBNAME, luaopen_CBaseAnimating_shared, REALM_SHARED }, // ✔ n/a n/a - { LUA_BASEANIMATINGLIBNAME, luaopen_CBaseAnimating, REALM_SHARED }, // n/a ✔ TODO + { LUA_BASEANIMATINGLIBNAME, luaopen_CBaseAnimating, REALM_SHARED }, // n/a ✔ ✔ { LUA_BASECOMBATWEAPONLIBNAME, luaopen_CBaseCombatWeapon, REALM_SHARED }, { LUA_BASEENTITYLIBNAME, luaopen_CBaseEntity_shared, REALM_SHARED }, { LUA_BASEENTITYLIBNAME, luaopen_CBaseEntity, REALM_SHARED },