diff options
author | McCabe Maxsted | 2009-09-16 23:22:41 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-16 23:22:41 -0700 |
commit | 34a125d95b422e9faf33ccecdae98ecd331cb068 (patch) | |
tree | 609263451354d1dc27dae27de80ea311b0fcdccb | |
parent | Moved Rotate Mini-Map option to mini-map menu, added first use dialog (diff) | |
download | meta-impy-34a125d95b422e9faf33ccecdae98ecd331cb068.zip meta-impy-34a125d95b422e9faf33ccecdae98ecd331cb068.tar.gz meta-impy-34a125d95b422e9faf33ccecdae98ecd331cb068.tar.bz2 meta-impy-34a125d95b422e9faf33ccecdae98ecd331cb068.tar.xz |
Estate and track buttons now disable when they should, tweaked spacing
-rw-r--r-- | ChangeLog.txt | 9 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 121 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.h | 3 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | 8 |
4 files changed, 94 insertions, 47 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index ce8c579..8c1722a 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,12 @@ | |||
1 | 2009-09-16 McCabe Maxsted <hakushakukun@gmail.com> | ||
2 | |||
3 | * Estate and track buttons now disable when they should, tweaked spacing. | ||
4 | |||
5 | modified: linden/indra/newview/llfloatermap.cpp | ||
6 | modified: linden/indra/newview/llfloatermap.h | ||
7 | modified: linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | ||
8 | |||
9 | |||
1 | 2009-09-15 McCabe Maxsted <hakushakukun@gmail.com> | 10 | 2009-09-15 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 11 | ||
3 | * Applied patch by Robin Cornelius for VWR-11128 - Python not always detected by develop.py. | 12 | * Applied patch by Robin Cornelius for VWR-11128 - Python not always detected by develop.py. |
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index a1ab97e..3be891e 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp | |||
@@ -51,13 +51,18 @@ | |||
51 | #include "llfloaterreporter.h" | 51 | #include "llfloaterreporter.h" |
52 | #include "llimview.h" | 52 | #include "llimview.h" |
53 | #include "llmutelist.h" | 53 | #include "llmutelist.h" |
54 | #include "llparcel.h" | ||
55 | #include "llregionposition.h" | ||
54 | #include "roles_constants.h" | 56 | #include "roles_constants.h" |
55 | #include "llscrolllistctrl.h" | 57 | #include "llscrolllistctrl.h" |
56 | #include "lltracker.h" | 58 | #include "lltracker.h" |
57 | #include "llviewerobjectlist.h" | 59 | #include "llviewerobjectlist.h" |
60 | #include "llviewermenu.h" | ||
58 | #include "llviewermessage.h" | 61 | #include "llviewermessage.h" |
62 | #include "llviewerparcelmgr.h" | ||
59 | #include "llviewerregion.h" | 63 | #include "llviewerregion.h" |
60 | #include "llviewerwindow.h" | 64 | #include "llviewerwindow.h" |
65 | #include "llvoavatar.h" | ||
61 | #include "llworld.h" | 66 | #include "llworld.h" |
62 | 67 | ||
63 | LLFloaterMap::LLFloaterMap(const LLSD& key) | 68 | LLFloaterMap::LLFloaterMap(const LLSD& key) |
@@ -233,7 +238,7 @@ void LLFloaterMap::populateRadar() | |||
233 | 238 | ||
234 | // Add to list only if we get their name | 239 | // Add to list only if we get their name |
235 | std::string fullname = getSelectedName(avatar_ids[i]); | 240 | std::string fullname = getSelectedName(avatar_ids[i]); |
236 | if (!fullname.empty() && fullname != " ") | 241 | if (!fullname.empty()) |
237 | { | 242 | { |
238 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; | 243 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; |
239 | element["id"] = avatar_ids[i]; | 244 | element["id"] = avatar_ids[i]; |
@@ -281,30 +286,69 @@ void LLFloaterMap::populateRadar() | |||
281 | 286 | ||
282 | void LLFloaterMap::toggleButtons() | 287 | void LLFloaterMap::toggleButtons() |
283 | { | 288 | { |
284 | BOOL enabled = FALSE; | 289 | BOOL enable = FALSE; |
285 | BOOL unmute_enabled = FALSE; | 290 | BOOL enable_unmute = FALSE; |
291 | BOOL enable_track = FALSE; | ||
292 | BOOL enable_estate = FALSE; | ||
286 | if (childHasFocus("RadarPanel")) | 293 | if (childHasFocus("RadarPanel")) |
287 | { | 294 | { |
288 | enabled = mSelectedAvatar.notNull() ? visibleItemsSelected() : FALSE; | 295 | enable = mSelectedAvatar.notNull() ? visibleItemsSelected() : FALSE; |
289 | unmute_enabled = mSelectedAvatar.notNull() ? LLMuteList::getInstance()->isMuted(mSelectedAvatar) : FALSE; | 296 | enable_unmute = mSelectedAvatar.notNull() ? LLMuteList::getInstance()->isMuted(mSelectedAvatar) : FALSE; |
297 | enable_track = gAgent.isGodlike() || is_agent_mappable(mSelectedAvatar); | ||
298 | enable_estate = getKickable(mSelectedAvatar); | ||
290 | } | 299 | } |
291 | else | 300 | else |
292 | { | 301 | { |
293 | mRadarList->deselect(); | 302 | mRadarList->deselect(); |
294 | } | 303 | } |
295 | 304 | ||
296 | childSetEnabled("im_btn", enabled); | 305 | childSetEnabled("im_btn", enable); |
297 | childSetEnabled("profile_btn", enabled); | 306 | childSetEnabled("profile_btn", enable); |
298 | childSetEnabled("offer_teleport_btn", enabled); | 307 | childSetEnabled("offer_teleport_btn", enable); |
299 | childSetEnabled("track_btn", enabled); | 308 | childSetEnabled("track_btn", enable_track); |
300 | childSetEnabled("invite_btn", enabled); | 309 | childSetEnabled("invite_btn", enable); |
301 | childSetEnabled("add_btn", enabled); | 310 | childSetEnabled("add_btn", enable); |
302 | childSetEnabled("freeze_btn", enabled); | 311 | childSetEnabled("freeze_btn", enable_estate); |
303 | childSetEnabled("eject_btn", enabled); | 312 | childSetEnabled("eject_btn", enable_estate); |
304 | childSetEnabled("mute_btn", enabled); | 313 | childSetEnabled("mute_btn", enable); |
305 | childSetEnabled("unmute_btn", unmute_enabled); | 314 | childSetEnabled("unmute_btn", enable_unmute); |
306 | childSetEnabled("ar_btn", enabled); | 315 | childSetEnabled("ar_btn", enable); |
307 | childSetEnabled("estate_eject_btn", enabled); | 316 | childSetEnabled("estate_eject_btn", enable_estate); |
317 | } | ||
318 | |||
319 | BOOL LLFloaterMap::getKickable(const LLUUID &agent_id) | ||
320 | { | ||
321 | if (agent_id.notNull()) | ||
322 | { | ||
323 | LLViewerObject* av_obj = gObjectList.findObject(agent_id); | ||
324 | if (av_obj != NULL && av_obj->isAvatar()) | ||
325 | { | ||
326 | LLVOAvatar* avatar = (LLVOAvatar*)av_obj; | ||
327 | LLViewerRegion* region = avatar->getRegion(); | ||
328 | if (region) | ||
329 | { | ||
330 | const LLVector3& pos = avatar->getPositionRegion(); | ||
331 | const LLVector3d& pos_global = avatar->getPositionGlobal(); | ||
332 | if (LLWorld::getInstance()->positionRegionValidGlobal(pos_global)) | ||
333 | { | ||
334 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel(); | ||
335 | |||
336 | BOOL new_value = (region != NULL); | ||
337 | |||
338 | if (new_value) | ||
339 | { | ||
340 | new_value = region->isOwnedSelf(pos); | ||
341 | if (!new_value || region->isOwnedGroup(pos)) | ||
342 | { | ||
343 | new_value = LLViewerParcelMgr::getInstance()->isParcelOwnedByAgent(parcel,GP_LAND_ADMIN); | ||
344 | } | ||
345 | } | ||
346 | return new_value; | ||
347 | } | ||
348 | } | ||
349 | } | ||
350 | } | ||
351 | return FALSE; | ||
308 | } | 352 | } |
309 | 353 | ||
310 | // static | 354 | // static |
@@ -354,12 +398,8 @@ void LLFloaterMap::onClickIM(void* user_data) | |||
354 | if (item != NULL) | 398 | if (item != NULL) |
355 | { | 399 | { |
356 | LLUUID agent_id = item->getUUID(); | 400 | LLUUID agent_id = item->getUUID(); |
357 | std::string fullname; | 401 | gIMMgr->setFloaterOpen(TRUE); |
358 | if(gCacheName->getFullName(agent_id, fullname)) | 402 | gIMMgr->addSession(getSelectedName(agent_id), IM_NOTHING_SPECIAL, agent_id); |
359 | { | ||
360 | gIMMgr->setFloaterOpen(TRUE); | ||
361 | gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id); | ||
362 | } | ||
363 | } | 403 | } |
364 | } | 404 | } |
365 | 405 | ||
@@ -392,6 +432,7 @@ void LLFloaterMap::onClickTrack(void* user_data) | |||
392 | { | 432 | { |
393 | LLFloaterMap* self = (LLFloaterMap*) user_data; | 433 | LLFloaterMap* self = (LLFloaterMap*) user_data; |
394 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); | 434 | LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); |
435 | |||
395 | if (LLTracker::TRACKING_AVATAR == tracking_status) | 436 | if (LLTracker::TRACKING_AVATAR == tracking_status) |
396 | { | 437 | { |
397 | LLTracker::stopTracking(NULL); | 438 | LLTracker::stopTracking(NULL); |
@@ -402,9 +443,7 @@ void LLFloaterMap::onClickTrack(void* user_data) | |||
402 | if (item != NULL) | 443 | if (item != NULL) |
403 | { | 444 | { |
404 | LLUUID agent_id = item->getUUID(); | 445 | LLUUID agent_id = item->getUUID(); |
405 | std::string fullname; | 446 | LLTracker::trackAvatar(agent_id, getSelectedName(agent_id)); |
406 | gCacheName->getFullName(agent_id, fullname); | ||
407 | LLTracker::trackAvatar(agent_id, fullname); | ||
408 | } | 447 | } |
409 | } | 448 | } |
410 | } | 449 | } |
@@ -445,9 +484,7 @@ void LLFloaterMap::onClickAddFriend(void* user_data) | |||
445 | if (item != NULL) | 484 | if (item != NULL) |
446 | { | 485 | { |
447 | LLUUID agent_id = item->getUUID(); | 486 | LLUUID agent_id = item->getUUID(); |
448 | std::string fullname; | 487 | LLPanelFriends::requestFriendshipDialog(agent_id, getSelectedName(agent_id)); |
449 | gCacheName->getFullName(agent_id, fullname); | ||
450 | LLPanelFriends::requestFriendshipDialog(agent_id, fullname); | ||
451 | } | 488 | } |
452 | } | 489 | } |
453 | 490 | ||
@@ -456,10 +493,10 @@ void LLFloaterMap::onClickAddFriend(void* user_data) | |||
456 | // | 493 | // |
457 | 494 | ||
458 | //static | 495 | //static |
459 | std::string LLFloaterMap::getSelectedName(LLUUID agent_id) | 496 | std::string LLFloaterMap::getSelectedName(const LLUUID &agent_id) |
460 | { | 497 | { |
461 | std::string agent_name; | 498 | std::string agent_name; |
462 | if(agent_id.notNull() && gCacheName->getFullName(agent_id, agent_name)) | 499 | if(gCacheName->getFullName(agent_id, agent_name) && agent_name != " ") |
463 | { | 500 | { |
464 | return agent_name; | 501 | return agent_name; |
465 | } | 502 | } |
@@ -516,7 +553,7 @@ void LLFloaterMap::onClickFreeze(void *user_data) | |||
516 | LLFloaterMap *self = (LLFloaterMap*)user_data; | 553 | LLFloaterMap *self = (LLFloaterMap*)user_data; |
517 | LLStringUtil::format_map_t args; | 554 | LLStringUtil::format_map_t args; |
518 | LLSD payload; | 555 | LLSD payload; |
519 | args["[AVATAR_NAME]"] = self->getSelectedName(self->mSelectedAvatar); | 556 | args["[AVATAR_NAME]"] = getSelectedName(self->mSelectedAvatar); |
520 | gViewerWindow->alertXml("FreezeAvatarFullname", args, callbackFreeze, user_data); | 557 | gViewerWindow->alertXml("FreezeAvatarFullname", args, callbackFreeze, user_data); |
521 | } | 558 | } |
522 | 559 | ||
@@ -526,7 +563,7 @@ void LLFloaterMap::onClickEject(void *user_data) | |||
526 | LLFloaterMap *self = (LLFloaterMap*)user_data; | 563 | LLFloaterMap *self = (LLFloaterMap*)user_data; |
527 | LLStringUtil::format_map_t args; | 564 | LLStringUtil::format_map_t args; |
528 | LLSD payload; | 565 | LLSD payload; |
529 | args["AVATAR_NAME"] = self->getSelectedName(self->mSelectedAvatar); | 566 | args["AVATAR_NAME"] = getSelectedName(self->mSelectedAvatar); |
530 | gViewerWindow->alertXml("EjectAvatarFullName", args, callbackEject, user_data); | 567 | gViewerWindow->alertXml("EjectAvatarFullName", args, callbackEject, user_data); |
531 | } | 568 | } |
532 | 569 | ||
@@ -534,11 +571,11 @@ void LLFloaterMap::onClickEject(void *user_data) | |||
534 | void LLFloaterMap::onClickMute(void *user_data) | 571 | void LLFloaterMap::onClickMute(void *user_data) |
535 | { | 572 | { |
536 | LLFloaterMap *self = (LLFloaterMap*)user_data; | 573 | LLFloaterMap *self = (LLFloaterMap*)user_data; |
537 | 574 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | |
538 | LLUUID agent_id = self->mSelectedAvatar; | 575 | if (item != NULL) |
539 | std::string agent_name = self->getSelectedName(agent_id); | ||
540 | if(!agent_name.empty()) | ||
541 | { | 576 | { |
577 | LLUUID agent_id = item->getUUID(); | ||
578 | std::string agent_name = getSelectedName(agent_id); | ||
542 | if (LLMuteList::getInstance()->isMuted(agent_id)) | 579 | if (LLMuteList::getInstance()->isMuted(agent_id)) |
543 | { | 580 | { |
544 | //LLMute mute(agent_id, agent_name, LLMute::AGENT); | 581 | //LLMute mute(agent_id, agent_name, LLMute::AGENT); |
@@ -557,11 +594,11 @@ void LLFloaterMap::onClickMute(void *user_data) | |||
557 | void LLFloaterMap::onClickUnmute(void *user_data) | 594 | void LLFloaterMap::onClickUnmute(void *user_data) |
558 | { | 595 | { |
559 | LLFloaterMap *self = (LLFloaterMap*)user_data; | 596 | LLFloaterMap *self = (LLFloaterMap*)user_data; |
560 | 597 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | |
561 | LLUUID agent_id = self->mSelectedAvatar; | 598 | if (item != NULL) |
562 | std::string agent_name = self->getSelectedName(agent_id); | ||
563 | if(!agent_name.empty()) | ||
564 | { | 599 | { |
600 | LLUUID agent_id = item->getUUID(); | ||
601 | std::string agent_name = getSelectedName(agent_id); | ||
565 | if (LLMuteList::getInstance()->isMuted(agent_id)) | 602 | if (LLMuteList::getInstance()->isMuted(agent_id)) |
566 | { | 603 | { |
567 | LLMute mute(agent_id, agent_name, LLMute::AGENT); | 604 | LLMute mute(agent_id, agent_name, LLMute::AGENT); |
@@ -582,7 +619,7 @@ void LLFloaterMap::onClickEjectFromEstate(void *user_data) | |||
582 | LLFloaterMap *self = (LLFloaterMap*)user_data; | 619 | LLFloaterMap *self = (LLFloaterMap*)user_data; |
583 | LLStringUtil::format_map_t args; | 620 | LLStringUtil::format_map_t args; |
584 | LLSD payload; | 621 | LLSD payload; |
585 | args["EVIL_USER"] = self->getSelectedName(self->mSelectedAvatar); | 622 | args["EVIL_USER"] = getSelectedName(self->mSelectedAvatar); |
586 | gViewerWindow->alertXml("EstateKickUser", args, callbackEjectFromEstate, user_data); | 623 | gViewerWindow->alertXml("EstateKickUser", args, callbackEjectFromEstate, user_data); |
587 | } | 624 | } |
588 | 625 | ||
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h index fae6184..81e4159 100644 --- a/linden/indra/newview/llfloatermap.h +++ b/linden/indra/newview/llfloatermap.h | |||
@@ -72,6 +72,7 @@ private: | |||
72 | static void onList(LLUICtrl* ctrl, void* user_data); | 72 | static void onList(LLUICtrl* ctrl, void* user_data); |
73 | static void onRangeChange(LLFocusableElement* focus, void* user_data); | 73 | static void onRangeChange(LLFocusableElement* focus, void* user_data); |
74 | BOOL visibleItemsSelected() const; | 74 | BOOL visibleItemsSelected() const; |
75 | BOOL getKickable(const LLUUID &agent_id); | ||
75 | void toggleButtons(); | 76 | void toggleButtons(); |
76 | void populateRadar(); | 77 | void populateRadar(); |
77 | 78 | ||
@@ -83,7 +84,7 @@ private: | |||
83 | static void onClickInvite(void* user_data); | 84 | static void onClickInvite(void* user_data); |
84 | static void callback_invite_to_group(LLUUID group_id, void *user_data); | 85 | static void callback_invite_to_group(LLUUID group_id, void *user_data); |
85 | 86 | ||
86 | static std::string getSelectedName(LLUUID agent_id); | 87 | static std::string getSelectedName(const LLUUID &agent_id); |
87 | static void onClickFreeze(void *user_data); | 88 | static void onClickFreeze(void *user_data); |
88 | static void onClickEject(void *user_data); | 89 | static void onClickEject(void *user_data); |
89 | static void onClickMute(void *user_data); | 90 | static void onClickMute(void *user_data); |
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 041672e..3485812 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 | |||
@@ -36,7 +36,7 @@ | |||
36 | width="40"> | 36 | width="40"> |
37 | Meters | 37 | Meters |
38 | </text> | 38 | </text> |
39 | <tab_container border="false" bottom_delta="-179" height="174" left="0" mouse_opaque="false" | 39 | <tab_container border="false" bottom_delta="-176" height="172" left="0" mouse_opaque="false" |
40 | name="button_container" tab_position="top" follows="left|right|bottom" width="198"> | 40 | name="button_container" tab_position="top" follows="left|right|bottom" width="198"> |
41 | <panel border="true" bottom="-180" follows="left|top|right|bottom" height="160" | 41 | <panel border="true" bottom="-180" follows="left|top|right|bottom" height="160" |
42 | label="Avatars" left="1" mouse_opaque="true" name="avatar_tab" width="198"> | 42 | label="Avatars" left="1" mouse_opaque="true" name="avatar_tab" width="198"> |
@@ -76,17 +76,17 @@ | |||
76 | <button bottom_delta="-25" follows="top|right" height="22" label="Report..." | 76 | <button bottom_delta="-25" follows="top|right" height="22" label="Report..." |
77 | left_delta="0" name="ar_btn" | 77 | left_delta="0" name="ar_btn" |
78 | tool_tip="" width="80" /> | 78 | tool_tip="" width="80" /> |
79 | <button bottom_delta="-25" follows="top|right" height="22" label="Estate..." | 79 | <button bottom_delta="-25" follows="top|right" height="22" label="Kick..." |
80 | left_delta="0" name="estate_eject_btn" tool_tip="" | 80 | left_delta="0" name="estate_eject_btn" tool_tip="" |
81 | width="80" /> | 81 | width="80" /> |
82 | </panel> | 82 | </panel> |
83 | </tab_container> | 83 | </tab_container> |
84 | <scroll_list bottom="-187" width="96" height="140" left="10" | 84 | <scroll_list bottom="-190" width="104" height="143" left="4" |
85 | follows="left|bottom|right" draw_border="false" draw_heading="true" | 85 | follows="left|bottom|right" draw_border="false" draw_heading="true" |
86 | draw_stripes="true" column_padding="5" sort_column="1" mouse_opaque="true" | 86 | draw_stripes="true" column_padding="5" sort_column="1" mouse_opaque="true" |
87 | background_visible="true" multi_select="false" name="RadarList"> | 87 | background_visible="true" multi_select="false" name="RadarList"> |
88 | <column name="avatar_name" label="Name" dynamicwidth="true" /> | 88 | <column name="avatar_name" label="Name" dynamicwidth="true" /> |
89 | <column name="avatar_distance" label="Dist." width="55" /> | 89 | <column name="avatar_distance" label="Dist." width="48" /> |
90 | </scroll_list> | 90 | </scroll_list> |
91 | </panel> | 91 | </panel> |
92 | <string name="no_one_near"> | 92 | <string name="no_one_near"> |