From 6ca9572497f3ccfa3cd46130685baada752e7fe1 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 13 Jun 2009 01:18:31 -0700 Subject: Applied Aimee's patch for VWR-13221: Allow panning of the mini-map --- linden/indra/newview/llnetmap.h | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'linden/indra/newview/llnetmap.h') diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index be5593d..508e882 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h @@ -40,9 +40,14 @@ #include "llimage.h" #include "llimagegl.h" - class LLTextBox; +typedef enum e_minimap_center +{ + MAP_CENTER_NONE = 0, + MAP_CENTER_CAMERA = 1 +} EMiniMapCenter; + class LLNetMap : public LLPanel { public: @@ -51,6 +56,9 @@ public: 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); @@ -62,7 +70,7 @@ private: void setScale( F32 scale ); - // *TODO: Enable panning of the mini-map + // Not used at present void translatePan( F32 delta_x, F32 delta_y ); void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } @@ -90,6 +98,13 @@ private: 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 mUpdateNow; LLVector3d mObjectImageCenterGlobal; LLPointer mObjectRawImagep; @@ -102,6 +117,8 @@ private: 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); + static void showAgentProfile(void*); BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } @@ -111,6 +128,18 @@ private: /*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 LLStopTracking : public LLMemberListener { public: -- cgit v1.1