diff options
author | McCabe Maxsted | 2010-10-17 01:27:33 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-10-17 01:27:33 -0700 |
commit | 0e5448aea1753e89de0c411f159f5e8f664418c1 (patch) | |
tree | 8c9906731fe0b5bae6f5bf9c0225e0ed18070a30 /linden | |
parent | Ported fix for Apply button not working correctly when changing show group in... (diff) | |
download | meta-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 '')
-rw-r--r-- | linden/indra/newview/llfloatertools.cpp | 67 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_tools.xml | 6 |
2 files changed, 63 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 | } |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml index 0cb4a59..309ce70 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml | |||
@@ -321,6 +321,12 @@ | |||
321 | mouse_opaque="true" name="prim_count" v_pad="0" width="143"> | 321 | mouse_opaque="true" name="prim_count" v_pad="0" width="143"> |
322 | Primitives: [COUNT] | 322 | Primitives: [COUNT] |
323 | </text> | 323 | </text> |
324 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
325 | bottom="-168" left="118" drop_shadow_visible="true" follows="left|top" | ||
326 | font="SansSerifSmall" h_pad="0" halign="right" height="16" | ||
327 | mouse_opaque="true" name="link_num" v_pad="0" width="143"> | ||
328 | Link number: [NUMBER] | ||
329 | </text> | ||
324 | 330 | ||
325 | <!-- Sub-tabs --> | 331 | <!-- Sub-tabs --> |
326 | 332 | ||