Table of Contents

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

bool

lastActiveHeldHitAnimation

protected string lastActiveHeldHitAnimation

Field Value

string

lastActiveHeldReadyAnimation

protected string lastActiveHeldReadyAnimation

Field Value

string

lastActiveHeldUseAnimation

protected string lastActiveHeldUseAnimation

Field Value

string

lastActiveLeftHeldIdleAnimation

protected string lastActiveLeftHeldIdleAnimation

Field Value

string

lastActiveRightHeldIdleAnimation

protected string lastActiveRightHeldIdleAnimation

Field Value

string

lastRunningHeldHitAnimation

public string lastRunningHeldHitAnimation

Field Value

string

lastRunningHeldUseAnimation

public string lastRunningHeldUseAnimation

Field Value

string

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 ITreeAttribute
version string

GetAnimationState(string)

public override RunningAnimation GetAnimationState(string anim)

Parameters

anim string

Returns

RunningAnimation

HeldHitAnimChanged(string)

public bool HeldHitAnimChanged(string nowHeldRightHitAnim)

Parameters

nowHeldRightHitAnim string

Returns

bool

HeldRightReadyAnimChanged(string)

public bool HeldRightReadyAnimChanged(string nowHeldRightReadyAnim)

Parameters

nowHeldRightReadyAnim string

Returns

bool

HeldUseAnimChanged(string)

public bool HeldUseAnimChanged(string nowHeldRightUseAnim)

Parameters

nowHeldRightUseAnim string

Returns

bool

Init(ICoreAPI, Entity)

Initializes the Animation Manager.

public override void Init(ICoreAPI api, Entity entity)

Parameters

api ICoreAPI

The Core API.

entity Entity

The entity this manager is attached to.

IsAnimationActive(params string[])

public override bool IsAnimationActive(params string[] anims)

Parameters

anims string[]

Returns

bool

IsAnimationActiveOrRunning(string, float)

public bool IsAnimationActiveOrRunning(string anim, float untilProgress = 0.95)

Parameters

anim string
untilProgress float

Returns

bool

IsAnimationMostlyRunning(string, float)

protected bool IsAnimationMostlyRunning(string anim, float untilProgress = 0.95)

Parameters

anim string
untilProgress float

Returns

bool

IsAuthoritative(string)

public bool IsAuthoritative(string anim)

Parameters

anim string

Returns

bool

IsHeldHitActive(float)

public bool IsHeldHitActive(float untilProgress = 0.95)

Parameters

untilProgress float

Returns

bool

IsHeldHitAuthoritative()

public bool IsHeldHitAuthoritative()

Returns

bool

IsHeldUseActive()

public bool IsHeldUseActive()

Returns

bool

IsLeftHeldActive()

public bool IsLeftHeldActive()

Returns

bool

IsRightHeldActive()

public bool IsRightHeldActive()

Returns

bool

IsRightHeldReadyActive()

public bool IsRightHeldReadyActive()

Returns

bool

LeftHeldIdleChanged(string)

public bool LeftHeldIdleChanged(string nowHeldLeftIdleAnim)

Parameters

nowHeldLeftIdleAnim string

Returns

bool

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

prev bool
now bool

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

activeAnimations int[]
activeAnimationsCount int
activeAnimationSpeeds float[]

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

bool

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 string

Anim config code, not the animation code!

Returns

bool

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

bool

StartHeldHitAnim(string)

public void StartHeldHitAnim(string animCode)

Parameters

animCode string

StartHeldReadyAnim(string, bool)

public void StartHeldReadyAnim(string heldReadyAnim, bool force = false)

Parameters

heldReadyAnim string
force bool

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 ITreeAttribute
forClient bool

onReceivedServerAnimation(AnimationMetaData)

protected override void onReceivedServerAnimation(AnimationMetaData animmetadata)

Parameters

animmetadata AnimationMetaData