Index: ps/trunk/source/simulation2/components/CCmpVisualActor.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpVisualActor.cpp +++ ps/trunk/source/simulation2/components/CCmpVisualActor.cpp @@ -421,6 +421,11 @@ m_Unit->SetEntitySelection(key, selection); } + virtual std::string GetAnimationName() + { + return m_AnimName; + } + virtual void SelectAnimation(const std::string& name, bool once, fixed speed, const std::wstring& soundgroup) { m_AnimRunThreshold = fixed::Zero(); Index: ps/trunk/source/simulation2/components/ICmpVisual.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpVisual.h +++ ps/trunk/source/simulation2/components/ICmpVisual.h @@ -87,6 +87,11 @@ virtual void SetVariant(const CStr& key, const CStr& selection) = 0; /** + * Returns the name of the currently played animation. + */ + virtual std::string GetAnimationName() = 0; + + /** * Start playing the given animation. If there are multiple possible animations then it will * pick one at random (not network-synchronised). * If @p soundgroup is specified, then the sound will be played at each 'event' point in the Index: ps/trunk/source/simulation2/components/ICmpVisual.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpVisual.cpp +++ ps/trunk/source/simulation2/components/ICmpVisual.cpp @@ -23,6 +23,7 @@ BEGIN_INTERFACE_WRAPPER(Visual) DEFINE_INTERFACE_METHOD_2("SetVariant", void, ICmpVisual, SetVariant, CStr, CStr) +DEFINE_INTERFACE_METHOD_0("GetAnimationName", std::string, ICmpVisual, GetAnimationName) DEFINE_INTERFACE_METHOD_4("SelectAnimation", void, ICmpVisual, SelectAnimation, std::string, bool, fixed, std::wstring) DEFINE_INTERFACE_METHOD_1("SelectMovementAnimation", void, ICmpVisual, SelectMovementAnimation, fixed) DEFINE_INTERFACE_METHOD_1("ResetMoveAnimation", void, ICmpVisual, ResetMoveAnimation, std::string)