From 34a9e84cd89e9a5a748dd5aa0cc2666bf8f6c34a Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Thu, 17 Feb 2022 12:56:40 -0800 Subject: SL-16917: Fix minimap cardinal direction text being offset slightly, and move cardinal directions to the edge of the minimap --- indra/newview/llfloatermap.cpp | 64 +++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 17 deletions(-) mode change 100644 => 100755 indra/newview/llfloatermap.cpp (limited to '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. - - 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 ); - - // Inset by a little to account for position display. - radius -= 8.f; - - 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 )) ); + // 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 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; + + 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; + + 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() -- cgit v1.2.3 From 81da0dd2db7261e402c53445efa1d012177a4cfe Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Wed, 9 Feb 2022 18:03:52 -0800 Subject: 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 +++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'indra/newview/llfloatermap.cpp') 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) -- cgit v1.2.3 From 0e927e92f33f4a421a3cd56f7b9bc65c19003df2 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Mon, 28 Feb 2022 11:55:15 -0800 Subject: 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 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfloatermap.cpp') 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"); -- cgit v1.2.3 From f1b7ba6c284605f2104896d7316e74b1e436e821 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 18 Feb 2022 14:35:59 -0800 Subject: SL-16916: Update minimap context menu with new options and reworded existing options Map rotation: Split minimap "Rotate Map" context menu option into two options: "North at top" and "Camera at top" Zoom: - Adjust minimap context menu zoom presets: New presets are "far", "medium", "close", and "very close" - Change default minimap zoom level from 128 to 64 - Currently selected minimap zoom level is now checked About Land: Add "About Land" button to minimap context menu Reword: Rearrange and adjust capitalization of the various context menu options Code change: Remove unused zoom handling code in LLFloaterMap --- indra/newview/llfloatermap.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'indra/newview/llfloatermap.cpp') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 95c43805d4..fd1af7ccc0 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -248,32 +248,6 @@ void LLFloaterMap::reshape(S32 width, S32 height, BOOL called_from_parent) updateMinorDirections(); } -void LLFloaterMap::handleZoom(const LLSD& userdata) -{ - std::string level = userdata.asString(); - - F32 scale = 0.0f; - if (level == std::string("default")) - { - LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale"); - if(pvar) - { - pvar->resetToDefault(); - scale = gSavedSettings.getF32("MiniMapScale"); - } - } - else if (level == std::string("close")) - scale = LLNetMap::MAP_SCALE_MAX; - else if (level == std::string("medium")) - scale = LLNetMap::MAP_SCALE_MID; - else if (level == std::string("far")) - scale = LLNetMap::MAP_SCALE_MIN; - if (scale != 0.0f) - { - mMap->setScale(scale); - } -} - LLFloaterMap* LLFloaterMap::getInstance() { return LLFloaterReg::getTypedInstance("mini_map"); -- cgit v1.2.3