1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Repeatable emote animations...

... It's multistage majick!
This commit is contained in:
2014-01-19 19:35:38 -05:00
parent 69e6381736
commit f9a72e1a8f
5 changed files with 49 additions and 61 deletions

View File

@ -1831,35 +1831,10 @@ bool cyAvatar::ExitPBMode()
//
// PURPOSE : Makes the avatar enter a custom anim loop.
//
void cyAvatar::EnterAnimMode(plString animName)
bool cyAvatar::EnterAnimMode(const plString& animName)
{
plArmatureMod *fAvMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
if (!fAvMod->FindAnimInstance(animName)) {
plKey avKey = fAvMod->GetKey();
plAvAnimTask *animTask = new plAvAnimTask(animName, 0.0, 1.0, 1.0, 0.0, true, true, true);
plAvTaskMsg *taskMsg = new plAvTaskMsg(avKey, avKey, animTask);
taskMsg->SetBCastFlag(plMessage::kNetPropagate);
taskMsg->Send();
}
}
/////////////////////////////////////////////////////////////////////////////
//
// Function : ExitAnimMode
// PARAMETERS : animName - string
//
// PURPOSE : Makes the avatar stop the custom anim loop.
//
void cyAvatar::ExitAnimMode(plString animName)
{
plArmatureMod *fAvMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
if (fAvMod->FindAnimInstance(animName)) {
plKey avKey = fAvMod->GetKey();
plAvAnimTask *animTask = new plAvAnimTask(animName, -1.0);
plAvTaskMsg *taskMsg = new plAvTaskMsg(avKey, avKey, animTask);
taskMsg->SetBCastFlag(plMessage::kNetPropagate);
taskMsg->Send();
}
plArmatureMod* fAvMod = plAvatarMgr::GetInstance()->GetLocalAvatar();
return PushRepeatEmote(fAvMod, animName);
}

View File

@ -520,17 +520,8 @@ public:
//
// PURPOSE : Makes the avatar enter a custom anim loop.
//
static void EnterAnimMode(plString animName);
static bool EnterAnimMode(const plString& animName);
/////////////////////////////////////////////////////////////////////////////
//
// Function : ExitAnimMode
// PARAMETERS : animName - string
//
// PURPOSE : Makes the avatar stop the custom anim loop.
//
static void ExitAnimMode(plString animName);
/////////////////////////////////////////////////////////////////////////////
//
// Function : GetCurrentMode()

View File

@ -801,28 +801,15 @@ PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtAvatarExitAFK, "Tells the local avatar
PYTHON_GLOBAL_METHOD_DEFINITION(PtAvatarEnterAnimMode, args, "Params: animName\nEnter a custom anim loop (netpropagated)")
{
char* animName;
if (!PyArg_ParseTuple(args, "s", &animName))
PyObject* animNameObj;
if (!PyArg_ParseTuple(args, "O", &animNameObj) || !PyString_CheckEx(animNameObj))
{
PyErr_SetString(PyExc_TypeError, "PtAvatarEnterAnimMode expects a string");
PYTHON_RETURN_ERROR;
}
cyAvatar::EnterAnimMode(animName);
PYTHON_RETURN_NONE;
}
PYTHON_GLOBAL_METHOD_DEFINITION(PtAvatarExitAnimMode, args, "Params: animName\nExit a custom anim loop (netpropagated)")
{
char* animName;
if (!PyArg_ParseTuple(args, "s", &animName))
{
PyErr_SetString(PyExc_TypeError, "PtAvatarExitAnimMode expects a string");
PYTHON_RETURN_ERROR;
}
cyAvatar::ExitAnimMode(animName);
PYTHON_RETURN_NONE;
plString animName = PyString_AsStringEx(animNameObj);
PYTHON_RETURN_BOOL(cyAvatar::EnterAnimMode(animName));
}
PYTHON_BASIC_GLOBAL_METHOD_DEFINITION(PtDisableMovementKeys, cyAvatar::DisableMovementControls, "Disable avatar movement input")
@ -919,7 +906,6 @@ void cyAvatar::AddPlasmaMethods(std::vector<PyMethodDef> &methods)
PYTHON_GLOBAL_METHOD_NOARGS(methods, PtAvatarEnterAFK);
PYTHON_GLOBAL_METHOD_NOARGS(methods, PtAvatarExitAFK);
PYTHON_GLOBAL_METHOD(methods, PtAvatarEnterAnimMode);
PYTHON_GLOBAL_METHOD(methods, PtAvatarExitAnimMode);
// Suspend avatar input
PYTHON_BASIC_GLOBAL_METHOD(methods, PtDisableMovementKeys);