aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorMcCabe Maxsted2010-10-17 01:27:33 -0700
committerMcCabe Maxsted2010-10-17 01:27:33 -0700
commit0e5448aea1753e89de0c411f159f5e8f664418c1 (patch)
tree8c9906731fe0b5bae6f5bf9c0225e0ed18070a30 /linden/indra/newview/llfloatertools.cpp
parentPorted fix for Apply button not working correctly when changing show group in... (diff)
downloadmeta-impy-0e5448aea1753e89de0c411f159f5e8f664418c1.zip
meta-impy-0e5448aea1753e89de0c411f159f5e8f664418c1.tar.gz
meta-impy-0e5448aea1753e89de0c411f159f5e8f664418c1.tar.bz2
meta-impy-0e5448aea1753e89de0c411f159f5e8f664418c1.tar.xz
Ported list link number in tools window from the Ascent Viewer and Imprudenced it
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp67
1 files changed, 57 insertions, 10 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index f6f09b1..fc72467 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -528,14 +528,54 @@ void LLFloaterTools::refresh()
528 mTab->enableTabButton(idx_face, all_volume); 528 mTab->enableTabButton(idx_face, all_volume);
529 mTab->enableTabButton(idx_contents, all_volume); 529 mTab->enableTabButton(idx_contents, all_volume);
530 530
531 // Refresh object and prim count labels 531 // Added in Link Num value -HgB
532 LLLocale locale(LLLocale::USER_LOCALE); 532 if (gSavedSettings.getBOOL("EditLinkedParts") && LLSelectMgr::getInstance()->getEditSelection()->getObjectCount() == 1) //Selecting a single prim in "Edit Linked" mode, show link number
533 std::string obj_count_string; 533 {
534 LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); 534 childSetVisible("obj_count", FALSE);
535 childSetTextArg("obj_count", "[COUNT]", obj_count_string); 535 childSetVisible("prim_count", FALSE);
536 std::string prim_count_string; 536 childSetVisible("link_num", TRUE);
537 LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); 537
538 childSetTextArg("prim_count", "[COUNT]", prim_count_string); 538 std::string value_string = "";
539 LLViewerObject* selected = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
540 if (selected && selected->getRootEdit())
541 {
542 LLViewerObject::child_list_t children = selected->getRootEdit()->getChildren();
543 if (children.empty())
544 {
545 // An unlinked prim is "link 0".
546 value_string = "0";
547 }
548 else
549 {
550 children.push_front(selected->getRootEdit()); // need root in the list too
551 S32 index = 0;
552 for (LLViewerObject::child_list_t::iterator iter = children.begin(); iter != children.end(); ++iter)
553 {
554 index++;
555 if ((*iter)->isSelected())
556 {
557 LLResMgr::getInstance()->getIntegerString(value_string, index);
558 break;
559 }
560 }
561 }
562 }
563 childSetTextArg("link_num", "[NUMBER]", value_string);
564 }
565 else
566 {
567 // Refresh object and prim count labels
568 childSetVisible("obj_count", TRUE);
569 childSetVisible("prim_count", TRUE);
570 childSetVisible("link_num", FALSE);
571 LLLocale locale(LLLocale::USER_LOCALE);
572 std::string obj_count_string;
573 LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount());
574 childSetTextArg("obj_count", "[COUNT]", obj_count_string);
575 std::string prim_count_string;
576 LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount());
577 childSetTextArg("prim_count", "[COUNT]", prim_count_string);
578 }
539 579
540 updateToolsPrecision(); 580 updateToolsPrecision();
541 581
@@ -887,8 +927,15 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
887 childSetVisible("Strength:", land_visible); 927 childSetVisible("Strength:", land_visible);
888 } 928 }
889 929
890 childSetVisible("obj_count", !land_visible); 930 if (gSavedSettings.getBOOL("EditLinkedParts"))
891 childSetVisible("prim_count", !land_visible); 931 {
932 childSetVisible("link_num", !land_visible);
933 }
934 else
935 {
936 childSetVisible("obj_count", !land_visible);
937 childSetVisible("prim_count", !land_visible);
938 }
892 mTab->setVisible(!land_visible); 939 mTab->setVisible(!land_visible);
893 mPanelLandInfo->setVisible(land_visible); 940 mPanelLandInfo->setVisible(land_visible);
894} 941}