From c1d75f12b4f9bddd0bf4e4381cfc72f9212428ef Mon Sep 17 00:00:00 2001 From: Signal Linden Date: Thu, 6 Jan 2022 16:25:39 -0800 Subject: [PATCH 001/122] SL-15741: Add pre-commit configuration --- .pre-commit-config.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..6d296d7a24 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://bitbucket.org/lindenlab/git-hooks.git + rev: v1.0.0-beta2 + hooks: + - id: opensource-license + - id: jira-issue + - id: llsd + - id: no-trigraphs + - id: copyright + - id: end-of-file + files: \.(cpp|c|h|py|glsl|cmake|txt)$ + exclude: language.txt + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.5.0 + hooks: + - id: check-xml + - id: mixed-line-ending From a4d80a5fc3b01aef53f20d07d9b4965b009e7504 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 13 Jan 2022 17:56:04 -0800 Subject: [PATCH 002/122] SL-16862: Add comment that min_val for zoom_slider is hardcoded min_val for zoom slider is hardcoded for performance reasons. Changing its value in the slider XML element will have no effect. Note that larger values of min_val, if allowed, would most likely be safe, however that would reduce how far you can zoom out. See: LLFloaterWorldMap::adjustZoomSliderBounds --- indra/newview/skins/default/xui/en/floater_world_map.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index 83407069d2..d7e4b88a21 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -677,6 +677,7 @@ name="zoom_icon" top_pad="7" width="16" > + Date: Wed, 19 Jan 2022 13:49:04 -0800 Subject: [PATCH 003/122] SL-16862: Adjust max zoom-in level on world map to match max zoom-in on minimap --- indra/newview/skins/default/xui/en/floater_world_map.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index d7e4b88a21..eb633e50e7 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -685,7 +685,7 @@ initial_value="-2" left_pad="0" layout="topleft" - max_val="0" + max_val="4" min_val="-8" name="zoom slider" show_text="false" From ab39432109f696023c6633908a0920546c03e7b7 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Tue, 22 Feb 2022 09:47:43 -0800 Subject: [PATCH 004/122] SL-9748 - Option to compute uploaded mesh physics shape from a cube. --- indra/newview/cube.dae | 103 ++++++++++++++++++ indra/newview/llfloatermodelpreview.cpp | 23 ++-- indra/newview/llfloatermodelpreview.h | 1 + .../default/xui/en/floater_model_preview.xml | 1 + indra/newview/viewer_manifest.py | 1 + 5 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 indra/newview/cube.dae diff --git a/indra/newview/cube.dae b/indra/newview/cube.dae new file mode 100644 index 0000000000..f9df955ff2 --- /dev/null +++ b/indra/newview/cube.dae @@ -0,0 +1,103 @@ + + + + + modified from https://gist.github.com/wtsnz/bfa11c40e04594b260255b5dc7956f26 + + 2018-10-25T16:29:03Z + 2022-02-18T00:00:00Z + + Y_UP + + + + + + + + + + + + + + + + 0 0 0 1 + + + 0.137255 0.403922 0.870588 1 + + + 0.5 0.5 0.5 1 + + + 16 + + + 0 0 0 1 + + + 1 + + + 1 + + + + + + + + + + + + + + -0.5 0.5 0.5 -0.5 -0.5 0.5 0.5 -0.5 0.5 0.5 0.5 0.5 -0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 -0.5 -0.5 0.5 -0.5 -0.5 -0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 -0.5 -0.5 0.5 -0.5 0.5 0.5 -0.5 0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 0.5 0.5 -0.5 0.5 0.5 -0.5 -0.5 0.5 0.5 -0.5 0.5 0.5 0.5 0.5 0.5 -0.5 0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 0.5 -0.5 + + + + + + + + + + + + + + + +

0 1 2 0 2 3 4 5 6 4 6 7 8 9 10 8 10 11 12 13 14 12 14 15 16 17 18 16 18 19 20 21 22 20 22 23

