Crazy, super-hack AO replacement. It's actually pretty good, but requires a lot of tweaks and fixes. Need to talk to the creator of the original code to see if they can shed light on stuff.
Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
@@ -42,6 +42,8 @@ std::list<std::string> LLAO::mMediumLandOverrides;
|
||||
std::list<std::string> LLAO::mHardLandOverrides;
|
||||
std::list<std::string> LLAO::mSlowFlyOverrides;
|
||||
std::list<std::string> LLAO::mGroundSitOverrides;
|
||||
LLSD LLAO::mAnimationOverrides;
|
||||
S32 LLAO::mAnimationIndex;
|
||||
|
||||
std::map<LLUUID,LLUUID> LLAO::mOverrides;
|
||||
LLFloaterAO* LLFloaterAO::sInstance;
|
||||
@@ -70,6 +72,21 @@ private:
|
||||
std::string sName;
|
||||
};
|
||||
|
||||
const LLUUID& LLAO::getAssetIDByName(const std::string& name)
|
||||
{
|
||||
if (name.empty()) return LLUUID::null;
|
||||
|
||||
LLViewerInventoryCategory::cat_array_t cats;
|
||||
LLViewerInventoryItem::item_array_t items;
|
||||
ObjectNameMatches objectnamematches(name);
|
||||
gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches);
|
||||
|
||||
if (items.count())
|
||||
{
|
||||
return items[0]->getAssetUUID();
|
||||
}
|
||||
return LLUUID::null;
|
||||
};
|
||||
|
||||
LLUUID LLAO::getFrontUUID()
|
||||
{
|
||||
@@ -192,6 +209,7 @@ void LLAO::setup()
|
||||
mEnabled = gSavedSettings.getBOOL("AO.Enabled");
|
||||
mPeriod = gSavedSettings.getF32("AO.Period");
|
||||
mTimer = new LLAOStandTimer(mPeriod);
|
||||
mAnimationIndex = 0;
|
||||
gSavedSettings.getControl("AO.Enabled")->getSignal()->connect(boost::bind(&handleAOEnabledChanged, _1));
|
||||
gSavedSettings.getControl("AO.Period")->getSignal()->connect(boost::bind(&handleAOPeriodChanged, _1));
|
||||
}
|
||||
@@ -259,163 +277,38 @@ BOOL LLAO::isStand(LLUUID _id)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const LLUUID& LLAO::getAssetIDByName(const std::string& name)
|
||||
BOOL LLAO::isVoice(LLUUID _id)
|
||||
{
|
||||
if (name.empty()) return LLUUID::null;
|
||||
|
||||
LLViewerInventoryCategory::cat_array_t cats;
|
||||
LLViewerInventoryItem::item_array_t items;
|
||||
ObjectNameMatches objectnamematches(name);
|
||||
gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches);
|
||||
|
||||
if (items.count())
|
||||
{
|
||||
return items[0]->getAssetUUID();
|
||||
}
|
||||
return LLUUID::null;
|
||||
};
|
||||
std::string id = _id.asString();
|
||||
//ALL KNOWN VOICE ANIMS
|
||||
if(id == "3557510a-5eb4-d0ce-0b91-67c72aa75312") return TRUE;
|
||||
if(id == "a71890f1-0dab-8744-fd47-7defaf411dbf") return TRUE;
|
||||
if(id == "c1802201-5f4e-366f-7f78-2d08ec6ea54a") return TRUE;
|
||||
if(id == "68db359f-4c9c-0932-5f1e-e95e3a0b19bc") return TRUE;
|
||||
if(id == "7ef0d5c0-3346-06e4-5cfc-f081db108baa") return TRUE;
|
||||
if(id == "28a3f544-268d-da71-7da6-82c8dd522cb9") return TRUE;
|
||||
if(id == "cc340155-3e9d-60fe-d8e3-9e9abc7062d1") return TRUE;
|
||||
if(id == "55fe6788-8a16-d998-2f63-3c1eab2b6009") return TRUE;
|
||||
if(id == "69d5a8ed-9ec6-6dac-842f-d92d82e69428") return TRUE;
|
||||
if(id == "9a7f3201-7bbd-4f75-b762-24270536e4e3") return TRUE;
|
||||
if(id == "37694185-3107-d418-3a20-0181424e542d") return TRUE;
|
||||
if(id == "cb1139b6-e7c3-fdc7-a9c1-e21673d7a50e") return TRUE;
|
||||
if(id == "bbf194d1-a118-1312-998b-8145cec6eaff") return TRUE;
|
||||
if(id == "593e9a3d-58d8-c594-d6dd-f4b98965202e") return TRUE;
|
||||
if(id == "2b78c24a-2451-6135-fc49-ad274552bb68") return TRUE;
|
||||
if(id == "0f645c60-3151-2805-b6f7-28e710ed22ac") return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLAO::refresh()
|
||||
{
|
||||
mOverrides.clear();
|
||||
mStandOverrides.clear();
|
||||
mWalkOverrides.clear();
|
||||
mRunOverrides.clear();
|
||||
mCrouchwalkOverrides.clear();
|
||||
mFlyOverrides.clear();
|
||||
mTurnLeftOverrides.clear();
|
||||
mTurnRightOverrides.clear();
|
||||
mJumpOverrides.clear();
|
||||
mFlyUpOverrides.clear();
|
||||
mFlyDownOverrides.clear();
|
||||
mCrouchOverrides.clear();
|
||||
mHoverOverrides.clear();
|
||||
mSitOverrides.clear();
|
||||
mPreJumpOverrides.clear();
|
||||
mFallOverrides.clear();
|
||||
mStrideOverrides.clear();
|
||||
mSoftLandOverrides.clear();
|
||||
mMediumLandOverrides.clear();
|
||||
mHardLandOverrides.clear();
|
||||
mSlowFlyOverrides.clear();
|
||||
mGroundSitOverrides.clear();
|
||||
mAnimationOverrides.clear();
|
||||
LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings");
|
||||
//S32 version = (S32)settings["version"].asInteger();
|
||||
LLSD overrides = settings["overrides"];
|
||||
LLSD::map_iterator sd_it = overrides.beginMap();
|
||||
LLSD::map_iterator sd_end = overrides.endMap();
|
||||
for( ; sd_it != sd_end; sd_it++)
|
||||
{
|
||||
if(sd_it->second.asString() == "" )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if(sd_it->first == "stands")
|
||||
{
|
||||
for(LLSD::array_iterator itr = sd_it->second.beginArray();
|
||||
itr != sd_it->second.endArray(); ++itr)
|
||||
{
|
||||
//list of listness
|
||||
if(itr->asString() != "")
|
||||
mStandOverrides.push_back(itr->asString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::list<std::string>* LLAO::getOverrideList(const std::string name)
|
||||
{
|
||||
std::list<std::string> *anim_list;
|
||||
if (name == "Stand")
|
||||
anim_list = &mStandOverrides;
|
||||
else if (name == "Walk")
|
||||
anim_list = &mWalkOverrides;
|
||||
else if (name == "Run")
|
||||
anim_list = &mRunOverrides;
|
||||
else if (name == "Crouchwalk")
|
||||
anim_list = &mCrouchwalkOverrides;
|
||||
else if (name == "Fly")
|
||||
anim_list = &mFlyOverrides;
|
||||
else if (name == "TurnLeft")
|
||||
anim_list = &mTurnLeftOverrides;
|
||||
else if (name == "TurnRight")
|
||||
anim_list = &mTurnRightOverrides;
|
||||
else if (name == "Jump")
|
||||
anim_list = &mJumpOverrides;
|
||||
else if (name == "FlyUp")
|
||||
anim_list = &mFlyUpOverrides;
|
||||
else if (name == "FlyDown")
|
||||
anim_list = &mFlyDownOverrides;
|
||||
else if (name == "Crouch")
|
||||
anim_list = &mCrouchOverrides;
|
||||
else if (name == "Hover")
|
||||
anim_list = &mHoverOverrides;
|
||||
else if (name == "Sit")
|
||||
anim_list = &mSitOverrides;
|
||||
else if (name == "PreJump")
|
||||
anim_list = &mPreJumpOverrides;
|
||||
else if (name == "Fall")
|
||||
anim_list = &mFallOverrides;
|
||||
else if (name == "Stride")
|
||||
anim_list = &mStrideOverrides;
|
||||
else if (name == "SoftLand")
|
||||
anim_list = &mSoftLandOverrides;
|
||||
else if (name == "MediumLand")
|
||||
anim_list = &mMediumLandOverrides;
|
||||
else if (name == "HardLand")
|
||||
anim_list = &mHardLandOverrides;
|
||||
else if (name == "SlowFly")
|
||||
anim_list = &mSlowFlyOverrides;
|
||||
else
|
||||
anim_list = &mGroundSitOverrides;
|
||||
return anim_list;
|
||||
}
|
||||
|
||||
void LLAO::pushTo(std::string name, std::string value)
|
||||
{
|
||||
if (name == "Stand")
|
||||
mStandOverrides.push_back(value);
|
||||
else if (name == "Walk")
|
||||
mWalkOverrides.push_back(value);
|
||||
else if (name == "Run")
|
||||
mRunOverrides.push_back(value);
|
||||
else if (name == "Crouchwalk")
|
||||
mCrouchwalkOverrides.push_back(value);
|
||||
else if (name == "Fly")
|
||||
mFlyOverrides.push_back(value);
|
||||
else if (name == "TurnLeft")
|
||||
mTurnLeftOverrides.push_back(value);
|
||||
else if (name == "TurnRight")
|
||||
mTurnRightOverrides.push_back(value);
|
||||
else if (name == "Jump")
|
||||
mJumpOverrides.push_back(value);
|
||||
else if (name == "FlyUp")
|
||||
mFlyUpOverrides.push_back(value);
|
||||
else if (name == "FlyDown")
|
||||
mFlyDownOverrides.push_back(value);
|
||||
else if (name == "Crouch")
|
||||
mCrouchOverrides.push_back(value);
|
||||
else if (name == "Hover")
|
||||
mHoverOverrides.push_back(value);
|
||||
else if (name == "Sit")
|
||||
mSitOverrides.push_back(value);
|
||||
else if (name == "PreJump")
|
||||
mPreJumpOverrides.push_back(value);
|
||||
else if (name == "Fall")
|
||||
mFallOverrides.push_back(value);
|
||||
else if (name == "Stride")
|
||||
mStrideOverrides.push_back(value);
|
||||
else if (name == "SoftLand")
|
||||
mSoftLandOverrides.push_back(value);
|
||||
else if (name == "MediumLand")
|
||||
mMediumLandOverrides.push_back(value);
|
||||
else if (name == "HardLand")
|
||||
mHardLandOverrides.push_back(value);
|
||||
else if (name == "SlowFly")
|
||||
mSlowFlyOverrides.push_back(value);
|
||||
else
|
||||
mGroundSitOverrides.push_back(value);
|
||||
mAnimationOverrides = settings["overrides"];
|
||||
llinfos << "Stand count: " << mAnimationOverrides["Stands"].size() << llendl;
|
||||
}
|
||||
|
||||
//static ------------- Floater
|
||||
@@ -450,37 +343,43 @@ BOOL LLFloaterAO::postBuild(void)
|
||||
combo = getChild<LLComboBox>( "combo_anim_type");
|
||||
combo->setCommitCallback(onCommitType);
|
||||
combo->setCallbackUserData(this);
|
||||
combo->selectFirstItem();
|
||||
mAnimTypeCombo = combo;
|
||||
mCurrentAnimType = mAnimTypeCombo->getValue();
|
||||
|
||||
combo = getChild<LLComboBox>( "combo_anim_list");
|
||||
mAnimListCombo = combo;
|
||||
childSetAction("combo_anim_add", onClickAnimAdd, this);
|
||||
childSetAction("combo_anim_delete", onClickAnimRemove, this);
|
||||
|
||||
list = getChild<LLScrollListCtrl>("combo_anim_list");
|
||||
list = getChild<LLScrollListCtrl>("active_anim_list");
|
||||
mAnimationList = list;
|
||||
|
||||
addAnimations();
|
||||
|
||||
refresh();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLFloaterAO::refresh()
|
||||
{
|
||||
std::list<std::string> *animation_list = LLAO::getOverrideList(mCurrentAnimType);
|
||||
llinfos << "Refreshed, building animation list for " << mCurrentAnimType << ", Count:" << animation_list->size() << llendl;
|
||||
for(std::list<std::string>::iterator itr = animation_list->begin();itr != animation_list->end();
|
||||
itr++)
|
||||
mAnimationList->deleteAllItems();
|
||||
S32 count = LLAO::mAnimationOverrides[mCurrentAnimType].size();
|
||||
llinfos << "Refreshed, building animation list for " << mCurrentAnimType << ", Count:" << count << llendl;
|
||||
int i;
|
||||
for(i = 0; i < count; i++)
|
||||
{
|
||||
llinfos << "Adding " << itr->c_str() << llendl;
|
||||
mAnimationList->addElement((*itr), ADD_BOTTOM);
|
||||
std::string name = LLAO::mAnimationOverrides[mCurrentAnimType][i].asString();
|
||||
llinfos << "Adding " << name << llendl;
|
||||
mAnimationList->addSimpleElement(name, ADD_BOTTOM);
|
||||
}
|
||||
}
|
||||
// static
|
||||
void LLFloaterAO::onCommitType(LLUICtrl* ctrl, void* user_data)
|
||||
{
|
||||
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
floater->mCurrentAnimType = floater->mAnimTypeCombo->getSimple();
|
||||
floater->mCurrentAnimType = floater->mAnimTypeCombo->getValue();
|
||||
floater->refresh();
|
||||
}
|
||||
|
||||
@@ -491,11 +390,14 @@ void LLFloaterAO::addAnimations()
|
||||
std::string none_text = getString("none_text");
|
||||
mAnimListCombo->add(none_text, LLUUID::null);
|
||||
|
||||
// Add all the default (legacy) animations
|
||||
S32 i;
|
||||
|
||||
// Get all inventory items that are animations
|
||||
LLViewerInventoryCategory::cat_array_t cats;
|
||||
LLViewerInventoryItem::item_array_t items;
|
||||
LLIsTypeWithPermissions is_copyable_animation(LLAssetType::AT_ANIMATION,
|
||||
PERM_ITEM_UNRESTRICTED,
|
||||
PERM_NONE,
|
||||
gAgent.getID(),
|
||||
gAgent.getGroupID());
|
||||
gInventory.collectDescendentsIf(gAgent.getInventoryRootID(),
|
||||
@@ -521,57 +423,17 @@ void LLFloaterAO::addAnimations()
|
||||
for (it = animations.begin(); it != animations.end(); ++it)
|
||||
{
|
||||
LLInventoryItem* item = *it;
|
||||
llinfos << "Adding " << item->getName() << " to animation list." << llendl;
|
||||
mAnimListCombo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM);
|
||||
}
|
||||
}
|
||||
|
||||
void generateAnimationSet(std::string name, std::list<std::string> anim_list, LLSD& overrides)
|
||||
{
|
||||
for(std::list<std::string>::iterator itr = anim_list.begin();
|
||||
itr != anim_list.end();
|
||||
itr++)
|
||||
{
|
||||
overrides[name].append((*itr));
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data)
|
||||
{
|
||||
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
//LLUUID animid(getAssetIDByName(stranim)); ------------------------------------------- IMPORTANT FOR LATER
|
||||
|
||||
/*if (!(animid.notNull()))
|
||||
{
|
||||
cmdline_printchat(llformat("Warning: animation '%s' could not be found (Section: %s).",stranim.c_str(),strtoken.c_str()));
|
||||
}*/
|
||||
LLSD overrides;
|
||||
generateAnimationSet("stands", LLAO::mStandOverrides, overrides);
|
||||
generateAnimationSet("walks", LLAO::mWalkOverrides, overrides);
|
||||
generateAnimationSet("runs", LLAO::mRunOverrides, overrides);
|
||||
generateAnimationSet("crouchwalks", LLAO::mCrouchwalkOverrides, overrides);
|
||||
generateAnimationSet("flies", LLAO::mFlyOverrides, overrides);
|
||||
generateAnimationSet("turnlefts", LLAO::mTurnLeftOverrides, overrides);
|
||||
generateAnimationSet("turnrights", LLAO::mTurnRightOverrides, overrides);
|
||||
generateAnimationSet("jumps", LLAO::mJumpOverrides, overrides);
|
||||
generateAnimationSet("flyups", LLAO::mFlyUpOverrides, overrides);
|
||||
generateAnimationSet("flydowns", LLAO::mFlyDownOverrides, overrides);
|
||||
generateAnimationSet("crouches", LLAO::mCrouchOverrides, overrides);
|
||||
generateAnimationSet("hovers", LLAO::mHoverOverrides, overrides);
|
||||
generateAnimationSet("sits", LLAO::mSitOverrides, overrides);
|
||||
generateAnimationSet("prejumps", LLAO::mPreJumpOverrides, overrides);
|
||||
generateAnimationSet("falls", LLAO::mFallOverrides, overrides);
|
||||
generateAnimationSet("strides", LLAO::mStrideOverrides, overrides);
|
||||
generateAnimationSet("softlands", LLAO::mSoftLandOverrides, overrides);
|
||||
generateAnimationSet("mediumlands", LLAO::mMediumLandOverrides, overrides);
|
||||
generateAnimationSet("hardlands", LLAO::mHardLandOverrides, overrides);
|
||||
generateAnimationSet("slowflies", LLAO::mSlowFlyOverrides, overrides);
|
||||
generateAnimationSet("groundsits", LLAO::mGroundSitOverrides, overrides);
|
||||
|
||||
LLSD settings;
|
||||
settings["version"] = 2;
|
||||
settings["overrides"] = overrides;
|
||||
settings["overrides"] = LLAO::mAnimationOverrides;
|
||||
gSavedPerAccountSettings.setLLSD("AO.Settings", settings);
|
||||
LLAO::refresh();
|
||||
floater->refresh();
|
||||
@@ -588,44 +450,46 @@ void LLFloaterAO::onClickAnimRemove(void* user_data)
|
||||
LLScrollListItem* item = *iter;
|
||||
if (item->getValue().asString() != "")
|
||||
{
|
||||
//avatar_names.push_back(item->getColumn(0)->getValue().asString());
|
||||
//avatar_ids.push_back(item->getUUID());
|
||||
std::string anim_name = item->getValue().asString();
|
||||
S32 count = LLAO::mAnimationOverrides[floater->mCurrentAnimType].size();
|
||||
S32 index;
|
||||
LLSD new_list;
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
if (LLAO::mAnimationOverrides[floater->mCurrentAnimType][index].isDefined())
|
||||
{
|
||||
std::string this_anim = LLAO::mAnimationOverrides[floater->mCurrentAnimType][index].asString();
|
||||
if (this_anim != anim_name)
|
||||
{
|
||||
new_list.append(this_anim);
|
||||
}
|
||||
}
|
||||
}
|
||||
LLAO::mAnimationOverrides[floater->mCurrentAnimType] = new_list;
|
||||
}
|
||||
}
|
||||
/*std::list<std::string>::iterator itr = std::find(LLAO::mStandOverrides.begin(),LLAO::mStandOverrides.end(),id);
|
||||
LLVOAvatar* avatarp = gAgent.getAvatarObject();
|
||||
if(id.notNull() && itr != LLAO::mStandOverrides.end())
|
||||
{
|
||||
//back is always last played, front is next
|
||||
avatarp->stopMotion(id);
|
||||
LLAO::mStandOverrides.erase(itr);
|
||||
avatarp->startMotion(LLAO::mStandOverrides.front());
|
||||
LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front());
|
||||
LLAO::mStandOverrides.pop_front();
|
||||
|
||||
floater->refresh();
|
||||
LLAO::mTimer->reset();
|
||||
}
|
||||
onCommitAnim(NULL,user_data);*/
|
||||
onCommitAnim(NULL,user_data);
|
||||
}
|
||||
//static
|
||||
void LLFloaterAO::onClickAnimAdd(void* user_data)
|
||||
{
|
||||
LLFloaterAO* floater = (LLFloaterAO*)user_data;
|
||||
std::string anim_name = floater->mAnimListCombo->getSimple();
|
||||
if (anim_name == "")
|
||||
return;
|
||||
LLUUID id(LLAO::getAssetIDByName(anim_name));
|
||||
std::list<std::string>* animation_list = LLAO::getOverrideList(floater->mCurrentAnimType);
|
||||
std::list<std::string>::iterator itr = std::find(animation_list->begin(),
|
||||
animation_list->end(),
|
||||
anim_name);
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Attempting to add " << anim_name << " (" << id << ") " << " to " << floater->mCurrentAnimType << llendl;
|
||||
#endif
|
||||
if(id.notNull() && (itr == animation_list->end()))
|
||||
if(id.notNull() && !LLAO::mAnimationOverrides[floater->mCurrentAnimType].has(anim_name))
|
||||
{
|
||||
llinfos << "Actually adding animation, this should be refreshed. Count:" << animation_list->size() << llendl;
|
||||
LLAO::pushTo(floater->mCurrentAnimType, anim_name);
|
||||
llinfos << "Added animation. Count:" << animation_list->size() << llendl;
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Actually adding animation, this should be refreshed. Count:" << LLAO::mAnimationOverrides[floater->mCurrentAnimType].size() << llendl;
|
||||
#endif
|
||||
LLAO::mAnimationOverrides[floater->mCurrentAnimType].append(anim_name);
|
||||
#ifdef AO_DEBUG
|
||||
llinfos << "Added animation. Count:" << LLAO::mAnimationOverrides[floater->mCurrentAnimType].size() << llendl;
|
||||
#endif
|
||||
LLAO::mTimer->reset();
|
||||
}
|
||||
onCommitAnim(NULL,user_data);
|
||||
|
||||
@@ -27,36 +27,18 @@ public:
|
||||
static void setup();
|
||||
static std::map<LLUUID,LLUUID> mOverrides;
|
||||
static std::list<std::string> mStandOverrides;
|
||||
static std::list<std::string> mWalkOverrides;
|
||||
static std::list<std::string> mRunOverrides;
|
||||
static std::list<std::string> mCrouchwalkOverrides;
|
||||
static std::list<std::string> mFlyOverrides;
|
||||
static std::list<std::string> mTurnLeftOverrides;
|
||||
static std::list<std::string> mTurnRightOverrides;
|
||||
static std::list<std::string> mJumpOverrides;
|
||||
static std::list<std::string> mFlyUpOverrides;
|
||||
static std::list<std::string> mFlyDownOverrides;
|
||||
static std::list<std::string> mCrouchOverrides;
|
||||
static std::list<std::string> mHoverOverrides;
|
||||
static std::list<std::string> mSitOverrides;
|
||||
static std::list<std::string> mPreJumpOverrides;
|
||||
static std::list<std::string> mFallOverrides;
|
||||
static std::list<std::string> mStrideOverrides;
|
||||
static std::list<std::string> mSoftLandOverrides;
|
||||
static std::list<std::string> mMediumLandOverrides;
|
||||
static std::list<std::string> mHardLandOverrides;
|
||||
static std::list<std::string> mSlowFlyOverrides;
|
||||
static std::list<std::string> mGroundSitOverrides;
|
||||
//Animation LLSD for full animation options -HgB
|
||||
static LLSD mAnimationOverrides;
|
||||
static S32 mAnimationIndex;
|
||||
|
||||
static BOOL isEnabled(){ return mEnabled; }
|
||||
static BOOL isStand(LLUUID _id);
|
||||
static BOOL isVoice(LLUUID _id);
|
||||
static void refresh();
|
||||
static void runAnims(BOOL enabled);
|
||||
static bool handleAOEnabledChanged(const LLSD& newvalue);
|
||||
static bool handleAOPeriodChanged(const LLSD& newvalue);
|
||||
static const LLUUID& getAssetIDByName(const std::string& name);
|
||||
static std::list<std::string>* getOverrideList(const std::string name);
|
||||
static void pushTo(std::string name, std::string value);
|
||||
static LLUUID getFrontUUID();
|
||||
static LLUUID getBackUUID();
|
||||
static LLAOStandTimer* mTimer;
|
||||
|
||||
@@ -1393,6 +1393,9 @@ bool idle_startup()
|
||||
// Overwrite default user settings with user settings
|
||||
LLAppViewer::instance()->loadSettingsFromDirectory("Account");
|
||||
|
||||
//User settings are loaded, get the AO settings - HgB
|
||||
LLAO::refresh();
|
||||
|
||||
// Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation
|
||||
// and startup time is close enough if we don't have a real value.
|
||||
if (gSavedPerAccountSettings.getU32("LastLogoff") == 0)
|
||||
@@ -1430,7 +1433,6 @@ bool idle_startup()
|
||||
LLFile::mkdir(user_windlight_days_path_name.c_str());
|
||||
|
||||
// <edit>
|
||||
LLAO::refresh();
|
||||
LLFloaterBlacklist::loadFromSave();
|
||||
// </edit>
|
||||
|
||||
|
||||
@@ -5698,13 +5698,37 @@ std::string LLVOAvatar::getIdleTime()
|
||||
BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_AVATAR);
|
||||
|
||||
// <edit>
|
||||
if(mIsSelf)
|
||||
{
|
||||
if(LLAO::isEnabled())
|
||||
{
|
||||
if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
std::string ao_id;
|
||||
if (LLAO::isStand(id))
|
||||
{
|
||||
ao_id = "Stands";
|
||||
}
|
||||
else if (LLAO::isVoice(id))
|
||||
{
|
||||
ao_id = "Voices";
|
||||
}
|
||||
else
|
||||
{
|
||||
ao_id = id.asString();
|
||||
}
|
||||
if (LLAO::mAnimationOverrides[ao_id].size() > 0)
|
||||
{
|
||||
LLAO::mAnimationIndex++;
|
||||
if (LLAO::mAnimationOverrides[ao_id].size() <= LLAO::mAnimationIndex)
|
||||
{
|
||||
LLAO::mAnimationIndex = 0;
|
||||
}
|
||||
LLUUID new_anim = LLAO::getAssetIDByName(LLAO::mAnimationOverrides[ao_id][LLAO::mAnimationIndex]);
|
||||
llinfos << "Switching to anim #" << LLAO::mAnimationIndex << ": " << LLAO::mAnimationOverrides[ao_id][LLAO::mAnimationIndex] << llendl;
|
||||
gAgent.sendAnimationRequest(new_anim, ANIM_REQUEST_START);
|
||||
startMotion(new_anim, time_offset);
|
||||
}
|
||||
/*if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
{
|
||||
// avoid infinite loops!
|
||||
if( (id != LLAO::mOverrides[id])
|
||||
@@ -5714,7 +5738,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
|
||||
gAgent.sendAnimationRequest(LLAO::mOverrides[id], ANIM_REQUEST_START);
|
||||
startMotion(LLAO::mOverrides[id], time_offset);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
// </edit>
|
||||
@@ -5777,15 +5801,35 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
|
||||
{
|
||||
if (mIsSelf)
|
||||
{
|
||||
|
||||
// <edit>
|
||||
if(LLAO::isEnabled())
|
||||
{
|
||||
if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
std::string ao_id;
|
||||
if (LLAO::isStand(id))
|
||||
{
|
||||
ao_id = "Stands";
|
||||
}
|
||||
else if (LLAO::isVoice(id))
|
||||
{
|
||||
ao_id = "Voices";
|
||||
}
|
||||
else
|
||||
{
|
||||
ao_id = id.asString();
|
||||
}
|
||||
if (LLAO::mAnimationOverrides[ao_id].size() > 0)
|
||||
{
|
||||
LLUUID new_anim = LLAO::getAssetIDByName(LLAO::mAnimationOverrides[ao_id][LLAO::mAnimationIndex]);
|
||||
gAgent.sendAnimationRequest(new_anim, ANIM_REQUEST_STOP);
|
||||
stopMotion(new_anim, stop_immediate);
|
||||
}
|
||||
/*if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end())
|
||||
&& (id != LLAO::mOverrides[id]) )
|
||||
{
|
||||
gAgent.sendAnimationRequest(LLAO::mOverrides[id], ANIM_REQUEST_STOP);
|
||||
stopMotion(LLAO::mOverrides[id], stop_immediate);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
// </edit>
|
||||
gAgent.onAnimStop(id);
|
||||
|
||||
@@ -1,80 +1,86 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
|
||||
width="305" height="590" min_width="305" min_height="400"
|
||||
width="305" height="590" min_width="275" min_height="400"
|
||||
name="AO Editor" title="AO Editor" rect_control="FloaterAORect">
|
||||
<text follows="top|left" height="15" left="10" name="text_stand1" bottom="-40">
|
||||
Action:
|
||||
</text>
|
||||
<combo_box name="combo_anim_type" max_length="36" allow_text_entry="true" follows="top||left|right" height="20" left="100" right="-7" bottom_delta="0">
|
||||
<combo_item type="string" length="1" enabled="true" name="Stand" value="Stand">
|
||||
Stand
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Walk" value="Walk">
|
||||
Walk
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Run" value="Run">
|
||||
Run
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Crouchwalk" value="Crouchwalk">
|
||||
<combo_box name="combo_anim_type" max_length="36" allow_text_entry="true" follows="top||left|right" height="20" left="75" right="-7" bottom_delta="0">
|
||||
<combo_item type="string" length="1" enabled="true" name="Crouch" value="201f3fdf-cb1f-dbec-201f-7333e328ae7c">
|
||||
Crouch
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Crouchwalk" value="47f5f6fb-22e5-ae44-f871-73aaaf4a6022">
|
||||
Crouchwalk
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Fly" value="Fly">
|
||||
Fly
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="TurnLeft" value="TurnLeft">
|
||||
Turn Left
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="TurnRight" value="TurnRight">
|
||||
Turn Right
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Jump" value="Jump">
|
||||
Jump
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="FlyUp" value="FlyUp">
|
||||
Fly Up
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="FlyDown" value="FlyDown">
|
||||
Fly Down
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Crouch" value="Crouch">
|
||||
Crouch
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Hover" value="Hover">
|
||||
Hover
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Sit" value="Sit">
|
||||
Sit
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="PreJump" value="PreJump">
|
||||
Pre-Jump
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Fall" value="Fall">
|
||||
<combo_item type="string" length="1" enabled="true" name="Fall" value="666307d9-a860-572d-6fd4-c3ab8865c094">
|
||||
Fall
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Stride" value="Stride">
|
||||
Stride
|
||||
<combo_item type="string" length="1" enabled="true" name="Fly" value="aec4610c-757f-bc4e-c092-c6e9caf18daf">
|
||||
Fly
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="SoftLand" value="SoftLand">
|
||||
<combo_item type="string" length="1" enabled="true" name="FlyDown" value="20f063ea-8306-2562-0b07-5c853b37b31e">
|
||||
Fly Down
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="FlyUp" value="62c5de58-cb33-5743-3d07-9e4cd4352864">
|
||||
Fly Up
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="GroundSit" value="1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e">
|
||||
Ground Sit
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Hover" value="4ae8016b-31b9-03bb-c401-b1ea941db41d">
|
||||
Hover
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="SoftLand" value="7a17b059-12b2-41b1-570a-186368b6aa6f">
|
||||
Land (Soft)
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="MediumLand" value="MediumLand">
|
||||
<combo_item type="string" length="1" enabled="true" name="MediumLand" value="f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57">
|
||||
Land (Medium)
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="HardLand" value="HardLand">
|
||||
<combo_item type="string" length="1" enabled="true" name="HardLand" value="3da1d753-028a-5446-24f3-9c9b856d9422">
|
||||
Land (Hard)
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="SlowFly" value="SlowFly">
|
||||
<combo_item type="string" length="1" enabled="true" name="Jump" value="2305bd75-1ca9-b03b-1faa-b176b8a8c49e">
|
||||
Jump
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="PreJump" value="7a4e87fe-de39-6fcb-6223-024b00893244">
|
||||
Pre-Jump
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Run" value="05ddbff8-aaa9-92a1-2b74-8fe77a29b445">
|
||||
Run
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Sit" value="1a5fe8ac-a804-8a5d-7cbd-56bd83184568">
|
||||
Sit
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="SlowFly" value="2b5a38b2-5e00-3a97-a495-4c826bc443e6">
|
||||
Slow Fly
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="GroundSit" value="GroundSit">
|
||||
Ground Sit
|
||||
<combo_item type="string" length="1" enabled="true" name="Stand" value="Stands">
|
||||
Stand
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Stride" value="1cb562b0-ba21-2202-efb3-30f82cdf9595">
|
||||
Stride
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="TurnLeft" value="56e0ba0d-4a9f-7f27-6117-32f2ebbf6135">
|
||||
Turn Left
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="TurnRight" value="2d6daa51-3192-6794-8e2e-a15f8338ec30">
|
||||
Turn Right
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Type" value="c541c47f-e0c0-058b-ad1a-d6ae3a4584d9">
|
||||
Typing
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Voice" value="Voices">
|
||||
Voice
|
||||
</combo_item>
|
||||
<combo_item type="string" length="1" enabled="true" name="Walk" value="6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0">
|
||||
Walk
|
||||
</combo_item>
|
||||
</combo_box>
|
||||
|
||||
<text follows="top|left" height="15" left="10" name="text_walking" bottom_delta="-25">
|
||||
Animations:
|
||||
</text>
|
||||
<combo_box name="combo_anim_list" max_length="36" allow_text_entry="true" follows="top|left|right" height="20" left="100" right="-52" bottom_delta="0">
|
||||
<combo_box name="combo_anim_list" max_length="36" allow_text_entry="true" follows="top|left|right" height="20" left="75" right="-52" bottom_delta="0">
|
||||
</combo_box>
|
||||
<button follows="top|right" bottom_delta="0" height="20" label="✔" right="-29" name="combo_anim_add" width="21" />
|
||||
<button follows="top|right" bottom_delta="0" height="20" label="X" right="-7" name="combo_anim_delete" width="21" />
|
||||
@@ -86,11 +92,10 @@
|
||||
name="active_anim_list" width="280" search_column="1"
|
||||
tool_tip="Hold shift or control while clicking to select multiple files"
|
||||
top="-68">
|
||||
<column name="file_type" width="0" />
|
||||
<column dynamicwidth="true" label="Animation" name="anim_name" tool_tip="Name of the animation." />
|
||||
</scroll_list>
|
||||
<button follows="left|bottom" bottom="7" halign="center" height="24" label="Load..."
|
||||
<button follows="right|bottom" bottom="7" halign="center" height="24" label="Load..."
|
||||
left="120" name="btn_load" width="80" />
|
||||
<button follows="left|bottom" bottom="7" halign="center" height="24" label="Save..."
|
||||
<button follows="right|bottom" bottom="7" halign="center" height="24" label="Save..."
|
||||
left_delta="90" name="btn_save" width="80" />
|
||||
</floater>
|
||||
|
||||
Reference in New Issue
Block a user