Browse Source

Add customizable finish message to avatar seeking

Florian Meißner 13 years ago
parent
commit
14392883a7
  1. 9
      Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp
  2. 1
      Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.h
  3. 8
      Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp
  4. 1
      Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h

9
Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp

@ -101,7 +101,7 @@ bool plAvTaskSeek::fLogProcess = false;
void plAvTaskSeek::IInitDefaults()
{
fSeekObject = nil;
fSeekObject = nullptr;
fMovingTarget = false;
fAlign = kAlignHandle;
fAnimName = "";
@ -114,7 +114,8 @@ void plAvTaskSeek::IInitDefaults()
fMaxSidleAngle = kDefaultMaxSidleAngle;
fFlags = kSeekFlagForce3rdPersonOnStart;
fState = kSeekRunNormal;
fNotifyFinishedKey = nil;
fNotifyFinishedKey = nullptr;
fFinishMsg = nullptr;
}
// plAvTaskSeek ------------
// -------------
@ -158,6 +159,7 @@ plAvTaskSeek::plAvTaskSeek(plAvSeekMsg *msg)
fFlags &= ~kSeekFlagRotationOnly;
fNotifyFinishedKey = msg->fFinishKey;
fFinishMsg = msg->fFinishMsg;
}
// plAvTaskSeek ------------------------
@ -303,6 +305,9 @@ void plAvTaskSeek::Finish(plArmatureMod *avatar, plArmatureBrain *brain, double
//inform controller we are done seeking
if (avatar->GetController())
avatar->GetController()->SetSeek(false);
if (fFinishMsg)
fFinishMsg->Send();
}
void plAvTaskSeek::LeaveAge(plArmatureMod *avatar)

1
Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.h

@ -156,6 +156,7 @@ protected:
plString fAnimName; // an (optional) anim to use to line up our target
// so you can say "seek to a place where your hand
// will be here after you play animation foo"
plMessage* fFinishMsg;
hsPoint3 fPosition; // our current position
hsQuat fRotation; // our current rotation

8
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp

@ -174,12 +174,13 @@ void plAvTaskMsg::Write(hsStream *stream, hsResMgr *mgr)
// CTOR()
plAvSeekMsg::plAvSeekMsg()
: plAvTaskMsg(),
fSeekPoint(nil),
fSeekPoint(nullptr),
fDuration(0),
fSmartSeek(true),
fAlignType(kAlignHandle),
fNoSeek(false),
fFlags(kSeekFlagForce3rdPersonOnStart)
fFlags(kSeekFlagForce3rdPersonOnStart),
fFinishMsg(nullptr)
{
}
@ -198,7 +199,8 @@ plAvSeekMsg::plAvSeekMsg(const plKey& sender, const plKey& receiver,
fAlignType(alignType),
fNoSeek(noSeek),
fFlags(flags),
fFinishKey(finishKey)
fFinishKey(finishKey),
fFinishMsg(nullptr)
{
}

1
Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.h

@ -218,6 +218,7 @@ public:
plAvAlignment fAlignType;
uint8_t fFlags;
plKey fFinishKey;
plMessage* fFinishMsg;
};
class plAvTaskSeekDoneMsg : public plAvatarMsg

Loading…
Cancel
Save