summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r--indra/newview/llpanelobject.cpp99
1 files changed, 6 insertions, 93 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 64af6c2157..b4d0ada196 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -33,11 +33,9 @@
#include "lleconomy.h"
#include "llerror.h"
#include "llfontgl.h"
-#include "llmaterialtable.h"
#include "llpermissionsflags.h"
#include "llstring.h"
#include "llvolume.h"
-#include "material_codes.h"
#include "m3math.h"
// project includes
@@ -57,7 +55,6 @@
#include "lltool.h"
#include "lltoolcomp.h"
#include "lltoolmgr.h"
-#include "lltrans.h"
#include "llui.h"
#include "llviewerobject.h"
#include "llviewerregion.h"
@@ -101,17 +98,6 @@ BOOL LLPanelObject::postBuild()
{
setMouseOpaque(FALSE);
- std::map<std::string, std::string> material_name_map;
- material_name_map["Stone"]= LLTrans::getString("Stone");
- material_name_map["Metal"]= LLTrans::getString("Metal");
- material_name_map["Glass"]= LLTrans::getString("Glass");
- material_name_map["Wood"]= LLTrans::getString("Wood");
- material_name_map["Flesh"]= LLTrans::getString("Flesh");
- material_name_map["Plastic"]= LLTrans::getString("Plastic");
- material_name_map["Rubber"]= LLTrans::getString("Rubber");
- material_name_map["Light"]= LLTrans::getString("Light");
-
- LLMaterialTable::basic.initTableTransNames(material_name_map);
//--------------------------------------------------------
// Top
//--------------------------------------------------------
@@ -166,22 +152,6 @@ BOOL LLPanelObject::postBuild()
//--------------------------------------------------------
- // material type popup
- mComboMaterial = getChild<LLComboBox>("material");
- childSetCommitCallback("material",onCommitMaterial,this);
- mComboMaterial->removeall();
-
- for (LLMaterialTable::info_list_t::iterator iter = LLMaterialTable::basic.mMaterialInfoList.begin();
- iter != LLMaterialTable::basic.mMaterialInfoList.end(); ++iter)
- {
- LLMaterialInfo* minfop = *iter;
- if (minfop->mMCode != LL_MCODE_LIGHT)
- {
- mComboMaterial->add(minfop->mName);
- }
- }
- mComboMaterialItemCount = mComboMaterial->getItemCount();
-
// Base Type
mComboBaseType = getChild<LLComboBox>("comboBaseType");
childSetCommitCallback("comboBaseType",onCommitParametric,this);
@@ -309,7 +279,6 @@ BOOL LLPanelObject::postBuild()
LLPanelObject::LLPanelObject()
: LLPanel(),
- mComboMaterialItemCount(0),
mIsPhysical(FALSE),
mIsTemporary(FALSE),
mIsPhantom(FALSE),
@@ -527,43 +496,6 @@ void LLPanelObject::getState( )
mCheckCastShadows->setEnabled( roots_selected==1 && editable );
#endif
- // Update material part
- // slightly inefficient - materials are unique per object, not per TE
- U8 material_code = 0;
- struct f : public LLSelectedTEGetFunctor<U8>
- {
- U8 get(LLViewerObject* object, S32 te)
- {
- return object->getMaterial();
- }
- } func;
- bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code );
- std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright");
- if (editable && single_volume && material_same)
- {
- mComboMaterial->setEnabled( TRUE );
- if (material_code == LL_MCODE_LIGHT)
- {
- if (mComboMaterial->getItemCount() == mComboMaterialItemCount)
- {
- mComboMaterial->add(LEGACY_FULLBRIGHT_DESC);
- }
- mComboMaterial->setSimple(LEGACY_FULLBRIGHT_DESC);
- }
- else
- {
- if (mComboMaterial->getItemCount() != mComboMaterialItemCount)
- {
- mComboMaterial->remove(LEGACY_FULLBRIGHT_DESC);
- }
-
- mComboMaterial->setSimple(std::string(LLMaterialTable::basic.getName(material_code)));
- }
- }
- else
- {
- mComboMaterial->setEnabled( FALSE );
- }
//----------------------------------------------------------------------------
S32 selected_item = MI_BOX;
@@ -1095,12 +1027,9 @@ void LLPanelObject::getState( )
mCtrlSculptTexture->setVisible(sculpt_texture_visible);
mLabelSculptType->setVisible(sculpt_texture_visible);
mCtrlSculptType->setVisible(sculpt_texture_visible);
- mCtrlSculptMirror->setVisible(sculpt_texture_visible);
- mCtrlSculptInvert->setVisible(sculpt_texture_visible);
// sculpt texture
-
if (selected_item == MI_SCULPT)
{
@@ -1145,7 +1074,7 @@ void LLPanelObject::getState( )
if (mCtrlSculptMirror)
{
mCtrlSculptMirror->set(sculpt_mirror);
- mCtrlSculptMirror->setEnabled(editable);
+ mCtrlSculptMirror->setEnabled(editable && !isMesh);
}
if (mCtrlSculptInvert)
@@ -1166,6 +1095,9 @@ void LLPanelObject::getState( )
mSculptTextureRevert = LLUUID::null;
}
+ mCtrlSculptMirror->setVisible(sculpt_texture_visible && !isMesh);
+ mCtrlSculptInvert->setVisible(sculpt_texture_visible && !isMesh);
+
//----------------------------------------------------------------------------
mObject = objectp;
@@ -1245,25 +1177,6 @@ void LLPanelObject::sendCastShadows()
}
// static
-void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata )
-{
- //LLPanelObject* self = (LLPanelObject*) userdata;
- LLComboBox* box = (LLComboBox*) ctrl;
-
- if (box)
- {
- // apply the currently selected material to the object
- const std::string& material_name = box->getSimple();
- std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright");
- if (material_name != LEGACY_FULLBRIGHT_DESC)
- {
- U8 material_code = LLMaterialTable::basic.getMCode(material_name);
- LLSelectMgr::getInstance()->selectionSetMaterial(material_code);
- }
- }
-}
-
-// static
void LLPanelObject::onCommitParametric( LLUICtrl* ctrl, void* userdata )
{
LLPanelObject* self = (LLPanelObject*) userdata;
@@ -1829,7 +1742,8 @@ void LLPanelObject::refresh()
bool enable_mesh = gSavedSettings.getBOOL("MeshEnabled") &&
gAgent.getRegion() &&
- !gAgent.getRegion()->getCapability("GetMesh").empty();
+ !gAgent.getRegion()->getCapability("GetMesh").empty() &&
+ !gAgent.getRegion()->getCapability("ObjectAdd").empty();
F32 max_scale = get_default_max_prim_scale(LLPickInfo::isFlora(mObject));
@@ -1937,7 +1851,6 @@ void LLPanelObject::clearCtrls()
mCheckCastShadows->set(FALSE);
mCheckCastShadows->setEnabled( FALSE );
#endif
- mComboMaterial ->setEnabled( FALSE );
// Disable text labels
mLabelPosition ->setEnabled( FALSE );
mLabelSize ->setEnabled( FALSE );