Class PlayerAnimationManager
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public class PlayerAnimationManager : AnimationManager, IAnimationManager, IDisposable
- Inheritance
-
PlayerAnimationManager
- Implements
- Inherited Members
- Extension Methods
Fields
UseFpAnmations
public bool UseFpAnmations
Field Value
lastActiveHeldHitAnimation
protected string lastActiveHeldHitAnimation
Field Value
lastActiveHeldReadyAnimation
protected string lastActiveHeldReadyAnimation
Field Value
lastActiveHeldUseAnimation
protected string lastActiveHeldUseAnimation
Field Value
lastActiveLeftHeldIdleAnimation
protected string lastActiveLeftHeldIdleAnimation
Field Value
lastActiveRightHeldIdleAnimation
protected string lastActiveRightHeldIdleAnimation
Field Value
lastRunningHeldHitAnimation
public string lastRunningHeldHitAnimation
Field Value
lastRunningHeldUseAnimation
public string lastRunningHeldUseAnimation
Field Value
Methods
FromAttributes(ITreeAttribute, string)
Loads the entity from a stored byte array from the SaveGame
public override void FromAttributes(ITreeAttribute tree, string version)
Parameters
tree
ITreeAttributeversion
string
GetAnimationState(string)
public override RunningAnimation GetAnimationState(string anim)
Parameters
anim
string
Returns
HeldHitAnimChanged(string)
public bool HeldHitAnimChanged(string nowHeldRightHitAnim)
Parameters
nowHeldRightHitAnim
string
Returns
HeldRightReadyAnimChanged(string)
public bool HeldRightReadyAnimChanged(string nowHeldRightReadyAnim)
Parameters
nowHeldRightReadyAnim
string
Returns
HeldUseAnimChanged(string)
public bool HeldUseAnimChanged(string nowHeldRightUseAnim)
Parameters
nowHeldRightUseAnim
string
Returns
Init(ICoreAPI, Entity)
Initializes the Animation Manager.
public override void Init(ICoreAPI api, Entity entity)
Parameters
IsAnimationActive(params string[])
public override bool IsAnimationActive(params string[] anims)
Parameters
anims
string[]
Returns
IsAnimationActiveOrRunning(string, float)
public bool IsAnimationActiveOrRunning(string anim, float untilProgress = 0.95)
Parameters
Returns
IsAnimationMostlyRunning(string, float)
protected bool IsAnimationMostlyRunning(string anim, float untilProgress = 0.95)
Parameters
Returns
IsAuthoritative(string)
public bool IsAuthoritative(string anim)
Parameters
anim
string
Returns
IsHeldHitActive(float)
public bool IsHeldHitActive(float untilProgress = 0.95)
Parameters
untilProgress
float
Returns
IsHeldHitAuthoritative()
public bool IsHeldHitAuthoritative()
Returns
IsHeldUseActive()
public bool IsHeldUseActive()
Returns
IsLeftHeldActive()
public bool IsLeftHeldActive()
Returns
IsRightHeldActive()
public bool IsRightHeldActive()
Returns
IsRightHeldReadyActive()
public bool IsRightHeldReadyActive()
Returns
LeftHeldIdleChanged(string)
public bool LeftHeldIdleChanged(string nowHeldLeftIdleAnim)
Parameters
nowHeldLeftIdleAnim
string
Returns
OnActiveSlotChanged(ItemSlot)
public void OnActiveSlotChanged(ItemSlot slot)
Parameters
slot
ItemSlot
OnClientFrame(float)
The event fired each time the client ticks.
public override void OnClientFrame(float dt)
Parameters
dt
float
OnIfpModeChanged(bool, bool)
public void OnIfpModeChanged(bool prev, bool now)
Parameters
OnReceivedServerAnimations(int[], int, float[])
The event fired when the manager recieves the server animations.
public override void OnReceivedServerAnimations(int[] activeAnimations, int activeAnimationsCount, float[] activeAnimationSpeeds)
Parameters
RegisterFrameCallback(AnimFrameCallback)
public override void RegisterFrameCallback(AnimFrameCallback trigger)
Parameters
trigger
AnimFrameCallback
ResetAnimation(string)
If given animation is running, will set its progress to the first animation frame
public override void ResetAnimation(string animCode)
Parameters
animCode
string
RightHeldIdleChanged(string)
public bool RightHeldIdleChanged(string nowHeldRightIdleAnim)
Parameters
nowHeldRightIdleAnim
string
Returns
StartAnimation(string)
Start a new animation defined in the entity config file. If it's not defined, it won't play. Use StartAnimation(AnimationMetaData animdata) to circumvent the entity config anim data.
public override bool StartAnimation(string configCode)
Parameters
configCode
stringAnim config code, not the animation code!
Returns
StartAnimation(AnimationMetaData)
Client: Starts given animation Server: Sends all active anims to all connected clients then purges the ActiveAnimationsByAnimCode list
public override bool StartAnimation(AnimationMetaData animdata)
Parameters
animdata
AnimationMetaData
Returns
StartHeldHitAnim(string)
public void StartHeldHitAnim(string animCode)
Parameters
animCode
string
StartHeldReadyAnim(string, bool)
public void StartHeldReadyAnim(string heldReadyAnim, bool force = false)
Parameters
StartHeldUseAnim(string)
public void StartHeldUseAnim(string animCode)
Parameters
animCode
string
StartLeftHeldIdleAnim(string)
public void StartLeftHeldIdleAnim(string animCode)
Parameters
animCode
string
StartRightHeldIdleAnim(string)
public void StartRightHeldIdleAnim(string animCode)
Parameters
animCode
string
StopAnimation(string)
Stops given animation
public override void StopAnimation(string code)
Parameters
code
string
StopHeldAttackAnim()
public void StopHeldAttackAnim()
StopHeldReadyAnim()
public void StopHeldReadyAnim()
StopHeldUseAnim()
public void StopHeldUseAnim()
StopLeftHeldIdleAnim()
public void StopLeftHeldIdleAnim()
StopRightHeldIdleAnim()
public void StopRightHeldIdleAnim()
StopSelfAnimation(string)
public void StopSelfAnimation(string code)
Parameters
code
string
ToAttributes(ITreeAttribute, bool)
Serializes the slots contents to be stored in the SaveGame
public override void ToAttributes(ITreeAttribute tree, bool forClient)
Parameters
tree
ITreeAttributeforClient
bool
onReceivedServerAnimation(AnimationMetaData)
protected override void onReceivedServerAnimation(AnimationMetaData animmetadata)
Parameters
animmetadata
AnimationMetaData