Ripped out Inertia AO

This commit is contained in:
Siana Gearz
2011-02-27 16:32:06 +01:00
parent c8602110e4
commit f7109a0131
9 changed files with 9 additions and 946 deletions

View File

@@ -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

View File

@@ -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)
{
// <edit>
if(LLAO::isEnabled())
LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function.
// </edit>
stopFidget();
}
else if (id == ANIM_AGENT_AWAY)

View File

@@ -1,574 +0,0 @@
// <edit>
/* 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<std::string> LLAO::mStandOverrides;
LLSD LLAO::mAnimationOverrides;
S32 LLAO::mAnimationIndex;
LLUUID LLAO::mLastAnimation;
std::map<LLUUID,LLUUID> 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<LLComboBox>( "combo_anim_type");
combo->setCommitCallback(onCommitType);
combo->setCallbackUserData(this);
combo->selectFirstItem();
mAnimTypeCombo = combo;
mCurrentAnimType = mAnimTypeCombo->getValue().asString();
combo = getChild<LLComboBox>( "combo_anim_list");
mAnimListCombo = combo;
childSetAction("combo_anim_add", onClickAnimAdd, this);
childSetAction("combo_anim_delete", onClickAnimRemove, this);
list = getChild<LLScrollListCtrl>("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<LLInventoryItem*> 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<LLInventoryItem*>::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<LLScrollListItem*> items = floater->mAnimationList->getAllSelected();
for (std::vector<LLScrollListItem*>::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();
}
}
// </edit>

View File

@@ -1,89 +0,0 @@
// <edit>
#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<LLUUID,LLUUID> mOverrides;
static std::list<std::string> 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
// </edit>

View File

@@ -99,7 +99,6 @@
#include "llimageworker.h"
// <edit>
#include "llao.h" //for setting up listener
#include "lldelayeduidelete.h"
#include "llbuildnewviewsscheduler.h"
// </edit>
@@ -678,10 +677,6 @@ bool LLAppViewer::init()
settings_to_globals();
// Setup settings listeners
settings_setup_listeners();
// <edit>
// Setup AO settings listener
LLAO::setup();
// </edit>
// Modify settings based on system configuration and compile options
settings_modify();

View File

@@ -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"
// </edit>
@@ -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)

View File

@@ -244,7 +244,6 @@
#include "dofloaterhex.h"
#include "hgfloatertexteditor.h"
#include "llfloatermessagelog.h"
#include "llao.h"
#include "llfloatervfs.h"
#include "llfloatervfsexplorer.h"
// </edit>
@@ -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*)
{

View File

@@ -96,7 +96,6 @@
// <edit>
#include "llfloaterexploreanimations.h"
#include "llao.h"
#include "llimagemetadatareader.h"
// </edit>
@@ -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))
{
// <edit>
if(LLAO::isEnabled())
LLAO::mTimer->resume();//Timer only pauses if its not paused, check is inside function.
// </edit>
agent.fidget();
}
}
@@ -5787,81 +5782,16 @@ std::string LLVOAvatar::getIdleTime()
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
LLMemType mt(LLMemType::MTYPE_AVATAR);
// <edit>
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<const std::string&> (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<LLFloater>(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;
}
// </edit>
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)
{
// <edit>
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;
}
}
// </edit>
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);
}

View File

@@ -1,101 +0,0 @@
<?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="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="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="Fall" value="666307d9-a860-572d-6fd4-c3ab8865c094">
Fall
</combo_item>
<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="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="f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57">
Land (Medium)
</combo_item>
<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="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="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="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="-" right="-7" name="combo_anim_delete" width="21" />
<text follows="top|left" height="15" left="10" name="text_running" bottom_delta="-25">
Current List:
</text>
<scroll_list bottom="35" can_resize="true" column_padding="0" draw_heading="true"
follows="left|top|bottom|right" left="7" multi_select="true" right="-7"
name="active_anim_list" width="280" search_column="1"
tool_tip="Hold shift or control while clicking to select multiple files"
top="-68">
<column dynamicwidth="true" label="Animation" name="anim_name" tool_tip="Name of the animation." />
</scroll_list>
<button follows="right|bottom" bottom="7" halign="center" height="24" label="Load..."
left="120" name="btn_load" width="80" />
<button follows="right|bottom" bottom="7" halign="center" height="24" label="Save..."
left_delta="90" name="btn_save" width="80" />
</floater>