Added sophisticated option to choose the double click action on the minimap and made handling and tooltips consistent throughout all minimap instances (FIRE-6705)

Ansariel 2012-06-21 17:38:47 +02:00
parent 90a7aa5c4a
commit 69303ab2ce
11 changed files with 255 additions and 78 deletions

View File

@ -17483,5 +17483,18 @@ Change of this parameter will affect the layout of buttons in notification toast
<integer>3</integer>
</map>
<!-- </FS:HG> -->
<key>FSNetMapDoubleClickAction</key>
<map>
<key>Comment</key>
<string>Defines the action happening if the a double click occurs on a minimap instance (minimap floater or within people panel): 0 = Nothing, 1 = Open world map, 2 = teleport to location</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>2</integer>
</map>
</map>
</llsd>

View File

@ -85,14 +85,16 @@ LLFloaterMap::~LLFloaterMap()
BOOL LLFloaterMap::postBuild()
{
mMap = getChild<LLNetMap>("Net Map");
if (gSavedSettings.getBOOL("DoubleClickTeleport"))
{
mMap->setToolTipMsg(getString("AltToolTipMsg"));
}
else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap"))
{
mMap->setToolTipMsg(getString("ToolTipMsg"));
}
// <FS:Ansariel> Synchronize tooltips throughout instances
//if (gSavedSettings.getBOOL("DoubleClickTeleport"))
//{
// mMap->setToolTipMsg(getString("AltToolTipMsg"));
//}
//else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap"))
//{
// mMap->setToolTipMsg(getString("ToolTipMsg"));
//}
// </FS:Ansariel> Synchronize tooltips throughout instances
sendChildToBack(mMap);
mTextBoxNorth = getChild<LLTextBox> ("floater_map_north");
@ -152,25 +154,28 @@ BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask)
LLVector3d pos_global = mMap->viewPosToGlobal(x, y);
// If we're not tracking a beacon already, double-click will set one
if (!LLTracker::isTracking(NULL))
{
LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
if (world_map)
{
world_map->trackLocation(pos_global);
}
}
if (gSavedSettings.getBOOL("DoubleClickTeleport"))
{
// If DoubleClickTeleport is on, double clicking the minimap will teleport there
gAgent.teleportViaLocationLookAt(pos_global);
}
else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap"))
{
LLFloaterReg::showInstance("world_map");
}
// <FS:Ansariel> Synchronize double click handling throughout instances
//// If we're not tracking a beacon already, double-click will set one
//if (!LLTracker::isTracking(NULL))
//{
// LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
// if (world_map)
// {
// world_map->trackLocation(pos_global);
// }
//}
//
//if (gSavedSettings.getBOOL("DoubleClickTeleport"))
//{
// // If DoubleClickTeleport is on, double clicking the minimap will teleport there
// gAgent.teleportViaLocationLookAt(pos_global);
//}
//else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap"))
//{
// LLFloaterReg::showInstance("world_map");
//}
mMap->performDoubleClickAction(pos_global);
// </FS:Ansariel> Synchronize double click handling throughout instances
return TRUE;
}
@ -359,9 +364,9 @@ void LLFloaterMap::handleShowProfile()
mMap->showProfile();
}
// <Ansariel> Avatar tracking feature
// <FS:Ansariel> Avatar tracking feature
void LLFloaterMap::handleStartTracking()
{
mMap->startTracking();
}
// </Ansariel> Avatar tracking feature
// </FS:Ansariel> Avatar tracking feature

View File

