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 /linden/indra/newview/panelradar.cpp | |
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
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/panelradar.cpp | 37 |
1 files changed, 31 insertions, 6 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 |