From a777a0b27ed6adfa99d708e289e704915f2b62b7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 7 Mar 2023 21:51:14 +0200 Subject: SL-18629 WIP Replacing UDP creation messages with callback based AIS --- indra/newview/llviewermessage.cpp | 75 +++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 35 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 5266db5b38..767e092318 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5898,42 +5898,47 @@ void container_inventory_arrived(LLViewerObject* object, { // create a new inventory category to put this in LLUUID cat_id; - cat_id = gInventory.createNewCategory(gInventory.getRootFolderID(), - LLFolderType::FT_NONE, - LLTrans::getString("AcquiredItems")); + gInventory.createNewCategory( + gInventory.getRootFolderID(), + LLFolderType::FT_NONE, + LLTrans::getString("AcquiredItems"), + [inventory](const LLUUID &new_cat_id) + { + LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); + LLInventoryObject::object_list_t::const_iterator end = inventory->end(); + for (; it != end; ++it) + { + if ((*it)->getType() != LLAssetType::AT_CATEGORY) + { + LLInventoryObject* obj = (LLInventoryObject*)(*it); + LLInventoryItem* item = (LLInventoryItem*)(obj); + LLUUID item_id; + item_id.generate(); + time_t creation_date_utc = time_corrected(); + LLPointer new_item + = new LLViewerInventoryItem(item_id, + new_cat_id, + item->getPermissions(), + item->getAssetUUID(), + item->getType(), + item->getInventoryType(), + item->getName(), + item->getDescription(), + LLSaleInfo::DEFAULT, + item->getFlags(), + creation_date_utc); + new_item->updateServer(TRUE); + gInventory.updateItem(new_item); + } + } + gInventory.notifyObservers(); - LLInventoryObject::object_list_t::const_iterator it = inventory->begin(); - LLInventoryObject::object_list_t::const_iterator end = inventory->end(); - for ( ; it != end; ++it) - { - if ((*it)->getType() != LLAssetType::AT_CATEGORY) - { - LLInventoryObject* obj = (LLInventoryObject*)(*it); - LLInventoryItem* item = (LLInventoryItem*)(obj); - LLUUID item_id; - item_id.generate(); - time_t creation_date_utc = time_corrected(); - LLPointer new_item - = new LLViewerInventoryItem(item_id, - cat_id, - item->getPermissions(), - item->getAssetUUID(), - item->getType(), - item->getInventoryType(), - item->getName(), - item->getDescription(), - LLSaleInfo::DEFAULT, - item->getFlags(), - creation_date_utc); - new_item->updateServer(TRUE); - gInventory.updateItem(new_item); - } - } - gInventory.notifyObservers(); - if(active_panel) - { - active_panel->setSelection(cat_id, TAKE_FOCUS_NO); - } + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) + { + active_panel->setSelection(new_cat_id, TAKE_FOCUS_NO); + } + }); } else if (inventory->size() == 2) { -- cgit v1.3 From eaccee37f2875c4d2378cf0ce562f382b88487d7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 15 Apr 2023 02:23:38 +0300 Subject: SL-19549 Add option to show ban lines on collision --- indra/newview/app_settings/settings.xml | 4 +-- indra/newview/llglsandbox.cpp | 6 ++++ indra/newview/llviewermenu.cpp | 21 ++++++++++++++ indra/newview/llviewermessage.cpp | 6 ++++ indra/newview/llviewerparcelmgr.cpp | 24 ++++++++++++---- indra/newview/llviewerparcelmgr.h | 3 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 32 ++++++++++++++++++---- 7 files changed, 82 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index deeca494c3..5b465864cc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11316,11 +11316,11 @@ ShowBanLines Comment - Show in-world ban/access borders + Show in-world ban/access borders, 0 - do not show, 1 - show on collision, 2 - show on proximity Persist 1 Type - Boolean + S32 Value 1 diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 175f1849cf..25e9ade7df 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -741,6 +741,12 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV gGL.end(); } +void LLViewerParcelMgr::resetCollisionTimer() +{ + mCollisionTimer.reset(); + mRenderCollision = TRUE; +} + void draw_line_cube(F32 width, const LLVector3& center) { width = 0.5f * width; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a0223a5dbb..111e70bfe9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9060,6 +9060,25 @@ class LLWorldPostProcess : public view_listener_t } }; +class LLWorldCheckBanLines : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 callback_data = userdata.asInteger(); + return gSavedSettings.getS32("ShowBanLines") == callback_data; + } +}; + +class LLWorldShowBanLines : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 callback_data = userdata.asInteger(); + gSavedSettings.setS32("ShowBanLines", callback_data); + return true; + } +}; + void handle_flush_name_caches() { if (gCacheName) gCacheName->clear(); @@ -9349,6 +9368,8 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); + view_listener_t::addMenu(new LLWorldCheckBanLines() , "World.CheckBanLines"); + view_listener_t::addMenu(new LLWorldShowBanLines() , "World.ShowBanLines"); // Tools menu view_listener_t::addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c1a9b6be80..a535433b5b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5151,6 +5151,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LandBuyAccessBlocked_AdultsOnlyContent -----------------------------------------------------------------------*/ + LLViewerParcelMgr::getInstance()->resetCollisionTimer(); if (handle_special_notification(notificationID, llsdBlock)) { return true; @@ -5319,6 +5320,11 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) { BOOL modal = FALSE; process_alert_core(message, modal); + + if (message.find("Cannot enter parcel") != std::string::npos) + { + LLViewerParcelMgr::getInstance()->resetCollisionTimer(); + } } } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 97dc916bfe..bb68278555 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -72,7 +72,11 @@ #include "llenvironment.h" -const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; +const F32 PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION = 10.f; +const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; +const S32 PARCEL_BAN_LINES_HIDE = 0; +const S32 PARCEL_BAN_LINES_ON_COLLISION = 1; +const S32 PARCEL_BAN_LINES_ON_PROXIMITY = 2; // Globals @@ -892,13 +896,18 @@ void LLViewerParcelMgr::render() void LLViewerParcelMgr::renderParcelCollision() { + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + // check for expiration - if (mCollisionTimer.getElapsedTimeF32() > PARCEL_COLLISION_DRAW_SECS) + F32 expiration = (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + ? PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY + : PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION; + if (mCollisionTimer.getElapsedTimeF32() > expiration) { - mRenderCollision = FALSE; + mRenderCollision = false; } - if (mRenderCollision && gSavedSettings.getBOOL("ShowBanLines")) + if (mRenderCollision && ban_lines_mode != PARCEL_BAN_LINES_HIDE) { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -1842,8 +1851,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - parcel_mgr.mRenderCollision = TRUE; - parcel_mgr.mCollisionTimer.reset(); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + if (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) + { + parcel_mgr.resetCollisionTimer(); + } // Differentiate this parcel if we are banned from it. if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 6ce389ab88..d45ff674af 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -204,6 +204,7 @@ public: void renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 height, U8 direction, LLViewerRegion* regionp); void renderHighlightSegments(const U8* segments, LLViewerRegion* regionp); void renderCollisionSegments(U8* segments, BOOL use_pass, LLViewerRegion* regionp); + void resetCollisionTimer(); void sendParcelGodForceOwner(const LLUUID& owner_id); @@ -361,7 +362,7 @@ private: // If it's coming, draw the parcel's boundaries. LLParcel* mCollisionParcel; U8* mCollisionSegments; - BOOL mRenderCollision; + bool mRenderCollision; BOOL mRenderSelection; S32 mCollisionBanned; LLFrameTimer mCollisionTimer; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 58584345a9..64167a9a5d 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -794,14 +794,36 @@ name="LandShow" tear_off="true"> + label="Hide Ban Lines" + name="Hide Ban Lines"> + function="World.CheckBanLines" + parameter="0" /> + function="World.ShowBanLines" + parameter="0" /> + + + + + + + + + Date: Mon, 17 Apr 2023 15:31:22 +0300 Subject: SL-19549 Add option to show ban lines on collision #2 --- indra/newview/llviewermessage.cpp | 10 ++++++++-- indra/newview/llviewerparcelmgr.cpp | 10 +++++----- indra/newview/llviewerparcelmgr.h | 6 +++++- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a535433b5b..a60f11d97b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5151,7 +5151,11 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) LandBuyAccessBlocked_AdultsOnlyContent -----------------------------------------------------------------------*/ - LLViewerParcelMgr::getInstance()->resetCollisionTimer(); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION); + if (ban_lines_mode == LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION) + { + LLViewerParcelMgr::getInstance()->resetCollisionTimer(); + } if (handle_special_notification(notificationID, llsdBlock)) { return true; @@ -5321,7 +5325,9 @@ void process_alert_message(LLMessageSystem *msgsystem, void **user_data) BOOL modal = FALSE; process_alert_core(message, modal); - if (message.find("Cannot enter parcel") != std::string::npos) + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION); + if (ban_lines_mode == LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION + && message.find("Cannot enter parcel") != std::string::npos) { LLViewerParcelMgr::getInstance()->resetCollisionTimer(); } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index bb68278555..15accd0547 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -74,14 +74,14 @@ const F32 PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION = 10.f; const F32 PARCEL_COLLISION_DRAW_SECS_ON_PROXIMITY = 1.f; -const S32 PARCEL_BAN_LINES_HIDE = 0; -const S32 PARCEL_BAN_LINES_ON_COLLISION = 1; -const S32 PARCEL_BAN_LINES_ON_PROXIMITY = 2; // Globals U8* LLViewerParcelMgr::sPackedOverlay = NULL; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_HIDE = 0; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_COLLISION = 1; +S32 LLViewerParcelMgr::PARCEL_BAN_LINES_ON_PROXIMITY = 2; LLUUID gCurrentMovieID = LLUUID::null; @@ -896,7 +896,7 @@ void LLViewerParcelMgr::render() void LLViewerParcelMgr::renderParcelCollision() { - static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_ON_COLLISION); // check for expiration F32 expiration = (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) @@ -1851,7 +1851,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_DRAW_SECS_ON_COLLISION); + static LLCachedControl ban_lines_mode(gSavedSettings , "ShowBanLines" , PARCEL_BAN_LINES_ON_COLLISION); if (ban_lines_mode == PARCEL_BAN_LINES_ON_PROXIMITY) { parcel_mgr.resetCollisionTimer(); diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index d45ff674af..56dacd3efd 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -204,7 +204,11 @@ public: void renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 height, U8 direction, LLViewerRegion* regionp); void renderHighlightSegments(const U8* segments, LLViewerRegion* regionp); void renderCollisionSegments(U8* segments, BOOL use_pass, LLViewerRegion* regionp); - void resetCollisionTimer(); + + static S32 PARCEL_BAN_LINES_HIDE; + static S32 PARCEL_BAN_LINES_ON_COLLISION; + static S32 PARCEL_BAN_LINES_ON_PROXIMITY; + void resetCollisionTimer(); // Ban lines visibility timer void sendParcelGodForceOwner(const LLUUID& owner_id); -- cgit v1.3 From 4173cae02165e36d96638761f29bd6d00ac24ddc Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 11 May 2023 01:16:42 +0100 Subject: sl-19676 - more loading stats and 360 Interest List mode work --- indra/newview/app_settings/settings.xml | 11 ----- indra/newview/llagent.cpp | 76 +++++++++++++++++++----------- indra/newview/llagent.h | 5 ++ indra/newview/llfloater360capture.cpp | 66 +++++--------------------- indra/newview/llfloater360capture.h | 4 +- indra/newview/llviewermenu.cpp | 59 +++--------------------- indra/newview/llviewermessage.cpp | 36 ++++++++------- indra/newview/llviewerobjectlist.cpp | 12 ++--- indra/newview/llviewerregion.cpp | 82 ++++++++++++++++++++++++++++++++- indra/newview/llviewerregion.h | 18 ++++++++ indra/newview/llviewerstatsrecorder.cpp | 56 +++++++--------------- indra/newview/llviewerstatsrecorder.h | 28 +++++------ 12 files changed, 231 insertions(+), 222 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9f2d6f746d..775ddb0571 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16964,17 +16964,6 @@ Value 0 - 360CaptureUseInterestListCap - - Comment - Flag if set, uses the new InterestList cap to ask the simulator for full content - Persist - 1 - Type - Boolean - Value - 1 - 360CaptureJPEGEncodeQuality Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8cc9be7244..89d4df7caa 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -401,6 +401,7 @@ LLAgent::LLAgent() : mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mTeleportState(TELEPORT_NONE), mRegionp(NULL), + mUse360Mode(false), mAgentOriginGlobal(), mPositionGlobal(), @@ -894,11 +895,20 @@ boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_cal // static void LLAgent::capabilityReceivedCallback(const LLUUID ®ion_id, LLViewerRegion *regionp) -{ - if (regionp && regionp->getRegionID() == region_id) +{ // Changed regions and now have the region capabilities + if (regionp) { - regionp->requestSimulatorFeatures(); - LLAppViewer::instance()->updateNameLookupUrl(regionp); + if (regionp->getRegionID() == region_id) + { + regionp->requestSimulatorFeatures(); + LLAppViewer::instance()->updateNameLookupUrl(regionp); + } + + if (gAgent.getInterestList360Mode()) + { + const bool use_360_mode = true; + gAgent.changeInterestListMode(use_360_mode); + } } } @@ -2910,39 +2920,53 @@ void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferr handlePreferredMaturityResult(maturity); } - -bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) -{ - if (!getRegion()) +// Using a new capability, tell the simulator that we want it to send everything +// it knows about and not just what is in front of the camera, in its view +// frustum. We need this feature so that the contents of the region that appears +// in the 6 snapshots which we cannot see and is normally not "considered", is +// also rendered. Typically, this is turned on when the 360 capture floater is +// opened and turned off when it is closed. +// Note: for this version, we do not have a way to determine when "everything" +// has arrived and has been rendered so for now, the proposal is that users +// will need to experiment with the low resolution version and wait for some +// (hopefully) small period of time while the full contents resolves. +// Pass in a flag to ask the simulator/interest list to "send everything" or +// not (the default mode) +void LLAgent::changeInterestListMode(bool use_360_mode) +{ + mUse360Mode = use_360_mode; + + // Change interest list mode for all regions. If they are already set for the current mode, + // the setting will have no effect. + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); + ++iter) { - return false; + LLViewerRegion *regionp = *iter; + if (regionp && regionp->isAlive() && regionp->capabilitiesReceived()) + { + regionp->setInterestList360Mode(mUse360Mode); + } } - std::string url = getRegion()->getCapability(capName); +} - if (url.empty()) + +bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestPostCapability(capName, postData, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, mHttpPolicy, postData, cbSuccess, cbFailure); - return true; + return false; } bool LLAgent::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) { - std::string url; - - url = getRegionCapability(capName); - - if (url.empty()) + if (getRegion()) { - LL_WARNS("Agent") << "Could not retrieve region capability \"" << capName << "\"" << LL_ENDL; - return false; + return getRegion()->requestGetCapability(capName, cbSuccess, cbFailure); } - - LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, mHttpPolicy, cbSuccess, cbFailure); - return true; + return false; } BOOL LLAgent::getAdminOverride() const diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 498bea3c07..ef8df13fc6 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -294,9 +294,14 @@ public: boost::signals2::connection addRegionChangedCallback(const region_changed_signal_t::slot_type& cb); void removeRegionChangedCallback(boost::signals2::connection callback); + + void changeInterestListMode(bool use_360_mode); + bool getInterestList360Mode() const { return mUse360Mode; } + private: LLViewerRegion *mRegionp; region_changed_signal_t mRegionChangedSignal; + bool mUse360Mode; //-------------------------------------------------------------------- // History diff --git a/indra/newview/llfloater360capture.cpp b/indra/newview/llfloater360capture.cpp index 9c25cdbc7d..a0889abe2d 100644 --- a/indra/newview/llfloater360capture.cpp +++ b/indra/newview/llfloater360capture.cpp @@ -64,12 +64,11 @@ LLFloater360Capture::LLFloater360Capture(const LLSD& key) // such time as we ask it not to (the dtor). If we crash or // otherwise, exit before this is turned off, the Simulator // will take care of cleaning up for us. - if (gSavedSettings.getBOOL("360CaptureUseInterestListCap")) - { - // send everything to us for as long as this floater is open - const bool send_everything = true; - changeInterestListMode(send_everything); - } + mWasIn360Mode = gAgent.getInterestList360Mode(); + + // send everything to us for as long as this floater is open + const bool use_360_mode = true; + gAgent.changeInterestListMode(use_360_mode); } LLFloater360Capture::~LLFloater360Capture() @@ -81,13 +80,15 @@ LLFloater360Capture::~LLFloater360Capture() mWebBrowser->unloadMediaSource(); } - // Tell the Simulator not to send us everything anymore - // and revert to the regular "keyhole" frustum of interest + // Restore interest list mode to the state when started + // Normally LLFloater360Capture tells the Simulator send everything + // and now reverts to the regular "keyhole" frustum of interest // list updates. - if (!LLApp::isExiting() && gSavedSettings.getBOOL("360CaptureUseInterestListCap")) + if (!LLApp::isExiting() && + gSavedSettings.getBOOL("360CaptureUseInterestListCap") && + mWasIn360Mode != gAgent.getInterestList360Mode()) { - const bool send_everything = false; - changeInterestListMode(send_everything); + gAgent.changeInterestListMode(mWasIn360Mode); } } @@ -170,49 +171,6 @@ void LLFloater360Capture::onChooseQualityRadioGroup() setSourceImageSize(); } -// Using a new capability, tell the simulator that we want it to send everything -// it knows about and not just what is in front of the camera, in its view -// frustum. We need this feature so that the contents of the region that appears -// in the 6 snapshots which we cannot see and is normally not "considered", is -// also rendered. Typically, this is turned on when the 360 capture floater is -// opened and turned off when it is closed. -// Note: for this version, we do not have a way to determine when "everything" -// has arrived and has been rendered so for now, the proposal is that users -// will need to experiment with the low resolution version and wait for some -// (hopefully) small period of time while the full contents resolves. -// Pass in a flag to ask the simulator/interest list to "send everything" or -// not (the default mode) -void LLFloater360Capture::changeInterestListMode(bool send_everything) -{ - LLSD body; - - if (send_everything) - { - body["mode"] = LLSD::String("360"); - } - else - { - body["mode"] = LLSD::String("default"); - } - - if (gAgent.requestPostCapability("InterestList", body, [](const LLSD & response) - { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" << - ll_pretty_print_sd(response) << - LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to post an InterestList capability request with payload: \n" << - ll_pretty_print_sd(body) << - LL_ENDL; - } -} // There is is a setting (360CaptureSourceImageSize) that holds the size // (width == height since it's a square) of each of the 6 source snapshots. diff --git a/indra/newview/llfloater360capture.h b/indra/newview/llfloater360capture.h index 8f765c0b1b..61316c65f3 100644 --- a/indra/newview/llfloater360capture.h +++ b/indra/newview/llfloater360capture.h @@ -50,8 +50,6 @@ class LLFloater360Capture: void onOpen(const LLSD& key) override; void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; - void changeInterestListMode(bool send_everything); - const std::string getHTMLBaseFolder(); void capture360Images(); @@ -93,6 +91,8 @@ class LLFloater360Capture: std::string mImageSaveDir; LLPointer mRawImages[6]; + + bool mWasIn360Mode; }; #endif // LL_FLOATER_360CAPTURE_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d1b240d2c4..23abd0fe16 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1301,65 +1301,18 @@ class LLAdvancedToggleInterestList360Mode : public view_listener_t public: bool handleEvent(const LLSD &userdata) { - LLSD request; - LLSD body; - - // First do a GET to report on current mode and update stats - if (gAgent.requestGetCapability("InterestList", - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability GET responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successful GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - else - { - LL_WARNS("360Capture") << "Unable to GET InterestList capability request with return body: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - } - - // Now do a POST to change the mode - if (sUsing360) - { - body["mode"] = LLSD::String("default"); - } - else - { - body["mode"] = LLSD::String("360"); - } - sUsing360 = !sUsing360; - LL_INFOS("360Capture") << "Setting InterestList capability mode to " << body["mode"].asString() << LL_ENDL; - - if (gAgent.requestPostCapability("InterestList", body, - [](const LLSD &response) { - LL_DEBUGS("360Capture") << "InterestList capability responded: \n" - << ll_pretty_print_sd(response) << LL_ENDL; - })) - { - LL_DEBUGS("360Capture") << "Successfully posted an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return true; - } - else - { - LL_DEBUGS("360Capture") << "Unable to post an InterestList capability request with payload: \n" - << ll_pretty_print_sd(body) << LL_ENDL; - return false; - } - }; - - static bool sUsing360; + // Toggle the mode - regions will get updated + bool new_mode = !gAgent.getInterestList360Mode(); + gAgent.changeInterestListMode(new_mode); + return true; + } }; -bool LLAdvancedToggleInterestList360Mode::sUsing360 = false; - class LLAdvancedCheckInterestList360Mode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return LLAdvancedToggleInterestList360Mode::sUsing360; + return gAgent.getInterestList360Mode(); } }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a60f11d97b..ef83fa161b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -99,6 +99,7 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerstats.h" +#include "llviewerstatsrecorder.h" #include "llviewertexteditor.h" #include "llviewerthrottle.h" #include "llviewerwindow.h" @@ -3759,31 +3760,34 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) continue; } - LLViewerObject *objectp = gObjectList.findObject(id); - if (objectp) + LLViewerObject *objectp = gObjectList.findObject(id); + if (objectp) + { + // Display green bubble on kill + if ( gShowObjectUpdates ) { - // Display green bubble on kill - if ( gShowObjectUpdates ) - { - LLColor4 color(0.f,1.f,0.f,1.f); - gPipeline.addDebugBlip(objectp->getPositionAgent(), color); - LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; - } - - // Do the kill - gObjectList.killObject(objectp); + LLColor4 color(0.f,1.f,0.f,1.f); + gPipeline.addDebugBlip(objectp->getPositionAgent(), color); + LL_DEBUGS("MessageBlip") << "Kill blip for local " << local_id << " at " << objectp->getPositionAgent() << LL_ENDL; } - if(delete_object) - { - regionp->killCacheEntry(local_id); + // Do the kill + gObjectList.killObject(objectp); + } + + if(delete_object) + { + regionp->killCacheEntry(local_id); } // We should remove the object from selection after it is marked dead by gObjectList to make LLToolGrab, // which is using the object, release the mouse capture correctly when the object dies. // See LLToolGrab::handleHoverActive() and LLToolGrab::handleHoverNonPhysical(). LLSelectMgr::getInstance()->removeObjectFromSelections(id); - } + + } // end for loop + + LLViewerStatsRecorder::instance().recordObjectKills(num_objects); } void process_time_synch(LLMessageSystem *mesgsys, void **user_data) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 0c9e929cf3..5f0e331baa 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -369,7 +369,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(0); + recorder.objectUpdateFailure(); return NULL; } justCreated = true; @@ -501,7 +501,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, << " Flags: " << flags << " Region: " << regionp->getName() << " Region id: " << regionp->getRegionID() << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0) @@ -612,7 +612,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type == OUT_TERSE_IMPROVED) { // LL_INFOS() << "terse update for an unknown object (compressed):" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } } @@ -621,7 +621,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type != OUT_FULL) { //LL_INFOS() << "terse update for an unknown object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } @@ -634,7 +634,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, { mNumDeadObjectUpdates++; //LL_INFOS() << "update for a dead object:" << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } #endif @@ -647,7 +647,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (!objectp) { LL_INFOS() << "createObject failure for object: " << fullid << LL_ENDL; - recorder.objectUpdateFailure(msg_size); + recorder.objectUpdateFailure(); continue; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 54d787366f..7abd77505d 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -646,7 +646,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mInvisibilityCheckHistory(-1), mPaused(FALSE), mRegionCacheHitCount(0), - mRegionCacheMissCount(0) + mRegionCacheMissCount(0), + mUse360Mode(false) { mWidth = region_width_meters; mImpl->mOriginGlobal = from_region_handle(handle); @@ -3283,6 +3284,9 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) // This is a single-shot signal. Forget callbacks to save resources. mCapabilitiesReceivedSignal.disconnect_all_slots(); + + // Set the region to the desired interest list mode + setInterestList360Mode(gAgent.getInterestList360Mode()); } } @@ -3301,6 +3305,82 @@ void LLViewerRegion::logActiveCapabilities() const log_capabilities(mImpl->mCapabilities); } + +bool LLViewerRegion::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " POST capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, gAgent.getAgentPolicy(), postData, cbSuccess, cbFailure); + return true; +} + +bool LLViewerRegion::requestGetCapability(const std::string &capName, httpCallback_t cbSuccess, httpCallback_t cbFailure) +{ + std::string url; + + url = getCapability(capName); + + if (url.empty()) + { + LL_WARNS("Region") << "Could not retrieve region " << getRegionID() + << " GET capability \"" << capName << "\"" << LL_ENDL; + return false; + } + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(url, gAgent.getAgentPolicy(), cbSuccess, cbFailure); + return true; +} + + +void LLViewerRegion::setInterestList360Mode(bool use_360_mode) +{ + if (use_360_mode != mUse360Mode) + { + LLSD body; + mUse360Mode = use_360_mode; + + if (mUse360Mode) + { + body["mode"] = LLSD::String("360"); + } + else + { + body["mode"] = LLSD::String("default"); + } + + if (requestPostCapability("InterestList", body, + [](const LLSD &response) { + LL_DEBUGS("360Capture") << "InterestList capability responded: \n" + << ll_pretty_print_sd(response) << LL_ENDL; + })) + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() + << " Successfully posted an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + else + { + LL_WARNS("360Capture") << "Region " << getRegionID() + << " Unable to post an InterestList capability request with payload: \n" + << ll_pretty_print_sd(body) << LL_ENDL; + } + } + else + { + LL_DEBUGS("360Capture") << "Region " << getRegionID() << "No change, skipping Interest List mode POST to " + << (use_360_mode ? "360" : "default") << " mode" << LL_ENDL; + } +} + + + LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) { if (type < mImpl->mObjectPartition.size() && type < PARTITION_VO_CACHE) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 81371b7f30..3da0c376d3 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -32,6 +32,7 @@ #include #include +#include "llcorehttputil.h" #include "llwind.h" #include "v3dmath.h" #include "llstring.h" @@ -278,6 +279,15 @@ public: static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; + // Utilities to post and get via + // HTTP using the agent's policy settings and headers. + typedef LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t httpCallback_t; + bool requestPostCapability(const std::string &capName, + LLSD &postData, + httpCallback_t cbSuccess = NULL, + httpCallback_t cbFailure = NULL); + bool requestGetCapability(const std::string &capName, httpCallback_t cbSuccess = NULL, httpCallback_t cbFailure = NULL); + /// implements LLCapabilityProvider /*virtual*/ const LLHost& getHost() const; const U64 &getHandle() const { return mHandle; } @@ -477,6 +487,11 @@ public: }; typedef std::set region_priority_list_t; + void setInterestList360Mode(bool use_360_mode); + bool getInterestList360Mode() const { return mUse360Mode; } + + + private: static S32 sNewObjectCreationThrottle; LLViewerRegionImpl * mImpl; @@ -574,6 +589,9 @@ private: LLFrameTimer mMaterialsCapThrottleTimer; LLFrameTimer mRenderInfoRequestTimer; LLFrameTimer mRenderInfoReportTimer; + + // how the server interest list works + bool mUse360Mode; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp index f95a960186..6372679a07 100644 --- a/indra/newview/llviewerstatsrecorder.cpp +++ b/indra/newview/llviewerstatsrecorder.cpp @@ -73,15 +73,14 @@ void LLViewerStatsRecorder::clearStats() mObjectFullUpdates = 0; mObjectTerseUpdates = 0; mObjectCacheMissRequests = 0; - mObjectCacheMissResponses = 0; mObjectCacheUpdateDupes = 0; mObjectCacheUpdateChanges = 0; mObjectCacheUpdateAdds = 0; mObjectCacheUpdateReplacements = 0; mObjectUpdateFailures = 0; - mObjectUpdateFailuresSize = 0; mTextureFetchCount = 0; mMeshLoadedCount = 0; + mObjectKills = 0; } @@ -100,12 +99,6 @@ void LLViewerStatsRecorder::enableObjectStatsRecording(bool enable, bool logging -void LLViewerStatsRecorder::recordObjectUpdateFailure(S32 msg_size) -{ - mObjectUpdateFailures++; - mObjectUpdateFailuresSize += msg_size; -} - void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) { if (LLViewerRegion::CACHE_MISS_TYPE_TOTAL == cache_miss_type) @@ -119,24 +112,17 @@ void LLViewerStatsRecorder::recordCacheMissEvent(U8 cache_miss_type) } -void LLViewerStatsRecorder::recordCacheHitEvent() -{ - mObjectCacheHitCount++; -} - void LLViewerStatsRecorder::recordObjectUpdateEvent(const EObjectUpdateType update_type) { switch (update_type) { case OUT_FULL: - mObjectFullUpdates++; + case OUT_FULL_COMPRESSED: + mObjectFullUpdates++; break; case OUT_TERSE_IMPROVED: mObjectTerseUpdates++; break; - case OUT_FULL_COMPRESSED: - mObjectCacheMissResponses++; - break; default: LL_WARNS() << "Unknown update_type" << LL_ENDL; break; @@ -165,11 +151,6 @@ void LLViewerStatsRecorder::recordCacheFullUpdate(LLViewerRegion::eCacheUpdateRe }; } -void LLViewerStatsRecorder::recordRequestCacheMissesEvent(S32 count) -{ - mObjectCacheMissRequests += count; -} - void LLViewerStatsRecorder::writeToLog( F32 interval ) { if (!mEnableStatsLogging || !mEnableStatsRecording) @@ -185,7 +166,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) if (mSkipSaveIfZeros) { S32 total_events = mObjectCacheHitCount + mObjectCacheMissCrcCount + mObjectCacheMissFullCount + mObjectFullUpdates + - mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheMissResponses + mObjectCacheUpdateDupes + + mObjectTerseUpdates + mObjectCacheMissRequests + mObjectCacheUpdateDupes + mObjectCacheUpdateChanges + mObjectCacheUpdateAdds + mObjectCacheUpdateReplacements + mObjectUpdateFailures; if (total_events == 0) { @@ -202,14 +183,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << mObjectFullUpdates << " full updates, " << mObjectTerseUpdates << " terse updates, " << mObjectCacheMissRequests << " cache miss requests, " - << mObjectCacheMissResponses << " cache miss responses, " << mObjectCacheUpdateDupes << " cache update dupes, " << mObjectCacheUpdateChanges << " cache update changes, " << mObjectCacheUpdateAdds << " cache update adds, " - << mObjectCacheUpdateReplacements << " cache update replacements, " - << mObjectUpdateFailures << " update failures" + << mObjectCacheUpdateReplacements << " cache update replacements," + << mObjectUpdateFailures << " update failures," + << mTextureFetchCount << " texture fetches, " + << mMeshLoadedCount << " mesh loads, " + << mObjectKills << " object kills" << LL_ENDL; - + if (mStatsFile == NULL) { // Refresh settings @@ -237,8 +220,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Cache Crc Misses," << "Full Updates," << "Terse Updates," - << "Cache Miss Requests," - << "Cache Miss Responses," + << "Cache Miss Requests," // Normally results in a Full Update from simulator << "Cache Update Dupes," << "Cache Update Changes," << "Cache Update Adds," @@ -246,12 +228,16 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "Update Failures," << "Texture Count," << "Mesh Load Count," + << "Object Kills" << "\n"; data_size = col_headers.str().size(); if (fwrite(col_headers.str().c_str(), 1, data_size, mStatsFile ) != data_size) { LL_WARNS() << "failed to write full headers to " << mStatsFileName << LL_ENDL; + // Close the file and turn off stats logging + closeStatsFile(); + return; } } else @@ -273,7 +259,6 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectFullUpdates << "," << mObjectTerseUpdates << "," << mObjectCacheMissRequests - << "," << mObjectCacheMissResponses << "," << mObjectCacheUpdateDupes << "," << mObjectCacheUpdateChanges << "," << mObjectCacheUpdateAdds @@ -281,6 +266,7 @@ void LLViewerStatsRecorder::writeToLog( F32 interval ) << "," << mObjectUpdateFailures << "," << mTextureFetchCount << "," << mMeshLoadedCount + << "," << mObjectKills << "\n"; data_size = stats_data.str().size(); @@ -332,14 +318,4 @@ F32 LLViewerStatsRecorder::getTimeSinceStart() return (F32) (LLFrameTimer::getTotalSeconds() - mFileOpenTime); } -void LLViewerStatsRecorder::recordTextureFetch() -{ - mTextureFetchCount += 1; -} - -void LLViewerStatsRecorder::recordMeshLoaded() -{ - mMeshLoadedCount += 1; -} - diff --git a/indra/newview/llviewerstatsrecorder.h b/indra/newview/llviewerstatsrecorder.h index 37c08a51cf..b9fe02e54d 100644 --- a/indra/newview/llviewerstatsrecorder.h +++ b/indra/newview/llviewerstatsrecorder.h @@ -53,11 +53,11 @@ class LLViewerStatsRecorder : public LLSingleton bool isEnabled() const { return mEnableStatsRecording; } bool isLogging() const { return mEnableStatsLogging; } - void objectUpdateFailure(S32 msg_size) + void objectUpdateFailure() { if (mEnableStatsRecording) { - recordObjectUpdateFailure(msg_size); + mObjectUpdateFailures++; } } @@ -73,7 +73,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordCacheHitEvent(); + mObjectCacheHitCount++; } } @@ -97,7 +97,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordRequestCacheMissesEvent(count); + mObjectCacheMissRequests += count; } } @@ -105,7 +105,7 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordTextureFetch(); + mTextureFetchCount += 1; } } @@ -113,10 +113,18 @@ class LLViewerStatsRecorder : public LLSingleton { if (mEnableStatsRecording) { - recordMeshLoaded(); + mMeshLoadedCount += 1; } } + void recordObjectKills(S32 num_objects) + { + if (mEnableStatsRecording) + { + mObjectKills += num_objects; + } + } + void idle() { writeToLog(mInterval); @@ -125,14 +133,9 @@ class LLViewerStatsRecorder : public LLSingleton F32 getTimeSinceStart(); private: - void recordObjectUpdateFailure(S32 msg_size); void recordCacheMissEvent(U8 cache_miss_type); - void recordCacheHitEvent(); void recordObjectUpdateEvent(const EObjectUpdateType update_type); void recordCacheFullUpdate(LLViewerRegion::eCacheUpdateResult update_result); - void recordRequestCacheMissesEvent(S32 count); - void recordTextureFetch(); - void recordMeshLoaded(); void writeToLog(F32 interval); void closeStatsFile(); void makeStatsFileName(); @@ -158,15 +161,14 @@ private: S32 mObjectFullUpdates; S32 mObjectTerseUpdates; S32 mObjectCacheMissRequests; - S32 mObjectCacheMissResponses; S32 mObjectCacheUpdateDupes; S32 mObjectCacheUpdateChanges; S32 mObjectCacheUpdateAdds; S32 mObjectCacheUpdateReplacements; S32 mObjectUpdateFailures; - S32 mObjectUpdateFailuresSize; S32 mTextureFetchCount; S32 mMeshLoadedCount; + S32 mObjectKills; void clearStats(); }; -- cgit v1.3 From f7872f7ed1aaf42a6dc4a7999a554f428f6dfe60 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 11 May 2023 17:54:35 +0300 Subject: SL-19701 Clicking on 'Show' in inventory offering does not open inventory in Single folder --- indra/newview/llinventorypanel.cpp | 11 ++++++++--- indra/newview/llinventorypanel.h | 2 +- indra/newview/llviewermessage.cpp | 20 +++++++++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d6eee523f4..ca5abfd661 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1798,14 +1798,14 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel, BOOL take_keyboard_focus, BOOL reset_filter) +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL use_main_panel, BOOL take_keyboard_focus, BOOL reset_filter) { LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); sidepanel_inventory->showInventoryPanel(); bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); - if (!in_inbox && (main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected())) + if (!in_inbox && (use_main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected())) { sidepanel_inventory->selectAllItemsPanel(); } @@ -1822,7 +1822,12 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L } } - + LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + if (main_inventory && main_inventory->isSingleFolderMode() + && use_main_panel) + { + main_inventory->toggleViewMode(); + } LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 1476194195..f323a6c6d7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -246,7 +246,7 @@ public: static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, - BOOL main_panel = FALSE, + BOOL use_main_panel = FALSE, BOOL take_keyboard_focus = TAKE_FOCUS_YES, BOOL reset_filter = FALSE); static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 065e3ab3ad..78241a7c71 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -76,6 +76,7 @@ #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpanelgrouplandmoney.h" +#include "llpanelmaininventory.h" #include "llrecentpeople.h" #include "llscriptfloater.h" #include "llscriptruntimeperms.h" @@ -1536,11 +1537,28 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam } //////////////////////////////////////////////////////////////////////////////// + static LLUICachedControl find_original_new_floater("FindOriginalOpenWindow", false); + //show in a new single-folder window + if(find_original_new_floater) + { + const LLInventoryObject *obj = gInventory.getObject(obj_id); + if (obj && obj->getParentUUID().notNull()) + { + LLPanelMainInventory::newFolderWindow(obj->getParentUUID(), obj_id); + } + } + else + { // Highlight item const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false !from_name.empty(); // don't open if it's not from anyone. - LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id); + if(auto_open) + { + LLFloaterReg::showInstance("inventory"); + } + LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true); + } } } -- cgit v1.3 From 55fb718598b474680ab66cdc667a9e779fb7807a Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 16 May 2023 18:34:32 +0300 Subject: SL-19701 open shared folder instead of just selecting it --- indra/newview/llviewermessage.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 78241a7c71..b359ef6df4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1544,7 +1544,14 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam const LLInventoryObject *obj = gInventory.getObject(obj_id); if (obj && obj->getParentUUID().notNull()) { - LLPanelMainInventory::newFolderWindow(obj->getParentUUID(), obj_id); + if (obj->getActualType() == LLAssetType::AT_CATEGORY) + { + LLPanelMainInventory::newFolderWindow(obj_id); + } + else + { + LLPanelMainInventory::newFolderWindow(obj->getParentUUID(), obj_id); + } } } else -- cgit v1.3 From 86fc10f710ced7d2e7b1ddf01eef945aafd60e8b Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Tue, 16 May 2023 22:36:26 +0300 Subject: SL-19717 don't open new floater when taking an object from in-world or copying content --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b359ef6df4..3adb5db3bc 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1539,7 +1539,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam //////////////////////////////////////////////////////////////////////////////// static LLUICachedControl find_original_new_floater("FindOriginalOpenWindow", false); //show in a new single-folder window - if(find_original_new_floater) + if(find_original_new_floater && !from_name.empty()) { const LLInventoryObject *obj = gInventory.getObject(obj_id); if (obj && obj->getParentUUID().notNull()) -- cgit v1.3 From d192d91db95ec9ed3ad47039e126134bc05ad5f4 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Thu, 13 Jul 2023 11:28:36 -0700 Subject: Fixed failure to open Material Editor when creating or uploading a new material found this warning found while working on SL-19999 --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f14e3ed737..b756d3d87f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1532,7 +1532,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam LLFloaterReg::showInstance("preview_sound", LLSD(obj_id), take_focus); break; case LLAssetType::AT_MATERIAL: - LLFloaterReg::showInstance("material editor", LLSD(obj_id), take_focus); + LLFloaterReg::showInstance("material_editor", LLSD(obj_id), take_focus); break; default: LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type) << LL_ENDL; -- cgit v1.3 From 9be08fc56bd6079fd58d43ceb5d6a7bb5e45b42c Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 28 Jul 2023 10:31:31 -0500 Subject: SL-20037 Don't pop up the material editor implicitly. --- indra/newview/llviewermessage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index b756d3d87f..539951b939 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1532,7 +1532,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam LLFloaterReg::showInstance("preview_sound", LLSD(obj_id), take_focus); break; case LLAssetType::AT_MATERIAL: - LLFloaterReg::showInstance("material_editor", LLSD(obj_id), take_focus); + // Explicitly do nothing -- we don't want to open the material editor every time you add a material to inventory break; default: LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type) << LL_ENDL; -- cgit v1.3