Skip to content
Snippets Groups Projects
Commit edbc980d authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix findChild abuse in new debug settings floater

parent ef93c962
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,18 @@ BOOL LLFloaterSettingsDebug::postBuild()
{
enableResizeCtrls(true, false, true);
mValSpinner1 = getChild<LLSpinCtrl>("val_spinner_1");
mValSpinner2 = getChild<LLSpinCtrl>("val_spinner_2");
mValSpinner3 = getChild<LLSpinCtrl>("val_spinner_3");
mValSpinner4 = getChild<LLSpinCtrl>("val_spinner_4");
mBooleanCombo = getChild<LLUICtrl>("boolean_combo");
mValText = getChild<LLUICtrl>("val_text");
mColorSwatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
mDefaultButton = getChild<LLUICtrl>("default_btn");
mSettingNameText = getChild<LLTextBox>("setting_name_txt");
mComment = getChild<LLTextEditor>("comment_text");
getChild<LLFilterEditor>("filter_input")->setCommitCallback(boost::bind(&LLFloaterSettingsDebug::setSearchFilter, this, _2));
......@@ -109,67 +121,67 @@ void LLFloaterSettingsDebug::onCommitSettings()
switch(controlp->type())
{
case TYPE_U32:
controlp->set(getChild<LLUICtrl>("val_spinner_1")->getValue());
controlp->set(mValSpinner1->getValue());
break;
case TYPE_S32:
controlp->set(getChild<LLUICtrl>("val_spinner_1")->getValue());
controlp->set(mValSpinner1->getValue());
break;
case TYPE_F32:
controlp->set(LLSD(getChild<LLUICtrl>("val_spinner_1")->getValue().asReal()));
controlp->set(LLSD(mValSpinner1->getValue().asReal()));
break;
case TYPE_BOOLEAN:
controlp->set(getChild<LLUICtrl>("boolean_combo")->getValue());
controlp->set(mBooleanCombo->getValue());
break;
case TYPE_STRING:
controlp->set(LLSD(getChild<LLUICtrl>("val_text")->getValue().asString()));
controlp->set(LLSD(mValText->getValue().asString()));
break;
case TYPE_VEC3:
vector.mV[VX] = (F32)getChild<LLUICtrl>("val_spinner_1")->getValue().asReal();
vector.mV[VY] = (F32)getChild<LLUICtrl>("val_spinner_2")->getValue().asReal();
vector.mV[VZ] = (F32)getChild<LLUICtrl>("val_spinner_3")->getValue().asReal();
vector.mV[VX] = (F32)mValSpinner1->getValue().asReal();
vector.mV[VY] = (F32)mValSpinner2->getValue().asReal();
vector.mV[VZ] = (F32)mValSpinner3->getValue().asReal();
controlp->set(vector.getValue());
break;
case TYPE_VEC3D:
vectord.mdV[VX] = getChild<LLUICtrl>("val_spinner_1")->getValue().asReal();
vectord.mdV[VY] = getChild<LLUICtrl>("val_spinner_2")->getValue().asReal();
vectord.mdV[VZ] = getChild<LLUICtrl>("val_spinner_3")->getValue().asReal();
vectord.mdV[VX] = mValSpinner1->getValue().asReal();
vectord.mdV[VY] = mValSpinner2->getValue().asReal();
vectord.mdV[VZ] = mValSpinner3->getValue().asReal();
controlp->set(vectord.getValue());
break;
case TYPE_VEC4:
vector4.mV[VX] = (F32)getChild<LLUICtrl>("val_spinner_1")->getValue().asReal();
vector4.mV[VY] = (F32)getChild<LLUICtrl>("val_spinner_2")->getValue().asReal();
vector4.mV[VZ] = (F32)getChild<LLUICtrl>("val_spinner_3")->getValue().asReal();
vector4.mV[VW] = (F32)getChild<LLUICtrl>("val_spinner_4")->getValue().asReal();
vector4.mV[VX] = (F32)mValSpinner1->getValue().asReal();
vector4.mV[VY] = (F32)mValSpinner2->getValue().asReal();
vector4.mV[VZ] = (F32)mValSpinner3->getValue().asReal();
vector4.mV[VW] = (F32)mValSpinner4->getValue().asReal();
controlp->set(vector4.getValue());
break;
case TYPE_QUAT:
quat.mQ[VX] = getChild<LLUICtrl>("val_spinner_1")->getValue().asReal();
quat.mQ[VY] = getChild<LLUICtrl>("val_spinner_2")->getValue().asReal();
quat.mQ[VZ] = getChild<LLUICtrl>("val_spinner_3")->getValue().asReal();
quat.mQ[VS] = getChild<LLUICtrl>("val_spinner_4")->getValue().asReal();;
quat.mQ[VX] = mValSpinner1->getValue().asReal();
quat.mQ[VY] = mValSpinner2->getValue().asReal();
quat.mQ[VZ] = mValSpinner3->getValue().asReal();
quat.mQ[VS] = mValSpinner4->getValue().asReal();;
controlp->set(quat.getValue());
break;
case TYPE_RECT:
rect.mLeft = getChild<LLUICtrl>("val_spinner_1")->getValue().asInteger();
rect.mRight = getChild<LLUICtrl>("val_spinner_2")->getValue().asInteger();
rect.mBottom = getChild<LLUICtrl>("val_spinner_3")->getValue().asInteger();
rect.mTop = getChild<LLUICtrl>("val_spinner_4")->getValue().asInteger();
rect.mLeft = mValSpinner1->getValue().asInteger();
rect.mRight = mValSpinner2->getValue().asInteger();
rect.mBottom = mValSpinner3->getValue().asInteger();
rect.mTop = mValSpinner4->getValue().asInteger();
controlp->set(rect.getValue());
break;
case TYPE_COL4:
col3.setValue(getChild<LLUICtrl>("val_color_swatch")->getValue());
col4 = LLColor4(col3, (F32)getChild<LLUICtrl>("val_spinner_4")->getValue().asReal());
col3.setValue(mColorSwatch->getValue());
col4 = LLColor4(col3, (F32)mValSpinner4->getValue().asReal());
controlp->set(col4.getValue());
break;
case TYPE_COL3:
controlp->set(getChild<LLUICtrl>("val_color_swatch")->getValue());
//col3.mV[VRED] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_1")->getValue().asC();
//col3.mV[VGREEN] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_2")->getValue().asReal();
//col3.mV[VBLUE] = (F32)floaterp->getChild<LLUICtrl>("val_spinner_3")->getValue().asReal();
controlp->set(mColorSwatch->getValue());
//col3.mV[VRED] = (F32)floaterp->mValSpinner1->getValue().asC();
//col3.mV[VGREEN] = (F32)floaterp->mValSpinner2->getValue().asReal();
//col3.mV[VBLUE] = (F32)floaterp->mValSpinner3->getValue().asReal();
//controlp->set(col3.getValue());
break;
case TYPE_UUID:
LLUUID::parseUUID(getChild<LLUICtrl>("val_text")->getValue().asString(), &uuid);
LLUUID::parseUUID(mValText->getValue().asString(), &uuid);
controlp->set(LLSD(uuid));
break;
default:
......@@ -197,19 +209,6 @@ void LLFloaterSettingsDebug::onClickDefault()
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1");
LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2");
LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3");
LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4");
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("val_color_swatch");
if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch)
{
LL_WARNS() << "Could not find all desired controls by name"
<< LL_ENDL;
return;
}
hideUIControls();
if (controlp && !isSettingHidden(controlp))
......@@ -218,24 +217,24 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
// If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control
// NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault()
bool fEnable = !controlp->isHiddenFromSettingsEditor();
spinner1->setEnabled(fEnable);
spinner2->setEnabled(fEnable);
spinner3->setEnabled(fEnable);
spinner4->setEnabled(fEnable);
color_swatch->setEnabled(fEnable);
childSetEnabled("val_text", fEnable);
childSetEnabled("boolean_combo", fEnable);
childSetEnabled("default_btn", fEnable);
mValSpinner1->setEnabled(fEnable);
mValSpinner2->setEnabled(fEnable);
mValSpinner3->setEnabled(fEnable);
mValSpinner4->setEnabled(fEnable);
mColorSwatch->setEnabled(fEnable);
mValText->setEnabled(fEnable);
mBooleanCombo->setEnabled(fEnable);
mDefaultButton->setEnabled(fEnable);
// [/RLVa:KB]
eControlType type = controlp->type();
//hide combo box only for non booleans, otherwise this will result in the combo box closing every frame
getChildView("boolean_combo")->setVisible( type == TYPE_BOOLEAN);
getChildView("default_btn")->setVisible(true);
getChildView("setting_name_txt")->setVisible(true);
getChild<LLTextBox>("setting_name_txt")->setText(controlp->getName());
getChild<LLTextBox>("setting_name_txt")->setToolTip(controlp->getName());
mBooleanCombo->setVisible( type == TYPE_BOOLEAN);
mDefaultButton->setVisible(true);
mSettingNameText->setVisible(true);
mSettingNameText->setText(controlp->getName());
mSettingNameText->setToolTip(controlp->getName());
mComment->setVisible(true);
std::string old_text = mComment->getText();
......@@ -248,111 +247,111 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
mComment->setText(controlp->getComment());
}
spinner1->setMaxValue(F32_MAX);
spinner2->setMaxValue(F32_MAX);
spinner3->setMaxValue(F32_MAX);
spinner4->setMaxValue(F32_MAX);
spinner1->setMinValue(-F32_MAX);
spinner2->setMinValue(-F32_MAX);
spinner3->setMinValue(-F32_MAX);
spinner4->setMinValue(-F32_MAX);
if (!spinner1->hasFocus())
mValSpinner1->setMaxValue(F32_MAX);
mValSpinner2->setMaxValue(F32_MAX);
mValSpinner3->setMaxValue(F32_MAX);
mValSpinner4->setMaxValue(F32_MAX);
mValSpinner1->setMinValue(-F32_MAX);
mValSpinner2->setMinValue(-F32_MAX);
mValSpinner3->setMinValue(-F32_MAX);
mValSpinner4->setMinValue(-F32_MAX);
if (!mValSpinner1->hasFocus())
{
spinner1->setIncrement(0.1f);
mValSpinner1->setIncrement(0.1f);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setIncrement(0.1f);
mValSpinner2->setIncrement(0.1f);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setIncrement(0.1f);
mValSpinner3->setIncrement(0.1f);
}
if (!spinner4->hasFocus())
if (!mValSpinner4->hasFocus())
{
spinner4->setIncrement(0.1f);
mValSpinner4->setIncrement(0.1f);
}
LLSD sd = controlp->get();
switch(type)
{
case TYPE_U32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("value")); // Debug, don't translate
if (!mValSpinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)U32_MIN);
spinner1->setMaxValue((F32)U32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
mValSpinner1->setValue(sd);
mValSpinner1->setMinValue((F32)U32_MIN);
mValSpinner1->setMaxValue((F32)U32_MAX);
mValSpinner1->setIncrement(1.f);
mValSpinner1->setPrecision(0);
}
break;
case TYPE_S32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("value")); // Debug, don't translate
if (!mValSpinner1->hasFocus())
{
spinner1->setValue(sd);
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
spinner1->setPrecision(0);
mValSpinner1->setValue(sd);
mValSpinner1->setMinValue((F32)S32_MIN);
mValSpinner1->setMaxValue((F32)S32_MAX);
mValSpinner1->setIncrement(1.f);
mValSpinner1->setPrecision(0);
}
break;
case TYPE_F32:
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("value")); // Debug, don't translate
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("value")); // Debug, don't translate
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(sd);
mValSpinner1->setPrecision(3);
mValSpinner1->setValue(sd);
}
break;
case TYPE_BOOLEAN:
if (!getChild<LLUICtrl>("boolean_combo")->hasFocus())
if (!mBooleanCombo->hasFocus())
{
if (sd.asBoolean())
{
getChild<LLUICtrl>("boolean_combo")->setValue(LLSD("true"));
mBooleanCombo->setValue(LLSD("true"));
}
else
{
getChild<LLUICtrl>("boolean_combo")->setValue(LLSD(""));
mBooleanCombo->setValue(LLSD(""));
}
}
break;
case TYPE_STRING:
getChildView("val_text")->setVisible( TRUE);
if (!getChild<LLUICtrl>("val_text")->hasFocus())
mValText->setVisible( TRUE);
if (!mValText->hasFocus())
{
getChild<LLUICtrl>("val_text")->setValue(sd);
mValText->setValue(sd);
}
break;
case TYPE_VEC3:
{
LLVector3 v;
v.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("X"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Y"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Z"));
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("X"));
mValSpinner2->setVisible(TRUE);
mValSpinner2->setLabel(std::string("Y"));
mValSpinner3->setVisible(TRUE);
mValSpinner3->setLabel(std::string("Z"));
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(v[VX]);
mValSpinner1->setPrecision(3);
mValSpinner1->setValue(v[VX]);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setPrecision(3);
spinner2->setValue(v[VY]);
mValSpinner2->setPrecision(3);
mValSpinner2->setValue(v[VY]);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setPrecision(3);
spinner3->setValue(v[VZ]);
mValSpinner3->setPrecision(3);
mValSpinner3->setValue(v[VZ]);
}
break;
}
......@@ -360,26 +359,26 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLVector3d v;
v.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("X"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Y"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Z"));
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("X"));
mValSpinner2->setVisible(TRUE);
mValSpinner2->setLabel(std::string("Y"));
mValSpinner3->setVisible(TRUE);
mValSpinner3->setLabel(std::string("Z"));
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(v[VX]);
mValSpinner1->setPrecision(3);
mValSpinner1->setValue(v[VX]);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setPrecision(3);
spinner2->setValue(v[VY]);
mValSpinner2->setPrecision(3);
mValSpinner2->setValue(v[VY]);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setPrecision(3);
spinner3->setValue(v[VZ]);
mValSpinner3->setPrecision(3);
mValSpinner3->setValue(v[VZ]);
}
break;
}
......@@ -387,33 +386,33 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLVector4 v;
v.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("X"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Y"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Z"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("W"));
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("X"));
mValSpinner2->setVisible(TRUE);
mValSpinner2->setLabel(std::string("Y"));
mValSpinner3->setVisible(TRUE);
mValSpinner3->setLabel(std::string("Z"));
mValSpinner4->setVisible(TRUE);
mValSpinner4->setLabel(std::string("W"));
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(3);
spinner1->setValue(v[VX]);
mValSpinner1->setPrecision(3);
mValSpinner1->setValue(v[VX]);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setPrecision(3);
spinner2->setValue(v[VY]);
mValSpinner2->setPrecision(3);
mValSpinner2->setValue(v[VY]);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setPrecision(3);
spinner3->setValue(v[VZ]);
mValSpinner3->setPrecision(3);
mValSpinner3->setValue(v[VZ]);
}
if (!spinner4->hasFocus())
if (!mValSpinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setValue(v[VW]);
mValSpinner4->setPrecision(3);
mValSpinner4->setValue(v[VW]);
}
break;
}
......@@ -421,33 +420,33 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLQuaternion q;
q.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("X"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Y"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Z"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("S"));
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("X"));
mValSpinner2->setVisible(TRUE);
mValSpinner2->setLabel(std::string("Y"));
mValSpinner3->setVisible(TRUE);
mValSpinner3->setLabel(std::string("Z"));
mValSpinner4->setVisible(TRUE);
mValSpinner4->setLabel(std::string("S"));
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(4);
spinner1->setValue(q.mQ[VX]);
mValSpinner1->setPrecision(4);
mValSpinner1->setValue(q.mQ[VX]);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setPrecision(4);
spinner2->setValue(q.mQ[VY]);
mValSpinner2->setPrecision(4);
mValSpinner2->setValue(q.mQ[VY]);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setPrecision(4);
spinner3->setValue(q.mQ[VZ]);
mValSpinner3->setPrecision(4);
mValSpinner3->setValue(q.mQ[VZ]);
}
if (!spinner4->hasFocus())
if (!mValSpinner4->hasFocus())
{
spinner4->setPrecision(4);
spinner4->setValue(q.mQ[VS]);
mValSpinner4->setPrecision(4);
mValSpinner4->setValue(q.mQ[VS]);
}
break;
}
......@@ -455,70 +454,70 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLRect r;
r.setValue(sd);
spinner1->setVisible(TRUE);
spinner1->setLabel(std::string("Left"));
spinner2->setVisible(TRUE);
spinner2->setLabel(std::string("Right"));
spinner3->setVisible(TRUE);
spinner3->setLabel(std::string("Bottom"));
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Top"));
if (!spinner1->hasFocus())
mValSpinner1->setVisible(TRUE);
mValSpinner1->setLabel(std::string("Left"));
mValSpinner2->setVisible(TRUE);
mValSpinner2->setLabel(std::string("Right"));
mValSpinner3->setVisible(TRUE);
mValSpinner3->setLabel(std::string("Bottom"));
mValSpinner4->setVisible(TRUE);
mValSpinner4->setLabel(std::string("Top"));
if (!mValSpinner1->hasFocus())
{
spinner1->setPrecision(0);
spinner1->setValue(r.mLeft);
mValSpinner1->setPrecision(0);
mValSpinner1->setValue(r.mLeft);
}
if (!spinner2->hasFocus())
if (!mValSpinner2->hasFocus())
{
spinner2->setPrecision(0);
spinner2->setValue(r.mRight);
mValSpinner2->setPrecision(0);
mValSpinner2->setValue(r.mRight);
}
if (!spinner3->hasFocus())
if (!mValSpinner3->hasFocus())
{
spinner3->setPrecision(0);
spinner3->setValue(r.mBottom);
mValSpinner3->setPrecision(0);
mValSpinner3->setValue(r.mBottom);
}
if (!spinner4->hasFocus())
if (!mValSpinner4->hasFocus())
{
spinner4->setPrecision(0);
spinner4->setValue(r.mTop);
mValSpinner4->setPrecision(0);
mValSpinner4->setValue(r.mTop);
}
spinner1->setMinValue((F32)S32_MIN);
spinner1->setMaxValue((F32)S32_MAX);
spinner1->setIncrement(1.f);
mValSpinner1->setMinValue((F32)S32_MIN);
mValSpinner1->setMaxValue((F32)S32_MAX);
mValSpinner1->setIncrement(1.f);
spinner2->setMinValue((F32)S32_MIN);
spinner2->setMaxValue((F32)S32_MAX);
spinner2->setIncrement(1.f);
mValSpinner2->setMinValue((F32)S32_MIN);
mValSpinner2->setMaxValue((F32)S32_MAX);
mValSpinner2->setIncrement(1.f);
spinner3->setMinValue((F32)S32_MIN);
spinner3->setMaxValue((F32)S32_MAX);
spinner3->setIncrement(1.f);
mValSpinner3->setMinValue((F32)S32_MIN);
mValSpinner3->setMaxValue((F32)S32_MAX);
mValSpinner3->setIncrement(1.f);
spinner4->setMinValue((F32)S32_MIN);
spinner4->setMaxValue((F32)S32_MAX);
spinner4->setIncrement(1.f);
mValSpinner4->setMinValue((F32)S32_MIN);
mValSpinner4->setMaxValue((F32)S32_MAX);
mValSpinner4->setIncrement(1.f);
break;
}
case TYPE_COL4:
{
LLColor4 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
mColorSwatch->setVisible(TRUE);
// only set if changed so color picker doesn't update
if(clr != LLColor4(color_swatch->getValue()))
if(clr != LLColor4(mColorSwatch->getValue()))
{
color_swatch->set(LLColor4(sd), TRUE, FALSE);
mColorSwatch->set(LLColor4(sd), TRUE, FALSE);
}
spinner4->setVisible(TRUE);
spinner4->setLabel(std::string("Alpha"));
if (!spinner4->hasFocus())
mValSpinner4->setVisible(TRUE);
mValSpinner4->setLabel(std::string("Alpha"));
if (!mValSpinner4->hasFocus())
{
spinner4->setPrecision(3);
spinner4->setMinValue(0.0);
spinner4->setMaxValue(1.f);
spinner4->setValue(clr.mV[VALPHA]);
mValSpinner4->setPrecision(3);
mValSpinner4->setMinValue(0.0);
mValSpinner4->setMaxValue(1.f);
mValSpinner4->setValue(clr.mV[VALPHA]);
}
break;
}
......@@ -526,15 +525,15 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp)
{
LLColor3 clr;
clr.setValue(sd);
color_swatch->setVisible(TRUE);
color_swatch->setValue(sd);
mColorSwatch->setVisible(TRUE);
mColorSwatch->setValue(sd);
break;
}
case TYPE_UUID:
getChildView("val_text")->setVisible( TRUE);
if (!getChild<LLUICtrl>("val_text")->hasFocus())
mValText->setVisible( TRUE);
if (!mValText->hasFocus())
{
getChild<LLUICtrl>("val_text")->setValue(sd);
mValText->setValue(sd);
}
break;
// [RLVa:KB] - Patch: RLVa-2.1.0
......@@ -704,15 +703,15 @@ void LLFloaterSettingsDebug::updateDefaultColumn(LLControlVariable* control)
void LLFloaterSettingsDebug::hideUIControls()
{
getChildView("val_spinner_1")->setVisible(false);
getChildView("val_spinner_2")->setVisible(false);
getChildView("val_spinner_3")->setVisible(false);
getChildView("val_spinner_4")->setVisible(false);
getChildView("val_color_swatch")->setVisible(false);
getChildView("val_text")->setVisible(false);
getChildView("default_btn")->setVisible(false);
getChildView("boolean_combo")->setVisible(false);
getChildView("setting_name_txt")->setVisible(false);
mValSpinner1->setVisible(false);
mValSpinner2->setVisible(false);
mValSpinner3->setVisible(false);
mValSpinner4->setVisible(false);
mColorSwatch->setVisible(false);
mValText->setVisible(false);
mDefaultButton->setVisible(false);
mBooleanCombo->setVisible(false);
mSettingNameText->setVisible(false);
mComment->setVisible(false);
}
......@@ -30,7 +30,10 @@
#include "llcontrol.h"
#include "llfloater.h"
class LLColorSwatchCtrl;
class LLScrollListCtrl;
class LLSpinCtrl;
class LLTextBox;
class LLFloaterSettingsDebug final
: public LLFloater
......@@ -67,6 +70,16 @@ class LLFloaterSettingsDebug final
protected:
class LLTextEditor* mComment;
LLSpinCtrl* mValSpinner1 = nullptr;
LLSpinCtrl* mValSpinner2 = nullptr;
LLSpinCtrl* mValSpinner3 = nullptr;
LLSpinCtrl* mValSpinner4 = nullptr;
LLUICtrl* mBooleanCombo = nullptr;
LLUICtrl* mValText = nullptr;
LLUICtrl* mDefaultButton = nullptr;
LLTextBox* mSettingNameText = nullptr;
LLColorSwatchCtrl* mColorSwatch = nullptr;
std::string mSearchFilter;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment