aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-10-08 02:01:55 -0700
committerMcCabe Maxsted2009-10-08 02:01:55 -0700
commit64d298ac17b47805f3deec99fc911bd8f73a9d2d (patch)
tree27e9a8e783c8e93129f8759e80bbef1f6d43640c /linden/indra
parentAdded typing info to mini-map radar (diff)
downloadmeta-impy-64d298ac17b47805f3deec99fc911bd8f73a9d2d.zip
meta-impy-64d298ac17b47805f3deec99fc911bd8f73a9d2d.tar.gz
meta-impy-64d298ac17b47805f3deec99fc911bd8f73a9d2d.tar.bz2
meta-impy-64d298ac17b47805f3deec99fc911bd8f73a9d2d.tar.xz
Mini-map radar now can notify you when someone enters the sim
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/app_settings/settings.xml13
-rw-r--r--linden/indra/newview/llfloatermap.cpp73
-rw-r--r--linden/indra/newview/llfloatermap.h12
-rw-r--r--linden/indra/newview/llpanelgeneral.cpp6
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml3
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml17
6 files changed, 116 insertions, 8 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 8ffcb19..f167840 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -5088,7 +5088,7 @@
5088 <key>Value</key> 5088 <key>Value</key>
5089 <integer>1</integer> 5089 <integer>1</integer>
5090 </map> 5090 </map>
5091 <key>MiniMapNotify</key> 5091 <key>MiniMapNotifyChatRange</key>
5092 <map> 5092 <map>
5093 <key>Comment</key> 5093 <key>Comment</key>
5094 <string>Notify when avatars enter chat range</string> 5094 <string>Notify when avatars enter chat range</string>
@@ -5099,6 +5099,17 @@
5099 <key>Value</key> 5099 <key>Value</key>
5100 <integer>1</integer> 5100 <integer>1</integer>
5101 </map> 5101 </map>
5102 <key>MiniMapNotifySimRange</key>
5103 <map>
5104 <key>Comment</key>
5105 <string>Notify when avatars enters the current sim</string>
5106 <key>Persist</key>
5107 <integer>1</integer>
5108 <key>Type</key>
5109 <string>Boolean</string>
5110 <key>Value</key>
5111 <integer>0</integer>
5112 </map>
5102 <key>MiniMapPrimMaxRadius</key> 5113 <key>MiniMapPrimMaxRadius</key>
5103 <map> 5114 <map>
5104 <key>Comment</key> 5115 <key>Comment</key>
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index ae5b2b6..142d8fe 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -266,10 +266,14 @@ void LLFloaterMap::populateRadar()
266 std::string fullname = getSelectedName(avatar_ids[i]); 266 std::string fullname = getSelectedName(avatar_ids[i]);
267 if (!fullname.empty()) 267 if (!fullname.empty())
268 { 268 {
269 bool notify_chat = gSavedSettings.getBOOL("MiniMapNotifyChatRange");
270 bool notify_sim = gSavedSettings.getBOOL("MiniMapNotifySimRange");
269 // [RLVa:KB] - Alternate: Imprudence-1.2.0 271 // [RLVa:KB] - Alternate: Imprudence-1.2.0
270 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) 272 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
271 { 273 {
272 fullname = gRlvHandler.getAnonym(fullname); 274 fullname = gRlvHandler.getAnonym(fullname);
275 notify_chat = false;
276 notify_sim = false;
273 } 277 }
274 // [/RLVa:KB] 278 // [/RLVa:KB]
275 279
@@ -280,7 +284,7 @@ void LLFloaterMap::populateRadar()
280 sprintf(dist, "%.1f", distance); 284 sprintf(dist, "%.1f", distance);
281 std::string dist_string = dist; 285 std::string dist_string = dist;
282 286
283 if (gSavedSettings.getBOOL("MiniMapNotify")) 287 if (notify_chat)
284 { 288 {
285 if (distance < 20.0f) 289 if (distance < 20.0f)
286 { 290 {
@@ -304,6 +308,31 @@ void LLFloaterMap::populateRadar()
304 mChatAvatars.clear(); 308 mChatAvatars.clear();
305 } 309 }
306 310
311 // announce their presence in the sim if we've enabled that
312 if (notify_sim)
313 {
314 if (!getInChatList(avatar_ids[i]) && !getInSimAvList(avatar_ids[i]))
315 {
316 LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]);
317 if (av_obj != NULL && av_obj->isAvatar())
318 {
319 LLVOAvatar* avatarp = (LLVOAvatar*)av_obj;
320 if (avatarp != NULL)
321 {
322 if (avatarp->getRegion() == gAgent.getRegion())
323 {
324 addToSimAvList(avatar_ids[i], dist_string);
325 }
326 }
327 }
328 }
329 updateSimAvList(avatar_ids);
330 }
331 else if (!mSimAvatars.empty())
332 {
333 mSimAvatars.clear();
334 }
335
307 // append typing string 336 // append typing string
308 std::string typing = ""; 337 std::string typing = "";
309 if (getIsTyping(avatar_ids[i])) 338 if (getIsTyping(avatar_ids[i]))
@@ -334,6 +363,7 @@ void LLFloaterMap::populateRadar()
334 } 363 }
335 else 364 else
336 { 365 {
366 mTypingAvatars.clear();
337 mRadarList->addCommentText(getString("no_one_near"), ADD_TOP); 367 mRadarList->addCommentText(getString("no_one_near"), ADD_TOP);
338 avatar_count << "0"; 368 avatar_count << "0";
339 } 369 }
@@ -416,6 +446,47 @@ void LLFloaterMap::updateTypingList(LLUUID agent_id, bool remove)
416 } 446 }
417} 447}
418 448
449void LLFloaterMap::updateSimAvList(std::vector<LLUUID> agent_ids)
450{
451 std::set<LLUUID>::iterator it;
452 std::vector<LLUUID>::iterator result;
453 for (it = mSimAvatars.begin(); it != mSimAvatars.end(); )
454 {
455 result = find(agent_ids.begin(), agent_ids.end(), *it);
456 if (result == agent_ids.end())
457 {
458 mSimAvatars.erase(it++);
459 }
460 else
461 {
462 it++;
463 }
464 }
465}
466
467void LLFloaterMap::addToSimAvList(LLUUID agent_id, std::string distance)
468{
469 mSimAvatars.insert(agent_id);
470 LLChat chat;
471
472 LLUIString notify = getString("entering_sim_range");
473 notify.setArg("[NAME]", getSelectedName(agent_id));
474 notify.setArg("[DISTANCE]", distance);
475
476 chat.mText = notify;
477 chat.mSourceType = CHAT_SOURCE_SYSTEM;
478 LLFloaterChat::addChat(chat, FALSE, FALSE);
479}
480
481bool LLFloaterMap::getInSimAvList(LLUUID agent_id)
482{
483 if (mSimAvatars.count(agent_id) > 0)
484 {
485 return true;
486 }
487 return false;
488}
489
419void LLFloaterMap::toggleButtons() 490void LLFloaterMap::toggleButtons()
420{ 491{
421 BOOL enable = FALSE; 492 BOOL enable = FALSE;
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h
index 6e44a1e..af4d1cc 100644
--- a/linden/indra/newview/llfloatermap.h
+++ b/linden/indra/newview/llfloatermap.h
@@ -67,13 +67,19 @@ public:
67 67
68 68
69private: 69private:
70
70 LLFloaterMap(const LLSD& key = LLSD()); 71 LLFloaterMap(const LLSD& key = LLSD());
71 72
72 LLNetMap* mPanelMap; 73 LLNetMap* mPanelMap;
73 LLScrollListCtrl* mRadarList; 74 LLScrollListCtrl* mRadarList;
74 LLUUID mSelectedAvatar; 75 LLUUID mSelectedAvatar;
76
77 // TODO: move all this info into its own object. It's stupid
78 // and bug-prone to keep it all in separate containers, but
79 // I want to get this out for 1.2 -- McCabe
75 std::set<LLUUID> mChatAvatars; 80 std::set<LLUUID> mChatAvatars;
76 std::set<LLUUID> mTypingAvatars; 81 std::set<LLUUID> mTypingAvatars;
82 std::set<LLUUID> mSimAvatars;
77 bool mUpdate; 83 bool mUpdate;
78 84
79 static void onList(LLUICtrl* ctrl, void* user_data); 85 static void onList(LLUICtrl* ctrl, void* user_data);
@@ -88,6 +94,10 @@ private:
88 void addToChatList(LLUUID agent_id, std::string distance); 94 void addToChatList(LLUUID agent_id, std::string distance);
89 void removeFromChatList(LLUUID agent_id); 95 void removeFromChatList(LLUUID agent_id);
90 96
97 bool getInSimAvList(LLUUID agent_id);
98 void addToSimAvList(LLUUID agent_id, std::string distance);
99 void updateSimAvList(std::vector<LLUUID> agent_ids);
100
91 static void onClickProfile(void* user_data); 101 static void onClickProfile(void* user_data);
92 static void onClickIM(void* user_data); 102 static void onClickIM(void* user_data);
93 static void onClickAddFriend(void* user_data); 103 static void onClickAddFriend(void* user_data);
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp
index 4cf4091..04b7afe 100644
--- a/linden/indra/newview/llpanelgeneral.cpp
+++ b/linden/indra/newview/llpanelgeneral.cpp
@@ -60,7 +60,8 @@ BOOL LLPanelGeneral::postBuild()
60 childSetValue("small_avatar_names_checkbox", gSavedSettings.getBOOL("SmallAvatarNames")); 60 childSetValue("small_avatar_names_checkbox", gSavedSettings.getBOOL("SmallAvatarNames"));
61 childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle")); 61 childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle"));
62 childSetValue("afk_timeout_spinner", gSavedSettings.getF32("AFKTimeout")); 62 childSetValue("afk_timeout_spinner", gSavedSettings.getF32("AFKTimeout"));
63 childSetValue("mini_map_notify", gSavedSettings.getBOOL("MiniMapNotify")); 63 childSetValue("mini_map_notify_chat", gSavedSettings.getBOOL("MiniMapNotifyChatRange"));
64 childSetValue("mini_map_notify_sim", gSavedSettings.getBOOL("MiniMapNotifySimRange"));
64 childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); 65 childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange"));
65 childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); 66 childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker"));
66 childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); 67 childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar"));
@@ -98,7 +99,8 @@ void LLPanelGeneral::apply()
98 gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); 99 gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox"));
99 gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); 100 gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox"));
100 gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); 101 gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal());
101 gSavedSettings.setBOOL("MiniMapNotify", childGetValue("mini_map_notify")); 102 gSavedSettings.setBOOL("MiniMapNotifyChatRange", childGetValue("mini_map_notify_chat"));
103 gSavedSettings.setBOOL("MiniMapNotifySimRange", childGetValue("mini_map_notify_sim"));
102 gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); 104 gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox"));
103 gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); 105 gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox"));
104 gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel")); 106 gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel"));
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml
index dd9c324..3baec3f 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml
@@ -101,4 +101,7 @@
101 <string name="entering_chat_range"> 101 <string name="entering_chat_range">
102 [NAME] has entered chat range ([DISTANCE]m) 102 [NAME] has entered chat range ([DISTANCE]m)
103 </string> 103 </string>
104 <string name="entering_sim_range">
105 [NAME] has entered the sim ([DISTANCE]m)
106 </string>
104</floater> 107</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
index 56bdb28..0c18a62 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
@@ -77,11 +77,22 @@
77 follows="left|top" height="16" increment="1" initial_val="300" 77 follows="left|top" height="16" increment="1" initial_val="300"
78 label="Away Timeout:" label_width="141" left="10" max_val="600" 78 label="Away Timeout:" label_width="141" left="10" max_val="600"
79 min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" /> 79 min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" />
80 <check_box bottom_delta="-25" enabled="true" 80 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
81 bottom_delta="-25" drop_shadow_visible="true" enabled="true" follows="left|top"
82 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
83 mouse_opaque="true" name="UI Size:" v_pad="0" width="128">
84 Mini-map notify:
85 </text>
86 <check_box bottom_delta="0" enabled="true"
81 follows="left|top" font="SansSerifSmall" height="16" initial_value="false" 87 follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
82 label="Display mini-map messages in chat" left="151" 88 label="Entering chat range" left="151"
83 mouse_opaque="true" name="mini_map_notify" radio_style="false" 89 mouse_opaque="true" name="mini_map_notify_chat" radio_style="false"
84 width="256" /> 90 width="256" />
91 <check_box bottom_delta="0" enabled="true"
92 follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
93 label="Entering sim" left="330"
94 mouse_opaque="true" name="mini_map_notify_sim" radio_style="false"
95 width="256" />
85 <check_box bottom="-304" enabled="true" 96 <check_box bottom="-304" enabled="true"
86 follows="left|top" font="SansSerifSmall" height="16" initial_value="false" 97 follows="left|top" font="SansSerifSmall" height="16" initial_value="false"
87 label="Notify when Linden dollars (L$) spent or received" left="151" 98 label="Notify when Linden dollars (L$) spent or received" left="151"