aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatermap.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloatermap.cpp57
1 files changed, 41 insertions, 16 deletions
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index 49563a6..3807a90 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -279,25 +279,38 @@ void LLFloaterMap::populateRadar()
279 // [/RLVa:KB] 279 // [/RLVa:KB]
280 280
281 // check if they're in certain ranges and notify user if we've enabled that 281 // check if they're in certain ranges and notify user if we've enabled that
282 LLVector3d temp = positions[i] - current_pos; 282 LLVector3d temp = positions[i];
283 F32 distance = llround((F32)temp.magVec(), 0.1f); 283 if (positions[i].mdV[VZ] == 0.0f) // LL only sends height value up to 1024m, try to work around it
284 /*char dist[32]; 284 {
285 sprintf(dist, "%.1f", distance); 285 LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]);
286 std::string dist_string = dist;*/ 286 if (av_obj != NULL && av_obj->isAvatar())
287 std::string dist_string = llformat("%.1f", distance); 287 {
288 LLVOAvatar* avatarp = (LLVOAvatar*)av_obj;
289 if (avatarp != NULL)
290 {
291 temp = avatarp->getPositionGlobal();
292 }
293 }
294 }
295 F64 distance = dist_vec(temp, current_pos);
296 // we round for accuracy when avs tp in
297 std::string dist_string = llformat("%.1f", llround((F32)distance, 0.1f));
298
299 /*llinfos << "Avatar :" << fullname << " Position: " << positions[i] << " Your Position: "
300 << current_pos << " Distance: " << distance << llendl;*/
288 301
289 if (notify_chat) 302 if (notify_chat)
290 { 303 {
291 if (distance < 20.0f) 304 if (distance < 20.0f)
292 { 305 {
293 if (!getInChatList(avatar_ids[i])) 306 if (!isInChatList(avatar_ids[i]))
294 { 307 {
295 addToChatList(avatar_ids[i], dist_string); 308 addToChatList(avatar_ids[i], dist_string);
296 } 309 }
297 } 310 }
298 else 311 else
299 { 312 {
300 if (getInChatList(avatar_ids[i])) 313 if (isInChatList(avatar_ids[i]))
301 { 314 {
302 removeFromChatList(avatar_ids[i]); 315 removeFromChatList(avatar_ids[i]);
303 } 316 }
@@ -311,7 +324,7 @@ void LLFloaterMap::populateRadar()
311 324
312 if (notify_sim) 325 if (notify_sim)
313 { 326 {
314 if (!getInChatList(avatar_ids[i]) && !getInSimAvList(avatar_ids[i])) 327 if (!isInChatList(avatar_ids[i]) && !getInSimAvList(avatar_ids[i]))
315 { 328 {
316 LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]); 329 LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]);
317 if (av_obj != NULL && av_obj->isAvatar()) 330 if (av_obj != NULL && av_obj->isAvatar())
@@ -338,7 +351,7 @@ void LLFloaterMap::populateRadar()
338 { 351 {
339 // append typing string 352 // append typing string
340 std::string typing = ""; 353 std::string typing = "";
341 if (getIsTyping(avatar_ids[i])) 354 if (isTyping(avatar_ids[i]))
342 { 355 {
343 typing = getString("is_typing")+ " "; 356 typing = getString("is_typing")+ " ";
344 } 357 }
@@ -397,7 +410,7 @@ void LLFloaterMap::updateChatList(std::vector<LLUUID> agent_ids)
397 } 410 }
398} 411}
399 412
400bool LLFloaterMap::getInChatList(LLUUID agent_id) 413bool LLFloaterMap::isInChatList(LLUUID agent_id)
401{ 414{
402 if (mChatAvatars.count(agent_id) > 0) 415 if (mChatAvatars.count(agent_id) > 0)
403 { 416 {
@@ -426,7 +439,7 @@ void LLFloaterMap::removeFromChatList(LLUUID agent_id)
426 mChatAvatars.erase(agent_id); 439 mChatAvatars.erase(agent_id);
427} 440}
428 441
429bool LLFloaterMap::getIsTyping(LLUUID agent_id) 442bool LLFloaterMap::isTyping(LLUUID agent_id)
430{ 443{
431 if (mTypingAvatars.count(agent_id) > 0) 444 if (mTypingAvatars.count(agent_id) > 0)
432 { 445 {
@@ -439,7 +452,7 @@ void LLFloaterMap::updateTypingList(LLUUID agent_id, bool remove)
439{ 452{
440 if (remove) 453 if (remove)
441 { 454 {
442 if (getIsTyping(agent_id)) 455 if (isTyping(agent_id))
443 { 456 {
444 mTypingAvatars.erase(agent_id); 457 mTypingAvatars.erase(agent_id);
445 } 458 }
@@ -503,7 +516,7 @@ void LLFloaterMap::toggleButtons()
503 enable = mSelectedAvatar.notNull() ? visibleItemsSelected() : FALSE; 516 enable = mSelectedAvatar.notNull() ? visibleItemsSelected() : FALSE;
504 enable_unmute = mSelectedAvatar.notNull() ? LLMuteList::getInstance()->isMuted(mSelectedAvatar) : FALSE; 517 enable_unmute = mSelectedAvatar.notNull() ? LLMuteList::getInstance()->isMuted(mSelectedAvatar) : FALSE;
505 enable_track = gAgent.isGodlike() || is_agent_mappable(mSelectedAvatar); 518 enable_track = gAgent.isGodlike() || is_agent_mappable(mSelectedAvatar);
506 enable_estate = getKickable(mSelectedAvatar); 519 enable_estate = isKickable(mSelectedAvatar);
507 enable_friend = !is_agent_friend(mSelectedAvatar); 520 enable_friend = !is_agent_friend(mSelectedAvatar);
508 } 521 }
509 else 522 else
@@ -520,10 +533,21 @@ void LLFloaterMap::toggleButtons()
520 childSetEnabled("freeze_btn", enable_estate); 533 childSetEnabled("freeze_btn", enable_estate);
521 childSetEnabled("eject_btn", enable_estate); 534 childSetEnabled("eject_btn", enable_estate);
522 childSetEnabled("mute_btn", enable); 535 childSetEnabled("mute_btn", enable);
523 childSetEnabled("unmute_btn", enable_unmute);
524 childSetEnabled("ar_btn", enable); 536 childSetEnabled("ar_btn", enable);
525 childSetEnabled("estate_eject_btn", enable_estate); 537 childSetEnabled("estate_eject_btn", enable_estate);
526 538
539 if (enable_unmute)
540 {
541 childSetVisible("mute_btn", false);
542 childSetEnabled("unmute_btn", true);
543 childSetVisible("unmute_btn", true);
544 }
545 else
546 {
547 childSetVisible("mute_btn", true);
548 childSetVisible("unmute_btn", false);
549 }
550
527// [RLVa:KB] - Imprudence-1.2.0 551// [RLVa:KB] - Imprudence-1.2.0
528 // Bit clumsy, but this way the RLV stuff is in its own separate block and keeps the code above clean - Kitty 552 // Bit clumsy, but this way the RLV stuff is in its own separate block and keeps the code above clean - Kitty
529 if ( (rlv_handler_t::isEnabled()) && (mSelectedAvatar.notNull()) ) 553 if ( (rlv_handler_t::isEnabled()) && (mSelectedAvatar.notNull()) )
@@ -552,7 +576,7 @@ void LLFloaterMap::toggleButtons()
552// [/RLVa:KB] 576// [/RLVa:KB]
553} 577}
554 578
555BOOL LLFloaterMap::getKickable(const LLUUID &agent_id) 579BOOL LLFloaterMap::isKickable(const LLUUID &agent_id)
556{ 580{
557 if (agent_id.notNull()) 581 if (agent_id.notNull())
558 { 582 {
@@ -568,6 +592,7 @@ BOOL LLFloaterMap::getKickable(const LLUUID &agent_id)
568 if (LLWorld::getInstance()->positionRegionValidGlobal(pos_global)) 592 if (LLWorld::getInstance()->positionRegionValidGlobal(pos_global))
569 { 593 {
570 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel(); 594 LLParcel* parcel = LLViewerParcelMgr::getInstance()->selectParcelAt(pos_global)->getParcel();
595 LLViewerParcelMgr::getInstance()->deselectLand();
571 596
572 BOOL new_value = (region != NULL); 597 BOOL new_value = (region != NULL);
573 598