diff options
author | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-02 17:14:07 +0300 |
---|---|---|
committer | Paul ProductEngine <pguslisty@productengine.com> | 2011-09-02 17:14:07 +0300 |
commit | 5da2d4c85370ebe1a14ecbebd8e5df7965e9d02e (patch) | |
tree | 73311ca98cbcf00176e3678052c0437d8d182805 /indra | |
parent | 004de653aa3aa2702c7532d2ff5ce9838636d4ca (diff) |
SH-2309 WIP Priority modifications to mesh uploader UI
- Changed representation of Retain% control values
- Added "Choose one..." item to the LOD combo_box
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 24 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_model_preview.xml | 2 |
2 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 362a40632a..2d18c2bb24 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -119,6 +119,7 @@ const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PRE const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE; const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16; const S32 PREVIEW_TEXTURE_HEIGHT = 300; +const double RETAIN_COEFFICIENT = 100; void drawBoxOutline(const LLVector3& pos, const LLVector3& size); @@ -907,7 +908,15 @@ void LLFloaterModelPreview::onPhysicsParamCommit(LLUICtrl* ctrl, void* data) { LLCDParam* param = (LLCDParam*) data; std::string name(param->mName); - sInstance->mDecompParams[name] = ctrl->getValue(); + + LLSD value = ctrl->getValue(); + + if("Retain%" == name) + { + value = ctrl->getValue().asReal() / RETAIN_COEFFICIENT; + } + + sInstance->mDecompParams[name] = value; if (name == "Simplify Method") { @@ -980,7 +989,7 @@ void LLFloaterModelPreview::onPhysicsBrowse(LLUICtrl* ctrl, void* userdata) //static void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata) { - S32 num_modes = 3; + S32 num_modes = 4; S32 which_mode = 3; static S32 previous_mode = which_mode; @@ -1115,10 +1124,13 @@ void LLFloaterModelPreview::initDecompControls() } else if (LLSpinCtrl* spinner = dynamic_cast<LLSpinCtrl*>(ctrl)) { - spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat); - spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat); - spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat); - spinner->setValue(param[i].mDefault.mFloat); + bool is_retain_ctrl = "Retain%" == name; + double coefficient = is_retain_ctrl ? RETAIN_COEFFICIENT : 1.f; + + spinner->setMinValue(param[i].mDetails.mRange.mLow.mFloat * coefficient); + spinner->setMaxValue(param[i].mDetails.mRange.mHigh.mFloat * coefficient); + spinner->setIncrement(param[i].mDetails.mRange.mDelta.mFloat * coefficient); + spinner->setValue(param[i].mDefault.mFloat * coefficient); spinner->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); } else if (LLComboBox* combo_box = dynamic_cast<LLComboBox*>(ctrl)) 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 d613e42786..39ef844824 100755 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -305,6 +305,7 @@ name="physics_lod_combo" width="130" tool_tip="LOD to use for physics shape"> + <combo_item name="choose_one"> Choose one... </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> @@ -521,6 +522,7 @@ width="60"/> <spinner name="Retain%" + decimal_digits="0" width="60" follows="top|left" height="20" |