From 9afc77ba0affee16d9dbee312417aaef541eabba Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 21 Jun 2011 21:00:06 +0300 Subject: SH-1719 FIXED Viewer side cleanup of presentation of accounting data in build tools - Moved grid mode combo box to the grid options floater - Updated UI of the build floater according to the spec - Fixed "conflict" between LLFloaterOpenHandler and LLFloaterHandler command handlers --- indra/newview/llfloatertools.cpp | 142 +++++++++++++-------------------------- 1 file changed, 48 insertions(+), 94 deletions(-) (limited to 'indra/newview/llfloatertools.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 0d798afdcc..3e98cff9e6 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -36,7 +36,6 @@ #include "llagentcamera.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llcombobox.h" #include "lldraghandle.h" #include "llerror.h" #include "llfloaterbuildoptions.h" @@ -101,6 +100,7 @@ const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] = std::string("Content"), // PANEL_CONTENTS, }; + // Local prototypes void commit_select_component(void *data); void click_show_more(void*); @@ -116,7 +116,6 @@ void commit_radio_group_focus(LLUICtrl* ctrl); void commit_radio_group_move(LLUICtrl* ctrl); void commit_radio_group_edit(LLUICtrl* ctrl); void commit_radio_group_land(LLUICtrl* ctrl); -void commit_grid_mode(LLUICtrl *); void commit_slider_zoom(LLUICtrl *ctrl); @@ -234,7 +233,6 @@ BOOL LLFloaterTools::postBuild() getChild("checkbox uniform")->setValue((BOOL)gSavedSettings.getBOOL("ScaleUniform")); mCheckStretchTexture = getChild("checkbox stretch textures"); getChild("checkbox stretch textures")->setValue((BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); - mComboGridMode = getChild("combobox grid mode"); mCheckStretchUniformLabel = getChild("checkbox uniform label"); // @@ -269,6 +267,8 @@ BOOL LLFloaterTools::postBuild() // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here getChild("slider force")->setValue(log10(gSavedSettings.getF32("LandBrushForce"))); + mCostTextBorder = getChild("cost_text_border"); + mTab = getChild("Object Info Tabs"); if(mTab) { @@ -311,7 +311,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCheckSnapToGrid(NULL), mBtnGridOptions(NULL), mTitleMedia(NULL), - mComboGridMode(NULL), mCheckStretchUniform(NULL), mCheckStretchTexture(NULL), mCheckStretchUniformLabel(NULL), @@ -344,6 +343,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mPanelFace(NULL), mPanelLandInfo(NULL), + mCostTextBorder(NULL), mTabLand(NULL), mDirty(TRUE), mNeedMediaTitle(TRUE) @@ -367,7 +367,6 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCommitCallbackRegistrar.add("BuildTool.selectComponent", boost::bind(&commit_select_component, this)); mCommitCallbackRegistrar.add("BuildTool.gridOptions", boost::bind(&LLFloaterTools::onClickGridOptions,this)); mCommitCallbackRegistrar.add("BuildTool.applyToSelection", boost::bind(&click_apply_to_selection, this)); - mCommitCallbackRegistrar.add("BuildTool.gridMode", boost::bind(&commit_grid_mode,_1)); mCommitCallbackRegistrar.add("BuildTool.commitRadioLand", boost::bind(&commit_radio_group_land,_1)); mCommitCallbackRegistrar.add("BuildTool.LandBrushForce", boost::bind(&commit_slider_dozer_force,_1)); mCommitCallbackRegistrar.add("BuildTool.AddMedia", boost::bind(&LLFloaterTools::onClickBtnAddMedia,this)); @@ -429,10 +428,10 @@ void LLFloaterTools::refresh() { std::string obj_count_string; LLResMgr::getInstance()->getIntegerString(obj_count_string, LLSelectMgr::getInstance()->getSelection()->getRootObjectCount()); - getChild("obj_count")->setTextArg("[COUNT]", obj_count_string); + getChild("selection_count")->setTextArg("[OBJ_COUNT]", obj_count_string); std::string prim_count_string; LLResMgr::getInstance()->getIntegerString(prim_count_string, LLSelectMgr::getInstance()->getSelection()->getObjectCount()); - getChild("prim_count")->setTextArg("[COUNT]", prim_count_string); + getChild("selection_count")->setTextArg("[PRIM_COUNT]", prim_count_string); // calculate selection rendering cost if (sShowObjectCost) @@ -451,55 +450,46 @@ void LLFloaterTools::refresh() else #endif { - // 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(); - F32 obj_physics_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedPhysicsCost(); - F32 link_physics_cost = - LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); - - // 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)); - childSetTextArg("linked_set_cost","[PHYSICS]",llformat("%.1f", link_physics_cost)); - childSetTextArg("object_cost", "[PHYSICS]", llformat("%.1f", obj_physics_cost)); - - // Display rendering cost if needed - if (sShowObjectCost) + F32 link_phys_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); + F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); + S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); + + LLStringUtil::format_map_t args; + args["OBJ_COUNT"] = llformat("%.1d", link_count); + args["PRIM_COUNT"] = llformat("%.1d", prim_count); + + std::ostringstream selection_info; + selection_info << getString("status_selectcount", args); + + bool show_prim_equiv = (link_cost != prim_count) && link_cost; + bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"); + bool show_mesh_cost = gMeshRepo.meshRezEnabled(); + + if (show_prim_equiv && show_mesh_cost) { - std::string prim_cost_string; - LLResMgr::getInstance()->getIntegerString(prim_cost_string, calcRenderCost()); - getChild("RenderingCost")->setTextArg("[COUNT]", prim_cost_string); + selection_info << ": "; + args["SEL_WEIGHT"] = llformat("%.1f", link_cost); + selection_info << getString("status_selectprimequiv", args); } + if (show_adv_weight) + { + show_prim_equiv ? (selection_info << ",") : (selection_info << "."); - // disable the object and prim counts if nothing selected - bool have_selection = ! LLSelectMgr::getInstance()->getSelection()->isEmpty(); - childSetEnabled("linked_set_count", have_selection); - childSetEnabled("object_count", have_selection); - childSetEnabled("linked_set_cost", have_selection); - childSetEnabled("object_cost", have_selection); - getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); + childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost)); + childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost())); + } + else + { + selection_info<<"."; + } + getChild("selection_count")->setText(selection_info.str()); + + bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty(); + childSetVisible("selection_count", have_selection); + childSetVisible("selection_weight", have_selection && show_adv_weight); + childSetVisible("selection_empty", !have_selection); } @@ -664,33 +654,6 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) mRadioGroupEdit->setValue("radio select face"); } - if (mComboGridMode) - { - mComboGridMode->setVisible( edit_visible ); - S32 index = mComboGridMode->getCurrentIndex(); - mComboGridMode->removeall(); - - switch (mObjectSelection->getSelectType()) - { - case SELECT_TYPE_HUD: - mComboGridMode->add(getString("grid_screen_text")); - mComboGridMode->add(getString("grid_local_text")); - //mComboGridMode->add(getString("grid_reference_text")); - break; - case SELECT_TYPE_WORLD: - mComboGridMode->add(getString("grid_world_text")); - mComboGridMode->add(getString("grid_local_text")); - mComboGridMode->add(getString("grid_reference_text")); - break; - case SELECT_TYPE_ATTACHMENT: - mComboGridMode->add(getString("grid_attachment_text")); - mComboGridMode->add(getString("grid_local_text")); - mComboGridMode->add(getString("grid_reference_text")); - break; - } - - mComboGridMode->setCurrentByIndex(index); - } // Snap to grid disabled for grab tool - very confusing if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); @@ -739,6 +702,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) // Land buttons BOOL land_visible = (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance() ); + mCostTextBorder->setVisible(!land_visible); + if (mBtnLand) mBtnLand ->setToggleState( land_visible ); mRadioGroupLand->setVisible( land_visible ); @@ -791,15 +756,11 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) getChildView("Strength:")->setVisible( land_visible); } - bool show_mesh_cost = gMeshRepo.meshRezEnabled(); + bool have_selection = !LLSelectMgr::getInstance()->getSelection()->isEmpty(); - getChildView("obj_count")->setVisible( !land_visible && !show_mesh_cost); - getChildView("prim_count")->setVisible( !land_visible && !show_mesh_cost); - getChildView("linked_set_count")->setVisible( !land_visible && show_mesh_cost); - getChildView("linked_set_cost")->setVisible( !land_visible && show_mesh_cost); - getChildView("object_count")->setVisible( !land_visible && show_mesh_cost); - getChildView("object_cost")->setVisible( !land_visible && show_mesh_cost); - getChildView("RenderingCost")->setVisible( !land_visible && sShowObjectCost); + getChildView("selection_count")->setVisible(!land_visible && have_selection); + getChildView("selection_weight")->setVisible(!land_visible && have_selection && gSavedSettings.getBOOL("ShowAdvancedBuilderOptions")); + getChildView("selection_empty")->setVisible(!land_visible && !have_selection); mTab->setVisible(!land_visible); mPanelLandInfo->setVisible(land_visible); @@ -1032,13 +993,6 @@ void commit_select_component(void *data) } } -void commit_grid_mode(LLUICtrl *ctrl) -{ - LLComboBox* combo = (LLComboBox*)ctrl; - - LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex()); -} - // static void LLFloaterTools::setObjectType( LLPCode pcode ) { -- cgit v1.2.3 From 41f3080d93c0a6efdf415981a2f168bbc55dd73a Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 28 Jun 2011 15:36:26 -0400 Subject: SH-1917 SH-1935 FIX PE cost is not always shown, includes unnecessary digits Reformatted line showing prim equiv values, formatted to an integer, removed old Render Cost display, and updated label of new display. --- indra/newview/llfloatertools.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloatertools.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 3e98cff9e6..1b6feddb6c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -455,27 +455,31 @@ void LLFloaterTools::refresh() S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); S32 link_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); - LLStringUtil::format_map_t args; - args["OBJ_COUNT"] = llformat("%.1d", link_count); - args["PRIM_COUNT"] = llformat("%.1d", prim_count); + LLStringUtil::format_map_t selection_args; + selection_args["OBJ_COUNT"] = llformat("%.1d", link_count); + selection_args["PRIM_COUNT"] = llformat("%.1d", prim_count); std::ostringstream selection_info; - selection_info << getString("status_selectcount", args); - bool show_prim_equiv = (link_cost != prim_count) && link_cost; bool show_adv_weight = gSavedSettings.getBOOL("ShowAdvancedBuilderOptions"); bool show_mesh_cost = gMeshRepo.meshRezEnabled(); - if (show_prim_equiv && show_mesh_cost) + if (show_mesh_cost) { - selection_info << ": "; - args["SEL_WEIGHT"] = llformat("%.1f", link_cost); - selection_info << getString("status_selectprimequiv", args); + LLStringUtil::format_map_t prim_equiv_args; + prim_equiv_args["SEL_WEIGHT"] = llformat("%.1d", (S32)link_cost); + selection_args["PE_STRING"] = getString("status_selectprimequiv", prim_equiv_args); } + else + { + selection_args["PE_STRING"] = ""; + } + + selection_info << getString("status_selectcount", selection_args); if (show_adv_weight) { - show_prim_equiv ? (selection_info << ",") : (selection_info << "."); + selection_info << ","; childSetTextArg("selection_weight", "[PHYS_WEIGHT]", llformat("%.1f", link_phys_cost)); childSetTextArg("selection_weight", "[DISP_WEIGHT]", llformat("%.1d", calcRenderCost())); -- cgit v1.2.3 From 5d25338ed0a8580be43f86ff07d777f21d1147e8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 12 Jul 2011 14:42:56 -0600 Subject: fix for SH-2040: Missing '?: 0' and old style object/prim counts under Edit linked when Mesh disabled --- indra/newview/llfloatertools.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatertools.cpp') diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index dc71ade621..84fb8bd9e7 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -422,7 +422,7 @@ void LLFloaterTools::refresh() // Refresh object and prim count labels LLLocale locale(LLLocale::USER_LOCALE); - +#if 0 if (!gMeshRepo.meshRezEnabled()) { std::string obj_count_string; @@ -447,6 +447,7 @@ void LLFloaterTools::refresh() getChildView("RenderingCost")->setEnabled(have_selection && sShowObjectCost); } else +#endif { F32 link_phys_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetPhysicsCost(); F32 link_cost = LLSelectMgr::getInstance()->getSelection()->getSelectedLinksetCost(); -- cgit v1.2.3