Fix the crash upon hitting select for an object's light color feature
Modernizes LLTextureControl(, LLFloaterTexturePicker) and LLColorSwatch Updates LLPanelVolume, LLPanelObject, and LLPanelFace to prevent related crashes and compile. Adds translation string InventoryNoTexture to strings.xml (added to all existing translations from upstream translation)
This commit is contained in:
@@ -3,10 +3,9 @@
|
|||||||
* @brief LLColorSwatch class implementation
|
* @brief LLColorSwatch class implementation
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("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)
|
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
|
||||||
{
|
{
|
||||||
subject->mOnCancelCallback(subject, subject->mCallbackUserData);
|
subject->mOnCancelCallback(subject, LLSD());
|
||||||
}
|
}
|
||||||
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
|
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
|
||||||
{
|
{
|
||||||
subject->mOnSelectCallback(subject, subject->mCallbackUserData);
|
subject->mOnSelectCallback(subject, LLSD());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
* @brief LLColorSwatch class definition
|
* @brief LLColorSwatch class definition
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||||
@@ -70,8 +69,8 @@ public:
|
|||||||
void setValid(BOOL valid);
|
void setValid(BOOL valid);
|
||||||
void setLabel(const std::string& label);
|
void setLabel(const std::string& label);
|
||||||
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
|
void setCanApplyImmediately(BOOL apply) { mCanApplyImmediately = apply; }
|
||||||
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 setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
|
void setFallbackImageName(const std::string& name) { mFallbackImageName = name; }
|
||||||
|
|
||||||
void showPicker(BOOL take_focus);
|
void showPicker(BOOL take_focus);
|
||||||
@@ -96,8 +95,8 @@ protected:
|
|||||||
LLHandle<LLFloater> mPickerHandle;
|
LLHandle<LLFloater> mPickerHandle;
|
||||||
LLViewBorder* mBorder;
|
LLViewBorder* mBorder;
|
||||||
BOOL mCanApplyImmediately;
|
BOOL mCanApplyImmediately;
|
||||||
LLUICtrlCallback mOnCancelCallback;
|
commit_callback_t mOnCancelCallback;
|
||||||
LLUICtrlCallback mOnSelectCallback;
|
commit_callback_t mOnSelectCallback;
|
||||||
|
|
||||||
LLPointer<LLUIImage> mAlphaGradientImage;
|
LLPointer<LLUIImage> mAlphaGradientImage;
|
||||||
std::string mFallbackImageName;
|
std::string mFallbackImageName;
|
||||||
|
|||||||
@@ -92,11 +92,10 @@ BOOL LLPanelFace::postBuild()
|
|||||||
if(mTextureCtrl)
|
if(mTextureCtrl)
|
||||||
{
|
{
|
||||||
mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
|
mTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
|
||||||
mTextureCtrl->setCommitCallback( LLPanelFace::onCommitTexture );
|
mTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitTexture, this, _2) );
|
||||||
mTextureCtrl->setOnCancelCallback( LLPanelFace::onCancelTexture );
|
mTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelTexture, this, _2) );
|
||||||
mTextureCtrl->setOnSelectCallback( LLPanelFace::onSelectTexture );
|
mTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectTexture, this, _2) );
|
||||||
mTextureCtrl->setDragCallback(LLPanelFace::onDragTexture);
|
mTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
|
||||||
mTextureCtrl->setCallbackUserData( this );
|
|
||||||
mTextureCtrl->setFollowsTop();
|
mTextureCtrl->setFollowsTop();
|
||||||
mTextureCtrl->setFollowsLeft();
|
mTextureCtrl->setFollowsLeft();
|
||||||
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
||||||
@@ -123,10 +122,9 @@ BOOL LLPanelFace::postBuild()
|
|||||||
mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||||
if(mColorSwatch)
|
if(mColorSwatch)
|
||||||
{
|
{
|
||||||
mColorSwatch->setCommitCallback(LLPanelFace::onCommitColor);
|
mColorSwatch->setCommitCallback(boost::bind(&LLPanelFace::onCommitColor, this, _2));
|
||||||
mColorSwatch->setOnCancelCallback(LLPanelFace::onCancelColor);
|
mColorSwatch->setOnCancelCallback(boost::bind(&LLPanelFace::onCancelColor, this, _2));
|
||||||
mColorSwatch->setOnSelectCallback(LLPanelFace::onSelectColor);
|
mColorSwatch->setOnSelectCallback(boost::bind(&LLPanelFace::onSelectColor, this, _2));
|
||||||
mColorSwatch->setCallbackUserData( this );
|
|
||||||
mColorSwatch->setFollowsTop();
|
mColorSwatch->setFollowsTop();
|
||||||
mColorSwatch->setFollowsLeft();
|
mColorSwatch->setFollowsLeft();
|
||||||
mColorSwatch->setCanApplyImmediately(TRUE);
|
mColorSwatch->setCanApplyImmediately(TRUE);
|
||||||
@@ -142,8 +140,7 @@ BOOL LLPanelFace::postBuild()
|
|||||||
mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans");
|
mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans");
|
||||||
if(mCtrlColorTransp)
|
if(mCtrlColorTransp)
|
||||||
{
|
{
|
||||||
mCtrlColorTransp->setCommitCallback(LLPanelFace::onCommitAlpha);
|
mCtrlColorTransp->setCommitCallback(boost::bind(&LLPanelFace::onCommitAlpha, this, _2));
|
||||||
mCtrlColorTransp->setCallbackUserData(this);
|
|
||||||
mCtrlColorTransp->setPrecision(0);
|
mCtrlColorTransp->setPrecision(0);
|
||||||
mCtrlColorTransp->setFollowsTop();
|
mCtrlColorTransp->setFollowsTop();
|
||||||
mCtrlColorTransp->setFollowsLeft();
|
mCtrlColorTransp->setFollowsLeft();
|
||||||
@@ -152,23 +149,20 @@ BOOL LLPanelFace::postBuild()
|
|||||||
mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright");
|
mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright");
|
||||||
if (mCheckFullbright)
|
if (mCheckFullbright)
|
||||||
{
|
{
|
||||||
mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright);
|
mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright, this);
|
||||||
mCheckFullbright->setCallbackUserData( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mComboTexGen = getChild<LLComboBox>("combobox texgen");
|
mComboTexGen = getChild<LLComboBox>("combobox texgen");
|
||||||
if(mComboTexGen)
|
if(mComboTexGen)
|
||||||
{
|
{
|
||||||
mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen);
|
mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen, this);
|
||||||
mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
|
mComboTexGen->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP);
|
||||||
mComboTexGen->setCallbackUserData( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mCtrlGlow = getChild<LLSpinCtrl>("glow");
|
mCtrlGlow = getChild<LLSpinCtrl>("glow");
|
||||||
if(mCtrlGlow)
|
if(mCtrlGlow)
|
||||||
{
|
{
|
||||||
mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow);
|
mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow, this);
|
||||||
mCtrlGlow->setCallbackUserData(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
|
childSetCommitCallback("combobox shininess",&LLPanelFace::onCommitShiny,this);
|
||||||
@@ -1017,32 +1011,25 @@ F32 LLPanelFace::valueGlow(LLViewerObject* object, S32 face)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onCommitColor(const LLSD& data)
|
||||||
void LLPanelFace::onCommitColor(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
sendColor();
|
||||||
self->sendColor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onCommitAlpha(const LLSD& data)
|
||||||
void LLPanelFace::onCommitAlpha(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
sendAlpha();
|
||||||
self->sendAlpha();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onCancelColor(const LLSD& data)
|
||||||
void LLPanelFace::onCancelColor(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLSelectMgr::getInstance()->selectionRevertColors();
|
LLSelectMgr::getInstance()->selectionRevertColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onSelectColor(const LLSD& data)
|
||||||
void LLPanelFace::onSelectColor(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
|
||||||
LLSelectMgr::getInstance()->saveSelectedObjectColors();
|
LLSelectMgr::getInstance()->saveSelectedObjectColors();
|
||||||
self->sendColor();
|
sendColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -1081,7 +1068,7 @@ void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*)
|
BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
|
||||||
{
|
{
|
||||||
BOOL accept = TRUE;
|
BOOL accept = TRUE;
|
||||||
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
|
for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
|
||||||
@@ -1098,28 +1085,21 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*)
|
|||||||
return accept;
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onCommitTexture( const LLSD& data )
|
||||||
void LLPanelFace::onCommitTexture( LLUICtrl* ctrl, void* userdata )
|
|
||||||
{
|
{
|
||||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
|
||||||
|
|
||||||
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
|
LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
|
||||||
|
sendTexture();
|
||||||
self->sendTexture();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onCancelTexture(const LLSD& data)
|
||||||
void LLPanelFace::onCancelTexture(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLSelectMgr::getInstance()->selectionRevertTextures();
|
LLSelectMgr::getInstance()->selectionRevertTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelFace::onSelectTexture(const LLSD& data)
|
||||||
void LLPanelFace::onSelectTexture(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelFace* self = (LLPanelFace*) userdata;
|
|
||||||
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
|
LLSelectMgr::getInstance()->saveSelectedObjectTextures();
|
||||||
self->sendTexture();
|
sendTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -70,28 +70,28 @@ protected:
|
|||||||
void sendFullbright(); // applies and sends full bright
|
void sendFullbright(); // applies and sends full bright
|
||||||
void sendGlow();
|
void sendGlow();
|
||||||
|
|
||||||
// this function is to return TRUE if the dra should succeed.
|
// 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);
|
||||||
|
|
||||||
static void onCommitTexture( LLUICtrl* ctrl, void* userdata);
|
void onCommitTexture(const LLSD& data);
|
||||||
static void onCancelTexture( LLUICtrl* ctrl, void* userdata);
|
void onCancelTexture(const LLSD& data);
|
||||||
static void onSelectTexture( LLUICtrl* ctrl, void* userdata);
|
void onSelectTexture(const LLSD& data);
|
||||||
|
void onCommitColor(const LLSD& data);
|
||||||
|
void onCommitAlpha(const LLSD& data);
|
||||||
|
void onCancelColor(const LLSD& data);
|
||||||
|
void onSelectColor(const LLSD& data);
|
||||||
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
|
static void onCommitTextureInfo( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitColor( LLUICtrl* ctrl, void* userdata);
|
|
||||||
static void onCommitAlpha( LLUICtrl* ctrl, void* userdata);
|
|
||||||
static void onCancelColor( LLUICtrl* ctrl, void* userdata);
|
|
||||||
static void onSelectColor( LLUICtrl* ctrl, void* userdata);
|
|
||||||
static void onCommitBump( LLUICtrl* ctrl, void* userdata);
|
static void onCommitBump( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitTexGen( LLUICtrl* ctrl, void* userdata);
|
static void onCommitTexGen( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
|
static void onCommitShiny( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
|
static void onCommitFullbright( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
|
static void onCommitGlow( LLUICtrl* ctrl, void *userdata);
|
||||||
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
|
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
|
||||||
|
|
||||||
static void onClickApply(void*);
|
static void onClickApply(void*);
|
||||||
static void onClickAutoFix(void*);
|
static void onClickAutoFix(void*);
|
||||||
static void onClickCopy(void*);
|
static void onClickCopy(void*);
|
||||||
static void onClickPaste(void*);
|
static void onClickPaste(void*);
|
||||||
|
|
||||||
static F32 valueGlow(LLViewerObject* object, S32 face);
|
static F32 valueGlow(LLViewerObject* object, S32 face);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -339,11 +339,10 @@ BOOL LLPanelObject::postBuild()
|
|||||||
if (mCtrlSculptTexture)
|
if (mCtrlSculptTexture)
|
||||||
{
|
{
|
||||||
mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE));
|
mCtrlSculptTexture->setDefaultImageAssetID(LLUUID(SCULPT_DEFAULT_TEXTURE));
|
||||||
mCtrlSculptTexture->setCommitCallback( LLPanelObject::onCommitSculpt );
|
mCtrlSculptTexture->setCommitCallback( boost::bind(&LLPanelObject::onCommitSculpt, this, _2 ));
|
||||||
mCtrlSculptTexture->setOnCancelCallback( LLPanelObject::onCancelSculpt );
|
mCtrlSculptTexture->setOnCancelCallback( boost::bind(&LLPanelObject::onCancelSculpt, this, _2 ));
|
||||||
mCtrlSculptTexture->setOnSelectCallback( LLPanelObject::onSelectSculpt );
|
mCtrlSculptTexture->setOnSelectCallback( boost::bind(&LLPanelObject::onSelectSculpt, this, _2 ));
|
||||||
mCtrlSculptTexture->setDropCallback(LLPanelObject::onDropSculpt);
|
mCtrlSculptTexture->setDropCallback( boost::bind(&LLPanelObject::onDropSculpt, this, _2 ));
|
||||||
mCtrlSculptTexture->setCallbackUserData( this );
|
|
||||||
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
// Don't allow (no copy) or (no transfer) textures to be selected during immediate mode
|
||||||
mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
|
mCtrlSculptTexture->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER);
|
||||||
// Allow any texture to be used during non-immediate mode.
|
// Allow any texture to be used during non-immediate mode.
|
||||||
@@ -2361,60 +2360,49 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata )
|
|||||||
self->sendIsPhantom();
|
self->sendIsPhantom();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
void LLPanelObject::onSelectSculpt(const LLSD& data)
|
||||||
void LLPanelObject::onSelectSculpt(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||||
|
|
||||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
|
||||||
|
|
||||||
if (mTextureCtrl)
|
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;
|
sendSculpt();
|
||||||
|
|
||||||
self->sendSculpt();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
BOOL LLPanelObject::onDropSculpt(LLInventoryItem* item)
|
||||||
BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||||
|
|
||||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
|
||||||
|
|
||||||
if (mTextureCtrl)
|
if (mTextureCtrl)
|
||||||
{
|
{
|
||||||
LLUUID asset = item->getAssetUUID();
|
LLUUID asset = item->getAssetUUID();
|
||||||
|
|
||||||
mTextureCtrl->setImageAssetID(asset);
|
mTextureCtrl->setImageAssetID(asset);
|
||||||
self->mSculptTextureRevert = asset;
|
mSculptTextureRevert = asset;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// static
|
void LLPanelObject::onCancelSculpt(const LLSD& data)
|
||||||
void LLPanelObject::onCancelSculpt(LLUICtrl* ctrl, void* userdata)
|
|
||||||
{
|
{
|
||||||
LLPanelObject* self = (LLPanelObject*) userdata;
|
LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control");
|
||||||
|
|
||||||
LLTextureCtrl* mTextureCtrl = self->getChild<LLTextureCtrl>("sculpt texture control");
|
|
||||||
if(!mTextureCtrl)
|
if(!mTextureCtrl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mTextureCtrl->setImageAssetID(self->mSculptTextureRevert);
|
mTextureCtrl->setImageAssetID(mSculptTextureRevert);
|
||||||
|
|
||||||
self->sendSculpt();
|
sendSculpt();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ public:
|
|||||||
|
|
||||||
static void onCommitMaterial( LLUICtrl* ctrl, void* userdata);
|
static void onCommitMaterial( LLUICtrl* ctrl, void* userdata);
|
||||||
|
|
||||||
static void onCommitSculpt( LLUICtrl* ctrl, void* userdata);
|
void onCommitSculpt(const LLSD& data);
|
||||||
static void onCancelSculpt( LLUICtrl* ctrl, void* userdata);
|
void onCancelSculpt(const LLSD& data);
|
||||||
static void onSelectSculpt( LLUICtrl* ctrl, void* userdata);
|
void onSelectSculpt(const LLSD& data);
|
||||||
static BOOL onDropSculpt( LLUICtrl* ctrl, LLInventoryItem* item, void* ud);
|
BOOL onDropSculpt(LLInventoryItem* item);
|
||||||
static void onCommitSculptType( LLUICtrl *ctrl, void* userdata);
|
static void onCommitSculptType( LLUICtrl *ctrl, void* userdata);
|
||||||
|
|
||||||
static void onClickBuildConstants(void *);
|
static void onClickBuildConstants(void *);
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
* @brief Object editing (position, scale, etc.) in the tools floater
|
* @brief Object editing (position, scale, etc.) in the tools floater
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||||
@@ -117,16 +116,16 @@ BOOL LLPanelVolume::postBuild()
|
|||||||
childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this);
|
childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this);
|
||||||
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||||
if(LightColorSwatch){
|
if(LightColorSwatch){
|
||||||
LightColorSwatch->setOnCancelCallback(onLightCancelColor);
|
LightColorSwatch->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelColor, this, _2));
|
||||||
LightColorSwatch->setOnSelectCallback(onLightSelectColor);
|
LightColorSwatch->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectColor, this, _2));
|
||||||
childSetCommitCallback("colorswatch",onCommitLight,this);
|
childSetCommitCallback("colorswatch",onCommitLight,this);
|
||||||
}
|
}
|
||||||
|
|
||||||
LLTextureCtrl* LightTexPicker = getChild<LLTextureCtrl>("light texture control");
|
LLTextureCtrl* LightTexPicker = getChild<LLTextureCtrl>("light texture control");
|
||||||
if (LightTexPicker)
|
if (LightTexPicker)
|
||||||
{
|
{
|
||||||
LightTexPicker->setOnCancelCallback(onLightCancelTexture);
|
LightTexPicker->setOnCancelCallback(boost::bind(&LLPanelVolume::onLightCancelTexture, this, _2));
|
||||||
LightTexPicker->setOnSelectCallback(onLightSelectTexture);
|
LightTexPicker->setOnSelectCallback(boost::bind(&LLPanelVolume::onLightSelectTexture, this, _2));
|
||||||
childSetCommitCallback("light texture control", onCommitLight, this);
|
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 = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||||
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
|
|
||||||
if(LightColorSwatch)
|
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 = getChild<LLTextureCtrl>("light texture control");
|
||||||
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
|
|
||||||
if (LightTextureCtrl)
|
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 = mObject;
|
||||||
LLViewerObject* objectp = self->mObject;
|
|
||||||
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
|
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -682,32 +678,31 @@ void LLPanelVolume::onLightSelectColor(LLUICtrl* ctrl, void* userdata)
|
|||||||
LLVOVolume *volobjp = (LLVOVolume *)objectp;
|
LLVOVolume *volobjp = (LLVOVolume *)objectp;
|
||||||
|
|
||||||
|
|
||||||
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
|
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
|
||||||
if(LightColorSwatch)
|
if(LightColorSwatch)
|
||||||
{
|
{
|
||||||
LLColor4 clr = LightColorSwatch->get();
|
LLColor4 clr = LightColorSwatch->get();
|
||||||
LLColor3 clr3( clr );
|
LLColor3 clr3( clr );
|
||||||
volobjp->setLightColor(clr3);
|
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;
|
if (mObject.isNull() || (mObject->getPCode() != LL_PCODE_VOLUME))
|
||||||
LLVOVolume *volobjp = (LLVOVolume*)self->mObject.get();
|
|
||||||
if (!volobjp || (volobjp->getPCode() != LL_PCODE_VOLUME))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
LLVOVolume *volobjp = (LLVOVolume *) mObject.get();
|
||||||
|
|
||||||
|
|
||||||
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
|
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
|
||||||
if(LightTextureCtrl)
|
if(LightTextureCtrl)
|
||||||
{
|
{
|
||||||
LLUUID id = LightTextureCtrl->getImageAssetID();
|
LLUUID id = LightTextureCtrl->getImageAssetID();
|
||||||
volobjp->setLightTextureID(id);
|
volobjp->setLightTextureID(id);
|
||||||
self->mLightSavedTexture = id;
|
mLightSavedTexture = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
* @brief Object editing (position, scale, etc.) in the tools floater
|
* @brief Object editing (position, scale, etc.) in the tools floater
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||||
@@ -45,7 +44,6 @@ class LLUICtrl;
|
|||||||
class LLButton;
|
class LLButton;
|
||||||
class LLViewerObject;
|
class LLViewerObject;
|
||||||
class LLComboBox;
|
class LLComboBox;
|
||||||
class LLPanelObjectInventory;
|
|
||||||
class LLColorSwatchCtrl;
|
class LLColorSwatchCtrl;
|
||||||
|
|
||||||
class LLPanelVolume : public LLPanel
|
class LLPanelVolume : public LLPanel
|
||||||
@@ -72,11 +70,11 @@ public:
|
|||||||
static void onCommitFlexible( LLUICtrl* ctrl, void* userdata);
|
static void onCommitFlexible( LLUICtrl* ctrl, void* userdata);
|
||||||
static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata);
|
static void onCommitPhysicsParam( LLUICtrl* ctrl, void* userdata);
|
||||||
|
|
||||||
static void onLightCancelColor(LLUICtrl* ctrl, void* userdata);
|
void onLightCancelColor(const LLSD& data);
|
||||||
static void onLightSelectColor(LLUICtrl* ctrl, void* userdata);
|
void onLightSelectColor(const LLSD& data);
|
||||||
|
|
||||||
static void onLightCancelTexture(LLUICtrl* ctrl, void* userdata);
|
void onLightCancelTexture(const LLSD& data);
|
||||||
static void onLightSelectTexture(LLUICtrl* ctrl, void* userdata);
|
void onLightSelectTexture(const LLSD& data);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -4,10 +4,9 @@
|
|||||||
* @brief LLTextureCtrl class implementation including related functions
|
* @brief LLTextureCtrl class implementation including related functions
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||||
@@ -281,12 +280,11 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
LLInventoryItem* itemp = gInventory.getItem(image_id);
|
LLInventoryItem* itemp = gInventory.getItem(image_id);
|
||||||
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
|
if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
|
||||||
{
|
{
|
||||||
// no copy texture
|
// no copy texture
|
||||||
childSetValue("apply_immediate_check", FALSE);
|
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
|
||||||
mNoCopyTextureSelected = TRUE;
|
mNoCopyTextureSelected = TRUE;
|
||||||
}
|
}
|
||||||
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
|
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
|
||||||
@@ -296,7 +294,7 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
|
|||||||
|
|
||||||
void LLFloaterTexturePicker::setActive( BOOL active )
|
void LLFloaterTexturePicker::setActive( BOOL active )
|
||||||
{
|
{
|
||||||
if (!active && childGetValue("Pipette").asBoolean())
|
if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean())
|
||||||
{
|
{
|
||||||
stopUsingPipette();
|
stopUsingPipette();
|
||||||
}
|
}
|
||||||
@@ -308,7 +306,7 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
|
|||||||
mCanApplyImmediately = b;
|
mCanApplyImmediately = b;
|
||||||
if (!mCanApplyImmediately)
|
if (!mCanApplyImmediately)
|
||||||
{
|
{
|
||||||
childSetValue("apply_immediate_check", FALSE);
|
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
|
||||||
}
|
}
|
||||||
updateFilterPermMask();
|
updateFilterPermMask();
|
||||||
}
|
}
|
||||||
@@ -369,7 +367,6 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop(
|
|||||||
|
|
||||||
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
|
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
|
||||||
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
|
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
|
||||||
|
|
||||||
{
|
{
|
||||||
if (drop)
|
if (drop)
|
||||||
{
|
{
|
||||||
@@ -488,7 +485,7 @@ BOOL LLFloaterTexturePicker::postBuild()
|
|||||||
// tag: vaa emerald local_asset_browser [end]
|
// tag: vaa emerald local_asset_browser [end]
|
||||||
|
|
||||||
childSetCommitCallback("show_folders_check", onShowFolders, this);
|
childSetCommitCallback("show_folders_check", onShowFolders, this);
|
||||||
childSetVisible("show_folders_check", FALSE);
|
getChildView("show_folders_check")->setVisible( FALSE);
|
||||||
|
|
||||||
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
|
mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
|
||||||
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
|
mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
|
||||||
@@ -526,12 +523,12 @@ BOOL LLFloaterTexturePicker::postBuild()
|
|||||||
|
|
||||||
mNoCopyTextureSelected = FALSE;
|
mNoCopyTextureSelected = FALSE;
|
||||||
|
|
||||||
childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately"));
|
getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately"));
|
||||||
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
|
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
|
||||||
|
|
||||||
if (!mCanApplyImmediately)
|
if (!mCanApplyImmediately)
|
||||||
{
|
{
|
||||||
childSetEnabled("show_folders_check", FALSE);
|
getChildView("show_folders_check")->setEnabled(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
|
getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
|
||||||
@@ -605,10 +602,10 @@ void LLFloaterTexturePicker::draw()
|
|||||||
updateImageStats();
|
updateImageStats();
|
||||||
|
|
||||||
// if we're inactive, gray out "apply immediate" checkbox
|
// if we're inactive, gray out "apply immediate" checkbox
|
||||||
childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
|
getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
|
||||||
childSetEnabled("Select", mActive);
|
getChildView("Select")->setEnabled(mActive);
|
||||||
childSetEnabled("Pipette", mActive);
|
getChildView("Pipette")->setEnabled(mActive);
|
||||||
childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
|
getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
|
||||||
|
|
||||||
//RN: reset search bar to reflect actual search query (all caps, for example)
|
//RN: reset search bar to reflect actual search query (all caps, for example)
|
||||||
mFilterEdit->setText(mInventoryPanel->getFilterSubString());
|
mFilterEdit->setText(mInventoryPanel->getFilterSubString());
|
||||||
@@ -631,11 +628,11 @@ void LLFloaterTexturePicker::draw()
|
|||||||
mTentativeLabel->setVisible( FALSE );
|
mTentativeLabel->setVisible( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID());
|
getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID());
|
||||||
childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID );
|
getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID);
|
||||||
childSetEnabled("None", mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
|
getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() );
|
||||||
childSetEnabled("Invisible", mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID );
|
getChildView("Invisible")->setEnabled(mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID);
|
||||||
childSetEnabled("Alpha", mImageAssetID != mAlphaImageAssetID );
|
getChildView("Alpha")->setEnabled(mImageAssetID != mAlphaImageAssetID);
|
||||||
|
|
||||||
LLFloater::draw();
|
LLFloater::draw();
|
||||||
|
|
||||||
@@ -761,14 +758,14 @@ const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL co
|
|||||||
|
|
||||||
PermissionMask LLFloaterTexturePicker::getFilterPermMask()
|
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;
|
return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLFloaterTexturePicker::commitIfImmediateSet()
|
void LLFloaterTexturePicker::commitIfImmediateSet()
|
||||||
{
|
{
|
||||||
bool apply_immediate = childGetValue("apply_immediate_check").asBoolean();
|
bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean();
|
||||||
if (!mNoCopyTextureSelected && apply_immediate && mOwner)
|
if (!mNoCopyTextureSelected && mOwner && apply_immediate)
|
||||||
{
|
{
|
||||||
mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE);
|
mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE);
|
||||||
}
|
}
|
||||||
@@ -1072,7 +1069,7 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te )
|
|||||||
}
|
}
|
||||||
else
|
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 +1270,6 @@ void LLTextureCtrl::setEnabled( BOOL enabled )
|
|||||||
mEnable = enabled;
|
mEnable = enabled;
|
||||||
|
|
||||||
LLView::setEnabled( enabled );
|
LLView::setEnabled( enabled );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLTextureCtrl::setValid(BOOL valid )
|
void LLTextureCtrl::setValid(BOOL valid )
|
||||||
@@ -1420,11 +1416,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op)
|
|||||||
lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
|
lldebugs << "mImageAssetID: " << mImageAssetID << llendl;
|
||||||
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
||||||
{
|
{
|
||||||
mOnSelectCallback(this, mCallbackUserData);
|
mOnSelectCallback( this, LLSD() );
|
||||||
}
|
}
|
||||||
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
||||||
{
|
{
|
||||||
mOnCancelCallback(this, mCallbackUserData);
|
mOnCancelCallback( this, LLSD() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1453,11 +1449,11 @@ void LLTextureCtrl::onFloaterCommit(ETexturePickOp op, LLUUID id)
|
|||||||
|
|
||||||
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
if (op == TEXTURE_SELECT && mOnSelectCallback)
|
||||||
{
|
{
|
||||||
mOnSelectCallback(this, mCallbackUserData);
|
mOnSelectCallback(this, LLSD());
|
||||||
}
|
}
|
||||||
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
else if (op == TEXTURE_CANCEL && mOnCancelCallback)
|
||||||
{
|
{
|
||||||
mOnCancelCallback(this, mCallbackUserData);
|
mOnCancelCallback(this, LLSD());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1573,7 +1569,6 @@ void LLTextureCtrl::draw()
|
|||||||
|
|
||||||
mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() );
|
mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() );
|
||||||
|
|
||||||
|
|
||||||
// Show "Loading..." string on the top left corner while this texture is loading.
|
// 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
|
// Using the discard level, do not show the string if the texture is almost but not
|
||||||
// fully loaded.
|
// fully loaded.
|
||||||
@@ -1610,13 +1605,12 @@ BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item)
|
|||||||
|
|
||||||
// PermissionMask filter_perm_mask = mCanApplyImmediately ? commented out due to no-copy texture loss.
|
// PermissionMask filter_perm_mask = mCanApplyImmediately ? commented out due to no-copy texture loss.
|
||||||
// mImmediateFilterPermMask : mNonImmediateFilterPermMask;
|
// mImmediateFilterPermMask : mNonImmediateFilterPermMask;
|
||||||
|
|
||||||
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
|
PermissionMask filter_perm_mask = mImmediateFilterPermMask;
|
||||||
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
|
if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
|
||||||
{
|
{
|
||||||
if(mDragCallback)
|
if(mDragCallback)
|
||||||
{
|
{
|
||||||
return mDragCallback(this, item, mCallbackUserData);
|
return mDragCallback(this, item);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1636,7 +1630,7 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item)
|
|||||||
{
|
{
|
||||||
// if it returns TRUE, we return TRUE, and therefore the
|
// if it returns TRUE, we return TRUE, and therefore the
|
||||||
// commit is called above.
|
// 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.
|
// no callback installed, so just set the image ids and carry on.
|
||||||
@@ -1666,64 +1660,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
|
* @brief LLTextureCtrl class header file including related functions
|
||||||
*
|
*
|
||||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||||
*
|
* Second Life Viewer Source Code
|
||||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
* 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
|
* 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
|
* to you under the terms of the GNU General Public License, version 2.0
|
||||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||||
@@ -48,7 +47,8 @@ class LLViewBorder;
|
|||||||
class LLViewerFetchedTexture;
|
class LLViewerFetchedTexture;
|
||||||
|
|
||||||
// used for setting drag & drop callbacks.
|
// 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
|
// LLTextureCtrl
|
||||||
@@ -152,9 +152,9 @@ public:
|
|||||||
// necessariliy any other change.
|
// necessariliy any other change.
|
||||||
void setDropCallback(drag_n_drop_callback cb) { mDropCallback = cb; }
|
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);
|
void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder);
|
||||||
|
|
||||||
@@ -168,8 +168,8 @@ private:
|
|||||||
private:
|
private:
|
||||||
drag_n_drop_callback mDragCallback;
|
drag_n_drop_callback mDragCallback;
|
||||||
drag_n_drop_callback mDropCallback;
|
drag_n_drop_callback mDropCallback;
|
||||||
LLUICtrlCallback mOnCancelCallback;
|
commit_callback_t mOnCancelCallback;
|
||||||
LLUICtrlCallback mOnSelectCallback;
|
commit_callback_t mOnSelectCallback;
|
||||||
LLPointer<LLViewerFetchedTexture> mTexturep;
|
LLPointer<LLViewerFetchedTexture> mTexturep;
|
||||||
LLColor4 mBorderColor;
|
LLColor4 mBorderColor;
|
||||||
LLUUID mImageItemID;
|
LLUUID mImageItemID;
|
||||||
|
|||||||
@@ -3004,6 +3004,7 @@ Where tag = tag string to match. Removes bot's matching the tag.
|
|||||||
|
|
||||||
<!-- inventory -->
|
<!-- inventory -->
|
||||||
<string name="InventoryNoMatchingItems">No matching items found in inventory.</string>
|
<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">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_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>
|
<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 -->
|
<!-- inventory -->
|
||||||
<string name="InventoryNoMatchingItems">Elementos no hallados en el inventario.</string>
|
<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">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_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>
|
<string name="MarketplaceURL_Dashboard">https://marketplace.[MARKETPLACE_DOMAIN_NAME]/merchants/store/dashboard</string>
|
||||||
|
|||||||
@@ -455,6 +455,9 @@
|
|||||||
<string name="choose_the_directory">
|
<string name="choose_the_directory">
|
||||||
Choisir le répertoire
|
Choisir le répertoire
|
||||||
</string>
|
</string>
|
||||||
|
<string name="InventoryNoTexture">
|
||||||
|
Vous n'avez pas de copie de cette texture dans votre inventaire
|
||||||
|
</string>
|
||||||
<string name="conference-title">
|
<string name="conference-title">
|
||||||
Chat à plusieurs
|
Chat à plusieurs
|
||||||
</string>
|
</string>
|
||||||
|
|||||||
@@ -205,6 +205,10 @@
|
|||||||
<string name="load_files">Carregar Arquivos</string>
|
<string name="load_files">Carregar Arquivos</string>
|
||||||
<string name="choose_the_directory">Escolher Diretório</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">
|
<string name="conference-title">
|
||||||
Bate-papo com várias pessoas
|
Bate-papo com várias pessoas
|
||||||
</string>
|
</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user