diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 89 | ||||
-rw-r--r-- | linden/indra/newview/llfloatermap.h | 14 | ||||
-rw-r--r-- | linden/indra/newview/llpanelgeneral.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | 3 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml | 5 |
6 files changed, 112 insertions, 12 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 84baa99..8a13b85 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -5044,6 +5044,17 @@ | |||
5044 | <key>Value</key> | 5044 | <key>Value</key> |
5045 | <integer>1</integer> | 5045 | <integer>1</integer> |
5046 | </map> | 5046 | </map> |
5047 | <key>MiniMapNotify</key> | ||
5048 | <map> | ||
5049 | <key>Comment</key> | ||
5050 | <string>Notify when avatars enter chat range</string> | ||
5051 | <key>Persist</key> | ||
5052 | <integer>1</integer> | ||
5053 | <key>Type</key> | ||
5054 | <string>Boolean</string> | ||
5055 | <key>Value</key> | ||
5056 | <integer>1</integer> | ||
5057 | </map> | ||
5047 | <key>MiniMapPrimMaxRadius</key> | 5058 | <key>MiniMapPrimMaxRadius</key> |
5048 | <map> | 5059 | <map> |
5049 | <key>Comment</key> | 5060 | <key>Comment</key> |
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index c60f07f..9992d9c 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp | |||
@@ -43,8 +43,10 @@ | |||
43 | #include "lluictrlfactory.h" | 43 | #include "lluictrlfactory.h" |
44 | 44 | ||
45 | // radar | 45 | // radar |
46 | #include "llchat.h" | ||
46 | #include "llfirstuse.h" | 47 | #include "llfirstuse.h" |
47 | #include "llfloateravatarinfo.h" | 48 | #include "llfloateravatarinfo.h" |
49 | #include "llfloaterchat.h" | ||
48 | #include "llfloaterfriends.h" | 50 | #include "llfloaterfriends.h" |
49 | #include "llfloatergroupinvite.h" | 51 | #include "llfloatergroupinvite.h" |
50 | #include "llfloatergroups.h" | 52 | #include "llfloatergroups.h" |
@@ -69,13 +71,15 @@ LLFloaterMap::LLFloaterMap(const LLSD& key) | |||
69 | : | 71 | : |
70 | LLFloater(std::string("minimap")), | 72 | LLFloater(std::string("minimap")), |
71 | mPanelMap(NULL), | 73 | mPanelMap(NULL), |
72 | mUpdate(TRUE) | 74 | mUpdate(TRUE), |
75 | mSelectedAvatar(LLUUID::null) | ||
76 | |||
73 | { | 77 | { |
74 | LLCallbackMap::map_t factory_map; | 78 | LLCallbackMap::map_t factory_map; |
75 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); | 79 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); |
76 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); | 80 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); |
77 | 81 | ||
78 | mSelectedAvatar.setNull(); | 82 | mChatAvatars.clear(); |
79 | } | 83 | } |
80 | 84 | ||
81 | 85 | ||
@@ -262,6 +266,33 @@ void LLFloaterMap::populateRadar() | |||
262 | } | 266 | } |
263 | // [/RLVa:KB] | 267 | // [/RLVa:KB] |
264 | 268 | ||
269 | // check if they're in chat range and notify user | ||
270 | LLVector3d temp = positions[i] - current_pos; | ||
271 | F32 distance = llround((F32)temp.magVec(), 0.1f); | ||
272 | std::stringstream dist; | ||
273 | dist.str(""); | ||
274 | dist << distance; | ||
275 | |||
276 | if (gSavedSettings.getBOOL("MiniMapNotify")) | ||
277 | { | ||
278 | if (distance <= 20.0f) | ||
279 | { | ||
280 | if (!getInChatList(avatar_ids[i])) | ||
281 | { | ||
282 | addToChatList(avatar_ids[i], dist.str()); | ||
283 | } | ||
284 | } | ||
285 | else | ||
286 | { | ||
287 | if (getInChatList(avatar_ids[i])) | ||
288 | { | ||
289 | removeFromChatList(avatar_ids[i]); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | updateChatList(avatar_ids); | ||
294 | } | ||
295 | |||
265 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; | 296 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; |
266 | element["id"] = avatar_ids[i]; | 297 | element["id"] = avatar_ids[i]; |
267 | element["columns"][0]["column"] = "avatar_name"; | 298 | element["columns"][0]["column"] = "avatar_name"; |
@@ -269,12 +300,7 @@ void LLFloaterMap::populateRadar() | |||
269 | element["columns"][0]["value"] = fullname + " " + mute_text; | 300 | element["columns"][0]["value"] = fullname + " " + mute_text; |
270 | element["columns"][1]["column"] = "avatar_distance"; | 301 | element["columns"][1]["column"] = "avatar_distance"; |
271 | element["columns"][1]["type"] = "text"; | 302 | element["columns"][1]["type"] = "text"; |
272 | 303 | element["columns"][1]["value"] = dist.str()+"m"; | |
273 | LLVector3d temp = positions[i] - current_pos; | ||
274 | F32 distance = (F32)temp.magVec(); | ||
275 | char dist[32]; | ||
276 | snprintf(dist, sizeof(dist), "%.1f", distance); | ||
277 | element["columns"][1]["value"] = strcat(dist,"m"); | ||
278 | 304 | ||
279 | mRadarList->addElement(element, ADD_BOTTOM); | 305 | mRadarList->addElement(element, ADD_BOTTOM); |
280 | } | 306 | } |
@@ -306,6 +332,53 @@ void LLFloaterMap::populateRadar() | |||
306 | //llinfos << "mSelectedAvatar: " << mSelectedAvatar.asString() << llendl; | 332 | //llinfos << "mSelectedAvatar: " << mSelectedAvatar.asString() << llendl; |
307 | } | 333 | } |
308 | 334 | ||
335 | void LLFloaterMap::updateChatList(std::vector<LLUUID> agent_ids) | ||
336 | { | ||
337 | std::set<LLUUID>::iterator it; | ||
338 | std::vector<LLUUID>::iterator result; | ||
339 | for (it = mChatAvatars.begin(); it != mChatAvatars.end(); ) | ||
340 | { | ||
341 | result = find(agent_ids.begin(), agent_ids.end(), *it); | ||
342 | if (result == agent_ids.end()) | ||
343 | { | ||
344 | mChatAvatars.erase(it++); | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | it++; | ||
349 | } | ||
350 | } | ||
351 | } | ||
352 | |||
353 | bool LLFloaterMap::getInChatList(LLUUID agent_id) | ||
354 | { | ||
355 | if (mChatAvatars.count(agent_id) > 0) | ||
356 | { | ||
357 | return true; | ||
358 | } | ||
359 | return false; | ||
360 | } | ||
361 | |||
362 | void LLFloaterMap::addToChatList(LLUUID agent_id, std::string distance) | ||
363 | { | ||
364 | mChatAvatars.insert(agent_id); | ||
365 | LLChat chat; | ||
366 | |||
367 | LLUIString notify = getString("entering_chat_range"); | ||
368 | notify.setArg("[NAME]", getSelectedName(agent_id)); | ||
369 | notify.setArg("[DISTANCE]", distance); | ||
370 | |||
371 | chat.mText = notify; | ||
372 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
373 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
374 | } | ||
375 | |||
376 | void LLFloaterMap::removeFromChatList(LLUUID agent_id) | ||
377 | { | ||
378 | // Do we want to add a notice? | ||
379 | mChatAvatars.erase(agent_id); | ||
380 | } | ||
381 | |||
309 | void LLFloaterMap::toggleButtons() | 382 | void LLFloaterMap::toggleButtons() |
310 | { | 383 | { |
311 | BOOL enable = FALSE; | 384 | BOOL enable = FALSE; |
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h index 349b0e6..deb972b 100644 --- a/linden/indra/newview/llfloatermap.h +++ b/linden/indra/newview/llfloatermap.h | |||
@@ -66,10 +66,11 @@ public: | |||
66 | private: | 66 | private: |
67 | LLFloaterMap(const LLSD& key = LLSD()); | 67 | LLFloaterMap(const LLSD& key = LLSD()); |
68 | 68 | ||
69 | LLNetMap* mPanelMap; | 69 | LLNetMap* mPanelMap; |
70 | LLScrollListCtrl* mRadarList; | 70 | LLScrollListCtrl* mRadarList; |
71 | LLUUID mSelectedAvatar; | 71 | LLUUID mSelectedAvatar; |
72 | bool mUpdate; | 72 | std::set<LLUUID> mChatAvatars; |
73 | bool mUpdate; | ||
73 | 74 | ||
74 | static void onList(LLUICtrl* ctrl, void* user_data); | 75 | static void onList(LLUICtrl* ctrl, void* user_data); |
75 | static void onRangeChange(LLFocusableElement* focus, void* user_data); | 76 | static void onRangeChange(LLFocusableElement* focus, void* user_data); |
@@ -78,6 +79,11 @@ private: | |||
78 | void toggleButtons(); | 79 | void toggleButtons(); |
79 | void populateRadar(); | 80 | void populateRadar(); |
80 | 81 | ||
82 | void updateChatList(std::vector<LLUUID> agent_ids); | ||
83 | bool getInChatList(LLUUID agent_id); | ||
84 | void addToChatList(LLUUID agent_id, std::string distance); | ||
85 | void removeFromChatList(LLUUID agent_id); | ||
86 | |||
81 | static void onClickProfile(void* user_data); | 87 | static void onClickProfile(void* user_data); |
82 | static void onClickIM(void* user_data); | 88 | static void onClickIM(void* user_data); |
83 | static void onClickAddFriend(void* user_data); | 89 | static void onClickAddFriend(void* user_data); |
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index e416401..4cf4091 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -60,6 +60,7 @@ 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("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); | 64 | childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); |
64 | childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); | 65 | childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); |
65 | childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); | 66 | childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); |
@@ -97,6 +98,7 @@ void LLPanelGeneral::apply() | |||
97 | gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); | 98 | gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); |
98 | gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); | 99 | gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); |
99 | gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); | 100 | gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); |
101 | gSavedSettings.setBOOL("MiniMapNotify", childGetValue("mini_map_notify")); | ||
100 | gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); | 102 | gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); |
101 | gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); | 103 | gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); |
102 | gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel")); | 104 | 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 3ae02e7..2cb46b7 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 | |||
@@ -95,4 +95,7 @@ | |||
95 | <string name="muted"> | 95 | <string name="muted"> |
96 | (muted) | 96 | (muted) |
97 | </string> | 97 | </string> |
98 | <string name="entering_chat_range"> | ||
99 | [NAME] has entered chat range ([DISTANCE]m) | ||
100 | </string> | ||
98 | </floater> | 101 | </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 bb1c5ee..56bdb28 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,6 +77,11 @@ | |||
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" | ||
81 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | ||
82 | label="Display mini-map messages in chat" left="151" | ||
83 | mouse_opaque="true" name="mini_map_notify" radio_style="false" | ||
84 | width="256" /> | ||
80 | <check_box bottom="-304" enabled="true" | 85 | <check_box bottom="-304" enabled="true" |
81 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | 86 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" |
82 | label="Notify when Linden dollars (L$) spent or received" left="151" | 87 | label="Notify when Linden dollars (L$) spent or received" left="151" |