aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llnetmap.h
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-06-09 09:41:04 -0700
committerMcCabe Maxsted2009-06-09 09:41:04 -0700
commite5dbb8e4dc05e664102362685ddca94f37cdf575 (patch)
tree93e695263553adadc423cf7e7d2e4b046adb8a7a /linden/indra/newview/llnetmap.h
parentFixed the Resident Chooser showing hair instead of calling cards (diff)
downloadmeta-impy-e5dbb8e4dc05e664102362685ddca94f37cdf575.zip
meta-impy-e5dbb8e4dc05e664102362685ddca94f37cdf575.tar.gz
meta-impy-e5dbb8e4dc05e664102362685ddca94f37cdf575.tar.bz2
meta-impy-e5dbb8e4dc05e664102362685ddca94f37cdf575.tar.xz
Backported 1.23's minimap conversion to XUI
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llnetmap.h89
1 files changed, 55 insertions, 34 deletions
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h
index 65d4a4c..be5593d 100644
--- a/linden/indra/newview/llnetmap.h
+++ b/linden/indra/newview/llnetmap.h
@@ -32,63 +32,56 @@
32#ifndef LL_LLNETMAP_H 32#ifndef LL_LLNETMAP_H
33#define LL_LLNETMAP_H 33#define LL_LLNETMAP_H
34 34
35#include "llmath.h" 35#include "llpanel.h"
36#include "lluictrl.h" 36#include "llmemberlistener.h"
37#include "v3math.h" 37#include "v3math.h"
38#include "v3dmath.h" 38#include "v3dmath.h"
39#include "v4color.h" 39#include "v4color.h"
40#include "llimage.h" 40#include "llimage.h"
41#include "llimagegl.h" 41#include "llimagegl.h"
42 42
43class LLColor4U; 43
44class LLCoordGL;
45class LLTextBox; 44class LLTextBox;
46class LLMenuGL;
47 45
48class LLNetMap : public LLUICtrl 46class LLNetMap : public LLPanel
49{ 47{
50public: 48public:
51 LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color ); 49 LLNetMap(const std::string& name);
52 virtual ~LLNetMap(); 50 virtual ~LLNetMap();
53 51
54 virtual void draw(); 52 virtual void draw();
53 virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
55 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); 54 virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
56 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); 55 virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
57 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); 56 virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
58 virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ); 57 virtual BOOL handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen );
59 58
59 void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius );
60
61private:
62
60 void setScale( F32 scale ); 63 void setScale( F32 scale );
64
65 // *TODO: Enable panning of the mini-map
61 void translatePan( F32 delta_x, F32 delta_y ); 66 void translatePan( F32 delta_x, F32 delta_y );
62 void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; } 67 void setPan( F32 x, F32 y ) { mTargetPanX = x; mTargetPanY = y; }
63 68
64 const LLVector3d& getObjectImageCenterGlobal() { return mObjectImageCenterGlobal; }
65 void renderPoint(const LLVector3 &pos, const LLColor4U &color, 69 void renderPoint(const LLVector3 &pos, const LLColor4U &color,
66 S32 diameter, S32 relative_height = 0); 70 S32 diameter, S32 relative_height = 0);
67 void renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &color, F32 radius ); 71 LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated);
68 72 LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated);
69 LLVector3 globalPosToView(const LLVector3d& global_pos);
70 LLVector3d viewPosToGlobal(S32 x,S32 y);
71
72 static void setRotateMap( BOOL b ) { LLNetMap::sRotateMap = b; }
73 static void handleZoomLevel(void* which);
74 73
75 void drawTracking( const LLVector3d& pos_global, 74 void drawTracking( const LLVector3d& pos_global,
76 const LLColor4& color, 75 BOOL rotated,
77 BOOL draw_arrow = TRUE); 76 const LLColor4& color,
77 BOOL draw_arrow = TRUE);
78 78
79protected:
80 void setDirectionPos( LLTextBox* text_box, F32 rotation ); 79 void setDirectionPos( LLTextBox* text_box, F32 rotation );
80 void updateMinorDirections();
81 void createObjectImage(); 81 void createObjectImage();
82 static void teleport( const LLVector3d& destination );
83 static void fly( const LLVector3d& destination );
84 82
85public:
86 LLHandle<LLView> mPopupMenuHandle; 83 LLHandle<LLView> mPopupMenuHandle;
87 84
88 LLColor4 mBackgroundColor;
89 LLColor4 glyph_color_avatar;
90 LLColor4 glyph_color_friend;
91
92 F32 mScale; // Size of a region in pixels 85 F32 mScale; // Size of a region in pixels
93 F32 mPixelsPerMeter; // world meters to map pixels 86 F32 mPixelsPerMeter; // world meters to map pixels
94 F32 mObjectMapTPM; // texels per meter on map 87 F32 mObjectMapTPM; // texels per meter on map
@@ -101,18 +94,46 @@ public:
101 LLVector3d mObjectImageCenterGlobal; 94 LLVector3d mObjectImageCenterGlobal;
102 LLPointer<LLImageRaw> mObjectRawImagep; 95 LLPointer<LLImageRaw> mObjectRawImagep;
103 LLPointer<LLImageGL> mObjectImagep; 96 LLPointer<LLImageGL> mObjectImagep;
104 LLTextBox* mTextBoxEast;
105 LLTextBox* mTextBoxNorth;
106 LLTextBox* mTextBoxWest;
107 LLTextBox* mTextBoxSouth;
108 97
109 LLTextBox* mTextBoxSouthEast; 98private:
110 LLTextBox* mTextBoxNorthEast; 99 LLUUID mClosestAgentToCursor;
111 LLTextBox* mTextBoxNorthWest; 100 LLUUID mClosestAgentAtLastRightClick;
112 LLTextBox* mTextBoxSouthWest;
113 101
114 static BOOL sRotateMap; 102 static BOOL sRotateMap;
115 static LLNetMap* sInstance; 103 static LLNetMap* sInstance;
104 static BOOL isAgentUnderCursor(void*) { return sInstance && sInstance->mClosestAgentToCursor.notNull(); }
105 static void showAgentProfile(void*);
106 BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); }
107
108 class LLScaleMap : public LLMemberListener<LLNetMap>
109 {
110 public:
111 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
112 };
113
114 class LLStopTracking : public LLMemberListener<LLNetMap>
115 {
116 public:
117 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
118 };
119
120 class LLEnableTracking : public LLMemberListener<LLNetMap>
121 {
122 public:
123 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
124 };
125
126 class LLShowAgentProfile : public LLMemberListener<LLNetMap>
127 {
128 public:
129 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
130 };
131
132 class LLEnableProfile : public LLMemberListener<LLNetMap>
133 {
134 public:
135 /*virtual*/ bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata);
136 };
116}; 137};
117 138
118 139