Minimap enhancements!!

Much of this patch comes from upstream and Kitty Barnett, or is inspired from their works
This commit applies the World-Minimap patches from Catznip.

Catznip stuffs:
- Issue 1383: Parcel lines on mini map
 - Show parcels on the minimap
 - Minimap menu: "Show" submenu: "Property Lines" "Parcels for Sale"
- Option to have world map textures on the minimap
 - Minimap menu: "World Map Textures"
 - Singular touch: Made this comply with hypergridding.

The minimap will now scroll zoom based on where your mouse is if centering on camera is off.

A lot of cruft was cleaned up in this merge, a lot of gSavedSettings lookups in draw were converted to LLCachedControls, some license updates were performed.

Finally: By myself, but inspired by upstream and requested in the group before:
- Option to show tracking circles around people selected on the radar while the radar is visible
 - Minimap menu: "Show" submenu: "Radar Tracking Circles"
This commit is contained in:
Inusaito Sayori
2014-02-08 18:26:18 -05:00
parent c4bfdcbeac
commit 8f7e96e2a5
12 changed files with 1016 additions and 468 deletions

View File

@@ -6063,6 +6063,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DoubleClickShowWorldMap</key>
<map>
<key>Comment</key>
<string>Enable double-click to show world map from mini map</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>DragAndDropToolTipDelay</key>
<map>
<key>Comment</key>
@@ -10181,6 +10192,28 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>MiniMapCollisionParcels</key>
<map>
<key>Comment</key>
<string>Show collision parcels on the mini-map as they become available</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>MiniMapForSaleParcels</key>
<map>
<key>Comment</key>
<string>Show for-sale parcels with a yellow highlight on the mini-map</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>MiniMapPrimMaxAltitudeDelta</key>
<map>
<key>Comment</key>
@@ -10214,6 +10247,28 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<real>256.0</real>
</map>
<key>MiniMapPropertyLines</key>
<map>
<key>Comment</key>
<string>Show property boundaries on the mini-map</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>MiniMapRadarTrackingCircles</key>
<map>
<key>Comment</key>
<string>Show tracking circles around the avatars you've selected on the radar in the minimap</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>MiniMapCenter</key>
<map>
<key>Comment</key>
@@ -10328,6 +10383,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<real>128.0</real>
</map>
<key>MiniMapWorldMapTextures</key>
<map>
<key>Comment</key>
<string>Use the world map texture tile on the mini-map rather than the terrain texture</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>MouseSensitivity</key>
<map>
<key>Comment</key>

View File

