Merge branch 'V2MultiWear' of git://github.com/Shyotl/SingularityViewer into V2MultiWear

Conflicts:
	indra/newview/llfloateravatarlist.cpp
	indra/newview/llfloatermessagelog.cpp
	indra/newview/llstartup.cpp
	indra/newview/llviewermenu.cpp
	indra/newview/llviewermessage.cpp
	indra/newview/skins/default/xui/fr/menu_inventory.xml
This commit is contained in:
Siana Gearz
2012-03-28 22:27:45 +02:00
264 changed files with 27606 additions and 15368 deletions

View File

@@ -205,6 +205,9 @@
#include "llwaterparammanager.h"
#include "llagentlanguage.h"
#include "llproxy.h"
#include "llwearable.h"
#include "llinventorybridge.h"
#include "llappearancemgr.h"
#include "jcfloaterareasearch.h"
// <edit>
@@ -234,12 +237,12 @@
// exported globals
//
bool gAgentMovementCompleted = false;
std::string gInitialOutfit;
std::string gInitialOutfitGender;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
LLPointer<LLViewerTexture> gStartTexture;
//
// Imported globals
//
@@ -250,7 +253,7 @@ extern S32 gStartImageHeight;
// local globals
//
LLPointer<LLViewerTexture> gStartTexture;
static LLHost gAgentSimHost;
static BOOL gSkipOptionalUpdate = FALSE;
@@ -258,6 +261,7 @@ static BOOL gSkipOptionalUpdate = FALSE;
static bool gGotUseCircuitCodeAck = false;
static std::string sInitialOutfit;
static std::string sInitialOutfitGender; // "male" or "female"
static boost::signals2::connection sWearablesLoadedCon;
static bool gUseCircuitCallbackCalled = false;
@@ -397,7 +401,7 @@ bool idle_startup()
// until initialization is complete, but need to be done here for things
// to work.
gIdleCallbacks.callFunctions();
gViewerWindow->handlePerFrameHover();
gViewerWindow->updateUI();
LLMortician::updateClass();
if (gNoRender)
@@ -1873,6 +1877,12 @@ bool idle_startup()
// OGPX : Inventory root might be null in OGP.
// && gAgent.mInventoryRootID.notNull())
{
std::string name = firstname;
std::string last_name = lastname;
LLStringUtil::toLower(last_name);
if(last_name != "resident")
name += " " + lastname;
gViewerWindow->getWindow()->setTitle(LLAppViewer::instance()->getWindowTitle() + "- " + name);
LLStartUp::setStartupState( STATE_WORLD_INIT );
}
else
@@ -2081,7 +2091,7 @@ bool idle_startup()
// <edit>
else if (gSavedSettings.getBOOL("RadarKeepOpen"))
{
LLFloaterAvatarList::createInstance(false);
LLFloaterAvatarList::getInstance()->close();
}
if (gSavedSettings.getBOOL("SHShowMediaTicker"))
{
@@ -2859,23 +2869,8 @@ bool idle_startup()
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
display_startup();
// We now have an inventory skeleton, so if this is a user's first
// login, we can start setting up their clothing and avatar
// appearance. This helps to avoid the generic "Ruth" avatar in
// the orientation island tutorial experience. JC
if (gAgent.isFirstLogin()
&& !sInitialOutfit.empty() // registration set up an outfit
&& !sInitialOutfitGender.empty() // and a gender
&& gAgentAvatarp // can't wear clothes without object
&& !gAgent.isGenderChosen() ) // nothing already loading
{
// Start loading the wearables, textures, gestures
LLStartUp::loadInitialOutfit( sInitialOutfit, sInitialOutfitGender );
}
display_startup();
// wait precache-delay and for agent's avatar or a lot longer.
if(((timeout_frac > 1.f) && isAgentAvatarValid())
|| (timeout_frac > 3.f))
@@ -2907,7 +2902,7 @@ bool idle_startup()
const F32 wearables_time = wearables_timer.getElapsedTimeF32();
const F32 MAX_WEARABLES_TIME = 10.f;
if (!gAgent.isGenderChosen())
if (!gAgent.isGenderChosen() && isAgentAvatarValid())
{
// No point in waiting for clothing, we don't even
// know what gender we are. Pop a dialog to ask and
@@ -3562,7 +3557,7 @@ void register_viewer_callbacks(LLMessageSystem* msg)
msg->setHandlerFuncFast(_PREHASH_AvatarAnimation, process_avatar_animation);
msg->setHandlerFuncFast(_PREHASH_AvatarAppearance, process_avatar_appearance);
msg->setHandlerFunc("AgentCachedTextureResponse", LLAgent::processAgentCachedTextureResponse);
msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatar::processRebakeAvatarTextures);
msg->setHandlerFunc("RebakeAvatarTextures", LLVOAvatarSelf::processRebakeAvatarTextures);
msg->setHandlerFuncFast(_PREHASH_CameraConstraint, process_camera_constraint);
msg->setHandlerFuncFast(_PREHASH_AvatarSitResponse, process_avatar_sit_response);
msg->setHandlerFunc("SetFollowCamProperties", process_set_follow_cam_properties);
@@ -3760,44 +3755,79 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response)
void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name,
const std::string& gender_name )
{
S32 gender = 0;
std::string gestures;
lldebugs << "starting" << llendl;
// Not going through the processAgentInitialWearables path, so need to set this here.
LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true);
// Initiate creation of COF, since we're also bypassing that.
gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
ESex gender;
if (gender_name == "male")
{
gender = OPT_MALE;
gestures = MALE_GESTURES_FOLDER;
lldebugs << "male" << llendl;
gender = SEX_MALE;
}
else
{
gender = OPT_FEMALE;
gestures = FEMALE_GESTURES_FOLDER;
lldebugs << "female" << llendl;
gender = SEX_FEMALE;
}
if (!isAgentAvatarValid())
{
llwarns << "Trying to load an initial outfit for an invalid agent avatar" << llendl;
return;
}
gAgentAvatarp->setSex(gender);
// try to find the outfit - if not there, create some default
// wearables.
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
LLNameCategoryCollector has_name(outfit_folder_name);
gInventory.collectDescendentsIf(LLUUID::null,
cat_array,
item_array,
LLInventoryModel::EXCLUDE_TRASH,
has_name);
if (0 == cat_array.count())
LLUUID cat_id = findDescendentCategoryIDByName(
gInventory.getLibraryRootFolderID(),
outfit_folder_name);
if (cat_id.isNull())
{
gAgentWearables.createStandardWearables(gender);
lldebugs << "standard wearables" << llendl;
gAgentWearables.createStandardWearables();
}
else
{
wear_outfit_by_name(outfit_folder_name);
sWearablesLoadedCon = gAgentWearables.addLoadedCallback(LLStartUp::saveInitialOutfit);
bool do_copy = true;
bool do_append = false;
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
LLAppearanceMgr::instance().wearInventoryCategory(cat, do_copy, do_append);
lldebugs << "initial outfit category id: " << cat_id << llendl;
}
wear_outfit_by_name(gestures);
wear_outfit_by_name(COMMON_GESTURES_FOLDER);
// This is really misnamed -- it means we have started loading
// an outfit/shape that will give the avatar a gender eventually. JC
gAgent.setGenderChosen(TRUE);
}
//static
void LLStartUp::saveInitialOutfit()
{
if (sInitialOutfit.empty()) {
lldebugs << "sInitialOutfit is empty" << llendl;
return;
}
if (sWearablesLoadedCon.connected())
{
lldebugs << "sWearablesLoadedCon is connected, disconnecting" << llendl;
sWearablesLoadedCon.disconnect();
}
lldebugs << "calling makeNewOutfitLinks( \"" << sInitialOutfit << "\" )" << llendl;
LLAppearanceMgr::getInstance()->makeNewOutfitLinks(sInitialOutfit,false);
}
std::string& LLStartUp::getInitialOutfitName()
{
return sInitialOutfit;
}
// Loads a bitmap to display during load
@@ -3836,22 +3866,32 @@ void init_start_screen(S32 location_id)
else if(!start_image_bmp->load(temp_str) )
{
LL_WARNS("AppInit") << "Bitmap load failed" << LL_ENDL;
return;
}
gStartImageWidth = start_image_bmp->getWidth();
gStartImageHeight = start_image_bmp->getHeight();
LLPointer<LLImageRaw> raw = new LLImageRaw;
if (!start_image_bmp->decode(raw, 0.0f))
{
LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL;
gStartTexture = NULL;
return;
}
else
{
gStartImageWidth = start_image_bmp->getWidth();
gStartImageHeight = start_image_bmp->getHeight();
LLPointer<LLImageRaw> raw = new LLImageRaw;
if (!start_image_bmp->decode(raw, 0.0f))
{
LL_WARNS("AppInit") << "Bitmap decode failed" << LL_ENDL;
gStartTexture = NULL;
}
else
{
raw->expandToPowerOfTwo();
gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ;
}
}
raw->expandToPowerOfTwo();
gStartTexture = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE) ;
if(gStartTexture.isNull())
{
gStartTexture = LLViewerTexture::sBlackImagep ;
gStartImageWidth = gStartTexture->getWidth() ;
gStartImageHeight = gStartTexture->getHeight() ;
}
}