aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatermap.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/llfloatermap.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatermap.cpp145
1 files changed, 27 insertions, 118 deletions
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index b1aa6c7..3b1e4c7 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -31,120 +32,43 @@
31 32
32#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
33 34
34// self include
35#include "llfloatermap.h" 35#include "llfloatermap.h"
36 36
37// Library includes
38#include "llfontgl.h"
39#include "llinventory.h"
40#include "message.h"
41
42// Viewer includes
43#include "llagent.h" 37#include "llagent.h"
44#include "llcolorscheme.h" 38#include "llcolorscheme.h"
45#include "llviewercontrol.h" 39#include "llviewercontrol.h"
46#include "lldraghandle.h" 40#include "lldraghandle.h"
47#include "lleconomy.h"
48#include "llfloaterworldmap.h"
49#include "llfocusmgr.h"
50#include "llnetmap.h" 41#include "llnetmap.h"
51#include "llregionhandle.h" 42#include "llregionhandle.h"
52#include "llresizebar.h" 43#include "llresizebar.h"
53#include "llresizehandle.h" 44#include "lluictrlfactory.h"
54#include "llresmgr.h"
55#include "llsky.h"
56#include "llsliderctrl.h"
57#include "llspinctrl.h"
58#include "llstatgraph.h"
59#include "llstatusbar.h"
60//#include "lltextbox.h"
61#include "llui.h"
62#include "llviewermenu.h"
63#include "llviewerparceloverlay.h"
64#include "llviewerregion.h"
65#include "llviewerstats.h"
66#include "llurlsimstring.h"
67
68#include "llglheaders.h"
69
70//
71// Constants
72//
73const S32 LEGEND_SIZE = 16;
74
75const S32 HPAD = 4;
76
77const S32 MAP_COMBOBOX_WIDTH = 128;
78const S32 MAP_COMBOBOX_HEIGHT = 20;
79const S32 GO_BTN_WIDTH = 20;
80const S32 SLIDER_WIDTH = LEGEND_SIZE + MAP_COMBOBOX_WIDTH + HPAD + GO_BTN_WIDTH - HPAD;
81const S32 SLIDER_HEIGHT = 16;
82
83const S32 SIM_STAT_WIDTH = 8;
84
85const S32 MAP_SCALE_MIN = 35; // in pixels per sim
86const S32 MAP_SCALE_MAX = 180; // in pixels per sim
87const S32 MAP_SCALE_INCREMENT = 5;
88
89const S32 NETMAP_MIN_WIDTH = 128;
90const S32 NETMAP_MIN_HEIGHT = 128;
91
92const S32 FLOATERMAP_MIN_WIDTH =
93 SLIDER_WIDTH +
94 2 * (HPAD + LLPANEL_BORDER_WIDTH);
95
96const S32 MORE_BTN_VPAD = 2;
97
98const S32 SPIN_VPAD = 4;
99
100const S32 TRACKING_LABEL_HEIGHT = 16;
101
102const S32 FLOATERMAP_MIN_HEIGHT_LARGE = 60;
103
104//
105// Globals
106//
107LLFloaterMap *gFloaterMap = NULL;
108
109 45
46LLFloaterMap::LLFloaterMap(const LLSD& key)
47 :
48 LLFloater(std::string("minimap")),
49 mPanelMap(NULL)
50{
51 LLCallbackMap::map_t factory_map;
52 factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this);
53 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE);
54}
110 55
111 56
112// 57// static
113// Member functions 58void* LLFloaterMap::createPanelMiniMap(void* data)
114// 59{
60 LLFloaterMap* self = (LLFloaterMap*)data;
61 self->mPanelMap = new LLNetMap("Mapview");
62 return self->mPanelMap;
63}
115 64
116LLFloaterMap::LLFloaterMap(const std::string& name) 65BOOL LLFloaterMap::postBuild()
117 :
118 LLFloater(name,
119 std::string("FloaterMiniMapRect"),
120 LLStringUtil::null,
121 TRUE,
122 FLOATERMAP_MIN_WIDTH,
123 FLOATERMAP_MIN_HEIGHT_LARGE,
124 FALSE,
125 FALSE,
126 TRUE) // close button
127{ 66{
128 const S32 LEFT = LLPANEL_BORDER_WIDTH; 67 // Send the drag handle to the back, but make sure close stays on top
129 const S32 TOP = getRect().getHeight();
130
131 S32 y = 0;
132
133 // Map itself
134 LLRect map_rect(
135 LEFT,
136 TOP - LLPANEL_BORDER_WIDTH,
137 getRect().getWidth() - LLPANEL_BORDER_WIDTH,
138 y );
139 LLColor4 bg_color = gColors.getColor( "NetMapBackgroundColor" );
140 mMap = new LLNetMap("Net Map", map_rect, bg_color);
141 mMap->setFollowsAll();
142 addChildAtEnd(mMap);
143
144 // Get the drag handle all the way in back
145 sendChildToBack(getDragHandle()); 68 sendChildToBack(getDragHandle());
146 69 sendChildToFront(getChild<LLButton>("llfloater_close_btn"));
147 setIsChrome(TRUE); 70 setIsChrome(TRUE);
71 return TRUE;
148} 72}
149 73
150 74
@@ -154,11 +78,11 @@ LLFloaterMap::~LLFloaterMap()
154 78
155 79
156// virtual 80// virtual
157void LLFloaterMap::setVisible(BOOL visible) 81void LLFloaterMap::onOpen()
158{ 82{
159 LLFloater::setVisible(visible); 83 gFloaterView->adjustToFitScreen(this, FALSE);
160 84
161 gSavedSettings.setBOOL("ShowMiniMap", visible); 85 gSavedSettings.setBOOL("ShowMiniMap", TRUE);
162} 86}
163 87
164 88
@@ -188,7 +112,7 @@ void LLFloaterMap::draw()
188 setMouseOpaque(FALSE); 112 setMouseOpaque(FALSE);
189 getDragHandle()->setMouseOpaque(FALSE); 113 getDragHandle()->setMouseOpaque(FALSE);
190 114
191 drawChild(mMap); 115 drawChild(mPanelMap);
192 } 116 }
193 else 117 else
194 { 118 {
@@ -199,18 +123,3 @@ void LLFloaterMap::draw()
199 } 123 }
200} 124}
201 125
202// static
203void LLFloaterMap::toggle(void*)
204{
205 if( gFloaterMap )
206 {
207 if (gFloaterMap->getVisible())
208 {
209 gFloaterMap->close();
210 }
211 else
212 {
213 gFloaterMap->open(); /* Flawfinder: ignore */
214 }
215 }
216}