@@ -1547,6 +1547,11 @@ LLUUID LLFloaterAvatarList::getSelectedID()
return LLUUID::null;
}
uuid_vec_t LLFloaterAvatarList::getSelectedIDs()
{
return mAvatarList->getSelectedIDs();
}
//static
void LLFloaterAvatarList::callbackFreeze(const LLSD& notification, const LLSD& response)
{

View File

@@ -215,6 +215,7 @@ public:
static void toggle(void*);
static void showInstance();
static bool instanceVisible() { return instanceExists() && instance().getVisible(); }
// Decides which user-chosen columns to show and hide.
void assessColumns();
@@ -241,6 +242,7 @@ public:
std::string getSelectedNames(const std::string& separator = ", ");
std::string getSelectedName();
LLUUID getSelectedID();
uuid_vec_t getSelectedIDs();
static void lookAtAvatar(LLUUID &uuid);

File diff suppressed because it is too large Load Diff

View File

@@ -33,21 +33,31 @@
#ifndef LL_LLNETMAP_H
#define LL_LLNETMAP_H
#include "llmath.h"
#include "llpanel.h"
#include "llmemberlistener.h"
#include "v3math.h"
#include "v3dmath.h"
#include "v4color.h"
#include "llimage.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]
typedef enum e_minimap_center
enum EMiniMapCenter
{
MAP_CENTER_NONE = 0,
MAP_CENTER_CAMERA = 1
} EMiniMapCenter;
};
class LLNetMap : public LLPanel
{
@@ -55,77 +65,93 @@ public:
LLNetMap(const std::string& name);
virtual ~LLNetMap();
virtual void draw();
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask );
virtual BOOL handleHover( S32 x, S32 y, MASK mask );
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
static const F32 MAP_SCALE_MIN;
static const F32 MAP_SCALE_MID;
static const F32 MAP_SCALE_MAX;
void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
/*virtual*/ void draw();
/*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
/*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask );
/*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask );
/*virtual*/ BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
/*virtual*/ BOOL postBuild();
/*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
static void mm_setcolor(LLUUID key,LLColor4 col); //moymod
private:
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
void refreshParcelOverlay() { mUpdateParcelImage = true; }
// [/SL:KB]
void setScale( F32 scale );
void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
// Not used at present
void translatePan( F32 delta_x, F32 delta_y );
void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; }
private:
const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
void renderPoint(const LLVector3 &pos, const LLColor4U &color,
S32 diameter, S32 relative_height = 0);
LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated);
LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated);
LLVector3 globalPosToView(const LLVector3d& global_pos);
LLVector3d viewPosToGlobal(S32 x,S32 y);
void drawRing(const F32 radius, LLVector3 pos_map, const LLColor4& color);
void drawTracking( const LLVector3d& pos_global,
BOOL rotated,
const LLColor4& color,
BOOL draw_arrow = TRUE);
void setDirectionPos( LLTextBox* text_box, F32 rotation );
void updateMinorDirections();
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
bool createImage(LLPointer<LLImageRaw>& rawimagep) const;
void createObjectImage();
void createParcelImage();
LLHandle<LLView> mPopupMenuHandle;
void renderPropertyLinesForRegion(const LLViewerRegion* pRegion, const LLColor4U& clrOverlay);
// [/SL:KB]
// void createObjectImage();
static bool outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y, S32 slop);
private:
// bool mUpdateNow;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
bool mUpdateObjectImage;
protected:
friend class OverlayToggle;
bool mUpdateParcelImage;
private:
// [/SL:KB]
F32 mScale; // Size of a region in pixels
F32 mPixelsPerMeter; // world meters to map pixels
F32 mObjectMapTPM; // texels per meter on map
F32 mObjectMapPixels; // Width of object map in pixels
F32 mDotRadius; // Size of avatar markers
F32 mTargetPanX;
F32 mTargetPanY;
F32 mCurPanX;
F32 mCurPanY;
BOOL mPanning; // map has been dragged
S32 mMouseDownPanX; // value at start of drag
S32 mMouseDownPanY; // value at start of drag
S32 mMouseDownX;
S32 mMouseDownY;
bool mPanning; // map is being dragged
LLVector2 mTargetPan;
LLVector2 mCurPan;
LLVector2 mStartPan; // pan offset at start of drag
LLCoordGL mMouseDown; // pointer position at start of drag
BOOL mUpdateNow;
LLVector3d mObjectImageCenterGlobal;
LLPointer<LLImageRaw> mObjectRawImagep;
LLPointer<LLViewerTexture> mObjectImagep;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
LLVector3d mParcelImageCenterGlobal;
LLPointer<LLImageRaw> mParcelRawImagep;
LLPointer<LLViewerTexture> mParcelImagep;
// [/SL:KB]
private:
LLUUID mClosestAgentToCursor;
LLVector3d mClosestAgentPosition;
LLUUID mClosestAgentAtLastRightClick;
static BOOL sRotateMap;
static LLNetMap* sInstance;
static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); }
static BOOL outsideSlop(S32 x, S32 y, S32 start_x, S32 start_y, S32 slop);
static void showAgentProfile(void*);
BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); }
@@ -183,10 +209,7 @@ private:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
//moymod - Custom minimap markers :o
class mmsetred : public LLMemberListener<LLNetMap> //moymod
{
public:
@@ -224,9 +247,6 @@ private:
};
class LLEnableProfile : public LLMemberListener<LLNetMap>
{
public:
@@ -239,6 +259,15 @@ private:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
// [SL:KB] - Patch: World-MiniMap | Checked: 2012-07-08 (Catznip-3.3.0)
class OverlayToggle : public LLMemberListener<LLNetMap>
{
public:
/*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata);
};
// [/SL:KB]
LLMenuGL* mPopupMenu;
};

View File

@@ -2,31 +2,25 @@
* @file llviewerparcelmgr.cpp
* @brief Viewer-side representation of owned land
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -130,6 +124,10 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mRenderSelection(TRUE),
mCollisionBanned(0),
mCollisionTimer(),
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
mCollisionRegionHandle(0),
mCollisionUpdateSignal(NULL),
// [/SL:KB]
mMediaParcelId(0),
mMediaRegionId(0),
mHighlightSegments(NULL),
@@ -152,6 +150,11 @@ LLViewerParcelMgr::LLViewerParcelMgr()
mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mHighlightSegments);
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
mCollisionBitmap = new U8[getCollisionBitmapSize()];
memset(mCollisionBitmap, 0, getCollisionBitmapSize());
// [/SL:KB]
mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)];
resetSegments(mCollisionSegments);
@@ -208,6 +211,11 @@ LLViewerParcelMgr::~LLViewerParcelMgr()
delete[] mHighlightSegments;
mHighlightSegments = NULL;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
delete[] mCollisionBitmap;
mCollisionBitmap = NULL;
// [/SL:KB]
delete[] mCollisionSegments;
mCollisionSegments = NULL;
@@ -1741,18 +1749,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
* parcel_mgr.mParcelsPerEdge
/ 8;
U8* bitmap = new U8[ bitmap_size ];
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
// S32 bitmap_size = parcel_mgr.mParcelsPerEdge
// * parcel_mgr.mParcelsPerEdge
// / 8;
// U8* bitmap = new U8[ bitmap_size ];
// msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, parcel_mgr.mCollisionBitmap, parcel_mgr.getCollisionBitmapSize());
// [/SL:KB]
parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments);
parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments );
// parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments );
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
parcel_mgr.writeSegmentsFromBitmap(parcel_mgr.mCollisionBitmap, parcel_mgr.mCollisionSegments);
// [/SL:KB]
delete[] bitmap;
bitmap = NULL;
// delete[] bitmap;
// bitmap = NULL;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
LLViewerRegion* pRegion = LLWorld::getInstance()->getRegion(msg->getSender());
parcel_mgr.mCollisionRegionHandle = (pRegion) ? pRegion->getHandle() : 0;
if (parcel_mgr.mCollisionUpdateSignal)
(*parcel_mgr.mCollisionUpdateSignal)(pRegion);
// [/SL:KB]
}
else if (sequence_id == HOVERED_PARCEL_SEQ_ID)
{
@@ -1770,7 +1791,10 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
else
{
// look for music.
// Check for video
LLViewerParcelMedia::update(parcel);
// Then check for music
if (gAudiop)
{
if (parcel)
@@ -1818,9 +1842,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
gAudiop->stopInternetStream();
}
}//if gAudiop
// now check for video
LLViewerParcelMedia::update( parcel );
};
}
@@ -1828,9 +1849,6 @@ void optionally_start_music(LLParcel* parcel)
{
if (gSavedSettings.getBOOL("AudioStreamingMusic"))
{
// Make the user click the start button on the overlay bar. JC
// llinfos << "Starting parcel music " << parcel->getMusicURL() << llendl;
@@ -2571,3 +2589,12 @@ void LLViewerParcelMgr::onTeleportFailed()
{
mTeleportFailedSignal();
}
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
boost::signals2::connection LLViewerParcelMgr::setCollisionUpdateCallback(const collision_update_signal_t::slot_type & cb)
{
if (!mCollisionUpdateSignal)
mCollisionUpdateSignal = new collision_update_signal_t();
return mCollisionUpdateSignal->connect(cb);
}
// [/SL:KB]

View File

@@ -2,31 +2,25 @@
* @file llviewerparcelmgr.h
* @brief Viewer-side representation of owned land
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,10 +30,13 @@
#include "v3dmath.h"
#include "lldarray.h"
#include "llframetimer.h"
#include "llmemory.h"
#include "llsingleton.h"
#include "llparcelselection.h"
#include "llui.h"
#include <boost/function.hpp>
#include <boost/signals2.hpp>
class LLUUID;
class LLMessageSystem;
class LLParcel;
@@ -169,6 +166,14 @@ public:
LLParcel* getHoverParcel() const;
LLParcel* getCollisionParcel() const;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
const U8* getCollisionBitmap() const { return mCollisionBitmap; }
size_t getCollisionBitmapSize() const { return mParcelsPerEdge * mParcelsPerEdge / 8; }
U64 getCollisionRegionHandle() const { return mCollisionRegionHandle; }
typedef boost::signals2::signal<void (const LLViewerRegion*)> collision_update_signal_t;
boost::signals2::connection setCollisionUpdateCallback(const collision_update_signal_t::slot_type & cb);
// [/SL:KB]
// Can this agent build on the parcel he is on?
// Used for parcel property icons in nav bar.
@@ -361,6 +366,11 @@ private:
// Watch for pending collisions with a parcel you can't access.
// If it's coming, draw the parcel's boundaries.
LLParcel* mCollisionParcel;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
U8* mCollisionBitmap;
U64 mCollisionRegionHandle;
collision_update_signal_t* mCollisionUpdateSignal;
// [/SL:KB]
U8* mCollisionSegments;
BOOL mRenderCollision;
BOOL mRenderSelection;

View File

@@ -2,31 +2,25 @@
* @file llviewerparceloverlay.cpp
* @brief LLViewerParcelOverlay class implementation
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -54,8 +48,13 @@
#include "llglheaders.h"
#include "pipeline.h"
const U8 OVERLAY_IMG_COMPONENTS = 4;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
LLViewerParcelOverlay::update_signal_t* LLViewerParcelOverlay::mUpdateSignal = NULL;
// [/SL:KB]
LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters)
: mRegion( region ),
mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ),
@@ -858,6 +857,10 @@ void LLViewerParcelOverlay::idleUpdate(bool force_update)
{
updateOverlayTexture();
updatePropertyLines();
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
if (mUpdateSignal)
(*mUpdateSignal)(mRegion);
// [/SL:KB]
mTimeSinceLastUpdate.reset();
}
}
@@ -929,6 +932,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
S32 drawn = 0;
F32* vertexp;
U8* colorp;
bool render_hidden = LLSelectMgr::sRenderHiddenSelections && gFloaterTools && gFloaterTools->getVisible();
const F32 PROPERTY_LINE_CLIP_DIST_SQUARED = 256.f * 256.f;
@@ -970,7 +974,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
gGL.end();
if (LLSelectMgr::sRenderHiddenSelections && gFloaterTools && gFloaterTools->getVisible())
if (render_hidden)
{
LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_GREATER);
@@ -1005,3 +1009,12 @@ S32 LLViewerParcelOverlay::renderPropertyLines ()
return drawn;
}
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
boost::signals2::connection LLViewerParcelOverlay::setUpdateCallback(const update_signal_t::slot_type & cb)
{
if (!mUpdateSignal)
mUpdateSignal = new update_signal_t();
return mUpdateSignal->connect(cb);
}
// [/SL:KB]

View File

@@ -2,31 +2,25 @@
* @file llviewerparceloverlay.h
* @brief LLViewerParcelOverlay class header file
*
* $LicenseInfo:firstyear=2002&license=viewergpl$
*
* Copyright (c) 2002-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -73,6 +67,9 @@ public:
BOOL isBuildCameraAllowed(const LLVector3& pos) const;
F32 getOwnedRatio() const;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
const U8* getOwnership() const { return mOwnership; }
// [/SL:KB]
// Returns the number of vertices drawn
S32 renderPropertyLines();
@@ -88,6 +85,11 @@ public:
void idleUpdate(bool update_now = false);
void updateGL();
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
typedef boost::signals2::signal<void (const LLViewerRegion*)> update_signal_t;
static boost::signals2::connection setUpdateCallback(const update_signal_t::slot_type & cb);
// [/SL:KB]
private:
// This is in parcel rows and columns, not grid rows and columns
// Stored in bottom three bits.
@@ -129,6 +131,10 @@ private:
S32 mVertexCount;
F32* mVertexArray;
U8* mColorArray;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
static update_signal_t* mUpdateSignal;
// [/SL:KB]
};
#endif

View File

@@ -48,6 +48,7 @@
#include "v3math.h"
#include "v4math.h"
#include "lfsimfeaturehandler.h"
#include "llagent.h"
#include "llagentcamera.h"
#include "llcallingcard.h"
@@ -222,7 +223,7 @@ public:
virtual ~BaseCapabilitiesComplete()
{ }
/*virtual*/ void error(U32 statusNum, const std::string& reason)
void error(U32 statusNum, const std::string& reason)
{
LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL;
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
@@ -232,7 +233,7 @@ public:
}
}
/*virtual*/ void result(const LLSD& content)
void result(const LLSD& content)
{
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if(!regionp) //region was removed
@@ -422,6 +423,14 @@ LLViewerRegion::~LLViewerRegion()
delete mImpl;
mImpl = NULL;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
if (mWorldMapTile)
{
mWorldMapTile->setBoostLevel(LLViewerTexture::BOOST_NONE);
mWorldMapTile = NULL;
}
// [/SL:KB]
}
LLEventPump& LLViewerRegion::getCapAPI() const
@@ -1087,7 +1096,28 @@ F32 LLViewerRegion::getLandHeightRegion(const LLVector3& region_pos)
return mImpl->mLandp->resolveHeightRegion( region_pos );
}
bool LLViewerRegion::isAlive()
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
LLViewerTexture* LLViewerRegion::getWorldMapTile() const
{
if (!mWorldMapTile)
{
U32 gridX, gridY;
grid_from_region_handle(mHandle, &gridX, &gridY);
// Singu Note: We must obey the override on certain grids!
std::string simOverrideMap = LFSimFeatureHandler::instance().mapServerURL();
std::string strImgURL = (simOverrideMap.empty() ? gSavedSettings.getString("MapServerURL") : simOverrideMap) + llformat("map-1-%d-%d-objects.jpg", gridX, gridY);
mWorldMapTile = LLViewerTextureManager::getFetchedTextureFromUrl(strImgURL, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
mWorldMapTile->setBoostLevel(LLViewerTexture::BOOST_MAP);
}
return mWorldMapTile;
}
// [/SL:KB]
//bool LLViewerRegion::isAlive()
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
bool LLViewerRegion::isAlive() const
// [/SL:KB]
{
return mAlive;
}
@@ -1817,13 +1847,13 @@ public:
{ }
/*virtual*/ void error(U32 statusNum, const std::string& reason)
void error(U32 statusNum, const std::string& reason)
{
LL_WARNS2("AppInit", "SimulatorFeatures") << statusNum << ": " << reason << LL_ENDL;
retry();
}
/*virtual*/ void result(const LLSD& content)
void result(const LLSD& content)
{
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if(!regionp) //region is removed or responder is not created.
@@ -2044,6 +2074,7 @@ void LLViewerRegion::getNeighboringRegionsStatus( std::vector<S32>& regions )
{
mImpl->mLandp->getNeighboringRegionsStatus( regions );
}
void LLViewerRegion::showReleaseNotes()
{
std::string url = this->getCapability("ServerReleaseNotes");

View File

@@ -75,6 +75,9 @@ class LLDataPacker;
class LLDataPackerBinaryBuffer;
class LLHost;
class LLBBox;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
class LLViewerTexture;
// [/SL:KB]
class LLViewerRegionImpl;
@@ -143,7 +146,12 @@ public:
inline BOOL getRestrictPushObject() const;
inline BOOL getReleaseNotesRequested() const;
bool isAlive(); // can become false if circuit disconnects
// bool isAlive(); // can become false if circuit disconnects
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0)
bool isAlive() const; // can become false if circuit disconnects
LLViewerTexture* getWorldMapTile() const;
// [/SL:KB]
void setWaterHeight(F32 water_level);
F32 getWaterHeight() const;
@@ -455,6 +463,10 @@ private:
LLDynamicArray<U32> mCacheMissFull;
LLDynamicArray<U32> mCacheMissCRC;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3)
mutable LLPointer<LLViewerTexture> mWorldMapTile;
// [/SL:KB]
bool mAlive; // can become false if circuit disconnects
bool mCapabilitiesReceived;
bool mFeaturesReceived;

View File

@@ -1,36 +1,67 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<menu bottom="100" color="MenuDefaultBgColor" drop_shadow="true" height="101" left="100"
mouse_opaque="false" name="popup" opaque="true" width="128">
<menu_item_call bottom_delta="-18" height="18" label="Zoom Close" left="0"
mouse_opaque="true" name="Zoom Close" width="128">
<menu_item_call label="Zoom Close" name="Zoom Close">
<on_click function="MiniMap.ZoomLevel" userdata="2" />
</menu_item_call>
<menu_item_call bottom_delta="-18" height="18" label="Zoom Medium" left="0"
mouse_opaque="true" name="Zoom Medium" width="128">
<menu_item_call label="Zoom Medium" name="Zoom Medium">
<on_click function="MiniMap.ZoomLevel" userdata="1" />
</menu_item_call>
<menu_item_call bottom_delta="-18" height="18" label="Zoom Far" left="0"
mouse_opaque="true" name="Zoom Far" width="128">
<menu_item_call label="Zoom Far" name="Zoom Far">
<on_click function="MiniMap.ZoomLevel" userdata="0" />
</menu_item_call>
<menu_item_separator />
<menu_item_check bottom_delta="-18" enabled="true" height="18" label="Center on Camera"
left="0" mouse_opaque="true" name="Center on Camera" width="128">
<menu_item_check label="Center on Camera" name="Center on Camera">
<on_click function="MiniMap.Center" userdata="1" />
<on_check function="MiniMap.CheckCenter" userdata="1" />
</menu_item_check>
<menu_item_check bottom_delta="-18" enabled="true" height="18" label="Rotate Mini-Map"
left="0" mouse_opaque="true" name="Rotate Mini-Map" width="128">
<menu_item_check label="Rotate Mini-Map" name="Rotate Mini-Map">
<on_click function="MiniMap.ToggleControl" userdata="MiniMapRotate" />
<on_check control="MiniMapRotate" />
</menu_item_check>
<menu_item_check bottom_delta="-18" enabled="false" height="18" label="Show Objects"
left="0" mouse_opaque="true" name="Show Objects" width="128">
<on_click function="MiniMap.ToggleControl" userdata="ShowMiniMapObjects" />
<on_check control="ShowMiniMapObjects" />
<menu
label="Show"
name="Minimap Show">
<menu_item_check
label="Objects"
name="Objects">
<menu_item_check.on_click
function="MiniMap.ToggleControl"
userdata="ShowMiniMapObjects" />
<menu_item_check.on_check
control="ShowMiniMapObjects" />
</menu_item_check>
<menu bottom_delta="0" color="MenuDefaultBgColor" drop_shadow="true" height="175" left="0"
mouse_opaque="false" name="Chat Distance Rings" label="Chat Distance Rings" opaque="true" tear_off="false" width="125">
<menu_item_check
label="Property Lines"
name="Property Lines">
<menu_item_check.on_click
function="Minimap.ToggleOverlay"
userdata="MiniMapPropertyLines" />
<menu_item_check.on_check
control="MiniMapPropertyLines" />
</menu_item_check>
<menu_item_check
label="Parcels for Sale"
name="Parcels for Sale">
<menu_item_check.on_click
function="Minimap.ToggleOverlay"
userdata="MiniMapForSaleParcels" />
<menu_item_check.on_check
control="MiniMapForSaleParcels" />
<menu_item_check.on_enable
control="MiniMapPropertyLines" />
</menu_item_check>
<menu_item_check
label="Radar Tracking Circles"
name="Radar Tracking Circles">
<menu_item_check.on_check
control="MiniMapRadarTrackingCircles"/>
<menu_item_check.on_click
function="MiniMap.ToggleControl"
userdata="MiniMapRadarTrackingCircles"/>
</menu_item_check>
</menu>
<menu name="Chat Distance Rings" label="Chat Distance Rings">
<menu_item_check label="Show All" name="Show All">
<on_check function="MiniMap.CheckChatRings" />
<on_click function="MiniMap.ChatRings" />
@@ -50,47 +81,41 @@
</menu_item_check>
</menu>
<menu_item_separator />
<menu_item_call bottom_delta="-18" enabled = "false" height="18" label="Stop Tracking"
left="0" mouse_opaque="true" name="Stop Tracking" width="128">
<menu_item_call label="Stop Tracking" name="Stop Tracking">
<on_click function="MiniMap.StopTracking" />
<on_enable function="MiniMap.EnableTracking" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "false" height="18" label="Profile..."
left="0" mouse_opaque="true" name="Profile" width="128">
<menu_item_call label="Profile..." name="Profile">
<on_click function="MiniMap.ShowProfile" />
<on_enable function="MiniMap.EnableProfile" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Cam..."
left="0" mouse_opaque="true" name="Camfollow" width="128">
<menu_item_call label="Cam..." name="Camfollow">
<on_click function="MiniMap.CamFollow" />
<on_enable function="MiniMap.EnableProfile" />
</menu_item_call>
<menu bottom_delta="0" color="MenuDefaultBgColor" drop_shadow="true" height="175" left="0"
mouse_opaque="false" name="Mark" label="Mark" opaque="true" tear_off="false" width="125">
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Red"
left="0" mouse_opaque="true" name="Red" width="128">
<menu name="Mark" label="Mark">
<menu_item_call label="Red" name="Red">
<on_click function="MiniMap.setred" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Green"
left="0" mouse_opaque="true" name="Green" width="128">
<menu_item_call label="Green" name="Green">
<on_click function="MiniMap.setgreen" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Blue"
left="0" mouse_opaque="true" name="Blue" width="128">
<menu_item_call label="Blue" name="Blue">
<on_click function="MiniMap.setblue" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Yellow"
left="0" mouse_opaque="true" name="Yellow" width="128">
<menu_item_call label="Yellow" name="Yellow">
<on_click function="MiniMap.setyellow" />
</menu_item_call>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Custom..."
left="0" mouse_opaque="true" name="Custom" width="128">
<menu_item_call label="Custom..." name="Custom">
<on_click function="MiniMap.setcustom" />
</menu_item_call>
</menu>
<menu_item_call bottom_delta="-18" enabled = "true" height="18" label="Unmark"
left="0" mouse_opaque="true" name="Unmark" width="128">
<menu_item_call label="Unmark" name="Unmark">
<on_click function="MiniMap.setunmark" />
<on_enable function="MiniMap.enableunmark" />
</menu_item_call>
<menu_item_check label="World Map Textures" name="World Map Textures">
<on_check control="MiniMapWorldMapTextures" />
<on_click function="MiniMap.ToggleControl" userdata="MiniMapWorldMapTextures" />
</menu_item_check>
</menu>