diff options
author | Armin Weatherwax | 2010-05-06 12:23:11 +0200 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:05:26 -0500 |
commit | 6a1ec2691a33f88428081ff9165af96b2549c81e (patch) | |
tree | 2848e45dbf7cbd9116c7baa524d0bbfdeccd61a6 /linden | |
parent | add "Advanced > Crash" menu. (diff) | |
download | meta-impy-6a1ec2691a33f88428081ff9165af96b2549c81e.zip meta-impy-6a1ec2691a33f88428081ff9165af96b2549c81e.tar.gz meta-impy-6a1ec2691a33f88428081ff9165af96b2549c81e.tar.bz2 meta-impy-6a1ec2691a33f88428081ff9165af96b2549c81e.tar.xz |
add TP-to button to radar. Todo: consider to only allow for friends.
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/panelradar.cpp | 27 | ||||
-rw-r--r-- | linden/indra/newview/panelradar.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_radar.xml | 17 |
3 files changed, 39 insertions, 6 deletions
diff --git a/linden/indra/newview/panelradar.cpp b/linden/indra/newview/panelradar.cpp index 1a5f2d4..a7062b4 100644 --- a/linden/indra/newview/panelradar.cpp +++ b/linden/indra/newview/panelradar.cpp | |||
@@ -77,6 +77,7 @@ BOOL PanelRadar::postBuild() | |||
77 | childSetAction("im_btn", onClickIM, this); | 77 | childSetAction("im_btn", onClickIM, this); |
78 | childSetAction("profile_btn", onClickProfile, this); | 78 | childSetAction("profile_btn", onClickProfile, this); |
79 | childSetAction("offer_teleport_btn", onClickOfferTeleport, this); | 79 | childSetAction("offer_teleport_btn", onClickOfferTeleport, this); |
80 | childSetAction("teleport_btn", onClickTeleport, this); | ||
80 | childSetAction("track_btn", onClickTrack, this); | 81 | childSetAction("track_btn", onClickTrack, this); |
81 | childSetAction("invite_btn", onClickInvite, this); | 82 | childSetAction("invite_btn", onClickInvite, this); |
82 | childSetAction("add_btn", onClickAddFriend, this); | 83 | childSetAction("add_btn", onClickAddFriend, this); |
@@ -417,6 +418,7 @@ void PanelRadar::updateButtonStates() | |||
417 | childSetEnabled("im_btn", enable); | 418 | childSetEnabled("im_btn", enable); |
418 | childSetEnabled("profile_btn", enable); | 419 | childSetEnabled("profile_btn", enable); |
419 | childSetEnabled("offer_teleport_btn", enable); | 420 | childSetEnabled("offer_teleport_btn", enable); |
421 | childSetEnabled("teleport_btn", enable); | ||
420 | childSetEnabled("track_btn", enable_track); | 422 | childSetEnabled("track_btn", enable_track); |
421 | childSetEnabled("invite_btn", enable); | 423 | childSetEnabled("invite_btn", enable); |
422 | childSetEnabled("add_btn", enable); | 424 | childSetEnabled("add_btn", enable); |
@@ -585,6 +587,31 @@ void PanelRadar::onClickOfferTeleport(void* user_data) | |||
585 | } | 587 | } |
586 | } | 588 | } |
587 | 589 | ||
590 | //static | ||
591 | void PanelRadar::onClickTeleport(void* userdata) | ||
592 | { | ||
593 | PanelRadar *self = (PanelRadar*)userdata; | ||
594 | LLScrollListItem *item = self->mRadarList->getFirstSelected(); | ||
595 | |||
596 | if ( item ) | ||
597 | { | ||
598 | LLUUID agent_id = item->getUUID(); | ||
599 | std::string agent_name = getSelectedName(agent_id); | ||
600 | if ( !agent_name.empty() ) | ||
601 | { | ||
602 | LLViewerObject *av_obj = gObjectList.findObject(agent_id); | ||
603 | if (av_obj != NULL && av_obj->isAvatar()) | ||
604 | { | ||
605 | LLVOAvatar* avatarp = (LLVOAvatar*)av_obj; | ||
606 | if (avatarp != NULL) | ||
607 | { | ||
608 | LLVector3d pos = avatarp->getPositionGlobal(); | ||
609 | gAgent.teleportViaLocation(pos); | ||
610 | } | ||
611 | } | ||
612 | } | ||
613 | } | ||
614 | } | ||
588 | 615 | ||
589 | // static | 616 | // static |
590 | void PanelRadar::onClickTrack(void* user_data) | 617 | void PanelRadar::onClickTrack(void* user_data) |
diff --git a/linden/indra/newview/panelradar.h b/linden/indra/newview/panelradar.h index 8697bbc..de7760f 100644 --- a/linden/indra/newview/panelradar.h +++ b/linden/indra/newview/panelradar.h | |||
@@ -88,6 +88,7 @@ private: | |||
88 | static void onClickIM(void* user_data); | 88 | static void onClickIM(void* user_data); |
89 | static void onClickAddFriend(void* user_data); | 89 | static void onClickAddFriend(void* user_data); |
90 | static void onClickOfferTeleport(void* user_data); | 90 | static void onClickOfferTeleport(void* user_data); |
91 | static void onClickTeleport(void *userdata); | ||
91 | static void onClickTrack(void* user_data); | 92 | static void onClickTrack(void* user_data); |
92 | static void onClickInvite(void* user_data); | 93 | static void onClickInvite(void* user_data); |
93 | static void callback_invite_to_group(LLUUID group_id, void *user_data); | 94 | static void callback_invite_to_group(LLUUID group_id, void *user_data); |
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 2d50bc0..1931354 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 | |||
@@ -65,32 +65,37 @@ | |||
65 | border="true" mouse_opaque="true"> | 65 | border="true" mouse_opaque="true"> |
66 | 66 | ||
67 | <button name="im_btn" label="IM/Call" | 67 | <button name="im_btn" label="IM/Call" |
68 | bottom="-25" left="-85" height="22" width="80" | 68 | bottom="-25" left="-85" height="16" width="80" |
69 | follows="top|right" | 69 | follows="top|right" |
70 | tool_tip="Open Instant Message session" /> | 70 | tool_tip="Open Instant Message session" /> |
71 | 71 | ||
72 | <button name="profile_btn" label="Profile" | 72 | <button name="profile_btn" label="Profile" |
73 | bottom_delta="-25" left_delta="0" height="22" width="80" | 73 | bottom_delta="-20" left_delta="0" height="18" width="80" |
74 | follows="top|right" | 74 | follows="top|right" |
75 | tool_tip="Show picture, groups, and other information" /> | 75 | tool_tip="Show picture, groups, and other information" /> |
76 | 76 | ||
77 | <button name="offer_teleport_btn" label="Teleport..." | 77 | <button name="offer_teleport_btn" label="Teleport..." |
78 | bottom_delta="-25" left_delta="0" height="22" width="80" | 78 | bottom_delta="-20" left_delta="0" height="16" width="80" |
79 | follows="top|right" | 79 | follows="top|right" |
80 | tool_tip="Offer to teleport this person to your location" /> | 80 | tool_tip="Offer to teleport this person to your location" /> |
81 | 81 | ||
82 | <button name="teleport_btn" label="TP to" | ||
83 | bottom_delta="-20" left_delta="0" height="16" width="80" | ||
84 | follows="top|right" | ||
85 | tool_tip="Teleport to avatar's position" /> | ||
86 | |||
82 | <button name="track_btn" label="Track" | 87 | <button name="track_btn" label="Track" |
83 | bottom_delta="-25" left_delta="0" height="22" width="80" | 88 | bottom_delta="-20" left_delta="0" height="16" width="80" |
84 | follows="top|right" | 89 | follows="top|right" |
85 | tool_tip="Create a beacon to track friends you can map" /> | 90 | tool_tip="Create a beacon to track friends you can map" /> |
86 | 91 | ||
87 | <button name="invite_btn" label="Invite..." | 92 | <button name="invite_btn" label="Invite..." |
88 | bottom_delta="-25" left_delta="0" height="22" width="80" | 93 | bottom_delta="-20" left_delta="0" height="16" width="80" |
89 | follows="top|right" | 94 | follows="top|right" |
90 | tool_tip="Remove this person from your friends list" /> | 95 | tool_tip="Remove this person from your friends list" /> |
91 | 96 | ||
92 | <button name="add_btn" label="Add..." | 97 | <button name="add_btn" label="Add..." |
93 | bottom_delta="-25" left_delta="0" height="22" width="80" | 98 | bottom_delta="-20" left_delta="0" height="16" width="80" |
94 | follows="top|right" | 99 | follows="top|right" |
95 | tool_tip="Offer friendship to a resident" /> | 100 | tool_tip="Offer friendship to a resident" /> |
96 | 101 | ||