summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-06-17 17:37:28 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-06-17 17:37:28 -0400
commit347e88961c06b9febfedeb7dc35f2b12546b5118 (patch)
treef52eea37b9485ae2d353522a7559917957931037 /indra
parent68b956b0d3069267737e4f26f93f2bba9ee6cd9c (diff)
EXT-4919 WIP - populating new users with more gestures, and activating appropriate ones
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llgesturemgr.cpp2
-rw-r--r--indra/newview/llstartup.cpp66
-rw-r--r--indra/newview/llviewerinventory.cpp5
3 files changed, 44 insertions, 29 deletions
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 0996d09e25..6ffd534a53 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -139,6 +139,8 @@ void LLGestureMgr::activateGesture(const LLUUID& item_id)
{
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if (!item) return;
+ if (item->getType() != LLAssetType::AT_GESTURE)
+ return;
LLUUID asset_id = item->getAssetUUID();
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index df5be34e39..5bd97efce6 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2375,6 +2375,8 @@ void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S3
const std::string COMMON_GESTURES_FOLDER = "Common Gestures";
const std::string MALE_GESTURES_FOLDER = "Male Gestures";
const std::string FEMALE_GESTURES_FOLDER = "Female Gestures";
+const std::string SPEECH_GESTURES_FOLDER = "Speech Gestures";
+const std::string OTHER_GESTURES_FOLDER = "Other Gestures";
const S32 OPT_CLOSED_WINDOW = -1;
const S32 OPT_MALE = 0;
const S32 OPT_FEMALE = 1;
@@ -2403,7 +2405,6 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response)
return false;
}
-
void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
const std::string& gender_name )
{
@@ -2415,16 +2416,16 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
S32 gender = 0;
- std::string gestures;
+ std::string same_gender_gestures;
if (gender_name == "male")
{
gender = OPT_MALE;
- gestures = MALE_GESTURES_FOLDER;
+ same_gender_gestures = MALE_GESTURES_FOLDER;
}
else
{
gender = OPT_FEMALE;
- gestures = FEMALE_GESTURES_FOLDER;
+ same_gender_gestures = FEMALE_GESTURES_FOLDER;
}
// try to find the outfit - if not there, create some default
@@ -2448,35 +2449,42 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
// Copy gestures
LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE);
- LLPointer<LLInventoryCallback> cb(NULL);
LLAppearanceMgr *app_mgr = &(LLAppearanceMgr::instance());
- // - Copy gender-specific gestures.
- LLUUID gestures_cat_id = findDescendentCategoryIDByName(
- gInventory.getLibraryRootFolderID(),
- gestures);
- if (gestures_cat_id.notNull())
+ std::vector<std::string> gesture_folders_to_copy;
+ gesture_folders_to_copy.push_back(MALE_GESTURES_FOLDER);
+ gesture_folders_to_copy.push_back(FEMALE_GESTURES_FOLDER);
+ gesture_folders_to_copy.push_back(COMMON_GESTURES_FOLDER);
+ gesture_folders_to_copy.push_back(SPEECH_GESTURES_FOLDER);
+ gesture_folders_to_copy.push_back(OTHER_GESTURES_FOLDER);
+
+ for(std::vector<std::string>::iterator it = gesture_folders_to_copy.begin();
+ it != gesture_folders_to_copy.end();
+ ++it)
{
- callAfterCategoryFetch(gestures_cat_id,
- boost::bind(&LLAppearanceMgr::shallowCopyCategory,
- app_mgr,
- gestures_cat_id,
- dst_id,
- cb));
- }
+ std::string& folder_name = *it;
- // - Copy common gestures.
- LLUUID common_gestures_cat_id = findDescendentCategoryIDByName(
- gInventory.getLibraryRootFolderID(),
- COMMON_GESTURES_FOLDER);
- if (common_gestures_cat_id.notNull())
- {
- callAfterCategoryFetch(common_gestures_cat_id,
- boost::bind(&LLAppearanceMgr::shallowCopyCategory,
- app_mgr,
- common_gestures_cat_id,
- dst_id,
- cb));
+ LLPointer<LLInventoryCallback> cb(NULL);
+ if (folder_name == same_gender_gestures ||
+ folder_name == COMMON_GESTURES_FOLDER ||
+ folder_name == OTHER_GESTURES_FOLDER)
+ {
+ cb = new ActivateGestureCallback;
+ }
+
+ // - Copy gender-specific gestures.
+ LLUUID cat_id = findDescendentCategoryIDByName(
+ gInventory.getLibraryRootFolderID(),
+ folder_name);
+ if (cat_id.notNull())
+ {
+ callAfterCategoryFetch(cat_id,
+ boost::bind(&LLAppearanceMgr::shallowCopyCategory,
+ app_mgr,
+ cat_id,
+ dst_id,
+ cb));
+ }
}
// This is really misnamed -- it means we have started loading
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 40f15fe86a..3430f265ae 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -922,6 +922,11 @@ void ActivateGestureCallback::fire(const LLUUID& inv_item)
{
if (inv_item.isNull())
return;
+ LLViewerInventoryItem* item = gInventory.getItem(inv_item);
+ if (!item)
+ return;
+ if (item->getType() != LLAssetType::AT_GESTURE)
+ return;
LLGestureMgr::instance().activateGesture(inv_item);
}