From 049c1e16b098171f2401079472543e5e9995bcfe Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 25 Jan 2019 21:19:51 -0500 Subject: [PATCH 01/90] Aurora-Sim is now WhiteCore Minor Alchemy merge in removing llvlmanager, indra_constants no longer has *_LAYER_CODE --- indra/llcommon/indra_constants.h | 13 -- indra/llrender/llimagegl.cpp | 2 +- indra/newview/hippogridmanager.cpp | 6 +- indra/newview/hippogridmanager.h | 6 +- indra/newview/hippolimits.cpp | 6 +- indra/newview/hippolimits.h | 2 +- indra/newview/llenvmanager.cpp | 4 +- indra/newview/llmaniptranslate.cpp | 2 +- indra/newview/llmarketplacefunctions.cpp | 2 +- indra/newview/llpanellogin.cpp | 4 +- indra/newview/llviewerparcelmgr.cpp | 2 +- indra/newview/llvlmanager.cpp | 59 +++--- indra/newview/llvlmanager.h | 9 +- indra/newview/llworldmap.cpp | 6 +- .../newview/skins/default/xui/de/strings.xml | 192 ++++++------------ .../skins/default/xui/en-us/strings.xml | 72 +------ .../newview/skins/default/xui/es/strings.xml | 72 +------ 17 files changed, 133 insertions(+), 326 deletions(-) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index fab4f11eb..86fbba80c 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -140,19 +140,6 @@ const U32 DEFAULT_CGI_SERVICES_PORT = 12045; // on a single host for map tile generation. JC const U32 DEFAULT_MAPSERVER_PORT = 12124; -const char LAND_LAYER_CODE = 'L'; -const char WATER_LAYER_CODE = 'W'; -const char WIND_LAYER_CODE = '7'; -const char CLOUD_LAYER_CODE = '8'; - -// Aurora Sim -// Extended land layer for Aurora Sim -const char AURORA_LAND_LAYER_CODE = 'M'; -const char AURORA_WATER_LAYER_CODE = 'X'; -const char AURORA_WIND_LAYER_CODE = '9'; -const char AURORA_CLOUD_LAYER_CODE = ':'; -// Aurora Sim - enum ETerrainBrushType { // the valid brush numbers cannot be reordered, because they diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 968897dde..05bbebe85 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -572,7 +572,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // Check if dimensions are a power of two! if (!checkSize(width,height)) { - LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << LL_ENDL; + LL_WARNS() << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on WhiteCore, beware." << LL_ENDL; } if (mTexName) diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 5295aac95..f1f13906e 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -105,9 +105,9 @@ void HippoGridInfo::setPlatform(const std::string& platform) for (unsigned i=0; i= PLATFORM_LAST)) diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index 450cc35f7..73eeca2d7 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -26,7 +26,7 @@ class HippoGridInfo public: enum Platform { PLATFORM_OTHER = 0, - PLATFORM_AURORA, + PLATFORM_WHITECORE, PLATFORM_OPENSIM, PLATFORM_SECONDLIFE, PLATFORM_LAST @@ -35,8 +35,8 @@ public: explicit HippoGridInfo(const std::string& gridName); Platform getPlatform() { return mPlatform; } - bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM || mPlatform == PLATFORM_AURORA); } - bool isAurora() const { return (mPlatform == PLATFORM_AURORA); } + bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM || mPlatform == PLATFORM_WHITECORE); } + bool isWhiteCore() const { return (mPlatform == PLATFORM_WHITECORE); } bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); } bool isAvination() const { return mIsInAvination; } bool isInProductionGrid() const { llassert(mPlatform == PLATFORM_SECONDLIFE); return mIsInProductionGrid; } // Should only be called if isSecondLife() returns true. diff --git a/indra/newview/hippolimits.cpp b/indra/newview/hippolimits.cpp index 8e7462511..929686f70 100644 --- a/indra/newview/hippolimits.cpp +++ b/indra/newview/hippolimits.cpp @@ -21,8 +21,8 @@ void HippoLimits::setLimits() { if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { setSecondLifeLimits(); - } else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA) { - setAuroraLimits(); + } else if (gHippoGridManager->getConnectedGrid()->getPlatform() == HippoGridInfo::PLATFORM_WHITECORE) { + setWhiteCoreLimits(); } else { setOpenSimLimits(); } @@ -66,7 +66,7 @@ void HippoLimits::setOpenSimLimits() } } -void HippoLimits::setAuroraLimits() +void HippoLimits::setWhiteCoreLimits() { setMaxAgentGroups(); mMaxPrimScale = 8192.0f; diff --git a/indra/newview/hippolimits.h b/indra/newview/hippolimits.h index 0c119cd34..6c48fc298 100644 --- a/indra/newview/hippolimits.h +++ b/indra/newview/hippolimits.h @@ -27,7 +27,7 @@ private: void setMaxAgentGroups(); void setOpenSimLimits(); - void setAuroraLimits(); + void setWhiteCoreLimits(); void setSecondLifeLimits(); }; diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp index 4abd7fc8e..d2fb204cc 100644 --- a/indra/newview/llenvmanager.cpp +++ b/indra/newview/llenvmanager.cpp @@ -505,7 +505,7 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) mRegionSettingsChangeSignal(); // reset - if (!gHippoGridManager->getConnectedGrid()->isAurora()) // On Aurora, the region says when to refresh + if (!gHippoGridManager->getConnectedGrid()->isWhiteCore()) // On WhiteCore, the region says when to refresh mInterpNextChangeMessage = false; } @@ -704,7 +704,7 @@ void LLEnvManagerNew::onRegionChange() } } -// Aurora-sim windlight refresh +// WhiteCore windlight refresh class WindLightRefresh : public LLHTTPNode { /*virtual*/ void post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 4b8597ff0..cc17802f9 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -542,7 +542,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) { F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance"); - if (gHippoGridManager->getConnectedGrid()->isAurora()) + if (gHippoGridManager->getConnectedGrid()->isWhiteCore()) max_drag_distance = llmin(10000.f, max_drag_distance); if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance) diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d8c921b9b..23c46561b 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -84,7 +84,7 @@ static std::string getMarketplaceDomain() else { // TODO: Find out if OpenSim, and Avination adopted any outbox stuffs, if so code HippoGridManager for this - // Aurora grid has not. + // WhiteCore has not. // For now, set domain on other grids to the loginUri domain, so we don't harass LL web services. domain = getLoginUriDomain(); //gHippoGridManager->getCurrentGrid()->getMarketPlaceDomain(); } diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 71acaaafd..7906493ef 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -103,7 +103,7 @@ static bool nameSplit(const std::string& full, std::string& first, std::string& return false; first = fragments[0]; last = (fragments.size() == 1) ? - gHippoGridManager->getCurrentGrid()->isAurora() ? "" : "Resident" : + gHippoGridManager->getCurrentGrid()->isWhiteCore() ? "" : "Resident" : fragments[1]; return (fragments.size() <= 2); } @@ -843,7 +843,7 @@ void LLPanelLogin::loadLoginPage() { params["grid"] = gHippoGridManager->getCurrentGrid()->getGridNick(); } - else if (gHippoGridManager->getCurrentGrid()->getPlatform() == HippoGridInfo::PLATFORM_AURORA) + else if (gHippoGridManager->getCurrentGrid()->getPlatform() == HippoGridInfo::PLATFORM_WHITECORE) { params["grid"] = LLViewerLogin::getInstance()->getGridLabel(); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index c528e3f8f..069f65310 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -145,7 +145,7 @@ LLViewerParcelMgr::LLViewerParcelMgr() mCollisionParcel = new LLParcel(); // Aurora Sim - mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on Aurora and solves the audio problem. + mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on WhiteCore and solves the audio problem. //mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); // Aurora Sim mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index d570428bd..b4ec788f7 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -42,6 +42,16 @@ #include "llframetimer.h" #include "llsurface.h" +const char LAND_LAYER_CODE = 'L'; +const char WATER_LAYER_CODE = 'W'; +const char WIND_LAYER_CODE = '7'; +const char CLOUD_LAYER_CODE = '8'; + +const char WHITECORE_LAND_LAYER_CODE = 'M'; +const char WHITECORE_WATER_LAYER_CODE = 'X'; +const char WHITECORE_WIND_LAYER_CODE = '9'; +const char WHITECORE_CLOUD_LAYER_CODE = ':'; + LLVLManager gVLManager; LLVLManager::~LLVLManager() @@ -56,33 +66,22 @@ LLVLManager::~LLVLManager() void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) { -// Aurora Sim - //if (LAND_LAYER_CODE == vl_datap->mType) - if (LAND_LAYER_CODE == vl_datap->mType || AURORA_LAND_LAYER_CODE == vl_datap->mType) -// Aurora Sim + if (LAND_LAYER_CODE == vl_datap->mType || WHITECORE_LAND_LAYER_CODE == vl_datap->mType) { mLandBits += mesg_size * 8; } -// Aurora Sim - //else if (WIND_LAYER_CODE == vl_datap->mType) - else if (WIND_LAYER_CODE == vl_datap->mType || AURORA_WIND_LAYER_CODE == vl_datap->mType) -// Aurora Sim - { - mWindBits += mesg_size * 8; - } -// Aurora Sim - //else if (CLOUD_LAYER_CODE == vl_datap->mType) - else if (CLOUD_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) -// Aurora Sim - { - mCloudBits += mesg_size * 8; - } -// Aurora Sim - else if (WATER_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) + else if (WATER_LAYER_CODE == vl_datap->mType || WHITECORE_CLOUD_LAYER_CODE == vl_datap->mType) { mWaterBits += mesg_size * 8; } -// Aurora Sim + else if (WIND_LAYER_CODE == vl_datap->mType || WHITECORE_WIND_LAYER_CODE == vl_datap->mType) + { + mWindBits += mesg_size * 8; + } + else if (CLOUD_LAYER_CODE == vl_datap->mType || WHITECORE_CLOUD_LAYER_CODE == vl_datap->mType) + { + mCloudBits += mesg_size * 8; + } else { LL_ERRS() << "Unknown layer type!" << (S32)vl_datap->mType << LL_ENDL; @@ -108,19 +107,16 @@ void LLVLManager::unpackData(const S32 num_packets) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); } -// Aurora Sim - else if (AURORA_LAND_LAYER_CODE == datap->mType) + else if (WHITECORE_LAND_LAYER_CODE == datap->mType) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE); } - //else if (WIND_LAYER_CODE == datap->mType) - else if (WIND_LAYER_CODE == datap->mType || AURORA_WIND_LAYER_CODE == datap->mType) -// Aurora Sim + else if (WIND_LAYER_CODE == datap->mType || WHITECORE_WIND_LAYER_CODE == datap->mType) { datap->mRegionp->mWind.decompress(bit_pack, &goph); } - else if (CLOUD_LAYER_CODE == datap->mType || AURORA_CLOUD_LAYER_CODE == datap->mType) + else if (CLOUD_LAYER_CODE == datap->mType || WHITECORE_CLOUD_LAYER_CODE == datap->mType) { #if ENABLE_CLASSIC_CLOUDS datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph); @@ -156,6 +152,11 @@ S32 LLVLManager::getCloudBits() const return mCloudBits; } +S32 LLVLManager::getWaterBits() const +{ + return mWaterBits; +} + S32 LLVLManager::getTotalBytes() const { return mLandBits + mWindBits + mCloudBits; @@ -189,6 +190,6 @@ LLVLData::LLVLData(LLViewerRegion *regionp, const S8 type, U8 *data, const S32 s LLVLData::~LLVLData() { delete [] mData; - mData = NULL; - mRegionp = NULL; + mData = nullptr; + mRegionp = nullptr; } diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h index 153abfa53..03d26d0db 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -54,6 +54,7 @@ public: S32 getLandBits() const; S32 getWindBits() const; S32 getCloudBits() const; + S32 getWaterBits() const; void resetBitCounts(); @@ -64,9 +65,7 @@ protected: U32 mLandBits; U32 mWindBits; U32 mCloudBits; -// Aurora Sim U32 mWaterBits; -// Aurora Sim }; class LLVLData @@ -76,10 +75,10 @@ public: const S8 type, U8 *data, const S32 size); ~LLVLData(); - S8 mType; - U8 *mData; - S32 mSize; LLViewerRegion *mRegionp; + U8 *mData; + S8 mType; + S32 mSize; }; extern LLVLManager gVLManager; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 8f33a56ac..ceb147443 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -95,8 +95,8 @@ LLSimInfo::LLSimInfo(U64 handle) void LLSimInfo::setLandForSaleImage (LLUUID image_id) { - const bool is_aurora = gHippoGridManager->getConnectedGrid()->isAurora(); - if (is_aurora && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id)) + const bool is_whitecore = gHippoGridManager->getConnectedGrid()->isWhiteCore(); + if (is_whitecore && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id)) LLAppViewer::getTextureCache()->removeFromCache(image_id); mMapImageID[SIM_LAYER_OVERLAY] = image_id; @@ -105,7 +105,7 @@ void LLSimInfo::setLandForSaleImage (LLUUID image_id) if (mMapImageID[SIM_LAYER_OVERLAY].notNull()) { mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE); - if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate(); + if (is_whitecore) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate(); mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP); } else diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index 8d1ab98ee..495e6d8ef 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -1291,8 +1291,8 @@ Sets the given permission mask to the new value on the root object the task is a Please keep LL-LSL above this section ** DATA SOURCES ** OpenSim OS Functions: \OpenSim\Region\ScriptEngine\Shared\Api\Interface\IOSSL_Api.cs - Aurora-Sim AA Functions: \Aurora\AuroraDotNetEngine\APIs\AA_API.cs - Aurora-Sim BOT Functions: \Aurora\BotManager\Bot_API.cs + WhiteCore AA Functions: \WhiteCore\ScriptEngine\DotNetEngine\APIs\AA\AA_API.cs + WhiteCore BOT Functions: \WhiteCore\BotManager\Bot_API.cs --> osSetDynamicTextureURL(key dynamicID, string contentType, string url, string extraParams, integer timer ) @@ -1622,199 +1622,139 @@ Set the current WindLight scene directed at a specific avatar. Estate managers a list lsGetWindlightScene(list rules) Get the current WindLight settings. (Reguires LightShare Enabled Viewer) - osReturnObject(key userID) -Returns object to specified avatars UUID. -(Aurora-Sim only) +Returns object to specified avatars UUID. osReturnObjects(float Parameter) -Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2. -(Aurora-Sim only) +Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2. osShutDown() -Shut's down current Simulator. Authorized Admin Only by config. -(Aurora-Sim only) +Shut's down current Simulator. Authorized Admin Only by config. osAddAgentToGroup(key avatarID, string group_name, string role_name) -Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group. -(Aurora-Sim only) +Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group. osRezObject(string inventory, vector position, vector velocity, rotation rot, integer param, integer isRezAtRoot, integer doRecoil, integer SetDieAtEdge, integer CheckPos) Where inventory = object to rez. Position = vector to rez object. Velocity = initial velocity. Rot = initial rotation. Param = onrez event. IzAtRoot = TRUE/FALSE flag changes llRezAtRoot to llRezObject. doRecoil =TRUE/FALSE to push avatar. SetDieAtEdge = TRUE/FALSE for rezzed object to die at edge of region. -CheckPos = TRUE/FALSE enable/disable 10m rez limit. -(Aurora-Sim only) +CheckPos = TRUE/FALSE enable/disable 10m rez limit. aaSetCloudDensity(float density) -AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud. -(Aurora-Sim only) +AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud. aUpdateDatabase(string Key, string value, string token) -Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password -(Aurora-Sim only) +Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password aaQueryDatabase(string Key, string Token) Returns a list with first value is the token, the second the Key, and the third the value -Where Key = database field name, Token = data-password -(Aurora-Sim only) +Where Key = database field name, Token = data-password aaDeserializeXMLValues(string xmlData) -Returns a list of Values from XML data. Where xmlData = xml formatted data Values. -(Aurora-Sim only) +Returns a list of Values from XML data. Where xmlData = xml formatted data Values. aaDeserializeXMLKeys(string xmlData) -Returns a list of keys from XML data. Where xmlData = xml formatted data keys. -(Aurora-Sim only) +Returns a list of keys from XML data. Where xmlData = xml formatted data keys. aaSetConeOfSilence(float radius) -Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa. -(Aurora-Sim only) +Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa. aaSerializeXML(list keys, list values) -Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database. -(Aurora-Sim only) +Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database. aaGetTeam(key uuid) -Returns a string of avatars team name. Where uuid = avatar key. -(Aurora-Sim only) +Returns a string of avatars team name. Where uuid = avatar key. aaGetHealth(key uuid) -Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key. -(Aurora-Sim only) +Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key. aaJoinCombat(key uuid) -Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat. -(Aurora-Sim only) +Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat. aaLeaveCombat(key uuid) -Where uuid = avatar key. -(Aurora-Sim only) +Where uuid = avatar key. aaJoinCombatTeam(key uuid, string team) -Where uuid = key of avatar, team = string of the team name. -(Aurora-Sim only) +Where uuid = key of avatar, team = string of the team name. aaRequestCombatPermission(key ID) Where ID = avatar uuid. Requests target avatar for Permissions to enter into combat mode. -Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT). -(Aurora-Sim only) +Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT). aaThawAvatar(key ID) -Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled). -(Aurora-Sim only) +Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled). aaFreezeAvatar(key ID) -Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement). -(Aurora-Sim only) +Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement). aaGetTeamMembers(string team) -Return a list of team members. Where team = string of team name. -(Aurora-Sim only) +Return a list of team members. Where team = string of team name. POLYMORPHIC FUNCTION. aaGetLastOwner(string PrimID) returns last owner UUID of PrimID where PrimID = uuid of prim. -AaGetLastOwner() returns last owner uuid of prim containg script. -(Aurora-Sim only) +AaGetLastOwner() returns last owner uuid of prim containg script. aaSayDistance(integer channelID, float Distance, string text) -Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say. -(Aurora-Sim only) +Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say. aaSayTo(key userID, string text) -Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar. -(Aurora-Sim only) +Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar. aaGetWalkDisabled(key ID) -Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) +Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. aaSetWalkDisabled(key ID, integer Value) -Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly. -(Aurora-Sim only) +Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly. aaGetFlyDisabled(key ID) -Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) +Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. aaSetFlyDisabled(key ID, integer Value) -Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk. -(Aurora-Sim only) +Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk. aaAvatarFullName2Key(string FullName) -Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”. -(Aurora-Sim only) +Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”. aaRaiseError(string message) -Allows you to have errors that end the execution of the event and fire another event in the script. -(Aurora-Sim only) +Allows you to have errors that end the execution of the event and fire another event in the script. aaGetText() -Returns a string of the hover text of an object. -(Aurora-Sim only) +Returns a string of the hover text of an object. aaGetTextColor() -Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText. -(Aurora-Sim only) +Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText. aaSetEnv(string EnvName, list Value) Sets environment values. Where EnvName = ENABLE_GRAVITY, GRAVITY_FORCE_X, GRAVITY_FORCE_Y, GRAVITY_FORCE_Z, ADD_GRAVITY_POINT, ADD_GRAVITY_FORCE, START_TIME_REVERSAL_SAVING, -STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL. -(Aurora-Sim only) +STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL. aaGetIsInfiniteRegion() -Returns TRUE or FALSE if region is an infinite region. -(Aurora-Sim only) +Returns TRUE or FALSE if region is an infinite region. aaSetCharacterStat( ID, StatName, statValue) -Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to. -(Aurora-Sim only) - aaAllRegionInstanceSay(integer channelID, string text) -(Aurora-Sim only) +Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to. + aaAllRegionInstanceSay(integer channelID, string text) aaWindlightGetDayCycle() -Returns a List of settings -(Aurora-Sim only) +Returns a List of settings aaWindlightAddDayCycleFrame(float dayCyclePosition, integer dayCycleFrameToCopy) -Returns TRUE / FALSE on success status -(Aurora-Sim only) +Returns TRUE / FALSE on success status aaWindlightRemoveDayCycleFrame(int dayCycleFrame) -Returns TRUE / FALSE on success status -(Aurora-Sim only) +Returns TRUE / FALSE on success status aaWindlightSetScene(list list) aaWindlightSetScene(integer dayCycleIndex, list list) -Returns TRUE/FALSE on success -(Aurora-Sim only) +Returns TRUE/FALSE on success aaWindlightGetScene(list rules) aaWindlightGetScene(integer dayCycleKeyFrame, list rules) -Returns a list -(Aurora-Sim only) +Returns a list aaWindlightGetSceneIsStatic() -Returns TRUE / FALSE -(Aurora-Sim only) +Returns TRUE / FALSE aaWindlightGetSceneDayCycleKeyFrameCount() -Returns integer value -(Aurora-Sim only) +Returns integer value botGetWaitingTime(integer waitTime) -Returns waitTime as vector. -(Aurora-Sim only) +Returns waitTime as vector. botSetMap(key keyOfBot, list positions, list movementType, integer flags) keyOfBot = bot uuid, positions = list of position vectors, movementType = corresponding list of move modes: 0 – walk, 1 – fly, -flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY. -(Aurora-Sim only) +flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY. botCreateBot(string FirstName, string LastName, key idToClone, vector startPos) -Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region. -(Aurora-Sim only) +Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region. botRemoveBot(key botID) -Where botID = uuid of bot. Removes bot identified by botID. -(Aurora-Sim only) +Where botID = uuid of bot. Removes bot identified by botID. botPauseMovement(key botID) -Where botID = bot uuid. Pauses bot at current position. -(Aurora-Sim only) +Where botID = bot uuid. Pauses bot at current position. botResumeMovement(key botID) -Where botID = bot uuid. Resumes bot movement. -(Aurora-Sim only) +Where botID = bot uuid. Resumes bot movement. botFollowAvatar(key botID, string avName, float startFollowDistance, float endFollowDistance) -Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar. -(Aurora-Sim only) +Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar. botStopFollowAvatar(key botID) -Where botID = bot uuid. Stops bot from following an avatar. -(Aurora-Sim only) +Where botID = bot uuid. Stops bot from following an avatar. botSendChatMessage(key botID, string message, integer channel, integer sayType) -Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout). -(Aurora-Sim only) +Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout). botSendIM(string bot, string user, string message) -Send IM to bot. -(Aurora-Sim only) +Send IM to bot. botSetShouldFly(key botID, integer ShouldFly) -Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode. -(Aurora-Sim only) +Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode. botSitObject(key botID, key objectID, vector offset) -Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos). -(Aurora-Sim only) +Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos). botStandUp(key botID) -Where botID = bot uuid. Command bot to stand up. -(Aurora-Sim only) +Where botID = bot uuid. Command bot to stand up. botTouchObject(key botID, key objectID) -Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified. -(Aurora-Sim only) +Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified. botAddTag(key botID, string tag) -Where botID = bot uuid, tag = string tag over bot. -(Aurora-Sim only) +Where botID = bot uuid, tag = string tag over bot. botGetBotsWithTag(string tag) -Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag. -(Aurora-Sim only) +Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag. botRemoveBotsWithTag(string tag) -Where tag = tag string to match. Removes bot's matching the tag. -(Aurora-Sim only) - +Where tag = tag string to match. Removes bot's matching the tag. + Currently not set diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index af87e8956..309840fb6 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -2168,8 +2168,8 @@ Sets the given permission mask to the new value on the root object the task is a Please keep LL-LSL above this section ** DATA SOURCES ** OpenSim OS Functions: \OpenSim\Region\ScriptEngine\Shared\Api\Interface\IOSSL_Api.cs - Aurora-Sim AA Functions: \Aurora\AuroraDotNetEngine\APIs\AA_API.cs - Aurora-Sim BOT Functions: \Aurora\BotManager\Bot_API.cs + WhiteCore AA Functions: \WhiteCore\ScriptEngine\DotNetEngine\APIs\AA\AA_API.cs + WhiteCore BOT Functions: \WhiteCore\BotManager\Bot_API.cs --> @@ -2799,319 +2799,259 @@ list lsGetWindlightScene(list rules) Get the current WindLight settings. (Reguires LightShare Enabled Viewer) - osReturnObject(key userID) Returns object to specified avatars UUID. -(Aurora-Sim only) osReturnObjects(float Parameter) Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2. -(Aurora-Sim only) osShutDown() Shut's down current Simulator. Authorized Admin Only by config. -(Aurora-Sim only) osAddAgentToGroup(key avatarID, string group_name, string role_name) Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group. -(Aurora-Sim only) osRezObject(string inventory, vector position, vector velocity, rotation rot, integer param, integer isRezAtRoot, integer doRecoil, integer SetDieAtEdge, integer CheckPos) Where inventory = object to rez. Position = vector to rez object. Velocity = initial velocity. Rot = initial rotation. Param = onrez event. IzAtRoot = TRUE/FALSE flag changes llRezAtRoot to llRezObject. doRecoil =TRUE/FALSE to push avatar. SetDieAtEdge = TRUE/FALSE for rezzed object to die at edge of region. CheckPos = TRUE/FALSE enable/disable 10m rez limit. -(Aurora-Sim only) aaSetCloudDensity(float density) AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud. -(Aurora-Sim only) aUpdateDatabase(string Key, string value, string token) Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password -(Aurora-Sim only) aaQueryDatabase(string Key, string Token) Returns a list with first value is the token, the second the Key, and the third the value Where Key = database field name, Token = data-password -(Aurora-Sim only) aaDeserializeXMLValues(string xmlData) Returns a list of Values from XML data. Where xmlData = xml formatted data Values. -(Aurora-Sim only) aaDeserializeXMLKeys(string xmlData) Returns a list of keys from XML data. Where xmlData = xml formatted data keys. -(Aurora-Sim only) aaSetConeOfSilence(float radius) Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa. -(Aurora-Sim only) aaSerializeXML(list keys, list values) Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database. -(Aurora-Sim only) aaGetTeam(key uuid) Returns a string of avatars team name. Where uuid = avatar key. -(Aurora-Sim only) aaGetHealth(key uuid) Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key. -(Aurora-Sim only) aaJoinCombat(key uuid) Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat. -(Aurora-Sim only) aaLeaveCombat(key uuid) Where uuid = avatar key. -(Aurora-Sim only) aaJoinCombatTeam(key uuid, string team) Where uuid = key of avatar, team = string of the team name. -(Aurora-Sim only) aaRequestCombatPermission(key ID) Where ID = avatar uuid. Requests target avatar for Permissions to enter into combat mode. Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT). -(Aurora-Sim only) aaThawAvatar(key ID) Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled). -(Aurora-Sim only) aaFreezeAvatar(key ID) Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement). -(Aurora-Sim only) aaGetTeamMembers(string team) Return a list of team members. Where team = string of team name. -(Aurora-Sim only) POLYMORPHIC FUNCTION. aaGetLastOwner(string PrimID) returns last owner UUID of PrimID where PrimID = uuid of prim. AaGetLastOwner() returns last owner uuid of prim containg script. -(Aurora-Sim only) aaSayDistance(integer channelID, float Distance, string text) Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say. -(Aurora-Sim only) aaSayTo(key userID, string text) Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar. -(Aurora-Sim only) aaGetWalkDisabled(key ID) Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) aaSetWalkDisabled(key ID, integer Value) Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly. -(Aurora-Sim only) aaGetFlyDisabled(key ID) Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) aaSetFlyDisabled(key ID, integer Value) Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk. -(Aurora-Sim only) aaAvatarFullName2Key(string FullName) Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”. -(Aurora-Sim only) aaRaiseError(string message) Allows you to have errors that end the execution of the event and fire another event in the script. -(Aurora-Sim only) aaGetText() Returns a string of the hover text of an object. -(Aurora-Sim only) aaGetTextColor() Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText. -(Aurora-Sim only) aaSetEnv(string EnvName, list Value) Sets environment values. Where EnvName = ENABLE_GRAVITY, GRAVITY_FORCE_X, GRAVITY_FORCE_Y, GRAVITY_FORCE_Z, ADD_GRAVITY_POINT, ADD_GRAVITY_FORCE, START_TIME_REVERSAL_SAVING, STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL. -(Aurora-Sim only) aaGetIsInfiniteRegion() Returns TRUE or FALSE if region is an infinite region. -(Aurora-Sim only) aaSetCharacterStat( ID, StatName, statValue) Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to. -(Aurora-Sim only) aaAllRegionInstanceSay(integer channelID, string text) -(Aurora-Sim only) aaWindlightGetDayCycle() Returns a List of settings -(Aurora-Sim only) aaWindlightAddDayCycleFrame(float dayCyclePosition, integer dayCycleFrameToCopy) Returns TRUE / FALSE on success status -(Aurora-Sim only) aaWindlightRemoveDayCycleFrame(int dayCycleFrame) Returns TRUE / FALSE on success status -(Aurora-Sim only) aaWindlightSetScene(list list) aaWindlightSetScene(integer dayCycleIndex, list list) Returns TRUE/FALSE on success -(Aurora-Sim only) aaWindlightGetScene(list rules) aaWindlightGetScene(integer dayCycleKeyFrame, list rules) Returns a list -(Aurora-Sim only) aaWindlightGetSceneIsStatic() Returns TRUE / FALSE -(Aurora-Sim only) aaWindlightGetSceneDayCycleKeyFrameCount() Returns integer value -(Aurora-Sim only) botGetWaitingTime(integer waitTime) Returns waitTime as vector. -(Aurora-Sim only) botSetMap(key keyOfBot, list positions, list movementType, integer flags) keyOfBot = bot uuid, positions = list of position vectors, movementType = corresponding list of move modes: 0 – walk, 1 – fly, flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY. -(Aurora-Sim only) botCreateBot(string FirstName, string LastName, key idToClone, vector startPos) Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region. -(Aurora-Sim only) botRemoveBot(key botID) Where botID = uuid of bot. Removes bot identified by botID. -(Aurora-Sim only) botPauseMovement(key botID) Where botID = bot uuid. Pauses bot at current position. -(Aurora-Sim only) botResumeMovement(key botID) Where botID = bot uuid. Resumes bot movement. -(Aurora-Sim only) botFollowAvatar(key botID, string avName, float startFollowDistance, float endFollowDistance) Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar. -(Aurora-Sim only) botStopFollowAvatar(key botID) Where botID = bot uuid. Stops bot from following an avatar. -(Aurora-Sim only) botSendChatMessage(key botID, string message, integer channel, integer sayType) Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout). -(Aurora-Sim only) botSendIM(string bot, string user, string message) Send IM to bot. -(Aurora-Sim only) botSetShouldFly(key botID, integer ShouldFly) Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode. -(Aurora-Sim only) botSitObject(key botID, key objectID, vector offset) Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos). -(Aurora-Sim only) botStandUp(key botID) Where botID = bot uuid. Command bot to stand up. -(Aurora-Sim only) botTouchObject(key botID, key objectID) Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified. -(Aurora-Sim only) botAddTag(key botID, string tag) Where botID = bot uuid, tag = string tag over bot. -(Aurora-Sim only) botGetBotsWithTag(string tag) Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag. -(Aurora-Sim only) botRemoveBotsWithTag(string tag) Where tag = tag string to match. Removes bot's matching the tag. -(Aurora-Sim only) - + Item currently not set diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml index c2c361fe8..d318af75d 100644 --- a/indra/newview/skins/default/xui/es/strings.xml +++ b/indra/newview/skins/default/xui/es/strings.xml @@ -2166,8 +2166,8 @@ Sets the given permission mask to the new value on the root object the task is a Please keep LL-LSL above this section ** DATA SOURCES ** OpenSim OS Functions: \OpenSim\Region\ScriptEngine\Shared\Api\Interface\IOSSL_Api.cs - Aurora-Sim AA Functions: \Aurora\AuroraDotNetEngine\APIs\AA_API.cs - Aurora-Sim BOT Functions: \Aurora\BotManager\Bot_API.cs + WhiteCore AA Functions: \WhiteCore\ScriptEngine\DotNetEngine\APIs\AA\AA_API.cs + WhiteCore BOT Functions: \WhiteCore\BotManager\Bot_API.cs --> @@ -2796,319 +2796,259 @@ list lsGetWindlightScene(list rules) Get the current WindLight settings. (Reguires LightShare Enabled Viewer) - osReturnObject(key userID) Returns object to specified avatars UUID. -(Aurora-Sim only) osReturnObjects(float Parameter) Returns group of objects. Parameter's are numeric, values are owner objects = 0, everyone except owner objects = 1, group objects = 2. -(Aurora-Sim only) osShutDown() Shut's down current Simulator. Authorized Admin Only by config. -(Aurora-Sim only) osAddAgentToGroup(key avatarID, string group_name, string role_name) Adds an avatar to a group. Where group_name = name of the target group, role_name = role to assign within the group. -(Aurora-Sim only) osRezObject(string inventory, vector position, vector velocity, rotation rot, integer param, integer isRezAtRoot, integer doRecoil, integer SetDieAtEdge, integer CheckPos) Where inventory = object to rez. Position = vector to rez object. Velocity = initial velocity. Rot = initial rotation. Param = onrez event. IzAtRoot = TRUE/FALSE flag changes llRezAtRoot to llRezObject. doRecoil =TRUE/FALSE to push avatar. SetDieAtEdge = TRUE/FALSE for rezzed object to die at edge of region. CheckPos = TRUE/FALSE enable/disable 10m rez limit. -(Aurora-Sim only) aaSetCloudDensity(float density) AaSetCloudDensity(0.5) Where float density values are 0.0 = no cloud to 1.0 = 100% cloud. -(Aurora-Sim only) aUpdateDatabase(string Key, string value, string token) Where Key = database field name, xmlDataToPutIntoTheDatabase = serialized XML data, Token = data-password -(Aurora-Sim only) aaQueryDatabase(string Key, string Token) Returns a list with first value is the token, the second the Key, and the third the value Where Key = database field name, Token = data-password -(Aurora-Sim only) aaDeserializeXMLValues(string xmlData) Returns a list of Values from XML data. Where xmlData = xml formatted data Values. -(Aurora-Sim only) aaDeserializeXMLKeys(string xmlData) Returns a list of keys from XML data. Where xmlData = xml formatted data keys. -(Aurora-Sim only) aaSetConeOfSilence(float radius) Where radius = metres radius from centre of scripted item. This creates an area that sounds can only be heard by the people within the area(radius) and not heard outside and visa-versa. -(Aurora-Sim only) aaSerializeXML(list keys, list values) Returns xml formatted string of the keys and values. Where keys = list of keys in the database, values = fields to retrieve from database. -(Aurora-Sim only) aaGetTeam(key uuid) Returns a string of avatars team name. Where uuid = avatar key. -(Aurora-Sim only) aaGetHealth(key uuid) Returns float value (0.0 to 100.0) of current health. Where uuid = avatar key. -(Aurora-Sim only) aaJoinCombat(key uuid) Where uuid = avatar key. If (PERMISSION_COMBAT == PERMISSION_COMBAT) and permission is granted then join combat. -(Aurora-Sim only) aaLeaveCombat(key uuid) Where uuid = avatar key. -(Aurora-Sim only) aaJoinCombatTeam(key uuid, string team) Where uuid = key of avatar, team = string of the team name. -(Aurora-Sim only) aaRequestCombatPermission(key ID) Where ID = avatar uuid. Requests target avatar for Permissions to enter into combat mode. Raises a run_time_permissions event. (PERMISSION_COMBAT == PERMISSION_COMBAT). -(Aurora-Sim only) aaThawAvatar(key ID) Where ID = avatar uuid. If combat permission are granted then avatar can be un-frozen (movement re-enabled). -(Aurora-Sim only) aaFreezeAvatar(key ID) Where ID = avatar uuid. If combat permission are granted then avatar can be frozen (no movement). -(Aurora-Sim only) aaGetTeamMembers(string team) Return a list of team members. Where team = string of team name. -(Aurora-Sim only) POLYMORPHIC FUNCTION. aaGetLastOwner(string PrimID) returns last owner UUID of PrimID where PrimID = uuid of prim. AaGetLastOwner() returns last owner uuid of prim containg script. -(Aurora-Sim only) aaSayDistance(integer channelID, float Distance, string text) Where channelID = channel to say on, Distance = float in meters for distance to say, text = string to say. -(Aurora-Sim only) aaSayTo(key userID, string text) Where userID = avatar key, text = string msg. Similar to llOwnerSay but can be directly targeted to an avatar. -(Aurora-Sim only) aaGetWalkDisabled(key ID) Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) aaSetWalkDisabled(key ID, integer Value) Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables walk, forcing avatar to fly. -(Aurora-Sim only) aaGetFlyDisabled(key ID) Returns integer of TRUE or FALSE for specifid ID. Where ID = avatar uuid. -(Aurora-Sim only) aaSetFlyDisabled(key ID, integer Value) Where ID = avatar uuid, Value = TRUE or FALSE. If PERMISSION_COMBAT is accepted, this disables flying, forcing avatar to walk. -(Aurora-Sim only) aaAvatarFullName2Key(string FullName) Returns the avatar uuid from their fullname. Where FullName = "Firstname Lastname”. -(Aurora-Sim only) aaRaiseError(string message) Allows you to have errors that end the execution of the event and fire another event in the script. -(Aurora-Sim only) aaGetText() Returns a string of the hover text of an object. -(Aurora-Sim only) aaGetTextColor() Returns the hovertext color in rotation. Use Ex: rotation color = aaGetTextColor() to separate color.x, color.y, color.z, color.s Where s = value of alpha in llSetText. -(Aurora-Sim only) aaSetEnv(string EnvName, list Value) Sets environment values. Where EnvName = ENABLE_GRAVITY, GRAVITY_FORCE_X, GRAVITY_FORCE_Y, GRAVITY_FORCE_Z, ADD_GRAVITY_POINT, ADD_GRAVITY_FORCE, START_TIME_REVERSAL_SAVING, STOP_TIME_REVERSAL_SAVING, START_TIME_REVERSAL, STOP_TIME_REVERSAL. -(Aurora-Sim only) aaGetIsInfiniteRegion() Returns TRUE or FALSE if region is an infinite region. -(Aurora-Sim only) aaSetCharacterStat( ID, StatName, statValue) Sets Character Stats. Where ID = avatar uuid, StatName = stat to change, statValue the value to change it to. -(Aurora-Sim only) aaAllRegionInstanceSay(integer channelID, string text) -(Aurora-Sim only) aaWindlightGetDayCycle() Returns a List of settings -(Aurora-Sim only) aaWindlightAddDayCycleFrame(float dayCyclePosition, integer dayCycleFrameToCopy) Returns TRUE / FALSE on success status -(Aurora-Sim only) aaWindlightRemoveDayCycleFrame(int dayCycleFrame) Returns TRUE / FALSE on success status -(Aurora-Sim only) aaWindlightSetScene(list list) aaWindlightSetScene(integer dayCycleIndex, list list) Returns TRUE/FALSE on success -(Aurora-Sim only) aaWindlightGetScene(list rules) aaWindlightGetScene(integer dayCycleKeyFrame, list rules) Returns a list -(Aurora-Sim only) aaWindlightGetSceneIsStatic() Returns TRUE / FALSE -(Aurora-Sim only) aaWindlightGetSceneDayCycleKeyFrameCount() Returns integer value -(Aurora-Sim only) botGetWaitingTime(integer waitTime) Returns waitTime as vector. -(Aurora-Sim only) botSetMap(key keyOfBot, list positions, list movementType, integer flags) keyOfBot = bot uuid, positions = list of position vectors, movementType = corresponding list of move modes: 0 – walk, 1 – fly, flags = BOT_FOLLOW_FLAG_NONE and BOT_FOLLOW_FLAG_INDEFINITELY. -(Aurora-Sim only) botCreateBot(string FirstName, string LastName, key idToClone, vector startPos) Where FirstName and LastName = strings for new bot name. idToClone = uuid of prebuild avatar to clone OR another existing avatar. startPos = vector of starting position on region. -(Aurora-Sim only) botRemoveBot(key botID) Where botID = uuid of bot. Removes bot identified by botID. -(Aurora-Sim only) botPauseMovement(key botID) Where botID = bot uuid. Pauses bot at current position. -(Aurora-Sim only) botResumeMovement(key botID) Where botID = bot uuid. Resumes bot movement. -(Aurora-Sim only) botFollowAvatar(key botID, string avName, float startFollowDistance, float endFollowDistance) Where botID = bot uuid. AvName = sting of avatar name OR avatar uuid. StartFollowDistance = distance to start following from. EndFollowDistance = distance to stop following avatar. -(Aurora-Sim only) botStopFollowAvatar(key botID) Where botID = bot uuid. Stops bot from following an avatar. -(Aurora-Sim only) botSendChatMessage(key botID, string message, integer channel, integer sayType) Where botID = bot uuid. Message = string msg. Channel = channel to speak on. SayType = (0=whisper, 1=say, 2=shout). -(Aurora-Sim only) botSendIM(string bot, string user, string message) Send IM to bot. -(Aurora-Sim only) botSetShouldFly(key botID, integer ShouldFly) Where botID = bot uuid. ShouldFly = TRUE/FALSE. Enables or disables flight mode. -(Aurora-Sim only) botSitObject(key botID, key objectID, vector offset) Where botID = bot uuid, objectID = uuid of object to sit on, offset = Vector for sit position (note that VECTOR_ZERO = default sit pos). -(Aurora-Sim only) botStandUp(key botID) Where botID = bot uuid. Command bot to stand up. -(Aurora-Sim only) botTouchObject(key botID, key objectID) Where botID = bot uuid, objectID = object uuid. Causes bot to touch object identified. -(Aurora-Sim only) botAddTag(key botID, string tag) Where botID = bot uuid, tag = string tag over bot. -(Aurora-Sim only) botGetBotsWithTag(string tag) Where tag = tag string to match. Return a list of bot UUID's in region with the matching tag. -(Aurora-Sim only) botRemoveBotsWithTag(string tag) Where tag = tag string to match. Removes bot's matching the tag. -(Aurora-Sim only) - + No definido actualmente From 045234912c05d42e4f5883c3d91bcf04638dd374 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 26 Jan 2019 14:00:35 -0500 Subject: [PATCH 02/90] We can spell --- indra/newview/skins/default/xui/en-us/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index b13e4c8eb..8b768ad04 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -10634,7 +10634,7 @@ for information and download links for this new version. type="notify"> Your version of Singularity[TYPE] is critically out of date! -It is STRONGLY recommended to download a newer version of this viewer due to grid compatability and/or security concerns. +It is STRONGLY recommended to download a newer version of this viewer due to grid compatibility and/or security concerns. Click [Visit Page] to open [URL] @@ -10655,7 +10655,7 @@ for information and download links for newer versions. type="alertmodal"> Your version of Singularity[TYPE] is critically out of date! -It is STRONGLY recommended to download a newer version of this viewer due to grid compatability and/or security concerns. +It is STRONGLY recommended to download a newer version of this viewer due to grid compatibility and/or security concerns. Click [Visit Page] to open [URL] From 2f4689ba377785c6c99f84c375938f4710b53690 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 27 Jan 2019 20:11:46 -0500 Subject: [PATCH 03/90] Woops, forgot I decided not to make an icons subfolder in textures. --- .../skins/default/textures/textures.xml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index b9d30eb02..d7c0ff419 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -119,18 +119,18 @@ with the same filename but different name - - - - - - - - - - - - + + + + + + + + + + + + From 0f96939828100279fc1c621cc352d211373c955d Mon Sep 17 00:00:00 2001 From: Damian Zhaoying Date: Sun, 27 Jan 2019 14:44:14 -0300 Subject: [PATCH 04/90] Update Spanish Translations. --- .../skins/default/xui/es/menu_local_avs.xml | 33 +++++++++++++++++++ .../skins/default/xui/es/menu_texteditor.xml | 9 +++++ .../default/xui/es/menu_url_agent_mini.xml | 7 ++++ 3 files changed, 49 insertions(+) create mode 100644 indra/newview/skins/default/xui/es/menu_local_avs.xml create mode 100644 indra/newview/skins/default/xui/es/menu_texteditor.xml create mode 100644 indra/newview/skins/default/xui/es/menu_url_agent_mini.xml diff --git a/indra/newview/skins/default/xui/es/menu_local_avs.xml b/indra/newview/skins/default/xui/es/menu_local_avs.xml new file mode 100644 index 000000000..7e788cffa --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_local_avs.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/es/menu_texteditor.xml b/indra/newview/skins/default/xui/es/menu_texteditor.xml new file mode 100644 index 000000000..287d85b33 --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_texteditor.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/indra/newview/skins/default/xui/es/menu_url_agent_mini.xml b/indra/newview/skins/default/xui/es/menu_url_agent_mini.xml new file mode 100644 index 000000000..4f90aa20c --- /dev/null +++ b/indra/newview/skins/default/xui/es/menu_url_agent_mini.xml @@ -0,0 +1,7 @@ + + + + + + + From 674abf478bf469ed18b0262e310015c1b147d4af Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 28 Jan 2019 20:46:47 -0500 Subject: [PATCH 05/90] Fix skin previews, allow using images from paths on disk --- indra/newview/llpanelskins.cpp | 3 +-- indra/newview/llviewertexturelist.cpp | 12 ++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelskins.cpp b/indra/newview/llpanelskins.cpp index 53d5ce60f..834fd9832 100644 --- a/indra/newview/llpanelskins.cpp +++ b/indra/newview/llpanelskins.cpp @@ -116,8 +116,7 @@ void LLPanelSkins::refresh() LLButton* b = getChild("custom_skin_preview"); std::string imagename = data["preview_image"].asString(); if(imagename == "" || imagename == " " || !LLFile::isfile(imagename)) imagename = "preview.png"; - std::string imageprev(".."+gDirUtilp->getDirDelimiter()+ - ".."+gDirUtilp->getDirDelimiter()+ + std::string imageprev(path_name+ data["folder_name"].asString()+gDirUtilp->getDirDelimiter()+ "textures"+gDirUtilp->getDirDelimiter()+ imagename); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index f3e57ec72..90c684807 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -383,8 +383,16 @@ LLViewerFetchedTexture* LLViewerTextureList::getImageFromFile(const std::string& return NULL ; } - std::string full_path = gDirUtilp->findSkinnedFilename("textures", filename); - if (full_path.empty()) + // Singu Note: Detect if we were given a full path already, require being over a certain size, so we have more than just a path + bool full = filename.size() > +#ifdef LL_WINDOWS + 3 && filename.substr(1, 2) == ":\\"; // Drive letter comes first +#else + 1 && filename.front() == '/'; // delim is root +#endif + + std::string full_path = full ? filename : gDirUtilp->findSkinnedFilename("textures", filename); + if (full_path.empty() || (full && !gDirUtilp->fileExists(full_path))) { LL_WARNS() << "Failed to find local image file: " << filename << LL_ENDL; return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); From a7886443c5aa9f19fdb3e4f227a713d3590e9494 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 06:51:58 -0500 Subject: [PATCH 06/90] Do not color the : after names in local chat as a link! --- indra/newview/llfloaterchat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index ae912c8d4..87db308dd 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -213,8 +213,8 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& if (!chat.mURL.empty() && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) { - std::string start_line = line.substr(0, chat.mFromName.length() + 1); - line = line.substr(chat.mFromName.length() + 1); + std::string start_line = chat.mFromName; + line = line.substr(chat.mFromName.length()); LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL); sourceStyle->mItalic = is_irc; edit->appendText(start_line, false, prepend_newline, sourceStyle); From d20dbaa7d2b5acaf1127a462b98ba9c8e0e5b0f1 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 08:12:12 -0500 Subject: [PATCH 07/90] Feature Request: Allow use of a separate color for linked usernames. The setting is HTMLAgentColor, I will not add this to preferences for now. Note that usernames before the colon in the chat are cached, set before login to change it for everyone or relog. Also hook up getStyle() for the registered urls, cleans up some code in lltexteditor. --- indra/llui/lltexteditor.cpp | 21 +++++++----- indra/llui/llurlentry.cpp | 45 ++++++++++++------------- indra/llui/llurlentry.h | 10 +++--- indra/llui/llurlmatch.cpp | 6 ++-- indra/llui/llurlmatch.h | 6 ++-- indra/llui/llurlregistry.cpp | 4 +-- indra/newview/app_settings/settings.xml | 16 +++++++++ indra/newview/llstylemap.cpp | 2 +- 8 files changed, 65 insertions(+), 45 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 547db779f..4309d2567 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4268,7 +4268,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s { std::string text = new_text; static LLUICachedControl replace_links("SinguReplaceLinks"); - bool is_link = style && !style->getLinkHREF().empty(); // Don't search for URLs inside a link segment (STORM-358). + bool is_link = style && !style->isLink(); // Don't search for URLs inside a link segment (STORM-358). S32 part = (S32)LLTextParser::WHOLE; if (mReadOnly && mParseHTML && !is_link) // Singu Note: Do not replace html if the user is going to edit it. (Like in profiles) @@ -4276,16 +4276,21 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML); S32 start=0,end=0; LLUrlMatch match; - const auto& link_color = mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor"); auto append_substr = [&](const size_t& pos, const size_t& count) { appendAndHighlightText(text.substr(pos, count), part, style); }; - auto append_link = [&](const std::string& link) + auto append_link = [&](const std::string& link, LLStyleSP link_style) { - LLStyleSP link_style(style ? new LLStyle(*style) : new LLStyle); - link_style->setColor(link_color); - link_style->setLinkHREF(match.getUrl()); + if (style) // Respect styling + { + const auto& text_style = *style; + link_style->mItalic = text_style.mItalic; + link_style->mBold = text_style.mBold; + link_style->mUnderline = text_style.mUnderline; + } + // Hack around colors looking bad on some backgrounds by allowing setting link color for this editor + if (mLinkColor) link_style->setColor(*mLinkColor); appendAndHighlightText(link, part, link_style, true/*match.underlineOnHoverOnly()*/); }; while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, @@ -4323,7 +4328,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s }*/ // output the styled url - append_link(label + match.getQuery()); + append_link(label + match.getQuery(), match.getStyle()); bool tooltip_required = !match.getTooltip().empty(); // set the tooltip for the Url label @@ -4359,7 +4364,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s append_substr(start, brackets ? 1 : pos-start); // In the special cases, only link exactly the url, this might not have a protocol so calculate the exact string if (fallback) url = brackets ? text.substr(start+1, text.find(' ', start+2)-start) : text.substr(start, end-start); - append_link(url); // Append the link + append_link(url, match.getStyle()); // Append the link const auto url_end = pos + url.size(); if (fallback == brackets && end > url_end) // Ending text, only in special case if brackets present append_substr(url_end, end-url_end); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 0282ae626..2591bbeb8 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -69,14 +69,13 @@ std::string LLUrlEntryBase::getIcon(const std::string &url) return mIcon; } -/*LLStyle::Params LLUrlEntryBase::getStyle() const +LLStyleSP LLUrlEntryBase::getStyle() const { - LLStyle::Params style_params; - style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); - style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); - style_params.font.style = "UNDERLINE"; + static LLUICachedControl color("HTMLLinkColor"); + LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null)); + //style_params->mUnderline = true; // Singu Note: We're not gonna bother here, underlining on hover return style_params; -}*/ +} std::string LLUrlEntryBase::getIDStringFromUrl(const std::string &url) const @@ -677,13 +676,12 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa } } -/*LLStyle::Params LLUrlEntryAgent::getStyle() const +LLStyleSP LLUrlEntryAgent::getStyle() const { - LLStyle::Params style_params = LLUrlEntryBase::getStyle(); - style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); - style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + static LLUICachedControl color("HTMLAgentColor"); + LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null)); return style_params; -}*/ +} std::string localize_slapp_label(const std::string& url, const std::string& full_name) { @@ -788,11 +786,12 @@ std::string LLUrlEntryAgentName::getLabel(const std::string &url, const LLUrlLab } } -/*LLStyle::Params LLUrlEntryAgentName::getStyle() const +LLStyleSP LLUrlEntryAgentName::getStyle() const { - // don't override default colors - return LLStyle::Params().is_link(false); -}*/ + static LLUICachedControl color("HTMLAgentColor"); + LLStyleSP style_params(new LLStyle(true, color, LLStringUtil::null)); + return style_params; +} // // LLUrlEntryAgentCompleteName describes a Second Life agent complete name Url, e.g., @@ -924,13 +923,12 @@ std::string LLUrlEntryGroup::getLabel(const std::string &url, const LLUrlLabelCa } } -/*LLStyle::Params LLUrlEntryGroup::getStyle() const +LLStyleSP LLUrlEntryGroup::getStyle() const { - LLStyle::Params style_params = LLUrlEntryBase::getStyle(); - style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); - style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + LLStyleSP style_params = LLUrlEntryBase::getStyle(); + //style_params->mUnderline = false; // Singu Note: We're not gonna bother here, underlining on hover return style_params; -}*/ +} // @@ -1392,11 +1390,12 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC return getUrl(url); } -/*LLStyle::Params LLUrlEntryNoLink::getStyle() const +LLStyleSP LLUrlEntryNoLink::getStyle() const { // Don't render as URL (i.e. no context menu or hand cursor). - return LLStyle::Params().is_link(false); -}*/ + // Singu Note: What the heck? No, that's misleading!! + return LLUrlEntryBase::getStyle(); +} // diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index a772cf8c9..d526ea957 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -82,7 +82,7 @@ public: virtual std::string getIcon(const std::string &url); /// Return the style to render the displayed text - //virtual LLStyle::Params getStyle() const; + virtual LLStyleSP getStyle() const; /// Given a matched Url, return a tooltip string for the hyperlink virtual std::string getTooltip(const std::string &string) const { return mTooltip; } @@ -232,7 +232,7 @@ public: /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; /*virtual*/ std::string getIcon(const std::string &url) override; /*virtual*/ std::string getTooltip(const std::string &string) const override; - ///*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLStyleSP getStyle() const override; /*virtual*/ LLUUID getID(const std::string &string) const override; /*virtual*/ bool underlineOnHoverOnly(const std::string &string) const override; protected: @@ -265,7 +265,7 @@ public: } /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; - ///*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLStyleSP getStyle() const override; protected: // override this to pull out relevant name fields virtual std::string getName(const LLAvatarName& avatar_name) = 0; @@ -332,7 +332,7 @@ class LLUrlEntryGroup : public LLUrlEntryBase public: LLUrlEntryGroup(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; - ///*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLStyleSP getStyle() const override; /*virtual*/ LLUUID getID(const std::string &string) const override; private: void onGroupNameReceived(const LLUUID& id, const std::string& name, bool is_group); @@ -492,7 +492,7 @@ public: LLUrlEntryNoLink(); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override; /*virtual*/ std::string getUrl(const std::string &string) const override; - ///*virtual*/ LLStyle::Params getStyle() const override; + /*virtual*/ LLStyleSP getStyle() const override; }; /// diff --git a/indra/llui/llurlmatch.cpp b/indra/llui/llurlmatch.cpp index 3d4e808ec..717db6280 100644 --- a/indra/llui/llurlmatch.cpp +++ b/indra/llui/llurlmatch.cpp @@ -46,7 +46,7 @@ LLUrlMatch::LLUrlMatch() : void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string& query, const std::string &tooltip, - const std::string &icon, /*const LLStyle::Params& style,*/ + const std::string &icon, const LLStyleSP& style, const std::string &menu, const std::string &location, const LLUUID& id, bool underline_on_hover_only, bool trusted) { @@ -57,8 +57,8 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std mQuery = query; mTooltip = tooltip; mIcon = icon; - //mStyle = style; - //mStyle.link_href = url; + mStyle = style; + mStyle->setLinkHREF(url); mMenuName = menu; mLocation = location; mID = id; diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h index 67255d3ae..fc0b505ec 100644 --- a/indra/llui/llurlmatch.h +++ b/indra/llui/llurlmatch.h @@ -70,7 +70,7 @@ public: std::string getIcon() const { return mIcon; } /// Return the color to render the displayed text - //LLStyle::Params getStyle() const { return mStyle; } + LLStyleSP getStyle() const { return mStyle; } /// Return the name of a XUI file containing the context menu items std::string getMenuName() const { return mMenuName; } @@ -87,7 +87,7 @@ public: /// Change the contents of this match object (used by LLUrlRegistry) void setValues(U32 start, U32 end, const std::string &url, const std::string &label, const std::string& query, const std::string &tooltip, const std::string &icon, - /*const LLStyle::Params& style,*/ const std::string &menu, + const LLStyleSP& style, const std::string &menu, const std::string &location, const LLUUID& id, bool underline_on_hover_only = false, bool trusted = false); @@ -103,7 +103,7 @@ private: std::string mMenuName; std::string mLocation; LLUUID mID; - //LLStyle::Params mStyle; + LLStyleSP mStyle; bool mUnderlineOnHoverOnly; bool mTrusted; }; diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 92d85ff91..908531b0b 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -265,7 +265,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL match_entry->getQuery(url), match_entry->getTooltip(url), match_entry->getIcon(url), - //match_entry->getStyle(), + match_entry->getStyle(), match_entry->getMenuName(), match_entry->getLocation(url), match_entry->getID(url), @@ -302,7 +302,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr match.getQuery(), match.getTooltip(), match.getIcon(), - //match.getStyle(), + match.getStyle(), match.getMenuName(), match.getLocation(), match.getID(), diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c1e976a93..f786da72d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9072,6 +9072,22 @@ This should be as low as possible, but too low may break functionality Value 400 + HTMLAgentColor + + Comment + Color of hyperlinked usernames + Persist + 1 + Type + Color4 + Value + + 0.600000023842 + 0.600000023842 + 1.0 + 1.0 + + HTMLLinkColor Comment diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index a0c64505e..21467b768 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -58,7 +58,7 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source) LLStyleSP style(new LLStyle); if (source.notNull()) { - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSettings.getColor4("HTMLAgentColor")); std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); style->setLinkHREF(link); } From 0d22841da1acb9fd386b1a33f7f5610139a59903 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 10:13:07 -0500 Subject: [PATCH 08/90] Woops, that's some inverted logic! --- indra/llui/lltexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 4309d2567..b40c7c168 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4268,7 +4268,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s { std::string text = new_text; static LLUICachedControl replace_links("SinguReplaceLinks"); - bool is_link = style && !style->isLink(); // Don't search for URLs inside a link segment (STORM-358). + bool is_link = style && style->isLink(); // Don't search for URLs inside a link segment (STORM-358). S32 part = (S32)LLTextParser::WHOLE; if (mReadOnly && mParseHTML && !is_link) // Singu Note: Do not replace html if the user is going to edit it. (Like in profiles) From 3054be307e4508afe2b00ed17c10646cd042c8a0 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 10:15:05 -0500 Subject: [PATCH 09/90] Do it for object names too, otherwise talking through scripts looks wrong Also this is needed for local chat ^^; --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llstylemap.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f786da72d..9baecde77 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9075,7 +9075,7 @@ This should be as low as possible, but too low may break functionality HTMLAgentColor Comment - Color of hyperlinked usernames + Color of hyperlinked user/object names Persist 1 Type diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index 21467b768..ff6159e4e 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -77,7 +77,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link) LLStyleSP style(new LLStyle); if (id.notNull() && !link.empty()) { - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSettings.getColor4("HTMLAgentColor")); style->setLinkHREF(link); } else @@ -102,6 +102,6 @@ void LLStyleMap::update() { LLStyleSP &style = iter->second; // Update the link color in case it has been changed. - style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); + style->setColor(gSavedSettings.getColor4("HTMLAgentColor")); } } From 1ec0eed8674b0ef26a95aff4229741fab1791fab Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 10:27:41 -0500 Subject: [PATCH 10/90] Use link color for names in radar alerts, not white. --- indra/newview/llfloateravatarlist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index c1cb88026..de4ecd451 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -112,6 +112,7 @@ namespace if (radar_show_dist) chat.mText += llformat(" (%.2fm)", dist); } chat.mFromName = name; + chat.mFromID = key; if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) // RLVa:LF - No way! chat.mURL = llformat("secondlife:///app/agent/%s/about", key.asString().c_str()); chat.mSourceType = CHAT_SOURCE_SYSTEM; From b47ff37612431ee820037768a18bdad9f47985fb Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 11:54:55 -0500 Subject: [PATCH 11/90] Allow clicking on pictures in profiles and picks to open them Only works if it's not gonna spawn a texture picture, of course. --- indra/newview/llpanelavatar.cpp | 19 +++++++++++++++---- indra/newview/llpanelgroupgeneral.cpp | 5 ++++- indra/newview/llpanelpick.cpp | 5 ++++- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 285b47c4f..d1a431917 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -380,21 +380,32 @@ BOOL LLPanelAvatarSecondLife::postBuild() LLTextureCtrl* ctrl = getChild("img"); ctrl->setFallbackImageName("default_profile_picture.j2c"); + auto show_pic = [&] + { + show_picture(getChild("img")->getImageAssetID(), profile_picture_title(getChildView("dnname")->getValue())); + }; + auto show_pic_if_not_self = [=] { if (!ctrl->canChange()) show_pic(); }; - getChild("bigimg")->setCommitCallback(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, ctrl), boost::bind(profile_picture_title, boost::bind(&LLView::getValue, getChild("dnname")))))); + ctrl->setMouseUpCallback(std::bind(show_pic_if_not_self)); + getChild("bigimg")->setCommitCallback(std::bind(show_pic)); return TRUE; } BOOL LLPanelAvatarFirstLife::postBuild() { - BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); - enableControls(own_avatar); + enableControls(getPanelAvatar()->getAvatarID() == gAgentID); LLTextureCtrl* ctrl = getChild("img"); ctrl->setFallbackImageName("default_profile_picture.j2c"); + auto show_pic = [&] + { + show_picture(getChild("img")->getImageAssetID(), "First Life Picture"); + }; + auto show_pic_if_not_self = [=] { if (!ctrl->canChange()) show_pic(); }; - getChild("flbigimg")->setCommitCallback(boost::bind(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, ctrl), "First Life Picture")))); + ctrl->setMouseUpCallback(std::bind(show_pic_if_not_self)); + getChild("flbigimg")->setCommitCallback(std::bind(show_pic)); return TRUE; } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 94047f771..c09f96dcf 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -130,7 +130,10 @@ BOOL LLPanelGroupGeneral::postBuild() mInsignia->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny,this)); mDefaultIconID = mInsignia->getImageAssetID(); void show_picture(const LLUUID& id, const std::string& name); - getChild("bigimg")->setCommitCallback(boost::bind(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mInsignia), "Group Insignia"))); + auto show_pic = [this] { show_picture(mInsignia->getImageAssetID(), "Group Insignia"); }; + auto show_pic_if_not_self = [=] { if (!mInsignia->canChange()) show_pic(); }; + mInsignia->setMouseUpCallback(std::bind(show_pic_if_not_self)); + getChild("bigimg")->setCommitCallback(std::bind(show_pic)); } mEditCharter = getChild("charter", recurse); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 55e58a4c9..51fbd5f43 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -126,8 +126,11 @@ void LLPanelPick::reset() BOOL LLPanelPick::postBuild() { + auto show_pic = [this] { show_picture(mSnapshotCtrl->getImageAssetID(), mNameEditor->getText()); }; + auto show_pic_if_not_self = [=] { if (!mSnapshotCtrl->canChange()) show_pic(); }; mSnapshotCtrl = getChild("snapshot_ctrl"); mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); + mSnapshotCtrl->setMouseUpCallback(std::bind(show_pic_if_not_self)); mNameEditor = getChild("given_name_editor"); mNameEditor->setCommitOnFocusLost(true); @@ -144,7 +147,7 @@ BOOL LLPanelPick::postBuild() mSetBtn->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this)); mOpenBtn = getChild("open_picture_btn"); - mOpenBtn->setCommitCallback(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mSnapshotCtrl), boost::bind(&LLLineEditor::getText, mNameEditor))); + mOpenBtn->setCommitCallback(std::bind(show_pic)); getChild("pick_teleport_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); getChild("pick_map_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickMap,this)); From d08d2fdec8dbdb78380e1800446cdee13a89428b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 1 Feb 2019 11:55:15 -0500 Subject: [PATCH 12/90] Don't open a null id picture. --- indra/newview/llpanelpick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 51fbd5f43..899210edb 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -61,7 +61,7 @@ void show_picture(const LLUUID& id, const std::string& name) { // Try to show and focus existing preview - if (LLPreview::show(id)) return; + if (id.isNull() || LLPreview::show(id)) return; // If there isn't one, make a new preview S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); From a45b4ffb43056ed9e66cce3c287c457aa096c48e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 2 Feb 2019 13:56:11 -0500 Subject: [PATCH 13/90] Code cleanup --- indra/newview/llfloaterchat.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 87db308dd..b1fc6b39a 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -200,7 +200,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& if (chat.mSourceType == CHAT_SOURCE_OBJECT) { LLStringUtil::trim(chat.mFromName); - if (!chat.mFromName.length()) + if (chat.mFromName.empty()) { chat.mFromName = LLTrans::getString("Unnamed"); line = chat.mFromName + line; @@ -211,13 +211,12 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& bool is_irc = italicize && chat.mChatStyle == CHAT_STYLE_IRC; // If the chat line has an associated url, link it up to the name. if (!chat.mURL.empty() - && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) + && (!chat.mFromName.empty() && line.find(chat.mFromName,0) == 0)) { - std::string start_line = chat.mFromName; line = line.substr(chat.mFromName.length()); LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL); sourceStyle->mItalic = is_irc; - edit->appendText(start_line, false, prepend_newline, sourceStyle); + edit->appendText(chat.mFromName, false, prepend_newline, sourceStyle); prepend_newline = false; } LLStyleSP style(new LLStyle); From 3546b5777b82362951ac5119c5960eabc2f54c32 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 2 Feb 2019 13:57:01 -0500 Subject: [PATCH 14/90] Oops, these are needed for the texture picker clicker --- indra/newview/lltexturectrl.cpp | 2 +- indra/newview/lltexturectrl.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 5481c3c1f..890e81410 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -1306,7 +1306,7 @@ void LLTextureCtrl::setEnabled( BOOL enabled ) mCaption->setEnabled( enabled ); mEnable = enabled; - LLView::setEnabled( enabled ); + //LLView::setEnabled( enabled ); // } void LLTextureCtrl::setValid(BOOL valid ) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 718aa1106..5d43dfdf0 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -150,6 +150,8 @@ public: void onFloaterCommit(ETexturePickOp op); void onFloaterCommit(ETexturePickOp op, LLUUID id); // tag: vaa emerald local_asset_browser + bool canChange() { return mEnable; } // + // This call is returned when a drag is detected. Your callback // should return TRUE if the drag is acceptable. void setDragCallback(drag_n_drop_callback cb) { mDragCallback = cb; } From dc96269bc66adcb249b41b3b7c1e53a69281243f Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 2 Feb 2019 18:39:33 -0500 Subject: [PATCH 15/90] Do not grab focus during login, seriously uncool. --- indra/newview/llstartup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 88da7fc15..b58f5cd04 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -944,7 +944,9 @@ bool idle_startup() display_startup(); // Push our window frontmost - gViewerWindow->getWindow()->show(); + // Singu Note: Actually, don't! But flash the window to let the user know + if (gSavedSettings.getBOOL("LiruFlashWhenMinimized")) // No, we're not minimized, but if you flash my bar, I will give you the biggest SIGSEGV ~Liru <3 + gViewerWindow->getWindow()->flashIcon(5.f); display_startup(); // DEV-16927. The following code removes errant keystrokes that happen while the window is being From 82087301307c5381f3d1f3b6b0e7d2f0a679200e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 2 Feb 2019 18:41:27 -0500 Subject: [PATCH 16/90] No more temp upload on SL, don't waste the users' time. --- indra/newview/llviewermenufile.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index f99b3c7be..9b9fdd105 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -409,11 +409,17 @@ class LLFileUploadBulk : public view_listener_t // // Also fix single upload to charge first, then refund // - S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree"; - LLSD args; - args["UPLOADCOST"] = gHippoGridManager->getConnectedGrid()->getUploadFee(); - LLNotificationsUtil::add(notification_type, args, LLSD(), onConfirmBulkUploadTemp); + const auto grid(gHippoGridManager->getConnectedGrid()); + if (grid->isSecondLife()) // For SL, we can't do temp uploads anymore. + { + doBulkUpload(); + } + else + { + S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + const char* notification_type = expected_upload_cost ? "BulkTemporaryUpload" : "BulkTemporaryUploadFree"; + LLNotificationsUtil::add(notification_type, LLSD().with("UPLOADCOST", grid->getUploadFee()), LLSD(), onConfirmBulkUploadTemp); + } return true; } @@ -428,10 +434,15 @@ class LLFileUploadBulk : public view_listener_t else // cancel return false; + doBulkUpload(enabled); + return true; + } + + static void doBulkUpload(bool temp = false) + { AIFilePicker* filepicker = AIFilePicker::create(); filepicker->open(FFLOAD_ALL, "", "openfile", true); - filepicker->run(boost::bind(&LLFileUploadBulk::onConfirmBulkUploadTemp_continued, enabled, filepicker)); - return true; + filepicker->run(boost::bind(&LLFileUploadBulk::onConfirmBulkUploadTemp_continued, temp, filepicker)); } static void onConfirmBulkUploadTemp_continued(bool enabled, AIFilePicker* filepicker) From 6c219bd6280df3e4cf9e9144af4c4eaa9e5e4f12 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 2 Feb 2019 18:42:15 -0500 Subject: [PATCH 17/90] Feature Request: Shouts should be in bold. Yes, they should. --- indra/newview/llfloaterchat.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index b1fc6b39a..adaff4652 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -222,6 +222,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& LLStyleSP style(new LLStyle); style->setColor(color); style->mItalic = is_irc; + style->mBold = chat.mChatType == CHAT_TYPE_SHOUT; edit->appendText(line, false, prepend_newline, style); } From 50f7893b2f0bbb574d22470bd5262023b1bc8e0a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 05:55:01 -0500 Subject: [PATCH 18/90] Add back the install while running viewer option --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index f6b27eb7a..3515d980d 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -326,7 +326,7 @@ Function CloseSecondLife IntCmp $0 0 DONE StrCmp $SKIP_DIALOGS "true" CLOSE - MessageBox MB_OKCANCEL $(CloseSecondLifeInstMB) IDOK CLOSE IDCANCEL CANCEL_INSTALL + MessageBox MB_YESNOCANCEL $(CloseSecondLifeInstMB) IDYES CLOSE IDNO DONE CANCEL_INSTALL: Quit From c03250f09bdb698f4524c5d68ebb088f30fa3ea2 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 10:05:41 -0500 Subject: [PATCH 19/90] Do this better --- indra/newview/llfloaterchat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index adaff4652..5fe89a400 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -211,7 +211,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& bool is_irc = italicize && chat.mChatStyle == CHAT_STYLE_IRC; // If the chat line has an associated url, link it up to the name. if (!chat.mURL.empty() - && (!chat.mFromName.empty() && line.find(chat.mFromName,0) == 0)) + && boost::algorithm::starts_with(line, chat.mFromName)) { line = line.substr(chat.mFromName.length()); LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL); From 45c7c711ad6a878ab2650feb22899353f8ac3063 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 12:31:36 -0500 Subject: [PATCH 20/90] You need to wake upYou need to wake upYou need to wake upYou need to wake up YouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUp ouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpY uNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYo NeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYou eedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouN edToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNe dToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNee ToWakeUpYouNeedToWakeUpNeedWAKEUPNeedYouNeedYouWakeUpYouNeed oWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedT WakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedTo akeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToW keUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWa eUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWak UpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWake pYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeUpYouNeedToWakeU [~~~~~~~~~~~~~~~~~~~~~~~~~~WakeUp~~~~~~~~~~~~~~~~~~~~~~~~~~] --- indra/llwindow/llwindow.h | 2 +- indra/llwindow/llwindowheadless.h | 2 +- indra/llwindow/llwindowmesaheadless.h | 2 +- indra/llwindow/llwindowsdl.cpp | 2 +- indra/llwindow/llwindowsdl.h | 2 +- indra/llwindow/llwindowwin32.cpp | 3 ++- indra/llwindow/llwindowwin32.h | 2 +- indra/newview/llstartup.cpp | 4 +++- 8 files changed, 11 insertions(+), 8 deletions(-) diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index d0cb3802d..cf92c3a51 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -66,7 +66,7 @@ public: }; public: virtual void postInitialized() {} - virtual void show() = 0; + virtual void show(bool focus = true) = 0; virtual void hide() = 0; virtual void close() = 0; virtual BOOL getVisible() = 0; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 491f9afd2..ae3cd90f2 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -32,7 +32,7 @@ class LLWindowHeadless : public LLWindow { public: - /*virtual*/ void show() {}; + /*virtual*/ void show(bool) {}; /*virtual*/ void hide() {}; /*virtual*/ void close() {}; /*virtual*/ BOOL getVisible() {return FALSE;}; diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 6c0e872e2..e85c27f87 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -35,7 +35,7 @@ class LLWindowMesaHeadless : public LLWindow { public: - /*virtual*/ void show() {}; + /*virtual*/ void show(bool) {}; /*virtual*/ void hide() {}; /*virtual*/ void close() {}; /*virtual*/ BOOL getVisible() {return FALSE;}; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 2ca113f55..3d6919393 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -790,7 +790,7 @@ LLWindowSDL::~LLWindowSDL() } -void LLWindowSDL::show() +void LLWindowSDL::show(bool focus) { // *FIX: What to do with SDL? } diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index a180be319..9a80856c5 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -49,7 +49,7 @@ class LLWindowSDL : public LLWindow { public: - /*virtual*/ void show(); + /*virtual*/ void show(bool focus); /*virtual*/ void hide(); /*virtual*/ void close(); /*virtual*/ BOOL getVisible(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 4a3a043d4..a12e4a1de 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -717,9 +717,10 @@ void LLWindowWin32::postInitialized() mCallbacks->handleDPIScaleChange(this, xDPIScale, yDPIScale); } -void LLWindowWin32::show() +void LLWindowWin32::show(bool take_focus) { ShowWindow(mWindowHandle, SW_SHOW); + if (!take_focus) return; SetForegroundWindow(mWindowHandle); SetFocus(mWindowHandle); } diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 4f8693dbe..ca82f7512 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -41,7 +41,7 @@ class LLWindowWin32 : public LLWindow { public: /*virtual*/ void postInitialized(); - /*virtual*/ void show(); + /*virtual*/ void show(bool focus = true); /*virtual*/ void hide(); /*virtual*/ void close(); /*virtual*/ BOOL getVisible(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b58f5cd04..56e690bf7 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -945,8 +945,10 @@ bool idle_startup() // Push our window frontmost // Singu Note: Actually, don't! But flash the window to let the user know + auto& window(*gViewerWindow->getWindow()); + window.show(false); if (gSavedSettings.getBOOL("LiruFlashWhenMinimized")) // No, we're not minimized, but if you flash my bar, I will give you the biggest SIGSEGV ~Liru <3 - gViewerWindow->getWindow()->flashIcon(5.f); + window.flashIcon(5.f); display_startup(); // DEV-16927. The following code removes errant keystrokes that happen while the window is being From a0875697cd401e8bf23bc5620ac3a0f3ce439fde Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 12:31:49 -0500 Subject: [PATCH 21/90] Fix warning --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 3515d980d..8ff723f76 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -328,7 +328,7 @@ Function CloseSecondLife StrCmp $SKIP_DIALOGS "true" CLOSE MessageBox MB_YESNOCANCEL $(CloseSecondLifeInstMB) IDYES CLOSE IDNO DONE - CANCEL_INSTALL: +; CANCEL_INSTALL: Quit CLOSE: From d29832ce5c9d1a2de1bdfc021dc6076b4ee26ad7 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 17:00:05 -0500 Subject: [PATCH 22/90] Copy SLURL not SLurl, SLurl looks weird!! --- indra/newview/skins/default/xui/en-us/menu_url_agent.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_experience.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_group.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_inventory.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_map.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_objectim.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_parcel.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_slapp.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_slurl.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_url_teleport.xml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml index 96f771d43..f369c0ba7 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml @@ -41,7 +41,7 @@ function="Text.Url" userdata="CopyLabel" /> Date: Sun, 3 Feb 2019 17:38:43 -0500 Subject: [PATCH 23/90] Right click linked names/groups/objects in chat, copy key --- indra/llui/lltexteditor.cpp | 24 +++++++++++++++---- .../default/xui/en-us/menu_url_agent.xml | 3 +++ .../default/xui/en-us/menu_url_agent_mini.xml | 3 +++ .../default/xui/en-us/menu_url_experience.xml | 3 +++ .../default/xui/en-us/menu_url_group.xml | 3 +++ .../default/xui/en-us/menu_url_objectim.xml | 3 +++ 6 files changed, 35 insertions(+), 4 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index b40c7c168..5aae494be 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -406,12 +406,13 @@ class ContextText : public LLMemberListener } }; +static const std::string& get_focused_url() +{ + return get_focused_text_editor()->getMenuSegmentUrl(); +} + class ContextUrl : public LLMemberListener { - static const std::string& get_focused_url() - { - return get_focused_text_editor()->getMenuSegmentUrl(); - } bool handleEvent(LLPointer, const LLSD& userdata) override { const auto& url = get_focused_url(); @@ -434,6 +435,20 @@ class ContextUrl : public LLMemberListener } }; +class ContextUrlCopy : public LLMemberListener +{ + + bool handleEvent(LLPointer, const LLSD& userdata) override + { + const auto& url = get_focused_url(); + const auto& type = userdata.asStringRef(); + // Empty works like avatar and group, "object" is an object (you needed to be told this) + const auto& id = type.empty() ? LLUrlAction::getUserID(url) : LLUrlAction::getObjectId(url); + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(id)); + return true; + } +}; + void LLTextEditor::spell_correct(void* data) { @@ -516,6 +531,7 @@ void LLTextEditor::addMenuListeners() { (new ContextText)->registerListener(LLMenuGL::sMenuContainer, "Text"); (new ContextUrl)->registerListener(LLMenuGL::sMenuContainer, "Text.Url"); + (new ContextUrlCopy)->registerListener(LLMenuGL::sMenuContainer, "Text.Url.CopyUUID"); } void LLTextEditor::setTrackColor( const LLColor4& color ) diff --git a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml index f369c0ba7..f9403282e 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_agent.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_agent.xml @@ -47,6 +47,9 @@ + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml b/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml index 8475a6000..ba3c272d7 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_agent_mini.xml @@ -26,6 +26,9 @@ + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_url_experience.xml b/indra/newview/skins/default/xui/en-us/menu_url_experience.xml index 73261b3a0..24a9f4095 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_experience.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_experience.xml @@ -10,6 +10,9 @@ + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_url_group.xml b/indra/newview/skins/default/xui/en-us/menu_url_group.xml index d631beed2..99b8c6d67 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_group.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_group.xml @@ -26,6 +26,9 @@ + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_url_objectim.xml b/indra/newview/skins/default/xui/en-us/menu_url_objectim.xml index 50551b14a..befbada9a 100644 --- a/indra/newview/skins/default/xui/en-us/menu_url_objectim.xml +++ b/indra/newview/skins/default/xui/en-us/menu_url_objectim.xml @@ -56,6 +56,9 @@ + + + From 62628a66bd8895856023ed74f3d96f676bdcb69c Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 18:36:49 -0500 Subject: [PATCH 24/90] Have a menu for agent slurls with name types. --- indra/llui/llurlentry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 2591bbeb8..4a5653b14 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -731,7 +731,9 @@ std::string LLUrlEntryAgent::getIcon(const std::string &url) // x-grid-info://lincoln.lindenlab.com/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/(completename|displayname|username) // LLUrlEntryAgentName::LLUrlEntryAgentName() -{} +{ + mMenuName = "menu_url_agent.xml"; +} void LLUrlEntryAgentName::onAvatarNameCache(const LLUUID& id, const LLAvatarName& av_name) From d2a42e47ce4633b6c5c2b1f97a418b2b2837f24a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 3 Feb 2019 18:37:51 -0500 Subject: [PATCH 25/90] Make agent slurls with name types open profile on click --- indra/newview/llpanelprofile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index d35d481ab..e40747eee 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -98,7 +98,7 @@ public: std::string verb = params[1].asString(); for (; !verb.empty() && std::ispunct(verb.back()); verb.pop_back()); - if (verb == "about") + if (verb == "about" || verb == "completename" || verb == "displayname" || verb == "username") { LLAvatarActions::showProfile(avatar_id); return true; From e53682062950d4571a1fb80f662a32c2399e4c3f Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 4 Feb 2019 16:45:49 -0500 Subject: [PATCH 26/90] Autoreplace can be as long as chat input --- indra/newview/skins/default/xui/en-us/floater_autoreplace.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml b/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml index 4f24a3da9..304049b1d 100644 --- a/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml +++ b/indra/newview/skins/default/xui/en-us/floater_autoreplace.xml @@ -202,7 +202,7 @@ height="23" layout="topleft" left="100" - max_length_bytes="255" + max_length="2147483647" bottom_delta="0" width="150" /> @@ -224,7 +224,7 @@ height="23" layout="topleft" left="100" - max_length_bytes="255" + max_length="2147483647" bottom_delta="0" width="280" /> From ae308a274c948efaafb059e4cfc35792c95763de Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 4 Feb 2019 17:32:04 -0500 Subject: [PATCH 27/90] Clean up the chitchat, console url replacement~ --- indra/newview/llfloaterchat.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 5fe89a400..e544bed80 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -45,6 +45,7 @@ #include "llcombobox.h" #include "lltextparser.h" #include "lltrans.h" +#include "llurlregistry.h" #include "llwindow.h" // project include @@ -384,7 +385,19 @@ void LLFloaterChat::addChat(const LLChat& chat, // We display anything if it's not an IM. If it's an IM, check pref... if ( !from_instant_message || gSavedSettings.getBOOL("IMInChatConsole") ) { - gConsole->addConsoleLine(chat.mText, text_color); + // Replace registered urls in the console so it looks right. + std::string chit(chat.mText), // Read through this + chat; // Add parts to this + LLUrlMatch match; + while (!chit.empty() && LLUrlRegistry::instance().findUrl(chit, match)) + { + const auto start(match.getStart()), length(match.getEnd()+1-start); + if (start > 0) chat += chit.substr(0, start); // Add up to the start of the match + chat += match.getLabel() + match.getQuery(); // Add the label and the query + chit.erase(0, start+length); // remove the url match and all before it + } + if (!chit.empty()) chat += chit; // Add any leftovers + gConsole->addConsoleLine(chat, text_color); } } From 0ce0f8114465ab6230b2d00804b2b3b41299f247 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 4 Feb 2019 17:40:47 -0500 Subject: [PATCH 28/90] Why do I still use windows, anyway? --- indra/newview/llpanellogin.cpp | 92 +++++++++++++++++----------------- indra/newview/llpanellogin.h | 2 + 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 7906493ef..c414feee7 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -368,15 +368,40 @@ void LLPanelLogin::setSiteIsAlive(bool alive) } } +void LLPanelLogin::clearPassword() +{ + getChild("password_edit")->setValue(mIncomingPassword = mMungedPassword = LLStringUtil::null); +} + +void LLPanelLogin::hidePassword() +{ + // This is a MD5 hex digest of a password. + // We don't actually use the password input field, + // fill it with MAX_PASSWORD characters so we get a + // nice row of asterixes. + getChild("password_edit")->setValue("123456789!123456"); +} + void LLPanelLogin::mungePassword(const std::string& password) { // Re-md5 if we've changed at all if (password != mIncomingPassword) { - LLMD5 pass((unsigned char *)password.c_str()); - char munged_password[MD5HEX_STR_SIZE]; - pass.hex_digest(munged_password); - mMungedPassword = munged_password; + // Max "actual" password length is 16 characters. + // Hex digests are always 32 characters. + if (password.length() == MD5HEX_STR_BYTES) + { + hidePassword(); + mMungedPassword = password; + } + else + { + LLMD5 pass((unsigned char *)password.substr(16).c_str()); + char munged_password[MD5HEX_STR_SIZE]; + pass.hex_digest(munged_password); + mMungedPassword = munged_password; + } + mIncomingPassword = password; } } @@ -552,29 +577,11 @@ void LLPanelLogin::setFields(const std::string& firstname, llassert_always(firstname.find(' ') == std::string::npos); login_combo->setLabel(nameJoin(firstname, lastname, false)); - // Max "actual" password length is 16 characters. - // Hex digests are always 32 characters. - if (password.length() == 32) - { - // This is a MD5 hex digest of a password. - // We don't actually use the password input field, - // fill it with MAX_PASSWORD characters so we get a - // nice row of asterixes. - const std::string filler("123456789!123456"); - sInstance->getChild("password_edit")->setValue(filler); - sInstance->mIncomingPassword = filler; - sInstance->mMungedPassword = password; - } - else - { - // this is a normal text password + sInstance->mungePassword(password); + if (sInstance->mIncomingPassword != sInstance->mMungedPassword) sInstance->getChild("password_edit")->setValue(password); - sInstance->mIncomingPassword = password; - LLMD5 pass((unsigned char *)password.c_str()); - char munged_password[MD5HEX_STR_SIZE]; - pass.hex_digest(munged_password); - sInstance->mMungedPassword = munged_password; - } + else + sInstance->hidePassword(); } // static @@ -591,33 +598,26 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus) LLComboBox* login_combo = sInstance->getChild("username_combo"); login_combo->setTextEntry(fullname); login_combo->resetTextDirty(); - //sInstance->getChild("username_combo")->setValue(fullname); + //login_combo->setValue(fullname); - std::string grid = entry.getGrid(); + const auto& grid = entry.getGrid(); //grid comes via LLSavedLoginEntry, which uses full grid names, not nicks - if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName()) + if (!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName()) { gHippoGridManager->setCurrentGrid(grid); } - - if (entry.getPassword().empty()) - { - sInstance->getChild("password_edit")->setValue(LLStringUtil::null); - remember_pass_check->setValue(LLSD(false)); - } - else - { - const std::string filler("123456789!123456"); - sInstance->getChild("password_edit")->setValue(filler); - sInstance->mIncomingPassword = filler; - sInstance->mMungedPassword = entry.getPassword(); - remember_pass_check->setValue(LLSD(true)); - } - if (takeFocus) + const auto& password = entry.getPassword(); + bool remember_pass = !password.empty(); + if (remember_pass) { - giveFocus(); + sInstance->mIncomingPassword = sInstance->mMungedPassword = password; + sInstance->hidePassword(); } + else sInstance->clearPassword(); + remember_pass_check->setValue(remember_pass); + + if (takeFocus) giveFocus(); } // static @@ -1066,7 +1066,7 @@ void LLPanelLogin::onLoginComboLostFocus(LLComboBox* combo_box) { if (combo_box->isTextDirty()) { - getChild("password_edit")->setValue(mIncomingPassword = mMungedPassword = LLStringUtil::null); + clearPassword(); combo_box->resetTextDirty(); } } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index b7e8facc8..e8f050a4c 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -95,6 +95,8 @@ public: static void refreshLoginPage(); static void giveFocus(); static void setAlwaysRefresh(bool refresh); + void clearPassword(); + void hidePassword(); void mungePassword(const std::string& password); // inherited from LLViewerMediaObserver From b2eb601fc48ef76cb2e0ae5c5dbe9677fde0eefd Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 4 Feb 2019 19:36:01 -0500 Subject: [PATCH 29/90] We can move whatever we want into favorites --- indra/newview/llinventorybridge.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 537358377..985a6289e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4075,7 +4075,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } - else if (move_is_into_favorites || move_is_into_landmarks) + else if (/*move_is_into_favorites ||*/ move_is_into_landmarks) { accept = can_move_to_landmarks(inv_item); } @@ -4151,7 +4151,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // FAVORITES folder // (copy the item) - else */if (move_is_into_favorites) + else if (move_is_into_favorites) { dropToFavorites(inv_item); } @@ -4233,7 +4233,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } // Don't allow to move a single item to Favorites or Landmarks // if it is not a landmark or a link to a landmark. - else if ((move_is_into_favorites || move_is_into_landmarks) + else if ((/*move_is_into_favorites ||*/ move_is_into_landmarks) && !can_move_to_landmarks(inv_item)) { accept = FALSE; @@ -4304,7 +4304,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } // Don't allow to move a single item to Favorites or Landmarks // if it is not a landmark or a link to a landmark. - else if (move_is_into_favorites || move_is_into_landmarks) + else if (/*move_is_into_favorites ||*/ move_is_into_landmarks) { accept = can_move_to_landmarks(inv_item); } From cb16e4edf0d2b1b260a851e9f793e9004e3ffd96 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 4 Feb 2019 20:02:40 -0500 Subject: [PATCH 30/90] Updat --- indra/newview/llpanellogin.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index c414feee7..4861a102b 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -409,7 +409,7 @@ void LLPanelLogin::mungePassword(const std::string& password) // (with some padding so the other login screen doesn't show through) void LLPanelLogin::reshapeBrowser() { - LLMediaCtrl* web_browser = getChild("login_html"); + auto web_browser = getChild("login_html"); LLRect rect = gViewerWindow->getWindowRectScaled(); LLRect html_rect; html_rect.setCenterAndSize( @@ -424,10 +424,13 @@ LLPanelLogin::~LLPanelLogin() { std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml"); LLSavedLogins::saveFile(mLoginHistoryData, login_hist_filepath); - LLPanelLogin::sInstance = NULL; + sInstance = nullptr; + + // Controls having keyboard focus by default + // must reset it on destroy. (EXT-2748) if (gFocusMgr.getDefaultKeyboardFocus() == this) - gFocusMgr.setDefaultKeyboardFocus(NULL); + gFocusMgr.setDefaultKeyboardFocus(nullptr); } // virtual @@ -518,8 +521,8 @@ void LLPanelLogin::giveFocus() BOOL have_username = !username.empty(); BOOL have_pass = !pass.empty(); - LLLineEditor* edit = NULL; - LLComboBox* combo = NULL; + LLLineEditor* edit = nullptr; + LLComboBox* combo = nullptr; if (have_username && !have_pass) { // User saved his name but not his password. Move @@ -678,7 +681,7 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) LL_DEBUGS("AppInit")<getChild("start_location_combo"); + auto location_combo = sInstance->getChild("start_location_combo"); /* * Determine whether or not the new_start_slurl modifies the grid. * @@ -697,12 +700,15 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) location_combo->setTextEntry(new_start_slurl.getLocationString()); } break; + case LLSLURL::HOME_LOCATION: location_combo->setCurrentByIndex(0); // home location break; + case LLSLURL::LAST_LOCATION: location_combo->setCurrentByIndex(1); // last location break; + default: LL_WARNS("AppInit")<<"invalid login slurl, using home"<setCurrentByIndex(1); // home location @@ -736,8 +742,9 @@ void LLPanelLogin::close() if (sInstance) { sInstance->getParent()->removeChild(sInstance); + delete sInstance; - sInstance = NULL; + sInstance = nullptr; } } @@ -1045,7 +1052,7 @@ void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl) void LLPanelLogin::onLocationSLURL() { - LLComboBox* location_combo = getChild("start_location_combo"); + auto location_combo = getChild("start_location_combo"); std::string location = location_combo->getValue().asString(); LLStringUtil::trim(location); LL_DEBUGS("AppInit")< Date: Tue, 5 Feb 2019 04:57:49 -0500 Subject: [PATCH 31/90] Favorites on the login screen Adds some guts for the favorites bar, I'll get to that eventually --- indra/newview/CMakeLists.txt | 4 + .../app_settings/settings_per_account.xml | 11 + indra/newview/llfavoritesbar.cpp | 1823 +++++++++++++++++ indra/newview/llfavoritesbar.h | 276 +++ indra/newview/llfolderview.cpp | 5 + indra/newview/llinventorybridge.cpp | 6 +- indra/newview/llinventorymodel.cpp | 16 +- indra/newview/llinventorymodel.h | 9 - indra/newview/lllandmarkactions.cpp | 421 ++++ indra/newview/lllandmarkactions.h | 138 ++ indra/newview/lllandmarklist.cpp | 20 +- indra/newview/lllandmarklist.h | 9 +- indra/newview/llpanellogin.cpp | 101 + indra/newview/llpanellogin.h | 1 + indra/newview/llviewerinventory.cpp | 45 +- indra/newview/llviewerinventory.h | 5 + 16 files changed, 2845 insertions(+), 45 deletions(-) create mode 100644 indra/newview/llfavoritesbar.cpp create mode 100644 indra/newview/llfavoritesbar.h create mode 100644 indra/newview/lllandmarkactions.cpp create mode 100644 indra/newview/lllandmarkactions.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 258d44e95..1ac784f5b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -174,6 +174,7 @@ set(viewer_SOURCE_FILES llexternaleditor.cpp llface.cpp llfasttimerview.cpp + llfavoritesbar.cpp llfeaturemanager.cpp llfirstuse.cpp llflexibleobject.cpp @@ -320,6 +321,7 @@ set(viewer_SOURCE_FILES llinventoryobserver.cpp llinventorypanel.cpp lljoystickbutton.cpp + lllandmarkactions.cpp lllandmarklist.cpp lllogchat.cpp llloginhandler.cpp @@ -707,6 +709,7 @@ set(viewer_HEADER_FILES llexternaleditor.h llface.h llfasttimerview.h + llfavoritesbar.h llfeaturemanager.h llfirstuse.h llflexibleobject.h @@ -852,6 +855,7 @@ set(viewer_HEADER_FILES llinventoryobserver.h llinventorypanel.h lljoystickbutton.h + lllandmarkactions.h lllandmarklist.h lllightconstants.h lllogchat.h diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 021563d5a..27a01079c 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -770,6 +770,17 @@ Value -%Y-%m + ShowFavoritesOnLogin + + Comment + Determines whether favorites of last logged in user will be saved on exit from viewer and shown on login screen + Persist + 1 + Type + Boolean + Value + 1 + KeywordsChangeColor diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp new file mode 100644 index 000000000..87269d478 --- /dev/null +++ b/indra/newview/llfavoritesbar.cpp @@ -0,0 +1,1823 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +/** + * @file llfavoritesbar.cpp + * @brief LLFavoritesBarCtrl class implementation + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llfavoritesbar.h" + +#if 0 +//#include "llfloaterreg.h" +#include "llfocusmgr.h" +#include "llinventory.h" +#include "lllandmarkactions.h" +#include "lltoolbarview.h" +#include "lltrans.h" +#include "llmenugl.h" +#include "lltooltip.h" +#endif + +#include "llagent.h" +#include "llavatarnamecache.h" +#include "llclipboard.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +//#include "llfloatersidepanelcontainer.h" +#include "llfloaterworldmap.h" +#include "lllandmarkactions.h" +#if 0 +#include "lllogininstance.h" +#endif +#include "llnotificationsutil.h" +#include "lltoggleablemenu.h" +#include "llviewerinventory.h" +#include "llviewermenu.h" +#include "hippogridmanager.h" //"llviewernetwork.h" +#include "lltooldraganddrop.h" +#include "llsdserialize.h" + +#if 0 +static LLRegisterWidget r("favorites_bar"); + +const S32 DROP_DOWN_MENU_WIDTH = 250; +const S32 DROP_DOWN_MENU_TOP_PAD = 13; + +/** + * Helper for LLFavoriteLandmarkButton and LLFavoriteLandmarkMenuItem. + * Performing requests for SLURL for given Landmark ID + */ +class LLLandmarkInfoGetter +{ +public: + LLLandmarkInfoGetter() + : mLandmarkID(LLUUID::null), + mName("(Loading...)"), + mPosX(0), + mPosY(0), + mPosZ(0), + mLoaded(false) + { + mHandle.bind(this); + } + + void setLandmarkID(const LLUUID& id) { mLandmarkID = id; } + const LLUUID& getLandmarkId() const { return mLandmarkID; } + + const std::string& getName() + { + if(!mLoaded) + requestNameAndPos(); + + return mName; + } + + S32 getPosX() + { + if (!mLoaded) + requestNameAndPos(); + return mPosX; + } + + S32 getPosY() + { + if (!mLoaded) + requestNameAndPos(); + return mPosY; + } + + S32 getPosZ() + { + if (!mLoaded) + requestNameAndPos(); + return mPosZ; + } + +private: + /** + * Requests landmark data from server. + */ + void requestNameAndPos() + { + if (mLandmarkID.isNull()) + return; + + LLVector3d g_pos; + if(LLLandmarkActions::getLandmarkGlobalPos(mLandmarkID, g_pos)) + { + LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(g_pos, + boost::bind(&LLLandmarkInfoGetter::landmarkNameCallback, static_cast >(mHandle), _1, _2, _3, _4)); + } + } + + static void landmarkNameCallback(LLHandle handle, const std::string& name, S32 x, S32 y, S32 z) + { + LLLandmarkInfoGetter* getter = handle.get(); + if (getter) + { + getter->mPosX = x; + getter->mPosY = y; + getter->mPosZ = z; + getter->mName = name; + getter->mLoaded = true; + } + } + + LLUUID mLandmarkID; + std::string mName; + S32 mPosX; + S32 mPosY; + S32 mPosZ; + bool mLoaded; + LLRootHandle mHandle; +}; + +/** + * This class is needed to override LLButton default handleToolTip function and + * show SLURL as button tooltip. + * *NOTE: dzaporozhan: This is a workaround. We could set tooltips for buttons + * in createButtons function but landmark data is not available when Favorites Bar is + * created. Thats why we are requesting landmark data after + */ +class LLFavoriteLandmarkButton : public LLButton +{ +public: + + BOOL handleToolTip(S32 x, S32 y, MASK mask) override + { + std::string region_name = mLandmarkInfoGetter.getName(); + + if (!region_name.empty()) + { + std::string extra_message = llformat("%s (%d, %d, %d)", region_name.c_str(), + mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY(), mLandmarkInfoGetter.getPosZ()); + + LLToolTip::Params params; + params.message = llformat("%s\n%s", getLabelSelected().c_str(), extra_message.c_str()); + params.max_width = 1000; + params.sticky_rect = calcScreenRect(); + + LLToolTipMgr::instance().show(params); + } + return TRUE; + } + + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override + { + LLFavoritesBarCtrl* fb = dynamic_cast(getParent()); + + if (fb) + { + fb->handleHover(x, y, mask); + } + + return LLButton::handleHover(x, y, mask); + } + + void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } + const LLUUID& getLandmarkId() const { return mLandmarkInfoGetter.getLandmarkId(); } + + void onMouseEnter(S32 x, S32 y, MASK mask) override + { + if (LLToolDragAndDrop::getInstance()->hasMouseCapture()) + { + LLUICtrl::onMouseEnter(x, y, mask); + } + else + { + LLButton::onMouseEnter(x, y, mask); + } + } + +protected: + LLFavoriteLandmarkButton(const LLButton::Params& p) : LLButton(p) {} + friend class LLUICtrlFactory; + +private: + LLLandmarkInfoGetter mLandmarkInfoGetter; +}; + +/** + * This class is needed to override LLMenuItemCallGL default handleToolTip function and + * show SLURL as button tooltip. + * *NOTE: dzaporozhan: This is a workaround. We could set tooltips for buttons + * in showDropDownMenu function but landmark data is not available when Favorites Bar is + * created. Thats why we are requesting landmark data after + */ +class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL +{ +public: + BOOL handleToolTip(S32 x, S32 y, MASK mask) override + { + std::string region_name = mLandmarkInfoGetter.getName(); + if (!region_name.empty()) + { + LLToolTip::Params params; + params.message = llformat("%s\n%s (%d, %d)", getLabel().c_str(), region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY()); + params.sticky_rect = calcScreenRect(); + LLToolTipMgr::instance().show(params); + } + return TRUE; + } + + void setLandmarkID(const LLUUID& id){ mLandmarkInfoGetter.setLandmarkID(id); } + + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override + { + if (mMouseDownSignal) + (*mMouseDownSignal)(this, x, y, mask); + return LLMenuItemCallGL::handleMouseDown(x, y, mask); + } + + BOOL handleMouseUp(S32 x, S32 y, MASK mask) override + { + if (mMouseUpSignal) + (*mMouseUpSignal)(this, x, y, mask); + return LLMenuItemCallGL::handleMouseUp(x, y, mask); + } + + BOOL handleHover(S32 x, S32 y, MASK mask) override + { + if (fb) + { + fb->handleHover(x, y, mask); + } + + return TRUE; + } + + void initFavoritesBarPointer(LLFavoritesBarCtrl* fb) { this->fb = fb; } + +protected: + + LLFavoriteLandmarkMenuItem(const LLMenuItemCallGL::Params& p) : LLMenuItemCallGL(p), fb(nullptr) {} + friend class LLUICtrlFactory; + +private: + LLLandmarkInfoGetter mLandmarkInfoGetter; + LLFavoritesBarCtrl* fb; +}; + +/** + * This class was introduced just for fixing the following issue: + * EXT-836 Nav bar: Favorites overflow menu passes left-mouse click through. + * We must explicitly handle drag and drop event by returning TRUE + * because otherwise LLToolDragAndDrop will initiate drag and drop operation + * with the world. + */ +class LLFavoriteLandmarkToggleableMenu : public LLToggleableMenu +{ +public: + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) override + { + *accept = ACCEPT_NO; + return TRUE; + } + +protected: + LLFavoriteLandmarkToggleableMenu(const LLToggleableMenu::Params& p): + LLToggleableMenu(p) + { + } + + friend class LLUICtrlFactory; +}; + +/** + * This class is needed to update an item being copied to the favorites folder + * with a sort field value (required to save favorites bar's tabs order). + * See method handleNewFavoriteDragAndDrop for more details on how this class is used. + */ +class LLItemCopiedCallback : public LLInventoryCallback +{ +public: + LLItemCopiedCallback(S32 sortField): mSortField(sortField) {} + + void fire(const LLUUID& inv_item) override + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + + if (item) + { + LLFavoritesOrderStorage::instance().setSortIndex(item, mSortField); + + item->setComplete(TRUE); + item->updateServer(FALSE); + + gInventory.updateItem(item); + gInventory.notifyObservers(); + LLFavoritesOrderStorage::instance().saveOrder(); + } + + LLView::getWindow()->setCursor(UI_CURSOR_ARROW); + } + +private: + S32 mSortField; +}; +#endif + +// updateButtons's helper +struct LLFavoritesSort +{ + // Sorting by creation date and name + // TODO - made it customizible using gSavedSettings + bool operator()(const LLViewerInventoryItem* const& a, const LLViewerInventoryItem* const& b) const + { + S32 sortField1 = LLFavoritesOrderStorage::instance().getSortIndex(a->getUUID()); + S32 sortField2 = LLFavoritesOrderStorage::instance().getSortIndex(b->getUUID()); + + if (!(sortField1 < 0 && sortField2 < 0)) + { + return sortField2 > sortField1; + } + + time_t first_create = a->getCreationDate(); + time_t second_create = b->getCreationDate(); + if (first_create == second_create) + { + return (LLStringUtil::compareDict(a->getName(), b->getName()) < 0); + } + else + { + return (first_create > second_create); + } + } +}; + +#if 0 +LLFavoritesBarCtrl::Params::Params() +: image_drag_indication("image_drag_indication"), + more_button("more_button"), + label("label") +{ +} + +LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) +: LLUICtrl(p), + mOverflowMenuHandle(), + mContextMenuHandle(), + mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), + mUpdateDropDownItems(true), + mRestoreOverflowMenu(false), + mImageDragIndication(p.image_drag_indication), + mShowDragMarker(FALSE), + mLandingTab(NULL) + , mLastTab(NULL) +, mTabsHighlightEnabled(TRUE) +{ + // Register callback for menus with current registrar (will be parent panel's registrar) + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected", + boost::bind(&LLFavoritesBarCtrl::doToSelected, this, _2)); + + // Add this if we need to selectively enable items + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Favorites.EnableSelected", + boost::bind(&LLFavoritesBarCtrl::enableSelected, this, _2)); + + gInventory.addObserver(this); + + //make chevron button + LLTextBox::Params more_button_params(p.more_button); + mMoreTextBox = LLUICtrlFactory::create (more_button_params); + mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); + addChild(mMoreTextBox); + + mDropDownItemsCount = 0; + + LLTextBox::Params label_param(p.label); + mBarLabel = LLUICtrlFactory::create (label_param); + addChild(mBarLabel); +} + +LLFavoritesBarCtrl::~LLFavoritesBarCtrl() +{ + gInventory.removeObserver(this); + + if (mOverflowMenuHandle.get()) mOverflowMenuHandle.get()->die(); + if (mContextMenuHandle.get()) mContextMenuHandle.get()->die(); +} + +BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; + + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); + if (LLToolDragAndDrop::SOURCE_AGENT != source && LLToolDragAndDrop::SOURCE_LIBRARY != source) return FALSE; + + switch (cargo_type) + { + + case DAD_LANDMARK: + { + /* + * add a callback to the end drag event. + * the callback will disconnet itself immediately after execution + * this is done because LLToolDragAndDrop is a common tool so it shouldn't + * be overloaded with redundant callbacks. + */ + if (!mEndDragConnection.connected()) + { + mEndDragConnection = LLToolDragAndDrop::getInstance()->setEndDragCallback(boost::bind(&LLFavoritesBarCtrl::onEndDrag, this)); + } + + // Copy the item into the favorites folder (if it's not already there). + LLInventoryItem *item = (LLInventoryItem *)cargo_data; + + if (LLFavoriteLandmarkButton* dest = dynamic_cast(findChildByLocalCoords(x, y))) + { + setLandingTab(dest); + } + else if (mLastTab && (x >= mLastTab->getRect().mRight)) + { + /* + * the condition dest == NULL can be satisfied not only in the case + * of dragging to the right from the last tab of the favbar. there is a + * small gap between each tab. if the user drags something exactly there + * then mLandingTab will be set to NULL and the dragged item will be pushed + * to the end of the favorites bar. this is incorrect behavior. that's why + * we need an additional check which excludes the case described previously + * making sure that the mouse pointer is beyond the last tab. + */ + setLandingTab(NULL); + } + + // check if we are dragging an existing item from the favorites bar + if (item && mDragItemId == item->getUUID()) + { + *accept = ACCEPT_YES_SINGLE; + + showDragMarker(TRUE); + + if (drop) + { + handleExistingFavoriteDragAndDrop(x, y); + } + } + else + { + const LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if (item && item->getParentUUID() == favorites_id) + { + LL_WARNS("FavoritesBar") << "Attemt to copy a favorite item into the same folder." << LL_ENDL; + break; + } + + *accept = ACCEPT_YES_COPY_MULTI; + + showDragMarker(TRUE); + + if (drop) + { + if (mItems.empty()) + { + setLandingTab(NULL); + } + handleNewFavoriteDragAndDrop(item, favorites_id, x, y); + } + } + } + break; + default: + break; + } + + return TRUE; +} + +void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) +{ + // Identify the button hovered and the side to drop + LLFavoriteLandmarkButton* dest = dynamic_cast(mLandingTab); + bool insert_before = true; + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } + + // There is no need to handle if an item was dragged onto itself + if (dest && dest->getLandmarkId() == mDragItemId) + { + return; + } + + // Insert the dragged item in the right place + if (dest) + { + LLInventoryModel::updateItemsOrder(mItems, mDragItemId, dest->getLandmarkId(), insert_before); + } + else + { + // This can happen when the item list is empty + mItems.push_back(gInventory.getItem(mDragItemId)); + } + + LLFavoritesOrderStorage::instance().saveItemsOrder(mItems); + + LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); + + if (menu && menu->getVisible()) + { + menu->setVisible(FALSE); + showDropDownMenu(); + } +} + +void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y) +{ + if (!item) return; + // Identify the button hovered and the side to drop + LLFavoriteLandmarkButton* dest = NULL; + bool insert_before = true; + if (!mItems.empty()) + { + // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, + // the viewer would crash when casting mLastTab below, as mLastTab is still null when the + // second landmark is being added. + // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function + dest = dynamic_cast(mLandingTab); + if (!dest) + { + insert_before = false; + dest = dynamic_cast(mLastTab); + } + } + + // There is no need to handle if an item was dragged onto itself + if (dest && dest->getLandmarkId() == mDragItemId) + { + return; + } + + LLPointer viewer_item = new LLViewerInventoryItem(item); + + // Insert the dragged item in the right place + if (dest) + { + insertItem(mItems, dest->getLandmarkId(), viewer_item, insert_before); + } + else + { + // This can happen when the item list is empty + mItems.push_back(viewer_item); + } + + int sortField = 0; + LLPointer cb; + + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (LLInventoryModel::item_array_t::iterator i = mItems.begin(); i != mItems.end(); ++i) + { + LLViewerInventoryItem* currItem = *i; + + if (currItem->getUUID() == item->getUUID()) + { + cb = new LLItemCopiedCallback(++sortField); + } + else + { + LLFavoritesOrderStorage::instance().setSortIndex(currItem, ++sortField); + + currItem->setComplete(TRUE); + currItem->updateServer(FALSE); + + gInventory.updateItem(currItem); + } + } + + LLToolDragAndDrop* tool_dad = LLToolDragAndDrop::getInstance(); + if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD) + { + viewer_item->setType(LLAssetType::AT_LANDMARK); + copy_inventory_from_notecard(favorites_id, + tool_dad->getObjectID(), + tool_dad->getSourceID(), + viewer_item.get(), + gInventoryCallbacks.registerCB(cb)); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + favorites_id, + std::string(), + cb); + } + + // [MAINT-2386] Ensure the favorite button has been created and is valid. + // This also ensures that mLastTab will be valid when dropping multiple + // landmarks to an empty favorites bar. + updateButtons(); + + LL_INFOS("FavoritesBar") << "Copied inventory item #" << item->getUUID() << " to favorites." << LL_ENDL; +} + +//virtual +void LLFavoritesBarCtrl::changed(U32 mask) +{ + if (mFavoriteFolderId.isNull()) + { + mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + + if (mFavoriteFolderId.notNull()) + { + gInventory.fetchDescendentsOf(mFavoriteFolderId); + } + } + else + { + LLInventoryModel::item_array_t items; + LLInventoryModel::cat_array_t cats; + LLIsType is_type(LLAssetType::AT_LANDMARK); + gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + + for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + { + LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID()); + } + + updateButtons(); + } +} + +//virtual +void LLFavoritesBarCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + LLUICtrl::reshape(width, height, called_from_parent); + updateButtons(); +} + +void LLFavoritesBarCtrl::draw() +{ + LLUICtrl::draw(); + + if (mShowDragMarker) + { + S32 w = mImageDragIndication->getWidth(); + S32 h = mImageDragIndication->getHeight(); + + if (mLandingTab) + { + // mouse pointer hovers over an existing tab + LLRect rect = mLandingTab->getRect(); + mImageDragIndication->draw(rect.mLeft, rect.getHeight(), w, h); + } + else if (mLastTab) + { + // mouse pointer hovers over the favbar empty space (right to the last tab) + LLRect rect = mLastTab->getRect(); + mImageDragIndication->draw(rect.mRight, rect.getHeight(), w, h); + } + // Once drawn, mark this false so we won't draw it again (unless we hit the favorite bar again) + mShowDragMarker = FALSE; + } +} + +const LLButton::Params& LLFavoritesBarCtrl::getButtonParams() +{ + static LLButton::Params button_params; + static bool params_initialized = false; + + if (!params_initialized) + { + LLXMLNodePtr button_xml_node; + if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node)) + { + LLXUIParser parser; + parser.readXUI(button_xml_node, button_params, "favorites_bar_button.xml"); + } + params_initialized = true; + } + + return button_params; +} + +void LLFavoritesBarCtrl::updateButtons() +{ + mItems.clear(); + + if (!collectFavoriteItems(mItems)) + { + return; + } + + const LLButton::Params& button_params = getButtonParams(); + + if(mItems.empty()) + { + mBarLabel->setVisible(TRUE); + } + else + { + mBarLabel->setVisible(FALSE); + } + const child_list_t* childs = getChildList(); + child_list_const_iter_t child_it = childs->begin(); + int first_changed_item_index = 0; + int rightest_point = getRect().mRight - mMoreTextBox->getRect().getWidth(); + //lets find first changed button + while (child_it != childs->end() && first_changed_item_index < mItems.size()) + { + LLFavoriteLandmarkButton* button = dynamic_cast (*child_it); + if (button) + { + const LLViewerInventoryItem *item = mItems[first_changed_item_index].get(); + if (item) + { + // an child's order and mItems should be same + if (button->getLandmarkId() != item->getUUID() // sort order has been changed + || button->getLabelSelected() != item->getName() // favorite's name has been changed + || button->getRect().mRight < rightest_point) // favbar's width has been changed + { + break; + } + } + first_changed_item_index++; + } + child_it++; + } + // now first_changed_item_index should contains a number of button that need to change + + if (first_changed_item_index <= mItems.size()) + { + // Rebuild the buttons only + // child_list_t is a linked list, so safe to erase from the middle if we pre-increment the iterator + + while (child_it != childs->end()) + { + //lets remove other landmarks button and rebuild it + child_list_const_iter_t cur_it = child_it++; + LLFavoriteLandmarkButton* button = + dynamic_cast (*cur_it); + if (button) + { + removeChild(button); + delete button; + } + } + // we have to remove ChevronButton to make sure that the last item will be LandmarkButton to get the right aligning + // keep in mind that we are cutting all buttons in space between the last visible child of favbar and ChevronButton + if (mMoreTextBox->getParent() == this) + { + removeChild(mMoreTextBox); + } + int last_right_edge = 0; + //calculate new buttons offset + if (getChildList()->size() > 0) + { + //find last visible child to get the rightest button offset + child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(), + std::mem_fn(&LLView::getVisible)); + if(last_visible_it != childs->rend()) + { + last_right_edge = (*last_visible_it)->getRect().mRight; + } + } + //last_right_edge is saving coordinates + LLButton* last_new_button = NULL; + int j = first_changed_item_index; + for (; j < mItems.size(); j++) + { + last_new_button = createButton(mItems[j], button_params, last_right_edge); + if (!last_new_button) + { + break; + } + sendChildToBack(last_new_button); + last_right_edge = last_new_button->getRect().mRight; + + mLastTab = last_new_button; + } + mFirstDropDownItem = j; + // Chevron button + if (mFirstDropDownItem < mItems.size()) + { + // if updateButton had been called it means: + //or there are some new favorites, or width had been changed + // so if we need to display chevron button, we must update dropdown items too. + mUpdateDropDownItems = true; + S32 buttonHGap = button_params.rect.left; // default value + LLRect rect; + // Chevron button should stay right aligned + rect.setOriginAndSize(getRect().mRight - mMoreTextBox->getRect().getWidth() - buttonHGap, 0, + mMoreTextBox->getRect().getWidth(), + mMoreTextBox->getRect().getHeight()); + + addChild(mMoreTextBox); + mMoreTextBox->setRect(rect); + mMoreTextBox->setVisible(TRUE); + } + // Update overflow menu + LLToggleableMenu* overflow_menu = static_cast (mOverflowMenuHandle.get()); + if (overflow_menu && overflow_menu->getVisible() && (overflow_menu->getItemCount() != mDropDownItemsCount)) + { + overflow_menu->setVisible(FALSE); + if (mUpdateDropDownItems) + { + showDropDownMenu(); + } + } + } + else + { + mUpdateDropDownItems = false; + } + +} + +LLButton* LLFavoritesBarCtrl::createButton(const LLPointer item, const LLButton::Params& button_params, S32 x_offset) +{ + S32 def_button_width = button_params.rect.width; + S32 button_x_delta = button_params.rect.left; // default value + S32 curr_x = x_offset; + + /** + * WORKAROUND: + * There are some problem with displaying of fonts in buttons. + * Empty space or ellipsis might be displayed instead of last symbols, even though the width of the button is enough. + * The problem disappears if we pad the button with 20 pixels. + */ + int required_width = mFont->getWidth(item->getName()) + 20; + int width = required_width > def_button_width? def_button_width : required_width; + LLFavoriteLandmarkButton* fav_btn = NULL; + + // do we have a place for next button + double buttonHGap + mMoreTextBox ? + if(curr_x + width + 2*button_x_delta + mMoreTextBox->getRect().getWidth() > getRect().mRight ) + { + return NULL; + } + LLButton::Params fav_btn_params(button_params); + fav_btn = LLUICtrlFactory::create(fav_btn_params); + if (NULL == fav_btn) + { + LL_WARNS("FavoritesBar") << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << LL_ENDL; + return NULL; + } + + addChild(fav_btn); + + LLRect butt_rect (fav_btn->getRect()); + fav_btn->setLandmarkID(item->getUUID()); + butt_rect.setOriginAndSize(curr_x + button_x_delta, fav_btn->getRect().mBottom, width, fav_btn->getRect().getHeight()); + + fav_btn->setRect(butt_rect); + // change only left and save bottom + fav_btn->setFont(mFont); + fav_btn->setLabel(item->getName()); + fav_btn->setToolTip(item->getName()); + fav_btn->setCommitCallback(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + fav_btn->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3,_4 )); + + fav_btn->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); + fav_btn->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); + + return fav_btn; +} + + +BOOL LLFavoritesBarCtrl::postBuild() +{ + // make the popup menu available + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile("menu_favorites.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if (!menu) + { + menu = LLUICtrlFactory::getDefaultWidget("inventory_menu"); + } + menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); + mContextMenuHandle = menu->getHandle(); + + return TRUE; +} +#endif + +BOOL /*LLFavoritesBarCtrl::*/collectFavoriteItems() +{ + + auto mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + if (mFavoriteFolderId.isNull()) + return FALSE; + + + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + + LLIsType is_type(LLAssetType::AT_LANDMARK); + gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + + std::sort(items.begin(), items.end(), LLFavoritesSort()); + +#if 0 + //if (needToSaveItemsOrder(items)) +#endif + { + S32 sortField = 0; + for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) + { + LLFavoritesOrderStorage::instance().setSortIndex((*i), ++sortField); + } + } + + return TRUE; +} + +#if 0 +void LLFavoritesBarCtrl::showDropDownMenu() +{ + if (mOverflowMenuHandle.isDead()) + { + createOverflowMenu(); + } + + LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); + if (menu && menu->toggleVisibility()) + { + if (mUpdateDropDownItems) + { + updateMenuItems(menu); + } + + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + menu->setButtonRect(mMoreTextBox->getRect(), this); + positionAndShowMenu(menu); + mDropDownItemsCount = menu->getItemCount(); + } +} + +void LLFavoritesBarCtrl::createOverflowMenu() +{ + LLToggleableMenu::Params menu_p; + menu_p.name("favorites menu"); + menu_p.can_tear_off(false); + menu_p.visible(false); + menu_p.scrollable(true); + menu_p.max_scrollable_items = 10; + menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; + + LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); + mOverflowMenuHandle = menu->getHandle(); +} + +void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) +{ + menu->empty(); + + U32 widest_item = 0; + + for (S32 i = mFirstDropDownItem; i < mItems.size(); i++) + { + LLViewerInventoryItem* item = mItems.at(i); + const std::string& item_name = item->getName(); + + LLFavoriteLandmarkMenuItem::Params item_params; + item_params.name(item_name); + item_params.label(item_name); + item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); + + LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create(item_params); + menu_item->initFavoritesBarPointer(this); + menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->LLUICtrl::setMouseUpCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseUp, this, item->getUUID(), _1, _2, _3, _4)); + menu_item->setLandmarkID(item->getUUID()); + + fitLabelWidth(menu_item); + + widest_item = llmax(widest_item, menu_item->getNominalWidth()); + + menu->addChild(menu_item); + } + + addOpenLandmarksMenuItem(menu); + mUpdateDropDownItems = false; +} + +void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item) +{ + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); + std::string item_name = menu_item->getName(); + + // Check whether item name wider than menu + if (menu_item->getNominalWidth() > max_width) + { + S32 chars_total = item_name.length(); + S32 chars_fitted = 1; + menu_item->setLabel(LLStringExplicit("")); + S32 label_space = max_width - menu_item->getFont()->getWidth("...") - + menu_item->getNominalWidth();// This returns width of menu item with empty label (pad pixels) + + while (chars_fitted < chars_total + && menu_item->getFont()->getWidth(item_name, 0, chars_fitted) < label_space) + { + chars_fitted++; + } + chars_fitted--; // Rolling back one char, that doesn't fit + + menu_item->setLabel(item_name.substr(0, chars_fitted) + "..."); + } +} + +void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu) +{ + std::string label_untrans = "Open landmarks"; + std::string label_transl; + bool translated = LLTrans::findString(label_transl, label_untrans); + + LLMenuItemCallGL::Params item_params; + item_params.name("open_my_landmarks"); + item_params.label(translated ? label_transl: label_untrans); + LLSD key; + key["type"] = "open_landmark_tab"; + item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", key)); + LLMenuItemCallGL* menu_item = LLUICtrlFactory::create(item_params); + + fitLabelWidth(menu_item); + + LLMenuItemSeparatorGL::Params sep_params; + sep_params.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor"); + sep_params.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor"); + sep_params.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor"); + sep_params.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor"); + LLMenuItemSeparatorGL* separator = LLUICtrlFactory::create(sep_params); + + menu->addChild(separator); + menu->addChild(menu_item); +} + +void LLFavoritesBarCtrl::positionAndShowMenu(LLToggleableMenu* menu) +{ + U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); + + S32 menu_x = getRect().getWidth() - max_width; + S32 menu_y = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD; + + // the menu should be offset of the right edge of the window + // so it's no covered by buttons in the right-side toolbar. + LLToolBar* right_toolbar = gToolBarView->getChild("toolbar_right"); + if (right_toolbar && right_toolbar->hasButtons()) + { + S32 toolbar_top = 0; + + if (LLView* top_border_panel = right_toolbar->getChild("button_panel")) + { + toolbar_top = top_border_panel->calcScreenRect().mTop; + } + + // Calculating the bottom (in screen coord) of the drop down menu + S32 menu_top = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD; + S32 menu_bottom = menu_top - menu->getRect().getHeight(); + S32 menu_bottom_screen = 0; + + localPointToScreen(0, menu_bottom, &menu_top, &menu_bottom_screen); + + if (menu_bottom_screen < toolbar_top) + { + menu_x -= right_toolbar->getRect().getWidth(); + } + } + + LLMenuGL::showPopup(this, menu, menu_x, menu_y); +} + +void LLFavoritesBarCtrl::onButtonClick(LLUUID item_id) +{ + // We only have one Inventory, gInventory. Some day this should be better abstracted. + LLInvFVBridgeAction::doAction(item_id,&gInventory); +} + +void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S32 x,S32 y,MASK mask) +{ + mSelectedItemID = item_id; + + LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get(); + if (!menu) + { + return; + } + + // Remember that the context menu was shown simultaneously with the overflow menu, + // so that we can restore the overflow menu when user clicks a context menu item + // (which hides the overflow menu). + { + LLView* overflow_menu = mOverflowMenuHandle.get(); + mRestoreOverflowMenu = overflow_menu && overflow_menu->getVisible(); + } + + // Release mouse capture so hover events go to the popup menu + // because this is happening during a mouse down. + gFocusMgr.setMouseCapture(NULL); + + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(fav_button, menu, x, y); +} + +BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = childrenHandleRightMouseDown( x, y, mask) != NULL; + if(!handled && !gMenuHolder->hasVisibleMenu()) + { + show_navbar_context_menu(this,x,y); + handled = true; + } + + return handled; +} +void copy_slurl_to_clipboard_cb(std::string& slurl) +{ + LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size()); + + LLSD args; + args["SLURL"] = slurl; + LLNotificationsUtil::add("CopySLURL", args); +} + + +bool LLFavoritesBarCtrl::enableSelected(const LLSD& userdata) +{ + std::string param = userdata.asString(); + + if (param == std::string("can_paste")) + { + return isClipboardPasteable(); + } + + return false; +} + +void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) +{ + std::string action = userdata.asString(); + LL_INFOS("FavoritesBar") << "Action = " << action << " Item = " << mSelectedItemID.asString() << LL_ENDL; + + LLViewerInventoryItem* item = gInventory.getItem(mSelectedItemID); + if (!item) + return; + + if (action == "open") + { + onButtonClick(item->getUUID()); + } + else if (action == "about") + { + LLSD key; + key["type"] = "landmark"; + key["id"] = mSelectedItemID; + + LLFloaterSidePanelContainer::showPanel("places", key); + } + else if (action == "copy_slurl") + { + LLVector3d posGlobal; + LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal); + + if (!posGlobal.isExactlyZero()) + { + LLLandmarkActions::getSLURLfromPosGlobal(posGlobal, copy_slurl_to_clipboard_cb); + } + } + else if (action == "show_on_map") + { + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + + LLVector3d posGlobal; + LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal); + + if (!posGlobal.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(posGlobal); + LLFloaterReg::showInstance("world_map", "center"); + } + } + else if (action == "cut") + { + } + else if (action == "copy") + { + LLClipboard::instance().copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK); + } + else if (action == "paste") + { + pasteFromClipboard(); + } + else if (action == "delete") + { + gInventory.removeItem(mSelectedItemID); + } + + // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). + // See EXT-4217 and STORM-207. + LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); + if (mRestoreOverflowMenu && menu && !menu->getVisible()) + { + menu->resetScrollPositionOnShow(false); + showDropDownMenu(); + menu->resetScrollPositionOnShow(true); + } +} + +BOOL LLFavoritesBarCtrl::isClipboardPasteable() const +{ + if (!LLClipboard::instance().hasContents()) + { + return FALSE; + } + + std::vector objects; + LLClipboard::instance().pasteFromClipboard(objects); + S32 count = objects.size(); + for(S32 i = 0; i < count; i++) + { + const LLUUID &item_id = objects.at(i); + + // Can't paste folders + const LLInventoryCategory *cat = gInventory.getCategory(item_id); + if (cat) + { + return FALSE; + } + + const LLInventoryItem *item = gInventory.getItem(item_id); + if (item && LLAssetType::AT_LANDMARK != item->getType()) + { + return FALSE; + } + } + return TRUE; +} + +void LLFavoritesBarCtrl::pasteFromClipboard() const +{ + LLInventoryModel* model = &gInventory; + if(model && isClipboardPasteable()) + { + LLInventoryItem* item = NULL; + std::vector objects; + LLClipboard::instance().pasteFromClipboard(objects); + S32 count = objects.size(); + LLUUID parent_id(mFavoriteFolderId); + for(S32 i = 0; i < count; i++) + { + item = model->getItem(objects.at(i)); + if (item) + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + parent_id, + std::string(), + LLPointer(NULL)); + } + } + } +} + +void LLFavoritesBarCtrl::onButtonMouseDown(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +{ + // EXT-6997 (Fav bar: Pop-up menu for LM in overflow dropdown is kept after LM was dragged away) + // mContextMenuHandle.get() - is a pop-up menu (of items) in already opened dropdown menu. + // We have to check and set visibility of pop-up menu in such a way instead of using + // LLMenuHolderGL::hideMenus() because it will close both menus(dropdown and pop-up), but + // we need to close only pop-up menu while dropdown one should be still opened. + LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get(); + if(menu && menu->getVisible()) + { + menu->setVisible(FALSE); + } + + mDragItemId = id; + mStartDrag = TRUE; + + S32 screenX, screenY; + localPointToScreen(x, y, &screenX, &screenY); + + LLToolDragAndDrop::getInstance()->setDragStart(screenX, screenY); +} + +void LLFavoritesBarCtrl::onButtonMouseUp(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +{ + mStartDrag = FALSE; + mDragItemId = LLUUID::null; +} + +void LLFavoritesBarCtrl::onEndDrag() +{ + mEndDragConnection.disconnect(); + + showDragMarker(FALSE); + mDragItemId = LLUUID::null; + LLView::getWindow()->setCursor(UI_CURSOR_ARROW); +} + +BOOL LLFavoritesBarCtrl::handleHover(S32 x, S32 y, MASK mask) +{ + if (mDragItemId != LLUUID::null && mStartDrag) + { + S32 screenX, screenY; + localPointToScreen(x, y, &screenX, &screenY); + + if(LLToolDragAndDrop::getInstance()->isOverThreshold(screenX, screenY)) + { + LLToolDragAndDrop::getInstance()->beginDrag( + DAD_LANDMARK, mDragItemId, + LLToolDragAndDrop::SOURCE_LIBRARY); + + mStartDrag = FALSE; + + return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask); + } + } + + return TRUE; +} + +LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y) +{ + LLUICtrl* ctrl = NULL; + const child_list_t* list = getChildList(); + + for (child_list_const_iter_t i = list->begin(); i != list->end(); ++i) + { + // Look only for children that are favorite buttons + if ((*i)->getName() == "favorites_bar_btn") + { + LLRect rect = (*i)->getRect(); + // We consider a button hit if the cursor is left of the right side + // This makes the hit a bit less finicky than hitting directly on the button itself + if (x <= rect.mRight) + { + ctrl = dynamic_cast(*i); + break; + } + } + } + return ctrl; +} + +BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array_t& items) +{ + BOOL result = FALSE; + + // if there is an item without sort order field set, we need to save items order + for (LLInventoryModel::item_array_t::const_iterator i = items.begin(); i != items.end(); ++i) + { + if (LLFavoritesOrderStorage::instance().getSortIndex((*i)->getUUID()) < 0) + { + result = TRUE; + break; + } + } + + return result; +} + +void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before) +{ + // Get the iterator to the destination item + LLInventoryModel::item_array_t::iterator it_dest = LLInventoryModel::findItemIterByUUID(items, dest_item_id); + if (it_dest == items.end()) + return; + + // Go to the next element if one wishes to insert after the dest element + if (!insert_before) + { + ++it_dest; + } + + // Insert the source item in the right place + if (it_dest != items.end()) + { + items.insert(it_dest, insertedItem); + } + else + { + // Append to the list if it_dest reached the end + items.push_back(insertedItem); + } +} +#endif + +const std::string LLFavoritesOrderStorage::SORTING_DATA_FILE_NAME = "landmarks_sorting.xml"; +const S32 LLFavoritesOrderStorage::NO_INDEX = -1; + +void LLFavoritesOrderStorage::setSortIndex(const LLViewerInventoryItem* inv_item, S32 sort_index) +{ + mSortIndexes[inv_item->getUUID()] = sort_index; + mIsDirty = true; + getSLURL(inv_item->getAssetUUID()); +} + +S32 LLFavoritesOrderStorage::getSortIndex(const LLUUID& inv_item_id) +{ + sort_index_map_t::const_iterator it = mSortIndexes.find(inv_item_id); + if (it != mSortIndexes.end()) + { + return it->second; + } + return NO_INDEX; +} + +void LLFavoritesOrderStorage::removeSortIndex(const LLUUID& inv_item_id) +{ + mSortIndexes.erase(inv_item_id); + mIsDirty = true; +} + +void LLFavoritesOrderStorage::getSLURL(const LLUUID& asset_id) +{ + slurls_map_t::iterator slurl_iter = mSLURLs.find(asset_id); + if (slurl_iter != mSLURLs.end()) return; // SLURL for current landmark is already cached + + LLLandmark* lm = gLandmarkList.getAsset(asset_id, + boost::bind(&LLFavoritesOrderStorage::onLandmarkLoaded, this, asset_id, _1)); + if (lm) + { + LL_DEBUGS("FavoritesBar") << "landmark for " << asset_id << " already loaded" << LL_ENDL; + onLandmarkLoaded(asset_id, lm); + } +} + +// static +std::string LLFavoritesOrderStorage::getStoredFavoritesFilename() +{ + std::string user_dir = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, ""); + + return (user_dir.empty() ? "" + : gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, + "stored_favorites_" + + gHippoGridManager->getCurrentGridName() + + ".xml") + ); +} + +// static +void LLFavoritesOrderStorage::destroyClass() +{ + LLFavoritesOrderStorage::instance().cleanup(); + + + std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); + llifstream file; + file.open(old_filename.c_str()); + if (file.is_open()) + { + file.close(); + std::string new_filename = getStoredFavoritesFilename(); + LL_INFOS("FavoritesBar") << "moving favorites from old name '" << old_filename + << "' to new name '" << new_filename << "'" + << LL_ENDL; + LLFile::rename(old_filename,new_filename); + } + + if (gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin")) + { + LLFavoritesOrderStorage::instance().saveFavoritesSLURLs(); + } + else + { + LLFavoritesOrderStorage::instance().removeFavoritesRecordOfUser(); + } +} + +std::string LLFavoritesOrderStorage::getSavedOrderFileName() +{ + // If we quit from the login screen we will not have an SL account + // name. Don't try to save, otherwise we'll dump a file in + // C:\Program Files\SecondLife\ or similar. JC + std::string user_dir = gDirUtilp->getLindenUserDir(); + return (user_dir.empty() ? "" : gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, SORTING_DATA_FILE_NAME)); +} + +void LLFavoritesOrderStorage::load() +{ + // load per-resident sorting information + std::string filename = getSavedOrderFileName(); + LLSD settings_llsd; + llifstream file; + file.open(filename.c_str()); + if (file.is_open()) + { + LLSDSerialize::fromXML(settings_llsd, file); + LL_INFOS("FavoritesBar") << "loaded favorites order from '" << filename << "' " + << (settings_llsd.isMap() ? "" : "un") << "successfully" + << LL_ENDL; + file.close(); + } + else + { + LL_WARNS("FavoritesBar") << "unable to open favorites order file at '" << filename << "'" << LL_ENDL; + } + + for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); + iter != settings_llsd.endMap(); ++iter) + { + mSortIndexes.insert(std::make_pair(LLUUID(iter->first), (S32)iter->second.asInteger())); + } +} + +void LLFavoritesOrderStorage::saveFavoritesSLURLs() +{ + // Do not change the file if we are not logged in yet. + if (gAgentID.isNull()) //LLLoginInstance::getInstance()->authSuccess()) + { + LL_WARNS("FavoritesBar") << "Cannot save favorites: not logged in" << LL_ENDL; + return; + } + + std::string filename = getStoredFavoritesFilename(); + if (!filename.empty()) + { + llifstream in_file; + in_file.open(filename.c_str()); + LLSD fav_llsd; + if (in_file.is_open()) + { + LLSDSerialize::fromXML(fav_llsd, in_file); + LL_INFOS("FavoritesBar") << "loaded favorites from '" << filename << "' " + << (fav_llsd.isMap() ? "" : "un") << "successfully" + << LL_ENDL; + in_file.close(); + } + else + { + LL_WARNS("FavoritesBar") << "unable to open favorites from '" << filename << "'" << LL_ENDL; + } + + const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); + + LLSD user_llsd; + for (LLInventoryModel::item_array_t::const_iterator it = items.cbegin(); it != items.cend(); ++it) + { + if (it->get()->getActualType() != LLAssetType::AT_LANDMARK) continue; + LLSD value; + value["name"] = (*it)->getName(); + value["asset_id"] = (*it)->getAssetUUID(); + + slurls_map_t::const_iterator slurl_iter = mSLURLs.find(value["asset_id"]); + if (slurl_iter != mSLURLs.cend()) + { + LL_DEBUGS("FavoritesBar") << "Saving favorite: idx=" << LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID()) + << ", SLURL=" << slurl_iter->second + << ", value=" << value << LL_ENDL; + value["slurl"] = slurl_iter->second; + user_llsd[LLFavoritesOrderStorage::instance().getSortIndex((*it)->getUUID())] = value; + } + else + { + LL_WARNS("FavoritesBar") << "Not saving favorite " << value["name"] << ": no matching SLURL" << LL_ENDL; + } + } + + LLAvatarName av_name; + LLAvatarNameCache::get( gAgentID, &av_name ); + // Note : use the "John Doe" and not the "john.doe" version of the name + // as we'll compare it with the stored credentials in the login panel. + fav_llsd[av_name.getUserName()] = user_llsd; + + llofstream file; + file.open(filename.c_str()); + if ( file.is_open() ) + { + LLSDSerialize::toPrettyXML(fav_llsd, file); + LL_INFOS("FavoritesBar") << "saved favorites for '" << av_name.getUserName() + << "' to '" << filename << "' " + << LL_ENDL; + file.close(); + } + else + { + LL_WARNS("FavoritesBar") << "unable to open favorites storage for '" << av_name.getUserName() + << "' at '" << filename << "' " + << LL_ENDL; + } + } +} + +void LLFavoritesOrderStorage::removeFavoritesRecordOfUser() +{ + std::string filename = getStoredFavoritesFilename(); + if (!filename.empty()) + { + LLSD fav_llsd; + llifstream file; + file.open(filename.c_str()); + if (file.is_open()) + { + LLSDSerialize::fromXML(fav_llsd, file); + file.close(); + + LLAvatarName av_name; + LLAvatarNameCache::get( gAgentID, &av_name ); + // Note : use the "John Doe" and not the "john.doe" version of the name. + // See saveFavoritesSLURLs() here above for the reason why. + if (fav_llsd.has(av_name.getUserName())) + { + LL_INFOS("FavoritesBar") << "Removed favorites for " << av_name.getUserName() << LL_ENDL; + fav_llsd.erase(av_name.getUserName()); + } + + llofstream out_file; + out_file.open(filename.c_str()); + if ( out_file.is_open() ) + { + LLSDSerialize::toPrettyXML(fav_llsd, out_file); + LL_INFOS("FavoritesBar") << "saved favorites to '" << filename << "' " + << LL_ENDL; + out_file.close(); + } + } + } +} + +void LLFavoritesOrderStorage::onLandmarkLoaded(const LLUUID& asset_id, LLLandmark* landmark) +{ + if (landmark) + { + LL_DEBUGS("FavoritesBar") << "landmark for " << asset_id << " loaded" << LL_ENDL; + LLVector3d pos_global; + if (!landmark->getGlobalPos(pos_global)) + { + // If global position was unknown on first getGlobalPos() call + // it should be set for the subsequent calls. + landmark->getGlobalPos(pos_global); + } + + if (!pos_global.isExactlyZero()) + { + LL_DEBUGS("FavoritesBar") << "requesting slurl for landmark " << asset_id << LL_ENDL; + LLLandmarkActions::getSLURLfromPosGlobal(pos_global, + boost::bind(&LLFavoritesOrderStorage::storeFavoriteSLURL, this, asset_id, _1)); + } + } +} + +void LLFavoritesOrderStorage::storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl) +{ + LL_DEBUGS("FavoritesBar") << "Saving landmark SLURL '" << slurl << "' for " << asset_id << LL_ENDL; + mSLURLs[asset_id] = slurl; +} + +void LLFavoritesOrderStorage::save() +{ + if (mIsDirty) + { + // something changed, so save it + std::string filename = LLFavoritesOrderStorage::getInstance()->getSavedOrderFileName(); + if (!filename.empty()) + { + LLSD settings_llsd; + + for(sort_index_map_t::const_iterator iter = mSortIndexes.begin(); iter != mSortIndexes.end(); ++iter) + { + settings_llsd[iter->first.asString()] = iter->second; + } + + llofstream file; + file.open(filename.c_str()); + if ( file.is_open() ) + { + LLSDSerialize::toPrettyXML(settings_llsd, file); + LL_INFOS("FavoritesBar") << "saved favorites order to '" << filename << "' " << LL_ENDL; + } + else + { + LL_WARNS("FavoritesBar") << "failed to open favorites order file '" << filename << "' " << LL_ENDL; + } + } + else + { + LL_DEBUGS("FavoritesBar") << "no user directory available to store favorites order file" << LL_ENDL; + } + } +} + + +void LLFavoritesOrderStorage::cleanup() +{ + // nothing to clean + if (!mIsDirty) return; + + const LLUUID fav_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(fav_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); + + IsNotInFavorites is_not_in_fav(items); + + sort_index_map_t aTempMap; + //copy unremoved values from mSortIndexes to aTempMap + std::remove_copy_if(mSortIndexes.begin(), mSortIndexes.end(), + inserter(aTempMap, aTempMap.begin()), + is_not_in_fav); + + //Swap the contents of mSortIndexes and aTempMap + mSortIndexes.swap(aTempMap); +} + +// See also LLInventorySort where landmarks in the Favorites folder are sorted. +class LLViewerInventoryItemSort +{ +public: + bool operator()(const LLPointer& a, const LLPointer& b) const + { + return LLFavoritesOrderStorage::instance().getSortIndex(a->getUUID()) + < LLFavoritesOrderStorage::instance().getSortIndex(b->getUUID()); + } +}; + +void LLFavoritesOrderStorage::saveOrder() +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLIsType is_type(LLAssetType::AT_LANDMARK); + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + gInventory.collectDescendentsIf(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); + std::sort(items.begin(), items.end(), LLViewerInventoryItemSort()); + saveItemsOrder(items); +} + +void LLFavoritesOrderStorage::saveItemsOrder( const LLInventoryModel::item_array_t& items ) +{ + + int sortField = 0; + // current order is saved by setting incremental values (1, 2, 3, ...) for the sort field + for (LLInventoryModel::item_array_t::const_iterator i = items.begin(); i != items.end(); ++i) + { + LLViewerInventoryItem* item = *i; + + setSortIndex(item, ++sortField); + + item->setComplete(TRUE); + item->updateServer(FALSE); + + gInventory.updateItem(item); + + // Tell the parent folder to refresh its sort order. + gInventory.addChangedMask(LLInventoryObserver::SORT, item->getParentUUID()); + } + + gInventory.notifyObservers(); +} + + +// * @param source_item_id - LLUUID of the source item to be moved into new position +// * @param target_item_id - LLUUID of the target item before which source item should be placed. +void LLFavoritesOrderStorage::rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + //LLIsType is_type(LLAssetType::AT_LANDMARK); // Singu Note: We can have anything here~ + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + gInventory.collectDescendents(favorites_id, cats, items, LLInventoryModel::EXCLUDE_TRASH/*, is_type*/); + + // ensure items are sorted properly before changing order. EXT-3498 + std::sort(items.begin(), items.end(), LLViewerInventoryItemSort()); + + // update order + gInventory.updateItemsOrder(items, source_item_id, target_item_id); + + saveItemsOrder(items); +} + +void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id) +{ + if (mTargetLandmarkId.isNull()) return; + + LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId); +} +// EOF diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h new file mode 100644 index 000000000..ad3c8e95c --- /dev/null +++ b/indra/newview/llfavoritesbar.h @@ -0,0 +1,276 @@ +/** + * @file llfavoritesbar.h + * @brief LLFavoritesBarCtrl base class + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFAVORITESBARCTRL_H +#define LL_LLFAVORITESBARCTRL_H + +#include "llbutton.h" +#include "lluictrl.h" +#include "lltextbox.h" + +#include "llinventoryobserver.h" +#include "llinventorymodel.h" +#include "llviewerinventory.h" +#include "llui.h" //"llinitdestroyclass.h" +#if 0 + +class LLMenuItemCallGL; +class LLToggleableMenu; + +class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver +{ +public: + struct Params : public LLInitParam::Block + { + Optional image_drag_indication; + Optional more_button; + Optional label; + Params(); + }; + +protected: + LLFavoritesBarCtrl(const Params&); + friend class LLUICtrlFactory; +public: + virtual ~LLFavoritesBarCtrl(); + + /*virtual*/ BOOL postBuild() override; + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) override; + + /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + // LLInventoryObserver observer trigger + void changed(U32 mask) override; + void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override; + void draw() override; + + void showDragMarker(BOOL show) { mShowDragMarker = show; } + void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; } + +protected: + void updateButtons(); + LLButton* createButton(const LLPointer item, const LLButton::Params& button_params, S32 x_offset ); + const LLButton::Params& getButtonParams(); + BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items); + + void onButtonClick(LLUUID id); + void onButtonRightClick(LLUUID id,LLView* button,S32 x,S32 y,MASK mask); + + void onButtonMouseDown(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask); + void onOverflowMenuItemMouseDown(LLUUID id, LLUICtrl* item, S32 x, S32 y, MASK mask); + void onButtonMouseUp(LLUUID id, LLUICtrl* button, S32 x, S32 y, MASK mask); + + void onEndDrag(); + + bool enableSelected(const LLSD& userdata); + void doToSelected(const LLSD& userdata); + BOOL isClipboardPasteable() const; + void pasteFromClipboard() const; + + void showDropDownMenu(); + + LLHandle mOverflowMenuHandle; + LLHandle mContextMenuHandle; + + LLUUID mFavoriteFolderId; + const LLFontGL *mFont; + S32 mFirstDropDownItem; + S32 mDropDownItemsCount; + bool mUpdateDropDownItems; + bool mRestoreOverflowMenu; + + LLUUID mSelectedItemID; + + LLUIImage* mImageDragIndication; + +private: + /* + * Helper function to make code more readable. It handles all drag and drop + * operations of the existing favorites items on the favorites bar. + */ + void handleExistingFavoriteDragAndDrop(S32 x, S32 y); + + /* + * Helper function to make code more readable. It handles all drag and drop + * operations of the new landmark to the favorites bar. + */ + void handleNewFavoriteDragAndDrop(LLInventoryItem *item, const LLUUID& favorites_id, S32 x, S32 y); + + // finds a control under the specified LOCAL point + LLUICtrl* findChildByLocalCoords(S32 x, S32 y); + + // checks if the current order of the favorites items must be saved + BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items); + + /** + * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId. + * this function assumes that an item identified by insertedItemId doesn't exist in items array. + */ + void insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before); + + // finds an item by it's UUID in the items array + LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); + + void createOverflowMenu(); + + void updateMenuItems(LLToggleableMenu* menu); + + // Fits menu item label width with favorites menu width + void fitLabelWidth(LLMenuItemCallGL* menu_item); + + void addOpenLandmarksMenuItem(LLToggleableMenu* menu); + + void positionAndShowMenu(LLToggleableMenu* menu); + + BOOL mShowDragMarker; + LLUICtrl* mLandingTab; + LLUICtrl* mLastTab; + LLTextBox* mMoreTextBox; + LLTextBox* mBarLabel; + + LLUUID mDragItemId; + BOOL mStartDrag; + LLInventoryModel::item_array_t mItems; + + BOOL mTabsHighlightEnabled; + + boost::signals2::connection mEndDragConnection; +}; +#endif + +/** + * Class to store sorting order of favorites landmarks in a local file. EXT-3985. + * It replaced previously implemented solution to store sort index in landmark's name as a "@" prefix. + * Data are stored in user home directory. + */ +class LLFavoritesOrderStorage : public LLSingleton + , public LLDestroyClass +{ + friend class LLSingleton; + LLFavoritesOrderStorage(); //LLSINGLETON(LLFavoritesOrderStorage); + ~LLFavoritesOrderStorage() { save(); } + LOG_CLASS(LLFavoritesOrderStorage); +public: + /** + * Sets sort index for specified with LLUUID favorite landmark + */ + void setSortIndex(const LLViewerInventoryItem* inv_item, S32 sort_index); + + /** + * Gets sort index for specified with LLUUID favorite landmark + */ + S32 getSortIndex(const LLUUID& inv_item_id); + void removeSortIndex(const LLUUID& inv_item_id); + + void getSLURL(const LLUUID& asset_id); + + // Saves current order of the passed items using inventory item sort field. + // Resets 'items' sort fields and saves them on server. + // Is used to save order for Favorites folder. + void saveItemsOrder(const LLInventoryModel::item_array_t& items); + + void saveOrder(); + + void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id); + + /** + * Implementation of LLDestroyClass. Calls cleanup() instance method. + * + * It is important this callback is called before gInventory is cleaned. + * For now it is called from LLAppViewer::cleanup() -> LLAppViewer::disconnectViewer(), + * Inventory is cleaned later from LLAppViewer::cleanup() after LLAppViewer::disconnectViewer() is called. + * @see cleanup() + */ + static void destroyClass(); + + const static S32 NO_INDEX; +private: + /** + * Removes sort indexes for items which are not in Favorites bar for now. + */ + void cleanup(); + + const static std::string SORTING_DATA_FILE_NAME; + std::string getSavedOrderFileName(); + static std::string getStoredFavoritesFilename(); + + void load(); + void save(); + + void saveFavoritesSLURLs(); + + // Remove record of current user's favorites from file on disk. + void removeFavoritesRecordOfUser(); + + void onLandmarkLoaded(const LLUUID& asset_id, class LLLandmark* landmark); + void storeFavoriteSLURL(const LLUUID& asset_id, std::string& slurl); + + typedef std::map sort_index_map_t; + sort_index_map_t mSortIndexes; + + typedef std::map slurls_map_t; + slurls_map_t mSLURLs; + std::set mMissingSLURLs; + bool mIsDirty; + + struct IsNotInFavorites + { + IsNotInFavorites(const LLInventoryModel::item_array_t& items) + : mFavoriteItems(items) + { + + } + + /** + * Returns true if specified item is not found among inventory items + */ + bool operator()(const sort_index_map_t::value_type& id_index_pair) const + { + LLPointer item = gInventory.getItem(id_index_pair.first); + if (item.isNull()) return true; + + LLInventoryModel::item_array_t::const_iterator found_it = + std::find(mFavoriteItems.begin(), mFavoriteItems.end(), item); + + return found_it == mFavoriteItems.end(); + } + private: + LLInventoryModel::item_array_t mFavoriteItems; + }; + +}; + +inline +LLFavoritesOrderStorage::LLFavoritesOrderStorage() : + mIsDirty(false) +{ load(); } + +#endif // LL_LLFAVORITESBARCTRL_H diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 8cae2ce8b..817d35a8a 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -66,6 +66,7 @@ // Linden library includes #include "lldbstrings.h" +#include "llfavoritesbar.h" // Singu TODO: Favorites bar. #include "llfocusmgr.h" #include "llfontgl.h" #include "llgl.h" @@ -2161,6 +2162,10 @@ void LLFolderView::doIdle() { return; } + + LLFavoritesOrderStorage::instance(); // Singu TODO: Favorites bar. + BOOL collectFavoriteItems(); + collectFavoriteItems(); LL_RECORD_BLOCK_TIME(FTM_INVENTORY); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 985a6289e..a0c2b5e59 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -42,6 +42,7 @@ #include "llattachmentsmgr.h" #include "llavataractions.h" #include "llcallingcard.h" +#include "llfavoritesbar.h" // management of favorites folder #include "llfirstuse.h" #include "llfloatercustomize.h" #include "llfloateropenobject.h" @@ -3957,7 +3958,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c } else { - LLPointer cb = NULL; + LLPointer cb = nullptr; link_inventory_object(mUUID, LLConstPointer(inv_item), cb); } } @@ -4135,7 +4136,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Destination folder logic // - /* Singu TODO: Favorites // REORDER // (only reorder the item in Favorites folder) if ((mUUID == inv_item->getParentUUID()) && move_is_into_favorites) @@ -4145,7 +4145,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { LLUUID srcItemId = inv_item->getUUID(); LLUUID destItemId = itemp->getListener()->getUUID(); - gInventory.rearrangeFavoriteLandmarks(srcItemId, destItemId); + LLFavoritesOrderStorage::instance().rearrangeFavoriteLandmarks(srcItemId, destItemId); } } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 25bd0321e..7239420a6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3580,25 +3580,25 @@ void LLInventoryModel::saveItemsOrder(const LLInventoryModel::item_array_t& item } */ // See also LLInventorySort where landmarks in the Favorites folder are sorted. -/*class LLViewerInventoryItemSort +class LLViewerInventoryItemSort { public: - bool operator()(const LLPointer& a, const LLPointer& b) + bool operator()(const LLPointer& a, const LLPointer& b) const { return a->getSortField() < b->getSortField(); } -};*/ +}; /** * Sorts passed items by LLViewerInventoryItem sort field. * * @param[in, out] items - array of items, not sorted. */ -/*static void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items) -{ - static LLViewerInventoryItemSort sort_functor; - std::sort(items.begin(), items.end(), sort_functor); -}*/ +//static void rearrange_item_order_by_sort_field(LLInventoryModel::item_array_t& items) +//{ +// static LLViewerInventoryItemSort sort_functor; +// std::sort(items.begin(), items.end(), sort_functor); +//} // * @param source_item_id - LLUUID of the source item to be moved into new position // * @param target_item_id - LLUUID of the target item before which source item should be placed. diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index b9187ef6f..b64881f83 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -418,15 +418,6 @@ public: // Returns end() of the vector if not found. static LLInventoryModel::item_array_t::iterator findItemIterByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); - // Saves current order of the passed items using inventory item sort field. - // Resets 'items' sort fields and saves them on server. - // Is used to save order for Favorites folder. - //void saveItemsOrder(const LLInventoryModel::item_array_t& items); - - // Rearranges Landmarks inside Favorites folder. - // Moves source landmark before target one. - void rearrangeFavoriteLandmarks(const LLUUID& source_item_id, const LLUUID& target_item_id); - //-------------------------------------------------------------------- // Creation //-------------------------------------------------------------------- diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp new file mode 100644 index 000000000..ba1ba95b5 --- /dev/null +++ b/indra/newview/lllandmarkactions.cpp @@ -0,0 +1,421 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com +/** +* @file lllandmarkactions.cpp +* @brief LLLandmarkActions class implementation +* +* $LicenseInfo:firstyear=2001&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" +#include "lllandmarkactions.h" + +#include "roles_constants.h" + +#include "llinventory.h" +#include "llinventoryfunctions.h" +#include "lllandmark.h" +#include "llparcel.h" +#include "llregionhandle.h" + +#include "llnotificationsutil.h" + +#include "llagent.h" +#include "llagentui.h" +#include "llinventorymodel.h" +#include "lllandmarklist.h" +#include "llslurl.h" +#include "llstring.h" +#include "llviewerinventory.h" +#include "llviewerparcelmgr.h" +#include "llworldmapmessage.h" +#include "llviewerwindow.h" +#include "llwindow.h" +#include "llworldmap.h" + +void copy_slurl_to_clipboard_callback(const std::string& slurl); + +class LLFetchlLandmarkByPos : public LLInventoryCollectFunctor +{ +private: + LLVector3d mPos; +public: + LLFetchlLandmarkByPos(const LLVector3d& pos) : + mPos(pos) + {} + + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { + if (!item || item->getType() != LLAssetType::AT_LANDMARK) + return false; + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) // the landmark not been loaded yet + return false; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return false; + //we have to round off each coordinates to compare positions properly + return ll_round(mPos.mdV[VX]) == ll_round(landmark_global_pos.mdV[VX]) + && ll_round(mPos.mdV[VY]) == ll_round(landmark_global_pos.mdV[VY]) + && ll_round(mPos.mdV[VZ]) == ll_round(landmark_global_pos.mdV[VZ]); + } +}; + +class LLFetchLandmarksByName : public LLInventoryCollectFunctor +{ +private: + std::string name; + BOOL use_substring; + //this member will be contain copy of founded items to keep the result unique + std::set check_duplicate; + +public: +LLFetchLandmarksByName(std::string &landmark_name, BOOL if_use_substring) +:name(landmark_name), +use_substring(if_use_substring) + { + LLStringUtil::toLower(name); + } + +public: + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { + if (!item || item->getType() != LLAssetType::AT_LANDMARK) + return false; + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) // the landmark not been loaded yet + return false; + + bool acceptable = false; + std::string landmark_name = item->getName(); + LLStringUtil::toLower(landmark_name); + if(use_substring) + { + acceptable = landmark_name.find( name ) != std::string::npos; + } + else + { + acceptable = landmark_name == name; + } + if(acceptable){ + if(check_duplicate.find(landmark_name) != check_duplicate.end()){ + // we have duplicated items in landmarks + acceptable = false; + }else{ + check_duplicate.insert(landmark_name); + } + } + + return acceptable; + } +}; + +// Returns true if the given inventory item is a landmark pointing to the current parcel. +// Used to find out if there is at least one landmark from current parcel. +class LLFirstAgentParcelLandmark : public LLInventoryCollectFunctor +{ +private: + bool mFounded;// to avoid unnecessary check + +public: + LLFirstAgentParcelLandmark(): mFounded(false){} + + bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override + { + if (mFounded || !item || item->getType() != LLAssetType::AT_LANDMARK) + return false; + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) // the landmark not been loaded yet + return false; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return false; + mFounded = LLViewerParcelMgr::getInstance()->inAgentParcel(landmark_global_pos); + return mFounded; + } +}; + +static void fetch_landmarks(LLInventoryModel::cat_array_t& cats, + LLInventoryModel::item_array_t& items, + LLInventoryCollectFunctor& add) +{ + // Look in "My Favorites" + const LLUUID favorites_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); + gInventory.collectDescendentsIf(favorites_folder_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + add); + + // Look in "Landmarks" + const LLUUID landmarks_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); + gInventory.collectDescendentsIf(landmarks_folder_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + add); +} + +LLInventoryModel::item_array_t LLLandmarkActions::fetchLandmarksByName(std::string& name, BOOL use_substring) +{ + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFetchLandmarksByName by_name(name, use_substring); + fetch_landmarks(cats, items, by_name); + + return items; +} + +bool LLLandmarkActions::landmarkAlreadyExists() +{ + // Determine whether there are landmarks pointing to the current global agent position. + return findLandmarkForAgentPos() != nullptr; +} + +//static +bool LLLandmarkActions::hasParcelLandmark() +{ + LLFirstAgentParcelLandmark get_first_agent_landmark; + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + fetch_landmarks(cats, items, get_first_agent_landmark); + return !items.empty(); + +} + +// *TODO: This could be made more efficient by only fetching the FIRST +// landmark that meets the criteria +LLViewerInventoryItem* LLLandmarkActions::findLandmarkForGlobalPos(const LLVector3d &pos) +{ + // Determine whether there are landmarks pointing to the current parcel. + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLFetchlLandmarkByPos is_current_pos_landmark(pos); + fetch_landmarks(cats, items, is_current_pos_landmark); + + return (items.empty()) ? nullptr : items[0]; +} + +LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos() +{ + return findLandmarkForGlobalPos(gAgent.getPositionGlobal()); +} + +bool LLLandmarkActions::canCreateLandmarkHere() +{ + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if(!agent_parcel) + { + LL_WARNS() << "No agent region" << LL_ENDL; + return false; + } + if (agent_parcel->getAllowLandmark() + || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) + { + return true; + } + + return false; +} + +void LLLandmarkActions::createLandmarkHere( + const std::string& name, + const std::string& desc, + const LLUUID& folder_id) +{ + if(!gAgent.getRegion()) + { + LL_WARNS() << "No agent region" << LL_ENDL; + return; + } + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!agent_parcel) + { + LL_WARNS() << "No agent parcel" << LL_ENDL; + return; + } + if (!canCreateLandmarkHere()) + { + LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); + return; + } + + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + folder_id, LLTransactionID::tnull, + name, desc, + LLAssetType::AT_LANDMARK, + LLInventoryType::IT_LANDMARK, + NOT_WEARABLE, PERM_ALL, + NULL); +} + +void LLLandmarkActions::createLandmarkHere() +{ + std::string landmark_name, landmark_desc; + + LLAgentUI::buildLocationString(landmark_name, LLAgentUI::LOCATION_FORMAT_LANDMARK); + LLAgentUI::buildLocationString(landmark_desc, LLAgentUI::LOCATION_FORMAT_FULL); + const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); + + createLandmarkHere(landmark_name, landmark_desc, folder_id); +} + +LLVector3d getRegionPosFromGlobalPos(const LLVector3d& global_pos, const LLSimInfo* siminfo) +{ + LLVector3d local_pos; + local_pos[0] = fmod(global_pos[0], siminfo ? siminfo->getSizeX() : 256); + local_pos[1] = fmod(global_pos[1], siminfo ? siminfo->getSizeY() : 256); + return local_pos; +} + +void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped /* = true */) +{ + const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (siminfo) + { + std::string slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString(); + cb(slurl); + } + else + { + U64 new_region_handle = to_region_handle(global_pos); + + LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseSLURL, + cb, + global_pos, + escaped, + _2); + + LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, LLStringExplicit("unused"), false); + } +} + +void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& global_pos, region_name_and_coords_callback_t cb) +{ + LLSimInfo* sim_infop = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (sim_infop) + { + LLVector3 pos = sim_infop->getLocalPos(global_pos); + std::string name = sim_infop->getName() ; + cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ])); + } + else + { + U64 new_region_handle = to_region_handle(global_pos); + + LLWorldMapMessage::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponseNameAndCoords, + cb, + global_pos, + _1); + + LLWorldMapMessage::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, std::string("unused"), false); + } +} + +void LLLandmarkActions::onRegionResponseSLURL(slurl_callback_t cb, + const LLVector3d& global_pos, + bool escaped, + const std::string& url) +{ + std::string sim_name; + std::string slurl; + const LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_pos); + if (siminfo) + { + slurl = LLSLURL(siminfo->getName(), getRegionPosFromGlobalPos(global_pos, siminfo)).getSLURLString(); + } + else + { + slurl.clear(); + } + + cb(slurl); +} + +void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_callback_t cb, + const LLVector3d& global_pos, + U64 region_handle) +{ + LLSimInfo* sim_infop = LLWorldMap::getInstance()->simInfoFromHandle(region_handle); + if (sim_infop) + { + LLVector3 local_pos = sim_infop->getLocalPos(global_pos); + std::string name = sim_infop->getName() ; + cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ])); + } +} + +bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal) +{ + LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); + if (NULL == item) + return false; + + const LLUUID& asset_id = item->getAssetUUID(); + + LLLandmark* landmark = gLandmarkList.getAsset(asset_id); + if (NULL == landmark) + return false; + + return landmark->getGlobalPos(posGlobal); +} + +LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb) +{ + LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); + if (NULL == item) + return NULL; + + const LLUUID& asset_id = item->getAssetUUID(); + + LLLandmark* landmark = gLandmarkList.getAsset(asset_id, cb); + if (landmark) + { + return landmark; + } + + return NULL; +} + +void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID) +{ + LLLandmark* landmark = LLLandmarkActions::getLandmark(landmarkInventoryItemID); + if(landmark) + { + LLVector3d global_pos; + landmark->getGlobalPos(global_pos); + LLLandmarkActions::getSLURLfromPosGlobal(global_pos,©_slurl_to_clipboard_callback,true); + } +} + +void copy_slurl_to_clipboard_callback(const std::string& slurl) +{ + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl)); + LLSD args; + args["SLURL"] = slurl; + LLNotificationsUtil::add("CopySLURL", args); +} diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h new file mode 100644 index 000000000..8ac61d6af --- /dev/null +++ b/indra/newview/lllandmarkactions.h @@ -0,0 +1,138 @@ +/** + * @file lllandmarkactions.h + * @brief LLLandmark class declaration + * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLLANDMARKACTIONS_H +#define LL_LLLANDMARKACTIONS_H + +#include "llinventorymodel.h" + +#include "lllandmarklist.h" + +class LLLandmark; + +/** + * @brief Provides helper functions to manage landmarks + */ +class LLLandmarkActions +{ +public: + typedef std::function slurl_callback_t; + typedef std::function region_name_and_coords_callback_t; + + /** + * @brief Fetches landmark LLViewerInventoryItems for the given landmark name. + */ + static LLInventoryModel::item_array_t fetchLandmarksByName(std::string& name, BOOL if_use_substring); + /** + * @brief Checks whether landmark exists for current agent position. + */ + static bool landmarkAlreadyExists(); + + /** + * @brief Checks whether landmark exists for current agent parcel. + */ + static bool hasParcelLandmark(); + + /** + * @brief Searches landmark for global position. + * @return Returns landmark or NULL. + * + * *TODO: dzaporozhan: There can be many landmarks for single parcel. + */ + static LLViewerInventoryItem* findLandmarkForGlobalPos(const LLVector3d &pos); + + /** + * @brief Searches landmark for agent global position. + * @return Returns landmark or NULL. + * + * *TODO: dzaporozhan: There can be many landmarks for single parcel. + */ + static LLViewerInventoryItem* findLandmarkForAgentPos(); + + + /** + * @brief Checks whether agent has rights to create landmark for current parcel. + */ + static bool canCreateLandmarkHere(); + + /** + * @brief Creates landmark for current parcel. + */ + static void createLandmarkHere(); + + /** + * @brief Creates landmark for current parcel. + */ + static void createLandmarkHere( + const std::string& name, + const std::string& desc, + const LLUUID& folder_id); + /** + * @brief Creates SLURL for given global position. + */ + static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb, bool escaped = true); + + static void getRegionNameAndCoordsFromPosGlobal(const LLVector3d& global_pos, region_name_and_coords_callback_t cb); + + /** + * @brief Gets landmark global position specified by inventory LLUUID. + * Found position is placed into "posGlobal" variable. + *. + * @return - true if specified item exists in Inventory and an appropriate landmark found. + * and its position is known, false otherwise. + */ + // *TODO: mantipov: profide callback for cases, when Landmark is not loaded yet. + static bool getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal); + + /** + * @brief Retrieve a landmark from gLandmarkList by inventory item's id + * If a landmark is not currently in the gLandmarkList a callback "cb" is called when it is loaded. + * + * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded. + */ + static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID, LLLandmarkList::loaded_callback_t cb = nullptr); + + /** + * @brief Performs standard action of copying of SLURL from landmark to user's clipboard. + * This action requires additional server request. The user will be notified by info message, + * when URL is copied . + */ + static void copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID); + +private: + LLLandmarkActions() = delete; + LLLandmarkActions(const LLLandmarkActions&) = delete; + + static void onRegionResponseSLURL(slurl_callback_t cb, + const LLVector3d& global_pos, + bool escaped, + const std::string& url); + static void onRegionResponseNameAndCoords(region_name_and_coords_callback_t cb, + const LLVector3d& global_pos, + U64 region_handle); +}; + +#endif //LL_LLLANDMARKACTIONS_H diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 1d2eab102..02cfd326a 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -1,3 +1,5 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check it. +// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com /** * @file lllandmarklist.cpp * @brief Landmark asset list class @@ -35,7 +37,6 @@ #include "llagent.h" #include "llvfile.h" #include "llviewerstats.h" -#include "llnotificationsutil.h" // Globals LLLandmarkList gLandmarkList; @@ -47,6 +48,7 @@ LLLandmarkList gLandmarkList; LLLandmarkList::~LLLandmarkList() { std::for_each(mList.begin(), mList.end(), DeletePairedPointer()); + mList.clear(); } LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb) @@ -67,7 +69,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t { if ( mBadList.find(asset_uuid) != mBadList.end() ) { - return NULL; + return nullptr; } landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid); @@ -76,7 +78,7 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t const F32 rerequest_time = 30.f; // 30 seconds between requests if (gFrameTimeSeconds - iter->second < rerequest_time) { - return NULL; + return nullptr; } } @@ -89,10 +91,10 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t gAssetStorage->getAssetData(asset_uuid, LLAssetType::AT_LANDMARK, LLLandmarkList::processGetAssetReply, - NULL); + nullptr); mRequestedList[asset_uuid] = gFrameTimeSeconds; } - return NULL; + return nullptr; } // static @@ -143,14 +145,16 @@ void LLLandmarkList::processGetAssetReply( else { LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - + // SJB: No use case for a notification here. Use LL_DEBUGS() instead if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { - LLNotificationsUtil::add("LandmarkMissing"); + LL_WARNS("Landmarks") << "Missing Landmark" << LL_ENDL; + //LLNotificationsUtil::add("LandmarkMissing"); } else { - LLNotificationsUtil::add("UnableToLoadLandmark"); + LL_WARNS("Landmarks") << "Unable to load Landmark" << LL_ENDL; + //LLNotificationsUtil::add("UnableToLoadLandmark"); } gLandmarkList.mBadList.insert(uuid); diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index ab51f7135..4983af562 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -27,11 +27,6 @@ #ifndef LL_LLLANDMARKLIST_H #define LL_LLLANDMARKLIST_H -#ifndef BOOST_FUNCTION_HPP_INCLUDED -#include -#define BOOST_FUNCTION_HPP_INCLUDED -#endif -#include #include "lllandmark.h" #include "lluuid.h" #include "llassetstorage.h" @@ -43,7 +38,7 @@ class LLInventoryItem; class LLLandmarkList { public: - typedef boost::function loaded_callback_t; + typedef std::function loaded_callback_t; LLLandmarkList() {} ~LLLandmarkList(); @@ -53,7 +48,7 @@ public: //const LLLandmark* getNext() { return mList.getNextData(); } BOOL assetExists(const LLUUID& asset_uuid); - LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL); + LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = nullptr); static void processGetAssetReply( LLVFS *vfs, const LLUUID& uuid, diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 4861a102b..cea6e239c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -86,6 +86,8 @@ #include // #include + +#include "llsdserialize.h" #include "llstring.h" #include @@ -354,6 +356,67 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect) { setFields(*saved_login_entries.rbegin()); } + + addFavoritesToStartLocation(); +} + +void LLPanelLogin::addFavoritesToStartLocation() +{ + // Clear the combo. + auto combo = getChild("start_location_combo"); + if (!combo) return; + S32 num_items = combo->getItemCount(); + for (S32 i = num_items - 1; i > 2; i--) + { + combo->remove(i); + } + + // Load favorites into the combo. + const auto grid = gHippoGridManager->getCurrentGrid(); + std::string first, last; + getFields(first, last, std::string()); + auto user_defined_name(first + ' ' + last); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + grid->getGridName() + ".xml"); + std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); + + LLSD fav_llsd; + llifstream file; + file.open(filename); + if (!file.is_open()) + { + file.open(old_filename); + if (!file.is_open()) return; + } + LLSDSerialize::fromXML(fav_llsd, file); + + for (LLSD::map_const_iterator iter = fav_llsd.beginMap(); + iter != fav_llsd.endMap(); ++iter) + { + // The account name in stored_favorites.xml has Resident last name even if user has + // a single word account name, so it can be compared case-insensitive with the + // user defined "firstname lastname". + S32 res = LLStringUtil::compareInsensitive(user_defined_name, iter->first); + if (res != 0) + { + LL_DEBUGS() << "Skipping favorites for " << iter->first << LL_ENDL; + continue; + } + + combo->addSeparator(); + LL_DEBUGS() << "Loading favorites for " << iter->first << LL_ENDL; + auto user_llsd = iter->second; + for (LLSD::array_const_iterator iter1 = user_llsd.beginArray(); + iter1 != user_llsd.endArray(); ++iter1) + { + std::string label = (*iter1)["name"].asString(); + std::string value = (*iter1)["slurl"].asString(); + if (!label.empty() && !value.empty()) + { + combo->add(label, value); + } + } + break; + } } void LLPanelLogin::setSiteIsAlive(bool alive) @@ -1048,6 +1111,42 @@ void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl) } gHippoGridManager->setCurrentGrid(grid); ctrl->setValue(grid); + sInstance->addFavoritesToStartLocation(); + + /* + * Determine whether or not the value in the start_location_combo makes sense + * with the new grid value. + * + * Note that some forms that could be in the location combo are grid-agnostic, + * such as "MyRegion/128/128/0". There could be regions with that name on any + * number of grids, so leave them alone. Other forms, such as + * https://grid.example.com/region/Party%20Town/20/30/5 specify a particular + * grid; in those cases we want to clear the location. + */ + auto location_combo = sInstance->getChild("start_location_combo"); + S32 index = location_combo->getCurrentIndex(); + switch (index) + { + case 0: // last location + case 1: // home location + // do nothing - these are grid-agnostic locations + break; + + default: + { + std::string location = location_combo->getValue().asString(); + LLSLURL slurl(location); // generata a slurl from the location combo contents + if ( slurl.getType() == LLSLURL::LOCATION + && slurl.getGrid() != gHippoGridManager->getCurrentGridNick() + ) + { + // the grid specified by the location is not this one, so clear the combo + location_combo->setCurrentByIndex(0); // last location on the new grid + location_combo->setTextEntry(LLStringUtil::null); + } + } + break; + } } void LLPanelLogin::onLocationSLURL() @@ -1067,6 +1166,8 @@ void LLPanelLogin::onSelectLoginEntry(const LLSD& selected_entry) setFields(LLSavedLoginEntry(selected_entry)); // This stops the automatic matching of the first name to a selected grid. LLViewerLogin::getInstance()->setNameEditted(true); + + sInstance->addFavoritesToStartLocation(); } void LLPanelLogin::onLoginComboLostFocus(LLComboBox* combo_box) diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index e8f050a4c..88b4a4c37 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -107,6 +107,7 @@ public: private: void reshapeBrowser(); + void addFavoritesToStartLocation(); void onLocationSLURL(); void onClickConnect(); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index e07ccebeb..58f369bec 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -50,8 +50,8 @@ #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llfloaterperms.h" +#include "lllandmarkactions.h" -#include "lllandmark.h" #include "llviewerassettype.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" @@ -62,6 +62,7 @@ #include "llcommandhandler.h" #include "llviewermessage.h" #include "llavatarnamecache.h" +#include "llfavoritesbar.h" #include "llsdutil.h" @@ -1090,13 +1091,6 @@ void create_notecard_cb(const LLUUID& inv_item) } } -void AddFavoriteLandmarkCallback::fire(const LLUUID& inv_item_id) -{ - if (mTargetLandmarkId.isNull()) return; - - //gInventory.rearrangeFavoriteLandmarks(inv_item_id, mTargetLandmarkId); // MULTI-WEARABLES TODO -} - LLInventoryCallbackManager gInventoryCallbacks; void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id, @@ -2136,17 +2130,21 @@ const std::string& LLViewerInventoryItem::getName() const return LLInventoryItem::getName(); } -#if 0 S32 LLViewerInventoryItem::getSortField() const { return LLFavoritesOrderStorage::instance().getSortIndex(mUUID); } +//void LLViewerInventoryItem::setSortField(S32 sortField) +//{ +// LLFavoritesOrderStorage::instance().setSortIndex(mUUID, sortField); +// getSLURL(); +//} + void LLViewerInventoryItem::getSLURL() { LLFavoritesOrderStorage::instance().getSLURL(mAssetUUID); } -#endif const LLPermissions& LLViewerInventoryItem::getPermissions() const { @@ -2244,6 +2242,33 @@ U32 LLViewerInventoryItem::getCRC32() const return LLInventoryItem::getCRC32(); } +// *TODO: mantipov: should be removed with LMSortPrefix patch in llinventorymodel.cpp, EXT-3985 +static char getSeparator() { return '@'; } +BOOL LLViewerInventoryItem::extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName) +{ + const char separator = getSeparator(); + const std::string::size_type separatorPos = name.find(separator, 0); + + BOOL result = FALSE; + + if (separatorPos < std::string::npos) + { + if (sortField) + { + *sortField = std::stoi(name.substr(0, separatorPos)); + } + + if (displayName) + { + *displayName = name.substr(separatorPos + 1, std::string::npos); + } + + result = TRUE; + } + + return result; +} + // This returns true if the item that this item points to // doesn't exist in memory (i.e. LLInventoryModel). The baseitem // might still be in the database but just not loaded yet. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 7b9db7234..20a1ca465 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -63,6 +63,9 @@ public: virtual const LLUUID& getAssetUUID() const; virtual const LLUUID& getProtectedAssetUUID() const; // returns LLUUID::null if current agent does not have permission to expose this asset's UUID to the user virtual const std::string& getName() const; + virtual S32 getSortField() const; + //virtual void setSortField(S32 sortField); + virtual void getSLURL(); //Caches SLURL for landmark. //*TODO: Find a better way to do it and remove this method from here. virtual const LLPermissions& getPermissions() const; virtual const bool getIsFullPerm() const; // 'fullperm' in the popular sense: modify-ok & copy-ok & transfer-ok, no special god rules applied virtual const LLUUID& getCreatorUUID() const; @@ -75,6 +78,8 @@ public: virtual time_t getCreationDate() const; virtual U32 getCRC32() const; // really more of a checksum. + static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName); + // construct a complete viewer inventory item LLViewerInventoryItem(const LLUUID& uuid, const LLUUID& parent_uuid, const LLPermissions& permissions, From d04067bd09462e66dc53fc4a3391ba85e65affd0 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 6 Feb 2019 19:49:39 -0500 Subject: [PATCH 32/90] [Local Textures] Default updating to on --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9baecde77..22fe29d72 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1196,7 +1196,7 @@ Found in Advanced->Rendering->Info Displays Type Boolean Value - 0 + 1 InstantMessageLogPathAnyAccount From bd442fb4123cf57130dae8fb8ccf32b793ac98b7 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 6 Feb 2019 19:51:54 -0500 Subject: [PATCH 33/90] [Local Textures] Some code polish --- indra/newview/floaterlocalassetbrowse.cpp | 104 ++++++++++------------ indra/newview/floaterlocalassetbrowse.h | 25 +++--- 2 files changed, 58 insertions(+), 71 deletions(-) diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp index c53705cf9..bc7321b09 100644 --- a/indra/newview/floaterlocalassetbrowse.cpp +++ b/indra/newview/floaterlocalassetbrowse.cpp @@ -107,7 +107,6 @@ LocalBitmap::LocalBitmap(std::string fullpath) bitmap_type = TYPE_TEXTURE; sculpt_dirty = false; volume_dirty = false; - valid = false; /* taking care of extension type now to avoid switch madness */ std::string temp_exten = gDirUtilp->getExtension(filename); @@ -294,63 +293,54 @@ void LocalBitmap::setType( S32 type ) } /* [information query functions] */ -std::string LocalBitmap::getShortName() +std::string LocalBitmap::getShortName() const { return shortname; } -std::string LocalBitmap::getFileName() +std::string LocalBitmap::getFileName() const { return filename; } -LLUUID LocalBitmap::getID() +LLUUID LocalBitmap::getID() const { return id; } -LLSD LocalBitmap::getLastModified() +LLSD LocalBitmap::getLastModified() const { return last_modified; } -std::string LocalBitmap::getLinkStatus() +std::string LocalBitmap::getLinkStatus() const { switch(linkstatus) { - case LINK_ON: - return "On"; - - case LINK_OFF: - return "Off"; - - case LINK_BROKEN: - return "Broken"; - - case LINK_UPDATING: - return "Updating"; - - default: - return "Unknown"; + case LINK_ON: return "On"; + case LINK_OFF: return "Off"; + case LINK_BROKEN: return "Broken"; + case LINK_UPDATING: return "Updating"; + default: return "Unknown"; } } -bool LocalBitmap::getUpdateBool() +bool LocalBitmap::getUpdateBool() const { return keep_updating; } -bool LocalBitmap::getIfValidBool() +bool LocalBitmap::getIfValidBool() const { return valid; } -S32 LocalBitmap::getType() +S32 LocalBitmap::getType() const { return bitmap_type; } -std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable) +std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable) const { std::vector matching_faces; @@ -365,7 +355,7 @@ std::vector LocalBitmap::getFaceUsesThis(LLDrawable* drawable) return matching_faces; } -std::vector LocalBitmap::getUsingObjects(bool seek_by_type, bool seek_textures, bool seek_sculptmaps) +std::vector LocalBitmap::getUsingObjects(bool seek_by_type, bool seek_textures, bool seek_sculptmaps) const { std::vector affected_vector; @@ -413,21 +403,20 @@ std::vector LocalBitmap::getUsingObjects(bool seek_by_type, boo return affected_vector; } -void LocalBitmap::getDebugInfo() +void LocalBitmap::getDebugInfo() const { /* debug function: dumps everything human readable into llinfos */ - LL_INFOS() << "===[local bitmap debug]===" << "\n" - << "path: " << filename << "\n" - << "name: " << shortname << "\n" - << "extension: " << extension << "\n" - << "uuid: " << id << "\n" - << "last modified: " << last_modified << "\n" - << "link status: " << getLinkStatus() << "\n" - << "keep updated: " << keep_updating << "\n" - << "type: " << bitmap_type << "\n" - << "is valid: " << valid << "\n" + LL_INFOS() << "===[local bitmap debug]===" << '\n' + << "path: " << filename << '\n' + << "name: " << shortname << '\n' + << "extension: " << extension << '\n' + << "uuid: " << id << '\n' + << "last modified: " << last_modified << '\n' + << "link status: " << getLinkStatus() << '\n' + << "keep updated: " << keep_updating << '\n' + << "type: " << bitmap_type << '\n' + << "is valid: " << valid << '\n' << "==========================" << LL_ENDL; - } /*=======================================*/ @@ -592,21 +581,20 @@ void LocalAssetBrowser::UpdateTextureCtrlList(LLScrollListCtrl* ctrl) if (ctrl) // checking again in case called externally for some silly reason. { ctrl->clearRows(); - if ( !loaded_bitmaps.empty() ) + for (const auto& bitmap : loaded_bitmaps) { - for (local_list_iter iter = loaded_bitmaps.begin(); iter != loaded_bitmaps.end(); ++iter) - { - LLSD element; - element["columns"][0]["column"] = "unit_name"; - element["columns"][0]["type"] = "text"; - element["columns"][0]["value"] = (*iter).shortname; + auto row = LLScrollListItem::Params(); + row.columns.add(LLScrollListCell::Params() + .column("unit_name") + .type("text") + .value(bitmap.shortname)); - element["columns"][1]["column"] = "unit_id_HIDDEN"; - element["columns"][1]["type"] = "text"; - element["columns"][1]["value"] = (*iter).id; + row.columns.add(LLScrollListCell::Params() + .column("unit_id_HIDDEN") + .type("text") + .value(bitmap.id)); - ctrl->addElement(element); - } + ctrl->addRow(row); } } } @@ -855,10 +843,9 @@ void FloaterLocalAssetBrowser::UpdateRightSide() */ if (!mTextureView->getVisible()) return; - if (!mBitmapList->getAllSelected().empty()) + if (const auto& selected = mBitmapList->getFirstSelected()) { - LocalBitmap* unit = gLocalBrowser->GetBitmapUnit( LLUUID(mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID)) ); - + LocalBitmap* unit = gLocalBrowser->GetBitmapUnit(LLUUID(selected->getColumn(BITMAPLIST_COL_ID)->getValue())); if ( unit ) { mTextureView->setImageAssetID(unit->getID()); @@ -885,11 +872,12 @@ void FloaterLocalAssetBrowser::UpdateRightSide() mTypeComboBox->selectFirstItem(); mTypeComboBox->setEnabled(false); - mPathTxt->setText(LLStringExplicit("None")); - mUUIDTxt->setText(LLStringExplicit("None")); - mNameTxt->setText(LLStringExplicit("None")); - mLinkTxt->setText(LLStringExplicit("None")); - mTimeTxt->setText(LLStringExplicit("None")); + const auto none = LLStringExplicit("None"); + mPathTxt->setText(none); + mUUIDTxt->setText(none); + mNameTxt->setText(none); + mLinkTxt->setText(none); + mTimeTxt->setText(none); } } @@ -931,7 +919,7 @@ void LocalAssetBrowserTimer::stop() mEventTimer.stop(); } -bool LocalAssetBrowserTimer::isRunning() +bool LocalAssetBrowserTimer::isRunning() const { return mEventTimer.getStarted(); } diff --git a/indra/newview/floaterlocalassetbrowse.h b/indra/newview/floaterlocalassetbrowse.h index dd7e618ea..5934b667f 100644 --- a/indra/newview/floaterlocalassetbrowse.h +++ b/indra/newview/floaterlocalassetbrowse.h @@ -127,25 +127,24 @@ class LocalBitmap }; public: /* [information query functions] */ - std::string getShortName(); - std::string getFileName(); - LLUUID getID(); - LLSD getLastModified(); - std::string getLinkStatus(); - bool getUpdateBool(); + std::string getShortName() const; + std::string getFileName() const; + LLSD getLastModified() const; + std::string getLinkStatus() const; + bool getUpdateBool() const; void setType( S32 ); - bool getIfValidBool(); - S32 getType(); - void getDebugInfo(); + bool getIfValidBool() const; + S32 getType() const; + void getDebugInfo() const; private: /* [maintenence functions] */ void updateSelf(); bool decodeSelf(LLImageRaw* rawimg); void setUpdateBool(); - std::vector getFaceUsesThis(LLDrawable*); + std::vector getFaceUsesThis(LLDrawable*) const; std::vector getUsingObjects(bool seek_by_type = true, - bool seek_textures = false, bool seek_sculptmaps = false); + bool seek_textures = false, bool seek_sculptmaps = false) const; protected: /* [basic properties] */ std::string shortname; @@ -289,10 +288,10 @@ class LocalAssetBrowserTimer : public LLEventTimer public: LocalAssetBrowserTimer(); ~LocalAssetBrowserTimer(); - virtual BOOL tick(); + BOOL tick() override; void start(); void stop(); - bool isRunning(); + bool isRunning() const; }; #endif From 8a4ab08810eacaf939c1d205dc099dade0cc1d9e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 6 Feb 2019 20:43:02 -0500 Subject: [PATCH 34/90] Fix compile --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 87269d478..969dff5a8 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -52,7 +52,7 @@ #include "lllogininstance.h" #endif #include "llnotificationsutil.h" -#include "lltoggleablemenu.h" +//#include "lltoggleablemenu.h" #include "llviewerinventory.h" #include "llviewermenu.h" #include "hippogridmanager.h" //"llviewernetwork.h" From aa0fea69312375d9efa48117e6407f4b80f69e8e Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 7 Feb 2019 01:33:34 -0500 Subject: [PATCH 35/90] [Local Textures] Small hack to allow changing texture id --- indra/newview/floaterlocalassetbrowse.cpp | 31 +++++++++++++++++++++++ indra/newview/floaterlocalassetbrowse.h | 4 +++ indra/newview/llviewertexture.h | 1 + 3 files changed, 36 insertions(+) diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp index bc7321b09..5e65e796b 100644 --- a/indra/newview/floaterlocalassetbrowse.cpp +++ b/indra/newview/floaterlocalassetbrowse.cpp @@ -292,6 +292,15 @@ void LocalBitmap::setType( S32 type ) bitmap_type = type; } +void LocalBitmap::setID(const LLUUID& uuid) +{ + LLViewerFetchedTexture* image = gTextureList.findImage(id); + gTextureList.deleteImage(image); + id = uuid; + image->setID(id); + gTextureList.addImage(image); +} + /* [information query functions] */ std::string LocalBitmap::getShortName() const { @@ -719,6 +728,11 @@ FloaterLocalAssetBrowser::FloaterLocalAssetBrowser() // checkbox callbacks mUpdateChkBox->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onClickUpdateChkbox,this)); + + // Allow changing the ID! + mUUIDTxt->setCommitCallback(boost::bind(&FloaterLocalAssetBrowser::onUpdateID, this, _2)); + mUUIDTxt->setCommitOnReturn(true); + mUUIDTxt->setCommitOnFocusLost(true); } void FloaterLocalAssetBrowser::show(void*) @@ -786,6 +800,21 @@ void FloaterLocalAssetBrowser::onCommitTypeCombo() } } +void FloaterLocalAssetBrowser::onUpdateID(const LLSD& val) +{ + const auto& id = val.asUUID(); + const auto& col = mBitmapList->getFirstSelected()->getColumn(BITMAPLIST_COL_ID); + const auto& old_id = col->getValue().asString(); + if (id.isNull() && id.asString() != old_id) // Just reset if invalid or unchanged + mUUIDTxt->setValue(old_id); + else + { + gLocalBrowser->GetBitmapUnit(LLUUID(old_id))->setID(id); + mTextureView->setImageAssetID(id); + col->setValue(id); + } +} + void FloaterLocalAssetBrowser::FloaterResize(bool expand) { mMoreBtn->setVisible(!expand); @@ -860,6 +889,7 @@ void FloaterLocalAssetBrowser::UpdateRightSide() mTextureView->setEnabled(true); mUpdateChkBox->setEnabled(true); mTypeComboBox->setEnabled(true); + mUUIDTxt->setEnabled(true); } } else @@ -871,6 +901,7 @@ void FloaterLocalAssetBrowser::UpdateRightSide() mTypeComboBox->selectFirstItem(); mTypeComboBox->setEnabled(false); + mUUIDTxt->setEnabled(false); const auto none = LLStringExplicit("None"); mPathTxt->setText(none); diff --git a/indra/newview/floaterlocalassetbrowse.h b/indra/newview/floaterlocalassetbrowse.h index 5934b667f..593b21249 100644 --- a/indra/newview/floaterlocalassetbrowse.h +++ b/indra/newview/floaterlocalassetbrowse.h @@ -129,6 +129,8 @@ class LocalBitmap public: /* [information query functions] */ std::string getShortName() const; std::string getFileName() const; + LLUUID getID() const; + void setID(const LLUUID&); LLSD getLastModified() const; std::string getLinkStatus() const; bool getUpdateBool() const; @@ -240,6 +242,8 @@ private: // Combobox type select void onCommitTypeCombo(); + void onUpdateID(const LLSD& val); + // Widgets LLButton* mAddBtn; LLButton* mDelBtn; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5b5ae3dfe..8e05d06d0 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -135,6 +135,7 @@ public: /*virtual*/ bool isActiveFetching(); /*virtual*/ const LLUUID& getID() const { return mID; } + void setID(const LLUUID& id) { mID = id; } // Edit for local assets to cut down on reloads, be sure to remove from wherever this has been added first. void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } From 90285944d99328490677d578dbf34c55223f10bb Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 7 Feb 2019 01:34:09 -0500 Subject: [PATCH 36/90] Line editors need to commit on return --- indra/llui/lllineeditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 66b8d64ec..1db2638e0 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1497,8 +1497,9 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) break; case KEY_RETURN: + if (getCommitOnReturn()) onCommit(); // store sent line in history - updateHistory(); + else updateHistory(); break; case KEY_ESCAPE: From 2493c401f95ac8144d94b660431a2089e4dbd58c Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 9 Feb 2019 16:50:38 -0500 Subject: [PATCH 37/90] Force replacing registered urls everywhere that's not from another user I think I covered all my bases: Local Chat, IMs/Group/Conference Chats Script Dialogs Group Notices There are a few others maybe, like notifications EMs can spawn but if those are intentionally tricking people, grid owners should be informed. --- indra/llui/lltexteditor.cpp | 18 ++++++++---------- indra/llui/lltexteditor.h | 4 ++-- indra/newview/llfloaterchat.cpp | 4 ++-- indra/newview/llgroupnotify.cpp | 7 ++++--- indra/newview/llimpanel.cpp | 4 ++-- indra/newview/llnotify.cpp | 2 +- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 5aae494be..8696951cd 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -4262,7 +4262,7 @@ void LLTextEditor::appendColoredText(const std::string &new_text, static LLTrace::BlockTimerStatHandle FTM_APPEND_TEXT("Append Text"); void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool prepend_newline, - const LLStyleSP style) + const LLStyleSP style, bool force_replace_links) { LL_RECORD_BLOCK_TIME(FTM_APPEND_TEXT); if (new_text.empty()) @@ -4280,10 +4280,11 @@ void LLTextEditor::appendText(const std::string &new_text, bool allow_undo, bool static LLTrace::BlockTimerStatHandle FTM_PARSE_HTML("Parse HTML"); // Appends new text to end of document -void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP style) +void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP style, bool force_replace_links) { std::string text = new_text; - static LLUICachedControl replace_links("SinguReplaceLinks"); + static const LLUICachedControl replace_links("SinguReplaceLinks"); + force_replace_links = force_replace_links || replace_links; bool is_link = style && style->isLink(); // Don't search for URLs inside a link segment (STORM-358). S32 part = (S32)LLTextParser::WHOLE; @@ -4309,8 +4310,8 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s if (mLinkColor) link_style->setColor(*mLinkColor); appendAndHighlightText(link, part, link_style, true/*match.underlineOnHoverOnly()*/); }; - while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, - boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3))) + const auto&& cb = force_replace_links ? boost::bind(&LLTextEditor::replaceUrl, this, _1, _2, _3) : LLUrlLabelCallback::slot_function_type(); + while (!text.empty() && LLUrlRegistry::instance().findUrl(text, match, cb)) { start = match.getStart(); end = match.getEnd()+1; @@ -4332,7 +4333,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s auto url = match.getUrl(); const auto& label = match.getLabel(); - if (replace_links || url == label) + if (force_replace_links || replace_links || url == label) { // add icon before url if need /* Singu TODO: Icons next to links? @@ -4371,7 +4372,7 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s } }*/ } - else if (!replace_links) // Still link the link itself + else // Still link the link itself { const auto pos = text.find(url); bool fallback(pos == std::string::npos); // In special cases like no protocol and brackets @@ -4454,9 +4455,6 @@ void LLTextEditor::replaceUrl(const std::string &url, const std::string &label, const std::string &icon) { - static LLUICachedControl replace_links("SinguReplaceLinks"); - if (!replace_links) return; - // get the full (wide) text for the editor so we can change it LLWString text = getWText(); LLWString wlabel = utf8str_to_wstring(label); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 9f55412be..4eba4842b 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -181,8 +181,8 @@ public: void insertText(const std::string &text, BOOL deleteSelection = TRUE); // appends text at end void appendText(const std::string &wtext, bool allow_undo, bool prepend_newline, - const LLStyleSP stylep = NULL); - void appendTextImpl(const std::string& new_text, const LLStyleSP style); + const LLStyleSP stylep = NULL, bool force_replace_links = true); + void appendTextImpl(const std::string& new_text, const LLStyleSP style, bool force_replace_links = true); void setLastSegmentToolTip(const std::string& tooltip); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index e544bed80..b0607210f 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -217,14 +217,14 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& line = line.substr(chat.mFromName.length()); LLStyleSP sourceStyle = LLStyleMap::instance().lookup(chat.mFromID, chat.mURL); sourceStyle->mItalic = is_irc; - edit->appendText(chat.mFromName, false, prepend_newline, sourceStyle); + edit->appendText(chat.mFromName, false, prepend_newline, sourceStyle, false); prepend_newline = false; } LLStyleSP style(new LLStyle); style->setColor(color); style->mItalic = is_irc; style->mBold = chat.mChatType == CHAT_TYPE_SHOUT; - edit->appendText(line, false, prepend_newline, style); + edit->appendText(line, false, prepend_newline, style, false); } void log_chat_text(const LLChat& chat) diff --git a/indra/newview/llgroupnotify.cpp b/indra/newview/llgroupnotify.cpp index 982dfcad4..4d70787a7 100644 --- a/indra/newview/llgroupnotify.cpp +++ b/indra/newview/llgroupnotify.cpp @@ -175,11 +175,12 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject, static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig")); static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif")); + static const LLStyleSP msgstyle(new LLStyle(true, LLColor4::grey4, LLStringUtil::null)); - text->appendText(subject + '\n',false,false,headerstyle); + text->appendText(subject + '\n',false,false,headerstyle,false); - text->appendText(time_buf,false,false,datestyle); - text->appendColoredText(std::string(" \n\n") + message,false,false,LLColor4::grey4); + text->appendText(time_buf,false,false,datestyle,false); + text->appendText(std::string(" \n\n") + message,false,false,msgstyle,false); LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f); text->setCursor(0,0); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 7a0b33ec7..2739d7c74 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -804,7 +804,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol // Convert the name to a hotlink and add to message. LLStyleSP source_style = LLStyleMap::instance().lookupAgent(source); source_style->mItalic = is_irc; - mHistoryEditor->appendText(show_name,false,prepend_newline,source_style); + mHistoryEditor->appendText(show_name,false,prepend_newline,source_style, false); } prepend_newline = false; } @@ -815,7 +815,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol style->setColor(incolor); style->mItalic = is_irc; style->mBold = from_user && gSavedSettings.getBOOL("SingularityBoldGroupModerator") && isModerator(source); - mHistoryEditor->appendText(utf8msg, false, prepend_newline, style); + mHistoryEditor->appendText(utf8msg, false, prepend_newline, style, false); } if (log_to_file diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp index 93e8b1663..174af5c7c 100644 --- a/indra/newview/llnotify.cpp +++ b/indra/newview/llnotify.cpp @@ -249,7 +249,7 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification) if (!mIsCaution) // We could do some extra color math here to determine if bg's too close to link color, but let's just cross with the link color instead text->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4))); text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard) - text->setText(message); // Now we can set the text, since colors have been set. + text->appendText(message,false,false,nullptr,!layout_script_dialog); // Now we can set the text, since colors have been set. addChild(text); } From 136cffbab9137761bd1ec5bf5d4a3b27e7b5807b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 9 Feb 2019 16:51:53 -0500 Subject: [PATCH 38/90] What a drag --- indra/newview/lltooldraganddrop.cpp | 1 + indra/newview/lltooldraganddrop.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index e26d65d93..07c3b12aa 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -524,6 +524,7 @@ void LLToolDragAndDrop::beginMultiDrag( void LLToolDragAndDrop::endDrag() { + mEndDragSignal(); LLSelectMgr::getInstance()->unhighlightAll(); setMouseCapture(FALSE); } diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 09de0e6dd..7835a32b8 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -50,6 +50,7 @@ class LLPickInfo; class LLToolDragAndDrop : public LLTool, public LLSingleton { public: + typedef boost::signals2::signal enddrag_signal_t; LLToolDragAndDrop(); // overridden from LLTool @@ -86,6 +87,8 @@ public: const LLUUID& getObjectID() const { return mObjectID; } EAcceptance getLastAccept() { return mLastAccept; } + boost::signals2::connection setEndDragCallback( const enddrag_signal_t::slot_type& cb ) { return mEndDragSignal.connect(cb); } + uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); } static S32 getOperationId() { return sOperationId; } @@ -136,6 +139,8 @@ protected: S32 mCurItemIndex; std::string mToolTipMsg; + enddrag_signal_t mEndDragSignal; + protected: // 3d drop functions. these call down into the static functions // named drop if drop is TRUE and permissions allow From 1df39f81eea8c3f4beed0cf8fa87fbdf83069680 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 9 Feb 2019 19:53:30 -0500 Subject: [PATCH 39/90] [Local Textures] These should persist through relogs, duh! --- indra/newview/floaterlocalassetbrowse.cpp | 80 ++++++++++++++++++----- indra/newview/floaterlocalassetbrowse.h | 16 ++++- indra/newview/llappviewer.cpp | 3 + indra/newview/llstartup.cpp | 3 + 4 files changed, 83 insertions(+), 19 deletions(-) diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp index 5e65e796b..f50b6afa2 100644 --- a/indra/newview/floaterlocalassetbrowse.cpp +++ b/indra/newview/floaterlocalassetbrowse.cpp @@ -64,6 +64,8 @@ this feature is still a work in progress. #include "llviewermenufile.h" #include "llfloaterimagepreview.h" #include "llfile.h" +#include "llsdparam.h" +#include "llsdserialize.h" /* including to force rebakes when needed */ #include "llvoavatarself.h" @@ -93,18 +95,27 @@ bool LocalAssetBrowser::mSculptUpdated; containing one loaded local texture. */ -LocalBitmap::LocalBitmap(std::string fullpath) +LocalBitmap::Params::Params(const std::string& path) +: fullpath("path", path) +, keep_updating("update", gSavedSettings.getBOOL("LocalBitmapUpdate")) +, type("type", TYPE_TEXTURE) +, id("id", LLUUID::generateNewID()) { +} + +LocalBitmap::LocalBitmap(const Params& p) +{ + llassert(!p.fullpath.empty()); valid = false; - if ( gDirUtilp->fileExists(fullpath) ) + if ( gDirUtilp->fileExists(p.fullpath) ) { /* taking care of basic properties */ - id.generate(); - filename = fullpath; - keep_updating = gSavedSettings.getBOOL("LocalBitmapUpdate"); + id = p.id; + filename = p.fullpath; + keep_updating = p.keep_updating; linkstatus = keep_updating ? LINK_ON : LINK_OFF; shortname = gDirUtilp->getBaseFileName(filename, true); - bitmap_type = TYPE_TEXTURE; + bitmap_type = p.type; sculpt_dirty = false; volume_dirty = false; @@ -142,6 +153,7 @@ LocalBitmap::LocalBitmap(std::string fullpath) /* filename is valid, bitmap is decoded and valid, i can haz liftoff! */ valid = true; + LocalAssetBrowser::add(*this); } } } @@ -428,6 +440,15 @@ void LocalBitmap::getDebugInfo() const << "==========================" << LL_ENDL; } +LLSD LocalBitmap::asLLSD() const +{ + return LLSD() + .with("path", filename) + .with("id", id) + .with("update", keep_updating) + .with("type", bitmap_type); +} + /*=======================================*/ /* LocalAssetBrowser: internal class */ /*=======================================*/ @@ -437,15 +458,47 @@ void LocalBitmap::getDebugInfo() const Sits in memory until the viewer is closed. */ +const std::string LocalAssetBrowser::getFileName() const +{ + return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "local_assets.xml"); +} + LocalAssetBrowser::LocalAssetBrowser() { + gLocalBrowser = this; mLayerUpdated = false; mSculptUpdated = false; + + // Load bitmaps + llifstream file(getFileName()); + if (!file) return; + LLSD saved_assets; + LLSDSerialize::fromXML(saved_assets, file); + file.close(); + for (auto it = saved_assets.beginArray(), end = saved_assets.endArray(); it < end; ++it) + { + const auto&& p = LLSDParamAdapter(*it); + LocalBitmap bm(p); // Creating one adds it to the list + } + + if (!loaded_bitmaps.empty()) PingTimer(); } LocalAssetBrowser::~LocalAssetBrowser() { - + // Save bitmaps + llofstream file(getFileName()); + if (!file) + { + LL_WARNS() << "Could not open file " << getFileName() << " for saving." << LL_ENDL; + return; + } + LLSD saved_assets(LLSD::emptyArray()); + for (const auto& bitmap : loaded_bitmaps) + saved_assets.append(bitmap.asLLSD()); + LLSDSerialize::toPrettyXML(saved_assets, file); + file.close(); + gLocalBrowser = nullptr; } void LocalAssetBrowser::AddBitmap() @@ -461,20 +514,13 @@ void LocalAssetBrowser::AddBitmap_continued(AIFilePicker* filepicker) return; bool change_happened = false; - std::vector const& filenames(filepicker->getFilenames()); - for(std::vector::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) - { - LocalBitmap unit(*filename); - if (unit.getIfValidBool()) - { - loaded_bitmaps.push_back(unit); + + for(const auto& filename : filepicker->getFilenames()) + if (LocalBitmap(filename).getIfValidBool()) change_happened = true; - } - } if (change_happened) onChangeHappened(); } - void LocalAssetBrowser::DelBitmap( std::vector delete_vector, S32 column ) { bool change_happened = false; diff --git a/indra/newview/floaterlocalassetbrowse.h b/indra/newview/floaterlocalassetbrowse.h index 593b21249..290fbe4e3 100644 --- a/indra/newview/floaterlocalassetbrowse.h +++ b/indra/newview/floaterlocalassetbrowse.h @@ -97,7 +97,15 @@ struct affected_object class LocalBitmap { public: - LocalBitmap(std::string filename); + struct Params : public LLInitParam::Block + { + Mandatory fullpath; + Optional keep_updating; + Optional type; + Optional id; + Params(const std::string& path = LLStringUtil::null); + }; + LocalBitmap(const Params& p); virtual ~LocalBitmap(); friend class LocalAssetBrowser; @@ -138,6 +146,8 @@ class LocalBitmap bool getIfValidBool() const; S32 getType() const; void getDebugInfo() const; + LLSD asLLSD() const; + private: /* [maintenence functions] */ void updateSelf(); @@ -174,9 +184,10 @@ class LocalBitmap class AIFilePicker; -class LocalAssetBrowser +class LocalAssetBrowser : public LLSingleton { public: + const std::string getFileName() const; LocalAssetBrowser(); virtual ~LocalAssetBrowser(); friend class FloaterLocalAssetBrowser; @@ -184,6 +195,7 @@ class LocalAssetBrowser static void UpdateTextureCtrlList(LLScrollListCtrl*); static void setLayerUpdated(bool toggle) { mLayerUpdated = toggle; } static void setSculptUpdated(bool toggle) { mSculptUpdated = toggle; } + static void add(const LocalBitmap& unit) { loaded_bitmaps.push_back(unit); } static void AddBitmap(); static void AddBitmap_continued(AIFilePicker* filepicker); static void DelBitmap( std::vector, S32 column = BITMAPLIST_COL_ID ); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9ae068e77..8cad9b148 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -165,6 +165,7 @@ // in save_settings_to_globals() #include "llbutton.h" #include "llcombobox.h" +#include "floaterlocalassetbrowse.h" #include "llstatusbar.h" #include "llsurface.h" #include "llvosky.h" @@ -1723,6 +1724,8 @@ bool LLAppViewer::cleanup() LLFloaterTeleportHistory::saveFile("teleport_history.xml"); + LocalAssetBrowser::deleteSingleton(); // + // save mute list. gMuteList used to also be deleted here too. LLMuteList::getInstance()->cache(gAgent.getID()); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 56e690bf7..b48c7a356 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -217,6 +217,7 @@ #include "generichandlers.h" // +#include "floaterlocalassetbrowse.h" #include "llpanellogin.h" //#include "llfloateravatars.h" //#include "llactivation.h" @@ -890,6 +891,8 @@ bool idle_startup() LLToolMgr::getInstance()->initTools(); display_startup(); + // Load local textures now, maybe someone wants to use them in UI (why?) + LocalAssetBrowser::instance(); // // Quickly get something onscreen to look at. gViewerWindow->initWorldUI(); display_startup(); From 2e8e641024b0aaa2315c478e2d57a84f55bd47a2 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 9 Feb 2019 21:18:58 -0500 Subject: [PATCH 40/90] Don't LogInventoryDecline from groups, stop spamming local chat --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index e331f16a8..d7f9369cd 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1666,7 +1666,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // send the message msg->sendReliable(mHost); - if (gSavedSettings.getBOOL("LogInventoryDecline")) + if (!mFromGroup && gSavedSettings.getBOOL("LogInventoryDecline")) { // [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1e) | Added: RLVa-1.2.1e if ( (rlv_handler_t::isEnabled()) && From 97a6f8aeb0225b04c4913106d0b6758c664ea072 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 9 Feb 2019 21:46:21 -0500 Subject: [PATCH 41/90] [Favorites Bar] Compiles, but does it work yet? Gimme time to put it somewhere and we'll find out~ Also here's navbar/ textures, because we'll need the favorites one. --- indra/newview/llfavoritesbar.cpp | 164 ++++++++---------- indra/newview/llfavoritesbar.h | 10 +- .../textures/navbar/Arrow_Left_Off.png | Bin 0 -> 382 bytes .../textures/navbar/Arrow_Right_Off.png | Bin 0 -> 380 bytes .../default/textures/navbar/BuyArrow_Over.png | Bin 0 -> 294 bytes .../textures/navbar/BuyArrow_Press.png | Bin 0 -> 294 bytes .../textures/navbar/Favorite_Link_Over.png | Bin 0 -> 191 bytes .../textures/navbar/Favorite_Star_Active.png | Bin 0 -> 704 bytes .../textures/navbar/Favorite_Star_Off.png | Bin 0 -> 444 bytes .../textures/navbar/Favorite_Star_Over.png | Bin 0 -> 445 bytes .../textures/navbar/Favorite_Star_Press.png | Bin 0 -> 616 bytes .../textures/navbar/FileMenu_Divider.png | Bin 0 -> 116 bytes .../skins/default/textures/navbar/Flag.png | Bin 0 -> 338 bytes .../default/textures/navbar/Help_Press.png | Bin 0 -> 384 bytes .../default/textures/navbar/Home_Off.png | Bin 0 -> 379 bytes .../textures/navbar/Icon_Lightshare.png | Bin 0 -> 775 bytes .../default/textures/navbar/Info_Off.png | Bin 0 -> 608 bytes .../default/textures/navbar/Info_Over.png | Bin 0 -> 622 bytes .../default/textures/navbar/Info_Press.png | Bin 0 -> 605 bytes .../skins/default/textures/navbar/Lock.png | Bin 0 -> 302 bytes .../default/textures/navbar/NavBar_BG.png | Bin 0 -> 195 bytes .../textures/navbar/NavBar_BG_NoFav_Bevel.png | Bin 0 -> 231 bytes .../textures/navbar/NavBar_BG_NoNav_Bevel.png | Bin 0 -> 218 bytes .../default/textures/navbar/Row_Selection.png | Bin 0 -> 231 bytes .../skins/default/textures/navbar/Search.png | Bin 0 -> 516 bytes .../default/textures/navbar/separator.png | Bin 0 -> 330 bytes .../skins/default/textures/textures.xml | 7 + 27 files changed, 81 insertions(+), 100 deletions(-) create mode 100644 indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png create mode 100644 indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png create mode 100644 indra/newview/skins/default/textures/navbar/BuyArrow_Over.png create mode 100644 indra/newview/skins/default/textures/navbar/BuyArrow_Press.png create mode 100644 indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png create mode 100644 indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png create mode 100644 indra/newview/skins/default/textures/navbar/Favorite_Star_Off.png create mode 100644 indra/newview/skins/default/textures/navbar/Favorite_Star_Over.png create mode 100644 indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png create mode 100644 indra/newview/skins/default/textures/navbar/FileMenu_Divider.png create mode 100644 indra/newview/skins/default/textures/navbar/Flag.png create mode 100644 indra/newview/skins/default/textures/navbar/Help_Press.png create mode 100644 indra/newview/skins/default/textures/navbar/Home_Off.png create mode 100644 indra/newview/skins/default/textures/navbar/Icon_Lightshare.png create mode 100644 indra/newview/skins/default/textures/navbar/Info_Off.png create mode 100644 indra/newview/skins/default/textures/navbar/Info_Over.png create mode 100644 indra/newview/skins/default/textures/navbar/Info_Press.png create mode 100644 indra/newview/skins/default/textures/navbar/Lock.png create mode 100644 indra/newview/skins/default/textures/navbar/NavBar_BG.png create mode 100644 indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png create mode 100644 indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png create mode 100644 indra/newview/skins/default/textures/navbar/Row_Selection.png create mode 100644 indra/newview/skins/default/textures/navbar/Search.png create mode 100644 indra/newview/skins/default/textures/navbar/separator.png diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 969dff5a8..64f8924d1 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -29,28 +29,26 @@ #include "llviewerprecompiledheaders.h" #include "llfavoritesbar.h" -#if 0 //#include "llfloaterreg.h" #include "llfocusmgr.h" #include "llinventory.h" #include "lllandmarkactions.h" -#include "lltoolbarview.h" +//#include "lltoolbarview.h" #include "lltrans.h" #include "llmenugl.h" -#include "lltooltip.h" -#endif +//#include "lltooltip.h" +#include "lluictrlfactory.h" #include "llagent.h" #include "llavatarnamecache.h" #include "llclipboard.h" #include "llinventorybridge.h" +#include "llinventoryclipboard.h" #include "llinventoryfunctions.h" //#include "llfloatersidepanelcontainer.h" #include "llfloaterworldmap.h" #include "lllandmarkactions.h" -#if 0 -#include "lllogininstance.h" -#endif +//#include "lllogininstance.h" #include "llnotificationsutil.h" //#include "lltoggleablemenu.h" #include "llviewerinventory.h" @@ -59,7 +57,8 @@ #include "lltooldraganddrop.h" #include "llsdserialize.h" -#if 0 +void open_landmark(LLViewerInventoryItem* inv_item, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus); + static LLRegisterWidget r("favorites_bar"); const S32 DROP_DOWN_MENU_WIDTH = 250; @@ -165,7 +164,7 @@ class LLFavoriteLandmarkButton : public LLButton { public: - BOOL handleToolTip(S32 x, S32 y, MASK mask) override + BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) override { std::string region_name = mLandmarkInfoGetter.getName(); @@ -174,12 +173,8 @@ public: std::string extra_message = llformat("%s (%d, %d, %d)", region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY(), mLandmarkInfoGetter.getPosZ()); - LLToolTip::Params params; - params.message = llformat("%s\n%s", getLabelSelected().c_str(), extra_message.c_str()); - params.max_width = 1000; - params.sticky_rect = calcScreenRect(); - - LLToolTipMgr::instance().show(params); + msg = llformat("%s\n%s", getLabelSelected().c_str(), extra_message.c_str()); + *sticky_rect = calcScreenRect(); } return TRUE; } @@ -211,7 +206,7 @@ public: } } -protected: +//protected: LLFavoriteLandmarkButton(const LLButton::Params& p) : LLButton(p) {} friend class LLUICtrlFactory; @@ -229,15 +224,13 @@ private: class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL { public: - BOOL handleToolTip(S32 x, S32 y, MASK mask) override + BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect) override { std::string region_name = mLandmarkInfoGetter.getName(); if (!region_name.empty()) { - LLToolTip::Params params; - params.message = llformat("%s\n%s (%d, %d)", getLabel().c_str(), region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY()); - params.sticky_rect = calcScreenRect(); - LLToolTipMgr::instance().show(params); + msg = llformat("%s\n%s (%d, %d)", getLabel().c_str(), region_name.c_str(), mLandmarkInfoGetter.getPosX(), mLandmarkInfoGetter.getPosY()); + *sticky_rect = calcScreenRect(); } return TRUE; } @@ -270,9 +263,9 @@ public: void initFavoritesBarPointer(LLFavoritesBarCtrl* fb) { this->fb = fb; } -protected: +//protected: - LLFavoriteLandmarkMenuItem(const LLMenuItemCallGL::Params& p) : LLMenuItemCallGL(p), fb(nullptr) {} + LLFavoriteLandmarkMenuItem(const LLMenuItemCallGL::Params& p) : LLMenuItemCallGL(p.name(), p.label(), nullptr), fb(nullptr) {} friend class LLUICtrlFactory; private: @@ -287,7 +280,7 @@ private: * because otherwise LLToolDragAndDrop will initiate drag and drop operation * with the world. */ -class LLFavoriteLandmarkToggleableMenu : public LLToggleableMenu +class LLFavoriteLandmarkToggleableMenu : public LLMenuGL { public: BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, @@ -300,9 +293,9 @@ public: return TRUE; } -protected: - LLFavoriteLandmarkToggleableMenu(const LLToggleableMenu::Params& p): - LLToggleableMenu(p) +//protected: + LLFavoriteLandmarkToggleableMenu(): + LLMenuGL("favorites menu") { } @@ -341,7 +334,6 @@ public: private: S32 mSortField; }; -#endif // updateButtons's helper struct LLFavoritesSort @@ -371,7 +363,6 @@ struct LLFavoritesSort } }; -#if 0 LLFavoritesBarCtrl::Params::Params() : image_drag_indication("image_drag_indication"), more_button("more_button"), @@ -403,15 +394,16 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) gInventory.addObserver(this); //make chevron button - LLTextBox::Params more_button_params(p.more_button); - mMoreTextBox = LLUICtrlFactory::create (more_button_params); + mMoreTextBox = new LLTextBox(">>", "\u0032", 50); + mMoreTextBox->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + mMoreTextBox->setToolTip(LLStringExplicit("Show more of My Favorites")); + mMoreTextBox->setTabStop(false); mMoreTextBox->setClickedCallback(boost::bind(&LLFavoritesBarCtrl::showDropDownMenu, this)); addChild(mMoreTextBox); mDropDownItemsCount = 0; - LLTextBox::Params label_param(p.label); - mBarLabel = LLUICtrlFactory::create (label_param); + mBarLabel = new LLTextBox(p.label.name, p.label.label); addChild(mBarLabel); } @@ -544,7 +536,7 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) LLFavoritesOrderStorage::instance().saveItemsOrder(mItems); - LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); + LLMenuGL* menu = (LLMenuGL*) mOverflowMenuHandle.get(); if (menu && menu->getVisible()) { @@ -712,12 +704,11 @@ const LLButton::Params& LLFavoritesBarCtrl::getButtonParams() if (!params_initialized) { - LLXMLNodePtr button_xml_node; - if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node)) - { - LLXUIParser parser; - parser.readXUI(button_xml_node, button_params, "favorites_bar_button.xml"); - } + button_params.image_overlay(LLUI::getUIImage("Favorite_Link_Over")) + .hover_glow_amount(0.15f) + .use_ellipses(true).tab_stop(false) + .name("favorites_bar_btn") + .follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM); params_initialized = true; } @@ -840,7 +831,7 @@ void LLFavoritesBarCtrl::updateButtons() mMoreTextBox->setVisible(TRUE); } // Update overflow menu - LLToggleableMenu* overflow_menu = static_cast (mOverflowMenuHandle.get()); + LLMenuGL* overflow_menu = static_cast (mOverflowMenuHandle.get()); if (overflow_menu && overflow_menu->getVisible() && (overflow_menu->getItemCount() != mDropDownItemsCount)) { overflow_menu->setVisible(FALSE); @@ -879,7 +870,7 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer(fav_btn_params); + fav_btn = new LLFavoriteLandmarkButton(fav_btn_params); if (NULL == fav_btn) { LL_WARNS("FavoritesBar") << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << LL_ENDL; @@ -910,19 +901,18 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointercreateFromFile("menu_favorites.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_favorites.xml", gMenuHolder); if (!menu) { - menu = LLUICtrlFactory::getDefaultWidget("inventory_menu"); + return FALSE; //menu = LLUICtrlFactory::getDefaultWidget("inventory_menu"); } - menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); + menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); mContextMenuHandle = menu->getHandle(); return TRUE; } -#endif -BOOL /*LLFavoritesBarCtrl::*/collectFavoriteItems() +BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& items) { auto mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); @@ -931,16 +921,13 @@ BOOL /*LLFavoritesBarCtrl::*/collectFavoriteItems() LLInventoryModel::cat_array_t cats; - LLInventoryModel::item_array_t items; LLIsType is_type(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type); std::sort(items.begin(), items.end(), LLFavoritesSort()); -#if 0 - //if (needToSaveItemsOrder(items)) -#endif + if (needToSaveItemsOrder(items)) { S32 sortField = 0; for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i) @@ -952,7 +939,6 @@ BOOL /*LLFavoritesBarCtrl::*/collectFavoriteItems() return TRUE; } -#if 0 void LLFavoritesBarCtrl::showDropDownMenu() { if (mOverflowMenuHandle.isDead()) @@ -960,9 +946,10 @@ void LLFavoritesBarCtrl::showDropDownMenu() createOverflowMenu(); } - LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); - if (menu && menu->toggleVisibility()) + LLMenuGL* menu = (LLMenuGL*)mOverflowMenuHandle.get(); + if (menu) { + if (mUpdateDropDownItems) { updateMenuItems(menu); @@ -970,7 +957,7 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); - menu->setButtonRect(mMoreTextBox->getRect(), this); + //menu->setButtonRect(mMoreTextBox->getRect(), this); positionAndShowMenu(menu); mDropDownItemsCount = menu->getItemCount(); } @@ -978,19 +965,16 @@ void LLFavoritesBarCtrl::showDropDownMenu() void LLFavoritesBarCtrl::createOverflowMenu() { - LLToggleableMenu::Params menu_p; - menu_p.name("favorites menu"); - menu_p.can_tear_off(false); - menu_p.visible(false); - menu_p.scrollable(true); - menu_p.max_scrollable_items = 10; - menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; - - LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); + LLMenuGL* menu = new LLFavoriteLandmarkToggleableMenu(); + menu->setCanTearOff(false); + menu->setVisible(false); + menu->setScrollable(true); + //menu_p.max_scrollable_items = 10; + //menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; mOverflowMenuHandle = menu->getHandle(); } -void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) +void LLFavoritesBarCtrl::updateMenuItems(LLMenuGL* menu) { menu->empty(); @@ -1004,9 +988,9 @@ void LLFavoritesBarCtrl::updateMenuItems(LLToggleableMenu* menu) LLFavoriteLandmarkMenuItem::Params item_params; item_params.name(item_name); item_params.label(item_name); - item_params.on_click.function(boost::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); - LLFavoriteLandmarkMenuItem *menu_item = LLUICtrlFactory::create(item_params); + LLFavoriteLandmarkMenuItem *menu_item = new LLFavoriteLandmarkMenuItem(item_params); + menu_item->setMouseUpCallback(std::bind(&LLFavoritesBarCtrl::onButtonClick, this, item->getUUID())); menu_item->initFavoritesBarPointer(this); menu_item->setRightMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonRightClick, this, item->getUUID(), _1, _2, _3, _4)); menu_item->LLUICtrl::setMouseDownCallback(boost::bind(&LLFavoritesBarCtrl::onButtonMouseDown, this, item->getUUID(), _1, _2, _3, _4)); @@ -1049,40 +1033,32 @@ void LLFavoritesBarCtrl::fitLabelWidth(LLMenuItemCallGL* menu_item) } } -void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLToggleableMenu* menu) +void LLFavoritesBarCtrl::addOpenLandmarksMenuItem(LLMenuGL* menu) { std::string label_untrans = "Open landmarks"; std::string label_transl; bool translated = LLTrans::findString(label_transl, label_untrans); - LLMenuItemCallGL::Params item_params; - item_params.name("open_my_landmarks"); - item_params.label(translated ? label_transl: label_untrans); - LLSD key; - key["type"] = "open_landmark_tab"; - item_params.on_click.function(boost::bind(&LLFloaterSidePanelContainer::showPanel, "places", key)); - LLMenuItemCallGL* menu_item = LLUICtrlFactory::create(item_params); + LLMenuItemCallGL* menu_item = new LLMenuItemCallGL(std::string("open_my_landmarks"), std::string(translated ? label_transl : label_untrans), nullptr); + void show_floater(const std::string& floater_name); + menu_item->setMouseUpCallback(std::bind(show_floater, "floater_inventory_favs.xml")); fitLabelWidth(menu_item); - LLMenuItemSeparatorGL::Params sep_params; - sep_params.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor"); - sep_params.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor"); - sep_params.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor"); - sep_params.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor"); - LLMenuItemSeparatorGL* separator = LLUICtrlFactory::create(sep_params); + LLMenuItemSeparatorGL* separator = new LLMenuItemSeparatorGL; menu->addChild(separator); menu->addChild(menu_item); } -void LLFavoritesBarCtrl::positionAndShowMenu(LLToggleableMenu* menu) +void LLFavoritesBarCtrl::positionAndShowMenu(LLMenuGL* menu) { U32 max_width = llmin(DROP_DOWN_MENU_WIDTH, getRect().getWidth()); S32 menu_x = getRect().getWidth() - max_width; S32 menu_y = getParent()->getRect().mBottom - DROP_DOWN_MENU_TOP_PAD; + /* Singu TODO: Side Toolbar? // the menu should be offset of the right edge of the window // so it's no covered by buttons in the right-side toolbar. LLToolBar* right_toolbar = gToolBarView->getChild("toolbar_right"); @@ -1107,6 +1083,7 @@ void LLFavoritesBarCtrl::positionAndShowMenu(LLToggleableMenu* menu) menu_x -= right_toolbar->getRect().getWidth(); } } + */ LLMenuGL::showPopup(this, menu, menu_x, menu_y); } @@ -1146,17 +1123,17 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S BOOL LLFavoritesBarCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = childrenHandleRightMouseDown( x, y, mask) != NULL; - if(!handled && !gMenuHolder->hasVisibleMenu()) + /*if(!handled && !gMenuHolder->hasVisibleMenu()) { show_navbar_context_menu(this,x,y); handled = true; - } + }*/ return handled; } void copy_slurl_to_clipboard_cb(std::string& slurl) { - LLClipboard::instance().copyToClipboard(utf8str_to_wstring(slurl),0,slurl.size()); + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl)); LLSD args; args["SLURL"] = slurl; @@ -1195,7 +1172,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) key["type"] = "landmark"; key["id"] = mSelectedItemID; - LLFloaterSidePanelContainer::showPanel("places", key); + open_landmark(item, "Favorite", false, mSelectedItemID, true); } else if (action == "copy_slurl") { @@ -1209,7 +1186,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } else if (action == "show_on_map") { - LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + LLFloaterWorldMap* worldmap_instance = gFloaterWorldMap; LLVector3d posGlobal; LLLandmarkActions::getLandmarkGlobalPos(mSelectedItemID, posGlobal); @@ -1217,7 +1194,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) if (!posGlobal.isExactlyZero() && worldmap_instance) { worldmap_instance->trackLocation(posGlobal); - LLFloaterReg::showInstance("world_map", "center"); + LLFloaterWorldMap::show(true); } } else if (action == "cut") @@ -1225,7 +1202,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) } else if (action == "copy") { - LLClipboard::instance().copyToClipboard(mSelectedItemID, LLAssetType::AT_LANDMARK); + LLInventoryClipboard::instance().add(mSelectedItemID); } else if (action == "paste") { @@ -1238,7 +1215,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. - LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); + LLMenuGL* menu = (LLMenuGL*) mOverflowMenuHandle.get(); if (mRestoreOverflowMenu && menu && !menu->getVisible()) { menu->resetScrollPositionOnShow(false); @@ -1249,13 +1226,13 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) BOOL LLFavoritesBarCtrl::isClipboardPasteable() const { - if (!LLClipboard::instance().hasContents()) + if (!LLInventoryClipboard::instance().hasContents()) { return FALSE; } std::vector objects; - LLClipboard::instance().pasteFromClipboard(objects); + LLInventoryClipboard::instance().retrieve(objects); S32 count = objects.size(); for(S32 i = 0; i < count; i++) { @@ -1284,7 +1261,7 @@ void LLFavoritesBarCtrl::pasteFromClipboard() const { LLInventoryItem* item = NULL; std::vector objects; - LLClipboard::instance().pasteFromClipboard(objects); + LLInventoryClipboard::instance().retrieve(objects); S32 count = objects.size(); LLUUID parent_id(mFavoriteFolderId); for(S32 i = 0; i < count; i++) @@ -1427,7 +1404,6 @@ void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const items.push_back(insertedItem); } } -#endif const std::string LLFavoritesOrderStorage::SORTING_DATA_FILE_NAME = "landmarks_sorting.xml"; const S32 LLFavoritesOrderStorage::NO_INDEX = -1; diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index ad3c8e95c..ef6f55c5e 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -35,10 +35,9 @@ #include "llinventorymodel.h" #include "llviewerinventory.h" #include "llui.h" //"llinitdestroyclass.h" -#if 0 class LLMenuItemCallGL; -class LLToggleableMenu; +class LLMenuGL; class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver { @@ -141,14 +140,14 @@ private: void createOverflowMenu(); - void updateMenuItems(LLToggleableMenu* menu); + void updateMenuItems(LLMenuGL* menu); // Fits menu item label width with favorites menu width void fitLabelWidth(LLMenuItemCallGL* menu_item); - void addOpenLandmarksMenuItem(LLToggleableMenu* menu); + void addOpenLandmarksMenuItem(LLMenuGL* menu); - void positionAndShowMenu(LLToggleableMenu* menu); + void positionAndShowMenu(LLMenuGL* menu); BOOL mShowDragMarker; LLUICtrl* mLandingTab; @@ -164,7 +163,6 @@ private: boost::signals2::connection mEndDragConnection; }; -#endif /** * Class to store sorting order of favorites landmarks in a local file. EXT-3985. diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png b/indra/newview/skins/default/textures/navbar/Arrow_Left_Off.png new file mode 100644 index 0000000000000000000000000000000000000000..19569501fed8e12b9887a72978d98e5d7729e66f GIT binary patch literal 382 zcmV-^0fGLBP)>Yo z>%n7y=gO5Um%udt{{4GBkk%u{08qI2p=n+Vq*c*fjLiT(K|#Uj&6_tbhiU%v=g$ft zt%c3Y7zS8dTZbJva%2rm^N$}tCIe|nTw#V`05Fg$k!;>;Vq%g6)Wc7-0U&<@H7*1h z@bBNh{f7=6T5V)xR0z~3K$HPc1%iM7{%wW1T~8#0m`gc4R{w z92^>eQffq}10bIZh~Z)K_U+r9b#--xq$DJmK{+r(zJLE-OR@n_LqIM8MJYeJ0gRMp cXMg|$02GbV0X^cc@c;k-07*qoM6N<$g8Z|b7XSbN literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png b/indra/newview/skins/default/textures/navbar/Arrow_Right_Off.png new file mode 100644 index 0000000000000000000000000000000000000000..3648c42656132bd26ece55cbaa8c7dc1ff11336e GIT binary patch literal 380 zcmV-?0fYXDP)vq{LC^^x(~$Agr%&5~^nMUtv0}v%pprl! zX2+!m!vG+*`19w_I+!6qm#mPMmX1UAE?xtm3KV|*`ZX73$kC%m*YNT2MFXXHh%x}G zNCMfABS(&`QBzYZ1WHK~WdPI=v2WkLfx=`T$dCsQ9&AlYN=hKw03Z-FFfhpa{rmSm zm`gr=`cy)!0Wu~gCRG7_S?5_cjD4a(16dMKi45?P9v0hv86;YAnpX>IAW4NBc<6H aAiw}&IL}9QF_Y#10000Dj literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png new file mode 100644 index 0000000000000000000000000000000000000000..0b3f252ccf61f02f9f42bb639233f4e2da074a21 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`JjK-FhRhmeNVVs!uQ)BpXKOJ3v!*yy6Fa!=ASru dna=tCkJ;jtbk-ElZUXsPVJ83p literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png new file mode 100644 index 0000000000000000000000000000000000000000..5c4c150bed9a2c4d04e552f18d7dfd6070b5c9d7 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`JjbP0l+XkKsrO|# literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png b/indra/newview/skins/default/textures/navbar/Favorite_Link_Over.png new file mode 100644 index 0000000000000000000000000000000000000000..d4f126f9692110c2f8ecb9f6c80e85c05d947e65 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^6+q0-!3HGtow-*7DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9MTwp+jv*Dd-dx_udBA|jCD4^+y5^q$dQm5rm{>g7a_pmh z%$?U0SFdt&v5DIMID)QPUsn;x1-t;7nke!Jr1BBod04?B*QY mcKLw!?;WkNxx4BZ*%;!zxiST&3(o{v#^CAd=d#Wzp$PyfZbe=I literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Active.png new file mode 100644 index 0000000000000000000000000000000000000000..e27dbe2cadc5f32d71829fa49a2d9fe3addda558 GIT binary patch literal 704 zcmV;x0zdtUP)qKphj$a;kg^12MDR0!Gt^dmi5r;(>p0Ah6XwlZYW;A^F z2BongULr|3VJ%W=1f}F;97J~pM~;8yu>ZW_yb0M?k%-~AQFfU)1PkM!?t1P zPLJi?{h5;;U1@0gRR}jKZ<9f2o1>q17GKMgY zKq>_x*ARFVY7m28_I;sMULrm$&OG}3+Z^?d9ZPD7*D#h-8Zp~B)W?C4ZQr1w_T`%- zloqJN=Lo0s>x&=6UvtzV0iF=fW{v-v2^vu0)?;hS+rHIVecRu^v9wY~jVoGXfKnO* z1xiFMv~`O&eXHAbjs`|^ZiahD3Bo}zfk(9_G>WB?MO$0m_O0$uBfh<8Dv^LtP0&n7 zceA+R6Gq*_w%-(_tJl2HV zCxl!Po0T~ecE8J6#>lHX8l`iGT@lMZ^J1Pje9BNu{=34jEb5tDcERwgfclcv8GWg` myt;KNvRC&Jg*{q71Q-CgcuJkPE4*d^0000M2C(UToWkhA0UE@{U6Ni(9O+)MMseiMZvWwxYR{Z5Ybi}zmZ>{hVxt+ z`0(hvm)GmNqfQh>nNd8B@B6m(8LZ$E&!&Pf41c2g&llwpC|Vy|qbyeOsF<}i8n>)1 zU=tgd!#VD4J8~4qQi__-ykgN%;|4+CB#q)@8{jL&!w#MlJwwfaVMj@$c#sv`pr^)> zPN}Y)*Y!DB>#4rNj`B&PF4{QLV9S_9H8qB+@@3V<^=)?49Uk@r_Hl&+EMpoULyacz zqA%UWDf*`4@9Si0xJ4BJNkafEF&@re_x;~3Yfd;4og@pfm?z?z!Gvv}7XYAWAQ m-LIeLjOzc$&5Y>z7GMBhYGGMN>e*ia0000x<4(xcnmOJ?H z$N&4^-{=25bb=sACGj|^gH_x580K(=XH!A2eex6Cf4(S#4Mpo?Yvf@bkBXkH(V%5* z3d>l+1TJuI+mWL<5R=nm6ibGh9>WfzM&TffxItHq z1D#S;JFn_CjB;!YW#tR13+tQgsM9~}2khb+dzi&2KKdFB z;YDA%g){i3oIzVBb*b1^K5M$1 zuHk})FYTa#73?cElrNbsay&7DX&hl4b$sF!i#SG0b#H&|DBSKiYFJQ{a2D^nLv`hA ns{8fxoTUDb+*Cr(w*UhGBDP^!bgFFl00000NkvXXu0mjfL)^s( literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png b/indra/newview/skins/default/textures/navbar/Favorite_Star_Press.png new file mode 100644 index 0000000000000000000000000000000000000000..6670667022ad09a9b0f188733d5c633a358610e0 GIT binary patch literal 616 zcmV-u0+;=XP)AJ2q8V!S%{!EQBnT!mu-0%0L z@dSpjk82$U0s*B~tLYw(=aVE!N8=cW!(sY-J|mGx7*oZLL?Rb%w|f%=0)(R7Zs!Yy z!qzmgrDQVs7GK&%M<3C}OPkF$x~`%q0z?#CAVwmAD_TP^P@|!vG-`gPQmL}d>-FCF z{r>h~FnHbT^;S^)0&7%E62t|bfWQ+F5S~|Nhj$=4!#+-@)4w0YE*6WI0PZ=R&d<=R zs%hE~9SUxeS!c$XCysd5{WrBzsnmh_hIYT=OV{Xb)QPp}GtNA5_xQ=BzI-sN&F)a&&-5adyK zL`$D>=81diWiR3?ubRzfA6guMWEY}-!8uN!apsA8Ok}qXp-@PHpsOf61;GypdtR+p zEiIbCVDJRfx`JNshyz}$R4V$zPh@WYNAn{3C%^y_NKgs7SxdwK0000|6H_V+Po~-c6^VJeIEGZ*O8WEv|9+9f8WOC{0t_q?3_{t=k_RL@X9HC* Nc)I$ztaD0e0sxH?APoQj literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Flag.png b/indra/newview/skins/default/textures/navbar/Flag.png new file mode 100644 index 0000000000000000000000000000000000000000..df53c8922480451b49e14f87dfd7d42aa7d502b2 GIT binary patch literal 338 zcmV-Y0j>UtP)1C;;^GN-7h zsE(15F%pPR1G%q(_$E~94iJ9|# z;@`i2%s`qL-+aVr(4Rklzy|&N`IE9R0(lK&(D(1(iP0;B%wa^2{)B{tzi;2ZB_=js zY~H+C5@+=Pf&d1P_Xyy>ZfgHSx=I+xRe=htLz4n17A}C2!v6jH zZ{iFiXn=!~fG|+uJ|Ml1tiXoF9FUTrDAp)3hzXn5fLNMhgFvYph$;6PFxIFOMnHou k1F2k64PvBL!3Gdu08o&WCTrZK6#xJL07*qoM6N<$f@IT*PXGV_ literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Help_Press.png b/indra/newview/skins/default/textures/navbar/Help_Press.png new file mode 100644 index 0000000000000000000000000000000000000000..ed3695f9d5c69844b0b125ae77fa1cb30352dbd3 GIT binary patch literal 384 zcmV-`0e}99P)h2R1Bg!m@dI=VnXnk@P*70dasU2(0gz%4UcY|5hJ%Ac0#Hr?T`?oFi9i={G&D3+ z)YsR;gdRX$0d`49NXVl#Yu3y|F#%=^2)nqr$N}jFD7Jv9dGh2*El6zNzI|oL>OmOA z3%hsk{sp!50njxkVBzul^=oDjLseDv8-|CGO~V2_fZ@@A0fhdEP)sDJ~VPST3%^)Bl zArTFv*kF8Q16Xx*bP^XVSl}ooCdQ7-$v|)Uii(QH0GS*pUJwxxNjQ4+Xpp+PIxnG^ zJ9qBfdw+lb9giPBo&`7H*|TS}rKF@(2xx+Dqi1)%2LK2-w+Wkgw-stRl9P&X+BN;E3zXY70%QoA}$9t z;cXwb6gZ)2DwdaJq@wGtx_!2j{R6k$7kVx>{?~=ADQo%Kx(2J&1>bca{QgpSJevs3 zVJIvhQ0dKW;>hrQ!RahG+SlKAz|6qwl3Ya@scc4dB#P{L4LnIm@ zzeiHKX=X6LlwJb0KP9EY$wbm;wMrWRPN^G^WjPFm0<*#C40Q~cHUUNvVF%{i zKi;B(A9Oeze%(06_}v-fucuz=8++)Q8NV4ppR3T%{|2hbK|BJTgl_-<002ovPDHLk FV1ndQXK(-j literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Info_Off.png b/indra/newview/skins/default/textures/navbar/Info_Off.png new file mode 100644 index 0000000000000000000000000000000000000000..64722255a33f4cb596a2b9d623ad923a7c63069e GIT binary patch literal 608 zcmV-m0-ybfP)HDJ_yzu`^AIXyX;ZE5z!qyFLU`3E`@g$sb?}g9t)WcmcsJRC`r&uh?E87PSfIYyl?@XWpRDe5ouy?s!I_EHO2ILou#pZlI z7y4{}Qqwdd@9}u9{C@uh?z)Nq!A|nm)oOJzo6UsDKA%qv!w@7$r_&Mm1hE^_>GacN zGTB1>=U_1SLyyPfbbdjlk8r32RFG&iDuqHp5{ZN&7!HR51)}RZ3+|whUM`m_8mjFB z`O#>k{jMBZiWOVkmPhZoOSjNfk}b}DkmKk|3iR*KWO+=!1PQ4Zook}9DWJp+3mA| zMOpV8;vI0sox2B=&1Tgc2%cXL5CzNCYW2};Ka2~g*upxG?UyE{Qc2#i>%m~~4gY67 z5{Ymaf57^k&l8v1fS(gy0}J!IMDk^`+5E}(rn5gfF~HxoTCEZah1wwc3+EE|oA^)g ue?oyz9;iG|pBO$y;4X_6|7;z1Nai%1gj{Qt@K zJytP?Imp1b`}WPuH{Y8#>nIco^1zOP6W|Ci?L7;)1**W!Zm_Xhtv2f*a1Nvvi^TyT z%jHsRe^k@7sIKcNhr@C0a=9+C_gxV%&`!=H_~mRillgou2$FC(EJ%=cyRC>o=$%fd z7vu5xaJ^o?^7(vs8wKY~hEq^QJRXk(gF#6qlS*2#Sd><)C5B-rKMI_JlOP*G8_&ipU=y` z3?yC@d~SgCh|oeCh9aR+`aVM=pQu}4 z02_pjt+QUQZ`ZrZ9uNo>SU{8nY|cJ=M1e(uTikDy9cLf@hXBexX?Rr8&3h71>IQ*8 zU>nHwuFuABFc^H~9NggJnsczZYa)?Ih-Fy{T<`h_6ns-El|CExU|d4QA!gx}y`bfC zIeEn1^?JRxc;D-$X|fr=!1x7ZI@V7?=wyfYV2DCj-EQ})R;zV6Z+avWQBKVG&vLn3 z_51zbFc-h!Tw(tJm?G&b$Uk5@Uso!X_xQQ`OpeFn%Rd4P0PMPtP++*HGynhq07*qo IM6N<$g8Wq&zyJUM literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Info_Press.png b/indra/newview/skins/default/textures/navbar/Info_Press.png new file mode 100644 index 0000000000000000000000000000000000000000..169105829ecc1c148eb998663904c0c0eb25d026 GIT binary patch literal 605 zcmV-j0;2tiP)0Uq zi^XCts@3XI5-jtTA4O;E&TW%GgR-O1=zo4MU@y4?ApvLC@@f5k|M5R_o-&Tm0c@{) zZJOX%j0SZb65QfpYZV6x&l14@ojYit(>-N+=L?6!t^$JZBRiPR=ksqWolgHkQVaw( z6|gIj&*x<_nYc(K64LAS9%BS*D$Qo|hIhbEcn#+%#(0hMbmi6Sb$P}*M1Iz<&a00000NkvXXu0mjfCs+=s literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Lock.png b/indra/newview/skins/default/textures/navbar/Lock.png new file mode 100644 index 0000000000000000000000000000000000000000..cf569d6ad29c42622f8cd7f4ccbec90cc864b26f GIT binary patch literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1G7d%}YLn>}1{rUgjp4pT^SdkS7UOD9Wc*rX2i8Gr1W?bo` z@U4OCF3Y2r!fHMmY6za$_M6^ybf<16ejgCZ1nf{ z=RcFcCYEy3zW!g0g3-+z42B-M%3;lQ|Nr@xHMtnRxV}FAis6gr=jR{3s*oTdtDy8M w@d1NfGgF6;yMi-Q$Em*|`u!cO42*0HZ=C%92rs`L3iKO;r>mdKI;Vst0NkH$rvLx| literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG.png b/indra/newview/skins/default/textures/navbar/NavBar_BG.png new file mode 100644 index 0000000000000000000000000000000000000000..38eea783e6ab496ddf602d4bf61e186a4ab2a303 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^8bEBr!3HEncK&z(q$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c6{UK*IEGZ*dUO3CZ-W63^8qo%(%zI{Ge2{NV;qlke%ABX z+bBPh>n-ki#>j#J{^)1AG!M?p#%<_zE4402`6zAP~ RVGp#B!PC{xWt~$(69D6jI)?xN literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoFav_Bevel.png new file mode 100644 index 0000000000000000000000000000000000000000..a79d999932cef5ea2bed1fbe0f8162b192f2af5e GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^8bGYV!3HFM+f;}FDVB6cUq=Rpjs4tz5?O(Kwj^(N z7l!{JxM1({$v_d#0*}aI1_o|n5N2eUHAey{$X?><>&kwMor%|&o5yn9OrVftiEBiO zbAE1aYF-J0b5UwyNotBhd1gt5g1e`0KzJjcI8c$jr;B4q#NoH+7a*U1WjyK{7~n_#hm!Aa5<+|V?1TeZ?p4TXSOAS;@O1TaS?83{1OO{; BKFa_A literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png b/indra/newview/skins/default/textures/navbar/NavBar_BG_NoNav_Bevel.png new file mode 100644 index 0000000000000000000000000000000000000000..b692ed92daed6b149341e802ba126f41c6b29843 GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0vp^8bB}RK1;6V=_l?0g(OQ{BTAg}b8}PkN*J7rQWHy3QxwWG zOEMJPJ$(bh8~Mb6irhV2977@wzrAkA%V5BB6}tq)G-xCKe6>1&0O@KO)78&qol`;+ E0DB@lWdHyG literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/Row_Selection.png b/indra/newview/skins/default/textures/navbar/Row_Selection.png new file mode 100644 index 0000000000000000000000000000000000000000..fc4f0c07eff0fe695e5f582b974fbdc026ae78ca GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^%Yj&wgAGV3i~O4eq$EpRBT9nv(@M${i&7aJQ}UBi z6+Ckj(^G>|6H_V+Po~-c6?J;LIEGZ*dUI&2&=)#QCxwGB-+2t{uaE_U3Y z`gdYy{w|3RG8NGW3J%Y`{`;-PF^kl8M%$WA&(9Q}oc89en#so1dfKNhhm ziOrWj%ir9k`uE1fs7vN8t{t!bMkN=he|%6Dza%StuCbN;q;ostAK%{0&Y;{L{eFG+ zsw3PDZ*IRm|Jol1P(5k-AG50UufDL|?${AJd0LI9>5_<#HIG)l zWeno~jq6{zMdJg9Le7jYV!fNbZ23}Sn%m&qHo4)z6-l3( z!cz>d4@d{guwR*VmhHpICYfK}sxmsEKK!$nC}Q!>*kacgLbeWd`@ Oz~JfX=d#Wzp$P!`o5utI literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/navbar/separator.png b/indra/newview/skins/default/textures/navbar/separator.png new file mode 100644 index 0000000000000000000000000000000000000000..c1d74e5a64434c954bc7d71229cc9fe4a9d99aa2 GIT binary patch literal 330 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b}0V1z1-1-6}knZT~$iT3%ujY5)WFTK5*(1o8 zfuWtBfuRS8{{l5NIxsNQRx&WW>}FuFdCI^bd8XK=wH&CHDaqU2h2ejD|C#+j9%q3^ zWHAE+w-5+3UbB}`2%3Eh-;xFgRl*w z+baVnb)W*(64!{5l*E!$tK_0oAjM#0U}&OiV5Vze5@KLrWoT|?Y^)7r7#MtJ2%3YU zAvZrIGp!Q0hNjq83P24~ARB`7(@M${i&7Z^5;OBk^!!{y6v~YCO!W*6489aC1gc{2 MboFyt=akR{0CnwH`2YX_ literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index d7c0ff419..24bd07eb6 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -40,6 +40,13 @@ with the same filename but different name + + + + + + + From 48541479fb1972cbcd9c5e0ced253f573aa46d4d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 11 Feb 2019 21:49:01 -0500 Subject: [PATCH 42/90] Compiles and fixes, fixes and compiles Pull this commit, get through the trials --- indra/newview/llfavoritesbar.cpp | 7 +++++-- indra/newview/llfolderview.cpp | 4 ++-- indra/newview/llpanellogin.cpp | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 64f8924d1..2a78d1df7 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -912,7 +912,7 @@ BOOL LLFavoritesBarCtrl::postBuild() return TRUE; } -BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& items) +BOOL collectFavoriteItems(LLInventoryModel::item_array_t& items) { auto mFavoriteFolderId = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); @@ -927,6 +927,7 @@ BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& it std::sort(items.begin(), items.end(), LLFavoritesSort()); + BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items); if (needToSaveItemsOrder(items)) { S32 sortField = 0; @@ -938,6 +939,7 @@ BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& it return TRUE; } +BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t& items) { return ::collectFavoriteItems(items); } void LLFavoritesBarCtrl::showDropDownMenu() { @@ -1363,7 +1365,7 @@ LLUICtrl* LLFavoritesBarCtrl::findChildByLocalCoords(S32 x, S32 y) return ctrl; } -BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array_t& items) +BOOL needToSaveItemsOrder(const LLInventoryModel::item_array_t& items) { BOOL result = FALSE; @@ -1379,6 +1381,7 @@ BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array return result; } +BOOL LLFavoritesBarCtrl::needToSaveItemsOrder(const LLInventoryModel::item_array_t& items) { return ::needToSaveItemsOrder(items); } void LLFavoritesBarCtrl::insertItem(LLInventoryModel::item_array_t& items, const LLUUID& dest_item_id, LLViewerInventoryItem* insertedItem, bool insert_before) { diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 817d35a8a..020805e33 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2164,8 +2164,8 @@ void LLFolderView::doIdle() } LLFavoritesOrderStorage::instance(); // Singu TODO: Favorites bar. - BOOL collectFavoriteItems(); - collectFavoriteItems(); + BOOL collectFavoriteItems(LLInventoryModel::item_array_t&); + collectFavoriteItems(LLInventoryModel::item_array_t()); LL_RECORD_BLOCK_TIME(FTM_INVENTORY); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index cea6e239c..e4d9c4abe 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -373,8 +373,8 @@ void LLPanelLogin::addFavoritesToStartLocation() // Load favorites into the combo. const auto grid = gHippoGridManager->getCurrentGrid(); - std::string first, last; - getFields(first, last, std::string()); + std::string first, last, password; + getFields(first, last, password); auto user_defined_name(first + ' ' + last); std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + grid->getGridName() + ".xml"); std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml"); From 323c0a7e1e8f9b9a3a7a728c7f9d53b2b75ca36c Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 18:51:45 -0500 Subject: [PATCH 43/90] Fix compile --- indra/newview/floaterlocalassetbrowse.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/floaterlocalassetbrowse.cpp b/indra/newview/floaterlocalassetbrowse.cpp index f50b6afa2..0be9b0a6b 100644 --- a/indra/newview/floaterlocalassetbrowse.cpp +++ b/indra/newview/floaterlocalassetbrowse.cpp @@ -920,7 +920,7 @@ void FloaterLocalAssetBrowser::UpdateRightSide() if (const auto& selected = mBitmapList->getFirstSelected()) { - LocalBitmap* unit = gLocalBrowser->GetBitmapUnit(LLUUID(selected->getColumn(BITMAPLIST_COL_ID)->getValue())); + LocalBitmap* unit = gLocalBrowser->GetBitmapUnit(LLUUID(selected->getColumn(BITMAPLIST_COL_ID)->getValue().asString())); if ( unit ) { mTextureView->setImageAssetID(unit->getID()); From 9f160b11fa0dea9d99c708f74cdfd9b103a23e43 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 18:52:43 -0500 Subject: [PATCH 44/90] Actually hook up LLAvatarResetSkeletonAndAnimations Thanks Aru --- indra/newview/llviewermenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ff590cd74..a7332f699 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9452,7 +9452,7 @@ void initialize_menus() addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); addMenu(new LLObjectEnableMute(), "Avatar.EnableMute"); addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton"); - addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeletonAndAnimations"); + addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend"); addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject"); addMenu(new LLAvatarCopyUUID(), "Avatar.CopyUUID"); From 368afacd142c81e09065aa361a58349b702ff6ac Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 19:28:34 -0500 Subject: [PATCH 45/90] Fix CSR Urls sometimes being broken Thanks Aru --- indra/newview/llavataractions.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 9609d60ff..269c24956 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -546,20 +546,12 @@ void LLAvatarActions::csr(const LLUUID& id) if (!gCacheName->getFullName(id, name)) return; std::string url = "http://csr.lindenlab.com/agent/"; - - // slow and stupid, but it's late - S32 len = name.length(); - for (S32 i = 0; i < len; i++) + if (char* output = curl_easy_escape(nullptr, name.c_str(), name.length())) { - if (name[i] == ' ') - { - url += "%20"; - } - else - { - url += name[i]; - } + name = output; + curl_free(output); } + url += name; LLWeb::loadURL(url); } From 1c9fcbb387b2933c5985999fe5f28280befb23f6 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 19:29:06 -0500 Subject: [PATCH 46/90] Fix Linux compile --- indra/newview/llfolderview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 020805e33..28c682544 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2165,7 +2165,8 @@ void LLFolderView::doIdle() LLFavoritesOrderStorage::instance(); // Singu TODO: Favorites bar. BOOL collectFavoriteItems(LLInventoryModel::item_array_t&); - collectFavoriteItems(LLInventoryModel::item_array_t()); + LLInventoryModel::item_array_t items; + collectFavoriteItems(items); LL_RECORD_BLOCK_TIME(FTM_INVENTORY); From 0269affb69f1d3291e8ab1b2509d9b9c01b90f3c Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 19:33:22 -0500 Subject: [PATCH 47/90] I need less unstaged code Here's pieces of the WIP offline->IM->online fix --- indra/llui/lltexteditor.h | 1 + indra/newview/llimpanel.cpp | 2 +- indra/newview/llimview.cpp | 32 ++++++++++++++++++++------------ indra/newview/llimview.h | 2 ++ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 4eba4842b..1bac9702c 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -295,6 +295,7 @@ public: llwchar getWChar(S32 pos) const { return mWText[pos]; } LLWString getWSubString(S32 pos, S32 len) const { return mWText.substr(pos, len); } + const LLTextSegment* getLastSegment() const { return mSegments.empty() ? nullptr : mSegments.back(); } const LLTextSegment* getCurrentSegment() const { return getSegmentAtOffset(mCursorPos); } const LLTextSegment* getPreviousSegment() const; void getSelectedSegments(std::vector& segments) const; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 2739d7c74..b80225d3e 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1227,7 +1227,7 @@ void deliver_message(const std::string& utf8_text, if((offline == IM_OFFLINE) && (LLVoiceClient::getInstance()->isOnlineSIP(other_participant_id))) { // User is online through the OOW connector, but not with a regular viewer. Try to send the message via SLVoice. - sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text); +// sent = LLVoiceClient::getInstance()->sendTextMessage(other_participant_id, utf8_text); } if(!sent) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ac3dea484..6dba5b453 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1097,31 +1097,39 @@ bool LLIMMgr::isNonFriendSessionNotified(const LLUUID& session_id) return mNotifiedNonFriendSessions.end() != mNotifiedNonFriendSessions.find(session_id); } +std::string LLIMMgr::getOfflineMessage(const LLUUID& id) +{ + std::string full_name; + if (LLAvatarNameCache::getNSName(id, full_name)) + { + LLUIString offline = LLTrans::getString("offline_message"); + offline.setArg("[NAME]", full_name); + return offline; + } + return LLStringUtil::null; +} + void LLIMMgr::noteOfflineUsers( LLFloaterIMPanel* floater, const std::vector& ids) { - S32 count = ids.size(); - if(count == 0) + if(ids.empty()) { const std::string& only_user = LLTrans::getString("only_user_message"); floater->addHistoryLine(only_user, gSavedSettings.getColor4("SystemChatColor")); } else { - const LLRelationship* info = NULL; + const LLRelationship* info = nullptr; LLAvatarTracker& at = LLAvatarTracker::instance(); - for(S32 i = 0; i < count; ++i) + for(const auto& id : ids) { - info = at.getBuddyInfo(ids.at(i)); - std::string full_name; - if (info - && !info->isOnline() - && LLAvatarNameCache::getNSName(ids.at(i), full_name)) + info = at.getBuddyInfo(id); + if (info && !info->isOnline()) { - LLUIString offline = LLTrans::getString("offline_message"); - offline.setArg("[NAME]", full_name); - floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); + auto offline(getOfflineMessage(id)); + if (!offline.empty()) + floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); } } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index b5a0f56e4..12aa856bd 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -188,6 +188,8 @@ public: bool isNonFriendSessionNotified(const LLUUID& session_id); + static std::string getOfflineMessage(const LLUUID& id); + private: // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance From 8f96442cc76ebc30438ad765026cae26840eee70 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 15 Feb 2019 23:41:06 -0500 Subject: [PATCH 48/90] Woops, truncate, not substr --- indra/newview/llpanellogin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e4d9c4abe..6d873d0be 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -459,7 +459,7 @@ void LLPanelLogin::mungePassword(const std::string& password) } else { - LLMD5 pass((unsigned char *)password.substr(16).c_str()); + LLMD5 pass((unsigned char *)utf8str_truncate(password, 16).c_str()); char munged_password[MD5HEX_STR_SIZE]; pass.hex_digest(munged_password); mMungedPassword = munged_password; From 50f9fbd72832183c2323a25172cccdc039967169 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 17 Feb 2019 12:54:16 -0500 Subject: [PATCH 49/90] Fix automatic bridge detach Thanks Aru --- indra/newview/llattachmentsmgr.cpp | 11 ++++++++++- indra/newview/llvoavatar.cpp | 16 ---------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/indra/newview/llattachmentsmgr.cpp b/indra/newview/llattachmentsmgr.cpp index 21ca02e38..e556ec61b 100644 --- a/indra/newview/llattachmentsmgr.cpp +++ b/indra/newview/llattachmentsmgr.cpp @@ -39,6 +39,7 @@ #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] +#include const F32 COF_LINK_BATCH_TIME = 5.0F; const F32 MAX_ATTACHMENT_REQUEST_LIFETIME = 30.0F; @@ -478,9 +479,17 @@ void LLAttachmentsMgr::onAttachmentArrived(const LLUUID& inv_item_id) { LLTimer timer; bool expected = mAttachmentRequests.getTime(inv_item_id, timer); + LLInventoryItem *item = gInventory.getItem(inv_item_id); + + if (item && boost::algorithm::contains(item->getName(), " Bridge v") && gSavedSettings.getBOOL("SGDetachBridge")) + { + LL_INFOS() << "Bridge detected! detaching" << LL_ENDL; + LLVOAvatarSelf::detachAttachmentIntoInventory(item->getUUID()); + return; + } + if (!expected) { - LLInventoryItem *item = gInventory.getItem(inv_item_id); LL_WARNS() << "ATT Attachment was unexpected or arrived after " << MAX_ATTACHMENT_REQUEST_LIFETIME << " seconds: " << (item ? item->getName() : "UNKNOWN") << " id " << inv_item_id << LL_ENDL; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index eaf57a214..217544bf6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7175,17 +7175,6 @@ void LLVOAvatar::removeChild(LLViewerObject *childp) } } -namespace -{ - boost::signals2::connection sDetachBridgeConnection; - void detach_bridge(const LLViewerObject* obj, const LLViewerObject* bridge) - { - if (obj != bridge) return; - sDetachBridgeConnection.disconnect(); - LLVOAvatarSelf::detachAttachmentIntoInventory(obj->getAttachmentItemID()); - } -} - LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object) { S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState()); @@ -7206,11 +7195,6 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi << " trying to use 1 (chest)" << LL_ENDL; - if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge")) - { - LL_INFOS() << "Bridge detected! detaching" << LL_ENDL; - sDetachBridgeConnection = gAgentAvatarp->setAttachmentCallback(boost::bind(detach_bridge, _1, viewer_object)); - } attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) if (attachment) { From 2773c22f9b9c5430abd6682146c0cb1617d450ef Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 17 Feb 2019 16:46:51 -0500 Subject: [PATCH 50/90] Fix los argumentos truncamientos Gracias a Damian --- indra/llrender/llpostprocess.cpp | 2 +- indra/newview/llnotify.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index a2fbeb9ee..9c65dffb4 100644 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp @@ -286,7 +286,7 @@ public: LLVector2 screen_rect = LLPostProcess::getInstance()->getDimensions(); mPassLoc = getShader().getUniformLocation(sHorizontalPass); - LLVector4 vec[] = { LLVector4(1.3846153846, 3.2307692308, 0, 0) / screen_rect.mV[VX], LLVector4( 0,0, 1.3846153846, 3.2307692308 ) / screen_rect.mV[VY] }; + LLVector4 vec[] = { LLVector4(1.3846153846f, 3.2307692308f, 0.f, 0.f) / screen_rect.mV[VX], LLVector4( 0.f,0.f, 1.3846153846f, 3.2307692308f ) / screen_rect.mV[VY] }; getShader().uniform4fv(sKern, LL_ARRAY_SIZE(vec), (GLfloat*)vec); return QUAD_NORMAL; } diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp index 174af5c7c..a223030b0 100644 --- a/indra/newview/llnotify.cpp +++ b/indra/newview/llnotify.cpp @@ -247,7 +247,7 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification) auto text_color = gColors.getColor(mIsCaution && mIsTip ? "NotifyCautionWarnColor" : "NotifyTextColor"); text->setReadOnlyFgColor(text_color); //sets caution text color for tip notifications if (!mIsCaution) // We could do some extra color math here to determine if bg's too close to link color, but let's just cross with the link color instead - text->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4))); + text->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4f))); text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard) text->appendText(message,false,false,nullptr,!layout_script_dialog); // Now we can set the text, since colors have been set. addChild(text); From 174a2d36aa0def980d39ac7d65f17a3569e4f223 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Tue, 19 Feb 2019 11:47:22 -0500 Subject: [PATCH 51/90] I found a leak, viewer-release found it too, let's use their fix It's close enough to mine, although I disagree with using 0 for a pointer instead of using nullptr, but alas, mergeability. This damn leak happened at least every log line on Linux and Mac since the dawn of time for the viewer... Disgusting. Well, not every log line, but every log line mentioning a class, which is most these days. --- indra/llcommon/llerror.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e6b688ee0..a0186e9f0 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -252,23 +252,13 @@ namespace { #ifdef __GNUC__ // GCC: type_info::name() returns a mangled class name,st demangle - - static size_t abi_name_len = 100; - static char* abi_name_buf = (char*)malloc(abi_name_len); - // warning: above is voodoo inferred from the GCC manual, - // do NOT change - - int status; - // We don't use status, and shouldn't have to pass apointer to it - // but gcc 3.3 libstc++'s implementation of demangling is broken - // and fails without. - - char* name = abi::__cxa_demangle(type.name(), - abi_name_buf, &abi_name_len, &status); - // this call can realloc the abi_name_buf pointer (!) - - return name ? name : type.name(); - + // passing nullptr, 0 forces allocation of a unique buffer we can free + // fixing MAINT-8724 on OSX 10.14 + int status = -1; + char* name = abi::__cxa_demangle(type.name(), nullptr, 0, &status); + std::string result(name ? name : type.name()); + free(name); + return result; #elif LL_WINDOWS // DevStudio: type_info::name() includes the text "class " at the start From 9f2d8e6fffbe9e5b25efcb0c66d5a4ac5cbf42e6 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 20 Feb 2019 07:34:56 -0500 Subject: [PATCH 52/90] Fix things, mainly make things more optimal... No, I didn't compile this Run along, Nothing to see here. --- indra/newview/llfloateravatarlist.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index de4ecd451..5ac50024f 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -98,7 +98,7 @@ namespace case STAT_TYPE_DRAW: if (radar_alert_draw) args["[RANGE]"] = LLTrans::getString("draw_distance"); break; case STAT_TYPE_SHOUTRANGE: if (radar_alert_shout_range) args["[RANGE]"] = LLTrans::getString("shout_range"); break; case STAT_TYPE_CHATRANGE: if (radar_alert_chat_range) args["[RANGE]"] = LLTrans::getString("chat_range"); break; - case STAT_TYPE_AGE: if (radar_alert_age) chat.mText = name + " " + LLTrans::getString("has_triggered_your_avatar_age_alert") + "."; break; + case STAT_TYPE_AGE: if (radar_alert_age) chat.mText = name + ' ' + LLTrans::getString("has_triggered_your_avatar_age_alert") + '.'; break; default: llassert(type); break; } args["[NAME]"] = name; @@ -592,13 +592,13 @@ void LLFloaterAvatarList::updateAvatarList(const LLViewerRegion* region, bool fi U32 num_ids = 0; while(!announce_keys.empty()) { - ids << "," << announce_keys.front().asString(); + ids << ',' << announce_keys.front().asString(); ++num_ids; if (ids.tellp() > 200) { send_keys_message(transact_num, num_ids, ids.str()); ids.seekp(num_ids = 0); - ids.str(""); + ids.str(LLStringUtil::null); } announce_keys.pop(); } @@ -1102,7 +1102,6 @@ void LLFloaterAvatarList::trackAvatar(const LLAvatarListEntry* entry) const LLAvatarListEntry* LLFloaterAvatarList::getAvatarEntry(const LLUUID& avatar) const { - if (avatar.isNull()) return NULL; av_list_t::const_iterator iter = std::find_if(mAvatars.begin(),mAvatars.end(),LLAvatarListEntry::uuidMatch(avatar)); return (iter != mAvatars.end()) ? iter->get() : NULL; } @@ -1272,13 +1271,13 @@ void LLFloaterAvatarList::sendKeys() const for (U32 i = 0; i < regionp->mMapAvatarIDs.size(); ++i) { - ids << "," << regionp->mMapAvatarIDs.at(i); + ids << ',' << regionp->mMapAvatarIDs.at(i); ++num_ids; if (ids.tellp() > 200) { send_keys_message(transact_num, num_ids, ids.str()); ids.seekp(num_ids = 0); - ids.str(""); + ids.str(LLStringUtil::null); } } if (num_ids > 0) send_keys_message(transact_num, num_ids, ids.str()); @@ -1417,7 +1416,7 @@ std::string LLFloaterAvatarList::getSelectedNames(const std::string& separator) std::string LLFloaterAvatarList::getSelectedName() const { LLAvatarListEntry* entry = getAvatarEntry(getSelectedID()); - return entry ? entry->getName() : ""; + return entry ? entry->getName() : LLStringUtil::null; } LLUUID LLFloaterAvatarList::getSelectedID() const From a2701faa2bbbb33bcb79d73cc2597806c4f96490 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 20 Feb 2019 21:22:24 -0500 Subject: [PATCH 53/90] Floss Finder: Igor Igor is a dentist with more on his "plate" than he can handle Watch as Igor tries to find all the floss in his patients' mouths Starring Timmy the Tooth, and the Tooth Fairy; join all your favorite oral hygiene friends in helping Igor solve his terrible tooth travesty! (May contain traces of knockoff pokemon, talk to your dietician before consumption) --- indra/llcommon/llformat.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index f9f16006a..319afda94 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -41,13 +41,17 @@ // wrapper for vsnprintf to be called from llformatXXX functions. static void va_format(std::string& out, const char *fmt, va_list va) { - char tstr[1024]; /* Flawfinder: ignore */ -#if LL_WINDOWS - _vsnprintf(tstr, 1024, fmt, va); -#else - vsnprintf(tstr, 1024, fmt, va); /* Flawfinder: ignore */ -#endif - out.assign(tstr); + constexpr auto smallsize = 1024; + std::vector charvector(smallsize); // Evolves into charveleon + va_list va2; + va_copy(va2, va); + const auto size = std::vsnprintf(charvector.data(), charvector.size(), fmt, va); + if (size >= smallsize) + { + charvector.resize(1+size); // Use the String Stone + std::vsnprintf(charvector.data(), charvector.size(), fmt, va2); + } + out.assign(charvector.data()); } std::string llformat(const char *fmt, ...) From 4f87e82a19c15d626bdcd4eac2ad80b4a1d7cd9a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 20 Feb 2019 21:39:06 -0500 Subject: [PATCH 54/90] Do llformat even better! --- indra/llcommon/llformat.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index 319afda94..57b74cc70 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -37,26 +37,24 @@ #include +constexpr auto smallsize = 1024; // common used function with va_list argument // wrapper for vsnprintf to be called from llformatXXX functions. -static void va_format(std::string& out, const char *fmt, va_list va) +static void va_format(std::string& charvector, const char *fmt, va_list va) { - constexpr auto smallsize = 1024; - std::vector charvector(smallsize); // Evolves into charveleon va_list va2; va_copy(va2, va); const auto size = std::vsnprintf(charvector.data(), charvector.size(), fmt, va); - if (size >= smallsize) + if (size >= smallsize) // Evolve into charveleon { charvector.resize(1+size); // Use the String Stone std::vsnprintf(charvector.data(), charvector.size(), fmt, va2); } - out.assign(charvector.data()); } std::string llformat(const char *fmt, ...) { - std::string res; + std::string res(smallsize, '\0'); va_list va; va_start(va, fmt); va_format(res, fmt, va); @@ -66,7 +64,7 @@ std::string llformat(const char *fmt, ...) std::string llformat_to_utf8(const char *fmt, ...) { - std::string res; + std::string res(smallsize, '\0'); va_list va; va_start(va, fmt); va_format(res, fmt, va); From f9e3afaad2296e8061b44f55152d2be14f072c57 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 21 Feb 2019 03:22:54 -0500 Subject: [PATCH 55/90] Revert "Do llformat even better!" This reverts commit 4f87e82a19c15d626bdcd4eac2ad80b4a1d7cd9a. string::data can't be nonconst until C++17, maybe one day. --- indra/llcommon/llformat.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index 57b74cc70..319afda94 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -37,24 +37,26 @@ #include -constexpr auto smallsize = 1024; // common used function with va_list argument // wrapper for vsnprintf to be called from llformatXXX functions. -static void va_format(std::string& charvector, const char *fmt, va_list va) +static void va_format(std::string& out, const char *fmt, va_list va) { + constexpr auto smallsize = 1024; + std::vector charvector(smallsize); // Evolves into charveleon va_list va2; va_copy(va2, va); const auto size = std::vsnprintf(charvector.data(), charvector.size(), fmt, va); - if (size >= smallsize) // Evolve into charveleon + if (size >= smallsize) { charvector.resize(1+size); // Use the String Stone std::vsnprintf(charvector.data(), charvector.size(), fmt, va2); } + out.assign(charvector.data()); } std::string llformat(const char *fmt, ...) { - std::string res(smallsize, '\0'); + std::string res; va_list va; va_start(va, fmt); va_format(res, fmt, va); @@ -64,7 +66,7 @@ std::string llformat(const char *fmt, ...) std::string llformat_to_utf8(const char *fmt, ...) { - std::string res(smallsize, '\0'); + std::string res; va_list va; va_start(va, fmt); va_format(res, fmt, va); From 2882cb728fdae28f69659e24d9ca2b87bd9a484d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 23 Feb 2019 04:08:55 -0500 Subject: [PATCH 56/90] Optimize llformat Even MORE, and clean up some code. Thanks for the help, Aru! --- indra/llcommon/llformat.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index 319afda94..01b02191f 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -36,21 +36,35 @@ #include "llformat.h" #include +#include // common used function with va_list argument // wrapper for vsnprintf to be called from llformatXXX functions. -static void va_format(std::string& out, const char *fmt, va_list va) +static void va_format(std::string& out, const char *fmt, va_list& va) { - constexpr auto smallsize = 1024; - std::vector charvector(smallsize); // Evolves into charveleon + typedef typename std::vector> vec_t; + static thread_local vec_t charvector(1024); // Evolves into charveleon + #define vsnprintf(va) std::vsnprintf(charvector.data(), charvector.capacity(), fmt, va) +#ifdef LL_WINDOWS // We don't have to copy on windows + #define va2 va +#else va_list va2; va_copy(va2, va); - const auto size = std::vsnprintf(charvector.data(), charvector.size(), fmt, va); - if (size >= smallsize) +#endif + const auto smallsize(charvector.capacity()); + const auto size = vsnprintf(va); + if (size < 0) + { + LL_ERRS() << "Encoding failed, code " << size << ". String hint:" << out << '/' << fmt << LL_ENDL; + } + else if (static_cast(size) >= smallsize) // Resize if we need more space { charvector.resize(1+size); // Use the String Stone - std::vsnprintf(charvector.data(), charvector.size(), fmt, va2); + vsnprintf(va2); } +#ifndef LL_WINDOWS + va_end(va2); +#endif out.assign(charvector.data()); } From d096c043f0e77df791e23eea529c3681513f35be Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 24 Feb 2019 09:06:32 -0500 Subject: [PATCH 57/90] Attempt to fix disconnects by syncing to match upstream eventpoll Upstream no longer repeats requests or force disconnects upon 404 or internal library error, so we shouldn't either. --- indra/llcommon/llformat.cpp | 2 +- indra/newview/lleventpoll.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llformat.cpp b/indra/llcommon/llformat.cpp index 01b02191f..7030b5f0f 100644 --- a/indra/llcommon/llformat.cpp +++ b/indra/llcommon/llformat.cpp @@ -55,7 +55,7 @@ static void va_format(std::string& out, const char *fmt, va_list& va) const auto size = vsnprintf(va); if (size < 0) { - LL_ERRS() << "Encoding failed, code " << size << ". String hint:" << out << '/' << fmt << LL_ENDL; + LL_ERRS() << "Encoding failed, code " << size << ". String hint: " << out << '/' << fmt << LL_ENDL; } else if (static_cast(size) >= smallsize) // Resize if we need more space { diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 22b715590..30146adcb 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -190,6 +190,20 @@ namespace mErrorCount = 0; makeRequest(); } + else if (mStatus == HTTP_NOT_FOUND) + { // Event polling for this server has been canceled. In + // some cases the server gets ahead of the viewer and will + // return a 404 error (Not Found) before the cancel event + // comes back in the queue + LL_WARNS("LLEventPollImpl") << "Canceling coroutine" << LL_ENDL; + stop(); + } + else if (mCode != CURLE_OK) + { + /// Some LLCore or LIBCurl error was returned. This is unlikely to be recoverable + LL_WARNS("LLEventPollImpl") << "Critical error from poll request returned from libraries. Canceling coroutine." << LL_ENDL; + stop(); + } else if (mErrorCount < MAX_EVENT_POLL_HTTP_ERRORS) { ++mErrorCount; From 55788495089e587de71fbfb89463a9efd1432612 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sun, 24 Feb 2019 09:08:08 -0500 Subject: [PATCH 58/90] On second thought, there's no reason to disconnect until region isn't alive So let's not do that anymore, making us resilient against a grid that has HTTP problems. Thanks for the help, Aru! --- indra/newview/lleventpoll.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 30146adcb..b804b81be 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -227,6 +227,7 @@ namespace // They are essentially disconnected from the region even though some things may still work. // Since things won't get better until they relog we force a disconnect now. + /* Singu Note: There's no reason to disconnect, just because this failed a few too many times // *NOTE:Mani - The following condition check to see if this failing event poll // is attached to the Agent's main region. If so we disconnect the viewer. // Else... its a child region and we just leave the dead event poll stopped and @@ -236,6 +237,7 @@ namespace LL_WARNS() << "Forcing disconnect due to stalled main region event poll." << LL_ENDL; LLAppViewer::instance()->forceDisconnect(LLTrans::getString("AgentLostConnection")); } + */ } } From 7071ac29e83f4cc2a7b1afe826c7865054f44467 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 25 Feb 2019 08:02:11 -0500 Subject: [PATCH 59/90] Do Opt Yes --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a0c2b5e59..67cd288b4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -679,7 +679,7 @@ void hide_context_entries(LLMenuGL& menu, // between two separators). if (found) { - const bool is_entry_separator = (dynamic_cast(menu_item) != NULL); + const bool is_entry_separator = !branchp && (dynamic_cast(menu_item) != NULL); found = !(is_entry_separator && is_previous_entry_separator); is_previous_entry_separator = is_entry_separator; } From e0b9f23dada7b926bd697728b8f72a753de03c6b Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 25 Feb 2019 08:05:37 -0500 Subject: [PATCH 60/90] Clean up and simplify wlf panel code --- indra/newview/wlfPanel_AdvSettings.cpp | 73 +++++++------------------- indra/newview/wlfPanel_AdvSettings.h | 7 +-- 2 files changed, 21 insertions(+), 59 deletions(-) diff --git a/indra/newview/wlfPanel_AdvSettings.cpp b/indra/newview/wlfPanel_AdvSettings.cpp index b105d22a2..748340622 100644 --- a/indra/newview/wlfPanel_AdvSettings.cpp +++ b/indra/newview/wlfPanel_AdvSettings.cpp @@ -34,15 +34,11 @@ #include "wlfPanel_AdvSettings.h" #include "llbutton.h" -#include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "lliconctrl.h" -#include "lloverlaybar.h" -#include "lltextbox.h" -#include "llcombobox.h" -#include "llsliderctrl.h" #include "llcheckboxctrl.h" -#include "llstartup.h" +#include "llcombobox.h" +#include "llpostprocess.h" +#include "llsliderctrl.h" +#include "lluictrlfactory.h" #include "llfloaterwindlight.h" #include "llfloaterwater.h" @@ -57,6 +53,10 @@ #include "llwlparamset.h" #include "llwlparammanager.h" + // [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + // Hover funcs void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl); void onHoverSliderMoved(const LLSD& val); @@ -171,10 +171,10 @@ BOOL wlfPanel_AdvSettings::postBuild() //populateDayCyclePresetsList(); // next/prev buttons - getChild("WWnext")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWWNext, this)); - getChild("WWprev")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWWPrev, this)); - getChild("WLnext")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWLNext, this)); - getChild("WLprev")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWLPrev, this)); + getChild("WWnext")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mWaterPresetCombo, true)); + getChild("WWprev")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mWaterPresetCombo, false)); + getChild("WLnext")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mSkyPresetCombo, true)); + getChild("WLprev")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mSkyPresetCombo, false)); getChild("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(LLFloaterWindLight::show)); getChild("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(LLFloaterWater::show)); @@ -224,7 +224,7 @@ BOOL wlfPanel_AdvSettings::postBuild() } else { - mHoverHeight = NULL; + mHoverHeight = nullptr; } return TRUE; } @@ -301,48 +301,13 @@ void wlfPanel_AdvSettings::onChangeWLPresetName(const LLSD& value) } } -void wlfPanel_AdvSettings::onClickWWNext() +void wlfPanel_AdvSettings::onClickArrow(LLComboBox* combo, bool next) { - S32 index = mWaterPresetCombo->getCurrentIndex(); - ++index; - if (index == mWaterPresetCombo->getItemCount()) - index = 0; - mWaterPresetCombo->setCurrentByIndex(index); - - onChangeWWPresetName(mWaterPresetCombo->getSelectedValue()); -} - -void wlfPanel_AdvSettings::onClickWWPrev() -{ - S32 index = mWaterPresetCombo->getCurrentIndex(); - if (index == 0) - index = mWaterPresetCombo->getItemCount(); - --index; - mWaterPresetCombo->setCurrentByIndex(index); - - onChangeWWPresetName(mWaterPresetCombo->getSelectedValue()); -} - -void wlfPanel_AdvSettings::onClickWLNext() -{ - S32 index = mSkyPresetCombo->getCurrentIndex(); - ++index; - if (index == mSkyPresetCombo->getItemCount()) - index = 0; - mSkyPresetCombo->setCurrentByIndex(index); - - onChangeWLPresetName(mSkyPresetCombo->getSelectedValue()); -} - -void wlfPanel_AdvSettings::onClickWLPrev() -{ - S32 index = mSkyPresetCombo->getCurrentIndex(); - if (index == 0) - index = mSkyPresetCombo->getItemCount(); - --index; - mSkyPresetCombo->setCurrentByIndex(index); - - onChangeWLPresetName(mSkyPresetCombo->getSelectedValue()); + S32 index = combo->getCurrentIndex() + (next ? 1 : -1); + const auto too_far = next ? combo->getItemCount() : -1; + const auto wrap_around = next ? 0 : combo->getItemCount(); + combo->setCurrentByIndex(index == too_far ? wrap_around : index); + combo->onCommit(); } void wlfPanel_AdvSettings::onChangeDayTime(const LLSD& value) diff --git a/indra/newview/wlfPanel_AdvSettings.h b/indra/newview/wlfPanel_AdvSettings.h index 1bf1b9691..2adf541c2 100644 --- a/indra/newview/wlfPanel_AdvSettings.h +++ b/indra/newview/wlfPanel_AdvSettings.h @@ -36,7 +36,7 @@ #include // [RLVa:KB] -#include "rlvhandler.h" +#include "rlvdefines.h" // [/RLVa:KB] class LLComboBox; @@ -66,10 +66,7 @@ protected: void build(); void onUseRegionSettings(const LLSD& value); - void onClickWWNext(); - void onClickWWPrev(); - void onClickWLNext(); - void onClickWLPrev(); + static void onClickArrow(LLComboBox* combo, bool next); void onChangeDayTime(const LLSD& value); void refreshLists(); /// update controls with user prefs From 0cadfbaddbfe02ec35aa162e3b4d3cb658ff59b8 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Mon, 25 Feb 2019 12:33:24 -0500 Subject: [PATCH 61/90] Why was this in the wrong position? --- .../skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml index 4f63d8917..053146f3c 100644 --- a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml +++ b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml @@ -26,7 +26,7 @@ + From e89e57b5a0335218ba234dfc80280a27d4d34566 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 13:56:18 -0500 Subject: [PATCH 83/90] [OpenSim] Feature Request: Allow passwords up to 24 characters long --- indra/newview/llpanellogin.cpp | 2 +- indra/newview/skins/default/xui/en-us/panel_login.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 6d873d0be..517bfb424 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -459,7 +459,7 @@ void LLPanelLogin::mungePassword(const std::string& password) } else { - LLMD5 pass((unsigned char *)utf8str_truncate(password, 16).c_str()); + LLMD5 pass((unsigned char *)utf8str_truncate(password, gHippoGridManager->getCurrentGrid()->isOpenSimulator() ? 24 : 16).c_str()); char munged_password[MD5HEX_STR_SIZE]; pass.hex_digest(munged_password); mMungedPassword = munged_password; diff --git a/indra/newview/skins/default/xui/en-us/panel_login.xml b/indra/newview/skins/default/xui/en-us/panel_login.xml index d1c875ad1..9a490a516 100644 --- a/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -35,7 +35,7 @@ From f599278d8ddce32fb006b0b0348a2fdeba6f0eba Mon Sep 17 00:00:00 2001 From: Pytak Date: Thu, 28 Feb 2019 21:03:38 +0100 Subject: [PATCH 84/90] rename non-prefixed PyFX Ambient windlights to [PyFX], add one new Ambient windlight, add PyFX 0.6 Ice water preset --- ...%5BPyFX%5D%20Ambient%20%2BFog%20Black.xml} | 0 ...X%5D%20Ambient%20%2BFog%20Dark%20Blue.xml} | 0 ... %5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml} | 0 ...X%5D%20Ambient%20%2BFog%20Gray%20Blue.xml} | 0 ... %5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml} | 0 ...FX%5D%20Ambient%20%2BFog%20Underwater.xml} | 0 ...%5D%20Ambient%20%2BFog%20White%20Wash.xml} | 0 ...%5BPyFX%5D%20Ambient%20%2BFog%20White.xml} | 12 +- ...k.xml => %5BPyFX%5D%20Ambient%20Black.xml} | 0 ...5BPyFX%5D%20Ambient%20Dark%20H%2DBomb.xml} | 0 ...rk.xml => %5BPyFX%5D%20Ambient%20Dark.xml} | 0 ...BPyFX%5D%20Ambient%20Gray%20Background.xml | 141 ++++++++++++++++++ ...ay.xml => %5BPyFX%5D%20Ambient%20Gray.xml} | 0 ...e.xml => %5BPyFX%5D%20Ambient%20White.xml} | 0 .../windlight/water/%5BPyFX%5D%20Ice.xml | 43 ++++++ 15 files changed, 190 insertions(+), 6 deletions(-) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Black.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Black.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Dark%20Blue.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Dark%20Blue.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Dark.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Gray%20Blue.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Gray%20Blue.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Gray.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20Underwater.xml => %5BPyFX%5D%20Ambient%20%2BFog%20Underwater.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20White%20Wash.xml => %5BPyFX%5D%20Ambient%20%2BFog%20White%20Wash.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20%2BFog%20White.xml => %5BPyFX%5D%20Ambient%20%2BFog%20White.xml} (95%) rename indra/newview/app_settings/windlight/skies/{Ambient%20Black.xml => %5BPyFX%5D%20Ambient%20Black.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20Dark%20H%2DBomb.xml => %5BPyFX%5D%20Ambient%20Dark%20H%2DBomb.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20Not%20As%20Dark.xml => %5BPyFX%5D%20Ambient%20Dark.xml} (100%) create mode 100644 indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray%20Background.xml rename indra/newview/app_settings/windlight/skies/{Ambient%20Gray.xml => %5BPyFX%5D%20Ambient%20Gray.xml} (100%) rename indra/newview/app_settings/windlight/skies/{Ambient%20Not%20As%20White.xml => %5BPyFX%5D%20Ambient%20White.xml} (100%) create mode 100644 indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Black.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Black.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Black.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Black.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark%20Blue.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark%20Blue.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark%20Blue.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark%20Blue.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Dark.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Dark.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray%20Blue.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray%20Blue.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray%20Blue.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray%20Blue.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Gray.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Gray.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Underwater.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Underwater.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20Underwater.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20Underwater.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White%20Wash.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White%20Wash.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White%20Wash.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White%20Wash.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml similarity index 95% rename from indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml index b33f7ad69..c91588466 100644 --- a/indra/newview/app_settings/windlight/skies/Ambient%20%2BFog%20White.xml +++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20%2BFog%20White.xml @@ -2,10 +2,10 @@ ambient - 3 - 3 - 3 - 1 + 1.5 + 1.5 + 1.5 + 0.5 blue_density @@ -63,14 +63,14 @@ density_multiplier - 4.999999873689375817775726e-05 + 0.0008999999845400452613830566 0 0 1 distance_multiplier - 50 + 1 0 0 1 diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20Black.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Black.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20Black.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Black.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20Dark%20H%2DBomb.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Dark%20H%2DBomb.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20Dark%20H%2DBomb.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Dark%20H%2DBomb.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20Not%20As%20Dark.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Dark.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20Not%20As%20Dark.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Dark.xml diff --git a/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray%20Background.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray%20Background.xml new file mode 100644 index 000000000..fe1c9f8c0 --- /dev/null +++ b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray%20Background.xml @@ -0,0 +1,141 @@ + + + ambient + + 1.5 + 1.5 + 1.5 + 0.5 + + blue_density + + 0.449999993698308176082179 + 0.4499999939833594919669224 + 0.4499999944309046040480382 + 1 + + blue_horizon + + 0.89999997615814208984375 + 0.89999997615814208984375 + 0.89999997615814208984375 + 0.449999988079071044921875 + + cloud_color + + 0.2261540024157503436796901 + 0.2261540024157503436796901 + 0.2261540024157503436796901 + 1 + + cloud_pos_density1 + + 0 + 0 + 0 + 1 + + cloud_pos_density2 + + 0.5 + 0.5 + 0.125 + 1 + + cloud_scale + + 0.4199999868869781494140625 + 0 + 0 + 1 + + cloud_scroll_rate + + 10 + 10 + + cloud_shadow + + 0.36000001430511474609375 + 0 + 0 + 1 + + density_multiplier + + 0.0004499999922700226306915283 + 0 + 0 + 1 + + distance_multiplier + + 0 + 0 + 0 + 1 + + east_angle + 0 + enable_cloud_scroll + + 1 + 1 + + gamma + + 1 + 0 + 0 + 1 + + glow + + 5 + 0.001000000047497451305389404 + -0 + 1 + + haze_density + + 4 + 0 + 0 + 1 + + haze_horizon + + 0 + 0.1991560043746730401803546 + 0.1991560043746730401803546 + 1 + + lightnorm + + -0 + 1 + 1.148381556959066074341536e-06 + 0 + + max_y + + 4000 + 0 + 0 + 1 + + preset_num + 26 + star_brightness + 0 + sun_angle + 1.57079517841339111328125 + sunlight_color + + 0 + 0 + 0 + 0 + + + diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20Gray.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20Gray.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20Gray.xml diff --git a/indra/newview/app_settings/windlight/skies/Ambient%20Not%20As%20White.xml b/indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20White.xml similarity index 100% rename from indra/newview/app_settings/windlight/skies/Ambient%20Not%20As%20White.xml rename to indra/newview/app_settings/windlight/skies/%5BPyFX%5D%20Ambient%20White.xml diff --git a/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml b/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml new file mode 100644 index 000000000..a5cdf76ae --- /dev/null +++ b/indra/newview/app_settings/windlight/water/%5BPyFX%5D%20Ice.xml @@ -0,0 +1,43 @@ + + + blurMultiplier + 0.1600000113248825073242188 + fresnelOffset + 0.5 + fresnelScale + 1 + normScale + + 5 + 5 + 5 + + normalMap + f92da839-f302-c813-668d-601ab1957af1 + scaleAbove + 0.199999988079071044921875 + scaleBelow + 0.2000000029802322387695313 + underWaterFogMod + 1 + waterFogColor + + 0.02851562201976776123046875 + 0.07148437201976776123046875 + 0.06242064759135246276855469 + 1 + + waterFogDensity + 2 + wave1Dir + + 0 + 0 + + wave2Dir + + 0 + 0 + + + From 8e18f2ab43e422f3488aecf73499a19512922787 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 20:09:00 -0500 Subject: [PATCH 85/90] So sick of these EEP warnings in my log, add the asset types --- indra/llcommon/llassettype.cpp | 3 + indra/llcommon/llassettype.h | 13 ++- indra/llinventory/llinventorytype.cpp | 10 ++ indra/llinventory/llinventorytype.h | 10 +- indra/newview/llinventorybridge.cpp | 3 + indra/newview/llinventoryicon.cpp | 25 +++++ indra/newview/llinventoryicon.h | 1 + indra/newview/llviewerassetstats.cpp | 97 ++++-------------- indra/newview/llviewerassettype.cpp | 3 + .../skins/default/textures/Inv_Settings.png | Bin 0 -> 925 bytes .../default/textures/Inv_SettingsDay.png | Bin 0 -> 925 bytes .../default/textures/Inv_SettingsSky.png | Bin 0 -> 883 bytes .../default/textures/Inv_SettingsWater.png | Bin 0 -> 764 bytes .../default/textures/Inv_UnknownObject.png | Bin 0 -> 1048 bytes .../skins/default/textures/textures.xml | 5 + 15 files changed, 90 insertions(+), 80 deletions(-) create mode 100644 indra/newview/skins/default/textures/Inv_Settings.png create mode 100644 indra/newview/skins/default/textures/Inv_SettingsDay.png create mode 100644 indra/newview/skins/default/textures/Inv_SettingsSky.png create mode 100644 indra/newview/skins/default/textures/Inv_SettingsWater.png create mode 100644 indra/newview/skins/default/textures/Inv_UnknownObject.png diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index 5b22d5bab..66602f4e7 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -101,6 +101,9 @@ LLAssetDictionary::LLAssetDictionary() addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false)); addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false)); addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, true, true)); + addEntry(LLAssetType::AT_SETTINGS, new AssetEntry("SETTINGS", "settings", "settings blob", true, true, true)); + + addEntry(LLAssetType::AT_UNKNOWN, new AssetEntry("UNKNOWN", "invalid", NULL, false, false, false)); addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false)); }; diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index e6fee54ca..272c63399 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -132,7 +132,16 @@ public: AT_MESH = 49, // Mesh data in our proprietary SLM format - AT_COUNT = 50, + AT_RESERVED_1 = 50, + AT_RESERVED_2 = 51, + AT_RESERVED_3 = 52, + AT_RESERVED_4 = 53, + AT_RESERVED_5 = 54, + AT_RESERVED_6 = 55, + + AT_SETTINGS = 56, // Collection of settings + + AT_COUNT = 57, // +*********************************************************+ // | TO ADD AN ELEMENT TO THIS ENUM: | @@ -143,7 +152,7 @@ public: // | 4. ADD TO LLViewerAssetType.cpp | // | 5. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp | // +*********************************************************+ - + AT_UNKNOWN = 255, AT_NONE = -1 }; diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 78651b55f..fcef1611c 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -85,6 +85,7 @@ LLInventoryDictionary::LLInventoryDictionary() addEntry(LLInventoryType::IT_ANIMATION, new InventoryEntry("animation", "animation", 1, LLAssetType::AT_ANIMATION)); addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE)); addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH)); + addEntry(LLInventoryType::IT_SETTINGS, new InventoryEntry("settings", "settings", 1, LLAssetType::AT_SETTINGS)); } @@ -145,6 +146,15 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_NONE, // 47 AT_NONE LLInventoryType::IT_NONE, // 48 AT_NONE LLInventoryType::IT_MESH, // 49 AT_MESH + + LLInventoryType::IT_NONE, // 50 AT_RESERVED_1 + LLInventoryType::IT_NONE, // 52 AT_RESERVED_2 + LLInventoryType::IT_NONE, // 53 AT_RESERVED_3 + LLInventoryType::IT_NONE, // 54 AT_RESERVED_4 + LLInventoryType::IT_NONE, // 55 AT_RESERVED_5 + LLInventoryType::IT_NONE, // 56 AT_RESERVED_6 + + LLInventoryType::IT_SETTINGS, // 57 AT_SETTINGS }; // static diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index b444ecfa5..1d9627ffb 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -62,8 +62,10 @@ public: IT_ANIMATION = 19, IT_GESTURE = 20, IT_MESH = 22, - IT_COUNT = 23, + IT_SETTINGS = 25, + IT_COUNT = 26, + IT_UNKNOWN = 255, IT_NONE = -1 }; @@ -108,8 +110,14 @@ public: ICONNAME_LINKFOLDER, ICONNAME_MESH, + ICONNAME_SETTINGS, + ICONNAME_SETTINGS_SKY, + ICONNAME_SETTINGS_WATER, + ICONNAME_SETTINGS_DAY, + ICONNAME_CLOTHING_UNKNOWN, ICONNAME_INVALID, + ICONNAME_UNKNOWN, ICONNAME_COUNT, ICONNAME_NONE = -1 }; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 67cd288b4..3eb442385 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1296,6 +1296,9 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, //LL_WARNS() << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << LL_ENDL; break; + case LLAssetType::AT_SETTINGS: + break; + default: LL_INFOS() << "Unhandled asset type (llassetstorage.h): " << (S32)asset_type << " (" << LLAssetType::lookup(asset_type) << ")" << LL_ENDL; diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index f93dc8dd7..f2739df69 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -88,8 +88,14 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryType::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga")); addEntry(LLInventoryType::ICONNAME_MESH, new IconEntry("inv_item_mesh.tga")); + addEntry(LLInventoryType::ICONNAME_SETTINGS_SKY, new IconEntry("Inv_SettingsSky.png")); + addEntry(LLInventoryType::ICONNAME_SETTINGS_WATER, new IconEntry("Inv_SettingsWater.png")); + addEntry(LLInventoryType::ICONNAME_SETTINGS_DAY, new IconEntry("Inv_SettingsDay.png")); + addEntry(LLInventoryType::ICONNAME_SETTINGS, new IconEntry("Inv_Settings.png")); + addEntry(LLInventoryType::ICONNAME_CLOTHING_UNKNOWN, new IconEntry("inv_item_unknown.tga")); addEntry(LLInventoryType::ICONNAME_INVALID, new IconEntry("inv_invalid.png")); + addEntry(LLInventoryType::ICONNAME_UNKNOWN, new IconEntry("Inv_UnknownObject.png")); addEntry(LLInventoryType::ICONNAME_NONE, new IconEntry("NONE")); } @@ -163,6 +169,14 @@ const std::string& LLInventoryIcon::getIconName(LLAssetType::EType asset_type, break; case LLAssetType::AT_MESH: idx = LLInventoryType::ICONNAME_MESH; + break; + case LLAssetType::AT_SETTINGS: + // TODO: distinguish between Sky and Water settings. + idx = assignSettingsIcon(misc_flag); + break; + case LLAssetType::AT_UNKNOWN: + idx = LLInventoryType::ICONNAME_UNKNOWN; + break; default: break; } @@ -182,3 +196,14 @@ LLInventoryType::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag) const LLWearableType::EType wearable_type = LLWearableType::EType(LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK & misc_flag); return LLWearableType::getIconName(wearable_type); } + +LLInventoryType::EIconName LLInventoryIcon::assignSettingsIcon(U32 misc_flag) +{ + switch (misc_flag & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK) + { + case 0: return LLInventoryType::ICONNAME_SETTINGS_SKY; + case 1: return LLInventoryType::ICONNAME_SETTINGS_WATER; + case 2: return LLInventoryType::ICONNAME_SETTINGS_DAY; + } + return LLInventoryType::ICONNAME_SETTINGS; +} diff --git a/indra/newview/llinventoryicon.h b/indra/newview/llinventoryicon.h index 659448143..58e1ffdb6 100644 --- a/indra/newview/llinventoryicon.h +++ b/indra/newview/llinventoryicon.h @@ -49,6 +49,7 @@ public: protected: static LLInventoryType::EIconName assignWearableIcon(U32 misc_flag); + static LLInventoryType::EIconName assignSettingsIcon(U32 misc_flag); }; #endif // LL_LLINVENTORYICON_H diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 90260ed6f..7e41b4bdd 100644 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -524,88 +524,31 @@ asset_type_to_category(const LLViewerAssetType::EType at, bool with_http, bool i // - gestures // - everything else. // - llassert_always(50 == LLViewerAssetType::AT_COUNT); // Multiple asset definitions are floating around so this requires some // maintenance and attention. - static const LLViewerAssetStats::EViewerAssetCategories asset_to_bin_map[LLViewerAssetType::AT_COUNT] = - { - LLViewerAssetStats::EVACTextureTempHTTPGet, // (0) AT_TEXTURE - LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND - LLViewerAssetStats::EVACOtherGet, // AT_CALLINGCARD - LLViewerAssetStats::EVACOtherGet, // AT_LANDMARK - LLViewerAssetStats::EVACOtherGet, // AT_SCRIPT - LLViewerAssetStats::EVACWearableUDPGet, // AT_CLOTHING - LLViewerAssetStats::EVACOtherGet, // AT_OBJECT - LLViewerAssetStats::EVACOtherGet, // AT_NOTECARD - LLViewerAssetStats::EVACOtherGet, // AT_CATEGORY - LLViewerAssetStats::EVACOtherGet, // AT_ROOT_CATEGORY - LLViewerAssetStats::EVACOtherGet, // (10) AT_LSL_TEXT - LLViewerAssetStats::EVACOtherGet, // AT_LSL_BYTECODE - LLViewerAssetStats::EVACOtherGet, // AT_TEXTURE_TGA - LLViewerAssetStats::EVACWearableUDPGet, // AT_BODYPART - LLViewerAssetStats::EVACOtherGet, // AT_TRASH - LLViewerAssetStats::EVACOtherGet, // AT_SNAPSHOT_CATEGORY - LLViewerAssetStats::EVACOtherGet, // AT_LOST_AND_FOUND - LLViewerAssetStats::EVACSoundUDPGet, // AT_SOUND_WAV - LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_TGA - LLViewerAssetStats::EVACOtherGet, // AT_IMAGE_JPEG - LLViewerAssetStats::EVACGestureUDPGet, // (20) AT_ANIMATION - LLViewerAssetStats::EVACGestureUDPGet, // AT_GESTURE - LLViewerAssetStats::EVACOtherGet, // AT_SIMSTATE - LLViewerAssetStats::EVACOtherGet, // AT_FAVORITE - LLViewerAssetStats::EVACOtherGet, // AT_LINK - LLViewerAssetStats::EVACOtherGet, // AT_LINK_FOLDER - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // (30) - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // (40) - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // - LLViewerAssetStats::EVACOtherGet, // AT_MESH - // (50) - }; - - if (at < 0 || at >= LLViewerAssetType::AT_COUNT) + switch (at) { + case LLAssetType::AT_TEXTURE: + return is_temp ? with_http ? LLViewerAssetStats::EVACTextureTempHTTPGet : LLViewerAssetStats::EVACTextureTempUDPGet + : with_http ? LLViewerAssetStats::EVACTextureTempHTTPGet : LLViewerAssetStats::EVACTextureNonTempUDPGet; + break; + case LLAssetType::AT_SOUND: + case LLAssetType::AT_SOUND_WAV: + return LLViewerAssetStats::EVACSoundUDPGet; + break; + case LLAssetType::AT_CLOTHING: + case LLAssetType::AT_BODYPART: + return LLViewerAssetStats::EVACWearableUDPGet; + break; + case LLAssetType::AT_ANIMATION: + case LLAssetType::AT_GESTURE: + return LLViewerAssetStats::EVACGestureUDPGet; + break; + case LLAssetType::AT_LANDMARK: + default: return LLViewerAssetStats::EVACOtherGet; + break; } - LLViewerAssetStats::EViewerAssetCategories ret(asset_to_bin_map[at]); - if (LLViewerAssetStats::EVACTextureTempHTTPGet == ret) - { - // Indexed with [is_temp][with_http] - static const LLViewerAssetStats::EViewerAssetCategories texture_bin_map[2][2] = - { - { - LLViewerAssetStats::EVACTextureNonTempUDPGet, - LLViewerAssetStats::EVACTextureNonTempHTTPGet, - }, - { - LLViewerAssetStats::EVACTextureTempUDPGet, - LLViewerAssetStats::EVACTextureTempHTTPGet, - } - }; - - ret = texture_bin_map[is_temp][with_http]; - } - return ret; } - } // anonymous namespace diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp index 3eee60882..b98767b1b 100644 --- a/indra/newview/llviewerassettype.cpp +++ b/indra/newview/llviewerassettype.cpp @@ -88,7 +88,10 @@ LLViewerAssetDictionary::LLViewerAssetDictionary() addEntry(LLViewerAssetType::AT_MESH, new ViewerAssetEntry(DAD_MESH)); + addEntry(LLViewerAssetType::AT_UNKNOWN, new ViewerAssetEntry(DAD_NONE)); + addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE)); + addEntry(LLViewerAssetType::AT_SETTINGS, new ViewerAssetEntry(DAD_NONE)); }; EDragAndDropType LLViewerAssetType::lookupDragAndDropType(EType asset_type) diff --git a/indra/newview/skins/default/textures/Inv_Settings.png b/indra/newview/skins/default/textures/Inv_Settings.png new file mode 100644 index 0000000000000000000000000000000000000000..c43ba349c486e32db0ff2ec222c665a72b0d0674 GIT binary patch literal 925 zcmV;O17iG%P){0OnIuy|=$p+QY-l#zy-q%q2`&6_vB z)ckn8Hsi3R1Rx+)<(YO^?b|e&4^XE*i59sHhPhHcTrg zJT4qu$(f3`gD01OJde6beJnFGExtoWJ2oK#_|cePj8S~_F(lSU5B>DYj56`weEcL?i8aKUtYWc5 zf+RV*MO~KcG4XNHW71Qss`~$}s~sQcFJ!OxL)DYxymdnL7JP3y&gY@yd>?`P5iT;N z`0N1;zKgzD(meanxDIERB`vZ8=Nr)WVCt5hm)tU3@i@GmK*JogTtn?bp=QN(j_)D7 zCQo$*yL<9gWPju04-GVDy>nq^#{d8T32;bRa{vGi!~g&e!~vBn4jTXf0m4Z{K~y-6 zrIJlZR8bg)pL@^fFs)2%%E3qov{JG`F&83(p|%Lb7IuUd8HkHCkjRCB3?d2=4rU-U zV4L8cVnhlN#<<%EgG6SUgf>Fiom}J~NmSgKHYwBfZ=!eio$tI44~GN)87+HIN`(RM zK6lrplwJD*lu~zrGQcaPTy%hIQ>oO?WHR|R7z}p*1yD*o1d0Jyj@CBtSxVUhp#NhT zK-jij0<>%ccFIom>}2nR5E@Xu4ahl$VfYQh@c$V#$U!|8iyezbqo;J2XsC*e6od-v zzFU@c9(a4GK|CHW`qFf^*3(?=>spKy=t9t8KK8g9FO*)N4-WwD0}V{mJmJko;~&Z zBcmq)$Ygll(8-UDO^y^7apmPB0MfRN4p`}Q+I9ju+OI8zj$YhKF0X*5QQp~#$6HAG zjaC3Yy{0OnIuy|=$p+QY-l#zy-q%q2`&6_vB z)ckn8Hsi3R1Rx+)<(YO^?b|e&4^XE*i59sHhPhHcTrg zJT4qu$(f3`gD01OJde6beJnFGExtoWJ2oK#_|cePj8S~_F(lSU5B>DYj56`weEcL?i8aKUtYWc5 zf+RV*MO~KcG4XNHW71Qss`~$}s~sQcFJ!OxL)DYxymdnL7JP3y&gY@yd>?`P5iT;N z`0N1;zKgzD(meanxDIERB`vZ8=Nr)WVCt5hm)tU3@i@GmK*JogTtn?bp=QN(j_)D7 zCQo$*yL<9gWPju04-GVDy>nq^#{d8T32;bRa{vGi!~g&e!~vBn4jTXf0m4Z{K~y-6 z#ge~k6hRb#zxQSqgF6A;y=_!3XcAFOX=5W25sy@MmV&8MX(yPou(PqTO6=2F`d9cT z1U;0%lKbi1u6V+;m|G3pACL#b3~y$>;eGSqyhGg64@NbDdWckGsK>}`0KaGd4(;td z-|^)C?UtvI0!iwS`b=TDB$8H z5Tz{p?Cd;1M3w-KhcCLK4n#ndxK;$fc@SmNKc(~dK5J`NDa!%#`5!hnuQQ!iIO)9V zA{yz=gBcA_L_wAEbj0_s-?(%82HV^BSYK~*eB9&Yq(pdMo77{dhER`?Y6$fNnf0Nb zKs7+B5mci%pOFjTNmelDdy_2BHxV+?4J{Hzv}Y*LM%jKyqk)C|&%_YJr6!f?b0D`Dm5FJmdMbj~s68 zBA*Sy6mcF?4^3~Vi#c(KdJr&mcz`S!aJaS0lP{lQVHX0XjTaX$i(B|n%te5xj}Dr6 zck3nA5%xFUK(Z1WEEKW!roqw-(j1yH&OQDD7NC~4P%M1K00000NkvXXu0mjfx=gEj literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/Inv_SettingsSky.png b/indra/newview/skins/default/textures/Inv_SettingsSky.png new file mode 100644 index 0000000000000000000000000000000000000000..77858b23c312ab5aae88888672a34d967ffbb62c GIT binary patch literal 883 zcmV-(1C0EMP){0OnIuy|=$p+QY-l#zy-q%q2`&6_vB z)ckn8Hsi3R1Rx+)<(YO^?b|e&4^XE*i59sHhPhHcTrg zJT4qu$(f3`gD01OJde6beJnFGExtoWJ2oK#_|cePj8S~_F(lSU5B>DYj56`weEcL?i8aKUtYWc5 zf+RV*MO~KcG4XNHW71Qss`~$}s~sQcFJ!OxL)DYxymdnL7JP3y&gY@yd>?`P5iT;N z`0N1;zKgzD(meanxDIERB`vZ8=Nr)WVCt5hm)tU3@i@GmK*JogTtn?bp=QN(j_)D7 zCQo$*yL<9gWPju04-GVDy>nq^#{d8T32;bRa{vGi!~g&e!~vBn4jTXf0hmcdK~y-6 z)soGM6HyR_zq(boyVL1RCJl}<4w48mh~UD_z`VdLd=T+Pd?nqw^$Ao&QNf>y=_Z*l zll0$p(UEcEP7n_ibrw~eqRxT;9>UWXAx;v47*!WQJ*a_t4n_(0Z>78~8;-^?@0LPY z0TzKXaEj&mm?vissoIX$UoQ}Gy!yD}eBDqs{ZKYg(j;PLN;%(&I0f}sgU8firaYSF zfG|7Qo#!Nk!qZT8LgqtaRyX>E6_=L_W z%UYl_5CwIh3Kp@(*rMc_^8E^qGMJ9w{0h1N4vWCYUPt! literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/Inv_SettingsWater.png b/indra/newview/skins/default/textures/Inv_SettingsWater.png new file mode 100644 index 0000000000000000000000000000000000000000..46fb58c3f24add810048393a5abb95eed712ee15 GIT binary patch literal 764 zcmV{0OnIuy|=$p+QY-l#zy-q%q2`&6_vB z)ckn8Hsi3R1Rx+)<(YO^?b|e&4^XE*i59sHhPhHcTrg zJT4qu$(f3`gD01OJde6beJnFGExtoWJ2oK#_|cePj8S~_F(lSU5B>DYj56`weEcL?i8aKUtYWc5 zf+RV*MO~KcG4XNHW71Qss`~$}s~sQcFJ!OxL)DYxymdnL7JP3y&gY@yd>?`P5iT;N z`0N1;zKgzD(meanxDIERB`vZ8=Nr)WVCt5hm)tU3@i@GmK*JogTtn?bp=QN(j_)D7 zCQo$*yL<9gWPju04-GVDy>nq^#{d8T32;bRa{vGi!~g&e!~vBn4jTXf0U=35K~y-6 z#geZ}Ls1xppR-K`LFaIC(L0b~P=*>TcC8jQ8pMA<5NwKJSj6OyAZQeeE}D#M3nGRi zh_JGxLD04<_qANc-Q{|)h+jG9JiOm?z5@sTw5(P+*S;%a9L)p36W4eYD6?r=X|aq$ zz6bcU$q{h-Qz%_vH4SWa&Tq_etc~9ZtbE`G$ae8pE;!V(TVOQ?)Pczk8;sU3GQ3mc zNQ1bLJ$s2Bl_ zW*dgGaOFdf0SZ8WtYef1*Avb@LRe`*AUN?NT8d3mqKdPus#pmtO}$9ov&5amrNpCl ulkxPgY_$Mv19LzK+ye(xOx=C^f7CY)+fx87^wLiN0000|qj zUdZK(S~%!;EkqYxwr6Z~BYwd}ou0T_(@VKIC zMd2yo&{|P7d0V(k$;1-Er^0ScE+~9!>hUVSn4GTim&sZr8~}?`*p;s1cpWPlEhj85 zr!SXXRetYdzQmr)&(BHh74JbOOb|aVrkNzb2t$m?Jc0)wgR-JQzV|18hJxfOGOLu( zSRqY@B5qMvrFv3gO7x_REG4u5fBUMZhJDrQc0aT{8OB>b*tVcjHjK|h!>AmA^${-e zwfw>XjJ}Iru4#Sy;Mjn(%bFJ7f%8r1eo$jt>_@VSTT&@_J%NrWbY4T-QnhEl`yAgx zWL>`M3U>EkK+ZdszX3vQXVnq^QB42<010qNS#tmY3ljhU3ljkVnw%H_00KNoL_t(I zjfIn6Xi`xe$A9PC+wBf-X{|Q@wCk)8!OB0F&_gZAC?b08A!3c9Jr(q@f~|rOeHk&JIAk-d|Wf=!2#xEUT zdpGFP6U5R8vLZp@UzXI#p*s(pPUmtfh;q4H4vynEmSq6|;K}&d6@UNR!7~TeDANvt zIi`V~dIeoDm-JK9ky8fG*;g8kM$YH+Y&aa&Q9hsVpdbh!NfI;~4Z1rPcyxNdOl2jC zT%EDcPS?Dzi$A^}IcAcnLwix}&ayQoZ++wjT{TBcL zP$(3%*9@PB?0X4bSjOb~hrTK6(G$@A%{wru=A+d%H=ZFn zCz%yO2)5ZwFWnt{9d95A!oI~}d3$+8W~$Yyv6Bx2KoZuwYKs&_p;)>B6aqj9$tqb9 z0FupF2nK^&S~`=-^v=#i&X*+-8TtM%*mh7NkpQ*erv3uNRO_f) SXw2mR0000 + + + + + From 96306321202f3aa5f8f5638ecd93a4a0f04b8f3a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 20:17:33 -0500 Subject: [PATCH 86/90] Enable wearable export --- indra/newview/llfloatercustomize.cpp | 2 -- indra/newview/llviewerwearable.cpp | 7 ++++--- indra/newview/llviewerwearable.h | 4 +--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatercustomize.cpp b/indra/newview/llfloatercustomize.cpp index ac33926bc..63aa904dd 100644 --- a/indra/newview/llfloatercustomize.cpp +++ b/indra/newview/llfloatercustomize.cpp @@ -503,7 +503,6 @@ void LLFloaterCustomize::onBtnExport() //static void LLFloaterCustomize::onBtnExport_continued(LLViewerWearable* edit_wearable, AIFilePicker* filepicker) { -#if 0 if (!filepicker->hasFilename()) { // User canceled export. @@ -529,7 +528,6 @@ void LLFloaterCustomize::onBtnExport_continued(LLViewerWearable* edit_wearable, { AIAlert::add_modal("AIXMLExportSuccess", AIArgs("[FILE]", filename)); } -#endif } void LLFloaterCustomize::onBtnOk() diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 6b9c37586..da7aa4794 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -42,6 +42,7 @@ #include "llinventoryfunctions.h" #include "lllocaltextureobject.h" #include "llpaneleditwearable.h" +#include "aixmllindengenepool.h" using namespace LLAvatarAppearanceDefines; @@ -135,8 +136,8 @@ LLWearable::EImportResult LLViewerWearable::importStream( std::istream& input_st return result; } -#if 0 -AIArchetype LLViewerWearable::getArchetype(void) const + +AIArchetype LLViewerWearable::getArchetype() const { AIArchetype archetype(this); for (visual_param_index_map_t::const_iterator iter = mVisualParamIndexMap.begin(); iter != mVisualParamIndexMap.end(); ++iter) @@ -149,7 +150,7 @@ AIArchetype LLViewerWearable::getArchetype(void) const } return archetype; } -#endif + // Avatar parameter and texture definitions can change over time. // This function returns true if parameters or textures have been added or removed // since this wearable was created. diff --git a/indra/newview/llviewerwearable.h b/indra/newview/llviewerwearable.h index 245753865..94f70fefa 100644 --- a/indra/newview/llviewerwearable.h +++ b/indra/newview/llviewerwearable.h @@ -68,9 +68,7 @@ public: /*virtual*/ EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp ); // Singu extension. -#if 0 - AIArchetype getArchetype(void) const; -#endif + class AIArchetype getArchetype() const; void setParamsToDefaults(); void setTexturesToDefaults(); From 1850cd159db34ee4f36a60ec713e6b93c46c7b77 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 20:23:21 -0500 Subject: [PATCH 87/90] My inventory patch everyone's been testing I'm still wary, but let's toss it into our release, shall we? This changes the maps in inventorymodel to unordered maps. On the surface this seems like a good thing, definitely is for inventory loading. It seemed a lot snappier to literally everyone before the HTTP Asset patch rolled out, so that's good. Thanks to Router, Bitten, Gooz, Deltek, Damian, Melaniecosti, Torric, and anyone else I might be forgetting at the moment who tested this for me! --- indra/newview/llinventorymodel.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index b64881f83..915dbc296 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -27,7 +27,7 @@ #ifndef LL_LLINVENTORYMODEL_H #define LL_LLINVENTORYMODEL_H -#include +#include #include #include #include @@ -154,13 +154,13 @@ private: // the inventory using several different identifiers. // mInventory member data is the 'master' list of inventory, and // mCategoryMap and mItemMap store uuid->object mappings. - typedef std::map > cat_map_t; - typedef std::map > item_map_t; + typedef std::unordered_map > cat_map_t; + typedef std::unordered_map > item_map_t; cat_map_t mCategoryMap; item_map_t mItemMap; // This last set of indices is used to map parents to children. - typedef std::map parent_cat_map_t; - typedef std::map parent_item_map_t; + typedef std::unordered_map parent_cat_map_t; + typedef std::unordered_map parent_item_map_t; parent_cat_map_t mParentChildCategoryTree; parent_item_map_t mParentChildItemTree; @@ -467,7 +467,7 @@ public: LLInitializedS32& operator++() { ++mValue; return *this; } LLInitializedS32& operator--() { --mValue; return *this; } }; - typedef std::map update_map_t; + typedef std::unordered_map update_map_t; // Call when there are category updates. Call them *before* the // actual update so the method can do descendent accounting correctly. @@ -592,8 +592,8 @@ protected: cat_array_t* getUnlockedCatArray(const LLUUID& id); item_array_t* getUnlockedItemArray(const LLUUID& id); private: - std::map mCategoryLock; - std::map mItemLock; + std::unordered_map mCategoryLock; + std::unordered_map mItemLock; //-------------------------------------------------------------------- // Debugging From 28b1ed82a5799d72138b3d6737a343f16f20caa1 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 21:13:04 -0500 Subject: [PATCH 88/90] Steam Hardware Survey says 100% SSE3 It's been over a decade since SSE3 came out Almost 95% of CPUs on Steam have support for SSE4.2 Therefore we are enabling optimizations for SSE3 but someone could easily make an SSE2 Build --- indra/cmake/00-Common.cmake | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index fbbf1446f..49ed82f62 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -107,7 +107,7 @@ if (WINDOWS) endif (USE_LTO) if (WORD_SIZE EQUAL 32) - add_compile_options(/arch:SSE2) + add_compile_options(/arch:SSE3) endif (WORD_SIZE EQUAL 32) if (NOT DISABLE_FATAL_WARNINGS) @@ -212,23 +212,23 @@ if (LINUX) if (NOT STANDALONE) set(MARCH_FLAG " -march=pentium4") endif (NOT STANDALONE) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse3 ${GCC_EXTRA_OPTIMIZATIONS}") endif (${ARCH} STREQUAL "x86_64") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse3") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse3") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse3") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse3") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") if (NOT STANDALONE) - set(MARCH_FLAG " -axsse4.1 -msse2") + set(MARCH_FLAG " -axsse4.1 -msse3") endif (NOT STANDALONE) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions") From 92fd0f56b47bb8af31eca964ad72a23237ce9255 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 21:51:44 -0500 Subject: [PATCH 89/90] In the modern era, if we don't recognize a GPU, give it full class 3 support and pray --- indra/newview/llfeaturemanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 42f46fb2e..096df5cde 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -421,6 +421,9 @@ void LLFeatureManager::parseGPUTable(std::string filename) else { LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL; + mGPUString = rawRenderer; + mGPUClass = EGPUClass::GPU_CLASS_3; + mGPUSupported = true; } } From c420751ffc26982fed5a7d1e1647785d3c4ab4c9 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Thu, 28 Feb 2019 21:57:52 -0500 Subject: [PATCH 90/90] Get these boost warnings out of our compile logs! --- indra/cmake/00-Common.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 49ed82f62..e9868cfea 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -84,6 +84,7 @@ if (WINDOWS) /DNOMINMAX /DUNICODE /D_UNICODE + /DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE /GS /TP /W3