diff options
Diffstat (limited to 'indra/newview/llpanelvolume.cpp')
-rw-r--r-- | indra/newview/llpanelvolume.cpp | 254 |
1 files changed, 127 insertions, 127 deletions
diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index 065c4d0b92..faf260881e 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -79,21 +79,21 @@ BOOL LLPanelVolume::postBuild() { childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this); childSetCommitCallback("FlexNumSections",onCommitFlexible,this); - getChild<LLUICtrl>("FlexNumSections")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexNumSections",precommitValidate); childSetCommitCallback("FlexGravity",onCommitFlexible,this); - getChild<LLUICtrl>("FlexGravity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexGravity",precommitValidate); childSetCommitCallback("FlexFriction",onCommitFlexible,this); - getChild<LLUICtrl>("FlexFriction")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexFriction",precommitValidate); childSetCommitCallback("FlexWind",onCommitFlexible,this); - getChild<LLUICtrl>("FlexWind")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexWind",precommitValidate); childSetCommitCallback("FlexTension",onCommitFlexible,this); - getChild<LLUICtrl>("FlexTension")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexTension",precommitValidate); childSetCommitCallback("FlexForceX",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceX")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceX",precommitValidate); childSetCommitCallback("FlexForceY",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceY")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceY",precommitValidate); childSetCommitCallback("FlexForceZ",onCommitFlexible,this); - getChild<LLUICtrl>("FlexForceZ")->setValidateBeforeCommit(precommitValidate); + childSetValidate("FlexForceZ",precommitValidate); } // LIGHT Parameters @@ -115,18 +115,18 @@ BOOL LLPanelVolume::postBuild() } childSetCommitCallback("Light Intensity",onCommitLight,this); - getChild<LLUICtrl>("Light Intensity")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Intensity",precommitValidate); childSetCommitCallback("Light Radius",onCommitLight,this); - getChild<LLUICtrl>("Light Radius")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Radius",precommitValidate); childSetCommitCallback("Light Falloff",onCommitLight,this); - getChild<LLUICtrl>("Light Falloff")->setValidateBeforeCommit(precommitValidate); + childSetValidate("Light Falloff",precommitValidate); childSetCommitCallback("Light FOV", onCommitLight, this); - getChild<LLUICtrl>("Light FOV")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light FOV", precommitValidate); childSetCommitCallback("Light Focus", onCommitLight, this); - getChild<LLUICtrl>("Light Focus")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Focus", precommitValidate); childSetCommitCallback("Light Ambiance", onCommitLight, this); - getChild<LLUICtrl>("Light Ambiance")->setValidateBeforeCommit( precommitValidate); + childSetValidate("Light Ambiance", precommitValidate); } // Start with everyone disabled @@ -204,25 +204,25 @@ void LLPanelVolume::getState( ) // Select Single Message if (single_volume) { - getChildView("edit_object")->setVisible(true); - getChildView("edit_object")->setEnabled(true); - getChildView("select_single")->setVisible(false); + childSetVisible("edit_object",true); + childSetEnabled("edit_object",true); + childSetVisible("select_single",false); } else { - getChildView("edit_object")->setVisible(false); - getChildView("select_single")->setVisible(true); - getChildView("select_single")->setEnabled(true); + childSetVisible("edit_object",false); + childSetVisible("select_single",true); + childSetEnabled("select_single",true); } // Light properties BOOL is_light = volobjp && volobjp->getIsLight(); - getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light); - getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetValue("Light Checkbox Ctrl",is_light); + childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp); if (is_light && editable && single_volume) { - getChildView("label color")->setEnabled(true); + childSetEnabled("label color",true); //mLabelColor ->setEnabled( TRUE ); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) @@ -240,22 +240,22 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID()); } - getChildView("Light Intensity")->setEnabled(true); - getChildView("Light Radius")->setEnabled(true); - getChildView("Light Falloff")->setEnabled(true); + childSetEnabled("Light Intensity",true); + childSetEnabled("Light Radius",true); + childSetEnabled("Light Falloff",true); - getChildView("Light FOV")->setEnabled(true); - getChildView("Light Focus")->setEnabled(true); - getChildView("Light Ambiance")->setEnabled(true); + childSetEnabled("Light FOV", true); + childSetEnabled("Light Focus", true); + childSetEnabled("Light Ambiance", true); - getChild<LLUICtrl>("Light Intensity")->setValue(volobjp->getLightIntensity()); - getChild<LLUICtrl>("Light Radius")->setValue(volobjp->getLightRadius()); - getChild<LLUICtrl>("Light Falloff")->setValue(volobjp->getLightFalloff()); + childSetValue("Light Intensity",volobjp->getLightIntensity()); + childSetValue("Light Radius",volobjp->getLightRadius()); + childSetValue("Light Falloff",volobjp->getLightFalloff()); LLVector3 params = volobjp->getSpotLightParams(); - getChild<LLUICtrl>("Light FOV")->setValue(params.mV[0]); - getChild<LLUICtrl>("Light Focus")->setValue(params.mV[1]); - getChild<LLUICtrl>("Light Ambiance")->setValue(params.mV[2]); + childSetValue("Light FOV", params.mV[0]); + childSetValue("Light Focus", params.mV[1]); + childSetValue("Light Ambiance", params.mV[2]); mLightSavedColor = volobjp->getLightColor(); } @@ -265,7 +265,7 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("Light Radius", true)->clear(); getChild<LLSpinCtrl>("Light Falloff", true)->clear(); - getChildView("label color")->setEnabled(false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { @@ -279,56 +279,56 @@ void LLPanelVolume::getState( ) LightTextureCtrl->setValid(FALSE); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); - getChildView("Light FOV")->setEnabled(false); - getChildView("Light Focus")->setEnabled(false); - getChildView("Light Ambiance")->setEnabled(false); + childSetEnabled("Light FOV",false); + childSetEnabled("Light Focus",false); + childSetEnabled("Light Ambiance",false); } // Flexible properties BOOL is_flexible = volobjp && volobjp->isFlexible(); - getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->setValue(is_flexible); + childSetValue("Flexible1D Checkbox Ctrl",is_flexible); if (is_flexible || (volobjp && volobjp->canBeFlexible())) { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp); + childSetEnabled("Flexible1D Checkbox Ctrl", editable && single_volume && volobjp); } else { - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); + childSetEnabled("Flexible1D Checkbox Ctrl", false); } if (is_flexible && editable && single_volume) { - getChildView("FlexNumSections")->setVisible(true); - getChildView("FlexGravity")->setVisible(true); - getChildView("FlexTension")->setVisible(true); - getChildView("FlexFriction")->setVisible(true); - getChildView("FlexWind")->setVisible(true); - getChildView("FlexForceX")->setVisible(true); - getChildView("FlexForceY")->setVisible(true); - getChildView("FlexForceZ")->setVisible(true); - - getChildView("FlexNumSections")->setEnabled(true); - getChildView("FlexGravity")->setEnabled(true); - getChildView("FlexTension")->setEnabled(true); - getChildView("FlexFriction")->setEnabled(true); - getChildView("FlexWind")->setEnabled(true); - getChildView("FlexForceX")->setEnabled(true); - getChildView("FlexForceY")->setEnabled(true); - getChildView("FlexForceZ")->setEnabled(true); + childSetVisible("FlexNumSections",true); + childSetVisible("FlexGravity",true); + childSetVisible("FlexTension",true); + childSetVisible("FlexFriction",true); + childSetVisible("FlexWind",true); + childSetVisible("FlexForceX",true); + childSetVisible("FlexForceY",true); + childSetVisible("FlexForceZ",true); + + childSetEnabled("FlexNumSections",true); + childSetEnabled("FlexGravity",true); + childSetEnabled("FlexTension",true); + childSetEnabled("FlexFriction",true); + childSetEnabled("FlexWind",true); + childSetEnabled("FlexForceX",true); + childSetEnabled("FlexForceY",true); + childSetEnabled("FlexForceZ",true); LLFlexibleObjectData *attributes = (LLFlexibleObjectData *)objectp->getParameterEntry(LLNetworkData::PARAMS_FLEXIBLE); - getChild<LLUICtrl>("FlexNumSections")->setValue((F32)attributes->getSimulateLOD()); - getChild<LLUICtrl>("FlexGravity")->setValue(attributes->getGravity()); - getChild<LLUICtrl>("FlexTension")->setValue(attributes->getTension()); - getChild<LLUICtrl>("FlexFriction")->setValue(attributes->getAirFriction()); - getChild<LLUICtrl>("FlexWind")->setValue(attributes->getWindSensitivity()); - getChild<LLUICtrl>("FlexForceX")->setValue(attributes->getUserForce().mV[VX]); - getChild<LLUICtrl>("FlexForceY")->setValue(attributes->getUserForce().mV[VY]); - getChild<LLUICtrl>("FlexForceZ")->setValue(attributes->getUserForce().mV[VZ]); + childSetValue("FlexNumSections",(F32)attributes->getSimulateLOD()); + childSetValue("FlexGravity",attributes->getGravity()); + childSetValue("FlexTension",attributes->getTension()); + childSetValue("FlexFriction",attributes->getAirFriction()); + childSetValue("FlexWind",attributes->getWindSensitivity()); + childSetValue("FlexForceX",attributes->getUserForce().mV[VX]); + childSetValue("FlexForceY",attributes->getUserForce().mV[VY]); + childSetValue("FlexForceZ",attributes->getUserForce().mV[VZ]); } else { @@ -341,14 +341,14 @@ void LLPanelVolume::getState( ) getChild<LLSpinCtrl>("FlexForceY", true)->clear(); getChild<LLSpinCtrl>("FlexForceZ", true)->clear(); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } mObject = objectp; @@ -378,11 +378,11 @@ void LLPanelVolume::refresh() BOOL visible = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED) > 0 ? TRUE : FALSE; - getChildView("label texture")->setVisible( visible); - getChildView("Light FOV")->setVisible( visible); - getChildView("Light Focus")->setVisible( visible); - getChildView("Light Ambiance")->setVisible( visible); - getChildView("light texture control")->setVisible( visible); + childSetVisible("label texture", visible); + childSetVisible("Light FOV", visible); + childSetVisible("Light Focus", visible); + childSetVisible("Light Ambiance", visible); + childSetVisible("light texture control", visible); } @@ -397,13 +397,13 @@ void LLPanelVolume::clearCtrls() { LLPanel::clearCtrls(); - getChildView("select_single")->setEnabled(false); - getChildView("select_single")->setVisible(true); - getChildView("edit_object")->setEnabled(false); - getChildView("edit_object")->setVisible(false); - getChildView("Light Checkbox Ctrl")->setEnabled(false); - getChildView("label color")->setEnabled(false); - getChildView("label color")->setEnabled(false); + childSetEnabled("select_single",false); + childSetVisible("select_single",true); + childSetEnabled("edit_object",false); + childSetVisible("edit_object",false); + childSetEnabled("Light Checkbox Ctrl",false); + childSetEnabled("label color",false); + childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) { @@ -417,19 +417,19 @@ void LLPanelVolume::clearCtrls() LightTextureCtrl->setValid( FALSE ); } - getChildView("Light Intensity")->setEnabled(false); - getChildView("Light Radius")->setEnabled(false); - getChildView("Light Falloff")->setEnabled(false); - - getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false); - getChildView("FlexNumSections")->setEnabled(false); - getChildView("FlexGravity")->setEnabled(false); - getChildView("FlexTension")->setEnabled(false); - getChildView("FlexFriction")->setEnabled(false); - getChildView("FlexWind")->setEnabled(false); - getChildView("FlexForceX")->setEnabled(false); - getChildView("FlexForceY")->setEnabled(false); - getChildView("FlexForceZ")->setEnabled(false); + childSetEnabled("Light Intensity",false); + childSetEnabled("Light Radius",false); + childSetEnabled("Light Falloff",false); + + childSetEnabled("Flexible1D Checkbox Ctrl",false); + childSetEnabled("FlexNumSections",false); + childSetEnabled("FlexGravity",false); + childSetEnabled("FlexTension",false); + childSetEnabled("FlexFriction",false); + childSetEnabled("FlexWind",false); + childSetEnabled("FlexForceX",false); + childSetEnabled("FlexForceY",false); + childSetEnabled("FlexForceZ",false); } // @@ -445,7 +445,7 @@ void LLPanelVolume::sendIsLight() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL value = getChild<LLUICtrl>("Light Checkbox Ctrl")->getValue(); + BOOL value = childGetValue("Light Checkbox Ctrl"); volobjp->setIsLight(value); llinfos << "update light sent" << llendl; } @@ -459,7 +459,7 @@ void LLPanelVolume::sendIsFlexible() } LLVOVolume *volobjp = (LLVOVolume *)objectp; - BOOL is_flexible = getChild<LLUICtrl>("Flexible1D Checkbox Ctrl")->getValue(); + BOOL is_flexible = childGetValue("Flexible1D Checkbox Ctrl"); //BOOL is_flexible = mCheckFlexible1D->get(); if (is_flexible) @@ -551,9 +551,9 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLVOVolume *volobjp = (LLVOVolume *)objectp; - volobjp->setLightIntensity((F32)self->getChild<LLUICtrl>("Light Intensity")->getValue().asReal()); - volobjp->setLightRadius((F32)self->getChild<LLUICtrl>("Light Radius")->getValue().asReal()); - volobjp->setLightFalloff((F32)self->getChild<LLUICtrl>("Light Falloff")->getValue().asReal()); + volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal()); + volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal()); + volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal()); LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch"); if(LightColorSwatch) @@ -568,29 +568,29 @@ void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata ) LLUUID id = LightTextureCtrl->getImageAssetID(); if (id.notNull()) { - if (!volobjp->isLightSpotlight()) + if (volobjp->getLightTextureID().isNull()) { //this commit is making this a spot light, set UI to default params volobjp->setLightTextureID(id); LLVector3 spot_params = volobjp->getSpotLightParams(); - self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]); - self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]); - self->getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]); + self->childSetValue("Light FOV", spot_params.mV[0]); + self->childSetValue("Light Focus", spot_params.mV[1]); + self->childSetValue("Light Ambiance", spot_params.mV[2]); } else { //modifying existing params LLVector3 spot_params; - spot_params.mV[0] = (F32) self->getChild<LLUICtrl>("Light FOV")->getValue().asReal(); - spot_params.mV[1] = (F32) self->getChild<LLUICtrl>("Light Focus")->getValue().asReal(); - spot_params.mV[2] = (F32) self->getChild<LLUICtrl>("Light Ambiance")->getValue().asReal(); + spot_params.mV[0] = (F32) self->childGetValue("Light FOV").asReal(); + spot_params.mV[1] = (F32) self->childGetValue("Light Focus").asReal(); + spot_params.mV[2] = (F32) self->childGetValue("Light Ambiance").asReal(); volobjp->setSpotLightParams(spot_params); } } - else if (volobjp->isLightSpotlight()) + else if (volobjp->getLightTextureID().notNull()) { //no longer a spot light volobjp->setLightTextureID(id); - //self->getChildView("Light FOV")->setEnabled(FALSE); - //self->getChildView("Light Focus")->setEnabled(FALSE); - //self->getChildView("Light Ambiance")->setEnabled(FALSE); + //self->childDisable("Light FOV"); + //self->childDisable("Light Focus"); + //self->childDisable("Light Ambiance"); } } @@ -623,14 +623,14 @@ void LLPanelVolume::onCommitFlexible( LLUICtrl* ctrl, void* userdata ) new_attributes = *attributes; - new_attributes.setSimulateLOD(self->getChild<LLUICtrl>("FlexNumSections")->getValue().asInteger());//(S32)self->mSpinSections->get()); - new_attributes.setGravity((F32)self->getChild<LLUICtrl>("FlexGravity")->getValue().asReal()); - new_attributes.setTension((F32)self->getChild<LLUICtrl>("FlexTension")->getValue().asReal()); - new_attributes.setAirFriction((F32)self->getChild<LLUICtrl>("FlexFriction")->getValue().asReal()); - new_attributes.setWindSensitivity((F32)self->getChild<LLUICtrl>("FlexWind")->getValue().asReal()); - F32 fx = (F32)self->getChild<LLUICtrl>("FlexForceX")->getValue().asReal(); - F32 fy = (F32)self->getChild<LLUICtrl>("FlexForceY")->getValue().asReal(); - F32 fz = (F32)self->getChild<LLUICtrl>("FlexForceZ")->getValue().asReal(); + new_attributes.setSimulateLOD(self->childGetValue("FlexNumSections").asInteger());//(S32)self->mSpinSections->get()); + new_attributes.setGravity((F32)self->childGetValue("FlexGravity").asReal()); + new_attributes.setTension((F32)self->childGetValue("FlexTension").asReal()); + new_attributes.setAirFriction((F32)self->childGetValue("FlexFriction").asReal()); + new_attributes.setWindSensitivity((F32)self->childGetValue("FlexWind").asReal()); + F32 fx = (F32)self->childGetValue("FlexForceX").asReal(); + F32 fy = (F32)self->childGetValue("FlexForceY").asReal(); + F32 fz = (F32)self->childGetValue("FlexForceZ").asReal(); LLVector3 force(fx,fy,fz); new_attributes.setUserForce(force); |