Merge branch 'master' of git://github.com/Lirusaito/SingularityViewer into VoiceUpdate
Conflicts: indra/newview/llpanelface.* -Knew these would conflict just from proximity
This commit is contained in:
@@ -3,10 +3,9 @@
|
||||
* @brief LLColorSwatch class implementation
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -277,11 +276,11 @@ void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
|
||||
|
||||
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
|
||||
{
|
||||
subject->mOnCancelCallback(subject, subject->mCallbackUserData);
|
||||
subject->mOnCancelCallback(subject, LLSD());
|
||||
}
|
||||
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
|
||||
{
|
||||
subject->mOnSelectCallback(subject, subject->mCallbackUserData);
|
||||
subject->mOnSelectCallback(subject, LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief LLColorSwatch class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -70,8 +69,8 @@ public:
|
||||
void setValid(BOOL valid);
|
||||
void setLabel(const std::string& label);
|
||||
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
|
||||
void setOnCancelCallback(LLUICtrlCallback cb) { mOnCancelCallback = cb; }
|
||||
void setOnSelectCallback(LLUICtrlCallback cb) { mOnSelectCallback = cb; }
|
||||
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
|
||||
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
|
||||
void setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
|
||||
|
||||
void showPicker(BOOL take_focus);
|
||||
@@ -96,8 +95,8 @@ protected:
|
||||
LLHandle<LLFloater> mPickerHandle;
|
||||
LLViewBorder* mBorder;
|
||||
BOOL mCanApplyImmediately;
|
||||
LLUICtrlCallback mOnCancelCallback;
|
||||
LLUICtrlCallback mOnSelectCallback;
|
||||
commit_callback_t mOnCancelCallback;
|
||||
commit_callback_t mOnSelectCallback;
|
||||
|
||||
LLPointer<LLUIImage> mAlphaGradientImage;
|
||||
std::string mFallbackImageName;
|
||||
|
||||
@@ -113,10 +113,9 @@ BOOL LLPanelFace::postBuild()
|
||||
{
|
||||
mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
|
||||
mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) );
|
||||
mTextureCtrl->setOnCancelCallback( LLPanelFace::onCancelTexture );
|
||||
mTextureCtrl->setOnSelectCallback( LLPanelFace::onSelectTexture );
|
||||
mTextureCtrl->setDragCallback(LLPanelFace::onDragTexture);
|
||||
mTextureCtrl->setCallbackUserData( this );
|
||||
mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) );
|
||||
mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) );
|
||||
mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
|
||||
mTextureCtrl->setFollowsTop();
|
||||
mTextureCtrl->setFollowsLeft();
|
||||
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
||||
@@ -144,9 +143,8 @@ BOOL LLPanelFace::postBuild()
|
||||
if(mColorSwatch)
|
||||
{
|
||||
mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2));
|
||||
mColorSwatch->setOnCancelCallback(LLPanelFace::onCancelColor);
|
||||
mColorSwatch->setOnSelectCallback(LLPanelFace::onSelectColor);
|
||||
mColorSwatch->setCallbackUserData( this );
|
||||
mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2));
|
||||
mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2));
|
||||
mColorSwatch->setFollowsTop();
|
||||
mColorSwatch->setFollowsLeft();
|
||||
mColorSwatch->setCanApplyImmediately(TRUE);
|
||||
@@ -1046,18 +1044,15 @@ void LLPanelFace::onCommitAlpha(const LLSD& data)
|
||||
sendAlpha();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelFace::onCancelColor(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelFace::onCancelColor(const LLSD& data)
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionRevertColors();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelFace::onSelectColor(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelFace::onSelectColor(const LLSD& data)
|
||||
{
|
||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
||||
LLSelectMgr::getInstance()->saveSelectedObjectColors();
|
||||
self->sendColor();
|
||||
sendColor();
|
||||
}
|
||||
|
||||
// static
|
||||
@@ -1096,7 +1091,7 @@ void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata)
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*)
|
||||
BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
|
||||
{
|
||||
BOOL accept = TRUE;
|
||||
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
|
||||
@@ -1119,18 +1114,15 @@ void LLPanelFace::onCommitTexture( const LLSD& data )
|
||||
sendTexture();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelFace::onCancelTexture(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelFace::onCancelTexture(const LLSD& data)
|
||||
{
|
||||
LLSelectMgr::getInstance()->selectionRevertTextures();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelFace::onSelectTexture(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelFace::onSelectTexture(const LLSD& data)
|
||||
{
|
||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
||||
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
|
||||
self->sendTexture();
|
||||
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
|
||||
sendTexture();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,28 +74,27 @@ protected:
|
||||
void sendMedia();
|
||||
|
||||
// this function is to return TRUE if the drag should succeed.
|
||||
static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
|
||||
static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item);
|
||||
|
||||
void onCommitTexture(const LLSD& data);
|
||||
static void onCancelTexture( LLUICtrl* ctrl, void* userdata);
|
||||
static void onSelectTexture( LLUICtrl* ctrl, void* userdata);
|
||||
void onCancelTexture(const LLSD& data);
|
||||
void onSelectTexture(const LLSD& data);
|
||||
void onCommitColor(const LLSD& data);
|
||||
void onCommitAlpha(const LLSD& data);
|
||||
static void onCancelColor( LLUICtrl* ctrl, void* userdata);
|
||||
static void onSelectColor( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
|
||||
void onCancelColor(const LLSD& data);
|
||||
void onSelectColor(const LLSD& data);
|
||||
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitBump( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitTexGen( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
|
||||
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onClickApply(void*);
|
||||
static void onClickAutoFix(void*);
|
||||
static void onClickCopy(void*);
|
||||
static void onClickPaste(void*);
|
||||
|
||||
static F32 valueGlow(LLViewerObject* object, S32 face);
|
||||
};
|
||||
|
||||
|
||||
@@ -339,11 +339,10 @@ BOOL LLPanelObject::postBuild()
|
||||
if (mCtrlSculptTexture)
|
||||
{
|
||||
mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE));
|
||||
mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt );
|
||||
mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt );
|
||||
mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt );
|
||||
mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt);
|
||||
mCtrlSculptTexture->setCallbackUserData( this );
|
||||
mCtrlSculptTexture->setCommitCallback( boost::bind(&LLPanelObject::onCommitSculpt, this, _2 ));
|
||||
mCtrlSculptTexture->setOnCancelCallback( boost::bind(&LLPanelObject::onCancelSculpt, this, _2 ));
|
||||
mCtrlSculptTexture->setOnSelectCallback( boost::bind(&LLPanelObject::onSelectSculpt, this, _2 ));
|
||||
mCtrlSculptTexture->setDropCallback( boost::bind(&LLPanelObject::onDropSculpt, this, _2 ));
|
||||
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
||||
mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
|
||||
// Allow any texture to be used during non-immediate mode.
|
||||
@@ -2361,60 +2360,49 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata )
|
||||
self->sendIsPhantom();
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelObject::onSelectSculpt(const LLSD& data)
|
||||
{
|
||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
||||
|
||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
||||
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||
|
||||
if (mTextureCtrl)
|
||||
{
|
||||
self->mSculptTextureRevert = mTextureCtrl->getImageAssetID();
|
||||
mSculptTextureRevert = mTextureCtrl->getImageAssetID();
|
||||
}
|
||||
|
||||
self->sendSculpt();
|
||||
sendSculpt();
|
||||
}
|
||||
|
||||
|
||||
void LLPanelObject::onCommitSculpt( LLUICtrl* ctrl, void* userdata )
|
||||
void LLPanelObject::onCommitSculpt( const LLSD& data )
|
||||
{
|
||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
||||
|
||||
self->sendSculpt();
|
||||
sendSculpt();
|
||||
}
|
||||
|
||||
// static
|
||||
BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdata)
|
||||
BOOL LLPanelObject::onDropSculpt(LLInventoryItem* item)
|
||||
{
|
||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
||||
|
||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
||||
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||
|
||||
if (mTextureCtrl)
|
||||
{
|
||||
LLUUID asset = item->getAssetUUID();
|
||||
|
||||
mTextureCtrl->setImageAssetID(asset);
|
||||
self->mSculptTextureRevert = asset;
|
||||
mSculptTextureRevert = asset;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLPanelObject::onCancelSculpt(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelObject::onCancelSculpt(const LLSD& data)
|
||||
{
|
||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
||||
|
||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
||||
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||
if(!mTextureCtrl)
|
||||
return;
|
||||
|
||||
mTextureCtrl->setImageAssetID(self->mSculptTextureRevert);
|
||||
mTextureCtrl->setImageAssetID(mSculptTextureRevert);
|
||||
|
||||
self->sendSculpt();
|
||||
sendSculpt();
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -95,10 +95,10 @@ public:
|
||||
|
||||
static void onCommitMaterial( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onCommitSculpt( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCancelSculpt( LLUICtrl* ctrl, void* userdata);
|
||||
static void onSelectSculpt( LLUICtrl* ctrl, void* userdata);
|
||||
static BOOL onDropSculpt( LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
|
||||
void onCommitSculpt(const LLSD& data);
|
||||
void onCancelSculpt(const LLSD& data);
|
||||
void onSelectSculpt(const LLSD& data);
|
||||
BOOL onDropSculpt(LLInventoryItem* item);
|
||||
static void onCommitSculptType( LLUICtrl *ctrl, void* userdata);
|
||||
|
||||
static void onClickBuildConstants(void *);
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief Object editing (position, scale, etc.) in the tools floater
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -117,16 +116,16 @@ BOOL LLPanelVolume::postBuild()
|
||||
childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this);
|
||||
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||
if(LightColorSwatch){
|
||||
LightColorSwatch->setOnCancelCallback(onLightCancelColor);
|
||||
LightColorSwatch->setOnSelectCallback(onLightSelectColor);
|
||||
LightColorSwatch->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelColor, this, _2));
|
||||
LightColorSwatch->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectColor, this, _2));
|
||||
childSetCommitCallback("colorswatch",onCommitLight,this);
|
||||
}
|
||||
|
||||
LLTextureCtrl* LightTexPicker = getChild<LLTextureCtrl>("light texture control");
|
||||
if (LightTexPicker)
|
||||
{
|
||||
LightTexPicker->setOnCancelCallback(onLightCancelTexture);
|
||||
LightTexPicker->setOnSelectCallback(onLightSelectTexture);
|
||||
LightTexPicker->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelTexture, this, _2));
|
||||
LightTexPicker->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectTexture, this, _2));
|
||||
childSetCommitCallback("light texture control", onCommitLight, this);
|
||||
}
|
||||
|
||||
@@ -650,31 +649,28 @@ void LLPanelVolume::refreshCost()
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVolume::onLightCancelColor(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelVolume::onLightCancelColor(const LLSD& data)
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
|
||||
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||
if(LightColorSwatch)
|
||||
{
|
||||
LightColorSwatch->setColor(self->mLightSavedColor);
|
||||
LightColorSwatch->setColor(mLightSavedColor);
|
||||
}
|
||||
onLightSelectColor(NULL, userdata);
|
||||
onLightSelectColor(data);
|
||||
}
|
||||
|
||||
void LLPanelVolume::onLightCancelTexture(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelVolume::onLightCancelTexture(const LLSD& data)
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
|
||||
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
|
||||
if (LightTextureCtrl)
|
||||
{
|
||||
LightTextureCtrl->setImageAssetID(self->mLightSavedTexture);
|
||||
LightTextureCtrl->setImageAssetID(mLightSavedTexture);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVolume::onLightSelectColor(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelVolume::onLightSelectColor(const LLSD& data)
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
LLViewerObject* objectp = self->mObject;
|
||||
LLViewerObject* objectp = mObject;
|
||||
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
|
||||
{
|
||||
return;
|
||||
@@ -682,32 +678,31 @@ void LLPanelVolume::onLightSelectColor(LLUICtrl* ctrl, void* userdata)
|
||||
LLVOVolume *volobjp = (LLVOVolume *)objectp;
|
||||
|
||||
|
||||
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
|
||||
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||
if(LightColorSwatch)
|
||||
{
|
||||
LLColor4 clr = LightColorSwatch->get();
|
||||
LLColor3 clr3( clr );
|
||||
volobjp->setLightColor(clr3);
|
||||
self->mLightSavedColor = clr;
|
||||
mLightSavedColor = clr;
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelVolume::onLightSelectTexture(LLUICtrl* ctrl, void* userdata)
|
||||
void LLPanelVolume::onLightSelectTexture(const LLSD& data)
|
||||
{
|
||||
LLPanelVolume* self = (LLPanelVolume*) userdata;
|
||||
LLVOVolume *volobjp = (LLVOVolume*)self->mObject.get();
|
||||
if (!volobjp || (volobjp->getPCode() != LL_PCODE_VOLUME))
|
||||
if (mObject.isNull() || (mObject->getPCode() != LL_PCODE_VOLUME))
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLVOVolume *volobjp = (LLVOVolume *) mObject.get();
|
||||
|
||||
|
||||
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
|
||||
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
|
||||
if(LightTextureCtrl)
|
||||
{
|
||||
LLUUID id = LightTextureCtrl->getImageAssetID();
|
||||
volobjp->setLightTextureID(id);
|
||||
self->mLightSavedTexture = id;
|
||||
mLightSavedTexture = id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
* @brief Object editing (position, scale, etc.) in the tools floater
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -45,7 +44,6 @@ class LLUICtrl;
|
||||
class LLButton;
|
||||
class LLViewerObject;
|
||||
class LLComboBox;
|
||||
class LLPanelObjectInventory;
|
||||
class LLColorSwatchCtrl;
|
||||
|
||||
class LLPanelVolume : public LLPanel
|
||||
@@ -72,11 +70,11 @@ public:
|
||||
static void onCommitFlexible( LLUICtrl* ctrl, void* userdata);
|
||||
static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
static void onLightCancelColor(LLUICtrl* ctrl, void* userdata);
|
||||
static void onLightSelectColor(LLUICtrl* ctrl, void* userdata);
|
||||
void onLightCancelColor(const LLSD& data);
|
||||
void onLightSelectColor(const LLSD& data);
|
||||
|
||||
static void onLightCancelTexture(LLUICtrl* ctrl, void* userdata);
|
||||
static void onLightSelectTexture(LLUICtrl* ctrl, void* userdata);
|
||||
void onLightCancelTexture(const LLSD& data);
|
||||
void onLightSelectTexture(const LLSD& data);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
* @brief LLTextureCtrl class implementation including related functions
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -285,12 +284,11 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
LLInventoryItem* itemp = gInventory.getItem(image_id);
|
||||
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
|
||||
{
|
||||
// no copy texture
|
||||
childSetValue("apply_immediate_check", FALSE);
|
||||
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
|
||||
mNoCopyTextureSelected = TRUE;
|
||||
}
|
||||
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
|
||||
@@ -300,7 +298,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
|
||||
|
||||
void LLFloaterTexturePicker::setActive( BOOL active )
|
||||
{
|
||||
if (!active && childGetValue("Pipette").asBoolean())
|
||||
if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean())
|
||||
{
|
||||
stopUsingPipette();
|
||||
}
|
||||
@@ -312,7 +310,7 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
|
||||
mCanApplyImmediately = b;
|
||||
if (!mCanApplyImmediately)
|
||||
{
|
||||
childSetValue("apply_immediate_check", FALSE);
|
||||
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
|
||||
}
|
||||
updateFilterPermMask();
|
||||
}
|
||||
@@ -491,7 +489,7 @@ BOOL LLFloaterTexturePicker::postBuild()
|
||||
// tag: vaa emerald local_asset_browser [end]
|
||||
|
||||
childSetCommitCallback("show_folders_check", onShowFolders, this);
|
||||
childSetVisible("show_folders_check", FALSE);
|
||||
getChildView("show_folders_check")->setVisible( FALSE);
|
||||
|
||||
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
|
||||
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
|
||||
@@ -529,12 +527,12 @@ BOOL LLFloaterTexturePicker::postBuild()
|
||||
|
||||
mNoCopyTextureSelected = FALSE;
|
||||
|
||||
childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately"));
|
||||
getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately"));
|
||||
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
|
||||
|
||||
if (!mCanApplyImmediately)
|
||||
{
|
||||
childSetEnabled("show_folders_check", FALSE);
|
||||
getChildView("show_folders_check")->setEnabled(FALSE);
|
||||
}
|
||||
|
||||
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
|
||||
@@ -608,10 +606,10 @@ void LLFloaterTexturePicker::draw()
|
||||
updateImageStats();
|
||||
|
||||
// if we're inactive, gray out "apply immediate" checkbox
|
||||
childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
|
||||
childSetEnabled("Select", mActive);
|
||||
childSetEnabled("Pipette", mActive);
|
||||
childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
|
||||
getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
|
||||
getChildView("Select")->setEnabled(mActive);
|
||||
getChildView("Pipette")->setEnabled(mActive);
|
||||
getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
|
||||
|
||||
//RN: reset search bar to reflect actual search query (all caps, for example)
|
||||
mFilterEdit->setText(mInventoryPanel->getFilterSubString());
|
||||
@@ -634,11 +632,11 @@ void LLFloaterTexturePicker::draw()
|
||||
mTentativeLabel->setVisible( FALSE );
|
||||
}
|
||||
|
||||
childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID());
|
||||
childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID );
|
||||
childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
|
||||
childSetEnabled("Invisible", mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID );
|
||||
childSetEnabled("Alpha", mImageAssetID != mAlphaImageAssetID );
|
||||
getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID());
|
||||
getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID);
|
||||
getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
|
||||
getChildView("Invisible")->setEnabled(mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID);
|
||||
getChildView("Alpha")->setEnabled(mImageAssetID != mAlphaImageAssetID);
|
||||
|
||||
LLFloater::draw();
|
||||
|
||||
@@ -764,14 +762,14 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co
|
||||
|
||||
PermissionMask LLFloaterTexturePicker::getFilterPermMask()
|
||||
{
|
||||
bool apply_immediate = childGetValue("apply_immediate_check").asBoolean();
|
||||
bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean();
|
||||
return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask;
|
||||
}
|
||||
|
||||
void LLFloaterTexturePicker::commitIfImmediateSet()
|
||||
{
|
||||
bool apply_immediate = childGetValue("apply_immediate_check").asBoolean();
|
||||
if (!mNoCopyTextureSelected && apply_immediate && mOwner)
|
||||
bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean();
|
||||
if (!mNoCopyTextureSelected && mOwner && apply_immediate)
|
||||
{
|
||||
mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE);
|
||||
}
|
||||
@@ -1075,7 +1073,7 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te )
|
||||
}
|
||||
else
|
||||
{
|
||||
LLToolPipette::getInstance()->setResult(FALSE, "You do not have a copy this \nof texture in your inventory");
|
||||
LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1273,7 +1271,6 @@ void LLTextureCtrl::setEnabled( BOOL enabled )
|
||||
mEnable = enabled;
|
||||
|
||||
LLView::setEnabled( enabled );
|
||||
|
||||
}
|
||||
|
||||
void LLTextureCtrl::setValid(BOOL valid )
|
||||
@@ -1421,11 +1418,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
|
||||
lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
|
||||
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
||||
{
|
||||
mOnSelectCallback(this, mCallbackUserData);
|
||||
mOnSelectCallback( this, LLSD() );
|
||||
}
|
||||
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
||||
{
|
||||
mOnCancelCallback(this, mCallbackUserData);
|
||||
mOnCancelCallback( this, LLSD() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1454,11 +1451,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id)
|
||||
|
||||
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
||||
{
|
||||
mOnSelectCallback(this, mCallbackUserData);
|
||||
mOnSelectCallback(this, LLSD());
|
||||
}
|
||||
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
||||
{
|
||||
mOnCancelCallback(this, mCallbackUserData);
|
||||
mOnCancelCallback(this, LLSD());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1574,7 +1571,6 @@ void LLTextureCtrl::draw()
|
||||
|
||||
mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() );
|
||||
|
||||
|
||||
// Show "Loading..." string on the top left corner while this texture is loading.
|
||||
// Using the discard level, do not show the string if the texture is almost but not
|
||||
// fully loaded.
|
||||
@@ -1611,13 +1607,12 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item)
|
||||
|
||||
// PermissionMask filter_perm_mask = mCanApplyImmediately ? commented out due to no-copy texture loss.
|
||||
// mImmediateFilterPermMask : mNonImmediateFilterPermMask;
|
||||
|
||||
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
|
||||
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
|
||||
{
|
||||
if(mDragCallback)
|
||||
{
|
||||
return mDragCallback(this, item, mCallbackUserData);
|
||||
return mDragCallback(this, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1637,7 +1632,7 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item)
|
||||
{
|
||||
// if it returns TRUE, we return TRUE, and therefore the
|
||||
// commit is called above.
|
||||
return mDropCallback(this, item, mCallbackUserData);
|
||||
return mDropCallback(this, item);
|
||||
}
|
||||
|
||||
// no callback installed, so just set the image ids and carry on.
|
||||
@@ -1667,64 +1662,6 @@ LLSD LLTextureCtrl::getValue() const
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// LLToolTexEyedropper
|
||||
|
||||
class LLToolTexEyedropper : public LLTool
|
||||
{
|
||||
public:
|
||||
LLToolTexEyedropper( void (*callback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata ), void* userdata );
|
||||
virtual ~LLToolTexEyedropper();
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
|
||||
protected:
|
||||
void (*mCallback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata );
|
||||
void* mCallbackUserData;
|
||||
};
|
||||
|
||||
|
||||
LLToolTexEyedropper::LLToolTexEyedropper(
|
||||
void (*callback)(const LLUUID& obj_id, const LLUUID& image_id, void* userdata ),
|
||||
void* userdata )
|
||||
: LLTool(std::string("texeyedropper")),
|
||||
mCallback( callback ),
|
||||
mCallbackUserData( userdata )
|
||||
{
|
||||
}
|
||||
|
||||
LLToolTexEyedropper::~LLToolTexEyedropper()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BOOL LLToolTexEyedropper::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
// this will affect framerate on mouse down
|
||||
const LLPickInfo& pick = gViewerWindow->pickImmediate(x, y, FALSE);
|
||||
LLViewerObject* hit_obj = pick.getObject();
|
||||
if (hit_obj &&
|
||||
!hit_obj->isAvatar())
|
||||
{
|
||||
if( (0 <= pick.mObjectFace) && (pick.mObjectFace < hit_obj->getNumTEs()) )
|
||||
{
|
||||
LLViewerTexture* image = hit_obj->getTEImage( pick.mObjectFace );
|
||||
if( image )
|
||||
{
|
||||
if( mCallback )
|
||||
{
|
||||
mCallback( hit_obj->getID(), image->getID(), mCallbackUserData );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL LLToolTexEyedropper::handleHover(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolTexEyedropper" << llendl;
|
||||
gViewerWindow->getWindow()->setCursor(UI_CURSOR_CROSS); // TODO: better cursor
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
* @brief LLTextureCtrl class header file including related functions
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
@@ -48,7 +47,8 @@ class LLViewBorder;
|
||||
class LLViewerFetchedTexture;
|
||||
|
||||
// used for setting drag & drop callbacks.
|
||||
typedef BOOL (*drag_n_drop_callback)(LLUICtrl*, LLInventoryItem*, void*);
|
||||
typedef boost::function<BOOL (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// LLTextureCtrl
|
||||
@@ -154,9 +154,9 @@ public:
|
||||
// necessariliy any other change.
|
||||
void setDropCallback(drag_n_drop_callback cb) { mDropCallback = cb; }
|
||||
|
||||
void setOnCancelCallback(LLUICtrlCallback cb) { mOnCancelCallback = cb; }
|
||||
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
|
||||
|
||||
void setOnSelectCallback(LLUICtrlCallback cb) { mOnSelectCallback = cb; }
|
||||
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
|
||||
|
||||
void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder);
|
||||
|
||||
@@ -170,8 +170,8 @@ private:
|
||||
private:
|
||||
drag_n_drop_callback mDragCallback;
|
||||
drag_n_drop_callback mDropCallback;
|
||||
LLUICtrlCallback mOnCancelCallback;
|
||||
LLUICtrlCallback mOnSelectCallback;
|
||||
commit_callback_t mOnCancelCallback;
|
||||
commit_callback_t mOnSelectCallback;
|
||||
LLPointer<LLViewerFetchedTexture> mTexturep;
|
||||
LLColor4 mBorderColor;
|
||||
LLUUID mImageItemID;
|
||||
|
||||
@@ -3037,6 +3037,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
|
||||
|
||||
<!-- inventory -->
|
||||
<string name="InventoryNoMatchingItems">No matching items found in inventory.</string>
|
||||
<string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string>
|
||||
<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
|
||||
<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3</string>
|
||||
<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
|
||||
|
||||
@@ -2953,6 +2953,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
|
||||
|
||||
<!-- inventory -->
|
||||
<string name="InventoryNoMatchingItems">Elementos no hallados en el inventario.</string>
|
||||
<string name="InventoryNoTexture">No tienes en tu inventario una copia de esta textura</string>
|
||||
<string name="MarketplaceURL">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/</string>
|
||||
<string name="MarketplaceURL_CreateStore">http://community.secondlife.com/t5/English-Knowledge-Base/Selling-in-the-Marketplace/ta-p/700193#Section_.3</string>
|
||||
<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
|
||||
|
||||
@@ -455,6 +455,9 @@
|
||||
<string name="choose_the_directory">
|
||||
Choisir le répertoire
|
||||
</string>
|
||||
<string name="InventoryNoTexture">
|
||||
Vous n'avez pas de copie de cette texture dans votre inventaire
|
||||
</string>
|
||||
<string name="conference-title">
|
||||
Chat à plusieurs
|
||||
</string>
|
||||
|
||||
@@ -205,6 +205,10 @@
|
||||
<string name="load_files">Carregar Arquivos</string>
|
||||
<string name="choose_the_directory">Escolher Diretório</string>
|
||||
|
||||
<string name="InventoryNoTexture">
|
||||
Você não possui uma cópia desta textura no seu inventário
|
||||
</string>
|
||||
|
||||
<string name="conference-title">
|
||||
Bate-papo com várias pessoas
|
||||
</string>
|
||||
|
||||
Reference in New Issue
Block a user