From 004de653aa3aa2702c7532d2ff5ce9838636d4ca Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Thu, 1 Sep 2011 19:01:46 +0300 Subject: SH-2309 WIP Priority modifications to mesh uploader UI - Bind "Cosine%" param with "Smooth" combo box. - Corrected some wording. - Little UI polish. Line with results in Physics tab. - Changed ordering of LOD combo box items. --- indra/newview/llfloatermodelpreview.cpp | 42 ++++++++++++++++++++++ indra/newview/llfloatermodelpreview.h | 2 ++ .../skins/default/xui/en/floater_model_preview.xml | 16 ++++----- 3 files changed, 52 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 276f513abf..362a40632a 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -980,6 +980,7 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata) //static void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { + S32 num_modes = 3; S32 which_mode = 3; static S32 previous_mode = which_mode; @@ -996,6 +997,7 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) if (!lod_to_file) { + which_mode = num_modes - which_mode; sInstance->mModelPreview->setPhysicsFromLOD(which_mode); } @@ -1119,6 +1121,29 @@ void LLFloaterModelPreview::initDecompControls() spinner->setValue(param[i].mDefault.mFloat); spinner->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); } + else if (LLComboBox* combo_box = dynamic_cast(ctrl)) + { + float min = param[i].mDetails.mRange.mLow.mFloat; + float max = param[i].mDetails.mRange.mHigh.mFloat; + float delta = param[i].mDetails.mRange.mDelta.mFloat; + + if ("Cosine%" == name) + { + createSmoothComboBox(combo_box, min, max); + } + else + { + for(float value = min; value <= max; value += delta) + { + std::string label = llformat("%.1f", value); + combo_box->add(label, value, ADD_BOTTOM, true); + } + combo_box->setValue(param[i].mDefault.mFloat); + + } + + combo_box->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); + } } else if (param[i].mType == LLCDParam::LLCD_INTEGER) { @@ -1192,6 +1217,23 @@ void LLFloaterModelPreview::initDecompControls() childSetCommitCallback("physics_explode", LLFloaterModelPreview::onExplodeCommit, this); } +void LLFloaterModelPreview::createSmoothComboBox(LLComboBox* combo_box, float min, float max) +{ + float combo_list_size = 10; + float delta = (max - min) / combo_list_size; + int ilabel = 0; + + combo_box->add("0 (none)", ADD_BOTTOM, true); + + for(float value = min + delta; value < max; value += delta) + { + std::string label = (++ilabel == combo_list_size) ? "10 (max)" : llformat("%.1d", ilabel); + combo_box->add(label, value, ADD_BOTTOM, true); + } + + +} + //----------------------------------------------------------------------------- // onMouseCaptureLost() //----------------------------------------------------------------------------- diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index a8fd02443e..f93d3b9482 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -281,6 +281,8 @@ private: // resets display options of model preview to their defaults. void resetDisplayOptions(); + void createSmoothComboBox(LLComboBox* combo_box, float min, float max); + LLButton* mUploadBtn; LLButton* mCalculateBtn; }; diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index ac3978938a..d613e42786 100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -70,7 +70,7 @@ text_color="White" top="0" width="200"> - This model represent... + This model represents... - Lowest - Low - Medium High + Medium + Low + Lowest From file + width="50"> Results: + width="90"> Triangles: [TRIANGLES], + width="85"> Vertices: [POINTS],