@ -95,8 +95,12 @@ const F64 COARSEUPDATE_MAX_Z = 1020.0f;
const F32 WIDTH_PIXELS = 2.f;
const S32 CIRCLE_STEPS = 100;
std::map<LLUUID, LLColor4> LLNetMap::sAvatarMarksMap; // Ansariel
F32 LLNetMap::sScale; // Ansariel: Synchronizing netmaps throughout instances
std::map<LLUUID, LLColor4> LLNetMap::sAvatarMarksMap; // <FS:Ansariel>
F32 LLNetMap::sScale; // <FS:Ansariel> Synchronizing netmaps throughout instances
// <FS:Ansariel> Synchronize tooltips throughout instances
std::string LLNetMap::sToolTipMsg;
// </FS:Ansariel> Synchronize tooltips throughout instances
LLNetMap::LLNetMap (const Params & p)
: LLUICtrl (p),
@ -116,7 +120,8 @@ LLNetMap::LLNetMap (const Params & p)
mObjectImagep(),
mClosestAgentToCursor(),
mClosestAgentAtLastRightClick(),
mToolTipMsg(),
// <FS:Ansariel> Synchronize tooltips throughout instances
//mToolTipMsg(),
mPopupMenu(NULL)
{
mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS);
@ -125,10 +130,10 @@ LLNetMap::LLNetMap (const Params & p)
LLNetMap::~LLNetMap()
{
// <Ansariel> Fixing borked minimap zoom level persistance
// <FS:Ansariel> Fixing borked minimap zoom level persistance
//gSavedSettings.setF32("MiniMapScale", mScale);
gSavedSettings.setF32("MiniMapScale", sScale);
// </Ansariel> Fixing borked minimap zoom level persistance
// </FS:Ansariel> Fixing borked minimap zoom level persistance
}
BOOL LLNetMap::postBuild()
@ -137,14 +142,17 @@ BOOL LLNetMap::postBuild()
registrar.add("Minimap.Zoom", boost::bind(&LLNetMap::handleZoom, this, _2));
registrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2));
// <Ansariel>
// <FS:Ansariel>
registrar.add("Minimap.Mark", boost::bind(&LLNetMap::handleMark, this, _2));
registrar.add("Minimap.ClearMarks", boost::bind(&LLNetMap::handleClearMarks, this));
// </Ansariel>
// </FS:Ansariel>
registrar.add("Minimap.Cam", boost::bind(&LLNetMap::handleCam, this));
registrar.add("Minimap.ShowProfile", boost::bind(&LLNetMap::handleShowProfile, this));
registrar.add("Minimap.StartTracking", boost::bind(&LLNetMap::handleStartTracking, this));
mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
// <FS:Ansariel> Synchronize tooltips throughout instances
LLNetMap::updateToolTipMsg();
return TRUE;
}
@ -153,7 +161,8 @@ void LLNetMap::setScale( F32 scale )
scale = llclamp(scale, MAP_SCALE_MIN, MAP_SCALE_MAX);
mCurPan *= scale / mScale;
mScale = scale;
sScale = scale; // Ansariel: Synchronize scale throughout instances
// <FS:Ansariel> Synchronize scale throughout instances
sScale = scale;
if (mObjectImagep.notNull())
{
@ -178,11 +187,12 @@ void LLNetMap::setScale( F32 scale )
void LLNetMap::draw()
{
// Ansariel: Synchronize netmap scale throughout instances
// <FS:Ansariel>: Synchronize netmap scale throughout instances
if (mScale != sScale)
{
setScale(sScale);
}
// </FS:Ansariel>: Synchronize netmap scale throughout instances
static LLFrameTimer map_timer;
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
@ -421,11 +431,12 @@ void LLNetMap::draw()
if (muteListInstance->isMuted(uuid)) color = map_avatar_muted_color;
else if (gCacheName->getFullName(uuid, fullName) && muteListInstance->isLinden(fullName)) color = map_avatar_linden_color;
// Mark Avatars with special colors - Ansariel
// <FS:Ansariel> Mark Avatars with special colors
if (LLNetMap::sAvatarMarksMap.find(uuid) != LLNetMap::sAvatarMarksMap.end())
{
color = LLNetMap::sAvatarMarksMap[uuid];
}
// </FS:Ansariel> Mark Avatars with special colors
//color based on contact sets prefs
if(LGGContactSets::getInstance()->hasFriendColorThatShouldShow(uuid,FALSE,FALSE,FALSE,TRUE))
@ -746,7 +757,9 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
// [RLVa:KB] - Checked: 2010-10-19 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b
region_name = ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION));
// [/RLVa:KB]
if (!region_name.empty())
// <FS:Ansariel> Synchronize tooltips throughout instances
//if (!region_name.empty())
if (!region_name.empty() && LLNetMap::sToolTipMsg != "[REGION]")
{
region_name += "\n";
}
@ -754,7 +767,10 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )
// LLStringUtil::format_map_t args;
args["[REGION]"] = region_name;
std::string msg = mToolTipMsg;
// <FS:Ansariel> Synchronize tooltips throughout instances
//std::string msg = mToolTipMsg;
std::string msg = LLNetMap::sToolTipMsg;
// </FS:Ansariel> Synchronize tooltips throughout instances
LLStringUtil::format(msg, args);
LLToolTipMgr::instance().show(LLToolTip::Params()
.message(msg)
@ -832,7 +848,7 @@ BOOL LLNetMap::handleToolTipAgent(const LLUUID& avatar_id)
p.message(av_name.getCompleteName());
}
// Ansariel: Get rid of the useless and clumsy I-button on the hovertip
// <FS:Ansariel> Get rid of the useless and clumsy I-button on the hovertip
//p.image.name("Inspector_I");
p.click_callback(boost::bind(showAvatarInspector, avatar_id));
p.visible_time_near(6.f);
@ -982,9 +998,10 @@ void LLNetMap::createObjectImage()
memset( data, 0, img_size * img_size * 4 );
mObjectImagep = LLViewerTextureManager::getLocalTexture( mObjectRawImagep.get(), FALSE);
}
// Ansariel: Synchronize scale throughout instances
// <FS:Ansariel> Synchronize scale throughout instances
//setScale(mScale);
setScale(sScale);
// </FS:Ansariel> Synchronize scale throughout instances
mUpdateNow = true;
}
@ -1063,31 +1080,35 @@ BOOL LLNetMap::handleDoubleClick(S32 x, S32 y, MASK mask)
{
LLVector3d pos_global = viewPosToGlobal(x, y);
bool double_click_teleport = gSavedSettings.getBOOL("DoubleClickTeleport");
bool double_click_show_world_map = gSavedSettings.getBOOL("DoubleClickShowWorldMap");
// <FS:Ansariel> Synchronize double click handling throughout instances
//bool double_click_teleport = gSavedSettings.getBOOL("DoubleClickTeleport");
//bool double_click_show_world_map = gSavedSettings.getBOOL("DoubleClickShowWorldMap");
if (double_click_teleport || double_click_show_world_map)
{
// If we're not tracking a beacon already, double-click will set one
if (!LLTracker::isTracking(NULL))
{
LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
if (world_map)
{
world_map->trackLocation(pos_global);
}
}
}
//if (double_click_teleport || double_click_show_world_map)
//{
// // If we're not tracking a beacon already, double-click will set one
// if (!LLTracker::isTracking(NULL))
// {
// LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
// if (world_map)
// {
// world_map->trackLocation(pos_global);
// }
// }
//}
//if (double_click_teleport)
//{
// // If DoubleClickTeleport is on, double clicking the minimap will teleport there
// gAgent.teleportViaLocationLookAt(pos_global);
//}
//else if (double_click_show_world_map)
//{
// LLFloaterReg::showInstance("world_map");
//}
performDoubleClickAction(pos_global);
// </FS:Ansariel> Synchronize double click handling throughout instances
if (double_click_teleport)
{
// If DoubleClickTeleport is on, double clicking the minimap will teleport there
gAgent.teleportViaLocationLookAt(pos_global);
}
else if (double_click_show_world_map)
{
LLFloaterReg::showInstance("world_map");
}
return TRUE;
}
@ -1177,7 +1198,7 @@ void LLNetMap::handleStopTracking (const LLSD& userdata)
}
}
// <Ansariel> additional functions
// <FS:Ansariel> additional functions
void LLNetMap::handleMark(const LLSD& userdata)
{
setAvatarMark(userdata);
@ -1209,7 +1230,7 @@ void LLNetMap::clearAvatarMarks()
{
LLNetMap::sAvatarMarksMap.clear();
}
//</Ansariel>
//</FS:Ansariel>
void LLNetMap::camAvatar()
{
@ -1249,7 +1270,7 @@ void LLNetMap::handleShowProfile()
}
// <Ansariel> Avatar tracking feature
// <FS:Ansariel> Avatar tracking feature
void LLNetMap::handleStartTracking()
{
startTracking();
@ -1266,4 +1287,58 @@ void LLNetMap::startTracking()
}
}
}
// </Ansariel> Avatar tracking feature
// </FS:Ansariel> Avatar tracking feature
// <FS:Ansariel> Synchronize tooltips throughout instances
// static
void LLNetMap::updateToolTipMsg()
{
S32 fsNetMapDoubleClickAction = gSavedSettings.getS32("FSNetMapDoubleClickAction");
switch (fsNetMapDoubleClickAction)
{
case 1:
LLNetMap::setToolTipMsg(LLTrans::getString("NetMapDoubleClickShowWorldMapToolTipMsg"));
break;
case 2:
LLNetMap::setToolTipMsg(LLTrans::getString("NetMapDoubleClickTeleportToolTipMsg"));
break;
default:
LLNetMap::setToolTipMsg(LLTrans::getString("NetMapDoubleClickNoActionToolTipMsg"));
break;
}
}
// </FS:Ansariel> Synchronize tooltips throughout instances
// <FS:Ansariel> Synchronize double click handling throughout instances
void LLNetMap::performDoubleClickAction(LLVector3d pos_global)
{
S32 fsNetMapDoubleClickAction = gSavedSettings.getS32("FSNetMapDoubleClickAction");
// 1 = Double click show world map
// 2 = Double click teleport
if (fsNetMapDoubleClickAction == 1 || fsNetMapDoubleClickAction == 2)
{
// If we're not tracking a beacon already, double-click will set one
if (!LLTracker::isTracking(NULL))
{
LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance();
if (world_map)
{
world_map->trackLocation(pos_global);
}
}
}
switch (fsNetMapDoubleClickAction)
{
case 1:
LLFloaterReg::showInstance("world_map");
break;
case 2:
gAgent.teleportViaLocationLookAt(pos_global);
break;
default:
break;
}
}
// </FS:Ansariel> Synchronize double click handling throughout instances

