From fc649854ff3439823b8b77d77e7fb6d88f4cac05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Sat, 16 Nov 2019 09:14:19 -0500 Subject: [PATCH] Add Selected Avatars submenu to minimap menu Minimap refactor, make it an LFIDBearer! Moves listeners to cpp file, no need for header exposure Removes duplicate ToggleControl listener just for minimap Removes excess code from ToggleOverlay, we can use two on_clicks instead Caches direction labels instead of looking them up each frame Removes weird userdata look up on camera center menu item, fixing it Respect RLVa by hiding the submenu, shortcutting lookups per child --- indra/newview/llnetmap.cpp | 380 +++++++++--------- indra/newview/llnetmap.h | 145 +------ .../skins/default/xui/en-us/menu_mini_map.xml | 46 +-- 3 files changed, 233 insertions(+), 338 deletions(-) diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 53463dea8..318c20b34 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -84,6 +84,82 @@ // [/RLVa:KB] using namespace LLOldEvents; +typedef LLMemberListener view_listener_t; + +class LLScaleMap : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +class LLChatRings : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +class LLCheckChatRings : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +class LLStopTracking : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +class LLIsTracking : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +//moymod - Custom minimap markers :o +class mmsetred : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmsetgreen : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmsetblue : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmsetyellow : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmsetcustom : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmsetunmark : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +class mmenableunmark : public view_listener_t //moymod +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; + +// [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) +class OverlayToggle : public view_listener_t +{ +public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); +}; +// [/SL:KB] const F32 LLNetMap::MAP_SCALE_MIN = 32; const F32 LLNetMap::MAP_SCALE_MID = 256; @@ -103,7 +179,7 @@ const S32 CIRCLE_STEPS = 100; const F64 COARSEUPDATE_MAX_Z = 1020.0f; std::map LLNetMap::mClosestAgentsToCursor; // -static std::map mClosestAgentsAtLastClick; // +uuid_vec_t LLNetMap::mClosestAgentsAtLastClick; // LLNetMap::LLNetMap(const std::string& name) : LLPanel(name), @@ -144,26 +220,29 @@ LLNetMap::~LLNetMap() BOOL LLNetMap::postBuild() { + mELabel = getChild("e_label"); + mNLabel = getChild("n_label"); + mWLabel = getChild("w_label"); + mSLabel = getChild("s_label"); + mNELabel = getChild("ne_label"); + mNWLabel = getChild("nw_label"); + mSWLabel = getChild("sw_label"); + mSELabel = getChild("se_label"); + // Register event listeners for popup menu - (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); - (new LLCenterMap())->registerListener(this, "MiniMap.Center"); - (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); - (new LLChatRings())->registerListener(this, "MiniMap.ChatRings"); - (new LLCheckChatRings())->registerListener(this, "MiniMap.CheckChatRings"); - (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); - (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); - (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); - (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); - (new LLCamFollow())->registerListener(this, "MiniMap.CamFollow"); //moymod - add cam follow crap thingie - (new mmsetred())->registerListener(this, "MiniMap.setred"); - (new mmsetgreen())->registerListener(this, "MiniMap.setgreen"); - (new mmsetblue())->registerListener(this, "MiniMap.setblue"); - (new mmsetyellow())->registerListener(this, "MiniMap.setyellow"); - (new mmsetcustom())->registerListener(this, "MiniMap.setcustom"); - (new mmsetunmark())->registerListener(this, "MiniMap.setunmark"); - (new mmenableunmark())->registerListener(this, "MiniMap.enableunmark"); - (new LLToggleControl())->registerListener(this, "MiniMap.ToggleControl"); - (new OverlayToggle())->registerListener(this, "Minimap.ToggleOverlay"); + (new LLScaleMap())->registerListener(gMenuHolder, "MiniMap.ZoomLevel"); + (new LLChatRings())->registerListener(gMenuHolder, "MiniMap.ChatRings"); + (new LLCheckChatRings())->registerListener(gMenuHolder, "MiniMap.CheckChatRings"); + (new LLStopTracking())->registerListener(gMenuHolder, "StopTracking"); + (new LLIsTracking())->registerListener(gMenuHolder, "IsTracking"); + (new mmsetred())->registerListener(gMenuHolder, "MiniMap.setred"); + (new mmsetgreen())->registerListener(gMenuHolder, "MiniMap.setgreen"); + (new mmsetblue())->registerListener(gMenuHolder, "MiniMap.setblue"); + (new mmsetyellow())->registerListener(gMenuHolder, "MiniMap.setyellow"); + (new mmsetcustom())->registerListener(gMenuHolder, "MiniMap.setcustom"); + (new mmsetunmark())->registerListener(gMenuHolder, "MiniMap.setunmark"); + (new mmenableunmark())->registerListener(gMenuHolder, "MiniMap.enableunmark"); + (new OverlayToggle())->registerListener(gMenuHolder, "Minimap.ToggleOverlay"); // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0) LLViewerParcelMgr::instance().setCollisionUpdateCallback(boost::bind(&LLNetMap::refreshParcelOverlay, this)); @@ -257,8 +336,8 @@ void LLNetMap::draw() } // [/SL:KB] - static LLUICachedControl center("MiniMapCenter"); - if (center != MAP_CENTER_NONE) + static const LLUICachedControl center("MiniMapCenter"); + if (center) { mCurPan = lerp(mCurPan, mTargetPan, LLSmoothInterpolation::getInterpolant(0.1f)); } @@ -558,14 +637,14 @@ void LLNetMap::draw() gmSelected = LLFloaterAvatarList::instance().getSelectedIDs(); // Draw avatars - for(LLWorld::pos_map_t::const_iterator iter = positions.cbegin(), iter_end = positions.cend(); iter != iter_end; ++iter) + for(const auto& pair : positions) { - const LLUUID& uuid = iter->first; + const LLUUID& uuid = pair.first; static const LLCachedControl standard_color("MapAvatar",LLColor4(0.f,1.f,0.f,1.f)); LLColor4 color = standard_color; // TODO: it'd be very cool to draw these in sorted order from lowest Z to highest. // just be careful to sort the avatar IDs along with the positions. -MG - const LLVector3d& position = iter->second; + const LLVector3d& position = pair.second; pos_map = globalPosToView(position); if (position.mdV[VZ] == 0.f || position.mdV[VZ] == COARSEUPDATE_MAX_Z) { @@ -732,15 +811,15 @@ void LLNetMap::draw() gGL.popUIMatrix(); // Rotation of 0 means that North is up - setDirectionPos( getChild("e_label"), rotation); - setDirectionPos( getChild("n_label"), rotation + F_PI_BY_TWO); - setDirectionPos( getChild("w_label"), rotation + F_PI); - setDirectionPos( getChild("s_label"), rotation + F_PI + F_PI_BY_TWO); + setDirectionPos(mELabel, rotation); + setDirectionPos(mNLabel, rotation + F_PI_BY_TWO); + setDirectionPos(mWLabel, rotation + F_PI); + setDirectionPos(mSLabel, rotation + F_PI + F_PI_BY_TWO); - setDirectionPos( getChild("ne_label"), rotation + F_PI_BY_TWO / 2); - setDirectionPos( getChild("nw_label"), rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); - setDirectionPos( getChild("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); - setDirectionPos( getChild("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos(mNELabel, rotation + F_PI_BY_TWO / 2); + setDirectionPos(mNWLabel, rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos(mSWLabel, rotation + F_PI + F_PI_BY_TWO / 2); + setDirectionPos(mSELabel, rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); LLUICtrl::draw(); } @@ -858,8 +937,8 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) setScale(new_scale); - static LLUICachedControl center("MiniMapCenter"); - if (center == MAP_CENTER_NONE) + static const LLUICachedControl center("MiniMapCenter"); + if (!center) { // Adjust pan to center the zoom on the mouse pointer LLVector2 zoom_offset; @@ -888,7 +967,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; - tool_tip.assign(""); + tool_tip.clear(); if (region->mMapAvatarIDs.size()) { @@ -902,10 +981,10 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick std::map::iterator current = mClosestAgentsToCursor.begin(); std::map::iterator end = mClosestAgentsToCursor.end(); - for (; current != end; ++current) + for (const auto& target : mClosestAgentsToCursor) { - LLUUID targetUUID = (*current).first; - LLVector3d targetPosition = (*current).second; + const auto& targetUUID = target.first; + auto targetPosition = target.second; std::string fullName; if (targetUUID.notNull() && LLAvatarNameCache::getNSName(targetUUID, fullName)) @@ -932,7 +1011,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick tool_tip.append(llformat(" (%.02fm)\n", distance)); } } - tool_tip.append("\n"); + tool_tip += '\n'; } } // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-0.2.0b @@ -940,9 +1019,9 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* stick // [/RLVa:KB] //tool_tip.append("\n\n" + region->getName()); - tool_tip.append("\n" + region->getHost().getHostName()); - tool_tip.append("\n" + region->getHost().getString()); - tool_tip.append("\n" + getToolTip()); + tool_tip.append('\n' + region->getHost().getHostName()); + tool_tip.append('\n' + region->getHost().getString()); + tool_tip.append('\n' + getToolTip()); } else { @@ -971,19 +1050,16 @@ void LLNetMap::setDirectionPos( LLTextBox* text_box, F32 rotation ) void LLNetMap::updateMinorDirections() { - if (getChild("ne_label", TRUE, FALSE) == NULL) - { - return; - } + if (!mNELabel) return; // Hide minor directions if they cover too much of the map - bool show_minors = getChild("ne_label")->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * + bool show_minors = mNELabel->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * llmin(getRect().getWidth(), getRect().getHeight()); - getChild("ne_label")->setVisible(show_minors); - getChild("nw_label")->setVisible(show_minors); - getChild("sw_label")->setVisible(show_minors); - getChild("se_label")->setVisible(show_minors); + mNELabel->setVisible(show_minors); + mNWLabel->setVisible(show_minors); + mSWLabel->setVisible(show_minors); + mSELabel->setVisible(show_minors); } void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius_meters ) @@ -1283,29 +1359,29 @@ BOOL LLNetMap::handleMouseUp( S32 x, S32 y, MASK mask ) } // [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) -bool LLNetMap::OverlayToggle::handleEvent(LLPointer event, const LLSD& sdParam) +bool OverlayToggle::handleEvent(LLPointer event, const LLSD& sdParam) { - // Toggle the setting - const std::string strControl = sdParam.asString(); - BOOL fCurValue = gSavedSettings.getBOOL(strControl); - gSavedSettings.setBOOL(strControl, !fCurValue); - // Force an overlay update - mPtr->mUpdateParcelImage = true; + LFIDBearer::getActive()->mUpdateParcelImage = true; return true; } // [/SL:KB] BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) { - mClosestAgentsAtLastClick = mClosestAgentsToCursor; + mClosestAgentsAtLastClick.clear(); + mClosestAgentsAtLastClick.reserve(mClosestAgentsToCursor.size()); + for (const auto& pair : mClosestAgentsToCursor) + mClosestAgentsAtLastClick.push_back(pair.first); mClosestAgentAtLastRightClick = mClosestAgentToCursor; if (mPopupMenu) { - // Singu TODO: It'd be spectacular to address multiple avatars from here. - mPopupMenu->buildDrawLabels(); - mPopupMenu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, mPopupMenu, x, y); + showMenu(this, mPopupMenu, x, y); + mPopupMenu->getChildView("avs_menu")->setVisible(!mClosestAgentsAtLastClick.empty() && +// [RLVa:LF] - 2019 + !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) +// [/RLVa:LF] + ); } return TRUE; } @@ -1396,22 +1472,22 @@ BOOL LLNetMap::handleHover( S32 x, S32 y, MASK mask ) } // static -bool LLNetMap::LLScaleMap::handleEvent(LLPointer event, const LLSD& userdata) +bool LLScaleMap::handleEvent(LLPointer event, const LLSD& userdata) { - LLNetMap *self = mPtr; + LLNetMap *self = LFIDBearer::getActive(); S32 level = userdata.asInteger(); switch(level) { case 0: - self->setScale(MAP_SCALE_MIN); + self->setScale(LLNetMap::MAP_SCALE_MIN); break; case 1: - self->setScale(MAP_SCALE_MID); + self->setScale(LLNetMap::MAP_SCALE_MID); break; case 2: - self->setScale(MAP_SCALE_MAX); + self->setScale(LLNetMap::MAP_SCALE_MAX); break; default: break; @@ -1423,149 +1499,85 @@ bool LLNetMap::LLScaleMap::handleEvent(LLPointer event, const LLSD& use //moymod - minimap color shit void markMassAgents(const LLColor4& color) { - std::map::iterator current = mClosestAgentsAtLastClick.begin(); - std::map::iterator end = mClosestAgentsAtLastClick.end(); - for(; current != end; ++current) LLNetMap::mm_setcolor((*current).first, color); + auto self = LFIDBearer::getActive(); + for (const auto& id : self->getSelectedIDs()) + self->mm_setcolor(id, color); } -bool LLNetMap::mmsetred::handleEvent(LLPointer, const LLSD&) +bool mmsetred::handleEvent(LLPointer, const LLSD&) { - markMassAgents(LLColor4::red); return true; -} -bool LLNetMap::mmsetgreen::handleEvent(LLPointer, const LLSD&) -{ - markMassAgents(LLColor4::green); return true; -} -bool LLNetMap::mmsetblue::handleEvent(LLPointer, const LLSD&) -{ - markMassAgents(LLColor4::blue); return true; -} -bool LLNetMap::mmsetyellow::handleEvent(LLPointer, const LLSD&) -{ - markMassAgents(LLColor4::yellow); return true; -} -bool LLNetMap::mmsetcustom::handleEvent(LLPointer, const LLSD&) -{ - markMassAgents(gSavedSettings.getColor4("MoyMiniMapCustomColor")); return true; -} -bool LLNetMap::mmsetunmark::handleEvent(LLPointer, const LLSD&) -{ - std::map::iterator it = mClosestAgentsAtLastClick.begin(); - std::map::iterator end = mClosestAgentsAtLastClick.end(); - for(; it!= end; ++it) mm_MarkerColors.erase((*it).first); + markMassAgents(LLColor4::red); return true; } -bool LLNetMap::mmenableunmark::handleEvent(LLPointer, const LLSD& userdata) +bool mmsetgreen::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::green); + return true; +} +bool mmsetblue::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::blue); + return true; +} +bool mmsetyellow::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::yellow); + return true; +} +bool mmsetcustom::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(gSavedSettings.getColor4("MoyMiniMapCustomColor")); + return true; +} +bool mmsetunmark::handleEvent(LLPointer, const LLSD&) +{ + for (const auto& id : LFIDBearer::getActiveSelectedIDs()) + mm_MarkerColors.erase(id); + return true; +} +bool mmenableunmark::handleEvent(LLPointer, const LLSD& userdata) { bool enabled(false); - std::map::iterator it = mClosestAgentsAtLastClick.begin(); - std::map::iterator end = mClosestAgentsAtLastClick.end(); - for(; it != end && !enabled; ++it) enabled = mm_MarkerColors.find((*it).first) != mm_MarkerColors.end(); + for (const auto& id : LFIDBearer::getActiveSelectedIDs()) + if (enabled = mm_MarkerColors.find(id) != mm_MarkerColors.end()) + break; mPtr->findControl(userdata["control"].asString())->setValue(enabled); return true; } -bool LLNetMap::LLCenterMap::handleEvent(LLPointer event, const LLSD& userdata) +bool LLChatRings::handleEvent(LLPointer event, const LLSD& userdata) { - EMiniMapCenter center = (EMiniMapCenter)userdata.asInteger(); + auto whisper = gSavedSettings.getControl("MiniMapWhisperRing"); + auto chat = gSavedSettings.getControl("MiniMapChatRing"); + auto shout = gSavedSettings.getControl("MiniMapShoutRing"); + bool all_enabled = whisper->get() && chat->get() && shout->get(); - if (gSavedSettings.getS32("MiniMapCenter") == center) - { - gSavedSettings.setS32("MiniMapCenter", MAP_CENTER_NONE); - } - else - { - gSavedSettings.setS32("MiniMapCenter", userdata.asInteger()); - } + whisper->set(!all_enabled); + chat->set(!all_enabled); + shout->set(!all_enabled); return true; } -bool LLNetMap::LLCheckCenterMap::handleEvent(LLPointer event, const LLSD& userdata) +bool LLCheckChatRings::handleEvent(LLPointer event, const LLSD& userdata) { - LLNetMap *self = mPtr; - EMiniMapCenter center = (EMiniMapCenter)userdata["data"].asInteger(); - BOOL enabled = (gSavedSettings.getS32("MiniMapCenter") == center); + bool all_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing") + && gSavedSettings.getBOOL("MiniMapChatRing") + && gSavedSettings.getBOOL("MiniMapShoutRing"); - self->findControl(userdata["control"].asString())->setValue(enabled); + mPtr->findControl(userdata["control"].asString())->setValue(all_enabled); return true; } -bool LLNetMap::LLChatRings::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); - BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); - BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); - BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; - - gSavedSettings.setBOOL("MiniMapWhisperRing", !all_enabled); - gSavedSettings.setBOOL("MiniMapChatRing", !all_enabled); - gSavedSettings.setBOOL("MiniMapShoutRing", !all_enabled); - - return true; -} - -bool LLNetMap::LLCheckChatRings::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); - BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); - BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); - BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; - - LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(all_enabled); - return true; -} - -bool LLNetMap::LLStopTracking::handleEvent(LLPointer event, const LLSD& userdata) +bool LLStopTracking::handleEvent(LLPointer event, const LLSD& userdata) { LLTracker::stopTracking(false); return true; } -bool LLNetMap::LLEnableTracking::handleEvent(LLPointer event, const LLSD& userdata) +bool LLIsTracking::handleEvent(LLPointer event, const LLSD& userdata) { - LLNetMap *self = mPtr; - self->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking()); + mPtr->findControl(userdata["control"].asString())->setValue(LLTracker::isTracking()); return true; } - -bool LLNetMap::LLCamFollow::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - LLFloaterAvatarList::lookAtAvatar(self->mClosestAgentAtLastRightClick); - return true; -} - - -bool LLNetMap::LLShowAgentProfile::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b - if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - { - LLAvatarActions::showProfile(self->mClosestAgentAtLastRightClick); - } -// [/RLVa:KB] - //LLAvatarActions::showProfile(self->mClosestAgentAtLastRightClick); - return true; -} - -bool LLNetMap::LLEnableProfile::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b - self->findControl(userdata["control"].asString())->setValue( - (self->isAgentUnderCursor()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ); -// [/RLVa:KB] - //self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); - return true; -} - -bool LLNetMap::LLToggleControl::handleEvent(LLPointer event, const LLSD& userdata) -{ - std::string control_name = userdata.asString(); - gSavedSettings.setBOOL(control_name, !gSavedSettings.getBOOL(control_name)); - return true; -} diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 0b291b5bc..b5e102889 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -33,33 +33,20 @@ #ifndef LL_LLNETMAP_H #define LL_LLNETMAP_H -#include "llmath.h" +#include "lfidbearer.h" #include "llpanel.h" -#include "llmemberlistener.h" -#include "v3math.h" -#include "v3dmath.h" -#include "v4color.h" -#include "llpointer.h" -#include "llcoord.h" class LLTextBox; class LLImageRaw; class LLViewerTexture; class LLFloaterMap; -class LLMenuGL; // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0) class LLViewerRegion; class LLAvatarName; // [/SL:KB] -enum EMiniMapCenter -{ - MAP_CENTER_NONE = 0, - MAP_CENTER_CAMERA = 1 -}; - -class LLNetMap : public LLPanel +class LLNetMap : public LLPanel, public LFIDBearer { public: LLNetMap(const std::string& name); @@ -81,6 +68,10 @@ public: /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); + LLUUID getStringUUIDSelectedItem() const override { return mClosestAgentAtLastRightClick; } + uuid_vec_t getSelectedIDs() const override { return mClosestAgentsAtLastClick; } + S32 getNumSelected() const override { return mClosestAgentsAtLastClick.size(); } + static void mm_setcolor(LLUUID key,LLColor4 col); //moymod @@ -127,6 +118,15 @@ protected: private: // [/SL:KB] + LLTextBox *mELabel = nullptr, + *mNLabel = nullptr, + *mWLabel = nullptr, + *mSLabel = nullptr, + *mNELabel = nullptr, + *mNWLabel = nullptr, + *mSWLabel = nullptr, + *mSELabel = nullptr; + F32 mScale; // Size of a region in pixels F32 mPixelsPerMeter; // world meters to map pixels F32 mObjectMapTPM; // texels per meter on map @@ -152,125 +152,12 @@ private: // [/SL:KB] static std::map mClosestAgentsToCursor; // + static uuid_vec_t mClosestAgentsAtLastClick; // LLUUID mClosestAgentToCursor; LLUUID mClosestAgentAtLastRightClick; - static void showAgentProfile(void*); BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } - - class LLScaleMap : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCenterMap : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCheckCenterMap : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLChatRings : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCheckChatRings : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLStopTracking : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLEnableTracking : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLShowAgentProfile : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCamFollow : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - //moymod - Custom minimap markers :o - class mmsetred : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmsetgreen : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmsetblue : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmsetyellow : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmsetcustom : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmsetunmark : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class mmenableunmark : public LLMemberListener //moymod - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - - class LLEnableProfile : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLToggleControl : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - -// [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0) - class OverlayToggle : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; -// [/SL:KB] - LLMenuGL* mPopupMenu; }; diff --git a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml index 9e43a178a..7b0322702 100644 --- a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml @@ -12,11 +12,11 @@ - - + + - + @@ -35,8 +35,9 @@ label="Property Lines" name="Property Lines"> + @@ -44,8 +45,9 @@ label="Parcels for Sale" name="Parcels for Sale"> + @@ -69,30 +71,23 @@ - + - + - + - - - - - - - - - - + + + @@ -109,13 +104,14 @@ + + + + + - - - - - +