Changed line editors to spin controls for all material float parameters in the debug floater

meow-7.2.2
Kitty Barnett 2012-12-02 00:39:45 +01:00
parent fd3af97a01
commit 566fbe751a
3 changed files with 138 additions and 269 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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"
<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="-260"
top_pad="10"
width="160">
Normal Map Offset X
</text>
<line_editor
border_style="line"
border_thickness="1"
default_text="0"
follows="left|top"
height="20"
layout="topleft"
left_pad="0"
top_pad="-18"
max_length_chars="255"
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"
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="-240"
label="Normal Map Offset Y"
max_val="1.0"
min_val="-1.0"
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"
layout="topleft"
left_pad="-240"
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"
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="-240"
label="Normal Map Repeat X"
max_val="64"
min_val="0.0"
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"
layout="topleft"
left_pad="-240"
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"
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="-240"
max_val="64"
min_val="0.0"
label="Normal Map Repeat Y"
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"
layout="topleft"
left_pad="-240"
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"
<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="-260"
top_pad="10"
width="160">
Specular Map Offset X
</text>
<line_editor
border_style="line"
border_thickness="1"
default_text="0"
follows="left|top"
height="20"
layout="topleft"
left_pad="0"
top_pad="-18"
max_length_chars="255"
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"
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="-240"
label="Specular Map Offset Y"
max_val="1.0"
min_val="-1.0"
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"
layout="topleft"
left_pad="-240"
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"
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="-240"
label="Specular Map Repeat X"
max_val="64"
min_val="0.0"
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"
layout="topleft"
left_pad="-240"
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"
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="-240"
label="Specular Map Repeat Y"
max_val="64"
min_val="0.0"
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"
layout="topleft"
left_pad="-240"
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"