View File

@ -80,11 +80,18 @@ public:
/*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
void setScale( F32 scale );
void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; }
// <FS:Ansariel> Synchronize tooltips throughout instances
//void setToolTipMsg(const std::string& msg) { mToolTipMsg = msg; }
static void setToolTipMsg(const std::string& msg) { sToolTipMsg = msg; }
static void updateToolTipMsg();
// </FS:Ansariel> Synchronize tooltips throughout instances
void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
LLVector3d viewPosToGlobal(S32 x,S32 y);
LLUUID getClosestAgentAtLastRightClick() const { return mClosestAgentAtLastRightClick; }
// <FS:Ansariel> Synchronize double click handling throughout instances
void performDoubleClickAction(LLVector3d pos_global);
private:
const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
void renderPoint(const LLVector3 &pos, const LLColor4U &color,
@ -109,7 +116,7 @@ private:
LLUIColor mBackgroundColor;
F32 mScale; // Size of a region in pixels
static F32 sScale; // Ansariel: Used to synchronize netmaps throughout instances
static F32 sScale; // <FS:Ansariel> Used to synchronize netmaps throughout instances
F32 mPixelsPerMeter; // world meters to map pixels
F32 mObjectMapTPM; // texels per meter on map
@ -132,7 +139,10 @@ private:
LLVector3d mClosestAgentPosition;
LLVector3d mClosestAgentAtLastRightClickPos;
std::string mToolTipMsg;
// <FS:Ansariel> Synchronize tooltips throughout instances
//std::string mToolTipMsg;
static std::string sToolTipMsg;
// </FS:Ansariel> Synchronize tooltips throughout instances
static std::map<LLUUID, LLColor4> sAvatarMarksMap;

View File

@ -623,8 +623,10 @@ BOOL LLPanelPeople::postBuild()
LLLayoutPanel* minilayout = (LLLayoutPanel*)getChildView("minimaplayout",true);
minilayout->setMinDim(140);
mMiniMap = (LLNetMap*)getChildView("Net Map",true);
mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ?
getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg"));
// <FS:Ansariel> Synchronize tooltips throughout instances
//mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ?
// getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg"));
// <//FS:Ansariel> Synchronize tooltips throughout instances
gSavedSettings.getControl("LimitRadarByRange")->getCommitSignal()->connect(boost::bind(&LLPanelPeople::handleLimitRadarByRange, this, _2));
mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list");

View File

@ -82,6 +82,7 @@
// NaCl - Antispam Registry
#include "NACLantispam.h"
// NaCl End
#include "llnetmap.h"
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
BOOL gHackGodmode = FALSE;
@ -686,6 +687,13 @@ static void handleAutohideChatbarChanged(const LLSD& new_value)
}
// </FS:Ansariel>
// <FS:Ansariel> Synchronize tooltips throughout instances
static void handleNetMapDoubleClickActionChanged()
{
LLNetMap::updateToolTipMsg();
}
// </FS:Ansariel> Synchronize tooltips throughout instances
////////////////////////////////////////////////////////////////////////////
void settings_setup_listeners()
@ -867,6 +875,9 @@ void settings_setup_listeners()
gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&handleNaclAntiSpamAmountChanged, _2));
// NaCl End
gSavedSettings.getControl("AutohideChatBar")->getSignal()->connect(boost::bind(&handleAutohideChatbarChanged, _2));
// <FS:Ansariel> Synchronize tooltips throughout instances
gSavedSettings.getControl("FSNetMapDoubleClickAction")->getSignal()->connect(boost::bind(&handleNetMapDoubleClickActionChanged));
}
#if TEST_CACHED_CONTROL

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="Map" title="MINIKARTE">
<floater.string name="ToolTipMsg">
[REGION](Doppelklicken, um Karte zu öffnen; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken)
[AGENT][REGION] (Doppelklicken, um Karte zu öffnen; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken)
</floater.string>
<floater.string name="AltToolTipMsg">
[REGION](Doppelklicken, um zu teleportieren; 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)
</floater.string>
<floater.string name="mini_map_caption">
Minikarte

View File

@ -67,6 +67,14 @@
</text>
<check_box label="Rotation der Minikarte aktivieren" name="minimaprotate" tool_tip="Aktiviert die Rotation der Minikarte bei Drehung des Avatars."/>
<check_box name="MiniMapChatRing" label="Chatreichweite auf der Minikarte anzeigen"/>
<text name="netmap_double_click_action_lbl">
Doppelklick auf Minikarte:
</text>
<combo_box name="netmap_double_click_action_combo">
<combo_box.item label="Keine Aktion" name="0"/>
<combo_box.item label="Weltkarte öffnen" name="1"/>
<combo_box.item label="Zur Position teleportieren" name="2"/>
</combo_box>
<check_box name="FSAdvancedTooltips" label="Erweiterte Informationen in den Hovertips anzeigen (klassischer Phoenix-Stil)"/>
<check_box name="FSShowGroupTitleInTooltip" label="Gruppentitel von Avataren in Hovertips anzeigen"/>
<check_box label="Avatar umdrehen beim Rückwärtsgehen" name="backwardsturnavatar" tool_tip="Dreht den Avatar mit dem Gesicht zur Kamera beim Rückwärtsgehen."/>

View File

@ -5273,4 +5273,16 @@ Setzen Sie den Editorpfad in Anführungszeichen
<string name="FSCmdLineRSP">
Maximale Bandbreite gesetzt auf: [VALUE] kbit/s.
</string>
<!-- NetMap double click action tooltip messages -->
<string name="NetMapDoubleClickShowWorldMapToolTipMsg">
[AGENT][REGION] (Doppelklicken, um Karte zu öffnen; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken)
</string>
<string name="NetMapDoubleClickTeleportToolTipMsg">
[REGION] (Doppelklicken, um zu teleportieren; Umschalt-Taste gedrückt halten und ziehen, um zu schwenken)
</string>
<string name="NetMapDoubleClickNoActionToolTipMsg">
[REGION]
</string>
</strings>

View File

@ -520,13 +520,48 @@
top_pad="0"
height="20"
width="350" />
<text
follows="left|top"
type="string"
length="1"
height="10"
layout="topleft"
left="35"
name="netmap_double_click_action_lbl"
width="150"
top_pad="10">
Double click on Minimap:
</text>
<combo_box
control_name="FSNetMapDoubleClickAction"
height="23"
layout="topleft"
left_pad="10"
top_delta="-6"
name="netmap_double_click_action_combo"
width="200">
<combo_box.item
label="No action"
name="0"
value="0"/>
<combo_box.item
label="Open world map"
name="1"
value="1"/>
<combo_box.item
label="Teleport to clicked point"
name="2"
value="2"/>
</combo_box>
<check_box
control_name="FSAdvancedTooltips"
name="FSAdvancedTooltips"
label="Show extended information in hovertips (classic Phoenix style)"
layout="topleft"
top_pad="0"
top_pad="2"
left="15"
height="20"
width="350" />

View File

@ -4034,4 +4034,10 @@ Try enclosing path to the editor with double quotes.
<!--<FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues-->
<string name="FSCmdLineRSP">Maximum Bandwidth Set To: [VALUE] kbps.</string>
<!--</FS:HG> FIRE-6340, FIRE-6567 - Setting Bandwidth issues-->
<!-- NetMap double click action tooltip messages -->
<string name="NetMapDoubleClickShowWorldMapToolTipMsg">[AGENT][REGION] (Double-click to open Map, shift-drag to pan)</string>
<string name="NetMapDoubleClickTeleportToolTipMsg">[REGION] (Double-click to teleport, shift-drag to pan)</string>
<string name="NetMapDoubleClickNoActionToolTipMsg">[REGION]</string>
</strings>