diff options
author | McCabe Maxsted | 2010-06-08 17:51:42 -0700 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:43:33 -0500 |
commit | d3596142a75dbba27eb844c42f6ef769fa6bfc82 (patch) | |
tree | ec3dc51d084cc4f9a6a6bf217e61a89d197f8f74 | |
parent | Fixed group notice history showing wrong icons for attached inventory (diff) | |
download | meta-impy-d3596142a75dbba27eb844c42f6ef769fa6bfc82.zip meta-impy-d3596142a75dbba27eb844c42f6ef769fa6bfc82.tar.gz meta-impy-d3596142a75dbba27eb844c42f6ef769fa6bfc82.tar.bz2 meta-impy-d3596142a75dbba27eb844c42f6ef769fa6bfc82.tar.xz |
Little tidying up, made the default double click action cam to for the estate tab
-rw-r--r-- | linden/indra/newview/panelradar.cpp | 37 | ||||
-rw-r--r-- | linden/indra/newview/panelradar.h | 6 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_radar.xml | 2 |
3 files changed, 37 insertions, 8 deletions
diff --git a/linden/indra/newview/panelradar.cpp b/linden/indra/newview/panelradar.cpp index c4eec1f..85048fe 100644 --- a/linden/indra/newview/panelradar.cpp +++ b/linden/indra/newview/panelradar.cpp | |||
@@ -61,7 +61,8 @@ | |||
61 | PanelRadar::PanelRadar() | 61 | PanelRadar::PanelRadar() |
62 | : | 62 | : |
63 | LLPanel(), | 63 | LLPanel(), |
64 | mSelectedAvatar(LLUUID::null) | 64 | mSelectedAvatar(LLUUID::null), |
65 | mSelectedDistance(-1.0f) | ||
65 | { | 66 | { |
66 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_radar.xml"); | 67 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_radar.xml"); |
67 | } | 68 | } |
@@ -69,6 +70,8 @@ PanelRadar::PanelRadar() | |||
69 | 70 | ||
70 | BOOL PanelRadar::postBuild() | 71 | BOOL PanelRadar::postBuild() |
71 | { | 72 | { |
73 | mRadarTabs = getChild<LLTabContainer>("radar_tab_container"); | ||
74 | |||
72 | mRadarList = getChild<LLScrollListCtrl>("RadarList"); | 75 | mRadarList = getChild<LLScrollListCtrl>("RadarList"); |
73 | childSetCommitCallback("RadarList", onUseRadarList, this); | 76 | childSetCommitCallback("RadarList", onUseRadarList, this); |
74 | mRadarList->setDoubleClickCallback(onClickIM); | 77 | mRadarList->setDoubleClickCallback(onClickIM); |
@@ -186,10 +189,13 @@ void PanelRadar::updateRadarDisplay() | |||
186 | if (visibleItemsSelected()) | 189 | if (visibleItemsSelected()) |
187 | { | 190 | { |
188 | mSelectedAvatar = mRadarList->getFirstSelected()->getUUID(); | 191 | mSelectedAvatar = mRadarList->getFirstSelected()->getUUID(); |
192 | //TODO: as we expand columns, make these numbers enums | ||
193 | mSelectedDistance = mRadarList->getFirstSelected()->getColumn(1)->getValue().asReal(); | ||
189 | } | 194 | } |
190 | else | 195 | else |
191 | { | 196 | { |
192 | mSelectedAvatar.setNull(); | 197 | mSelectedAvatar.setNull(); |
198 | mSelectedDistance = -1.0f; | ||
193 | } | 199 | } |
194 | 200 | ||
195 | S32 scroll_pos = mRadarList->getScrollPos(); | 201 | S32 scroll_pos = mRadarList->getScrollPos(); |
@@ -388,18 +394,35 @@ void PanelRadar::updateButtonStates() | |||
388 | static bool enable_track = false; | 394 | static bool enable_track = false; |
389 | static bool enable_estate = false; | 395 | static bool enable_estate = false; |
390 | static bool enable_friend = false; | 396 | static bool enable_friend = false; |
397 | static bool enable_cam = false; | ||
391 | 398 | ||
392 | if (hasFocus()) | 399 | if (mRadarTabs->getCurrentPanelIndex() == 0) // Avatar tab |
393 | { | 400 | { |
394 | enable = mSelectedAvatar.notNull() ? visibleItemsSelected() : false; | 401 | mRadarList->setDoubleClickCallback(onClickIM); |
395 | enable_unmute = mSelectedAvatar.notNull() ? LLMuteList::getInstance()->isMuted(mSelectedAvatar) : false; | 402 | } |
396 | enable_track = gAgent.isGodlike() || is_agent_mappable(mSelectedAvatar); | 403 | else // Estate tab |
404 | { | ||
405 | mRadarList->setDoubleClickCallback(onClickCam); | ||
406 | } | ||
407 | |||
408 | if (hasFocus() && mSelectedAvatar.notNull()) | ||
409 | { | ||
410 | enable = visibleItemsSelected(); | ||
397 | enable_estate = isKickable(mSelectedAvatar); | 411 | enable_estate = isKickable(mSelectedAvatar); |
412 | enable_unmute = LLMuteList::getInstance()->isMuted(mSelectedAvatar); | ||
413 | enable_track = gAgent.isGodlike() || is_agent_mappable(mSelectedAvatar); | ||
398 | enable_friend = !is_agent_friend(mSelectedAvatar); | 414 | enable_friend = !is_agent_friend(mSelectedAvatar); |
415 | enable_cam = mSelectedDistance >= 0 && mSelectedDistance <= gSavedSettings.getF32("NearMeRange"); | ||
399 | } | 416 | } |
400 | else | 417 | else |
401 | { | 418 | { |
402 | mRadarList->deselect(); | 419 | mRadarList->deselect(); |
420 | enable = false; | ||
421 | enable_estate = false; | ||
422 | enable_unmute = false; | ||
423 | enable_track = false; | ||
424 | enable_friend = false; | ||
425 | enable_cam = false; | ||
403 | } | 426 | } |
404 | 427 | ||
405 | childSetEnabled("im_btn", enable); | 428 | childSetEnabled("im_btn", enable); |
@@ -409,7 +432,7 @@ void PanelRadar::updateButtonStates() | |||
409 | childSetEnabled("track_btn", enable_track); | 432 | childSetEnabled("track_btn", enable_track); |
410 | childSetEnabled("invite_btn", enable); | 433 | childSetEnabled("invite_btn", enable); |
411 | childSetEnabled("add_btn", enable); | 434 | childSetEnabled("add_btn", enable); |
412 | childSetEnabled("cam_btn", enable); | 435 | childSetEnabled("cam_btn", enable_cam); |
413 | childSetEnabled("freeze_btn", enable_estate); | 436 | childSetEnabled("freeze_btn", enable_estate); |
414 | childSetEnabled("eject_btn", enable_estate); | 437 | childSetEnabled("eject_btn", enable_estate); |
415 | childSetEnabled("mute_btn", enable); | 438 | childSetEnabled("mute_btn", enable); |
@@ -442,6 +465,8 @@ void PanelRadar::updateButtonStates() | |||
442 | childSetEnabled("add_btn", false); | 465 | childSetEnabled("add_btn", false); |
443 | childSetEnabled("mute_btn", false); | 466 | childSetEnabled("mute_btn", false); |
444 | childSetEnabled("unmute_btn", false); | 467 | childSetEnabled("unmute_btn", false); |
468 | childSetEnabled("cam_btn", false); | ||
469 | childSetEnabled("teleport_btn", false); | ||
445 | } | 470 | } |
446 | 471 | ||
447 | // Even though the avie is in the same sim (so they already know | 472 | // Even though the avie is in the same sim (so they already know |
diff --git a/linden/indra/newview/panelradar.h b/linden/indra/newview/panelradar.h index af0ca2a..c86a0ce 100644 --- a/linden/indra/newview/panelradar.h +++ b/linden/indra/newview/panelradar.h | |||
@@ -31,9 +31,10 @@ | |||
31 | 31 | ||
32 | 32 | ||
33 | #include "llpanel.h" | 33 | #include "llpanel.h" |
34 | #include "llscrolllistctrl.h" | ||
35 | 34 | ||
36 | class PanelRadarEntry; | 35 | class PanelRadarEntry; |
36 | class LLScrollListCtrl; | ||
37 | class LLTabContainer; | ||
37 | 38 | ||
38 | class PanelRadar : public LLPanel | 39 | class PanelRadar : public LLPanel |
39 | { | 40 | { |
@@ -72,13 +73,16 @@ private: | |||
72 | // Removes avatar IDs no longer known to the viewer | 73 | // Removes avatar IDs no longer known to the viewer |
73 | void removeDeadEntries(const std::vector<LLUUID>& agent_ids); | 74 | void removeDeadEntries(const std::vector<LLUUID>& agent_ids); |
74 | 75 | ||
76 | LLTabContainer* mRadarTabs; | ||
75 | LLScrollListCtrl* mRadarList; | 77 | LLScrollListCtrl* mRadarList; |
76 | LLUUID mSelectedAvatar; | 78 | LLUUID mSelectedAvatar; |
79 | F32 mSelectedDistance; | ||
77 | 80 | ||
78 | bool visibleItemsSelected() const; | 81 | bool visibleItemsSelected() const; |
79 | bool isKickable(const LLUUID &agent_id); | 82 | bool isKickable(const LLUUID &agent_id); |
80 | 83 | ||
81 | std::string getSelectedName(const LLUUID &agent_id); | 84 | std::string getSelectedName(const LLUUID &agent_id); |
85 | F32 getSelectedDistance() { return mSelectedDistance; } | ||
82 | 86 | ||
83 | void sendAvatarPropertiesRequest(const LLUUID &agent_id); | 87 | void sendAvatarPropertiesRequest(const LLUUID &agent_id); |
84 | 88 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml b/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml index 969ddd8..1113743 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml | |||
@@ -54,7 +54,7 @@ | |||
54 | m | 54 | m |
55 | </text> | 55 | </text> |
56 | 56 | ||
57 | <tab_container name="buttons_container" | 57 | <tab_container name="radar_tab_container" |
58 | bottom="1" left="0" right="0" height="172" | 58 | bottom="1" left="0" right="0" height="172" |
59 | follows="left|right|bottom" border="false" | 59 | follows="left|right|bottom" border="false" |
60 | mouse_opaque="false" tab_position="top"> | 60 | mouse_opaque="false" tab_position="top"> |