diff options
Diffstat (limited to 'linden/indra/newview/llfloatermap.cpp')
-rw-r--r-- | linden/indra/newview/llfloatermap.cpp | 73 |
1 files changed, 72 insertions, 1 deletions
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 | ||
449 | void 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 | |||
467 | void 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 | |||
481 | bool LLFloaterMap::getInSimAvList(LLUUID agent_id) | ||
482 | { | ||
483 | if (mSimAvatars.count(agent_id) > 0) | ||
484 | { | ||
485 | return true; | ||
486 | } | ||
487 | return false; | ||
488 | } | ||
489 | |||
419 | void LLFloaterMap::toggleButtons() | 490 | void LLFloaterMap::toggleButtons() |
420 | { | 491 | { |
421 | BOOL enable = FALSE; | 492 | BOOL enable = FALSE; |