diff options
Diffstat (limited to 'linden/indra/newview/llnetmap.cpp')
-rw-r--r-- | linden/indra/newview/llnetmap.cpp | 177 |
1 files changed, 9 insertions, 168 deletions
diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 903f6f3..2429aa4 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp | |||
@@ -44,6 +44,8 @@ | |||
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 "llfloatermap.h" | ||
47 | #include "llfloaterworldmap.h" | 49 | #include "llfloaterworldmap.h" |
48 | #include "llframetimer.h" | 50 | #include "llframetimer.h" |
49 | #include "llmutelist.h" | 51 | #include "llmutelist.h" |
@@ -65,14 +67,6 @@ | |||
65 | #include "llworldmapview.h" // shared draw code | 67 | #include "llworldmapview.h" // shared draw code |
66 | #include "llappviewer.h" // Only for constants! | 68 | #include "llappviewer.h" // Only for constants! |
67 | 69 | ||
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 | |||
76 | #include "llglheaders.h" | 70 | #include "llglheaders.h" |
77 | 71 | ||
78 | const F32 MAP_SCALE_MIN = 32; | 72 | const F32 MAP_SCALE_MIN = 32; |
@@ -112,8 +106,6 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
112 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); | 106 | (new LLEnableProfile())->registerListener(this, "MiniMap.EnableProfile"); |
113 | 107 | ||
114 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); | 108 | 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"); | ||
117 | 109 | ||
118 | updateMinorDirections(); | 110 | updateMinorDirections(); |
119 | 111 | ||
@@ -128,17 +120,6 @@ LLNetMap::LLNetMap(const std::string& name) : | |||
128 | 120 | ||
129 | BOOL LLNetMap::postBuild() | 121 | BOOL LLNetMap::postBuild() |
130 | { | 122 | { |
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; | 123 | return TRUE; |
143 | } | 124 | } |
144 | 125 | ||
@@ -355,6 +336,7 @@ void LLNetMap::draw() | |||
355 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); | 336 | LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); |
356 | LLColor4 friend_color = gColors.getColor( "MapFriend" ); | 337 | LLColor4 friend_color = gColors.getColor( "MapFriend" ); |
357 | LLColor4 muted_color = gColors.getColor( "MapMuted" ); | 338 | LLColor4 muted_color = gColors.getColor( "MapMuted" ); |
339 | LLColor4 selected_color = gColors.getColor( "MapSelected" ); | ||
358 | LLColor4 glyph_color; | 340 | LLColor4 glyph_color; |
359 | 341 | ||
360 | std::vector<LLUUID> avatar_ids; | 342 | std::vector<LLUUID> avatar_ids; |
@@ -375,6 +357,10 @@ void LLNetMap::draw() | |||
375 | { | 357 | { |
376 | glyph_color = friend_color; | 358 | glyph_color = friend_color; |
377 | } | 359 | } |
360 | else if (LLFloaterMap::isSelected(avatar_ids[i])) | ||
361 | { | ||
362 | glyph_color = selected_color; | ||
363 | } | ||
378 | else | 364 | else |
379 | { | 365 | { |
380 | glyph_color = avatar_color; | 366 | glyph_color = avatar_color; |
@@ -474,9 +460,9 @@ void LLNetMap::draw() | |||
474 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); | 460 | setDirectionPos( getChild<LLTextBox>("sw_label"), rotation + F_PI + F_PI_BY_TWO / 2); |
475 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); | 461 | setDirectionPos( getChild<LLTextBox>("se_label"), rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); |
476 | 462 | ||
477 | populateRadar(); | ||
478 | |||
479 | LLView::draw(); | 463 | LLView::draw(); |
464 | |||
465 | LLFloaterMap::updateRadar(); | ||
480 | } | 466 | } |
481 | 467 | ||
482 | void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) | 468 | void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) |
@@ -975,148 +961,3 @@ bool LLNetMap::LLEnableProfile::handleEvent(LLPointer<LLEvent> event, const LLSD | |||
975 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); | 961 | self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); |
976 | return true; | 962 | return true; |
977 | } | 963 | } |
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 | } | ||
1122 | |||