+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 64b24d54c3..fe4deaa657 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -455,7 +455,7 @@ void LLFloaterModelPreview::loadHighLodModel() loadModel(3); } -void LLFloaterModelPreview::loadModel(S32 lod) +void LLFloaterModelPreview::prepareToLoadModel(S32 lod) { mModelPreview->mLoading = true; if (lod == LLModel::LOD_PHYSICS) @@ -463,14 +463,16 @@ void LLFloaterModelPreview::loadModel(S32 lod) // loading physics from file mModelPreview->mPhysicsSearchLOD = lod; } - +} +void LLFloaterModelPreview::loadModel(S32 lod) +{ + prepareToLoadModel(lod); (new LLMeshFilePicker(mModelPreview, lod))->getFile(); } void LLFloaterModelPreview::loadModel(S32 lod, const std::string& file_name, bool force_disable_slm) { - mModelPreview->mLoading = true; - + prepareToLoadModel(lod); mModelPreview->loadModel(file_name, lod, force_disable_slm); } @@ -1042,10 +1044,15 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) } S32 file_mode = iface->getItemCount() - 1; - if (which_mode < file_mode) + S32 cube_mode = file_mode - 1; + if (which_mode < cube_mode) { S32 which_lod = num_lods - which_mode; sInstance->mModelPreview->setPhysicsFromLOD(which_lod); + } else if (which_mode == cube_mode) { + std::string path = gDirUtilp->getAppRODataDir(); + gDirUtilp->append(path, "cube.dae"); + sInstance->loadModel(LLModel::LOD_PHYSICS, path); } LLModelPreview *model_preview = sInstance->mModelPreview; @@ -1641,15 +1648,15 @@ LLFloaterModelPreview::DecompRequest::DecompRequest(const std::string& stage, LL void LLFloaterModelPreview::setCtrlLoadFromFile(S32 lod) { if (lod == LLModel::LOD_PHYSICS) - { + { LLComboBox* lod_combo = findChild("physics_lod_combo"); if (lod_combo) { - lod_combo->setCurrentByIndex(5); + lod_combo->setCurrentByIndex(lod_combo->getItemCount() - 1); } } else -{ + { LLComboBox* lod_combo = findChild("lod_source_" + lod_name[lod]); if (lod_combo) { diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 8a01b0c307..db7e49fd9c 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -222,6 +222,7 @@ private: void resetUploadOptions(); void clearLogTab(); + void prepareToLoadModel(S32 lod); void createSmoothComboBox(LLComboBox* combo_box, float min, float max); diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 7f863756eb..64079d1d20 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -784,6 +784,7 @@ Medium Low Lowest + Bounding Box From file Date: Tue, 22 Feb 2022 10:51:18 -0800 Subject: [PATCH 005/122] SL-9748 - coding standard --- indra/newview/llfloatermodelpreview.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index fe4deaa657..4ea47c1bc7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1049,7 +1049,9 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { S32 which_lod = num_lods - which_mode; sInstance->mModelPreview->setPhysicsFromLOD(which_lod); - } else if (which_mode == cube_mode) { + } + else if (which_mode == cube_mode) + { std::string path = gDirUtilp->getAppRODataDir(); gDirUtilp->append(path, "cube.dae"); sInstance->loadModel(LLModel::LOD_PHYSICS, path); @@ -1652,7 +1654,7 @@ void LLFloaterModelPreview::setCtrlLoadFromFile(S32 lod) LLComboBox* lod_combo = findChild("physics_lod_combo"); if (lod_combo) { - lod_combo->setCurrentByIndex(lod_combo->getItemCount() - 1); + lod_combo->setCurrentByIndex(lod_combo->getItemCount() - 1); } } else From 1abc02ed6b5578f758e37abb5858a24408be4c68 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Tue, 22 Feb 2022 15:24:23 -0800 Subject: [PATCH 006/122] SL-9748 - Place cube.dae in ppRODataDir on all platforms. --- indra/newview/viewer_manifest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 7d059f08f4..3488e7550b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -573,6 +573,7 @@ class WindowsManifest(ViewerManifest): self.path(src="licenses-win32.txt", dst="licenses.txt") self.path("featuretable.txt") + self.path("cube.dae") with self.prefix(src=pkgdir): self.path("ca-bundle.crt") @@ -959,8 +960,8 @@ class DarwinManifest(ViewerManifest): self.path("licenses-mac.txt", dst="licenses.txt") self.path("featuretable_mac.txt") - self.path("SecondLife.nib") self.path("cube.dae") + self.path("SecondLife.nib") with self.prefix(src=pkgdir,dst=""): self.path("ca-bundle.crt") @@ -1403,6 +1404,7 @@ class LinuxManifest(ViewerManifest): print "Skipping llcommon.so (assuming llcommon was linked statically)" self.path("featuretable_linux.txt") + self.path("cube.dae") with self.prefix(src=pkgdir): self.path("ca-bundle.crt") From 34a9e84cd89e9a5a748dd5aa0cc2666bf8f6c34a Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 17 Feb 2022 12:56:40 -0800 Subject: [PATCH 007/122] SL-16917: Fix minimap cardinal direction text being offset slightly, and move cardinal directions to the edge of the minimap --- indra/newview/llfloatermap.cpp | 58 ++++++++++++++----- .../skins/default/xui/en/floater_map.xml | 48 +++------------ 2 files changed, 52 insertions(+), 54 deletions(-) mode change 100644 => 100755 indra/newview/llfloatermap.cpp diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp old mode 100644 new mode 100755 index fc2da772f3..7a7ffb0c7e --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -51,7 +51,7 @@ // The minor cardinal direction labels are hidden if their height is more // than this proportion of the map. -const F32 MAP_MINOR_DIR_THRESHOLD = 0.07f; +const F32 MAP_MINOR_DIR_THRESHOLD = 0.035f; // // Member functions @@ -97,6 +97,15 @@ BOOL LLFloaterMap::postBuild() mTextBoxSouthWest = getChild ("floater_map_southwest"); mTextBoxNorthWest = getChild ("floater_map_northwest"); + mTextBoxNorth->reshapeToFitText(); + mTextBoxEast->reshapeToFitText(); + mTextBoxWest->reshapeToFitText(); + mTextBoxSouth->reshapeToFitText(); + mTextBoxSouthEast->reshapeToFitText(); + mTextBoxNorthEast->reshapeToFitText(); + mTextBoxSouthWest->reshapeToFitText(); + mTextBoxNorthWest->reshapeToFitText(); + updateMinorDirections(); // Get the drag handle all the way in back @@ -138,23 +147,44 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } -void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) +void LLFloaterMap::setDirectionPos(LLTextBox *text_box, F32 rotation) { - // Rotation is in radians. - // Rotation of 0 means x = 1, y = 0 on the unit circle. + // Rotation is in radians. + // Rotation of 0 means x = 1, y = 0 on the unit circle. - F32 map_half_height = (F32)(getRect().getHeight() / 2) - getHeaderHeight()/2; - F32 map_half_width = (F32)(getRect().getWidth() / 2) ; - F32 text_half_height = (F32)(text_box->getRect().getHeight() / 2); - F32 text_half_width = (F32)(text_box->getRect().getWidth() / 2); - F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width ); + F32 map_half_height = (F32) (getRect().getHeight() / 2) - (getHeaderHeight() / 2); + F32 map_half_width = (F32) (getRect().getWidth() / 2); + F32 text_half_height = (F32) (text_box->getRect().getHeight() / 2); + F32 text_half_width = (F32) (text_box->getRect().getWidth() / 2); + F32 extra_padding = (F32) (mTextBoxNorth->getRect().getWidth() / 2); + F32 pos_half_height = map_half_height - text_half_height - extra_padding; + F32 pos_half_width = map_half_width - text_half_width - extra_padding; - // Inset by a little to account for position display. - radius -= 8.f; + F32 corner_angle = atan2(pos_half_height, pos_half_width); + F32 rotation_mirrored_into_top = abs(fmodf(rotation, F_PI)); + if (rotation < 0) + { + rotation_mirrored_into_top = F_PI - rotation_mirrored_into_top; + } + F32 rotation_mirrored_into_top_right = (F_PI_BY_TWO - abs(rotation_mirrored_into_top - F_PI_BY_TWO)); + bool at_left_right_edge = rotation_mirrored_into_top_right < corner_angle; - text_box->setOrigin( - ll_round(map_half_width - text_half_width + radius * cos( rotation )), - ll_round(map_half_height - text_half_height + radius * sin( rotation )) ); + F32 part_x = cos(rotation); + F32 part_y = sin(rotation); + F32 y; + F32 x; + if (at_left_right_edge) + { + x = std::copysign(pos_half_width, part_x); + y = x * part_y / part_x; + } + else + { + y = std::copysign(pos_half_height, part_y); + x = y * part_x / part_y; + } + + text_box->setOrigin(ll_round(map_half_width + x - text_half_width), ll_round(map_half_height + y - text_half_height)); } void LLFloaterMap::updateMinorDirections() diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml index b8893e11d9..18e7147136 100644 --- a/indra/newview/skins/default/xui/en/floater_map.xml +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -37,105 +37,73 @@ + text_color="1 1 1 0.7"> N + text_color="1 1 1 0.7"> E + text_color="1 1 1 0.7"> W + text_color="1 1 1 0.7"> S + text_color="1 1 1 0.7"> SE + text_color="1 1 1 0.7"> NE + text_color="1 1 1 0.7"> SW + text_color="1 1 1 0.7"> NW From 898079a39bc86598d8e998a24845d0932c88cdca Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Tue, 25 Jan 2022 17:25:46 -0800 Subject: [PATCH 008/122] SL-16857: Display parcel borders on the minimap, enable by default, right click context menu option to disable --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llnetmap.cpp | 20 ++++-- indra/newview/llviewerparcelmgr.cpp | 2 + indra/newview/llviewerparceloverlay.cpp | 64 ++++++++++++++++++- indra/newview/llviewerparceloverlay.h | 3 +- indra/newview/llviewerregion.cpp | 9 +++ indra/newview/llviewerregion.h | 2 + indra/newview/skins/default/colors.xml | 3 + .../skins/default/xui/en/menu_mini_map.xml | 10 +++ 9 files changed, 115 insertions(+), 9 deletions(-) mode change 100644 => 100755 indra/newview/llviewerparceloverlay.cpp mode change 100644 => 100755 indra/newview/llviewerregion.cpp diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 12f435f931..c170563cf7 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6821,6 +6821,17 @@ Value 128.0 + MiniMapShowPropertyLines + + Comment + Whether or not to show parcel borders on the MiniMap. + Persist + 1 + Type + Boolean + Value + 1 + MouseSensitivity Comment diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 112da55682..80fac58a1e 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -154,6 +154,7 @@ void LLNetMap::draw() //static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white); static LLUIColor map_frustum_color = LLUIColorTable::instance().getColor("MapFrustumColor", LLColor4::white); static LLUIColor map_frustum_rotating_color = LLUIColorTable::instance().getColor("MapFrustumRotatingColor", LLColor4::white); + static LLUIColor map_parcel_outline_color = LLUIColorTable::instance().getColor("MapParcelOutlineColor", LLColor4(LLColor3(LLColor4::yellow), 0.5f)); if (mObjectImagep.isNull()) { @@ -211,7 +212,8 @@ void LLNetMap::draw() } // figure out where agent is - S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters()); + const S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters()); + const F32 scale_pixels_per_meter = mScale / region_width; for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) @@ -220,8 +222,8 @@ void LLNetMap::draw() // Find x and y position relative to camera's center. LLVector3 origin_agent = regionp->getOriginAgent(); LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent(); - F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale; - F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale; + F32 relative_x = rel_region_pos.mV[0] * scale_pixels_per_meter; + F32 relative_y = rel_region_pos.mV[1] * scale_pixels_per_meter; // background region rectangle F32 bottom = relative_y; @@ -244,6 +246,7 @@ void LLNetMap::draw() } + // Draw using texture. gGL.getTexUnit(0)->bind(regionp->getLand().getSTexture()); gGL.begin(LLRender::QUADS); @@ -305,8 +308,8 @@ void LLNetMap::draw() LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); LLVector3 camera_position = gAgentCamera.getCameraPositionAgent(); map_center_agent -= camera_position; - map_center_agent.mV[VX] *= mScale/region_width; - map_center_agent.mV[VY] *= mScale/region_width; + map_center_agent.mV[VX] *= scale_pixels_per_meter; + map_center_agent.mV[VY] *= scale_pixels_per_meter; gGL.getTexUnit(0)->bind(mObjectImagep); F32 image_half_width = 0.5f*mObjectMapPixels; @@ -322,6 +325,13 @@ void LLNetMap::draw() gGL.texCoord2f(1.f, 1.f); gGL.vertex2f(image_half_width + map_center_agent.mV[VX], image_half_height + map_center_agent.mV[VY]); gGL.end(); + + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* regionp = *iter; + regionp->renderPropertyLinesOnMinimap(scale_pixels_per_meter, map_parcel_outline_color.get().mV); + } gGL.popMatrix(); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 56370df751..a6f15489f4 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1591,6 +1591,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use else if (sequence_id == 0 || sequence_id > parcel_mgr.mAgentParcelSequenceID) { // new agent parcel + // *TODO: Does it really make sense to set the agent parcel to this + // parcel if the client doesn't know what kind of parcel data this is? parcel_mgr.mAgentParcelSequenceID = sequence_id; parcel = parcel_mgr.mAgentParcel; } diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp old mode 100644 new mode 100755 index 7c3dd00e1a..c170a240a8 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -907,8 +907,8 @@ S32 LLViewerParcelOverlay::renderPropertyLines () // Always fudge a little vertically. pull_toward_camera.mV[VZ] += 0.01f; - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); // Move to appropriate region coords LLVector3 origin = mRegion->getOriginAgent(); @@ -1013,7 +1013,65 @@ S32 LLViewerParcelOverlay::renderPropertyLines () } - gGL.popMatrix(); + gGL.popMatrix(); return drawn; } + +// Draw half of a single cell (no fill) in a grid drawn from left to right and from bottom to top +void grid_2d_part_lines(const F32 left, const F32 top, const F32 right, const F32 bottom, bool has_left, bool has_bottom) +{ + gGL.begin(LLRender::LINES); + + if (has_left) + { + gGL.vertex2f(left, bottom); + gGL.vertex2f(left, top); + } + if (has_bottom) + { + gGL.vertex2f(left, bottom); + gGL.vertex2f(right, bottom); + } + + gGL.end(); +} + +void LLViewerParcelOverlay::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32 *parcel_outline_color) +{ + if (!mOwnership) + { + return; + } + if (!gSavedSettings.getBOOL("MiniMapShowPropertyLines")) + { + return; + } + + LLVector3 origin_agent = mRegion->getOriginAgent(); + LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent(); + F32 region_left = rel_region_pos.mV[0] * scale_pixels_per_meter; + F32 region_bottom = rel_region_pos.mV[1] * scale_pixels_per_meter; + F32 map_parcel_width = PARCEL_GRID_STEP_METERS * scale_pixels_per_meter; + const S32 GRIDS_PER_EDGE = mParcelGridsPerEdge; + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + glLineWidth(1.0f); + gGL.color4fv(parcel_outline_color); + for (S32 i = 0; i < GRIDS_PER_EDGE + 1; i++) + { + F32 bottom = region_bottom + (i * map_parcel_width); + F32 top = bottom + map_parcel_width; + for (S32 j = 0; j < GRIDS_PER_EDGE + 1; j++) + { + F32 left = region_left + (j * map_parcel_width); + F32 right = left + map_parcel_width; + U8 overlay = mOwnership[(i * GRIDS_PER_EDGE) + j]; + // The property line vertices are three-dimensional, but here we only care about the x and y coordinates, as we are drawing on a + // 2D map + const bool has_left = i != GRIDS_PER_EDGE && (j == GRIDS_PER_EDGE || (overlay & PARCEL_WEST_LINE)); + const bool has_bottom = j != GRIDS_PER_EDGE && (i == GRIDS_PER_EDGE || (overlay & PARCEL_SOUTH_LINE)); + grid_2d_part_lines(left, top, right, bottom, has_left, has_bottom); + } + } +} diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index e30dbf17b3..053f69ba4c 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -69,6 +69,7 @@ public: // Returns the number of vertices drawn S32 renderPropertyLines(); + void renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color); U8 ownership( const LLVector3& pos) const; U8 parcelLineFlags( const LLVector3& pos) const; @@ -82,7 +83,7 @@ public: void idleUpdate(bool update_now = false); void updateGL(); - + private: // This is in parcel rows and columns, not grid rows and columns // Stored in bottom three bits. diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp old mode 100644 new mode 100755 index 0f409701d1..36b0bf44c3 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1033,6 +1033,15 @@ S32 LLViewerRegion::renderPropertyLines() } } +void LLViewerRegion::renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32 *parcel_outline_color) +{ + if (mParcelOverlay) + { + mParcelOverlay->renderPropertyLinesOnMinimap(scale_pixels_per_meter, parcel_outline_color); + } +} + + // This gets called when the height field changes. void LLViewerRegion::dirtyHeights() { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index fcbf56c81f..b6c8f5c583 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -154,6 +154,8 @@ public: // Draw lines in the dirt showing ownership. Return number of // vertices drawn. S32 renderPropertyLines(); + void renderPropertyLinesOnMinimap(F32 scale_pixels_per_meter, const F32* parcel_outline_color); + // Call this whenever you change the height data in the region. // (Automatically called by LLSurfacePatch's update routine) diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 7beb013fba..82e1942aa5 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -513,6 +513,9 @@ + diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index ea263d05ce..c3899b35cd 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -63,6 +63,16 @@ function="Minimap.Tracker" parameter="task_properties" /> + + + + + Date: Fri, 25 Feb 2022 18:32:55 -0800 Subject: [PATCH 009/122] SL-9748 - Apply explicitly given physics shape only if the usual rules do not. --- indra/newview/llmodelpreview.cpp | 16 +++++++++++++++- indra/newview/llmodelpreview.h | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index a9e80ab5da..a1420fba17 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -529,6 +529,16 @@ void LLModelPreview::rebuildUploadData() LLFloaterModelPreview::addStringToLog(out, false); } } + if (!mLastSpecifiedPhysicsModelOriginalName.empty() && !lod_model && (i == LLModel::LOD_PHYSICS)) + { + // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition. + // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted. + std::ostringstream out; + out << "Reusing previously matched physics model " << mLastSpecifiedPhysicsModelOriginalName; + LL_INFOS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, false); + lod_model = mLastSpecifiedPhysicsP; + } if (lod_model) { @@ -1185,7 +1195,11 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); } - + if (loaded_lod == LLModel::LOD_PHYSICS) + { + mLastSpecifiedPhysicsModelOriginalName = loaded_name; + mLastSpecifiedPhysicsP = mModel[loaded_lod][idx]; + } mModel[loaded_lod][idx]->mLabel = name; } } diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 3664a27a72..5a9fc93879 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -217,6 +217,8 @@ private: LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; } // Count amount of original models, excluding sub-models static U32 countRootModels(LLModelLoader::model_list models); + LLModel* mLastSpecifiedPhysicsP{}; // As opposed to being found by name or LOD; + std::string mLastSpecifiedPhysicsModelOriginalName{""}; // Since the above will have it's label bashed. protected: friend class LLModelLoader; From 932b7de5309bc8599655ebb77666c41f5a81cfa9 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Mon, 28 Feb 2022 15:47:56 -0800 Subject: [PATCH 010/122] SL-9748 - Handle submesh case of resuseable physics model. --- indra/newview/llmodelpreview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index a1420fba17..f3b6207488 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -529,12 +529,12 @@ void LLModelPreview::rebuildUploadData() LLFloaterModelPreview::addStringToLog(out, false); } } - if (!mLastSpecifiedPhysicsModelOriginalName.empty() && !lod_model && (i == LLModel::LOD_PHYSICS)) + if (mLastSpecifiedPhysicsP && !lod_model && (i == LLModel::LOD_PHYSICS)) { // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition. // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted. std::ostringstream out; - out << "Reusing previously matched physics model " << mLastSpecifiedPhysicsModelOriginalName; + out << "Reusing physics model " << mLastSpecifiedPhysicsModelOriginalName << " for " << instance.mLabel; LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); lod_model = mLastSpecifiedPhysicsP; @@ -1204,6 +1204,11 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) } } } + else if ((loaded_lod == LLModel::LOD_PHYSICS) && (mModel[loaded_lod].size() == 1)) + { + mLastSpecifiedPhysicsModelOriginalName = stripSuffix(mModel[loaded_lod][0]->mLabel); + mLastSpecifiedPhysicsP = mModel[loaded_lod][0]; + } } } } From 239a29ab5c67bef8ffc773b0f405d8cc4542cf34 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 2 Mar 2022 17:39:12 -0800 Subject: [PATCH 011/122] SL-9748 - more cases --- indra/newview/llfloatermodelpreview.cpp | 1 + indra/newview/llmodelpreview.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 71ae31e665..4a51533a57 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -483,6 +483,7 @@ void LLFloaterModelPreview::prepareToLoadModel(S32 lod) { // loading physics from file mModelPreview->mPhysicsSearchLOD = lod; + mModelPreview->mLastSpecifiedPhysicsP = NULL; } } void LLFloaterModelPreview::loadModel(S32 lod) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 54a0c1a5bb..4e3b4c5c41 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -470,8 +470,8 @@ void LLModelPreview::rebuildUploadData() // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition. // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted. std::ostringstream out; - out << "Reusing physics model " << mLastSpecifiedPhysicsModelOriginalName << " for " << instance.mLabel; - LL_INFOS() << out.str() << LL_ENDL; + out << "No physics model specified for " << instance.mLabel << ". Reusing physics model " << mLastSpecifiedPhysicsModelOriginalName << "."; + LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); lod_model = mLastSpecifiedPhysicsP; } @@ -1140,7 +1140,7 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) } } } - else if ((loaded_lod == LLModel::LOD_PHYSICS) && (mModel[loaded_lod].size() == 1)) + else if ((loaded_lod == LLModel::LOD_PHYSICS) && !mLastSpecifiedPhysicsP) { mLastSpecifiedPhysicsModelOriginalName = stripSuffix(mModel[loaded_lod][0]->mLabel); mLastSpecifiedPhysicsP = mModel[loaded_lod][0]; From 81da0dd2db7261e402c53445efa1d012177a4cfe Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 9 Feb 2022 18:03:52 -0800 Subject: [PATCH 012/122] SL-16824: Change minimap hover tooltip. Show parcel name, owner name, and/or for sale info when available. Remove "shift-drag to pan" hint. --- indra/newview/llfloatermap.cpp | 56 ++++--- indra/newview/llnetmap.cpp | 146 +++++++++++++----- indra/newview/llnetmap.h | 20 ++- .../skins/default/xui/en/floater_map.xml | 30 +++- 4 files changed, 185 insertions(+), 67 deletions(-) diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 7a7ffb0c7e..ab39d08830 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -77,25 +77,31 @@ LLFloaterMap::~LLFloaterMap() BOOL LLFloaterMap::postBuild() { - mMap = getChild("Net Map"); - if (gSavedSettings.getBOOL("DoubleClickTeleport")) - { - mMap->setToolTipMsg(getString("AltToolTipMsg")); - } - else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) - { - mMap->setToolTipMsg(getString("ToolTipMsg")); - } - sendChildToBack(mMap); - - mTextBoxNorth = getChild ("floater_map_north"); - mTextBoxEast = getChild ("floater_map_east"); - mTextBoxWest = getChild ("floater_map_west"); - mTextBoxSouth = getChild ("floater_map_south"); - mTextBoxSouthEast = getChild ("floater_map_southeast"); - mTextBoxNorthEast = getChild ("floater_map_northeast"); - mTextBoxSouthWest = getChild ("floater_map_southwest"); - mTextBoxNorthWest = getChild ("floater_map_northwest"); + mMap = getChild("Net Map"); + mMap->setToolTipMsg(getString("ToolTipMsg")); + mMap->setParcelNameMsg(getString("ParcelNameMsg")); + mMap->setParcelSalePriceMsg(getString("ParcelSalePriceMsg")); + mMap->setParcelSaleAreaMsg(getString("ParcelSaleAreaMsg")); + mMap->setParcelOwnerMsg(getString("ParcelOwnerMsg")); + mMap->setRegionNameMsg(getString("RegionNameMsg")); + if (gSavedSettings.getBOOL("DoubleClickTeleport")) + { + mMap->setToolTipHintMsg(getString("AltToolTipHintMsg")); + } + else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) + { + mMap->setToolTipHintMsg(getString("ToolTipHintMsg")); + } + sendChildToBack(mMap); + + mTextBoxNorth = getChild("floater_map_north"); + mTextBoxEast = getChild("floater_map_east"); + mTextBoxWest = getChild("floater_map_west"); + mTextBoxSouth = getChild("floater_map_south"); + mTextBoxSouthEast = getChild("floater_map_southeast"); + mTextBoxNorthEast = getChild("floater_map_northeast"); + mTextBoxSouthWest = getChild("floater_map_southwest"); + mTextBoxNorthWest = getChild("floater_map_northwest"); mTextBoxNorth->reshapeToFitText(); mTextBoxEast->reshapeToFitText(); @@ -106,15 +112,15 @@ BOOL LLFloaterMap::postBuild() mTextBoxSouthWest->reshapeToFitText(); mTextBoxNorthWest->reshapeToFitText(); - updateMinorDirections(); + updateMinorDirections(); - // Get the drag handle all the way in back - sendChildToBack(getDragHandle()); + // Get the drag handle all the way in back + sendChildToBack(getDragHandle()); - // keep onscreen - gFloaterView->adjustToFitScreen(this, FALSE); + // keep onscreen + gFloaterView->adjustToFitScreen(this, false); - return TRUE; + return true; } BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 80fac58a1e..e87ec10e5d 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -37,6 +37,7 @@ #include "llfocusmgr.h" #include "lllocalcliprect.h" #include "llrender.h" +#include "llresmgr.h" #include "llui.h" #include "lltooltip.h" @@ -48,10 +49,14 @@ #include "llappviewer.h" // for gDisconnected #include "llcallingcard.h" // LLAvatarTracker #include "llfloaterworldmap.h" +#include "llparcel.h" #include "lltracker.h" #include "llsurface.h" +#include "llurlmatch.h" +#include "llurlregistry.h" #include "llviewercamera.h" #include "llviewercontrol.h" +#include "llviewerparcelmgr.h" #include "llviewertexture.h" #include "llviewertexturelist.h" #include "llviewermenu.h" @@ -603,47 +608,116 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } -BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) +BOOL LLNetMap::handleToolTip(S32 x, S32 y, MASK mask) { - if (gDisconnected) - { - return FALSE; - } + if (gDisconnected) + { + return false; + } - // If the cursor is near an avatar on the minimap, a mini-inspector will be - // shown for the avatar, instead of the normal map tooltip. - if (handleToolTipAgent(mClosestAgentToCursor)) - { - return TRUE; - } + // If the cursor is near an avatar on the minimap, a mini-inspector will be + // shown for the avatar, instead of the normal map tooltip. + if (handleToolTipAgent(mClosestAgentToCursor)) + { + return true; + } - LLRect sticky_rect; - std::string region_name; - LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); - if(region) - { - // set sticky_rect - S32 SLOP = 4; - localPointToScreen(x - SLOP, y - SLOP, &(sticky_rect.mLeft), &(sticky_rect.mBottom)); - sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; - sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; + LLRect sticky_rect; + S32 SLOP = 4; + localPointToScreen(x - SLOP, y - SLOP, &(sticky_rect.mLeft), &(sticky_rect.mBottom)); + sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; + sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; - region_name = region->getName(); - if (!region_name.empty()) - { - region_name += "\n"; - } - } + std::string parcel_name_msg; + std::string parcel_sale_price_msg; + std::string parcel_sale_area_msg; + std::string parcel_owner_msg; + std::string region_name_msg; - LLStringUtil::format_map_t args; - args["[REGION]"] = region_name; - std::string msg = mToolTipMsg; - LLStringUtil::format(msg, args); - LLToolTipMgr::instance().show(LLToolTip::Params() - .message(msg) - .sticky_rect(sticky_rect)); - - return TRUE; + LLVector3d posGlobal = viewPosToGlobal(x, y); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal(posGlobal); + if (region) + { + std::string region_name = region->getName(); + if (!region_name.empty()) + { + region_name_msg = mRegionNameMsg; + LLStringUtil::format(region_name_msg, {{"[REGION_NAME]", region_name}}); + } + + // Only show parcel information in the tooltip if property lines are visible. Otherwise, the parcel the tooltip is referring to is + // ambiguous. + if (gSavedSettings.getBOOL("MiniMapShowPropertyLines")) + { + LLViewerParcelMgr::getInstance()->setHoverParcel(posGlobal); + LLParcel *hover_parcel = LLViewerParcelMgr::getInstance()->getHoverParcel(); + if (hover_parcel) + { + std::string parcel_name = hover_parcel->getName(); + if (!parcel_name.empty()) + { + parcel_name_msg = mParcelNameMsg; + LLStringUtil::format(parcel_name_msg, {{"[PARCEL_NAME]", parcel_name}}); + } + + const LLUUID parcel_owner = hover_parcel->getOwnerID(); + std::string parcel_owner_name_url = LLSLURL("agent", parcel_owner, "inspect").getSLURLString(); + static LLUrlMatch parcel_owner_name_url_match; + LLUrlRegistry::getInstance()->findUrl(parcel_owner_name_url, parcel_owner_name_url_match); + if (!parcel_owner_name_url_match.empty()) + { + parcel_owner_msg = mParcelOwnerMsg; + std::string parcel_owner_name = parcel_owner_name_url_match.getLabel(); + LLStringUtil::format(parcel_owner_msg, {{"[PARCEL_OWNER]", parcel_owner_name}}); + } + + if (hover_parcel->getForSale()) + { + const LLUUID auth_buyer_id = hover_parcel->getAuthorizedBuyerID(); + const LLUUID agent_id = gAgent.getID(); + bool show_for_sale = auth_buyer_id.isNull() || auth_buyer_id == agent_id || parcel_owner == agent_id; + if (show_for_sale) + { + S32 price = hover_parcel->getSalePrice(); + S32 area = hover_parcel->getArea(); + F32 cost_per_sqm = 0.0f; + if (area > 0) + { + cost_per_sqm = F32(price) / area; + } + std::string formatted_price = LLResMgr::getInstance()->getMonetaryString(price); + std::string formatted_cost_per_meter = llformat("%.1f", cost_per_sqm); + parcel_sale_price_msg = mParcelSalePriceMsg; + LLStringUtil::format(parcel_sale_price_msg, + {{"[PRICE]", formatted_price}, {"[PRICE_PER_SQM]", formatted_cost_per_meter}}); + std::string formatted_area = llformat("%d", area); + parcel_sale_area_msg = mParcelSaleAreaMsg; + LLStringUtil::format(parcel_sale_area_msg, {{"[AREA]", formatted_area}}); + } + } + } + } + } + + std::string tool_tip_hint_msg = mToolTipHintMsg; + + LLStringUtil::format_map_t args; + args["[PARCEL_NAME_MSG]"] = parcel_name_msg.empty() ? "" : parcel_name_msg + '\n'; + args["[PARCEL_SALE_PRICE_MSG]"] = parcel_sale_price_msg.empty() ? "" : parcel_sale_price_msg + '\n'; + args["[PARCEL_SALE_AREA_MSG]"] = parcel_sale_area_msg.empty() ? "" : parcel_sale_area_msg + '\n'; + args["[PARCEL_OWNER_MSG]"] = parcel_owner_msg.empty() ? "" : parcel_owner_msg + '\n'; + args["[REGION_NAME_MSG]"] = region_name_msg.empty() ? "" : region_name_msg + '\n'; + args["[TOOL_TIP_HINT_MSG]"] = tool_tip_hint_msg.empty() ? "" : tool_tip_hint_msg + '\n'; + + std::string msg = mToolTipMsg; + LLStringUtil::format(msg, args); + if (msg.back() == '\n') + { + msg.resize(msg.size() - 1); + } + LLToolTipMgr::instance().show(LLToolTip::Params().message(msg).sticky_rect(sticky_rect)); + + return true; } BOOL LLNetMap::handleToolTipAgent(const LLUUID& avatar_id) diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 1f7e7d68c6..e7eeda7dcc 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -79,8 +79,16 @@ public: /*virtual*/ BOOL handleClick(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); - void setScale( F32 scale ); - void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; } + void setScale(F32 scale); + + void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; } + void setParcelNameMsg(const std::string& msg) { mParcelNameMsg = msg; } + void setParcelSalePriceMsg(const std::string& msg) { mParcelSalePriceMsg = msg; } + void setParcelSaleAreaMsg(const std::string& msg) { mParcelSaleAreaMsg = msg; } + void setParcelOwnerMsg(const std::string& msg) { mParcelOwnerMsg = msg; } + void setRegionNameMsg(const std::string& msg) { mRegionNameMsg = msg; } + void setToolTipHintMsg(const std::string& msg) { mToolTipHintMsg = msg; } + void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); private: @@ -125,7 +133,13 @@ private: LLUUID mClosestAgentToCursor; LLUUID mClosestAgentAtLastRightClick; - std::string mToolTipMsg; + std::string mToolTipMsg; + std::string mParcelNameMsg; + std::string mParcelSalePriceMsg; + std::string mParcelSaleAreaMsg; + std::string mParcelOwnerMsg; + std::string mRegionNameMsg; + std::string mToolTipHintMsg; public: void setSelected(uuid_vec_t uuids) { gmSelected=uuids; }; diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml index 18e7147136..9639e70544 100644 --- a/indra/newview/skins/default/xui/en/floater_map.xml +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -16,11 +16,35 @@ width="200"> - [REGION](Double-click to open Map, shift-drag to pan) + [PARCEL_NAME_MSG][PARCEL_SALE_PRICE_MSG][PARCEL_SALE_AREA_MSG][PARCEL_OWNER_MSG][REGION_NAME_MSG][TOOL_TIP_HINT_MSG] + + + [PARCEL_NAME] + + + Price: L$[PRICE] (L$[PRICE_PER_SQM]/m²) + + + Area: [AREA]m² + + + Owner: [PARCEL_OWNER] + + + Region: [REGION_NAME] - [REGION](Double-click to teleport, shift-drag to pan) + name="ToolTipHintMsg"> + Double-click to open map + + + Double-click to teleport Mini-map From 0e927e92f33f4a421a3cd56f7b9bc65c19003df2 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Mon, 28 Feb 2022 11:55:15 -0800 Subject: [PATCH 013/122] SL-16824: Fix minimap tooltip hint not updating until viewer restart (double click to show map vs double click to teleport) --- indra/newview/llfloatermap.cpp | 10 ++-------- indra/newview/llnetmap.cpp | 10 +++++++++- indra/newview/llnetmap.h | 2 ++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index ab39d08830..95c43805d4 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -84,14 +84,8 @@ BOOL LLFloaterMap::postBuild() mMap->setParcelSaleAreaMsg(getString("ParcelSaleAreaMsg")); mMap->setParcelOwnerMsg(getString("ParcelOwnerMsg")); mMap->setRegionNameMsg(getString("RegionNameMsg")); - if (gSavedSettings.getBOOL("DoubleClickTeleport")) - { - mMap->setToolTipHintMsg(getString("AltToolTipHintMsg")); - } - else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) - { - mMap->setToolTipHintMsg(getString("ToolTipHintMsg")); - } + mMap->setToolTipHintMsg(getString("ToolTipHintMsg")); + mMap->setAltToolTipHintMsg(getString("AltToolTipHintMsg")); sendChildToBack(mMap); mTextBoxNorth = getChild("floater_map_north"); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index e87ec10e5d..29623ccd53 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -699,7 +699,15 @@ BOOL LLNetMap::handleToolTip(S32 x, S32 y, MASK mask) } } - std::string tool_tip_hint_msg = mToolTipHintMsg; + std::string tool_tip_hint_msg; + if (gSavedSettings.getBOOL("DoubleClickTeleport")) + { + tool_tip_hint_msg = mAltToolTipHintMsg; + } + else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) + { + tool_tip_hint_msg = mToolTipHintMsg; + } LLStringUtil::format_map_t args; args["[PARCEL_NAME_MSG]"] = parcel_name_msg.empty() ? "" : parcel_name_msg + '\n'; diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index e7eeda7dcc..b82b3d4105 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -88,6 +88,7 @@ public: void setParcelOwnerMsg(const std::string& msg) { mParcelOwnerMsg = msg; } void setRegionNameMsg(const std::string& msg) { mRegionNameMsg = msg; } void setToolTipHintMsg(const std::string& msg) { mToolTipHintMsg = msg; } + void setAltToolTipHintMsg(const std::string& msg) { mAltToolTipHintMsg = msg; } void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); @@ -140,6 +141,7 @@ private: std::string mParcelOwnerMsg; std::string mRegionNameMsg; std::string mToolTipHintMsg; + std::string mAltToolTipHintMsg; public: void setSelected(uuid_vec_t uuids) { gmSelected=uuids; }; From fcbd928679619f2d1cb8550a30234dcdfc50ef81 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 25 Feb 2022 15:31:49 -0800 Subject: [PATCH 014/122] SL-16918: Minimap navigation improvements: Drag without holding shift, remove auto center, click button to re-center --- indra/newview/app_settings/settings.xml | 11 -- indra/newview/llnetmap.cpp | 157 +++++++++--------- indra/newview/llnetmap.h | 13 +- .../skins/default/xui/en/menu_mini_map.xml | 15 +- 4 files changed, 95 insertions(+), 101 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3ecfa4ef9a..d6836dd8ba 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6049,17 +6049,6 @@ Value 1 - MiniMapAutoCenter - - Comment - Center the focal point of the minimap. - Persist - 1 - Type - Boolean - Value - 1 - Marker Comment diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 29623ccd53..f7bcee2bbc 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -87,7 +87,6 @@ LLNetMap::LLNetMap (const Params & p) mPixelsPerMeter( MAP_SCALE_MID / REGION_WIDTH_METERS ), mObjectMapTPM(0.f), mObjectMapPixels(0.f), - mTargetPan(0.f, 0.f), mCurPan(0.f, 0.f), mStartPan(0.f, 0.f), mMouseDown(0, 0), @@ -112,13 +111,17 @@ LLNetMap::~LLNetMap() BOOL LLNetMap::postBuild() { - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - - registrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2)); - registrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2)); + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar commitRegistrar; - mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - return TRUE; + commitRegistrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2)); + commitRegistrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2)); + commitRegistrar.add("Minimap.Center.Activate", boost::bind(&LLNetMap::activateCenterMap, this, _2)); + + mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_mini_map.xml", gMenuHolder, + LLViewerMenuHolderGL::child_registry_t::instance()); + mPopupMenu->setItemEnabled("Re-Center Map", false); + + return true; } void LLNetMap::setScale( F32 scale ) @@ -166,10 +169,16 @@ void LLNetMap::draw() createObjectImage(); } - static LLUICachedControl auto_center("MiniMapAutoCenter", true); - if (auto_center) + mCentering = mCentering && !mPanning; + if (mCentering) { - mCurPan = lerp(mCurPan, mTargetPan, LLSmoothInterpolation::getInterpolant(0.1f)); + mCurPan = lerp(mCurPan, LLVector2(0.0f, 0.0f) , LLSmoothInterpolation::getInterpolant(0.1f)); + if (abs(mCurPan.mV[0]) < 0.5f && abs(mCurPan.mV[1]) < 0.5f){ + mCurPan.mV[0] = 0.0f; + mCurPan.mV[1] = 0.0f; + mCentering = false; + mPopupMenu->setItemEnabled("Re-Center Map", false); + } } // Prepare a scissor region @@ -589,23 +598,25 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { - // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in - F32 new_scale = mScale * pow(MAP_SCALE_ZOOM_FACTOR, -clicks); + // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in + F32 new_scale = mScale * pow(MAP_SCALE_ZOOM_FACTOR, -clicks); + // *TODO: Decide if we want this feature +#if 0 F32 old_scale = mScale; +#endif - setScale(new_scale); + setScale(new_scale); - static LLUICachedControl auto_center("MiniMapAutoCenter", true); - if (!auto_center) - { - // Adjust pan to center the zoom on the mouse pointer - LLVector2 zoom_offset; - zoom_offset.mV[VX] = x - getRect().getWidth() / 2; - zoom_offset.mV[VY] = y - getRect().getHeight() / 2; - mCurPan -= zoom_offset * mScale / old_scale - zoom_offset; - } + // *TODO: Decide if we want this feature +#if 0 + // Adjust pan to center the zoom on the mouse pointer + LLVector2 zoom_offset; + zoom_offset.mV[VX] = x - getRect().getWidth() / 2; + zoom_offset.mV[VY] = y - getRect().getHeight() / 2; + mCurPan -= zoom_offset * mScale / old_scale - zoom_offset; +#endif - return TRUE; + return true; } BOOL LLNetMap::handleToolTip(S32 x, S32 y, MASK mask) @@ -898,50 +909,48 @@ void LLNetMap::createObjectImage() mUpdateNow = true; } -BOOL LLNetMap::handleMouseDown( S32 x, S32 y, MASK mask ) +BOOL LLNetMap::handleMouseDown(S32 x, S32 y, MASK mask) { - if (!(mask & MASK_SHIFT)) return FALSE; + // Start panning + gFocusMgr.setMouseCapture(this); - // Start panning - gFocusMgr.setMouseCapture(this); - - mStartPan = mCurPan; - mMouseDown.mX = x; - mMouseDown.mY = y; - return TRUE; + mStartPan = mCurPan; + mMouseDown.mX = x; + mMouseDown.mY = y; + return true; } -BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask ) +BOOL LLNetMap::handleMouseUp(S32 x, S32 y, MASK mask) { - if(abs(mMouseDown.mX-x)<3 && abs(mMouseDown.mY-y)<3) - handleClick(x,y,mask); + if (abs(mMouseDown.mX - x) < 3 && abs(mMouseDown.mY - y) < 3) + { + handleClick(x, y, mask); + } - if (hasMouseCapture()) - { - if (mPanning) - { - // restore mouse cursor - S32 local_x, local_y; - local_x = mMouseDown.mX + llfloor(mCurPan.mV[VX] - mStartPan.mV[VX]); - local_y = mMouseDown.mY + llfloor(mCurPan.mV[VY] - mStartPan.mV[VY]); - LLRect clip_rect = getRect(); - clip_rect.stretch(-8); - clip_rect.clipPointToRect(mMouseDown.mX, mMouseDown.mY, local_x, local_y); - LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y); + if (hasMouseCapture()) + { + if (mPanning) + { + // restore mouse cursor + S32 local_x, local_y; + local_x = mMouseDown.mX + llfloor(mCurPan.mV[VX] - mStartPan.mV[VX]); + local_y = mMouseDown.mY + llfloor(mCurPan.mV[VY] - mStartPan.mV[VY]); + LLRect clip_rect = getRect(); + clip_rect.stretch(-8); + clip_rect.clipPointToRect(mMouseDown.mX, mMouseDown.mY, local_x, local_y); + LLUI::getInstance()->setMousePositionLocal(this, local_x, local_y); - // finish the pan - mPanning = false; + // finish the pan + mPanning = false; - mMouseDown.set(0, 0); + mMouseDown.set(0, 0); + } + gViewerWindow->showCursor(); + gFocusMgr.setMouseCapture(NULL); + return true; + } - // auto centre - mTargetPan.setZero(); - } - gViewerWindow->showCursor(); - gFocusMgr.setMouseCapture(NULL); - return TRUE; - } - return FALSE; + return false; } BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -1015,9 +1024,10 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask ) { if (!mPanning) { - // just started panning, so hide cursor + // Just started panning. Hide cursor and enable the "Re-Center Map" button. mPanning = true; gViewerWindow->hideCursor(); + mPopupMenu->setItemEnabled("Re-Center Map", true); } LLVector2 delta(static_cast(gViewerWindow->getCurrentMouseDX()), @@ -1025,26 +1035,21 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask ) // Set pan to value at start of drag + offset mCurPan += delta; - mTargetPan = mCurPan; gViewerWindow->moveCursorToCenter(); } + } - // Doesn't really matter, cursor should be hidden - gViewerWindow->setCursor( UI_CURSOR_TOOLPAN ); - } - else - { - if (mask & MASK_SHIFT) - { - // If shift is held, change the cursor to hint that the map can be dragged - gViewerWindow->setCursor( UI_CURSOR_TOOLPAN ); - } - else - { - gViewerWindow->setCursor( UI_CURSOR_CROSS ); - } - } + if (mask & MASK_SHIFT) + { + // If shift is held, change the cursor to hint that the map can be + // dragged. However, holding shift is not required to drag the map. + gViewerWindow->setCursor( UI_CURSOR_TOOLPAN ); + } + else + { + gViewerWindow->setCursor( UI_CURSOR_CROSS ); + } return TRUE; } @@ -1083,3 +1088,5 @@ void LLNetMap::handleStopTracking (const LLSD& userdata) LLTracker::stopTracking (LLTracker::isTracking(NULL)); } } + +void LLNetMap::activateCenterMap(const LLSD &userdata) { mCentering = true; } diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index b82b3d4105..0f2eee171d 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -121,11 +121,11 @@ private: F32 mObjectMapPixels; // Width of object map in pixels F32 mDotRadius; // Size of avatar markers - bool mPanning; // map is being dragged - LLVector2 mTargetPan; - LLVector2 mCurPan; - LLVector2 mStartPan; // pan offset at start of drag - LLCoordGL mMouseDown; // pointer position at start of drag + bool mPanning; // map is being dragged + bool mCentering; // map is being re-centered around the agent + LLVector2 mCurPan; + LLVector2 mStartPan; // pan offset at start of drag + LLCoordGL mMouseDown; // pointer position at start of drag LLVector3d mObjectImageCenterGlobal; LLPointer mObjectRawImagep; @@ -148,7 +148,8 @@ public: private: void handleZoom(const LLSD& userdata); - void handleStopTracking (const LLSD& userdata); + void handleStopTracking(const LLSD& userdata); + void activateCenterMap(const LLSD& userdata); LLMenuGL* mPopupMenu; uuid_vec_t gmSelected; diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index c3899b35cd..ddc952dfe7 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -46,16 +46,13 @@ function="ToggleControl" parameter="MiniMapRotate" /> - - - - + + + From 39e553fc11ef1a96707abb0a26c3b1be06954436 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 3 Mar 2022 11:06:16 -0800 Subject: [PATCH 015/122] SL-16918: Re-add "Auto-center map" button to minimap context menu, enable minimap auto-center by default again --- indra/newview/app_settings/settings.xml | 11 +++++ indra/newview/llnetmap.cpp | 45 ++++++++++--------- .../skins/default/xui/en/menu_mini_map.xml | 10 +++++ 3 files changed, 46 insertions(+), 20 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d6836dd8ba..3ecfa4ef9a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6049,6 +6049,17 @@ Value 1 + MiniMapAutoCenter + + Comment + Center the focal point of the minimap. + Persist + 1 + Type + Boolean + Value + 1 + Marker Comment diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f7bcee2bbc..387964f4e8 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -169,17 +169,25 @@ void LLNetMap::draw() createObjectImage(); } + static LLUICachedControl auto_center("MiniMapAutoCenter", true); + bool auto_centering = auto_center && !mPanning; mCentering = mCentering && !mPanning; - if (mCentering) + bool centered = mCurPan.mV[VX] == 0.0f && mCurPan.mV[VY] == 0.0f; + + if (auto_centering || mCentering) { mCurPan = lerp(mCurPan, LLVector2(0.0f, 0.0f) , LLSmoothInterpolation::getInterpolant(0.1f)); - if (abs(mCurPan.mV[0]) < 0.5f && abs(mCurPan.mV[1]) < 0.5f){ - mCurPan.mV[0] = 0.0f; - mCurPan.mV[1] = 0.0f; - mCentering = false; - mPopupMenu->setItemEnabled("Re-Center Map", false); - } } + centered = abs(mCurPan.mV[VX]) < 0.5f && abs(mCurPan.mV[VY]) < 0.5f; + if (centered) + { + mCurPan.mV[0] = 0.0f; + mCurPan.mV[1] = 0.0f; + mCentering = false; + } + + bool can_recenter_map = !(centered || mCentering || auto_centering); + mPopupMenu->setItemEnabled("Re-Center Map", can_recenter_map); // Prepare a scissor region F32 rotation = 0; @@ -600,21 +608,19 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in F32 new_scale = mScale * pow(MAP_SCALE_ZOOM_FACTOR, -clicks); - // *TODO: Decide if we want this feature -#if 0 F32 old_scale = mScale; -#endif setScale(new_scale); - // *TODO: Decide if we want this feature -#if 0 - // Adjust pan to center the zoom on the mouse pointer - LLVector2 zoom_offset; - zoom_offset.mV[VX] = x - getRect().getWidth() / 2; - zoom_offset.mV[VY] = y - getRect().getHeight() / 2; - mCurPan -= zoom_offset * mScale / old_scale - zoom_offset; -#endif + static LLUICachedControl auto_center("MiniMapAutoCenter", true); + if (!auto_center) + { + // Adjust pan to center the zoom on the mouse pointer + LLVector2 zoom_offset; + zoom_offset.mV[VX] = x - getRect().getWidth() / 2; + zoom_offset.mV[VY] = y - getRect().getHeight() / 2; + mCurPan -= zoom_offset * mScale / old_scale - zoom_offset; + } return true; } @@ -1024,10 +1030,9 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask ) { if (!mPanning) { - // Just started panning. Hide cursor and enable the "Re-Center Map" button. + // Just started panning. Hide cursor. mPanning = true; gViewerWindow->hideCursor(); - mPopupMenu->setItemEnabled("Re-Center Map", true); } LLVector2 delta(static_cast(gViewerWindow->getCurrentMouseDX()), diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index ddc952dfe7..402e1b34d0 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -47,6 +47,16 @@ parameter="MiniMapRotate" /> + + + + + From 340213b3023ec1dcc58587f35d270a3ad1a1e83d Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Thu, 3 Mar 2022 18:56:52 -0800 Subject: [PATCH 016/122] SL-9748 - Only supply a default physics shape if it is named default_physics_shape --- indra/newview/cube.dae | 2 +- indra/newview/llfloatermodelpreview.cpp | 2 +- indra/newview/llmodelpreview.cpp | 32 +++++++++++++------------ indra/newview/llmodelpreview.h | 4 ++-- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/indra/newview/cube.dae b/indra/newview/cube.dae index f9df955ff2..085b2c7309 100644 --- a/indra/newview/cube.dae +++ b/indra/newview/cube.dae @@ -51,7 +51,7 @@ - + diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 4a51533a57..d99d95934c 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -483,7 +483,7 @@ void LLFloaterModelPreview::prepareToLoadModel(S32 lod) { // loading physics from file mModelPreview->mPhysicsSearchLOD = lod; - mModelPreview->mLastSpecifiedPhysicsP = NULL; + mModelPreview->mWarnOfUnmatchedPhyicsMeshes = false; } } void LLFloaterModelPreview::loadModel(S32 lod) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 4e3b4c5c41..7578d3b9bb 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -86,6 +86,7 @@ static const LLColor4 PREVIEW_DEG_FILL_COL(1.f, 0.f, 0.f, 0.5f); static const F32 PREVIEW_DEG_EDGE_WIDTH(3.f); static const F32 PREVIEW_DEG_POINT_SIZE(8.f); static const F32 PREVIEW_ZOOM_LIMIT(10.f); +static const std::string DEFAULT_PHYSICS_MESH_NAME = "default_physics_shape"; const F32 SKIN_WEIGHT_CAMERA_DISTANCE = 16.f; @@ -465,15 +466,19 @@ void LLModelPreview::rebuildUploadData() LLFloaterModelPreview::addStringToLog(out, false); } } - if (mLastSpecifiedPhysicsP && !lod_model && (i == LLModel::LOD_PHYSICS)) + if (mWarnOfUnmatchedPhyicsMeshes && !lod_model && (i == LLModel::LOD_PHYSICS)) { // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition. - // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted. + // That's ok, but might not what they wanted. Use default_physics_shape if found. std::ostringstream out; - out << "No physics model specified for " << instance.mLabel << ". Reusing physics model " << mLastSpecifiedPhysicsModelOriginalName << "."; + out << "No physics model specified for " << instance.mLabel; + if (mDefaultPhysicsShapeP) + { + out << " - using: " << DEFAULT_PHYSICS_MESH_NAME; + lod_model = mDefaultPhysicsShapeP; + } LL_WARNS() << out.str() << LL_ENDL; - LLFloaterModelPreview::addStringToLog(out, false); - lod_model = mLastSpecifiedPhysicsP; + LLFloaterModelPreview::addStringToLog(out, !mDefaultPhysicsShapeP); // Flash log tab if no default. } if (lod_model) @@ -1061,6 +1066,13 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) } else { + if (loaded_lod == LLModel::LOD_PHYSICS) + { // Explicitly loading physics. See if there is a default mesh. + LLMatrix4 ignored_transform; // Each mesh that uses this will supply their own. + mDefaultPhysicsShapeP = nullptr; + FindModel(mScene[loaded_lod], DEFAULT_PHYSICS_MESH_NAME + getLodSuffix(loaded_lod), mDefaultPhysicsShapeP, ignored_transform); + mWarnOfUnmatchedPhyicsMeshes = true; + } BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching"); if (!legacyMatching) { @@ -1131,20 +1143,10 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod) LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, false); } - if (loaded_lod == LLModel::LOD_PHYSICS) - { - mLastSpecifiedPhysicsModelOriginalName = loaded_name; - mLastSpecifiedPhysicsP = mModel[loaded_lod][idx]; - } mModel[loaded_lod][idx]->mLabel = name; } } } - else if ((loaded_lod == LLModel::LOD_PHYSICS) && !mLastSpecifiedPhysicsP) - { - mLastSpecifiedPhysicsModelOriginalName = stripSuffix(mModel[loaded_lod][0]->mLabel); - mLastSpecifiedPhysicsP = mModel[loaded_lod][0]; - } } } } diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 9105ad2716..c46f9197e7 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -217,8 +217,8 @@ private: LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; } // Count amount of original models, excluding sub-models static U32 countRootModels(LLModelLoader::model_list models); - LLModel* mLastSpecifiedPhysicsP{}; // As opposed to being found by name or LOD; - std::string mLastSpecifiedPhysicsModelOriginalName{""}; // Since the above will have it's label bashed. + LLModel* mDefaultPhysicsShapeP{}; // If supplied by name in physics file. + bool mWarnOfUnmatchedPhyicsMeshes{false}; protected: friend class LLModelLoader; From 7f8236140266bb1f057333b3f0f8f2ea30e1aef0 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Fri, 4 Mar 2022 16:49:30 -0800 Subject: [PATCH 017/122] SL-9748 - add code doc! --- indra/newview/llmodelpreview.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index c46f9197e7..f5f4227049 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -217,8 +217,21 @@ private: LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; } // Count amount of original models, excluding sub-models static U32 countRootModels(LLModelLoader::model_list models); - LLModel* mDefaultPhysicsShapeP{}; // If supplied by name in physics file. + /// Indicates whether we should warn of high-lod meshes that do not have a corresponding physics mesh. + /// Reset when resetting the modelpreview (i.e., when the uploader dialog is created or reset), and when + /// about to process a physics file. Set to true immediately after the file is loaded (before rebuildUploadData()). + /// + /// (The rules for mapping the correspondence of high-lod meshes to physics meshes are complex. When + /// lod rendering meshes are used, there is never an unmatched mesh. Nor is there a mismatch when + /// the high-lod file and physics file have ony one mesh each. In these cases, this value is moot. + /// When there are multiple meshes in each file, they are matched by name or order, and some meshes + /// are broken up by limitations into multiple objects, and thus there can be mismatches.) bool mWarnOfUnmatchedPhyicsMeshes{false}; + /// A mesh to use as the default physics shape in only those cases where the physics shape is not otherwise specified. + /// It is set only when the user chooses a physics shape file that contains a mesh with a name that matches DEFAULT_PHYSICS_MESH_NAME. + /// It is reset when such a name is not found, and when resetting the modelpreview. + /// Not read unless mWarnOfUnmatchedPhyicsMeshes is true. + LLModel* mDefaultPhysicsShapeP{}; protected: friend class LLModelLoader; From 9e24280d81fd278caa914b8d54b26c3dc7f67242 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 16 Mar 2022 19:30:13 +0200 Subject: [PATCH 018/122] SL-16667 Show 'Voice volume' tooltip --- indra/newview/skins/default/xui/en/panel_avatar_list_item.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index aa1b929412..54f038c24f 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -155,6 +155,7 @@ right="-3" mouse_opaque="true" name="speaking_indicator" + tool_tip="Voice volume" visible="true" width="20" /> From d6febef0ec4619da615bd777a3f71f97d13d3e14 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Wed, 9 Mar 2022 10:11:40 -0800 Subject: [PATCH 019/122] Fix DRTVWR-550 TeamCity build. codesigning retry block had some leftover python2 syntax --- indra/newview/viewer_manifest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index ae3ed56b3d..1809b707ef 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1313,9 +1313,8 @@ class DarwinManifest(ViewerManifest): ] for attempt in range(3): if attempt: # second or subsequent iteration - print >> sys.stderr, \ - ("codesign failed, waiting %d seconds before retrying" % - sign_retry_wait) + print("codesign failed, waiting {:d} seconds before retrying".format(sign_retry_wait), + file=sys.stderr) time.sleep(sign_retry_wait) sign_retry_wait*=2 From c8eb9f54c4aa3b72184eb8a6bfc1ec6fd22320b7 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Wed, 9 Mar 2022 16:47:35 -0800 Subject: [PATCH 020/122] More DRTVWR-550 Teamcity build fix. another piece of python2 syntax leftover in an error handling block --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 1809b707ef..c9aa82f7d4 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1344,7 +1344,7 @@ class DarwinManifest(ViewerManifest): # 'err' goes out of scope sign_failed = err else: - print >> sys.stderr, "Maximum codesign attempts exceeded; giving up" + print("Maximum codesign attempts exceeded; giving up", file=sys.stderr) raise sign_failed self.run_command(['spctl', '-a', '-texec', '-vvvv', app_in_dmg]) self.run_command([self.src_path_of("installers/darwin/apple-notarize.sh"), app_in_dmg]) From 0d280ae11299f54eb81f7e978bf40fcb8d1f58fe Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 24 Mar 2022 17:49:55 +0200 Subject: [PATCH 021/122] SL-17030 show particle age info --- indra/llmessage/llpartdata.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp index 53aa35c0f9..6664eb02dc 100644 --- a/indra/llmessage/llpartdata.cpp +++ b/indra/llmessage/llpartdata.cpp @@ -311,8 +311,9 @@ BOOL LLPartSysData::unpack(LLDataPacker &dp) std::ostream& operator<<(std::ostream& s, const LLPartSysData &data) { s << "Flags: " << std::hex << data.mFlags; - s << " Pattern: " << std::hex << (U32) data.mPattern << "\n"; - s << "Age: [" << data.mStartAge << ", " << data.mMaxAge << "]\n"; + s << "Pattern: " << std::hex << (U32) data.mPattern << "\n"; + s << "Source Age: [" << data.mStartAge << ", " << data.mMaxAge << "]\n"; + s << "Particle Age: " << data.mPartData.mMaxAge << "\n"; s << "Angle: [" << data.mInnerAngle << ", " << data.mOuterAngle << "]\n"; s << "Burst Rate: " << data.mBurstRate << "\n"; s << "Burst Radius: " << data.mBurstRadius << "\n"; From 322320a90fdfa61341090bd638cef0679bfc84b5 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 30 Mar 2022 18:29:33 +0300 Subject: [PATCH 022/122] SL-16668 Enable/disable appropriate menu items in context menu --- indra/newview/llfloaterland.cpp | 6 +++--- indra/newview/llfloaterland.h | 1 + indra/newview/llfloaterregioninfo.cpp | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 04133f2710..ff2384e382 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -3054,7 +3054,8 @@ BOOL LLPanelLandCovenant::postBuild() { mLastRegionID = LLUUID::null; mNextUpdateTime = 0; - + mTextEstateOwner = getChild("estate_owner_text"); + mTextEstateOwner->setIsFriendCallback(LLAvatarActions::isFriend); return TRUE; } @@ -3162,8 +3163,7 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name) LLPanelLandCovenant* self = LLFloaterLand::getCurrentPanelLandCovenant(); if (self) { - LLTextBox* editor = self->getChild("estate_owner_text"); - if (editor) editor->setText(name); + self->mTextEstateOwner->setText(name); } } diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 5d9b411f04..684950d88b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -413,6 +413,7 @@ protected: private: LLUUID mLastRegionID; F64 mNextUpdateTime; //seconds since client start + LLTextBox* mTextEstateOwner; }; #endif diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 19080f05c0..1390f56ea7 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -47,6 +47,7 @@ #include "llagent.h" #include "llappviewer.h" +#include "llavataractions.h" #include "llavatarname.h" #include "llfloateravatarpicker.h" #include "llbutton.h" @@ -1826,7 +1827,7 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) setCtrlsEnabled(god || owner || manager); getChildView("apply_btn")->setEnabled(FALSE); - + getChildView("estate_owner")->setEnabled(TRUE); getChildView("message_estate_btn")->setEnabled(god || owner || manager); getChildView("kick_user_from_estate_btn")->setEnabled(god || owner || manager); @@ -1888,6 +1889,8 @@ BOOL LLPanelEstateInfo::postBuild() getChild("externally_visible_radio")->setFocus(TRUE); + getChild("estate_owner")->setIsFriendCallback(LLAvatarActions::isFriend); + return LLPanelRegionInfo::postBuild(); } @@ -2132,6 +2135,7 @@ BOOL LLPanelEstateCovenant::postBuild() { mEstateNameText = getChild("estate_name_text"); mEstateOwnerText = getChild("estate_owner_text"); + mEstateOwnerText->setIsFriendCallback(LLAvatarActions::isFriend); mLastModifiedText = getChild("covenant_timestamp_text"); mEditor = getChild("covenant_editor"); LLButton* reset_button = getChild("reset_covenant"); From e893185d20343be31f6f5b1973c83e6912ac9f95 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 31 Mar 2022 12:17:13 +0200 Subject: [PATCH 023/122] Remove invalid tooltips for mini map --- indra/newview/skins/default/xui/da/floater_map.xml | 6 ------ indra/newview/skins/default/xui/de/floater_map.xml | 6 ------ indra/newview/skins/default/xui/es/floater_map.xml | 6 ------ indra/newview/skins/default/xui/fr/floater_map.xml | 6 +++--- indra/newview/skins/default/xui/it/floater_map.xml | 6 ------ indra/newview/skins/default/xui/ja/floater_map.xml | 6 ------ indra/newview/skins/default/xui/pl/floater_map.xml | 6 ------ indra/newview/skins/default/xui/pt/floater_map.xml | 6 ------ indra/newview/skins/default/xui/ru/floater_map.xml | 6 ------ indra/newview/skins/default/xui/tr/floater_map.xml | 6 ------ indra/newview/skins/default/xui/zh/floater_map.xml | 6 ------ 11 files changed, 3 insertions(+), 63 deletions(-) diff --git a/indra/newview/skins/default/xui/da/floater_map.xml b/indra/newview/skins/default/xui/da/floater_map.xml index 4912d73ba0..66accacfc2 100644 --- a/indra/newview/skins/default/xui/da/floater_map.xml +++ b/indra/newview/skins/default/xui/da/floater_map.xml @@ -1,11 +1,5 @@ - - [REGION](Dobbeltklik for at åbne kort, klik-og-træk for at panorere) - - - [REGION](Dobbeltklik for at teleportere, træk for at panorere) - MINIKORT diff --git a/indra/newview/skins/default/xui/de/floater_map.xml b/indra/newview/skins/default/xui/de/floater_map.xml index d0a6c54246..96a61e45ad 100644 --- a/indra/newview/skins/default/xui/de/floater_map.xml +++ b/indra/newview/skins/default/xui/de/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](Doppelklicken, um Karte zu öffnen; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken) - - - [REGION](Doppelklicken, um zu teleportieren; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken) - Minikarte diff --git a/indra/newview/skins/default/xui/es/floater_map.xml b/indra/newview/skins/default/xui/es/floater_map.xml index 53057a28ef..1a2b72cf86 100644 --- a/indra/newview/skins/default/xui/es/floater_map.xml +++ b/indra/newview/skins/default/xui/es/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](Doble clic para abrir el Mapa, mayús. y arrastrar para obtener panorámica) - - - [REGION](Doble clic para teleportarte, mayús. y arrastrar para obtener panorámica) - Minimapa diff --git a/indra/newview/skins/default/xui/fr/floater_map.xml b/indra/newview/skins/default/xui/fr/floater_map.xml index 37d43afcea..1e14a07271 100644 --- a/indra/newview/skins/default/xui/fr/floater_map.xml +++ b/indra/newview/skins/default/xui/fr/floater_map.xml @@ -1,8 +1,8 @@ - [AGENT][REGION](Double-clic pour ouvrir la carte, maintenez shift pour une vue panoramique) - [REGION](Double -clic pour vous téléporter, maintenez shift pour une vue panoramique) - Mini-carte + + Mini-carte + N diff --git a/indra/newview/skins/default/xui/it/floater_map.xml b/indra/newview/skins/default/xui/it/floater_map.xml index b9a4f7103b..3a53c7769a 100644 --- a/indra/newview/skins/default/xui/it/floater_map.xml +++ b/indra/newview/skins/default/xui/it/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](Fai doppio clic per aprire la mappa, premi il tasto Maiusc e trascina per la panoramica) - - - [REGION](Fai doppio clic per teleport, premi il tasto Maiusc e trascina per la panoramica) - Minimappa diff --git a/indra/newview/skins/default/xui/ja/floater_map.xml b/indra/newview/skins/default/xui/ja/floater_map.xml index e4e01c23ce..d2f7d2ee86 100644 --- a/indra/newview/skins/default/xui/ja/floater_map.xml +++ b/indra/newview/skins/default/xui/ja/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](ダブルクリックで地図を開く。Shift‐ドラッグで水平・垂直移動する) - - - [地域](ダブルクリックでテレポート。Shift‐ドラッグで水平・垂直移動する) - ミニマップ diff --git a/indra/newview/skins/default/xui/pl/floater_map.xml b/indra/newview/skins/default/xui/pl/floater_map.xml index eabdeeb2c7..6c6163f07d 100644 --- a/indra/newview/skins/default/xui/pl/floater_map.xml +++ b/indra/newview/skins/default/xui/pl/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](Kliknij dwa razy by otworzyć Mapę, przeciągaj z shiftem by zmienić skalę) - - - [REGION](Kliknij dwa razy by teleportować, przeciągaj z shiftem by przesunąć) - Minimapa diff --git a/indra/newview/skins/default/xui/pt/floater_map.xml b/indra/newview/skins/default/xui/pt/floater_map.xml index 8233f2a43f..0671161073 100644 --- a/indra/newview/skins/default/xui/pt/floater_map.xml +++ b/indra/newview/skins/default/xui/pt/floater_map.xml @@ -1,11 +1,5 @@ - - [REGION](Clique duas vezes para abrir o mapa, shift+arraste para a visão pan) - - - [REGION](Clique duas vezes para teletransportar, shift+arraste para a visão pan) - Mini Mapa diff --git a/indra/newview/skins/default/xui/ru/floater_map.xml b/indra/newview/skins/default/xui/ru/floater_map.xml index 0ce846b9ce..0c500e441b 100644 --- a/indra/newview/skins/default/xui/ru/floater_map.xml +++ b/indra/newview/skins/default/xui/ru/floater_map.xml @@ -1,11 +1,5 @@ - - [AGENT][REGION](Двойное нажатие, чтобы открыть карту, переместить мышку с Shift для изменения масштаба) - - - [REGION](Двойное нажатие, чтобы телепортироваться, переместить мышку с Shift для изменения масштаба) - Миникарта diff --git a/indra/newview/skins/default/xui/tr/floater_map.xml b/indra/newview/skins/default/xui/tr/floater_map.xml index 7d6c314f04..ff8579a17f 100644 --- a/indra/newview/skins/default/xui/tr/floater_map.xml +++ b/indra/newview/skins/default/xui/tr/floater_map.xml @@ -1,11 +1,5 @@ - - [REGION](Haritayı açmak için çift tıkla, yatay hareket için shift çek) - - - [REGION](Işınlamak için çift tıkla, yatay hareket için shift çek) - Mini-harita diff --git a/indra/newview/skins/default/xui/zh/floater_map.xml b/indra/newview/skins/default/xui/zh/floater_map.xml index 8a030b3b3f..8c4aceee09 100644 --- a/indra/newview/skins/default/xui/zh/floater_map.xml +++ b/indra/newview/skins/default/xui/zh/floater_map.xml @@ -1,11 +1,5 @@ - - [REGION](雙擊以開啟地圖,按下 shift 鍵拖曳來平移) - - - [REGION](雙擊以瞬間傳送,按下 shift 鍵拖曳來平移) - 迷你地圖 From 99c14e9db4a7be79e2ed6ce5b8139eba5efe4807 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 31 Mar 2022 12:24:00 +0200 Subject: [PATCH 024/122] Update German translation --- .../skins/default/xui/de/floater_map.xml | 18 ++++++++++++++++++ .../default/xui/de/floater_model_preview.xml | 3 +++ .../default/xui/de/panel_avatar_list_item.xml | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/de/floater_map.xml b/indra/newview/skins/default/xui/de/floater_map.xml index 96a61e45ad..d68c4b2000 100644 --- a/indra/newview/skins/default/xui/de/floater_map.xml +++ b/indra/newview/skins/default/xui/de/floater_map.xml @@ -1,5 +1,23 @@ + + Preis: [PRICE] L$ ([PRICE_PER_SQM] L$/m²) + + + Fläche: [AREA]m² + + + Eigentümer: [PARCEL_OWNER] + + + Region: [REGION_NAME] + + + Doppelklicken, um Karte zu öffnen + + + Doppelklicken, um zu teleportieren + Minikarte diff --git a/indra/newview/skins/default/xui/de/floater_model_preview.xml b/indra/newview/skins/default/xui/de/floater_model_preview.xml index 088be49dbb..c08edfb94c 100644 --- a/indra/newview/skins/default/xui/de/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/de/floater_model_preview.xml @@ -242,6 +242,9 @@ Niedrigste + + Bounding Box + Würfel diff --git a/indra/newview/skins/default/xui/de/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/de/panel_avatar_list_item.xml index dd56494069..1603b39cbc 100644 --- a/indra/newview/skins/default/xui/de/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/de/panel_avatar_list_item.xml @@ -29,5 +29,5 @@