aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llnetmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llnetmap.cpp')
-rw-r--r--linden/indra/newview/llnetmap.cpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp
index 8f5d90d..c407f04 100644
--- a/linden/indra/newview/llnetmap.cpp
+++ b/linden/indra/newview/llnetmap.cpp
@@ -45,6 +45,7 @@
45#include "llcolorscheme.h" 45#include "llcolorscheme.h"
46#include "llviewercontrol.h" 46#include "llviewercontrol.h"
47#include "llfloateravatarinfo.h" 47#include "llfloateravatarinfo.h"
48#include "llfloatermap.h"
48#include "llfloaterworldmap.h" 49#include "llfloaterworldmap.h"
49#include "llframetimer.h" 50#include "llframetimer.h"
50#include "llmutelist.h" 51#include "llmutelist.h"
@@ -98,6 +99,8 @@ LLNetMap::LLNetMap(const std::string& name) :
98 (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); 99 (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel");
99 (new LLCenterMap())->registerListener(this, "MiniMap.Center"); 100 (new LLCenterMap())->registerListener(this, "MiniMap.Center");
100 (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); 101 (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter");
102 (new LLRotateMap())->registerListener(this, "MiniMap.Rotate");
103 (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate");
101 (new LLShowWorldMap())->registerListener(this, "MiniMap.ShowWorldMap"); 104 (new LLShowWorldMap())->registerListener(this, "MiniMap.ShowWorldMap");
102 (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); 105 (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking");
103 (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); 106 (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking");
@@ -117,6 +120,11 @@ LLNetMap::LLNetMap(const std::string& name) :
117 mPopupMenuHandle = menu->getHandle(); 120 mPopupMenuHandle = menu->getHandle();
118} 121}
119 122
123BOOL LLNetMap::postBuild()
124{
125 return TRUE;
126}
127
120LLNetMap::~LLNetMap() 128LLNetMap::~LLNetMap()
121{ 129{
122} 130}
@@ -330,6 +338,7 @@ void LLNetMap::draw()
330 LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); 338 LLColor4 avatar_color = gColors.getColor( "MapAvatar" );
331 LLColor4 friend_color = gColors.getColor( "MapFriend" ); 339 LLColor4 friend_color = gColors.getColor( "MapFriend" );
332 LLColor4 muted_color = gColors.getColor( "MapMuted" ); 340 LLColor4 muted_color = gColors.getColor( "MapMuted" );
341 LLColor4 selected_color = gColors.getColor( "MapSelected" );
333 LLColor4 glyph_color; 342 LLColor4 glyph_color;
334 343
335 std::vector<LLUUID> avatar_ids; 344 std::vector<LLUUID> avatar_ids;
@@ -340,9 +349,13 @@ void LLNetMap::draw()
340 // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest. 349 // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest.
341 // just be careful to sort the avatar IDs along with the positions. -MG 350 // just be careful to sort the avatar IDs along with the positions. -MG
342 pos_map = globalPosToView(positions[i], rotate_map); 351 pos_map = globalPosToView(positions[i], rotate_map);
343 352
353 if (LLFloaterMap::getSelected() == avatar_ids[i])
354 {
355 glyph_color = selected_color;
356 }
344 // Show them muted even if they're friends 357 // Show them muted even if they're friends
345 if (LLMuteList::getInstance()->isMuted(avatar_ids[i])) 358 else if (LLMuteList::getInstance()->isMuted(avatar_ids[i]))
346 { 359 {
347 glyph_color = muted_color; 360 glyph_color = muted_color;
348 } 361 }
@@ -356,7 +369,7 @@ void LLNetMap::draw()
356 } 369 }
357 370
358// [RLVa:KB] 371// [RLVa:KB]
359 if ( !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) ) 372 if ( rlv_handler_t::isEnabled() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) )
360 { 373 {
361 // User is not allowed to see who it is, or even if it's a friend, 374 // User is not allowed to see who it is, or even if it's a friend,
362 // due to RLV settings. 375 // due to RLV settings.
@@ -460,6 +473,8 @@ void LLNetMap::draw()
460 setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); 473 setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2);
461 474
462 LLView::draw(); 475 LLView::draw();
476
477 LLFloaterMap::updateRadar();
463} 478}
464 479
465void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) 480void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent)
@@ -562,7 +577,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec
562 if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname)) 577 if(mClosestAgentToCursor.notNull() && gCacheName->getFullName(mClosestAgentToCursor, fullname))
563 { 578 {
564// [RLVa:KB] 579// [RLVa:KB]
565 if ( !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) ) 580 if ( rlv_handler_t::isEnabled() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) )
566 { 581 {
567 // User is not allowed to see who it is, due to RLV settings. 582 // User is not allowed to see who it is, due to RLV settings.
568 msg.append(rlv_handler_t::cstrHidden); 583 msg.append(rlv_handler_t::cstrHidden);
@@ -576,7 +591,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec
576 } 591 }
577 592
578// [RLVa:KB] 593// [RLVa:KB]
579 if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) 594 if (rlv_handler_t::isEnabled() && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
580 { 595 {
581 // User is not allowed to see where they are, due to RLV settings. 596 // User is not allowed to see where they are, due to RLV settings.
582 msg.append( rlv_handler_t::cstrHidden ); 597 msg.append( rlv_handler_t::cstrHidden );
@@ -922,6 +937,22 @@ bool LLNetMap::LLScaleMap::handleEvent(LLPointer<LLEvent> event, const LLSD& use
922 return true; 937 return true;
923} 938}
924 939
940bool LLNetMap::LLRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
941{
942 BOOL rotate = gSavedSettings.getBOOL("MiniMapRotate");
943 gSavedSettings.setBOOL("MiniMapRotate", !rotate);
944
945 return true;
946}
947
948bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
949{
950 LLNetMap *self = mPtr;
951 BOOL enabled = gSavedSettings.getBOOL("MiniMapRotate");
952 self->findControl(userdata["control"].asString())->setValue(enabled);
953 return true;
954}
955
925bool LLNetMap::LLCenterMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 956bool LLNetMap::LLCenterMap::handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
926{ 957{
927 S32 center = userdata.asInteger(); 958 S32 center = userdata.asInteger();