diff options
| author | Dave Parks <davep@lindenlab.com> | 2010-08-25 14:48:18 -0500 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2010-08-25 14:48:18 -0500 |
| commit | 2f012dd34f01b359c487c778cbf8842eb419e7c3 (patch) | |
| tree | 2682cf545422d6656a0635bc6a28cba1b797dc66 /indra/newview/llfloatertools.cpp | |
| parent | 6fbc79d5e861085375d776a4da4a5921650b3115 (diff) | |
| parent | 314a89535791e1e5a0c3f4d901c9c1d16fb9b6cc (diff) | |
merge
Diffstat (limited to 'indra/newview/llfloatertools.cpp')
| -rw-r--r-- | indra/newview/llfloatertools.cpp | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 0988588d9c..5472531fa7 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -419,14 +419,38 @@ void LLFloaterTools::refresh() // Refresh object and prim count labels LLLocale locale(LLLocale::USER_LOCALE); - std::string obj_count_string; - LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - getChild<LLUICtrl>("obj_count")->setTextArg("[COUNT]", obj_count_string); - std::string prim_count_string; - LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - getChild<LLUICtrl>("prim_count")->setTextArg("[COUNT]", prim_count_string); - - // calculate selection rendering cost + + // Get the number of objects selected + std::string root_object_count_string; + std::string object_count_string; + + LLResMgr::getInstance()->getIntegerString( + root_object_count_string, + LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); + LLResMgr::getInstance()->getIntegerString( + object_count_string, + LLSelectMgr::getInstance()->getSelection()->getObjectCount()); + + F32 obj_cost = + LLSelectMgr::getInstance()->getSelection()->getSelectedObjectCost(); + F32 link_cost = + LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); + + // Update the text for the counts + childSetTextArg( + "linked_set_count", + "[COUNT]", + root_object_count_string); + childSetTextArg("object_count", "[COUNT]", object_count_string); + + // Update the text for the resource costs + childSetTextArg( + "linked_set_cost", + "[COST]", + llformat("%.1f", link_cost)); + childSetTextArg("object_cost", "[COST]", llformat("%.1f", obj_cost)); + + // Display rendering cost if needed if (sShowObjectCost) { std::string prim_cost_string; @@ -437,9 +461,10 @@ void LLFloaterTools::refresh() // disable the object and prim counts if nothing selected bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); - getChildView("obj_count")->setEnabled(have_selection); - getChildView("prim_count")->setEnabled(have_selection); - getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); + childSetEnabled("linked_set_count", have_selection); + childSetEnabled("object_count", have_selection); + childSetEnabled("linked_set_cost", have_selection); + childSetEnabled("object_cost", have_selection); // Refresh child tabs mPanelPermissions->refresh(); |
