aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatermap.cpp
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/llfloatermap.cpp
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/llfloatermap.cpp142
1 files changed, 25 insertions, 117 deletions
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index b1aa6c7..6115404 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -31,120 +31,43 @@
31 31
32#include "llviewerprecompiledheaders.h" 32#include "llviewerprecompiledheaders.h"
33 33
34// self include
35#include "llfloatermap.h" 34#include "llfloatermap.h"
36 35
37// Library includes
38#include "llfontgl.h"
39#include "llinventory.h"
40#include "message.h"
41
42// Viewer includes
43#include "llagent.h" 36#include "llagent.h"
44#include "llcolorscheme.h" 37#include "llcolorscheme.h"
45#include "llviewercontrol.h" 38#include "llviewercontrol.h"
46#include "lldraghandle.h" 39#include "lldraghandle.h"
47#include "lleconomy.h"
48#include "llfloaterworldmap.h"
49#include "llfocusmgr.h"
50#include "llnetmap.h" 40#include "llnetmap.h"
51#include "llregionhandle.h" 41#include "llregionhandle.h"
52#include "llresizebar.h" 42#include "llresizebar.h"
53#include "llresizehandle.h" 43#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 44
45LLFloaterMap::LLFloaterMap(const LLSD& key)
46 :
47 LLFloater(std::string("minimap")),
48 mPanelMap(NULL)
49{
50 LLCallbackMap::map_t factory_map;
51 factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this);
52 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE);
53}
110 54
111 55
112// 56// static
113// Member functions 57void* LLFloaterMap::createPanelMiniMap(void* data)
114// 58{
59 LLFloaterMap* self = (LLFloaterMap*)data;
60 self->mPanelMap = new LLNetMap("Mapview");
61 return self->mPanelMap;
62}
115 63
116LLFloaterMap::LLFloaterMap(const std::string& name) 64BOOL 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{ 65{
128 const S32 LEFT = LLPANEL_BORDER_WIDTH; 66 // 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()); 67 sendChildToBack(getDragHandle());
146 68 sendChildToFront(getChild<LLButton>("llfloater_close_btn"));
147 setIsChrome(TRUE); 69 setIsChrome(TRUE);
70 return TRUE;
148} 71}
149 72
150 73
@@ -154,11 +77,11 @@ LLFloaterMap::~LLFloaterMap()
154 77
155 78
156// virtual 79// virtual
157void LLFloaterMap::setVisible(BOOL visible) 80void LLFloaterMap::onOpen()
158{ 81{
159 LLFloater::setVisible(visible); 82 gFloaterView->adjustToFitScreen(this, FALSE);
160 83
161 gSavedSettings.setBOOL("ShowMiniMap", visible); 84 gSavedSettings.setBOOL("ShowMiniMap", TRUE);
162} 85}
163 86
164 87
@@ -188,7 +111,7 @@ void LLFloaterMap::draw()
188 setMouseOpaque(FALSE); 111 setMouseOpaque(FALSE);
189 getDragHandle()->setMouseOpaque(FALSE); 112 getDragHandle()->setMouseOpaque(FALSE);
190 113
191 drawChild(mMap); 114 drawChild(mPanelMap);
192 } 115 }
193 else 116 else
194 { 117 {
@@ -199,18 +122,3 @@ void LLFloaterMap::draw()
199 } 122 }
200} 123}
201 124
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}