Skip to content
Snippets Groups Projects
Unverified Commit 3caaa9e5 authored by Rye Mutt's avatar Rye Mutt :bread: Committed by GitHub
Browse files

Merge pull request #89 from shadoskill/Tooltips

Advanced hovertips.
parents 9cce6993 e223deeb
No related branches found
No related tags found
No related merge requests found
...@@ -2490,5 +2490,19 @@ ...@@ -2490,5 +2490,19 @@
<key>Value</key> <key>Value</key>
<string>All</string> <string>All</string>
</map> </map>
<key>ShowAdvancedHoverTips</key>
<map>
<key>Comment</key>
<string>
Toggles more hover tips details.
</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map> </map>
</llsd> </llsd>
\ No newline at end of file
...@@ -76,6 +76,8 @@ ...@@ -76,6 +76,8 @@
#include "rlvhandler.h" #include "rlvhandler.h"
// [/RLVa:KB] // [/RLVa:KB]
#include "alcinematicmode.h" #include "alcinematicmode.h"
#include "llviewerregion.h"
#include "llmeshrepository.h"
extern BOOL gDebugClicks; extern BOOL gDebugClicks;
...@@ -1311,7 +1313,50 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l ...@@ -1311,7 +1313,50 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l
} }
} }
if (gSavedSettings.getBool("ShowAdvancedHoverTips"))
{
LLStringUtil::format_map_t args;
// Get Position
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
LLVector3 objectPosition = region->getPosRegionFromGlobal(hover_object->getPositionGlobal());
if (!RlvActions::isRlvEnabled() || RlvActions::canShowLocation())
{
//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
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())
{
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"));
}
}
}
// Avoid showing tip over media that's displaying unless it's for sale // 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 // also check the primary node since sometimes it can have an action even though
// the root node doesn't // the root node doesn't
......
...@@ -4560,4 +4560,19 @@ and report the problem. ...@@ -4560,4 +4560,19 @@ and report the problem.
name="Permanent"> name="Permanent">
Permanent Permanent
</string> </string>
<string name="TooltipPrimCount">
Prims: [PRIM_COUNT]
</string>
<string name="TooltipPrimCost">
Land Impact: [PRIM_COST]
</string>
<string name="TooltipPrimCostLoading">
Loading Land Impact...
</string>
<string name="TooltipPosition">
Position: [OBJECT_POSITION]
</string>
<string name="TooltipDistance">
Distance: [OBJECT_DISTANCE]
</string>
</strings> </strings>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment