summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-21 16:49:14 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-21 16:49:14 -0500
commitc26034531a25590e718edc4d7efa41c04aa42731 (patch)
tree184ac14e257cb4728578aa93424aca2319338d58 /indra/newview
parentd215cd5c244a5448668cb2173b1d95d0d6adf3ae (diff)
EXT-3582 : My Outfits populates from library if I delete my last outfit
Autopopulation logic is now smarter and only triggers if this is the first time you're logging into viewer2.0.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagentwearables.cpp18
-rw-r--r--indra/newview/llinventorymodel.cpp7
2 files changed, 17 insertions, 8 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 79948abefd..e75d94bb2c 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -871,6 +871,13 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
if (mInitialWearablesUpdateReceived)
return;
mInitialWearablesUpdateReceived = true;
+
+ // If this is the very first time the user has logged into viewer2+ from a legacy viewer,
+ // then auto-populate outfits from the library into the My Outfits folder.
+ if (LLInventoryModel::getIsFirstTimeInViewer2())
+ {
+ gAgentWearables.populateMyOutfitsFolder();
+ }
LLUUID agent_id;
gMessageSystem->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
@@ -880,12 +887,15 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
{
gMessageSystem->getU32Fast(_PREHASH_AgentData, _PREHASH_SerialNum, gAgentQueryManager.mUpdateSerialNum);
+ const S32 NUM_BODY_PARTS = 4;
S32 num_wearables = gMessageSystem->getNumberOfBlocksFast(_PREHASH_WearableData);
- if (num_wearables < 4)
+ if (num_wearables < NUM_BODY_PARTS)
{
// Transitional state. Avatars should always have at least their body parts (hair, eyes, shape and skin).
- // The fact that they don't have any here (only a dummy is sent) implies that this account existed
- // before we had wearables, or that the database has gotten messed up.
+ // The fact that they don't have any here (only a dummy is sent) implies that either:
+ // 1. This account existed before we had wearables
+ // 2. The database has gotten messed up
+ // 3. This is the account's first login (i.e. the wearables haven't been generated yet).
return;
}
@@ -954,8 +964,6 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
gInventory.addObserver(outfit);
}
- if (LLInventoryModel::getIsFirstTimeInViewer2())
- gAgentWearables.populateMyOutfitsFolder();
}
}
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 26a81ab084..96925490cf 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -2518,6 +2518,10 @@ void LLInventoryModel::buildParentChildMap()
llwarns << "Found " << lost << " lost categories." << llendl;
}
+ const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null);
+ sFirstTimeInViewer2 = !COF_exists || gAgent.isFirstLogin();
+
+
// Now the items. We allocated in the last step, so now all we
// have to do is iterate over the items and put them in the right
// place.
@@ -2615,9 +2619,6 @@ void LLInventoryModel::buildParentChildMap()
notifyObservers();
}
}
-
- const BOOL COF_exists = (findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, FALSE) != LLUUID::null);
- sFirstTimeInViewer2 = !COF_exists;
}
struct LLUUIDAndName