diff options
author | McCabe Maxsted | 2009-08-09 11:11:09 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-08-09 11:11:09 -0700 |
commit | c174569f9c34f684e2e057ee57b23a6a118ddfcc (patch) | |
tree | e00edbee0946d5fce2eb26cf6f2507fb053f4af0 /linden/indra/newview | |
parent | Online/Offline notifications now always show in IM windows (diff) | |
download | meta-impy-c174569f9c34f684e2e057ee57b23a6a118ddfcc.zip meta-impy-c174569f9c34f684e2e057ee57b23a6a118ddfcc.tar.gz meta-impy-c174569f9c34f684e2e057ee57b23a6a118ddfcc.tar.bz2 meta-impy-c174569f9c34f684e2e057ee57b23a6a118ddfcc.tar.xz |
Basic basic radar that kinda sorta works but not really
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/llnetmap.cpp | 173 | ||||
-rw-r--r-- | linden/indra/newview/llnetmap.h | 18 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml | 46 |
3 files changed, 233 insertions, 4 deletions
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 6fa6745..765b6e6 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -44,7 +44,6 @@ | |||
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 "llfloaterworldmap.h" | 47 | #include "llfloaterworldmap.h" |
49 | #include "llframetimer.h" | 48 | #include "llframetimer.h" |
50 | #include "llmutelist.h" | 49 | #include "llmutelist.h" |
@@ -66,6 +65,14 @@ | |||
66 | #include "llworldmapview.h" // shared draw code | 65 | #include "llworldmapview.h" // shared draw code |
67 | #include "llappviewer.h" // Only for constants! | 66 | #include "llappviewer.h" // Only for constants! |
68 | 67 | ||
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 | |||
69 | #include "llglheaders.h" | 76 | #include "llglheaders.h" |
70 | 77 | ||
71 | const F32 MAP_SCALE_MIN = 32; | 78 | const F32 MAP_SCALE_MIN = 32; |
@@ -105,6 +112,8 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
105 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); | 112 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); |
106 | 113 | ||
107 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); | 114 | 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"); | ||
108 | 117 | ||
109 | updateMinorDirections(); | 118 | updateMinorDirections(); |
110 | 119 | ||
@@ -117,6 +126,22 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
117 | mPopupMenuHandle = menu->getHandle(); | 126 | mPopupMenuHandle = menu->getHandle(); |
118 | } | 127 | } |
119 | 128 | ||
129 | BOOL LLNetMap::postBuild() | ||
130 | { | ||
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; | ||
143 | } | ||
144 | |||
120 | LLNetMap::~LLNetMap() | 145 | LLNetMap::~LLNetMap() |
121 | { | 146 | { |
122 | } | 147 | } |
@@ -449,6 +474,8 @@ void LLNetMap::draw() | |||
449 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); | 474 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); |
450 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); | 475 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); |
451 | 476 | ||
477 | populateRadar(); | ||
478 | |||
452 | LLView::draw(); | 479 | LLView::draw(); |
453 | } | 480 | } |
454 | 481 | ||
@@ -948,3 +975,147 @@ bool LLNetMap::LLEnableProfile::handleEvent(LLPointer<LLEvent> event, const LLSD | |||
948 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); | 975 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); |
949 | return true; | 976 | return true; |
950 | } | 977 | } |
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 | } \ No newline at end of file | ||
diff --git a/linden/indra/newview/llnetmap.h b/linden/indra/newview/llnetmap.h index ef046d8..58b2066 100644 --- a/linden/indra/newview/llnetmap.h +++ b/linden/indra/newview/llnetmap.h | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include "llpanel.h" | 35 | #include "llpanel.h" |
36 | #include "llmemberlistener.h" | 36 | #include "llmemberlistener.h" |
37 | #include "llscrolllistctrl.h" | ||
37 | #include "v3math.h" | 38 | #include "v3math.h" |
38 | #include "v3dmath.h" | 39 | #include "v3dmath.h" |
39 | #include "v4color.h" | 40 | #include "v4color.h" |
@@ -52,6 +53,8 @@ class LLNetMap : public LLPanel | |||
52 | { | 53 | { |
53 | public: | 54 | public: |
54 | LLNetMap(const std::string& name); | 55 | LLNetMap(const std::string& name); |
56 | |||
57 | virtual BOOL postBuild(); | ||
55 | virtual ~LLNetMap(); | 58 | virtual ~LLNetMap(); |
56 | 59 | ||
57 | virtual void draw(); | 60 | virtual void draw(); |
@@ -111,8 +114,9 @@ private: | |||
111 | LLPointer<LLImageGL> mObjectImagep; | 114 | LLPointer<LLImageGL> mObjectImagep; |
112 | 115 | ||
113 | private: | 116 | private: |
114 | LLUUID mClosestAgentToCursor; | 117 | LLUUID mClosestAgentToCursor; |
115 | LLUUID mClosestAgentAtLastRightClick; | 118 | LLUUID mClosestAgentAtLastRightClick; |
119 | LLScrollListCtrl* mRadarList; | ||
116 | 120 | ||
117 | static BOOL sRotateMap; | 121 | static BOOL sRotateMap; |
118 | static LLNetMap* sInstance; | 122 | static LLNetMap* sInstance; |
@@ -122,6 +126,16 @@ private: | |||
122 | static void showAgentProfile(void*); | 126 | static void showAgentProfile(void*); |
123 | BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } | 127 | BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } |
124 | 128 | ||
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 | |||
125 | class LLScaleMap : public LLMemberListener<LLNetMap> | 139 | class LLScaleMap : public LLMemberListener<LLNetMap> |
126 | { | 140 | { |
127 | public: | 141 | public: |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml b/linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml index 1a93341..085b576 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_mini_map.xml | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | 1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
2 | <panel background_opaque="false" background_visible="true" bg_alpha_color="NetMapBackgroundColor" | 2 | <panel background_opaque="false" background_visible="true" bg_alpha_color="NetMapBackgroundColor" |
3 | border="false" follows="left|top|right|bottom" height="216" label="Mini Map" | 3 | border="false" follows="left|top|right|bottom" height="716" label="Mini Map" |
4 | mouse_opaque="false" name="mini_mapview" width="196"> | 4 | mouse_opaque="false" name="mini_mapview" width="196"> |
5 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 5 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
6 | bottom="-40" drop_shadow_visible="false" font="SansSerifSmall" h_pad="0" | 6 | bottom="-40" drop_shadow_visible="false" font="SansSerifSmall" h_pad="0" |
@@ -59,4 +59,48 @@ | |||
59 | <string name="tooltip_map"> | 59 | <string name="tooltip_map"> |
60 | Double-Click opens Map | 60 | Double-Click opens Map |
61 | </string> | 61 | </string> |
62 | <panel name="RadarPanel" label="Radar" bg_alpha_color="NetMapBackgroundColor" | ||
63 | border="true" width="196" bottom="200" | ||
64 | height="196" left="0" mouse_opaque="true"> | ||
65 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
66 | bottom="-24" drop_shadow_visible="true" follows="left|top" | ||
67 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="10" | ||
68 | mouse_opaque="true" name="InstructSelectResident" v_pad="0" | ||
69 | width="220"> | ||
70 | Select nearby resident: | ||
71 | </text> | ||
72 | <slider bottom_delta="-20" left="10" follows="left|top" width="175" height="15" | ||
73 | name="near_me_range" label="Range" control_name="NearMeRange" | ||
74 | min_val="5" max_val="40" increment="1" initial_val="20" decimal_digits="0" /> | ||
75 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
76 | bottom_delta="0" left="185" drop_shadow_visible="true" follows="left|top" | ||
77 | font="SansSerifSmall" h_pad="0" halign="left" height="15" | ||
78 | mouse_opaque="true" name="meters" v_pad="0" | ||
79 | width="40"> | ||
80 | Meters | ||
81 | </text> | ||
82 | <scroll_list bottom_delta="-20" width="96" height="100" left="10" | ||
83 | follows="left|top|bottom|right" draw_border="true" draw_heading="false" | ||
84 | draw_stripes="true" column_padding="5" sort_column="0" mouse_opaque="true" | ||
85 | background_visible="true" multi_select="false" name="RadarList" /> | ||
86 | <button bottom_delta="0" follows="top|right" height="22" label="IM/Call" | ||
87 | left="-90" name="im_btn" tool_tip="Open Instant Message session" | ||
88 | width="80" /> | ||
89 | <button bottom_delta="-25" follows="top|right" height="22" label="Profile" | ||
90 | left_delta="0" name="profile_btn" | ||
91 | tool_tip="Show picture, groups, and other information" width="80" /> | ||
92 | <button bottom_delta="-25" follows="top|right" height="22" label="Teleport..." | ||
93 | left_delta="0" name="offer_teleport_btn" | ||
94 | tool_tip="Offer this friend a teleport to your current location" width="80" /> | ||
95 | <button bottom_delta="-25" follows="top|right" height="22" label="Track" | ||
96 | left_delta="0" name="track_btn" | ||
97 | tool_tip="Create a beacon to track this avatar" width="80" /> | ||
98 | <button bottom_delta="-35" follows="top|right" height="22" label="Invite..." | ||
99 | left_delta="0" name="invite_btn" | ||
100 | tool_tip="Remove this person from your friends list" width="80" /> | ||
101 | <button bottom_delta="-35" follows="top|right" height="22" label="Add..." | ||
102 | left_delta="0" name="add_btn" tool_tip="Offer friendship to a resident" | ||
103 | width="80" /> | ||
104 | </panel> | ||
105 | |||
62 | </panel> | 106 | </panel> |