summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2011-09-01 19:01:46 +0300
committerPaul ProductEngine <pguslisty@productengine.com>2011-09-01 19:01:46 +0300
commit004de653aa3aa2702c7532d2ff5ce9838636d4ca (patch)
tree1e6d96cd211cd07d3bde219792c1416ab7e10dc2 /indra/newview
parent55c220779223682260c5299ec13c17d19bf6ca4e (diff)
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.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp42
-rw-r--r--indra/newview/llfloatermodelpreview.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_model_preview.xml16
3 files changed, 52 insertions, 8 deletions
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*) &param[i]);
}
+ else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(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*) &param[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...
</text>
<combo_box
follows="left|top"
@@ -305,10 +305,10 @@
name="physics_lod_combo"
width="130"
tool_tip="LOD to use for physics shape">
- <combo_item name="physics_lowest"> Lowest </combo_item>
- <combo_item name="physics_low"> Low </combo_item>
- <combo_item name="physics_medium"> Medium </combo_item>
<combo_item name="physics_high"> High </combo_item>
+ <combo_item name="physics_medium"> Medium </combo_item>
+ <combo_item name="physics_low"> Low </combo_item>
+ <combo_item name="physics_lowest"> Lowest </combo_item>
<combo_item name="load_from_file"> From file </combo_item>
</combo_box>
<line_editor
@@ -407,7 +407,7 @@
follows="top|left"
layout="topleft"
left_pad="15"
- name="Smooth"
+ name="Cosine%"
width="100"/>
<check_box
follows="top|left"
@@ -571,7 +571,7 @@
text_color="White"
top_pad="0"
name="results_text"
- width="60">
+ width="50">
Results:
</text>
<text
@@ -582,7 +582,7 @@
text_color="White"
top_delta="0"
name="physics_triangles"
- width="130">
+ width="90">
Triangles: [TRIANGLES],
</text>
<text
@@ -593,7 +593,7 @@
name="physics_points"
top_delta="0"
text_color="White"
- width="105">
+ width="85">
Vertices: [POINTS],
</text>
<text