diff options
Diffstat (limited to 'linden/indra/newview/llpanelobject.cpp')
-rw-r--r-- | linden/indra/newview/llpanelobject.cpp | 75 |
1 files changed, 56 insertions, 19 deletions
diff --git a/linden/indra/newview/llpanelobject.cpp b/linden/indra/newview/llpanelobject.cpp index 3e7be68..a8411df 100644 --- a/linden/indra/newview/llpanelobject.cpp +++ b/linden/indra/newview/llpanelobject.cpp | |||
@@ -286,6 +286,10 @@ BOOL LLPanelObject::postBuild() | |||
286 | } | 286 | } |
287 | } | 287 | } |
288 | 288 | ||
289 | mLabelSculptType = gUICtrlFactory->getTextBoxByName(this, "label sculpt type"); | ||
290 | mCtrlSculptType = gUICtrlFactory->getComboBoxByName(this, "sculpt type control"); | ||
291 | childSetCommitCallback("sculpt type control", onCommitSculptType, this); | ||
292 | |||
289 | 293 | ||
290 | // Start with everyone disabled | 294 | // Start with everyone disabled |
291 | clearCtrls(); | 295 | clearCtrls(); |
@@ -1035,7 +1039,10 @@ void LLPanelObject::getState( ) | |||
1035 | mLabelRevolutions->setVisible( revolutions_visible ); | 1039 | mLabelRevolutions->setVisible( revolutions_visible ); |
1036 | mSpinRevolutions ->setVisible( revolutions_visible ); | 1040 | mSpinRevolutions ->setVisible( revolutions_visible ); |
1037 | 1041 | ||
1038 | mCtrlSculptTexture->setVisible( sculpt_texture_visible ); | 1042 | bool sculpt_type_visible = FALSE; // currently not visible - for LSL setting only |
1043 | mCtrlSculptTexture->setVisible(sculpt_texture_visible); | ||
1044 | mLabelSculptType->setVisible(sculpt_texture_visible && sculpt_type_visible); | ||
1045 | mCtrlSculptType->setVisible(sculpt_texture_visible && sculpt_type_visible); | ||
1039 | 1046 | ||
1040 | 1047 | ||
1041 | // sculpt texture | 1048 | // sculpt texture |
@@ -1045,21 +1052,39 @@ void LLPanelObject::getState( ) | |||
1045 | LLUUID id; | 1052 | LLUUID id; |
1046 | LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); | 1053 | LLSculptParams *sculpt_params = (LLSculptParams *)objectp->getParameterEntry(LLNetworkData::PARAMS_SCULPT); |
1047 | 1054 | ||
1048 | LLTextureCtrl* mTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); | 1055 | |
1049 | if((mTextureCtrl) && (sculpt_params)) | 1056 | if (sculpt_params) // if we have a legal sculpt param block for this object: |
1050 | { | 1057 | { |
1051 | mTextureCtrl->setTentative(FALSE); | ||
1052 | mTextureCtrl->setEnabled(editable); | ||
1053 | if (editable) | ||
1054 | mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); | ||
1055 | else | ||
1056 | mTextureCtrl->setImageAssetID(LLUUID::null); | ||
1057 | |||
1058 | |||
1059 | if (mObject != objectp) // we've just selected a new object, so save for undo | 1058 | if (mObject != objectp) // we've just selected a new object, so save for undo |
1059 | { | ||
1060 | mSculptTextureRevert = sculpt_params->getSculptTexture(); | 1060 | mSculptTextureRevert = sculpt_params->getSculptTexture(); |
1061 | } | 1061 | mSculptTypeRevert = sculpt_params->getSculptType(); |
1062 | } | ||
1063 | |||
1064 | LLTextureCtrl* mTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); | ||
1065 | if(mTextureCtrl) | ||
1066 | { | ||
1067 | mTextureCtrl->setTentative(FALSE); | ||
1068 | mTextureCtrl->setEnabled(editable); | ||
1069 | if (editable) | ||
1070 | mTextureCtrl->setImageAssetID(sculpt_params->getSculptTexture()); | ||
1071 | else | ||
1072 | mTextureCtrl->setImageAssetID(LLUUID::null); | ||
1073 | } | ||
1074 | |||
1075 | if (mCtrlSculptType) | ||
1076 | { | ||
1077 | mCtrlSculptType->setCurrentByIndex(sculpt_params->getSculptType()); | ||
1078 | mCtrlSculptType->setEnabled(editable); | ||
1079 | } | ||
1062 | 1080 | ||
1081 | if (mLabelSculptType) | ||
1082 | { | ||
1083 | mLabelSculptType->setEnabled(TRUE); | ||
1084 | } | ||
1085 | |||
1086 | |||
1087 | } | ||
1063 | } | 1088 | } |
1064 | 1089 | ||
1065 | 1090 | ||
@@ -1194,7 +1219,7 @@ void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata ) | |||
1194 | self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, TRUE, TRUE); | 1219 | self->mObject->setParameterEntryInUse(LLNetworkData::PARAMS_SCULPT, TRUE, TRUE); |
1195 | LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT); | 1220 | LLSculptParams *sculpt_params = (LLSculptParams *)self->mObject->getParameterEntry(LLNetworkData::PARAMS_SCULPT); |
1196 | if (sculpt_params) | 1221 | if (sculpt_params) |
1197 | volume_params.setSculptID(sculpt_params->getSculptTexture(), 0); | 1222 | volume_params.setSculptID(sculpt_params->getSculptTexture(), sculpt_params->getSculptType()); |
1198 | } | 1223 | } |
1199 | else | 1224 | else |
1200 | { | 1225 | { |
@@ -1648,13 +1673,16 @@ void LLPanelObject::sendPosition() | |||
1648 | 1673 | ||
1649 | void LLPanelObject::sendSculpt() | 1674 | void LLPanelObject::sendSculpt() |
1650 | { | 1675 | { |
1651 | LLTextureCtrl* mTextureCtrl = gUICtrlFactory->getTexturePickerByName(this,"sculpt texture control"); | 1676 | if (mObject.isNull()) |
1652 | if(!mTextureCtrl) | ||
1653 | return; | 1677 | return; |
1654 | 1678 | ||
1655 | LLSculptParams sculpt_params; | 1679 | LLSculptParams sculpt_params; |
1656 | sculpt_params.setSculptTexture(mTextureCtrl->getImageAssetID()); | 1680 | |
1657 | sculpt_params.setSculptType(LL_SCULPT_TYPE_SPHERE); | 1681 | if (mCtrlSculptTexture) |
1682 | sculpt_params.setSculptTexture(mCtrlSculptTexture->getImageAssetID()); | ||
1683 | |||
1684 | if (mCtrlSculptType) | ||
1685 | sculpt_params.setSculptType(mCtrlSculptType->getCurrentIndex()); | ||
1658 | 1686 | ||
1659 | mObject->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE); | 1687 | mObject->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE); |
1660 | } | 1688 | } |
@@ -1863,7 +1891,9 @@ void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata) | |||
1863 | LLTextureCtrl* mTextureCtrl = gUICtrlFactory->getTexturePickerByName(self, "sculpt texture control"); | 1891 | LLTextureCtrl* mTextureCtrl = gUICtrlFactory->getTexturePickerByName(self, "sculpt texture control"); |
1864 | 1892 | ||
1865 | if (mTextureCtrl) | 1893 | if (mTextureCtrl) |
1894 | { | ||
1866 | self->mSculptTextureRevert = mTextureCtrl->getImageAssetID(); | 1895 | self->mSculptTextureRevert = mTextureCtrl->getImageAssetID(); |
1896 | } | ||
1867 | 1897 | ||
1868 | self->sendSculpt(); | 1898 | self->sendSculpt(); |
1869 | } | 1899 | } |
@@ -1890,7 +1920,6 @@ BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdat | |||
1890 | mTextureCtrl->setImageAssetID(asset); | 1920 | mTextureCtrl->setImageAssetID(asset); |
1891 | self->mSculptTextureRevert = asset; | 1921 | self->mSculptTextureRevert = asset; |
1892 | } | 1922 | } |
1893 | |||
1894 | 1923 | ||
1895 | return TRUE; | 1924 | return TRUE; |
1896 | } | 1925 | } |
@@ -1909,3 +1938,11 @@ void LLPanelObject::onCancelSculpt(LLUICtrl* ctrl, void* userdata) | |||
1909 | 1938 | ||
1910 | self->sendSculpt(); | 1939 | self->sendSculpt(); |
1911 | } | 1940 | } |
1941 | |||
1942 | // static | ||
1943 | void LLPanelObject::onCommitSculptType(LLUICtrl *ctrl, void* userdata) | ||
1944 | { | ||
1945 | LLPanelObject* self = (LLPanelObject*) userdata; | ||
1946 | |||
1947 | self->sendSculpt(); | ||
1948 | } | ||