diff options
author | McCabe Maxsted | 2009-08-11 17:47:40 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-08-11 17:47:40 -0700 |
commit | c5926546aa73bfb2900dda7d010a4d72550e6787 (patch) | |
tree | c8d48cacdd56f4b8fc191f0c75cff5446b020617 /linden | |
parent | Changed range to 96m (diff) | |
download | meta-impy-c5926546aa73bfb2900dda7d010a4d72550e6787.zip meta-impy-c5926546aa73bfb2900dda7d010a4d72550e6787.tar.gz meta-impy-c5926546aa73bfb2900dda7d010a4d72550e6787.tar.bz2 meta-impy-c5926546aa73bfb2900dda7d010a4d72550e6787.tar.xz |
Moved radar back into llfloatermap.cpp, it works
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 256 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.h | 21 | ||||
-rw-r--r-- | linden/indra/newview/llnetmap.cpp | 177 | ||||
-rw-r--r-- | linden/indra/newview/llnetmap.h | 12 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/colors_base.xml | 1 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | 47 |
6 files changed, 316 insertions, 198 deletions
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index 6115404..b420eca 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp | |||
@@ -42,6 +42,20 @@ | |||
42 | #include "llresizebar.h" | 42 | #include "llresizebar.h" |
43 | #include "lluictrlfactory.h" | 43 | #include "lluictrlfactory.h" |
44 | 44 | ||
45 | // radar | ||
46 | #include "llfloateravatarinfo.h" | ||
47 | #include "llfloaterfriends.h" | ||
48 | #include "llfloatergroupinvite.h" | ||
49 | #include "llfloatergroups.h" | ||
50 | #include "llimview.h" | ||
51 | #include "roles_constants.h" | ||
52 | #include "llscrolllistctrl.h" | ||
53 | #include "lltracker.h" | ||
54 | #include "llviewermessage.h" | ||
55 | #include "llworld.h" | ||
56 | |||
57 | LLFloaterMap* LLFloaterMap::sInstance = NULL; | ||
58 | |||
45 | LLFloaterMap::LLFloaterMap(const LLSD& key) | 59 | LLFloaterMap::LLFloaterMap(const LLSD& key) |
46 | : | 60 | : |
47 | LLFloater(std::string("minimap")), | 61 | LLFloater(std::string("minimap")), |
@@ -50,6 +64,7 @@ LLFloaterMap::LLFloaterMap(const LLSD& key) | |||
50 | LLCallbackMap::map_t factory_map; | 64 | LLCallbackMap::map_t factory_map; |
51 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); | 65 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); |
52 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); | 66 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); |
67 | sInstance = this; | ||
53 | } | 68 | } |
54 | 69 | ||
55 | 70 | ||
@@ -58,6 +73,7 @@ void* LLFloaterMap::createPanelMiniMap(void* data) | |||
58 | { | 73 | { |
59 | LLFloaterMap* self = (LLFloaterMap*)data; | 74 | LLFloaterMap* self = (LLFloaterMap*)data; |
60 | self->mPanelMap = new LLNetMap("Mapview"); | 75 | self->mPanelMap = new LLNetMap("Mapview"); |
76 | self->mSelectedAvatar.setNull(); | ||
61 | return self->mPanelMap; | 77 | return self->mPanelMap; |
62 | } | 78 | } |
63 | 79 | ||
@@ -67,12 +83,28 @@ BOOL LLFloaterMap::postBuild() | |||
67 | sendChildToBack(getDragHandle()); | 83 | sendChildToBack(getDragHandle()); |
68 | sendChildToFront(getChild<LLButton>("llfloater_close_btn")); | 84 | sendChildToFront(getChild<LLButton>("llfloater_close_btn")); |
69 | setIsChrome(TRUE); | 85 | setIsChrome(TRUE); |
86 | |||
87 | mRadarList = getChild<LLScrollListCtrl>("RadarList"); | ||
88 | childSetCommitCallback("RadarList", onList, this); | ||
89 | |||
90 | childSetAction("im_btn", onClickIM, this); | ||
91 | childSetAction("profile_btn", onClickProfile, this); | ||
92 | childSetAction("offer_teleport_btn", onClickOfferTeleport, this); | ||
93 | childSetAction("track_btn", onClickTrack, this); | ||
94 | childSetAction("invite_btn", onClickInvite, this); | ||
95 | childSetAction("add_btn", onClickAddFriend, this); | ||
96 | |||
97 | setDefaultBtn("im_btn"); | ||
98 | |||
99 | populateRadar(); | ||
100 | |||
70 | return TRUE; | 101 | return TRUE; |
71 | } | 102 | } |
72 | 103 | ||
73 | 104 | ||
74 | LLFloaterMap::~LLFloaterMap() | 105 | LLFloaterMap::~LLFloaterMap() |
75 | { | 106 | { |
107 | sInstance = NULL; | ||
76 | } | 108 | } |
77 | 109 | ||
78 | 110 | ||
@@ -122,3 +154,227 @@ void LLFloaterMap::draw() | |||
122 | } | 154 | } |
123 | } | 155 | } |
124 | 156 | ||
157 | |||
158 | // | ||
159 | // Radar | ||
160 | // | ||
161 | |||
162 | //static | ||
163 | void LLFloaterMap::updateRadar() | ||
164 | { | ||
165 | LLFloaterMap* self = sInstance; | ||
166 | self->populateRadar(); | ||
167 | } | ||
168 | |||
169 | void LLFloaterMap::populateRadar() | ||
170 | { | ||
171 | BOOL empty = TRUE; | ||
172 | std::stringstream avatar_count_string; | ||
173 | LLScrollListCtrl* radar_scroller = getChild<LLScrollListCtrl>("RadarList"); | ||
174 | radar_scroller->deleteAllItems(); | ||
175 | |||
176 | LLVector3d current_pos = gAgent.getPositionGlobal(); | ||
177 | |||
178 | std::vector<LLUUID> avatar_ids; | ||
179 | std::vector<LLVector3d> positions; | ||
180 | LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, current_pos, gSavedSettings.getF32("NearMeRange")); | ||
181 | for(U32 i=0; i<avatar_ids.size(); i++) | ||
182 | { | ||
183 | LLUUID& av = avatar_ids[i]; | ||
184 | |||
185 | if(av == gAgent.getID()) | ||
186 | continue; | ||
187 | |||
188 | LLVector3d avatar_pos = positions[i]; | ||
189 | F64 distance = dist_vec(current_pos, avatar_pos); | ||
190 | std::stringstream dist_formatted; | ||
191 | dist_formatted << (double)((int)((distance + 0.05)*10.0))/10.0 << "m"; | ||
192 | |||
193 | LLSD element; | ||
194 | element["id"] = av; // value | ||
195 | element["columns"][0]["column"] = "avatar_name"; | ||
196 | element["columns"][0]["type"] = "text"; | ||
197 | |||
198 | std::string fullname; | ||
199 | if(!gCacheName->getFullName(av, fullname)) | ||
200 | { | ||
201 | element["columns"][0]["value"] = LLCacheName::getDefaultName(); | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | element["columns"][0]["value"] = fullname; | ||
206 | } | ||
207 | |||
208 | element["columns"][1]["column"] = "avatar_distance"; | ||
209 | element["columns"][1]["type"] = "text"; | ||
210 | element["columns"][1]["value"] = dist_formatted.str(); | ||
211 | radar_scroller->addElement(element); | ||
212 | empty = FALSE; | ||
213 | } | ||
214 | |||
215 | avatar_count_string.str(""); | ||
216 | if (empty) | ||
217 | { | ||
218 | childSetEnabled("RadarList", false);childSetEnabled("im_btn", false); | ||
219 | radar_scroller->addCommentText(getString("no_one_near")); | ||
220 | avatar_count_string << "0"; | ||
221 | } | ||
222 | else | ||
223 | { | ||
224 | childSetEnabled("RadarList", true); | ||
225 | radar_scroller->selectFirstItem(); | ||
226 | avatar_count_string << (int)avatar_ids.size(); | ||
227 | } | ||
228 | LLTextBox* lblAvatarCount = getChild<LLTextBox>("lblAvatarCount"); | ||
229 | lblAvatarCount->setText(avatar_count_string.str()); | ||
230 | |||
231 | onList(radar_scroller, this); | ||
232 | } | ||
233 | |||
234 | // static | ||
235 | void LLFloaterMap::onList(LLUICtrl* ctrl, void* user_data) | ||
236 | { | ||
237 | LLFloaterMap* self = (LLFloaterMap*)user_data; | ||
238 | if (self) | ||
239 | { | ||
240 | self->childSetEnabled("im_btn", self->visibleItemsSelected()); | ||
241 | self->childSetEnabled("profile_btn", self->visibleItemsSelected()); | ||
242 | self->childSetEnabled("offer_teleport_btn", self->visibleItemsSelected()); | ||
243 | self->childSetEnabled("track_btn", self->visibleItemsSelected()); | ||
244 | self->childSetEnabled("invite_btn", self->visibleItemsSelected()); | ||
245 | self->childSetEnabled("add_btn", self->visibleItemsSelected()); | ||
246 | |||
247 | if (self->visibleItemsSelected()) | ||
248 | { | ||
249 | self->mSelectedAvatar = self->mRadarList->getFirstSelected()->getUUID(); | ||
250 | } | ||
251 | else | ||
252 | { | ||
253 | self->mSelectedAvatar.setNull(); | ||
254 | } | ||
255 | } | ||
256 | } | ||
257 | |||
258 | BOOL LLFloaterMap::visibleItemsSelected() const | ||
259 | { | ||
260 | if (mRadarList->getFirstSelectedIndex() >= 0) | ||
261 | { | ||
262 | return TRUE; | ||
263 | } | ||
264 | return FALSE; | ||
265 | } | ||
266 | |||
267 | // static | ||
268 | BOOL LLFloaterMap::isSelected(LLUUID agent) | ||
269 | { | ||
270 | if (sInstance->mSelectedAvatar == agent) | ||
271 | { | ||
272 | return TRUE; | ||
273 | } | ||
274 | return FALSE; | ||
275 | } | ||
276 | |||
277 | // static | ||
278 | void LLFloaterMap::onClickIM(void* user_data) | ||
279 | { | ||
280 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
281 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
282 | if (item != NULL) | ||
283 | { | ||
284 | LLUUID agent_id = item->getUUID(); | ||
285 | std::string fullname; | ||
286 | if(gCacheName->getFullName(agent_id, fullname)) | ||
287 | { | ||
288 | gIMMgr->setFloaterOpen(TRUE); | ||
289 | gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | |||
294 | // static | ||
295 | void LLFloaterMap::onClickProfile(void* user_data) | ||
296 | { | ||
297 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
298 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
299 | if (item != NULL) | ||
300 | { | ||
301 | LLUUID agent_id = item->getUUID(); | ||
302 | LLFloaterAvatarInfo::show(agent_id); | ||
303 | } | ||
304 | } | ||
305 | |||
306 | // static | ||
307 | void LLFloaterMap::onClickOfferTeleport(void* user_data) | ||
308 | { | ||
309 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
310 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
311 | if (item != NULL) | ||
312 | { | ||
313 | LLUUID agent_id = item->getUUID(); | ||
314 | handle_lure(agent_id); | ||
315 | } | ||
316 | } | ||
317 | |||
318 | // static | ||
319 | void LLFloaterMap::onClickTrack(void* user_data) | ||
320 | { | ||
321 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
322 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); | ||
323 | if (LLTracker::TRACKING_AVATAR == tracking_status) | ||
324 | { | ||
325 | LLTracker::stopTracking(NULL); | ||
326 | } | ||
327 | else | ||
328 | { | ||
329 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
330 | if (item != NULL) | ||
331 | { | ||
332 | LLUUID agent_id = item->getUUID(); | ||
333 | std::string fullname; | ||
334 | gCacheName->getFullName(agent_id, fullname); | ||
335 | LLTracker::trackAvatar(agent_id, fullname); | ||
336 | } | ||
337 | } | ||
338 | } | ||
339 | |||
340 | // static | ||
341 | void LLFloaterMap::onClickInvite(void* user_data) | ||
342 | { | ||
343 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
344 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
345 | if (item != NULL) | ||
346 | { | ||
347 | LLUUID agent_id = item->getUUID(); | ||
348 | LLFloaterGroupPicker* widget; | ||
349 | widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); | ||
350 | if (widget) | ||
351 | { | ||
352 | widget->center(); | ||
353 | widget->setPowersMask(GP_MEMBER_INVITE); | ||
354 | widget->setSelectCallback(callback_invite_to_group, (void *)&agent_id); | ||
355 | } | ||
356 | } | ||
357 | } | ||
358 | |||
359 | // static | ||
360 | void LLFloaterMap::callback_invite_to_group(LLUUID group_id, void *user_data) | ||
361 | { | ||
362 | std::vector<LLUUID> agent_ids; | ||
363 | agent_ids.push_back(*(LLUUID *)user_data); | ||
364 | |||
365 | LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); | ||
366 | } | ||
367 | |||
368 | // static | ||
369 | void LLFloaterMap::onClickAddFriend(void* user_data) | ||
370 | { | ||
371 | LLFloaterMap* self = (LLFloaterMap*) user_data; | ||
372 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
373 | if (item != NULL) | ||
374 | { | ||
375 | LLUUID agent_id = item->getUUID(); | ||
376 | std::string fullname; | ||
377 | gCacheName->getFullName(agent_id, fullname); | ||
378 | LLPanelFriends::requestFriendshipDialog(agent_id, fullname); | ||
379 | } | ||
380 | } | ||
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h index dd1cba8..e099b4e 100644 --- a/linden/indra/newview/llfloatermap.h +++ b/linden/indra/newview/llfloatermap.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define LL_LLFLOATERMAP_H | 33 | #define LL_LLFLOATERMAP_H |
34 | 34 | ||
35 | #include "llfloater.h" | 35 | #include "llfloater.h" |
36 | #include "llscrolllistctrl.h" | ||
36 | 37 | ||
37 | class LLNetMap; | 38 | class LLNetMap; |
38 | 39 | ||
@@ -46,6 +47,9 @@ public: | |||
46 | 47 | ||
47 | static void* createPanelMiniMap(void* data); | 48 | static void* createPanelMiniMap(void* data); |
48 | 49 | ||
50 | static void updateRadar(); | ||
51 | static BOOL isSelected(LLUUID agent); | ||
52 | |||
49 | BOOL postBuild(); | 53 | BOOL postBuild(); |
50 | 54 | ||
51 | /*virtual*/ void draw(); | 55 | /*virtual*/ void draw(); |
@@ -55,7 +59,22 @@ public: | |||
55 | 59 | ||
56 | private: | 60 | private: |
57 | LLFloaterMap(const LLSD& key = LLSD()); | 61 | LLFloaterMap(const LLSD& key = LLSD()); |
58 | LLNetMap* mPanelMap; | 62 | LLNetMap* mPanelMap; |
63 | LLScrollListCtrl* mRadarList; | ||
64 | LLUUID mSelectedAvatar; | ||
65 | static LLFloaterMap* sInstance; | ||
66 | |||
67 | static void onList(class LLUICtrl* ctrl, void* user_data); | ||
68 | BOOL visibleItemsSelected() const; | ||
69 | void populateRadar(); | ||
70 | |||
71 | static void onClickProfile(void* user_data); | ||
72 | static void onClickIM(void* user_data); | ||
73 | static void onClickAddFriend(void* user_data); | ||
74 | static void onClickOfferTeleport(void* user_data); | ||
75 | static void onClickTrack(void* user_data); | ||
76 | static void onClickInvite(void* user_data); | ||
77 | static void callback_invite_to_group(LLUUID group_id, void *user_data); | ||
59 | }; | 78 | }; |
60 | 79 | ||
61 | #endif // LL_LLFLOATERMAP_H | 80 | #endif // LL_LLFLOATERMAP_H |
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 903f6f3..2429aa4 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -44,6 +44,8 @@ | |||
44 | #include "llcallingcard.h" | 44 | #include "llcallingcard.h" |
45 | #include "llcolorscheme.h" | 45 | #include "llcolorscheme.h" |
46 | #include "llviewercontrol.h" | 46 | #include "llviewercontrol.h" |
47 | #include "llfloateravatarinfo.h" | ||
48 | #include "llfloatermap.h" | ||
47 | #include "llfloaterworldmap.h" | 49 | #include "llfloaterworldmap.h" |
48 | #include "llframetimer.h" | 50 | #include "llframetimer.h" |
49 | #include "llmutelist.h" | 51 | #include "llmutelist.h" |
@@ -65,14 +67,6 @@ | |||
65 | #include "llworldmapview.h" // shared draw code | 67 | #include "llworldmapview.h" // shared draw code |
66 | #include "llappviewer.h" // Only for constants! | 68 | #include "llappviewer.h" // Only for constants! |
67 | 69 | ||
68 | // radar | ||
69 | #include "llfloateravatarinfo.h" | ||
70 | #include "llfloatergroupinvite.h" | ||
71 | #include "llfloatergroups.h" | ||
72 | #include "roles_constants.h" | ||
73 | #include "llimview.h" | ||
74 | #include "llscrolllistctrl.h" | ||
75 | |||
76 | #include "llglheaders.h" | 70 | #include "llglheaders.h" |
77 | 71 | ||
78 | const F32 MAP_SCALE_MIN = 32; | 72 | const F32 MAP_SCALE_MIN = 32; |
@@ -112,8 +106,6 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
112 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); | 106 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); |
113 | 107 | ||
114 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); | 108 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); |
115 | //TODO: This'll make it toggle | ||
116 | //LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map_radar.xml"); | ||
117 | 109 | ||
118 | updateMinorDirections(); | 110 | updateMinorDirections(); |
119 | 111 | ||
@@ -128,17 +120,6 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
128 | 120 | ||
129 | BOOL LLNetMap::postBuild() | 121 | BOOL LLNetMap::postBuild() |
130 | { | 122 | { |
131 | mRadarList = getChild<LLScrollListCtrl>("RadarList"); | ||
132 | |||
133 | childSetAction("im_btn", onClickIM, this); | ||
134 | childSetAction("profile_btn", onClickProfile, this); | ||
135 | childSetAction("offer_teleport_btn", onClickOfferTeleport, this); | ||
136 | childSetAction("track_btn", onClickTrack, this); | ||
137 | childSetAction("invite_btn", onClickInvite, this); | ||
138 | childSetAction("add_btn", onClickAddFriend, this); | ||
139 | |||
140 | setDefaultBtn("im_btn"); | ||
141 | |||
142 | return TRUE; | 123 | return TRUE; |
143 | } | 124 | } |
144 | 125 | ||
@@ -355,6 +336,7 @@ void LLNetMap::draw() | |||
355 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); | 336 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); |
356 | LLColor4 friend_color = gColors.getColor( "MapFriend" ); | 337 | LLColor4 friend_color = gColors.getColor( "MapFriend" ); |
357 | LLColor4 muted_color = gColors.getColor( "MapMuted" ); | 338 | LLColor4 muted_color = gColors.getColor( "MapMuted" ); |
339 | LLColor4 selected_color = gColors.getColor( "MapSelected" ); | ||
358 | LLColor4 glyph_color; | 340 | LLColor4 glyph_color; |
359 | 341 | ||
360 | std::vector<LLUUID> avatar_ids; | 342 | std::vector<LLUUID> avatar_ids; |
@@ -375,6 +357,10 @@ void LLNetMap::draw() | |||
375 | { | 357 | { |
376 | glyph_color = friend_color; | 358 | glyph_color = friend_color; |
377 | } | 359 | } |
360 | else if (LLFloaterMap::isSelected(avatar_ids[i])) | ||
361 | { | ||
362 | glyph_color = selected_color; | ||
363 | } | ||
378 | else | 364 | else |
379 | { | 365 | { |
380 | glyph_color = avatar_color; | 366 | glyph_color = avatar_color; |
@@ -474,9 +460,9 @@ void LLNetMap::draw() | |||
474 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); | 460 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); |
475 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); | 461 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); |
476 | 462 | ||
477 | populateRadar(); | ||
478 | |||
479 | LLView::draw(); | 463 | LLView::draw(); |
464 | |||
465 | LLFloaterMap::updateRadar(); | ||
480 | } | 466 | } |
481 | 467 | ||
482 | void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) | 468 | void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) |
@@ -975,148 +961,3 @@ bool LLNetMap::LLEnableProfile::handleEvent(LLPointer<LLEvent> event, const LLSD | |||
975 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); | 961 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); |
976 | return true; | 962 | return true; |
977 | } | 963 | } |
978 | |||
979 | |||
980 | // | ||
981 | // Radar | ||
982 | // | ||
983 | |||
984 | void LLNetMap::populateRadar() | ||
985 | { | ||
986 | BOOL all_loaded = TRUE; | ||
987 | BOOL empty = TRUE; | ||
988 | LLScrollListCtrl* radar_scroller = getChild<LLScrollListCtrl>("RadarList"); | ||
989 | radar_scroller->deleteAllItems(); | ||
990 | |||
991 | std::vector<LLUUID> avatar_ids; | ||
992 | LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); | ||
993 | for(U32 i=0; i<avatar_ids.size(); i++) | ||
994 | { | ||
995 | LLUUID& av = avatar_ids[i]; | ||
996 | if(av == gAgent.getID()) continue; | ||
997 | LLSD element; | ||
998 | element["id"] = av; // value | ||
999 | std::string fullname; | ||
1000 | if(!gCacheName->getFullName(av, fullname)) | ||
1001 | { | ||
1002 | element["columns"][0]["value"] = LLCacheName::getDefaultName(); | ||
1003 | all_loaded = FALSE; | ||
1004 | } | ||
1005 | else | ||
1006 | { | ||
1007 | element["columns"][0]["value"] = fullname; | ||
1008 | } | ||
1009 | radar_scroller->addElement(element); | ||
1010 | empty = FALSE; | ||
1011 | } | ||
1012 | |||
1013 | if (empty) | ||
1014 | { | ||
1015 | childDisable("RadarList"); | ||
1016 | //radar_scroller->addCommentText(getString("no_one_near")); | ||
1017 | } | ||
1018 | else | ||
1019 | { | ||
1020 | childEnable("RadarList"); | ||
1021 | radar_scroller->selectFirstItem(); | ||
1022 | //onList(radar_scroller, this); | ||
1023 | radar_scroller->setFocus(TRUE); | ||
1024 | } | ||
1025 | |||
1026 | //if (all_loaded) | ||
1027 | //{ | ||
1028 | // mRadarListComplete = TRUE; | ||
1029 | //} | ||
1030 | } | ||
1031 | |||
1032 | // TODO: Since there're no tabs, move this up above | ||
1033 | //void LLNetMap::onList(LLUICtrl* ctrl, void* userdata) | ||
1034 | //{ | ||
1035 | // LLNetMap* self = (LLNetMap*)userdata; | ||
1036 | // if (self) | ||
1037 | // { | ||
1038 | // self->childSetEnabled("im_btn", self->visibleItemsSelected()); | ||
1039 | // self->childSetEnabled("profile_btn", self->visibleItemsSelected()); | ||
1040 | // self->childSetEnabled("offer_teleport_btn", self->visibleItemsSelected()); | ||
1041 | // self->childSetEnabled("track_btn", self->visibleItemsSelected()); | ||
1042 | // self->childSetEnabled("invite_btn", self->visibleItemsSelected()); | ||
1043 | // self->childSetEnabled("add_btn", self->visibleItemsSelected()); | ||
1044 | // } | ||
1045 | //} | ||
1046 | |||
1047 | void LLNetMap::onClickIM(void* user_data) | ||
1048 | { | ||
1049 | LLNetMap* self = (LLNetMap*) user_data; | ||
1050 | |||
1051 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
1052 | LLUUID agent_id = item->getUUID(); | ||
1053 | std::string fullname; | ||
1054 | if(gCacheName->getFullName(agent_id, fullname)) | ||
1055 | { | ||
1056 | gIMMgr->setFloaterOpen(TRUE); | ||
1057 | gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); | ||
1058 | } | ||
1059 | } | ||
1060 | |||
1061 | void LLNetMap::onClickProfile(void* user_data) | ||
1062 | { | ||
1063 | LLNetMap* self = (LLNetMap*) user_data; | ||
1064 | |||
1065 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
1066 | LLUUID agent_id = item->getUUID(); | ||
1067 | LLFloaterAvatarInfo::show(agent_id); | ||
1068 | } | ||
1069 | |||
1070 | void LLNetMap::onClickOfferTeleport(void* user_data) | ||
1071 | { | ||
1072 | } | ||
1073 | |||
1074 | void LLNetMap::onClickTrack(void* user_data) | ||
1075 | { | ||
1076 | LLNetMap* self = (LLNetMap*) user_data; | ||
1077 | |||
1078 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); | ||
1079 | if (LLTracker::TRACKING_AVATAR == tracking_status) | ||
1080 | { | ||
1081 | LLTracker::stopTracking(NULL); | ||
1082 | } | ||
1083 | else | ||
1084 | { | ||
1085 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
1086 | LLUUID agent_id = item->getUUID(); | ||
1087 | std::string fullname; | ||
1088 | gCacheName->getFullName(agent_id, fullname); | ||
1089 | LLTracker::trackAvatar(agent_id, fullname); | ||
1090 | } | ||
1091 | } | ||
1092 | |||
1093 | void LLNetMap::onClickInvite(void* user_data) | ||
1094 | { | ||
1095 | LLNetMap* self = (LLNetMap*) user_data; | ||
1096 | |||
1097 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
1098 | LLUUID agent_id = item->getUUID(); | ||
1099 | { | ||
1100 | LLFloaterGroupPicker* widget; | ||
1101 | widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); | ||
1102 | if (widget) | ||
1103 | { | ||
1104 | widget->center(); | ||
1105 | widget->setPowersMask(GP_MEMBER_INVITE); | ||
1106 | widget->setSelectCallback(callback_invite_to_group, (void *)&agent_id); | ||
1107 | } | ||
1108 | } | ||
1109 | } | ||
1110 | |||
1111 | void LLNetMap::callback_invite_to_group(LLUUID group_id, void *user_data) | ||
1112 | { | ||
1113 | std::vector<LLUUID> agent_ids; | ||
1114 | agent_ids.push_back(*(LLUUID *)user_data); | ||
1115 | |||
1116 | LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); | ||
1117 | } | ||
1118 | |||
1119 | void LLNetMap::onClickAddFriend(void* user_data) | ||
1120 | { | ||
1121 | } | ||
1122 | |||
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index 58b2066..45b5e2d 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | #include "llpanel.h" | 35 | #include "llpanel.h" |
36 | #include "llmemberlistener.h" | 36 | #include "llmemberlistener.h" |
37 | #include "llscrolllistctrl.h" | ||
38 | #include "v3math.h" | 37 | #include "v3math.h" |
39 | #include "v3dmath.h" | 38 | #include "v3dmath.h" |
40 | #include "v4color.h" | 39 | #include "v4color.h" |
@@ -116,7 +115,6 @@ private: | |||
116 | private: | 115 | private: |
117 | LLUUID mClosestAgentToCursor; | 116 | LLUUID mClosestAgentToCursor; |
118 | LLUUID mClosestAgentAtLastRightClick; | 117 | LLUUID mClosestAgentAtLastRightClick; |
119 | LLScrollListCtrl* mRadarList; | ||
120 | 118 | ||
121 | static BOOL sRotateMap; | 119 | static BOOL sRotateMap; |
122 | static LLNetMap* sInstance; | 120 | static LLNetMap* sInstance; |
@@ -126,16 +124,6 @@ private: | |||
126 | static void showAgentProfile(void*); | 124 | static void showAgentProfile(void*); |
127 | BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } | 125 | BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } |
128 | 126 | ||
129 | void populateRadar(); | ||
130 | |||
131 | static void onClickProfile(void* user_data); | ||
132 | static void onClickIM(void* user_data); | ||
133 | static void onClickAddFriend(void* user_data); | ||
134 | static void onClickOfferTeleport(void* user_data); | ||
135 | static void onClickTrack(void* user_data); | ||
136 | static void onClickInvite(void* user_data); | ||
137 | static void callback_invite_to_group(LLUUID group_id, void *user_data); | ||
138 | |||
139 | class LLScaleMap : public LLMemberListener<LLNetMap> | 127 | class LLScaleMap : public LLMemberListener<LLNetMap> |
140 | { | 128 | { |
141 | public: | 129 | public: |
diff --git a/linden/indra/newview/skins/default/colors_base.xml b/linden/indra/newview/skins/default/colors_base.xml index 42cb0ac..38499d3 100644 --- a/linden/indra/newview/skins/default/colors_base.xml +++ b/linden/indra/newview/skins/default/colors_base.xml | |||
@@ -160,6 +160,7 @@ | |||
160 | <MapAvatar value="0, 255, 0, 255" /> <!-- Your avatar's glyph color --> | 160 | <MapAvatar value="0, 255, 0, 255" /> <!-- Your avatar's glyph color --> |
161 | <MapFriend value="255, 255, 0, 255" /> <!-- Your friends' glyph color --> | 161 | <MapFriend value="255, 255, 0, 255" /> <!-- Your friends' glyph color --> |
162 | <MapMuted value="128, 128, 128, 255" /> <!-- Muted avatars' glyph color --> | 162 | <MapMuted value="128, 128, 128, 255" /> <!-- Muted avatars' glyph color --> |
163 | <MapSelected value="255, 0, 0, 255" /> <!-- Selected avatars' glyph color --> | ||
163 | 164 | ||
164 | <!-- MINI-MAP --> | 165 | <!-- MINI-MAP --> |
165 | <NetMapBackgroundColor value="0, 0, 0, 77" /> <!-- Mini-map floater background --> | 166 | <NetMapBackgroundColor value="0, 0, 0, 77" /> <!-- Mini-map floater background --> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml index c10367d..3408c76 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | |||
@@ -10,31 +10,41 @@ | |||
10 | <panel name="RadarPanel" label="Radar" | 10 | <panel name="RadarPanel" label="Radar" |
11 | background_visible="true" bg_alpha_color="NetMapBackgroundColor" | 11 | background_visible="true" bg_alpha_color="NetMapBackgroundColor" |
12 | left="2" top="196" right="196" height="120" | 12 | left="2" top="196" right="196" height="120" |
13 | follows="left|right|bottom" border="true" mouse_opaque="true"> | 13 | follows="left|right|bottom" border="false" mouse_opaque="true"> |
14 | 14 | ||
15 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 15 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
16 | bottom="-20" drop_shadow_visible="true" follows="left|top" | 16 | bottom="-20" drop_shadow_visible="true" follows="left|top" |
17 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="10" | 17 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="10" |
18 | mouse_opaque="true" name="InstructSelectResident" v_pad="0" | 18 | mouse_opaque="true" name="lblAvatarCount" v_pad="0" |
19 | width="220"> | 19 | width="220"> |
20 | Select nearby resident: | 20 | 0 |
21 | </text> | 21 | </text> |
22 | <slider bottom_delta="-20" left="10" follows="left|top" width="175" height="15" | 22 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
23 | name="near_me_range" label="Range" control_name="NearMeRange" | 23 | bottom="-20" drop_shadow_visible="true" follows="left|top" |
24 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="27" | ||
25 | mouse_opaque="true" name="avatars_in" v_pad="0" | ||
26 | width="220"> | ||
27 | Avatars in | ||
28 | </text> | ||
29 | <slider bottom_delta="0" left_delta="55" follows="left|top" width="110" height="15" | ||
30 | name="near_me_range" label="" control_name="NearMeRange" | ||
24 | min_val="5" max_val="256" increment="1" initial_val="96" decimal_digits="0" /> | 31 | min_val="5" max_val="256" increment="1" initial_val="96" decimal_digits="0" /> |
25 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 32 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
26 | bottom_delta="0" left="185" drop_shadow_visible="true" follows="left|top" | 33 | bottom_delta="0" left="190" drop_shadow_visible="true" follows="left|top" |
27 | font="SansSerifSmall" h_pad="0" halign="left" height="15" | 34 | font="SansSerifSmall" h_pad="0" halign="left" height="15" |
28 | mouse_opaque="true" name="meters" v_pad="0" | 35 | mouse_opaque="true" name="meters" v_pad="0" |
29 | width="40"> | 36 | width="40"> |
30 | Meters | 37 | Meters |
31 | </text> | 38 | </text> |
32 | <scroll_list bottom_delta="-100" width="96" height="100" left="10" | 39 | <scroll_list bottom_delta="-166" width="96" height="160" left="10" |
33 | follows="left|top|bottom|right" draw_border="true" draw_heading="false" | 40 | follows="left|top|bottom|right" draw_border="false" draw_heading="true" |
34 | draw_stripes="true" column_padding="5" sort_column="0" mouse_opaque="true" | 41 | draw_stripes="true" column_padding="5" sort_column="1" mouse_opaque="true" |
35 | background_visible="true" multi_select="false" name="RadarList" /> | 42 | background_visible="true" multi_select="false" name="RadarList"> |
36 | <button bottom_delta="100" follows="top|right" height="22" label="IM/Call" | 43 | <column name="avatar_name" label="Name" dynamicwidth="true" /> |
37 | left="-90" name="im_btn" tool_tip="Open Instant Message session" | 44 | <column name="avatar_distance" label="Dist." width="55" /> |
45 | </scroll_list> | ||
46 | <button bottom="-45" follows="top|right" height="22" label="IM/Call" | ||
47 | left="-85" name="im_btn" tool_tip="Open Instant Message session" | ||
38 | width="80" /> | 48 | width="80" /> |
39 | <button bottom_delta="-25" follows="top|right" height="22" label="Profile" | 49 | <button bottom_delta="-25" follows="top|right" height="22" label="Profile" |
40 | left_delta="0" name="profile_btn" | 50 | left_delta="0" name="profile_btn" |
@@ -45,11 +55,14 @@ | |||
45 | <button bottom_delta="-25" follows="top|right" height="22" label="Track" | 55 | <button bottom_delta="-25" follows="top|right" height="22" label="Track" |
46 | left_delta="0" name="track_btn" | 56 | left_delta="0" name="track_btn" |
47 | tool_tip="Create a beacon to track this avatar" width="80" /> | 57 | tool_tip="Create a beacon to track this avatar" width="80" /> |
48 | <button bottom_delta="-35" follows="top|right" height="22" label="Invite..." | 58 | <button bottom_delta="-30" follows="top|right" height="22" label="Invite..." |
49 | left_delta="0" name="invite_btn" | 59 | left_delta="0" name="invite_btn" |
50 | tool_tip="Remove this person from your friends list" width="80" /> | 60 | tool_tip="Remove this person from your friends list" width="80" /> |
51 | <button bottom_delta="-35" follows="top|right" height="22" label="Add..." | 61 | <button bottom_delta="-30" follows="top|right" height="22" label="Add..." |
52 | left_delta="0" name="add_btn" tool_tip="Offer friendship to a resident" | 62 | left_delta="0" name="add_btn" tool_tip="Offer friendship to a resident" |
53 | width="80" /> | 63 | width="80" /> |
64 | <string name="no_one_near"> | ||
65 | No avatars within range | ||
66 | </string> | ||
54 | </panel> | 67 | </panel> |
55 | </floater> | 68 | </floater> |