From f7109a0131daa54bafa1ef25c3463c6319a3d0ef Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Sun, 27 Feb 2011 16:32:06 +0100 Subject: [PATCH] Ripped out Inertia AO --- indra/newview/CMakeLists.txt | 2 - indra/newview/llagent.cpp | 9 +- indra/newview/llao.cpp | 574 ------------------ indra/newview/llao.h | 89 --- indra/newview/llappviewer.cpp | 5 - indra/newview/llstartup.cpp | 4 - indra/newview/llviewermenu.cpp | 9 - indra/newview/llvoavatar.cpp | 162 +---- .../skins/default/xui/en-us/floater_ao.xml | 101 --- 9 files changed, 9 insertions(+), 946 deletions(-) delete mode 100644 indra/newview/llao.cpp delete mode 100644 indra/newview/llao.h delete mode 100644 indra/newview/skins/default/xui/en-us/floater_ao.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index ad43d2263..d7ff0875e 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -93,7 +93,6 @@ set(viewer_SOURCE_FILES llagentlanguage.cpp llagentpilot.cpp llanimstatelabels.cpp - llao.cpp llappviewer.cpp llassetconverter.cpp llassetuploadresponders.cpp @@ -559,7 +558,6 @@ set(viewer_HEADER_FILES llagentlanguage.h llagentpilot.h llanimstatelabels.h - llao.h llappearance.h llappviewer.h llassetconverter.h diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 971964cdb..2f4a01543 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -139,9 +139,6 @@ #include "llviewerjoystick.h" #include "llfollowcam.h" -#include "llao.h" -#include "llfollowcam.h" - // [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3b) #include "rlvhandler.h" #include "rlvinventory.h" @@ -4995,12 +4992,8 @@ void LLAgent::requestStopMotion( LLMotion* motion ) void LLAgent::onAnimStop(const LLUUID& id) { // handle automatic state transitions (based on completion of animation playback) - if(LLAO::isStand(id)) + if (id == ANIM_AGENT_STAND) { - // - if(LLAO::isEnabled()) - LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function. - // stopFidget(); } else if (id == ANIM_AGENT_AWAY) diff --git a/indra/newview/llao.cpp b/indra/newview/llao.cpp deleted file mode 100644 index a14f6cb4a..000000000 --- a/indra/newview/llao.cpp +++ /dev/null @@ -1,574 +0,0 @@ -// -/* DOUBLE EDIT REACH AROUND -Rewritten by Hg Beeks - -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llagent.h" -#include "llanimstatelabels.h" -#include "llao.h" -#include "llfilepicker.h" -#include "llinventorymodel.h" -#include "llscrolllistctrl.h" -#include "llsdserialize.h" -#include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "llvoavatar.h" -//this is for debugging ;D -//#define AO_DEBUG - -//static variables -std::list LLAO::mStandOverrides; -LLSD LLAO::mAnimationOverrides; -S32 LLAO::mAnimationIndex; -LLUUID LLAO::mLastAnimation; - -std::map LLAO::mOverrides; -LLFloaterAO* LLFloaterAO::sInstance; -BOOL LLAO::mEnabled = FALSE; -F32 LLAO::mPeriod; -LLAOStandTimer* LLAO::mTimer = NULL; - -class ObjectNameMatches : public LLInventoryCollectFunctor -{ -public: - ObjectNameMatches(std::string name) - { - sName = name; - } - virtual ~ObjectNameMatches() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) - { - if(item) - { - return (item->getName() == sName); - } - return false; - } -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() -{ - if (!LLAO::mStandOverrides.empty()) - return LLUUID(LLAO::getAssetIDByName(LLAO::mStandOverrides.front())); - else - return LLUUID::null; -} - -LLUUID LLAO::getBackUUID() -{ - if (!LLAO::mStandOverrides.empty()) - return LLUUID(LLAO::getAssetIDByName(LLAO::mStandOverrides.back())); - else - return LLUUID::null; -} - -LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period) -{ -} -BOOL LLAOStandTimer::tick() -{ - if(!mPaused && LLAO::isEnabled() && !LLAO::mStandOverrides.empty()) - { -#ifdef AO_DEBUG - llinfos << "tick" << llendl; -#endif - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if (avatarp) - { - for ( LLVOAvatar::AnimIterator anim_it = - avatarp->mPlayingAnimations.begin(); - anim_it != avatarp->mPlayingAnimations.end(); - anim_it++) - { - if(LLAO::isStand(anim_it->first)) - { - //back is always last played, front is next - avatarp->stopMotion(LLAO::getBackUUID()); -#ifdef AO_DEBUG - //llinfos << "Stopping " << LLAO::mStandOverrides.back() << llendl; -#endif - avatarp->startMotion(LLAO::getFrontUUID()); -#ifdef AO_DEBUG - //llinfos << "Starting " << LLAO::mStandOverrides.front() << llendl; -#endif - LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front()); - LLAO::mStandOverrides.pop_front(); - LLFloaterAO* ao = LLFloaterAO::sInstance; - if(ao) - { - //ao->mStandsCombo->setSimple(LLStringExplicit(LLAO::mStandOverrides.back().asString())); - } - break; - } - } - } - } - return FALSE; -} - -void LLAOStandTimer::pause() -{ - if(mPaused) return; -#ifdef AO_DEBUG - llinfos << "Pausing AO Timer...." << llendl; -#endif - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if (avatarp) - { -#ifdef AO_DEBUG - //llinfos << "Stopping " << LLAO::mStandOverrides.back() << llendl; -#endif - gAgent.sendAnimationRequest(LLAO::getBackUUID(), ANIM_REQUEST_STOP); - avatarp->stopMotion(LLAO::getBackUUID()); - } - mEventTimer.reset(); - mEventTimer.stop(); - mPaused = TRUE; -} - -void LLAOStandTimer::resume() -{ - if(!mPaused) return; -#ifdef AO_DEBUG - llinfos << "Unpausing AO Timer...." << llendl; -#endif - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if (avatarp) - { -#ifdef AO_DEBUG - //llinfos << "Starting " << LLAO::mStandOverrides.back() << llendl; -#endif - gAgent.sendAnimationRequest(LLAO::getBackUUID(), ANIM_REQUEST_START); - avatarp->startMotion(LLAO::getBackUUID()); - } - mEventTimer.reset(); - mEventTimer.start(); - mPaused = FALSE; -} - -// Used for sorting -struct SortItemPtrsByName -{ - bool operator()(const LLInventoryItem* i1, const LLInventoryItem* i2) - { - return (LLStringUtil::compareDict(i1->getName(), i2->getName()) < 0); - } -}; - - -void LLAOStandTimer::reset() -{ - mEventTimer.reset(); -} - -//static -void LLAO::setup() -{ - mEnabled = gSavedSettings.getBOOL("AO.Enabled"); - mPeriod = gSavedSettings.getF32("AO.Period"); - mTimer = new LLAOStandTimer(mPeriod); - mAnimationIndex = 0; - mLastAnimation = LLUUID::null; - gSavedSettings.getControl("AO.Enabled")->getSignal()->connect(boost::bind(&handleAOEnabledChanged, _1)); - gSavedSettings.getControl("AO.Period")->getSignal()->connect(boost::bind(&handleAOPeriodChanged, _1)); -} -//static -void LLAO::runAnims(BOOL enabled) -{ - LLVOAvatar* avatarp = gAgent.getAvatarObject(); - if (avatarp) - { - for ( LLVOAvatar::AnimIterator anim_it = - avatarp->mPlayingAnimations.begin(); - anim_it != avatarp->mPlayingAnimations.end(); - anim_it++) - { - if(LLAO::mOverrides.find(anim_it->first) != LLAO::mOverrides.end()) - { - LLUUID anim_id = mOverrides[anim_it->first]; - // this is an override anim - if(enabled) - { - // make override start - avatarp->startMotion(anim_id); - } - else - { - avatarp->stopMotion(anim_id); - gAgent.sendAnimationRequest(anim_id, ANIM_REQUEST_STOP); - } - } - } - if(mTimer) - { - if(enabled) - mTimer->resume(); - else - mTimer->pause(); - } - } -} -//static -bool LLAO::handleAOPeriodChanged(const LLSD& newvalue) -{ - F32 value = (F32)newvalue.asReal(); - mPeriod = value; - return true; -} -//static -bool LLAO::handleAOEnabledChanged(const LLSD& newvalue) -{ - BOOL value = newvalue.asBoolean(); - mEnabled = value; - runAnims(value); - return true; -} -//static -BOOL LLAO::isStand(LLUUID _id) -{ - std::string id = _id.asString(); - //ALL KNOWN STANDS - if(id == "2408fe9e-df1d-1d7d-f4ff-1384fa7b350f") return TRUE; - if(id == "15468e00-3400-bb66-cecc-646d7c14458e") return TRUE; - if(id == "370f3a20-6ca6-9971-848c-9a01bc42ae3c") return TRUE; - if(id == "42b46214-4b44-79ae-deb8-0df61424ff4b") return TRUE; - if(id == "f22fed8b-a5ed-2c93-64d5-bdd8b93c889f") return TRUE; - return FALSE; -} - -BOOL LLAO::isVoice(LLUUID _id) -{ - 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(); - mAnimationOverrides.clear(); - LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings"); - //S32 version = (S32)settings["version"].asInteger(); - mAnimationOverrides = settings["overrides"]; - llinfos << "Stand count: " << mAnimationOverrides["Stands"].size() << llendl; -} - -//static ------------- Floater -void LLFloaterAO::show() -{ - if(sInstance) - sInstance->open(); - else - (new LLFloaterAO())->open(); -} - -LLFloaterAO::LLFloaterAO() -: LLFloater() -{ - sInstance = this; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_ao.xml"); -} - -LLFloaterAO::~LLFloaterAO() -{ - sInstance = NULL; -} - -BOOL LLFloaterAO::postBuild(void) -{ - LLComboBox* combo; - LLScrollListCtrl* list; - - childSetAction("btn_save", onClickSave, this); - childSetAction("btn_load", onClickLoad, this); - - combo = getChild( "combo_anim_type"); - combo->setCommitCallback(onCommitType); - combo->setCallbackUserData(this); - combo->selectFirstItem(); - mAnimTypeCombo = combo; - mCurrentAnimType = mAnimTypeCombo->getValue().asString(); - - combo = getChild( "combo_anim_list"); - mAnimListCombo = combo; - childSetAction("combo_anim_add", onClickAnimAdd, this); - childSetAction("combo_anim_delete", onClickAnimRemove, this); - - list = getChild("active_anim_list"); - mAnimationList = list; - - addAnimations(); - - refresh(); - - return TRUE; -} - -void LLFloaterAO::refresh() -{ - 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++) - { - 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->getValue().asString(); - floater->refresh(); -} - -void LLFloaterAO::addAnimations() -{ - mAnimListCombo->removeall(); - - std::string none_text = getString("none_text"); - mAnimListCombo->add(none_text, LLUUID::null); - - 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_NONE, - gAgent.getID(), - gAgent.getGroupID()); - gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), - cats, - items, - LLInventoryModel::EXCLUDE_TRASH, - is_copyable_animation); - - // Copy into something we can sort - std::vector animations; - - S32 count = items.count(); - for(i = 0; i < count; ++i) - { - animations.push_back( items.get(i) ); - } - - // Do the sort - std::sort(animations.begin(), animations.end(), SortItemPtrsByName()); - - // And load up the combobox - std::vector::iterator it; - for (it = animations.begin(); it != animations.end(); ++it) - { - LLInventoryItem* item = *it; - mAnimListCombo->add(item->getName(), item->getAssetUUID(), ADD_BOTTOM); - } -} - -// static -void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterAO* floater = (LLFloaterAO*)user_data; - LLSD settings; - settings["version"] = 2; - settings["overrides"] = LLAO::mAnimationOverrides; - gSavedPerAccountSettings.setLLSD("AO.Settings", settings); - LLAO::refresh(); - floater->refresh(); -} - - -//static -void LLFloaterAO::onClickAnimRemove(void* user_data) -{ - LLFloaterAO* floater = (LLFloaterAO*)user_data; - std::vector items = floater->mAnimationList->getAllSelected(); - for (std::vector::iterator iter = items.begin(); iter != items.end(); ++iter) - { - LLScrollListItem* item = *iter; - if (item->getValue().asString() != "") - { - 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; - } - } - 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)); -#ifdef AO_DEBUG - llinfos << "Attempting to add " << anim_name << " (" << id << ") " << " to " << floater->mCurrentAnimType << llendl; -#endif - if(id.notNull() && !LLAO::mAnimationOverrides[floater->mCurrentAnimType].has(anim_name)) - { -#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); -} - -BOOL LLFloaterAO::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg) -{ - BOOL handled = TRUE; - switch(cargo_type) - { - case DAD_ANIMATION: - { - LLInventoryItem* item = (LLInventoryItem*)cargo_data; - if (item - && gInventory.getItem(item->getUUID())) - { - if (drop) - { - if (cargo_type == DAD_ANIMATION) - { - std::string anim_name = item->getName(); - if (anim_name == "") - return true; - LLUUID id(LLAO::getAssetIDByName(anim_name)); -#ifdef AO_DEBUG - llinfos << "Actually adding animation, this should be refreshed. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl; -#endif - LLAO::mAnimationOverrides[mCurrentAnimType].append(anim_name); -#ifdef AO_DEBUG - llinfos << "Added animation. Count:" << LLAO::mAnimationOverrides[mCurrentAnimType].size() << llendl; -#endif - LLAO::mTimer->reset(); - onCommitAnim(NULL,this); - } - refresh(); - } - *accept = ACCEPT_YES_COPY_MULTI; - } - else - { - // Not in user's inventory means it was in object inventory - *accept = ACCEPT_NO; - } - break; - } - default: - *accept = ACCEPT_NO; - if (tooltip_msg.empty()) - { - tooltip_msg.assign("Only animations can be added to the AO."); - } - break; - } - return handled; -} - - -//static -void LLFloaterAO::onClickSave(void* user_data) -{ - LLFilePicker& file_picker = LLFilePicker::instance(); - if(file_picker.getSaveFile( LLFilePicker::FFSAVE_AO, LLDir::getScrubbedFileName("untitled.ao"))) - { - std::string file_name = file_picker.getFirstFile(); - llofstream export_file(file_name); - LLSDSerialize::toPrettyXML(gSavedPerAccountSettings.getLLSD("AO.Settings"), export_file); - export_file.close(); - } -} - -//static -void LLFloaterAO::onClickLoad(void* user_data) -{ - LLFloaterAO* floater = (LLFloaterAO*)user_data; - - LLFilePicker& file_picker = LLFilePicker::instance(); - if(file_picker.getOpenFile(LLFilePicker::FFLOAD_AO)) - { - std::string file_name = file_picker.getFirstFile(); - llifstream xml_file(file_name); - if(!xml_file.is_open()) return; - LLSD data; - if(LLSDSerialize::fromXML(data, xml_file) >= 1) - { - if(LLAO::isEnabled()) - LLAO::runAnims(FALSE); - - gSavedPerAccountSettings.setLLSD("AO.Settings", data); - LLAO::refresh(); - - if(LLAO::isEnabled()) - LLAO::runAnims(TRUE); - - floater->refresh(); - } - xml_file.close(); - } -} -// \ No newline at end of file diff --git a/indra/newview/llao.h b/indra/newview/llao.h deleted file mode 100644 index a54d71543..000000000 --- a/indra/newview/llao.h +++ /dev/null @@ -1,89 +0,0 @@ -// -#ifndef LL_LLAO_H -#define LL_LLAO_H - -//this is for debugging ;D -//#define AO_DEBUG - -#include "llfloater.h" -#include "llcombobox.h" - -class LLAOStandTimer : public LLEventTimer -{ -public: - LLAOStandTimer(F32 period); - BOOL tick(); - void pause(); - void resume(); - void reset(); - -private: - BOOL mPaused; -}; - -class LLAO -{ -public: - static void setup(); - static std::map mOverrides; - static std::list mStandOverrides; - //Animation LLSD for full animation options -HgB - static LLSD mAnimationOverrides; - static S32 mAnimationIndex; - static LLUUID mLastAnimation; - 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 LLUUID getFrontUUID(); - static LLUUID getBackUUID(); - static LLAOStandTimer* mTimer; - - //Horribly hacked-up stuff from llpreviewgesture.h, try to fix in the near future. -HgB - /*virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg);*/ - -private: - static BOOL mEnabled; - static F32 mPeriod; -}; - -class LLFloaterAO : public LLFloater -{ -public: - static LLFloaterAO* sInstance; - static void show(); - LLFloaterAO(); - void addAnimations(); - BOOL postBuild(void); - void refresh(); - static void onCommitAnim(LLUICtrl* ctrl, void* user_data); - static void onCommitType(LLUICtrl* ctrl,void* user_data); - static void onClickAnimRemove(void* user_data); - static void onClickAnimAdd(void* user_data); - static void onClickSave(void* user_data); - static void onClickLoad(void* user_data); - virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); -private: - LLComboBox* mAnimListCombo; - LLComboBox* mAnimTypeCombo; - LLScrollListCtrl* mAnimationList; - std::string mCurrentAnimType; - virtual ~LLFloaterAO(); -protected: - static void onCommitAnimation(LLUICtrl* ctrl, void* data); -}; - -#endif -// diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8ebb51e26..af166f778 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -99,7 +99,6 @@ #include "llimageworker.h" // -#include "llao.h" //for setting up listener #include "lldelayeduidelete.h" #include "llbuildnewviewsscheduler.h" // @@ -678,10 +677,6 @@ bool LLAppViewer::init() settings_to_globals(); // Setup settings listeners settings_setup_listeners(); - // - // Setup AO settings listener - LLAO::setup(); - // // Modify settings based on system configuration and compile options settings_modify(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1c3c2c634..8dbe168d7 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -203,7 +203,6 @@ //#include "llactivation.h" #include "wlfPanel_AdvSettings.h" //Lower right Windlight and Rendering options #include "ascentdaycyclemanager.h" -#include "llao.h" #include "llfloaterblacklist.h" #include "scriptcounter.h" // @@ -984,9 +983,6 @@ 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) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7e8810d90..9d2f985b6 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -244,7 +244,6 @@ #include "dofloaterhex.h" #include "hgfloatertexteditor.h" #include "llfloatermessagelog.h" -#include "llao.h" #include "llfloatervfs.h" #include "llfloatervfsexplorer.h" // @@ -440,7 +439,6 @@ void handle_hide_typing_notification(void*); void handle_close_all_notifications(void*); void handle_reopen_with_hex_editor(void*); void handle_open_message_log(void*); -void handle_edit_ao(void*); void handle_local_assets(void*); void handle_vfs_explorer(void*); void handle_sounds_explorer(void*); @@ -774,8 +772,6 @@ void init_menus() NULL, &menu_check_control, (void*)"AO.Enabled")); - menu->append(new LLMenuItemCallGL( "Edit AO...", - &handle_edit_ao, NULL)); menu->append(new LLMenuItemCheckGL( "Nimble", &menu_toggle_control, NULL, @@ -3618,11 +3614,6 @@ void handle_open_message_log(void*) LLFloaterMessageLog::show(); } -void handle_edit_ao(void*) -{ - LLFloaterAO::show(); -} - void handle_local_assets(void*) { diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7218b0953..9602ab179 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -96,7 +96,6 @@ // #include "llfloaterexploreanimations.h" -#include "llao.h" #include "llimagemetadatareader.h" // @@ -2727,10 +2726,6 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) // trigger fidget anims if (isAnyAnimationSignaled(AGENT_STAND_ANIMS, NUM_AGENT_STAND_ANIMS)) { - // - if(LLAO::isEnabled()) - LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function. - // agent.fidget(); } } @@ -5787,81 +5782,16 @@ std::string LLVOAvatar::getIdleTime() //----------------------------------------------------------------------------- BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { - LLMemType mt(LLMemType::MTYPE_AVATAR); - // - if(mIsSelf) + // [Ansariel Hiller]: Disable pesky hover up animation that changes + // hand and finger position and often breaks correct + // fit of prim nails, rings etc. when flying and + // using an AO. + if ("62c5de58-cb33-5743-3d07-9e4cd4352864" == id.getString() && gSavedSettings.getBOOL("DisableInternalFlyUpAnimation")) { - if(LLAO::isEnabled()) - { - 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) - { - if (LLAO::mLastAnimation.notNull()) - { - gAgent.sendAnimationRequest(LLAO::mLastAnimation, ANIM_REQUEST_STOP); - stopMotion(LLAO::mLastAnimation, true); - llinfos << "Stopping old animation." << llendl; - } - std::string anim_name; - LLUUID new_anim = LLUUID::null; - - while (new_anim.isNull()) - { - LLAO::mAnimationIndex++; - if (LLAO::mAnimationOverrides[ao_id].size() <= LLAO::mAnimationIndex) - { - LLAO::mAnimationIndex = 0; - } - anim_name = static_cast (LLAO::mAnimationOverrides[ao_id][LLAO::mAnimationIndex]); - new_anim = LLAO::getAssetIDByName(anim_name); - - if (new_anim.isNull()) - { - LLChat chat; - chat.mSourceType = CHAT_SOURCE_SYSTEM; - chat.mText = llformat("Could not find animation %s, skipping and moving to next.", anim_name.c_str()); - LLFloaterChat::addChat(chat); - } - } - llinfos << "Switching to anim #" << LLAO::mAnimationIndex << ": " << anim_name << "(UUID " << new_anim << ")" << llendl; - gAgent.sendAnimationRequest(new_anim, ANIM_REQUEST_START); - startMotion(new_anim, time_offset); - - //LLMotion* motion = findMotion(new_anim); - - /*if (motion) - { - motion->setDeactivateCallback(&endAnimCallback, (void *)(new LLHandle(self->getHandle()))); - }*/ - - LLAO::mLastAnimation = new_anim; - } - /*if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end()) - { - // avoid infinite loops! - if( (id != LLAO::mOverrides[id]) - && (LLAO::mOverrides.find(LLAO::mOverrides[id]) == LLAO::mOverrides.end()) ) - { - //llinfos << "AO: Replacing " << id.asString() << " with " << LLAO::mOverrides[id].asString() << llendl; - gAgent.sendAnimationRequest(LLAO::mOverrides[id], ANIM_REQUEST_START); - startMotion(LLAO::mOverrides[id], time_offset); - } - }*/ - } + return TRUE; } - // + + LLMemType mt(LLMemType::MTYPE_AVATAR); // start special case female walk for female avatars if (getSex() == SEX_FEMALE) @@ -5881,36 +5811,6 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) gAgent.setAFK(); } - if( id == ANIM_AGENT_BUSY || - id == ANIM_AGENT_CROUCH || - id == ANIM_AGENT_CROUCHWALK || - id == ANIM_AGENT_FEMALE_WALK || - id == ANIM_AGENT_FLY || - id == ANIM_AGENT_FLYSLOW || - id == ANIM_AGENT_HOVER || - id == ANIM_AGENT_HOVER_DOWN || - id == ANIM_AGENT_HOVER_UP || - id == ANIM_AGENT_JUMP || - id == ANIM_AGENT_LAND || - id == ANIM_AGENT_PRE_JUMP || - id == ANIM_AGENT_RUN || - id == ANIM_AGENT_SHOUT || - id == ANIM_AGENT_SIT || - id == ANIM_AGENT_SIT_FEMALE || - id == ANIM_AGENT_SIT_GENERIC || - id == ANIM_AGENT_SIT_GROUND || - id == ANIM_AGENT_SIT_GROUND_CONSTRAINED || - id == ANIM_AGENT_SNAPSHOT || - id == ANIM_AGENT_STAND || - id == ANIM_AGENT_TURNLEFT || - id == ANIM_AGENT_TURNRIGHT || - id == ANIM_AGENT_TYPE || - id == ANIM_AGENT_WALK || - id == ANIM_AGENT_WHISPER || - id == ANIM_AGENT_WHISPER - ) - mIdleTimer.reset(); - return LLCharacter::startMotion(id, time_offset); } @@ -5921,50 +5821,8 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { if (mIsSelf) { - - // - if(LLAO::isEnabled()) - { - 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); - LLAO::mLastAnimation.setNull(); - } - /*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); - }*/ - } - else //if this code ever works without crashing the viewer -HgB - { - if (!LLAO::mLastAnimation.isNull()) - { - llinfos << "Stopped last animation automatically. May not have needed to be stopped yet." << llendl; - gAgent.sendAnimationRequest(LLAO::mLastAnimation, ANIM_REQUEST_STOP); - LLAO::mLastAnimation = LLUUID::null; - } - } - // gAgent.onAnimStop(id); } - if (id == ANIM_AGENT_WALK) { @@ -5974,10 +5832,6 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { LLCharacter::stopMotion(ANIM_AGENT_SIT_FEMALE, stop_immediate); } - - if(id == ANIM_AGENT_AWAY || - id == ANIM_AGENT_BUSY) - mIdleTimer.reset(); return LLCharacter::stopMotion(id, stop_immediate); } diff --git a/indra/newview/skins/default/xui/en-us/floater_ao.xml b/indra/newview/skins/default/xui/en-us/floater_ao.xml deleted file mode 100644 index 394e3aea3..000000000 --- a/indra/newview/skins/default/xui/en-us/floater_ao.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - Action: - - - - Crouch - - - Crouchwalk - - - Fall - - - Fly - - - Fly Down - - - Fly Up - - - Ground Sit - - - Hover - - - Land (Soft) - - - Land (Medium) - - - Land (Hard) - - - Jump - - - Pre-Jump - - - Run - - - Sit - - - Slow Fly - - - Stand - - - Stride - - - Turn Left - - - Turn Right - - - Typing - - - Voice - - - Walk - - - - - Animations: - - - -