mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-13 23:09:40 +00:00
Keep track of the animation group currently playing
This commit is contained in:
parent
4dd01b81c6
commit
afbc9f3e41
2 changed files with 9 additions and 4 deletions
|
@ -41,10 +41,12 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
||||||
switch(mState)
|
switch(mState)
|
||||||
{
|
{
|
||||||
case CharState_Idle:
|
case CharState_Idle:
|
||||||
mAnimation->playGroup("idle", 1, 1);
|
mCurrentGroup = "idle";
|
||||||
|
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||||
break;
|
break;
|
||||||
case CharState_Dead:
|
case CharState_Dead:
|
||||||
mAnimation->playGroup("death1", 1, 1);
|
mCurrentGroup = "death1";
|
||||||
|
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,10 +102,12 @@ void CharacterController::setState(CharacterState state)
|
||||||
switch(mState)
|
switch(mState)
|
||||||
{
|
{
|
||||||
case CharState_Idle:
|
case CharState_Idle:
|
||||||
mAnimation->playGroup("idle", 1, 1);
|
mCurrentGroup = "idle";
|
||||||
|
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||||
break;
|
break;
|
||||||
case CharState_Dead:
|
case CharState_Dead:
|
||||||
mAnimation->playGroup("death1", 1, 1);
|
mCurrentGroup = "death1";
|
||||||
|
mAnimation->playGroup(mCurrentGroup, 1, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ class CharacterController
|
||||||
MWWorld::Ptr mPtr;
|
MWWorld::Ptr mPtr;
|
||||||
MWRender::Animation *mAnimation;
|
MWRender::Animation *mAnimation;
|
||||||
|
|
||||||
|
std::string mCurrentGroup;
|
||||||
CharacterState mState;
|
CharacterState mState;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue