diff options
author | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2007-08-21 22:17:53 +0000 |
commit | ce0a5fe14590b8d675b885fccd5f79d7ea17a302 (patch) | |
tree | 3388e6f8ff02292ec4521d278c841801462945b8 /indra/newview/llpanelobject.cpp | |
parent | b699ae454d8477d19342d320758cd993d1d28cec (diff) |
EFFECTIVE MERGE: svn merge -r 66133:68118 svn+ssh://svn/svn/linden/branches/maintenance into release
Actual action: branched maintenance-r68118, merged in release, then copied result into release
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r-- | indra/newview/llpanelobject.cpp | 75 |
1 files changed, 56 insertions, 19 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index f699027835..a267c50fde 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -266,6 +266,10 @@ BOOL LLPanelObject::postBuild() } } + mLabelSculptType = gUICtrlFactory->getTextBoxByName(this, "label sculpt type"); + mCtrlSculptType = gUICtrlFactory->getComboBoxByName(this, "sculpt type control"); + childSetCommitCallback("sculpt type control", onCommitSculptType, this); + // Start with everyone disabled clearCtrls(); @@ -1015,7 +1019,10 @@ void LLPanelObject::getState( ) mLabelRevolutions->setVisible( revolutions_visible ); mSpinRevolutions ->setVisible( revolutions_visible ); - mCtrlSculptTexture->setVisible( sculpt_texture_visible ); + bool sculpt_type_visible = FALSE; // currently not visible - for LSL setting only + mCtrlSculptTexture->setVisible(sculpt_texture_visible); + mLabelSculptType->setVisible(sculpt_texture_visible && sculpt_type_visible); + mCtrlSculptType->setVisible(sculpt_texture_visible && sculpt_type_visible); // sculpt texture @@ -1025,21 +1032,39 @@ void LLPanelObject::getState( ) LLUUID id; LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); - LLTextureCtrl* mTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); - if((mTextureCtrl) && (sculpt_params)) + + if (sculpt_params) // if we have a legal sculpt param block for this object: { - mTextureCtrl->setTentative(FALSE); - mTextureCtrl->setEnabled(editable); - if (editable) - mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); - else - mTextureCtrl->setImageAssetID(LLUUID::null); - - if (mObject != objectp) // we've just selected a new object, so save for undo + { mSculptTextureRevert = sculpt_params->getSculptTexture(); - } + mSculptTypeRevert = sculpt_params->getSculptType(); + } + + LLTextureCtrl* mTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); + if(mTextureCtrl) + { + mTextureCtrl->setTentative(FALSE); + mTextureCtrl->setEnabled(editable); + if (editable) + mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); + else + mTextureCtrl->setImageAssetID(LLUUID::null); + } + + if (mCtrlSculptType) + { + mCtrlSculptType->setCurrentByIndex(sculpt_params->getSculptType()); + mCtrlSculptType->setEnabled(editable); + } + if (mLabelSculptType) + { + mLabelSculptType->setEnabled(TRUE); + } + + + } } @@ -1174,7 +1199,7 @@ void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, TRUE, TRUE); LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT); if (sculpt_params) - volume_params.setSculptID(sculpt_params->getSculptTexture(), 0); + volume_params.setSculptID(sculpt_params->getSculptTexture(), sculpt_params->getSculptType()); } else { @@ -1628,13 +1653,16 @@ void LLPanelObject::sendPosition() void LLPanelObject::sendSculpt() { - LLTextureCtrl* mTextureCtrl = gUICtrlFactory->getTexturePickerByName(this,"sculpt texture control"); - if(!mTextureCtrl) + if (mObject.isNull()) return; - + LLSculptParams sculpt_params; - sculpt_params.setSculptTexture(mTextureCtrl->getImageAssetID()); - sculpt_params.setSculptType(LL_SCULPT_TYPE_SPHERE); + + if (mCtrlSculptTexture) + sculpt_params.setSculptTexture(mCtrlSculptTexture->getImageAssetID()); + + if (mCtrlSculptType) + sculpt_params.setSculptType(mCtrlSculptType->getCurrentIndex()); mObject->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE); } @@ -1843,7 +1871,9 @@ void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata) LLTextureCtrl* mTextureCtrl = gUICtrlFactory->getTexturePickerByName(self, "sculpt texture control"); if (mTextureCtrl) + { self->mSculptTextureRevert = mTextureCtrl->getImageAssetID(); + } self->sendSculpt(); } @@ -1870,7 +1900,6 @@ BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdat mTextureCtrl->setImageAssetID(asset); self->mSculptTextureRevert = asset; } - return TRUE; } @@ -1889,3 +1918,11 @@ void LLPanelObject::onCancelSculpt(LLUICtrl* ctrl, void* userdata) self->sendSculpt(); } + +// static +void LLPanelObject::onCommitSculptType(LLUICtrl *ctrl, void* userdata) +{ + LLPanelObject* self = (LLPanelObject*) userdata; + + self->sendSculpt(); +} |