From 566fbe751a4094db7c3d553d3866f0c057db18c9 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 2 Dec 2012 00:39:45 +0100 Subject: Changed line editors to spin controls for all material float parameters in the debug floater --- indra/newview/llfloaterdebugmaterials.cpp | 61 +--- indra/newview/llfloaterdebugmaterials.h | 20 +- .../default/xui/en/floater_debug_materials.xml | 326 +++++++-------------- 3 files changed, 138 insertions(+), 269 deletions(-) (limited to 'indra') 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("normal_map"); llassert(mNormalMap != NULL); - mNormalMapOffsetX = findChild("normal_map_offset_x"); + mNormalMapOffsetX = findChild("normal_map_offset_x"); llassert(mNormalMapOffsetX != NULL); - mNormalMapOffsetX->setPrevalidate(LLTextValidate::validateInt); - mNormalMapOffsetX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapOffsetY = findChild("normal_map_offset_y"); + mNormalMapOffsetY = findChild("normal_map_offset_y"); llassert(mNormalMapOffsetY != NULL); - mNormalMapOffsetY->setPrevalidate(LLTextValidate::validateInt); - mNormalMapOffsetY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRepeatX = findChild("normal_map_repeat_x"); + mNormalMapRepeatX = findChild("normal_map_repeat_x"); llassert(mNormalMapRepeatX != NULL); - mNormalMapRepeatX->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRepeatX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRepeatY = findChild("normal_map_repeat_y"); + mNormalMapRepeatY = findChild("normal_map_repeat_y"); llassert(mNormalMapRepeatY != NULL); - mNormalMapRepeatY->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRepeatY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mNormalMapRotation = findChild("normal_map_rotation"); + mNormalMapRotation = findChild("normal_map_rotation"); llassert(mNormalMapRotation != NULL); - mNormalMapRotation->setPrevalidate(LLTextValidate::validateInt); - mNormalMapRotation->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); mSpecularMap = findChild("specular_map"); llassert(mSpecularMap != NULL); - mSpecularMapOffsetX = findChild("specular_map_offset_x"); + mSpecularMapOffsetX = findChild("specular_map_offset_x"); llassert(mSpecularMapOffsetX != NULL); - mSpecularMapOffsetX->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapOffsetX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapOffsetY = findChild("specular_map_offset_y"); + mSpecularMapOffsetY = findChild("specular_map_offset_y"); llassert(mSpecularMapOffsetY != NULL); - mSpecularMapOffsetY->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapOffsetY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRepeatX = findChild("specular_map_repeat_x"); + mSpecularMapRepeatX = findChild("specular_map_repeat_x"); llassert(mSpecularMapRepeatX != NULL); - mSpecularMapRepeatX->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRepeatX->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRepeatY = findChild("specular_map_repeat_y"); + mSpecularMapRepeatY = findChild("specular_map_repeat_y"); llassert(mSpecularMapRepeatY != NULL); - mSpecularMapRepeatY->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRepeatY->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); - mSpecularMapRotation = findChild("specular_map_rotation"); + mSpecularMapRotation = findChild("specular_map_rotation"); llassert(mSpecularMapRotation != NULL); - mSpecularMapRotation->setPrevalidate(LLTextValidate::validateInt); - mSpecularMapRotation->setCommitCallback(boost::bind(&LLFloaterDebugMaterials::onValueEntered, this, _1)); mSpecularColor = findChild("specular_color"); llassert(mSpecularColor != NULL); @@ -1662,15 +1642,6 @@ std::string LLFloaterDebugMaterials::convertToPrintableMaterialID(const LLMateri template 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(mNormalMapOffsetX), getLineEditorValue(mNormalMapOffsetY)); - material.setNormalRepeat(getLineEditorValue(mNormalMapRepeatX), getLineEditorValue(mNormalMapRepeatY)); - material.setNormalRotation(getLineEditorValue(mNormalMapRotation)); + material.setNormalOffset(mNormalMapOffsetX->get(), mNormalMapOffsetY->get()); + material.setNormalRepeat(mNormalMapRepeatX->get(), mNormalMapRepeatY->get()); + material.setNormalRotation(mNormalMapRotation->get()); material.setSpecularID(mSpecularMap->getImageAssetID()); - material.setSpecularOffset(getLineEditorValue(mSpecularMapOffsetX), getLineEditorValue(mSpecularMapOffsetY)); - material.setSpecularRepeat(getLineEditorValue(mSpecularMapRepeatX), getLineEditorValue(mSpecularMapRepeatY)); - material.setSpecularRotation(getLineEditorValue(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" /> - - Normal Map Offset X - - - - Normal Map Offset Y - - + - - Normal Map Repeat X - - + - - Normal Map Repeat Y - - + - - Normal Map Rotation - - + + top_pad="10" + width="240" /> - - Specular Map Offset X - - - - Specular Map Offset Y - - + - - Specular Map Repeat X - - + - - Specular Map Repeat Y - - + - - Specular Map Rotation - - + + top_pad="10" + width="240" />