From b1b36abe23821479c63d41e5ad766f6b03750159 Mon Sep 17 00:00:00 2001 From: phr0z3nt04st Date: Wed, 9 Jun 2010 00:58:05 -0500 Subject: [PATCH] Added AO. --- indra/newview/CMakeLists.txt | 2 + .../app_settings/settings_per_account.xml | 13 ++ indra/newview/llao.cpp | 219 ++++++++++++++++++ indra/newview/llao.h | 32 +++ indra/newview/llstartup.cpp | 115 ++++----- indra/newview/llviewermenu.cpp | 49 +++- indra/newview/llvoavatar.cpp | 35 ++- .../skins/default/xui/en-us/floater_ao.xml | 122 ++++++++++ 8 files changed, 527 insertions(+), 60 deletions(-) create mode 100644 indra/newview/llao.cpp create mode 100644 indra/newview/llao.h create mode 100755 indra/newview/skins/default/xui/en-us/floater_ao.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index e780fdd0c..a38a746cc 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -74,6 +74,7 @@ set(viewer_SOURCE_FILES llagentlanguage.cpp llagentpilot.cpp llanimstatelabels.cpp + llao.cpp llappviewer.cpp llassetuploadresponders.cpp llassetuploadqueue.cpp @@ -507,6 +508,7 @@ set(viewer_HEADER_FILES llagentlanguage.h llagentpilot.h llanimstatelabels.h + llao.h llappearance.h llappviewer.h llassetuploadresponders.h diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 90c7b1163..884964fa7 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -1,5 +1,18 @@ + AO.Settings + + Comment + List for animation overrider + Persist + 1 + Type + LLSD + Value + + + + BusyModeResponse Comment diff --git a/indra/newview/llao.cpp b/indra/newview/llao.cpp new file mode 100644 index 000000000..90d9b6d69 --- /dev/null +++ b/indra/newview/llao.cpp @@ -0,0 +1,219 @@ +// + +#include "llviewerprecompiledheaders.h" +#include "llao.h" +#include "llviewercontrol.h" +#include "lluictrlfactory.h" +#include "llfilepicker.h" +#include "llsdserialize.h" + +std::map LLAO::mOverrides; +LLFloaterAO* LLFloaterAO::sInstance; + +//static +void LLAO::refresh() +{ + mOverrides.clear(); + LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings"); + 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++) + { + // don't allow override to be used as a trigger + if(mOverrides.find(sd_it->second.asUUID()) == mOverrides.end()) + { + // ignore if override is null key... + if(sd_it->second.asUUID().notNull()) + { + mOverrides[LLUUID(sd_it->first)] = sd_it->second.asUUID(); + } + } + } +} + +//static +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) +{ + childSetAction("btn_save", onClickSave, this); + childSetAction("btn_load", onClickLoad, this); + + childSetCommitCallback("line_walking", onCommitAnim, this); + childSetCommitCallback("line_running", onCommitAnim, this); + childSetCommitCallback("line_crouchwalk", onCommitAnim, this); + childSetCommitCallback("line_flying", onCommitAnim, this); + childSetCommitCallback("line_turn_left", onCommitAnim, this); + childSetCommitCallback("line_turn_right", onCommitAnim, this); + childSetCommitCallback("line_jumping", onCommitAnim, this); + childSetCommitCallback("line_fly_up", onCommitAnim, this); + childSetCommitCallback("line_crouching", onCommitAnim, this); + childSetCommitCallback("line_fly_down", onCommitAnim, this); + childSetCommitCallback("line_stand1", onCommitAnim, this); + childSetCommitCallback("line_stand2", onCommitAnim, this); + childSetCommitCallback("line_stand3", onCommitAnim, this); + childSetCommitCallback("line_hover", onCommitAnim, this); + childSetCommitCallback("line_sitting", onCommitAnim, this); + childSetCommitCallback("line_prejump", onCommitAnim, this); + childSetCommitCallback("line_falling", onCommitAnim, this); + childSetCommitCallback("line_stride", onCommitAnim, this); + childSetCommitCallback("line_soft_landing", onCommitAnim, this); + childSetCommitCallback("line_medium_landing", onCommitAnim, this); + childSetCommitCallback("line_hard_landing", onCommitAnim, this); + childSetCommitCallback("line_flying_slow", onCommitAnim, this); + childSetCommitCallback("line_sitting_on_ground", onCommitAnim, this); + refresh(); + return TRUE; +} + +std::string LLFloaterAO::idstr(LLUUID id) +{ + if(id.notNull()) return id.asString(); + else return ""; +} + +void LLFloaterAO::refresh() +{ + LLSD settings = gSavedPerAccountSettings.getLLSD("AO.Settings"); + LLSD overrides = settings["overrides"]; + childSetText("line_walking", idstr(overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"])); + childSetText("line_running", idstr(overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"])); + childSetText("line_crouchwalk", idstr(overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"])); + childSetText("line_flying", idstr(overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"])); + childSetText("line_turn_left", idstr(overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"])); + childSetText("line_turn_right", idstr(overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"])); + childSetText("line_jumping", idstr(overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"])); + childSetText("line_fly_up", idstr(overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"])); + childSetText("line_crouching", idstr(overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"])); + childSetText("line_fly_down", idstr(overrides["20f063ea-8306-2562-0b07-5c853b37b31e"])); + childSetText("line_stand1", idstr(overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"])); + childSetText("line_stand2", idstr(overrides["15468e00-3400-bb66-cecc-646d7c14458e"])); + childSetText("line_stand3", idstr(overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"])); + childSetText("line_hover", idstr(overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"])); + childSetText("line_sitting", idstr(overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"])); + childSetText("line_prejump", idstr(overrides["7a4e87fe-de39-6fcb-6223-024b00893244"])); + childSetText("line_falling", idstr(overrides["666307d9-a860-572d-6fd4-c3ab8865c094"])); + childSetText("line_stride", idstr(overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"])); + childSetText("line_soft_landing", idstr(overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"])); + childSetText("line_medium_landing", idstr(overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"])); + childSetText("line_hard_landing", idstr(overrides["3da1d753-028a-5446-24f3-9c9b856d9422"])); + childSetText("line_flying_slow", idstr(overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"])); + childSetText("line_sitting_on_ground", idstr(overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"])); +} + +// static +void LLFloaterAO::onCommitAnim(LLUICtrl* ctrl, void* user_data) +{ + LLFloaterAO* floater = (LLFloaterAO*)user_data; + + LLSD overrides; + LLUUID id; + id = LLUUID(floater->childGetValue("line_walking").asString()); + if(id.notNull()) overrides["6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"] = id; + id = LLUUID(floater->childGetValue("line_running").asString()); + if(id.notNull()) overrides["05ddbff8-aaa9-92a1-2b74-8fe77a29b445"] = id; + id = LLUUID(floater->childGetValue("line_crouchwalk").asString()); + if(id.notNull()) overrides["47f5f6fb-22e5-ae44-f871-73aaaf4a6022"] = id; + id = LLUUID(floater->childGetValue("line_flying").asString()); + if(id.notNull()) overrides["aec4610c-757f-bc4e-c092-c6e9caf18daf"] = id; + id = LLUUID(floater->childGetValue("line_turn_left").asString()); + if(id.notNull()) overrides["56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"] = id; + id = LLUUID(floater->childGetValue("line_turn_right").asString()); + if(id.notNull()) overrides["2d6daa51-3192-6794-8e2e-a15f8338ec30"] = id; + id = LLUUID(floater->childGetValue("line_jumping").asString()); + if(id.notNull()) overrides["2305bd75-1ca9-b03b-1faa-b176b8a8c49e"] = id; + id = LLUUID(floater->childGetValue("line_fly_up").asString()); + if(id.notNull()) overrides["62c5de58-cb33-5743-3d07-9e4cd4352864"] = id; + id = LLUUID(floater->childGetValue("line_crouching").asString()); + if(id.notNull()) overrides["201f3fdf-cb1f-dbec-201f-7333e328ae7c"] = id; + id = LLUUID(floater->childGetValue("line_fly_down").asString()); + if(id.notNull()) overrides["20f063ea-8306-2562-0b07-5c853b37b31e"] = id; + id = LLUUID(floater->childGetValue("line_stand1").asString()); + if(id.notNull()) overrides["2408fe9e-df1d-1d7d-f4ff-1384fa7b350f"] = id; + id = LLUUID(floater->childGetValue("line_stand2").asString()); + if(id.notNull()) overrides["15468e00-3400-bb66-cecc-646d7c14458e"] = id; + id = LLUUID(floater->childGetValue("line_stand3").asString()); + if(id.notNull()) overrides["370f3a20-6ca6-9971-848c-9a01bc42ae3c"] = id; + id = LLUUID(floater->childGetValue("line_hover").asString()); + if(id.notNull()) overrides["4ae8016b-31b9-03bb-c401-b1ea941db41d"] = id; + id = LLUUID(floater->childGetValue("line_sitting").asString()); + if(id.notNull()) overrides["1a5fe8ac-a804-8a5d-7cbd-56bd83184568"] = id; + id = LLUUID(floater->childGetValue("line_prejump").asString()); + if(id.notNull()) overrides["7a4e87fe-de39-6fcb-6223-024b00893244"] = id; + id = LLUUID(floater->childGetValue("line_falling").asString()); + if(id.notNull()) overrides["666307d9-a860-572d-6fd4-c3ab8865c094"] = id; + id = LLUUID(floater->childGetValue("line_stride").asString()); + if(id.notNull()) overrides["1cb562b0-ba21-2202-efb3-30f82cdf9595"] = id; + id = LLUUID(floater->childGetValue("line_soft_landing").asString()); + if(id.notNull()) overrides["7a17b059-12b2-41b1-570a-186368b6aa6f"] = id; + id = LLUUID(floater->childGetValue("line_medium_landing").asString()); + if(id.notNull()) overrides["f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57"] = id; + id = LLUUID(floater->childGetValue("line_hard_landing").asString()); + if(id.notNull()) overrides["3da1d753-028a-5446-24f3-9c9b856d9422"] = id; + id = LLUUID(floater->childGetValue("line_flying_slow").asString()); + if(id.notNull()) overrides["2b5a38b2-5e00-3a97-a495-4c826bc443e6"] = id; + id = LLUUID(floater->childGetValue("line_sitting_on_ground").asString()); + if(id.notNull()) overrides["1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e"] = id; + LLSD settings; + settings["version"] = 1; + settings["overrides"] = overrides; + gSavedPerAccountSettings.setLLSD("AO.Settings", settings); + LLAO::refresh(); + floater->refresh(); +} + +//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) + { + gSavedPerAccountSettings.setLLSD("AO.Settings", data); + LLAO::refresh(); + floater->refresh(); + } + xml_file.close(); + } +} + +// diff --git a/indra/newview/llao.h b/indra/newview/llao.h new file mode 100644 index 000000000..ea6db87a5 --- /dev/null +++ b/indra/newview/llao.h @@ -0,0 +1,32 @@ +// +#ifndef LL_LLAO_H +#define LL_LLAO_H + +#include "llfloater.h" + +class LLAO +{ +public: + static std::map mOverrides; + + static void refresh(); +}; + +class LLFloaterAO : public LLFloater +{ +public: + static LLFloaterAO* sInstance; + static void show(); + LLFloaterAO(); + BOOL postBuild(void); + void refresh(); + static void onCommitAnim(LLUICtrl* ctrl, void* user_data); + static void onClickSave(void* user_data); + static void onClickLoad(void* user_data); +private: + virtual ~LLFloaterAO(); + std::string idstr(LLUUID id); // silly utility +}; + +#endif +// diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d10746c90..99dceaf4c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -193,12 +193,12 @@ #include "llsocks5.h" #include "jcfloaterareasearch.h" -// -#include "llpanellogin.h" -//#include "llfloateravatars.h" -//#include "llactivation.h" -//#include "llao.h" -//#include "llcheats.h" +// +#include "llpanellogin.h" +//#include "llfloateravatars.h" +//#include "llactivation.h" +#include "llao.h" +//#include "llcheats.h" // #if LL_WINDOWS @@ -1102,8 +1102,8 @@ bool idle_startup() // We have at least some login information on a SLURL firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // web_login_key = gLoginHandler.getWebLoginKey(); @@ -1116,9 +1116,9 @@ bool idle_startup() LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); firstname = cmd_line_login[0].asString(); lastname = cmd_line_login[1].asString(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); - // + // + gFullName = utf8str_tolower(firstname + " " + lastname); + // LLMD5 pass((unsigned char*)cmd_line_login[2].asString().c_str()); char md5pass[33]; /* Flawfinder: ignore */ @@ -1136,8 +1136,8 @@ bool idle_startup() { firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // password = LLStartUp::loadPasswordFromDisk(); gSavedSettings.setBOOL("RememberPassword", TRUE); @@ -1154,8 +1154,8 @@ bool idle_startup() // a valid grid is selected firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // password = LLStartUp::loadPasswordFromDisk(); show_connect_box = true; @@ -1248,8 +1248,8 @@ bool idle_startup() else { LLPanelLogin::setFields(firstname, lastname, password, login_history); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // LLPanelLogin::giveFocus(); } @@ -1324,8 +1324,8 @@ bool idle_startup() { firstname = gLoginHandler.getFirstName(); lastname = gLoginHandler.getLastName(); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // web_login_key = gLoginHandler.getWebLoginKey(); } @@ -1345,8 +1345,8 @@ bool idle_startup() { gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // if (!gSavedSettings.controlExists("RememberLogin")) gSavedSettings.declareBOOL("RememberLogin", false, "Remember login", false); gSavedSettings.setBOOL("RememberLogin", LLPanelLogin::getRememberLogin()); @@ -1405,7 +1405,10 @@ bool idle_startup() std::string user_windlight_days_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/days", "")); LLFile::mkdir(user_windlight_days_path_name.c_str()); - + + // + LLAO::refresh(); + // if (show_connect_box) { @@ -1468,9 +1471,9 @@ bool idle_startup() init_start_screen(agent_location_id); } - // Display the startup progress bar. - // - //gViewerWindow->setShowProgress(TRUE); + // Display the startup progress bar. + // + //gViewerWindow->setShowProgress(TRUE); // gViewerWindow->setProgressCancelButtonVisible(TRUE, std::string("Quit")); // *TODO: Translate @@ -1696,13 +1699,13 @@ bool idle_startup() hashed_mac.finalize(); hashed_mac.hex_digest(hashed_mac_string); - // - std::string my_mac = std::string(hashed_mac_string); - if(gSavedSettings.getBOOL("SpecifyMAC")) - my_mac = gSavedSettings.getString("SpecifiedMAC").c_str(); - std::string my_id0 = LLAppViewer::instance()->getSerialNumber(); - if(gSavedSettings.getBOOL("SpecifyID0")) - my_id0 = gSavedSettings.getString("SpecifiedID0"); + // + std::string my_mac = std::string(hashed_mac_string); + if(gSavedSettings.getBOOL("SpecifyMAC")) + my_mac = gSavedSettings.getString("SpecifiedMAC").c_str(); + std::string my_id0 = LLAppViewer::instance()->getSerialNumber(); + if(gSavedSettings.getBOOL("SpecifyID0")) + my_id0 = gSavedSettings.getString("SpecifiedID0"); // LLViewerLogin* vl = LLViewerLogin::getInstance(); @@ -1724,11 +1727,11 @@ bool idle_startup() gAcceptCriticalMessage, gLastExecEvent, requested_options, - // - // hashed_mac_string, - // LLAppViewer::instance()->getSerialNumber()); - my_mac, - my_id0); + // + // hashed_mac_string, + // LLAppViewer::instance()->getSerialNumber()); + my_mac, + my_id0); // // reset globals @@ -2195,8 +2198,8 @@ bool idle_startup() if(!text.empty()) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); - // - gFullName = utf8str_tolower(firstname + " " + lastname); + // + gFullName = utf8str_tolower(firstname + " " + lastname); // if (gSavedSettings.getBOOL("RememberPassword")) @@ -2924,20 +2927,20 @@ bool idle_startup() { LL_WARNS("AppInit") << "Problem loading inventory-skel-targets" << LL_ENDL; } - } - - // testing adding a local inventory folder... - LLViewerInventoryCategory* test_cat = new LLViewerInventoryCategory(gAgent.getID()); - test_cat->rename(std::string("Pretend Inventory")); - LLUUID test_cat_id; - test_cat_id.generate(); - test_cat->setUUID(test_cat_id); - gLocalInventoryRoot = test_cat_id; - test_cat->setParent(LLUUID::null); - test_cat->setPreferredType(LLAssetType::AT_NONE); - - gInventory.addCategory(test_cat); - // + } + + // testing adding a local inventory folder... + LLViewerInventoryCategory* test_cat = new LLViewerInventoryCategory(gAgent.getID()); + test_cat->rename(std::string("Pretend Inventory")); + LLUUID test_cat_id; + test_cat_id.generate(); + test_cat->setUUID(test_cat_id); + gLocalInventoryRoot = test_cat_id; + test_cat->setParent(LLUUID::null); + test_cat->setPreferredType(LLAssetType::AT_NONE); + + gInventory.addCategory(test_cat); + // options.clear(); if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) @@ -3873,9 +3876,9 @@ bool update_dialog_callback(const LLSD& notification, const LLSD& response) // *TODO change userserver to be grid on both viewer and sim, since // userserver no longer exists. query_map["userserver"] = LLViewerLogin::getInstance()->getGridLabel(); - // - //query_map["channel"] = gSavedSettings.getString("VersionChannelName"); - query_map["channel"] = gSavedSettings.getString("SpecifiedChannel"); + // + //query_map["channel"] = gSavedSettings.getString("VersionChannelName"); + query_map["channel"] = gSavedSettings.getString("SpecifiedChannel"); // // *TODO constantize this guy // *NOTE: This URL is also used in win_setup/lldownloader.cpp diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a247fad8c..0fb20be3b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -233,6 +233,7 @@ #include "hgfloatertexteditor.h" #include "llfloatermessagelog.h" #include "llfloatermessagebuilder.h" +#include "llao.h" // using namespace LLVOAvatarDefines; @@ -399,6 +400,7 @@ void handle_close_all_notifications(void*); void handle_reopen_with_hex_editor(void*); void handle_open_message_log(void*); void handle_open_message_builder(void*); +void handle_edit_ao(void*); // BOOL is_inventory_visible( void* user_data ); @@ -1046,8 +1048,15 @@ void init_client_menu(LLMenuGL* menu) &handle_reopen_with_hex_editor, NULL)); sub->append(new LLMenuItemCallGL( "Message Log", &handle_open_message_log, NULL)); - sub->append(new LLMenuItemCallGL( "Message Builder", &handle_open_message_builder, NULL)); - + sub->append(new LLMenuItemCallGL( "Message Builder", &handle_open_message_builder, NULL)); + + sub->append(new LLMenuItemCheckGL( "Enable AO", + &menu_toggle_control, + NULL, + &menu_check_control, + (void*)"AO.Enabled")); + sub->append(new LLMenuItemCallGL( "Edit AO...", + &handle_edit_ao, NULL)); sub->append(new LLMenuItemCheckGL( "Nimble", &menu_toggle_control, NULL, @@ -3069,6 +3078,11 @@ void handle_open_message_builder(void*) LLFloaterMessageBuilder::show(""); } +void handle_edit_ao(void*) +{ + LLFloaterAO::show(); +} + void handle_close_all_notifications(void*) { LLView::child_list_t child_list(*(gNotifyBoxView->getChildList())); @@ -6748,6 +6762,37 @@ void menu_toggle_control( void* user_data ) // Doubleclick actions - there can be only one gSavedSettings.setBOOL( "DoubleClickAutoPilot", FALSE ); } + // + else if(std::string(static_cast(user_data)) == "AO.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()) + { + // this is an override anim + if(checked) + { + // make override stop + avatarp->stopMotion(anim_it->first); + gAgent.sendAnimationRequest(anim_it->first, ANIM_REQUEST_STOP); + } + else + { + // make override start + gSavedSettings.setBOOL("AO.Enabled", TRUE); + avatarp->startMotion(anim_it->first); + } + } + } + } + } + // gSavedSettings.setBOOL(setting, !checked); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2c945dc2c..f188be7ea 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -85,7 +85,7 @@ // #include "llfloaterexploreanimations.h" -//#include "llao.h" +#include "llao.h" // #if LL_MSVC @@ -5034,7 +5034,27 @@ void LLVOAvatar::resetAnimations() BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { LLMemType mt(LLMemType::MTYPE_AVATAR); - + + // + if(mIsSelf) + { + if(gSavedSettings.getBOOL("AO.Enabled")) + { + 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); + } + } + } + } + // + // start special case female walk for female avatars if (getSex() == SEX_FEMALE) { @@ -5063,6 +5083,17 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { if (mIsSelf) { + // + if(gSavedSettings.getBOOL("AO.Enabled")) + { + 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); + } + } + // gAgent.onAnimStop(id); } diff --git a/indra/newview/skins/default/xui/en-us/floater_ao.xml b/indra/newview/skins/default/xui/en-us/floater_ao.xml new file mode 100755 index 000000000..0ecd55eb8 --- /dev/null +++ b/indra/newview/skins/default/xui/en-us/floater_ao.xml @@ -0,0 +1,122 @@ + + +