diff options
author | Kitty Barnett <develop@catznip.com> | 2012-12-02 00:39:45 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2012-12-02 00:39:45 +0100 |
commit | 566fbe751a4094db7c3d553d3866f0c057db18c9 (patch) | |
tree | 93d02c6e9660dc82f56644fc068d2ec53e5988f5 /indra | |
parent | fd3af97a01ef5ed6c07fb0eef9e705f01725a95a (diff) |
Changed line editors to spin controls for all material float parameters in the debug floater
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.cpp | 61 | ||||
-rw-r--r-- | indra/newview/llfloaterdebugmaterials.h | 20 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_debug_materials.xml | 326 |
3 files changed, 138 insertions, 269 deletions
diff --git a/indra/newview/llfloaterdebugmaterials.cpp b/indra/newview/llfloaterdebugmaterials.cpp index c23a5a6426..e86777bfe0 100644 --- a/indra/newview/llfloaterdebugmaterials.cpp +++ b/indra/newview/llfloaterdebugmaterials.cpp @@ -159,58 +159,38 @@ BOOL LLFloaterDebugMaterials::postBuild() mNormalMap = findChild<LLTextureCtrl>("normal_map"); llassert(mNormalMap != NULL); - mNormalMapOffsetX = findChild<LLLineEditor>("normal_map_offset_x"); + mNormalMapOffsetX = findChild<LLSpinCtrl>("normal_map_offset_x"); llassert(mNormalMapOffsetX != NULL); - mNormalMapOffsetX->setPrevalidate(LLTextValidate::validateInt); - mNormalMapOffsetX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapOffsetY = findChild<LLLineEditor>("normal_map_offset_y"); + mNormalMapOffsetY = findChild<LLSpinCtrl>("normal_map_offset_y"); llassert(mNormalMapOffsetY != NULL); - mNormalMapOffsetY->setPrevalidate(LLTextValidate::validateInt); - mNormalMapOffsetY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRepeatX = findChild<LLLineEditor>("normal_map_repeat_x"); + mNormalMapRepeatX = findChild<LLSpinCtrl>("normal_map_repeat_x"); llassert(mNormalMapRepeatX != NULL); - mNormalMapRepeatX->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRepeatX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRepeatY = findChild<LLLineEditor>("normal_map_repeat_y"); + mNormalMapRepeatY = findChild<LLSpinCtrl>("normal_map_repeat_y"); llassert(mNormalMapRepeatY != NULL); - mNormalMapRepeatY->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRepeatY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRotation = findChild<LLLineEditor>("normal_map_rotation"); + mNormalMapRotation = findChild<LLSpinCtrl>("normal_map_rotation"); llassert(mNormalMapRotation != NULL); - mNormalMapRotation->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRotation->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); mSpecularMap = findChild<LLTextureCtrl>("specular_map"); llassert(mSpecularMap != NULL); - mSpecularMapOffsetX = findChild<LLLineEditor>("specular_map_offset_x"); + mSpecularMapOffsetX = findChild<LLSpinCtrl>("specular_map_offset_x"); llassert(mSpecularMapOffsetX != NULL); - mSpecularMapOffsetX->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapOffsetX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapOffsetY = findChild<LLLineEditor>("specular_map_offset_y"); + mSpecularMapOffsetY = findChild<LLSpinCtrl>("specular_map_offset_y"); llassert(mSpecularMapOffsetY != NULL); - mSpecularMapOffsetY->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapOffsetY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRepeatX = findChild<LLLineEditor>("specular_map_repeat_x"); + mSpecularMapRepeatX = findChild<LLSpinCtrl>("specular_map_repeat_x"); llassert(mSpecularMapRepeatX != NULL); - mSpecularMapRepeatX->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRepeatX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRepeatY = findChild<LLLineEditor>("specular_map_repeat_y"); + mSpecularMapRepeatY = findChild<LLSpinCtrl>("specular_map_repeat_y"); llassert(mSpecularMapRepeatY != NULL); - mSpecularMapRepeatY->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRepeatY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRotation = findChild<LLLineEditor>("specular_map_rotation"); + mSpecularMapRotation = findChild<LLSpinCtrl>("specular_map_rotation"); llassert(mSpecularMapRotation != NULL); - mSpecularMapRotation->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRotation->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); mSpecularColor = findChild<LLColorSwatchCtrl>("specular_color"); llassert(mSpecularColor != NULL); @@ -1662,15 +1642,6 @@ std::string LLFloaterDebugMaterials::convertToPrintableMaterialID(const LLMateri template<typename T> T getLineEditorValue(const LLLineEditor *pLineEditor); -template<> F32 getLineEditorValue(const LLLineEditor *pLineEditor) -{ - F32 value = 0; - - LLStringUtil::convertToF32(pLineEditor->getText(), value); - - return value; -} - template<> U8 getLineEditorValue(const LLLineEditor *pLineEditor) { U8 value = 0; @@ -1685,14 +1656,14 @@ LLMaterial LLFloaterDebugMaterials::getMaterial() const LLMaterial material; material.setNormalID(mNormalMap->getImageAssetID()); - material.setNormalOffset(getLineEditorValue<F32>(mNormalMapOffsetX), getLineEditorValue<F32>(mNormalMapOffsetY)); - material.setNormalRepeat(getLineEditorValue<F32>(mNormalMapRepeatX), getLineEditorValue<F32>(mNormalMapRepeatY)); - material.setNormalRotation(getLineEditorValue<F32>(mNormalMapRotation)); + material.setNormalOffset(mNormalMapOffsetX->get(), mNormalMapOffsetY->get()); + material.setNormalRepeat(mNormalMapRepeatX->get(), mNormalMapRepeatY->get()); + material.setNormalRotation(mNormalMapRotation->get()); material.setSpecularID(mSpecularMap->getImageAssetID()); - material.setSpecularOffset(getLineEditorValue<F32>(mSpecularMapOffsetX), getLineEditorValue<F32>(mSpecularMapOffsetY)); - material.setSpecularRepeat(getLineEditorValue<F32>(mSpecularMapRepeatX), getLineEditorValue<F32>(mSpecularMapRepeatY)); - material.setSpecularRotation(getLineEditorValue<F32>(mSpecularMapRotation)); + material.setSpecularOffset(mSpecularMapOffsetX->get(), mSpecularMapOffsetY->get()); + material.setSpecularRepeat(mSpecularMapRepeatX->get(), mSpecularMapRepeatY->get()); + material.setSpecularRotation(mSpecularMapRotation->get()); const LLColor4& specularColor = mSpecularColor->get(); LLColor4U specularColor4U = specularColor; diff --git a/indra/newview/llfloaterdebugmaterials.h b/indra/newview/llfloaterdebugmaterials.h index 7fc077dd34..0643d7a252 100644 --- a/indra/newview/llfloaterdebugmaterials.h +++ b/indra/newview/llfloaterdebugmaterials.h @@ -146,17 +146,17 @@ private: LLScrollListCtrl* mGetSpecularMapScrollList; LLScrollListCtrl* mGetOtherDataScrollList; LLTextureCtrl* mNormalMap; - LLLineEditor* mNormalMapOffsetX; - LLLineEditor* mNormalMapOffsetY; - LLLineEditor* mNormalMapRepeatX; - LLLineEditor* mNormalMapRepeatY; - LLLineEditor* mNormalMapRotation; + LLSpinCtrl* mNormalMapOffsetX; + LLSpinCtrl* mNormalMapOffsetY; + LLSpinCtrl* mNormalMapRepeatX; + LLSpinCtrl* mNormalMapRepeatY; + LLSpinCtrl* mNormalMapRotation; LLTextureCtrl* mSpecularMap; - LLLineEditor* mSpecularMapOffsetX; - LLLineEditor* mSpecularMapOffsetY; - LLLineEditor* mSpecularMapRepeatX; - LLLineEditor* mSpecularMapRepeatY; - LLLineEditor* mSpecularMapRotation; + LLSpinCtrl* mSpecularMapOffsetX; + LLSpinCtrl* mSpecularMapOffsetY; + LLSpinCtrl* mSpecularMapRepeatX; + LLSpinCtrl* mSpecularMapRepeatY; + LLSpinCtrl* mSpecularMapRotation; LLColorSwatchCtrl* mSpecularColor; LLSpinCtrl* mSpecularColorAlpha; LLLineEditor* mSpecularExponent; diff --git a/indra/newview/skins/default/xui/en/floater_debug_materials.xml b/indra/newview/skins/default/xui/en/floater_debug_materials.xml index afa93c3618..b6c105e19a 100644 --- a/indra/newview/skins/default/xui/en/floater_debug_materials.xml +++ b/indra/newview/skins/default/xui/en/floater_debug_materials.xml @@ -302,136 +302,85 @@ mouse_opaque="true" name="normal_map" tool_tip="Click to open texture picker" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="-260" - top_pad="10" - width="160"> - Normal Map Offset X - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + <spinner + allow_text_entry="true" follows="left|top" height="20" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" + left_pad="-260" + label="Normal Map Offset X" + max_val="1.0" + min_val="-1.0" name="normal_map_offset_x" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="-240" - top_pad="10" - width="160"> - Normal Map Offset Y - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="normal_map_offset_y" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + label="Normal Map Offset Y" + max_val="1.0" + min_val="-1.0" + name="normal_map_offset_y" top_pad="10" - width="160"> - Normal Map Repeat X - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="normal_map_repeat_x" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + label="Normal Map Repeat X" + max_val="64" + min_val="0.0" + name="normal_map_repeat_x" top_pad="10" - width="160"> - Normal Map Repeat Y - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="normal_map_repeat_y" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + max_val="64" + min_val="0.0" + label="Normal Map Repeat Y" + name="normal_map_repeat_y" top_pad="10" - width="160"> - Normal Map Rotation - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" + initial_value="0" + increment="1" + decimal_digits="4" + label_width="160" layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" + left_pad="-240" + label="Normal Map Rotation" + max_val="9999" + min_val="-9999" name="normal_map_rotation" - width="80" /> + top_pad="10" + width="240" /> </panel> <panel border="false" @@ -469,136 +418,85 @@ mouse_opaque="true" name="specular_map" tool_tip="Click to open texture picker" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="-260" - top_pad="10" - width="160"> - Specular Map Offset X - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + <spinner + allow_text_entry="true" follows="left|top" height="20" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" + left_pad="-260" + label="Specular Map Offset X" + max_val="1.0" + min_val="-1.0" name="specular_map_offset_x" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" - layout="topleft" - left_pad="-240" - top_pad="10" - width="160"> - Specular Map Offset Y - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="specular_map_offset_y" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + label="Specular Map Offset Y" + max_val="1.0" + min_val="-1.0" + name="specular_map_offset_y" top_pad="10" - width="160"> - Specular Map Repeat X - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="specular_map_repeat_x" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + label="Specular Map Repeat X" + max_val="64" + min_val="0.0" + name="specular_map_repeat_x" top_pad="10" - width="160"> - Specular Map Repeat Y - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" - layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" - name="specular_map_repeat_y" - width="80" /> - <text - height="13" - word_wrap="false" - use_ellipses="false" - type="string" - text_color="LabelTextColor" - length="1" - follows="left|top" + initial_value="0" + increment="0.1" + decimal_digits="4" + label_width="160" layout="topleft" left_pad="-240" + label="Specular Map Repeat Y" + max_val="64" + min_val="0.0" + name="specular_map_repeat_y" top_pad="10" - width="160"> - Specular Map Rotation - </text> - <line_editor - border_style="line" - border_thickness="1" - default_text="0" + width="240" /> + <spinner + allow_text_entry="true" follows="left|top" height="20" + initial_value="0" + increment="1" + decimal_digits="4" + label_width="160" layout="topleft" - left_pad="0" - top_pad="-18" - max_length_chars="255" + left_pad="-240" + label="Specular Map Rotation" + max_val="9999" + min_val="-9999" name="specular_map_rotation" - width="80" /> + top_pad="10" + width="240" /> </panel> <panel border="false" |