From 0308e9cfeed248c6347f6e5e4e3404f76ced9af1 Mon Sep 17 00:00:00 2001 From: shadoskill Date: Tue, 23 Jul 2024 09:25:11 -0500 Subject: [PATCH 1/5] Advanced tooltips. Add a toggle "ShowAdvancedHoverTips" to show more information on tooltips to include. Distance, Position, Prim Count, and Land Impact --- .../newview/app_settings/settings_alchemy.xml | 15 +++++- indra/newview/lltoolpie.cpp | 51 ++++++++++++++++++- .../newview/skins/default/xui/en/strings.xml | 18 +++++++ 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 0fbf3b24a6..7a167aa780 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -2490,5 +2490,18 @@ Value All + ShowAdvancedHoverTips + + Comment + + Toggles more hover tips details. + + Persist + 0 + Type + Boolean + Value + 0 + - \ No newline at end of file + diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index f69e2c8165..e468d2d742 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -76,6 +76,8 @@ #include "rlvhandler.h" // [/RLVa:KB] #include "alcinematicmode.h" +#include "llviewerregion.h" +#include "llmeshrepository.h" extern BOOL gDebugClicks; @@ -1311,7 +1313,54 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l } } + if (gSavedSettings.getBool("ShowAdvancedHoverTips") && (!RlvActions::isRlvEnabled() || RlvActions::canShowLocation())) + { + LLStringUtil::format_map_t args; + // Get Position + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + LLVector3 objectPosition = region->getPosRegionFromGlobal(hover_object->getPositionGlobal()); + if (RlvActions::canShowLocation()) + { + args["OBJECT_POSITION"] = + llformat("<%.02f, %.02f, %.02f>", objectPosition.mV[VX], objectPosition.mV[VY], objectPosition.mV[VZ]); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPosition", args)); + } + // Get Distance + F32 distance = (objectPosition - region->getPosRegionFromGlobal(gAgent.getPositionGlobal())).magVec(); + args["OBJECT_DISTANCE"] = llformat("%.02f", distance); + tooltip_msg.append("\n" + LLTrans::getString("TooltipDistance", args)); + } + + // Get Prim Count + args["PRIM_COUNT"] = llformat("%d", LLSelectMgr::getInstance()->getHoverObjects()->getObjectCount()); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCount", args)); + + // Get Prim Land Impact + if (gMeshRepo.meshRezEnabled()) + { + if (hover_object->getRegion() && gAgent.getRegion() && + hover_object->getRegion()->getRegionID() == gAgent.getRegion()->getRegionID()) + { + S32 cost = LLSelectMgr::getInstance()->getHoverObjects()->getSelectedLinksetCost(); + if (cost > 0) + { + args["PRIM_COST"] = llformat("%d", cost); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCost", args)); + } + else + { + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCostLoading")); + } + } + else + { + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCostUnavailable")); + } + } + } // Avoid showing tip over media that's displaying unless it's for sale // also check the primary node since sometimes it can have an action even though // the root node doesn't @@ -1324,7 +1373,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (show_all_object_tips || needs_tip) { -// [RLVa:KB] - Checked: RLVa-1.2.1 + // [RLVa:KB] - Checked: RLVa-1.2.1 if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canInteract(hover_object, mHoverPick.mObjectOffset)) ) { // [/RLVa:KB] diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 78d3e4d4a8..70d4e03ef4 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4560,4 +4560,22 @@ and report the problem. name="Permanent"> Permanent + + Prims: [PRIM_COUNT] + + + Land Impact: [PRIM_COST] + + + Loading Land Impact... + + + Unable To Load Land Impact. + + + Position: [OBJECT_POSITION] + + + Distance: [OBJECT_DISTANCE] + From d934f33987c3e88a9fff75cce8c46cb8fbc8bb66 Mon Sep 17 00:00:00 2001 From: shadoskill Date: Tue, 23 Jul 2024 10:09:56 -0500 Subject: [PATCH 2/5] Cleanup Remove a unneeded checks. Add a same region check to position. --- indra/newview/lltoolpie.cpp | 32 ++++++++----------- .../newview/skins/default/xui/en/strings.xml | 3 -- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index e468d2d742..a5400817ab 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1313,7 +1313,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l } } - if (gSavedSettings.getBool("ShowAdvancedHoverTips") && (!RlvActions::isRlvEnabled() || RlvActions::canShowLocation())) + if (gSavedSettings.getBool("ShowAdvancedHoverTips")) { LLStringUtil::format_map_t args; // Get Position @@ -1321,11 +1321,15 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (region) { LLVector3 objectPosition = region->getPosRegionFromGlobal(hover_object->getPositionGlobal()); - if (RlvActions::canShowLocation()) + if (!RlvActions::isRlvEnabled() || RlvActions::canShowLocation()) { - args["OBJECT_POSITION"] = - llformat("<%.02f, %.02f, %.02f>", objectPosition.mV[VX], objectPosition.mV[VY], objectPosition.mV[VZ]); - tooltip_msg.append("\n" + LLTrans::getString("TooltipPosition", args)); + //Check if we are in the same region, otherwise it shows large negitive position numbers. + if (hover_object->getRegion() && gAgent.getRegion() && hover_object->getRegion()->getRegionID() == gAgent.getRegion()->getRegionID()) + { + args["OBJECT_POSITION"] = + llformat("<%.02f, %.02f, %.02f>", objectPosition.mV[VX], objectPosition.mV[VY], objectPosition.mV[VZ]); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPosition", args)); + } } // Get Distance @@ -1341,23 +1345,15 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l // Get Prim Land Impact if (gMeshRepo.meshRezEnabled()) { - if (hover_object->getRegion() && gAgent.getRegion() && - hover_object->getRegion()->getRegionID() == gAgent.getRegion()->getRegionID()) + S32 cost = LLSelectMgr::getInstance()->getHoverObjects()->getSelectedLinksetCost(); + if (cost > 0) { - S32 cost = LLSelectMgr::getInstance()->getHoverObjects()->getSelectedLinksetCost(); - if (cost > 0) - { - args["PRIM_COST"] = llformat("%d", cost); - tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCost", args)); - } - else - { - tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCostLoading")); - } + args["PRIM_COST"] = llformat("%d", cost); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCost", args)); } else { - tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCostUnavailable")); + tooltip_msg.append("\n" + LLTrans::getString("TooltipPrimCostLoading")); } } } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 70d4e03ef4..48ae4619ee 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4569,9 +4569,6 @@ and report the problem. Loading Land Impact... - - Unable To Load Land Impact. - Position: [OBJECT_POSITION] From 83fbcb28bf2bd1da8ebba309ff86e30872db6edc Mon Sep 17 00:00:00 2001 From: shadoskill Date: Tue, 23 Jul 2024 10:12:34 -0500 Subject: [PATCH 3/5] Whoops turned off persist. --- indra/newview/app_settings/settings_alchemy.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 7a167aa780..39f57f8b2f 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -2497,7 +2497,7 @@ Toggles more hover tips details. Persist - 0 + 1 Type Boolean Value From b81fefd02c7530d448d14d3255ab997832984561 Mon Sep 17 00:00:00 2001 From: shadoskill Date: Tue, 23 Jul 2024 11:54:53 -0500 Subject: [PATCH 4/5] Fix editor being drunk. --- indra/newview/lltoolpie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index a5400817ab..1b5d491174 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1369,7 +1369,7 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (show_all_object_tips || needs_tip) { - // [RLVa:KB] - Checked: RLVa-1.2.1 +// [RLVa:KB] - Checked: RLVa-1.2.1 if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canInteract(hover_object, mHoverPick.mObjectOffset)) ) { // [/RLVa:KB] From e223deeb9cde49524f8e3a114a59670c9643caf5 Mon Sep 17 00:00:00 2001 From: shadoskill Date: Tue, 23 Jul 2024 12:02:06 -0500 Subject: [PATCH 5/5] Fix missing line ending. --- indra/newview/app_settings/settings_alchemy.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/app_settings/settings_alchemy.xml b/indra/newview/app_settings/settings_alchemy.xml index 39f57f8b2f..92cf017d4d 100644 --- a/indra/newview/app_settings/settings_alchemy.xml +++ b/indra/newview/app_settings/settings_alchemy.xml @@ -2505,3 +2505,4 @@ +