diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp
index 490fd1a12a..44daf3feba 100644
--- a/indra/newview/ao.cpp
+++ b/indra/newview/ao.cpp
@@ -35,7 +35,6 @@
#include "llnotificationsutil.h"
#include "llspinctrl.h"
#include "llviewercontrol.h"
-#include "llviewerinventory.h"
#include "utilitybar.h"
FloaterAO::FloaterAO(const LLSD& key)
@@ -51,10 +50,6 @@ FloaterAO::FloaterAO(const LLSD& key)
mEventTimer.stop();
}
-FloaterAO::~FloaterAO()
-{
-}
-
void FloaterAO::reloading(bool reload)
{
if (reload)
@@ -283,9 +278,7 @@ bool FloaterAO::postBuild()
mPreviousButtonSmall->setCommitCallback(boost::bind(&FloaterAO::onClickPrevious, this));
mNextButtonSmall->setCommitCallback(boost::bind(&FloaterAO::onClickNext, this));
-// Double click on animation in AO
mAnimationList->setDoubleClickCallback(boost::bind(&FloaterAO::onDoubleClick, this));
-//
updateSmart();
@@ -777,15 +770,14 @@ void FloaterAO::onChangeCycleTime()
void FloaterAO::onClickPrevious()
{
- AOEngine::instance().cycle(AOEngine::CyclePrevious);
+ AOEngine::instance().cycle(AOEngine::CyclePrevious, true);
}
void FloaterAO::onClickNext()
{
- AOEngine::instance().cycle(AOEngine::CycleNext);
+ AOEngine::instance().cycle(AOEngine::CycleNext, true);
}
-// Double click on animation in AO
void FloaterAO::onDoubleClick()
{
LLScrollListItem* item = mAnimationList->getFirstSelected();
@@ -817,7 +809,6 @@ void FloaterAO::onDoubleClick()
AOEngine::instance().playAnimation(*animUUID);
}
-//
void FloaterAO::onClickMore()
{
@@ -872,7 +863,6 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
if (mCurrentBoldItem)
{
-// Safer casts
if (LLScrollListCell* icon_cell = mCurrentBoldItem->getColumn(0))
{
if (LLScrollListIcon* icon = dynamic_cast(icon_cell))
@@ -888,7 +878,6 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
text->setFontStyle(LLFontGL::NORMAL);
}
}
-//
mCurrentBoldItem = nullptr;
}
@@ -898,23 +887,17 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
return;
}
-// Fix potential nullptr
if (!mAnimationList)
{
LL_WARNS("AO") << "Animation list control is null." << LL_ENDL;
return;
}
-//
-// Safer casts
// why do we have no LLScrollListCtrl::getItemByUserdata() ? -Zi
for (LLScrollListItem* item : mAnimationList->getAllData())
{
LLUUID* id = static_cast(item->getUserdata());
- // compares the LLUUID values instead of pointer values
- //if (id == &animation)
if (id && *id == animation)
- //
{
mCurrentBoldItem = item;
@@ -937,7 +920,6 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
return;
}
}
-//
}
// virtual
diff --git a/indra/newview/ao.h b/indra/newview/ao.h
index cadde5088c..df4e9eea6c 100644
--- a/indra/newview/ao.h
+++ b/indra/newview/ao.h
@@ -48,12 +48,12 @@ class FloaterAO
private:
FloaterAO(const LLSD& key);
- ~FloaterAO();
+ ~FloaterAO() = default;
public:
- /*virtual*/ bool postBuild();
- virtual void onOpen(const LLSD& key);
- virtual void onClose(bool app_quitting);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
+ void onClose(bool app_quitting) override;
void updateList();
void updateScrollListData();
void updateSetParameters();
@@ -90,10 +90,7 @@ class FloaterAO
void onClickMore();
void onClickLess();
-
-// Double click on animation in AO
void onDoubleClick();
-//
void onAnimationChanged(const LLUUID& animation);
@@ -108,7 +105,7 @@ class FloaterAO
bool newSetCallback(const LLSD& notification, const LLSD& response);
bool removeSetCallback(const LLSD& notification, const LLSD& response);
- virtual bool tick();
+ bool tick() override;
std::vector mSetList;
AOSet* mSelectedSet;
diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp
index 74c523b96a..533ebc56bd 100644
--- a/indra/newview/aoengine.cpp
+++ b/indra/newview/aoengine.cpp
@@ -151,7 +151,7 @@ void AOEngine::onPauseAO()
}
}
-void AOEngine::clear(bool from_timer)
+void AOEngine::clear(bool fromTimer)
{
std::move(mSets.begin(), mSets.end(), std::back_inserter(mOldSets));
mSets.clear();
@@ -160,7 +160,7 @@ void AOEngine::clear(bool from_timer)
// FIRE-3801; We cannot delete any AOSet object if we're called from a timer tick. AOSet is derived from LLEventTimer and destruction will
// fail in ~LLInstanceTracker when a destructor runs during iteration.
- if (!from_timer)
+ if (!fromTimer)
{
std::for_each(mOldSets.begin(), mOldSets.end(), DeletePointer());
mOldSets.clear();
@@ -222,7 +222,7 @@ void AOEngine::setLastOverriddenMotion(const LLUUID& motion)
}
}
-bool AOEngine::foreignAnimations()
+bool AOEngine::foreignAnimations() const
{
// checking foreign animations only makes sense when smart sit is enabled
if (!mCurrentSet->getSmart())
@@ -520,7 +520,7 @@ void AOEngine::setStateCycleTimer(const AOSet::AOState* state)
}
}
-const LLUUID AOEngine::override(const LLUUID& motion, bool start)
+LLUUID AOEngine::override(const LLUUID& motion, bool start)
{
LL_DEBUGS("AOEngine") << "override(" << gAnimLibrary.animationName(motion) << "," << start << ")" << LL_ENDL;
@@ -861,7 +861,7 @@ void AOEngine::cycleTimeout(const AOSet* set)
cycle(CycleAny);
}
-void AOEngine::cycle(eCycleMode cycleMode)
+void AOEngine::cycle(eCycleMode cycleMode, bool resetTimer)
{
if (!mEnabled)
{
@@ -980,9 +980,13 @@ void AOEngine::cycle(eCycleMode cycleMode)
gAgent.sendAnimationRequest(oldAnimation, ANIM_REQUEST_STOP);
gAgentAvatarp->LLCharacter::stopMotion(oldAnimation);
}
+
+ if (resetTimer)
+ {
+ mCurrentSet->resetTimer();
+ }
}
-// Double click on animation in AO
void AOEngine::playAnimation(const LLUUID& animation)
{
if (!mEnabled)
@@ -1098,6 +1102,8 @@ void AOEngine::playAnimation(const LLUUID& animation)
gAgent.sendAnimationRequest(oldAnimation, ANIM_REQUEST_STOP);
gAgentAvatarp->LLCharacter::stopMotion(oldAnimation);
}
+
+ mCurrentSet->resetTimer();
}
const AOSet* AOEngine::getCurrentSet() const
@@ -1108,7 +1114,6 @@ const AOSet::AOState* AOEngine::getCurrentState() const
{
return mCurrentSet->getStateByRemapID(mLastMotion);
}
-//
void AOEngine::updateSortOrder(AOSet::AOState* state)
{
@@ -1746,7 +1751,7 @@ void AOEngine::update()
}
}
-void AOEngine::reload(bool aFromTimer)
+void AOEngine::reload(bool fromTimer)
{
bool wasEnabled = mEnabled;
@@ -1760,7 +1765,7 @@ void AOEngine::reload(bool aFromTimer)
gAgent.stopCurrentAnimations();
mLastOverriddenMotion = ANIM_AGENT_STAND;
- clear(aFromTimer);
+ clear(fromTimer);
mAOFolder.setNull();
mTimerCollection.enableInventoryTimer(true);
tick();
@@ -1771,7 +1776,7 @@ void AOEngine::reload(bool aFromTimer)
}
}
-AOSet* AOEngine::getSetByName(const std::string& name) const
+AOSet* AOEngine::getSetByName(std::string_view name) const
{
for (auto set : mSets)
{
@@ -1819,7 +1824,7 @@ void AOEngine::selectSet(AOSet* set)
}
}
-AOSet* AOEngine::selectSetByName(const std::string& name)
+AOSet* AOEngine::selectSetByName(std::string_view name)
{
if (AOSet* set = getSetByName(name))
{
@@ -1880,9 +1885,9 @@ void AOEngine::saveSet(const AOSet* set)
mUpdatedSignal();
}
-bool AOEngine::renameSet(AOSet* set, const std::string& name)
+bool AOEngine::renameSet(AOSet* set, std::string_view name)
{
- if (name.empty() || name.find(":") != std::string::npos)
+ if (name.empty() || name.find(":") != std::string_view::npos)
{
return false;
}
diff --git a/indra/newview/aoengine.h b/indra/newview/aoengine.h
index fc5b3f3bfd..196dda4978 100644
--- a/indra/newview/aoengine.h
+++ b/indra/newview/aoengine.h
@@ -32,202 +32,191 @@
#include "llextendedstatus.h"
#include "llsingleton.h"
#include "llviewerinventory.h"
-#include
-class AOTimerCollection
-: public LLEventTimer
+class AOTimerCollection : public LLEventTimer
{
- public:
- AOTimerCollection();
- ~AOTimerCollection() = default;
+public:
+ AOTimerCollection();
+ ~AOTimerCollection() = default;
- virtual bool tick();
+ bool tick() override;
- void enableInventoryTimer(bool enable);
- void enableSettingsTimer(bool enable);
- void enableReloadTimer(bool enable);
- void enableImportTimer(bool enable);
+ void enableInventoryTimer(bool enable);
+ void enableSettingsTimer(bool enable);
+ void enableReloadTimer(bool enable);
+ void enableImportTimer(bool enable);
- protected:
- void updateTimers();
+protected:
+ void updateTimers();
- bool mInventoryTimer;
- bool mSettingsTimer;
- bool mReloadTimer;
- bool mImportTimer;
+ bool mInventoryTimer;
+ bool mSettingsTimer;
+ bool mReloadTimer;
+ bool mImportTimer;
};
// ----------------------------------------------------
-class AOSitCancelTimer
-: public LLEventTimer
+class AOSitCancelTimer : public LLEventTimer
{
- public:
- AOSitCancelTimer();
- ~AOSitCancelTimer() = default;
+public:
+ AOSitCancelTimer();
+ ~AOSitCancelTimer() = default;
- void oneShot();
- void stop();
+ void oneShot();
+ void stop();
- virtual bool tick();
+ bool tick() override;
- protected:
- S32 mTickCount;
+protected:
+ S32 mTickCount;
};
// ----------------------------------------------------
-class AOState;
-class LLInventoryItem;
-class LLVFS;
-
-class AOEngine
-: public LLSingleton
+class AOEngine : public LLSingleton
{
LLSINGLETON(AOEngine);
~AOEngine();
- public:
- enum eCycleMode
- {
- CycleAny,
- CycleNext,
- CyclePrevious
- };
+public:
+ enum eCycleMode
+ {
+ CycleAny,
+ CycleNext,
+ CyclePrevious
+ };
- void enable(bool enable);
- void enableStands(bool enable_stands);
- const LLUUID override(const LLUUID& motion, bool start);
- void tick();
- void update();
- void reload(bool);
- void reloadStateAnimations(AOSet* set, AOSet::AOState* state);
- void clear(bool from_timer);
+ void enable(bool enable);
+ void enableStands(bool enable_stands);
+ LLUUID override(const LLUUID& motion, bool start);
+ void tick();
+ void update();
+ void reload(bool fromTimer);
+ void reloadStateAnimations(AOSet* set, AOSet::AOState* state);
+ void clear(bool fromTimer);
- const LLUUID& getAOFolder() const;
+ const LLUUID& getAOFolder() const;
- void addSet(const std::string& name, inventory_func_type callback, bool reload = true);
- bool removeSet(AOSet* set);
+ void addSet(const std::string& name, inventory_func_type callback, bool reload = true);
+ bool removeSet(AOSet* set);
- void addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, bool reload = true);
- bool removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index);
- void checkSitCancel();
- void checkBelowWater(bool check_underwater);
+ void addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, bool reload = true);
+ bool removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index);
+ void checkSitCancel();
+ void checkBelowWater(bool check_underwater);
- bool importNotecard(const LLInventoryItem* item);
- void processImport(bool from_timer);
+ bool importNotecard(const LLInventoryItem* item);
+ void processImport(bool from_timer);
- bool swapWithPrevious(AOSet::AOState* state, S32 index);
- bool swapWithNext(AOSet::AOState* state, S32 index);
+ bool swapWithPrevious(AOSet::AOState* state, S32 index);
+ bool swapWithNext(AOSet::AOState* state, S32 index);
- void cycleTimeout(const AOSet* set);
- void cycle(eCycleMode cycleMode);
+ void cycleTimeout(const AOSet* set);
+ void cycle(eCycleMode cycleMode, bool resetTimer = false);
-// Double click on animation in AO
- void playAnimation(const LLUUID& animation);
- const AOSet* getCurrentSet() const;
- const AOSet::AOState* getCurrentState() const;
-//
+ void playAnimation(const LLUUID& animation);
+ const AOSet* getCurrentSet() const;
+ const AOSet::AOState* getCurrentState() const;
- void inMouselook(bool mouselook);
- void selectSet(AOSet* set);
- AOSet* selectSetByName(const std::string& name);
- AOSet* getSetByName(const std::string& name) const;
+ void inMouselook(bool mouselook);
+ void selectSet(AOSet* set);
+ AOSet* selectSetByName(std::string_view name);
+ AOSet* getSetByName(std::string_view name) const;
- // callback from LLAppViewer
- static void onLoginComplete();
+ // callback from LLAppViewer
+ static void onLoginComplete();
- const std::vector getSetList() const;
- const std::string getCurrentSetName() const;
- const AOSet* getDefaultSet() const;
- bool renameSet(AOSet* set, const std::string& name);
+ const std::vector getSetList() const;
+ const std::string getCurrentSetName() const;
+ const AOSet* getDefaultSet() const;
+ bool renameSet(AOSet* set, std::string_view name);
- void setDefaultSet(AOSet* set);
- void setOverrideSits(AOSet* set, bool override_sit);
- void setSmart(AOSet* set, bool smart);
- void setDisableMouselookStands(AOSet* set, bool disabled);
- void setCycle(AOSet::AOState* set, bool cycle);
- void setRandomize(AOSet::AOState* state, bool randomize);
- void setCycleTime(AOSet::AOState* state, F32 time);
+ void setDefaultSet(AOSet* set);
+ void setOverrideSits(AOSet* set, bool override_sit);
+ void setSmart(AOSet* set, bool smart);
+ void setDisableMouselookStands(AOSet* set, bool disabled);
+ void setCycle(AOSet::AOState* set, bool cycle);
+ void setRandomize(AOSet::AOState* state, bool randomize);
+ void setCycleTime(AOSet::AOState* state, F32 time);
- void saveSettings();
+ void saveSettings();
- typedef boost::signals2::signal updated_signal_t;
- boost::signals2::connection setReloadCallback(const updated_signal_t::slot_type& cb)
- {
- return mUpdatedSignal.connect(cb);
- };
+ typedef boost::signals2::signal updated_signal_t;
+ boost::signals2::connection setReloadCallback(const updated_signal_t::slot_type& cb)
+ {
+ return mUpdatedSignal.connect(cb);
+ };
- typedef boost::signals2::signal animation_changed_signal_t;
- boost::signals2::connection setAnimationChangedCallback(const animation_changed_signal_t::slot_type& cb)
- {
- return mAnimationChangedSignal.connect(cb);
- };
+ typedef boost::signals2::signal animation_changed_signal_t;
+ boost::signals2::connection setAnimationChangedCallback(const animation_changed_signal_t::slot_type& cb)
+ {
+ return mAnimationChangedSignal.connect(cb);
+ };
- protected:
- void init();
+protected:
+ void init();
- void setLastMotion(const LLUUID& motion);
- void setLastOverriddenMotion(const LLUUID& motion);
- void setStateCycleTimer(const AOSet::AOState* state);
+ void setLastMotion(const LLUUID& motion);
+ void setLastOverriddenMotion(const LLUUID& motion);
+ void setStateCycleTimer(const AOSet::AOState* state);
- void stopAllStandVariants();
- void stopAllSitVariants();
+ void stopAllStandVariants();
+ void stopAllSitVariants();
- bool foreignAnimations();
- AOSet::AOState* mapSwimming(const LLUUID& motion) const;
- AOSet::AOState* getStateForMotion(const LLUUID& motion) const;
+ bool foreignAnimations() const;
+ AOSet::AOState* mapSwimming(const LLUUID& motion) const;
+ AOSet::AOState* getStateForMotion(const LLUUID& motion) const;
- void updateSortOrder(AOSet::AOState* state);
- void saveSet(const AOSet* set);
- void saveState(const AOSet::AOState* state);
+ void updateSortOrder(AOSet::AOState* state);
+ void saveSet(const AOSet* set);
+ void saveState(const AOSet::AOState* state);
- bool createAnimationLink(AOSet::AOState* state, const LLInventoryItem* item);
- bool findForeignItems(const LLUUID& uuid) const;
- void purgeFolder(const LLUUID& uuid) const;
+ bool createAnimationLink(AOSet::AOState* state, const LLInventoryItem* item);
+ bool findForeignItems(const LLUUID& uuid) const;
+ void purgeFolder(const LLUUID& uuid) const;
- void onRegionChange();
+ void onRegionChange();
- void onToggleAOControl();
- void onToggleAOStandsControl();
- void onPauseAO();
+ void onToggleAOControl();
+ void onToggleAOStandsControl();
+ void onPauseAO();
- static void onNotecardLoadComplete(const LLUUID& assetUUID, LLAssetType::EType type,
- void* userdata, S32 status, LLExtStat extStatus);
- void parseNotecard(const char* buffer);
+ static void onNotecardLoadComplete(const LLUUID& assetUUID, LLAssetType::EType type, void* userdata, S32 status, LLExtStat extStatus);
+ void parseNotecard(const char* buffer);
- void updatePersistedStateAnimations();
+ void updatePersistedStateAnimations();
- updated_signal_t mUpdatedSignal;
- animation_changed_signal_t mAnimationChangedSignal;
+ updated_signal_t mUpdatedSignal;
+ animation_changed_signal_t mAnimationChangedSignal;
- AOTimerCollection mTimerCollection;
- AOSitCancelTimer mSitCancelTimer;
+ AOTimerCollection mTimerCollection;
+ AOSitCancelTimer mSitCancelTimer;
- bool mEnabled;
- bool mEnabledStands;
- bool mInMouselook;
- bool mUnderWater;
+ bool mEnabled;
+ bool mEnabledStands;
+ bool mInMouselook;
+ bool mUnderWater;
- LLUUID mAOFolder;
- LLUUID mLastMotion;
- LLUUID mLastOverriddenMotion;
- LLUUID mTransitionId;
+ LLUUID mAOFolder;
+ LLUUID mLastMotion;
+ LLUUID mLastOverriddenMotion;
+ LLUUID mTransitionId;
- // this motion will be ignored once in the overrider when stopping, fixes a case
- // where the AO doesn't correctly start up on login or when getting enabled manually
- LLUUID mIgnoreMotionStopOnce;
+ // this motion will be ignored once in the overrider when stopping, fixes a case
+ // where the AO doesn't correctly start up on login or when getting enabled manually
+ LLUUID mIgnoreMotionStopOnce;
- std::vector mSets;
- std::vector mOldSets;
- AOSet* mCurrentSet;
- AOSet* mDefaultSet;
+ std::vector mSets;
+ std::vector mOldSets;
+ AOSet* mCurrentSet;
+ AOSet* mDefaultSet;
- AOSet* mImportSet;
- std::vector mOldImportSets;
- S32 mImportRetryCount;
+ AOSet* mImportSet;
+ std::vector mOldImportSets;
+ S32 mImportRetryCount;
- boost::signals2::connection mRegionChangeConnection;
+ boost::signals2::connection mRegionChangeConnection;
};
#endif // AOENGINE_H
diff --git a/indra/newview/aoset.cpp b/indra/newview/aoset.cpp
index d44f9cd848..7201efa6d2 100644
--- a/indra/newview/aoset.cpp
+++ b/indra/newview/aoset.cpp
@@ -29,7 +29,7 @@
#include "llanimationstates.h"
#include "llinventorymodel.h"
-AOSet::AOSet(const LLUUID inventoryID)
+AOSet::AOSet(const LLUUID& inventoryID)
: LLEventTimer(10000.0f),
mInventoryID(inventoryID),
mName("** New AO Set **"),
@@ -232,6 +232,12 @@ void AOSet::stopTimer()
mEventTimer.stop();
}
+void AOSet::resetTimer()
+{
+ LL_DEBUGS("AOEngine") << "Resetting timer for " << getName() << "." << LL_ENDL;
+ mEventTimer.reset();
+}
+
bool AOSet::tick()
{
AOEngine::instance().cycleTimeout(this);
@@ -253,7 +259,7 @@ const std::string& AOSet::getName() const
return mName;
}
-void AOSet::setName(const std::string& name)
+void AOSet::setName(std::string_view name)
{
mName = name;
}
diff --git a/indra/newview/aoset.h b/indra/newview/aoset.h
index 2da7339b2b..d6df88d334 100644
--- a/indra/newview/aoset.h
+++ b/indra/newview/aoset.h
@@ -29,117 +29,117 @@
class LLInventoryItem;
-class AOSet
-: public LLEventTimer
+class AOSet : public LLEventTimer
{
- public:
- AOSet(const LLUUID inventoryID);
- ~AOSet();
+public:
+ AOSet(const LLUUID& inventoryID);
+ ~AOSet();
- // keep number and order in sync with list of names in the constructor
- enum
- {
- Start = 0, // convenience, so we don't have to know the name of the first state
- Standing = 0,
- Walking,
- Running,
- Sitting,
- SittingOnGround,
- Crouching,
- CrouchWalking,
- Landing,
- SoftLanding,
- StandingUp,
- Falling,
- FlyingDown,
- FlyingUp,
- Flying,
- FlyingSlow,
- Hovering,
- Jumping,
- PreJumping,
- TurningRight,
- TurningLeft,
- Typing,
- Floating,
- SwimmingForward,
- SwimmingUp,
- SwimmingDown,
- AOSTATES_MAX
- };
-
- struct AOAnimation
- {
- std::string mName;
- LLUUID mAssetUUID;
- LLUUID mInventoryUUID;
- LLUUID mOriginalUUID;
- S32 mSortOrder;
- };
-
- struct AOState
- {
- std::string mName;
- std::vector mAlternateNames;
- std::vector mAddQueue;
- LLUUID mRemapID;
- bool mCycle;
- bool mRandom;
- F32 mCycleTime;
- std::vector mAnimations;
- U32 mCurrentAnimation;
- LLUUID mCurrentAnimationID;
- LLUUID mInventoryUUID;
- bool mDirty;
- };
-
- const LLUUID& getInventoryUUID() const;
- void setInventoryUUID(const LLUUID& inventoryID);
-
- const std::string& getName() const;
- void setName(const std::string& name);
-
- bool getSitOverride() const;
- void setSitOverride(bool override_sit);
-
- bool getSmart() const;
- void setSmart(bool smart);
-
- bool getMouselookStandDisable() const;
- void setMouselookStandDisable(bool disable);
-
- bool getComplete() const;
- void setComplete(bool complete);
-
- const LLUUID& getMotion() const;
- void setMotion(const LLUUID& motion);
-
- bool getDirty() const;
- void setDirty(bool dirty);
-
- AOState* getState(S32 eName);
- AOState* getStateByName(const std::string& name);
- AOState* getStateByRemapID(const LLUUID& id);
- const LLUUID& getAnimationForState(AOState* state) const;
-
- void startTimer(F32 timeout);
- void stopTimer();
- bool tick() override;
-
- std::vector mStateNames;
-
- protected:
- LLUUID mInventoryID;
+ // keep number and order in sync with list of names in the constructor
+ enum
+ {
+ Start = 0, // convenience, so we don't have to know the name of the first state
+ Standing = 0,
+ Walking,
+ Running,
+ Sitting,
+ SittingOnGround,
+ Crouching,
+ CrouchWalking,
+ Landing,
+ SoftLanding,
+ StandingUp,
+ Falling,
+ FlyingDown,
+ FlyingUp,
+ Flying,
+ FlyingSlow,
+ Hovering,
+ Jumping,
+ PreJumping,
+ TurningRight,
+ TurningLeft,
+ Typing,
+ Floating,
+ SwimmingForward,
+ SwimmingUp,
+ SwimmingDown,
+ AOSTATES_MAX
+ };
+ struct AOAnimation
+ {
std::string mName;
- bool mSitOverride;
- bool mSmart;
- bool mMouselookStandDisable;
- bool mComplete;
- LLUUID mCurrentMotion;
- bool mDirty;
+ LLUUID mAssetUUID;
+ LLUUID mInventoryUUID;
+ LLUUID mOriginalUUID;
+ S32 mSortOrder;
+ };
- AOState mStates[AOSTATES_MAX];
+ struct AOState
+ {
+ std::string mName;
+ std::vector mAlternateNames;
+ std::vector mAddQueue;
+ LLUUID mRemapID;
+ bool mCycle;
+ bool mRandom;
+ F32 mCycleTime;
+ std::vector mAnimations;
+ U32 mCurrentAnimation;
+ LLUUID mCurrentAnimationID;
+ LLUUID mInventoryUUID;
+ bool mDirty;
+ };
+
+ const LLUUID& getInventoryUUID() const;
+ void setInventoryUUID(const LLUUID& inventoryID);
+
+ const std::string& getName() const;
+ void setName(std::string_view name);
+
+ bool getSitOverride() const;
+ void setSitOverride(bool override_sit);
+
+ bool getSmart() const;
+ void setSmart(bool smart);
+
+ bool getMouselookStandDisable() const;
+ void setMouselookStandDisable(bool disable);
+
+ bool getComplete() const;
+ void setComplete(bool complete);
+
+ const LLUUID& getMotion() const;
+ void setMotion(const LLUUID& motion);
+
+ bool getDirty() const;
+ void setDirty(bool dirty);
+
+ AOState* getState(S32 eName);
+ AOState* getStateByName(const std::string& name);
+ AOState* getStateByRemapID(const LLUUID& id);
+ const LLUUID& getAnimationForState(AOState* state) const;
+
+ void startTimer(F32 timeout);
+ void stopTimer();
+ void resetTimer();
+ bool tick() override;
+
+ std::vector mStateNames;
+
+protected:
+ LLUUID mInventoryID;
+
+ std::string mName;
+ bool mSitOverride;
+ bool mSmart;
+ bool mMouselookStandDisable;
+ bool mComplete;
+ LLUUID mCurrentMotion;
+ bool mDirty;
+
+ AOState mStates[AOSTATES_MAX];
};
#endif // AOSET_H