Merge branch 'V2MultiWear' of git://github.com/Shyotl/SingularityViewer into V2MultiWear

This commit is contained in:
Siana Gearz
2012-04-21 13:19:02 +02:00
55 changed files with 2394 additions and 1062 deletions

View File

@@ -44,6 +44,7 @@ const S32 GESTURE_VERSION = 2;
LLMultiGesture::LLMultiGesture()
: mKey(),
mMask(),
mName(),
mTrigger(),
mReplaceText(),
mSteps(),
@@ -286,20 +287,27 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
std::string LLGestureStepAnimation::getLabel() const
// *NOTE: result is translated in LLPreviewGesture::getLabel()
std::vector<std::string> LLGestureStepAnimation::getLabel() const
{
std::string label;
std::vector<std::string> strings;
// std::string label;
if (mFlags & ANIM_FLAG_STOP)
{
label = "Stop Animation: ";
strings.push_back( "AnimFlagStop");
// label = "Stop Animation: ";
}
else
{
label = "Start Animation: ";
strings.push_back( "AnimFlagStart");
// label = "Start Animation: ";
}
label += mAnimName;
return label;
strings.push_back( mAnimName);
// label += mAnimName;
return strings;
}
void LLGestureStepAnimation::dump()
@@ -353,12 +361,15 @@ BOOL LLGestureStepSound::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
std::string LLGestureStepSound::getLabel() const
// *NOTE: result is translated in LLPreviewGesture::getLabel()
std::vector<std::string> LLGestureStepSound::getLabel() const
{
std::string label("Sound: ");
label += mSoundName;
return label;
std::vector<std::string> strings;
strings.push_back( "Sound");
strings.push_back( mSoundName);
// std::string label("Sound: ");
// label += mSoundName;
return strings;
}
void LLGestureStepSound::dump()
@@ -408,12 +419,13 @@ BOOL LLGestureStepChat::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
std::string LLGestureStepChat::getLabel() const
// *NOTE: result is translated in LLPreviewGesture::getLabel()
std::vector<std::string> LLGestureStepChat::getLabel() const
{
std::string label("Chat: ");
label += mChatText;
return label;
std::vector<std::string> strings;
strings.push_back("Chat");
strings.push_back(mChatText);
return strings;
}
void LLGestureStepChat::dump()
@@ -461,22 +473,31 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp)
dp.unpackU32(mFlags, "flags");
return TRUE;
}
std::string LLGestureStepWait::getLabel() const
// *NOTE: result is translated in LLPreviewGesture::getLabel()
std::vector<std::string> LLGestureStepWait::getLabel() const
{
std::string label("--- Wait: ");
std::vector<std::string> strings;
strings.push_back( "Wait" );
// std::string label("--- Wait: ");
if (mFlags & WAIT_FLAG_TIME)
{
char buffer[64]; /* Flawfinder: ignore */
snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */
label += buffer;
strings.push_back(buffer);
// label += buffer;
}
else if (mFlags & WAIT_FLAG_ALL_ANIM)
{
label += "until animations are done";
strings.push_back("until animations are done");
// label += "until animations are done";
}
else
{
strings.push_back("");
}
return label;
return strings;
}

View File

@@ -134,7 +134,7 @@ public:
virtual EStepType getType() = 0;
// Return a user-readable label for this step
virtual std::string getLabel() const = 0;
virtual std::vector<std::string> getLabel() const = 0;
virtual S32 getMaxSerialSize() const = 0;
virtual BOOL serialize(LLDataPacker& dp) const = 0;
@@ -156,7 +156,7 @@ public:
virtual EStepType getType() { return STEP_ANIMATION; }
virtual std::string getLabel() const;
virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -179,7 +179,7 @@ public:
virtual EStepType getType() { return STEP_SOUND; }
virtual std::string getLabel() const;
virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -202,7 +202,7 @@ public:
virtual EStepType getType() { return STEP_CHAT; }
virtual std::string getLabel() const;
virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;
@@ -227,7 +227,7 @@ public:
virtual EStepType getType() { return STEP_WAIT; }
virtual std::string getLabel() const;
virtual std::vector<std::string> getLabel() const;
virtual S32 getMaxSerialSize() const;
virtual BOOL serialize(LLDataPacker& dp) const;

View File

@@ -1948,6 +1948,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) :
case GL_COLOR_MATERIAL:
case GL_FOG:
case GL_LINE_STIPPLE:
case GL_POLYGON_STIPPLE:
mState = 0;
break;
}

View File

@@ -176,7 +176,7 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
}
static const LLCachedControl<bool> no_texture_indexing("ShyotlUseLegacyTextureBatching",false);
if (gGLManager.mGLVersion < 3.1f || no_texture_indexing)
if ((gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3) || no_texture_indexing)
{ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
}

View File

@@ -1986,6 +1986,7 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
void LLImageGL::setCategory(S32 category)
{
#if 0 //turn this off temporarily because it is not in use now.
if(!gAuditTexture)
{
return ;
@@ -2006,6 +2007,7 @@ void LLImageGL::setCategory(S32 category)
mCategory = -1 ;
}
}
#endif
}
//for debug use

View File

@@ -1208,20 +1208,15 @@ void LLVertexBuffer::updateNumVerts(S32 nverts)
llassert(nverts >= 0);
if (nverts >= 65535)
if (nverts > 65536)
{
// <FS:ND> FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped.
// llwarns << "Vertex buffer overflow!" << llendl;
// nverts = 65535;
llinfos << "More vertices than 65535 (#" << nverts << ")" <<llendl;
// </FS:ND>
llwarns << "Vertex buffer overflow!" << llendl;
nverts = 65536;
}
S32 needed_size = calcOffsets(mTypeMask, mOffsets, nverts);
U32 needed_size = (U32)calcOffsets(mTypeMask, mOffsets, nverts);
if (needed_size > mSize || needed_size <= mSize/2)
if (needed_size > (U32)mSize || needed_size <= (U32)mSize/2)
{
createGLBuffer(needed_size);
}
@@ -1237,9 +1232,9 @@ void LLVertexBuffer::updateNumIndices(S32 nindices)
llassert(nindices >= 0);
S32 needed_size = sizeof(U16) * nindices;
U32 needed_size = sizeof(U16) * (U32)nindices;
if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2)
if (needed_size > (U32)mIndicesSize || needed_size <= (U32)mIndicesSize/2)
{
createGLIndices(needed_size);
}
@@ -1255,21 +1250,11 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
stop_glerror();
// <FS:ND> FIRE-5077; Just print an info if there are more than 0xFFFF, for now just so there is a message in the logs where in older version #vertices would have been capped.
// if (nverts < 0 || nindices < 0 ||
// nverts > 65536)
// {
// llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
// }
if( nverts < 0 || nindices < 0 )
llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
if( nverts > 0xFFFF )
llinfos << "More vertices than 65535 (#" << nverts << ")" <<llendl;
// </FS:ND>
if (nverts < 0 || nindices < 0 ||
nverts > 65536)
{
llwarns << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
}
updateNumVerts(nverts);
updateNumIndices(nindices);
@@ -2303,10 +2288,10 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
stop_glerror();
volatile U8* base = useVBOs() ? (U8*) mAlignedOffset : mMappedData;
/*if ((data_mask & mTypeMask) != data_mask)
if (gDebugGL && ((data_mask & mTypeMask) != data_mask))
{
llerrs << "LLVertexBuffer::setupVertexBuffer missing required components for supplied data mask." << llendl;
}*/
}
if (LLGLSLShader::sNoFixedFunction)
{

View File

@@ -319,6 +319,7 @@ set(viewer_SOURCE_FILES
llmaniprotate.cpp
llmanipscale.cpp
llmaniptranslate.cpp
llmarketplacenotifications.cpp
llmediaremotectrl.cpp
llmemoryview.cpp
llmenucommands.cpp
@@ -809,6 +810,7 @@ set(viewer_HEADER_FILES
llmaniprotate.h
llmanipscale.h
llmaniptranslate.h
llmarketplacenotifications.h
llmediaremotectrl.h
llmemoryview.h
llmenucommands.h

View File

@@ -5062,6 +5062,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>EnableGestureSounds</key>
<map>
<key>Comment</key>
<string>Play sounds from gestures</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>EnableMouselook</key>
<map>
<key>Comment</key>

View File

@@ -0,0 +1,46 @@
/**
* @file debugF.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
#else
#define frag_color gl_FragColor
#endif
uniform vec4 color;
uniform vec4 clip_plane;
VARYING vec3 vary_position;
void main()
{
if (dot(vary_position,clip_plane.xyz)+clip_plane.w < 0.0)
{
discard;
}
frag_color = color;
}

View File

@@ -0,0 +1,38 @@
/**
* @file debugV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
uniform mat4 modelview_projection_matrix;
uniform mat4 modelview_matrix;
ATTRIBUTE vec3 position;
VARYING vec3 vary_position;
void main()
{
vary_position = (modelview_matrix*vec4(position.xyz,1.0)).xyz;
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
}

View File

@@ -51,6 +51,8 @@
#include "llagentwearables.h"
#include "llwindow.h"
#include "llviewerstats.h"
//#include "llmarketplacefunctions.h"
#include "llmarketplacenotifications.h"
#include "llmd5.h"
#include "llmeshrepository.h"
#include "llpumpio.h"
@@ -4089,6 +4091,10 @@ void LLAppViewer::idle()
// update media focus
LLViewerMediaFocus::getInstance()->update();
// Update marketplace
//LLMarketplaceInventoryImporter::update();
LLMarketplaceInventoryNotifications::update();
// objects and camera should be in sync, do LOD calculations now
{

View File

@@ -138,7 +138,7 @@ LLChatBar::~LLChatBar()
BOOL LLChatBar::postBuild()
{
childSetAction("History", toggleChatHistory, this);
childSetCommitCallback("Say", onClickSay, this);
getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));
// attempt to bind to an existing combo box named gesture
setGestureCombo(getChild<LLComboBox>( "Gesture"));
@@ -249,7 +249,8 @@ void LLChatBar::refreshGestures()
// collect list of unique gestures
std::map <std::string, BOOL> unique;
LLGestureMgr::item_map_t::const_iterator it;
for (it = LLGestureMgr::instance().getActiveGestures().begin(); it != LLGestureMgr::instance().getActiveGestures().end(); ++it)
const LLGestureMgr::item_map_t& active_gestures = LLGestureMgr::instance().getActiveGestures();
for (it = active_gestures.begin(); it != active_gestures.end(); ++it)
{
LLMultiGesture* gesture = (*it).second;
if (gesture)
@@ -330,8 +331,7 @@ void LLChatBar::setGestureCombo(LLComboBox* combo)
mGestureCombo = combo;
if (mGestureCombo)
{
mGestureCombo->setCommitCallback(onCommitGesture);
mGestureCombo->setCallbackUserData(this);
mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1));
// now register observer since we have a place to put the results
mObserver = new LLChatBarGestureObserver(this);
@@ -637,19 +637,19 @@ void LLChatBar::onInputEditorGainFocus()
}
// static
void LLChatBar::onClickSay( LLUICtrl* ctrl, void* userdata )
void LLChatBar::onClickSay( LLUICtrl* ctrl )
{
std::string cmd = ctrl->getValue().asString();
e_chat_type chat_type = CHAT_TYPE_NORMAL;
if (ctrl->getValue().asString() == "shout")
if (cmd == "shout")
{
chat_type = CHAT_TYPE_SHOUT;
}
else if (ctrl->getValue().asString() == "whisper")
else if (cmd == "whisper")
{
chat_type = CHAT_TYPE_WHISPER;
}
LLChatBar* self = (LLChatBar*) userdata;
self->sendChat(chat_type);
sendChat(chat_type);
}
void LLChatBar::sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate)
@@ -861,11 +861,9 @@ void really_send_chat_from_viewer(const std::string& utf8_out_text, EChatType ty
}
// static
void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
void LLChatBar::onCommitGesture(LLUICtrl* ctrl)
{
LLChatBar* self = (LLChatBar*)data;
LLCtrlListInterface* gestures = self->mGestureCombo ? self->mGestureCombo->getListInterface() : NULL;
LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL;
if (gestures)
{
S32 index = gestures->getFirstSelectedIndex();
@@ -885,14 +883,14 @@ void LLChatBar::onCommitGesture(LLUICtrl* ctrl, void* data)
if (!revised_text.empty())
{
// Don't play nodding animation
self->sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
sendChatFromViewer(revised_text, CHAT_TYPE_NORMAL, FALSE);
}
}
self->mGestureLabelTimer.start();
if (self->mGestureCombo != NULL)
mGestureLabelTimer.start();
if (mGestureCombo != NULL)
{
// free focus back to chat bar
self->mGestureCombo->setFocus(FALSE);
mGestureCombo->setFocus(FALSE);
}
}

View File

@@ -82,14 +82,14 @@ public:
LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
// callbacks
static void onClickSay( LLUICtrl*, void* userdata );
void onClickSay(LLUICtrl* ctrl);
static void onTabClick( void* userdata );
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
static void onInputEditorFocusLost();
static void onInputEditorGainFocus();
static void onCommitGesture(LLUICtrl* ctrl, void* data);
void onCommitGesture(LLUICtrl* ctrl);
static void startChat(const char* line);
static void stopChat();

View File

@@ -121,8 +121,6 @@ LLDrawPool *LLDrawPoolAvatar::instancePool()
return new LLDrawPoolAvatar();
}
BOOL gRenderAvatar = TRUE;
S32 LLDrawPoolAvatar::getVertexShaderLevel() const
{
return (S32) LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR);
@@ -1056,13 +1054,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
if (!gRenderAvatar)
{
return;
}
if (mDrawFace.empty() && !single_avatar)
{
return;

View File

@@ -187,8 +187,8 @@ bool LLEnvManagerNew::useRegionSettings()
bool LLEnvManagerNew::useWaterPreset(const std::string& name)
{
LL_DEBUGS("Windlight") << "Displaying water preset " << name << LL_ENDL;
LLWaterParamManager* water_mgr = LLWaterParamManager::getInstance();
bool rslt = water_mgr->getParamSet(name, water_mgr->mCurParams);
LLWaterParamManager& water_mgr = LLWaterParamManager::instance();
bool rslt = water_mgr.getParamSet(name, water_mgr.mCurParams);
llassert(rslt == true);
return rslt;
}
@@ -196,30 +196,30 @@ bool LLEnvManagerNew::useWaterPreset(const std::string& name)
bool LLEnvManagerNew::useWaterParams(const LLSD& params)
{
LL_DEBUGS("Windlight") << "Displaying water params" << LL_ENDL;
LLWaterParamManager::getInstance()->mCurParams.setAll(params);
LLWaterParamManager::instance().mCurParams.setAll(params);
return true;
}
bool LLEnvManagerNew::useSkyPreset(const std::string& name, bool interpolate /*= false*/)
{
LLWLParamManager* sky_mgr = LLWLParamManager::getInstance();
LLWLParamManager& sky_mgr = LLWLParamManager::instance();
LLWLParamSet param_set;
if (!sky_mgr->getParamSet(LLWLParamKey(name, LLEnvKey::SCOPE_LOCAL), param_set))
if (!sky_mgr.getParamSet(LLWLParamKey(name, LLEnvKey::SCOPE_LOCAL), param_set))
{
llwarns << "No sky preset named " << name << llendl;
return false;
}
LL_DEBUGS("Windlight") << "Displaying sky preset " << name << LL_ENDL;
sky_mgr->applySkyParams(param_set.getAll(), interpolate);
sky_mgr.applySkyParams(param_set.getAll(), interpolate);
return true;
}
bool LLEnvManagerNew::useSkyParams(const LLSD& params)
{
LL_DEBUGS("Windlight") << "Displaying sky params" << LL_ENDL;
LLWLParamManager::getInstance()->applySkyParams(params);
LLWLParamManager::instance().applySkyParams(params);
return true;
}
@@ -243,7 +243,7 @@ bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scop
}
}
bool rslt = LLWLParamManager::getInstance()->applyDayCycleParams(params, scope);
bool rslt = LLWLParamManager::instance().applyDayCycleParams(params, scope);
llassert(rslt == true);
return rslt;
}
@@ -251,7 +251,7 @@ bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scop
bool LLEnvManagerNew::useDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time /* = 0.5*/)
{
LL_DEBUGS("Windlight") << "Displaying day cycle params" << LL_ENDL;
return LLWLParamManager::getInstance()->applyDayCycleParams(params, scope);
return LLWLParamManager::instance().applyDayCycleParams(params, scope);
}
void LLEnvManagerNew::setUseRegionSettings(bool val, bool interpolate /*= false*/)
@@ -366,7 +366,7 @@ void LLEnvManagerNew::dumpPresets()
LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL;
}
LLWaterParamManager::preset_name_list_t water_presets;
LLWaterParamManager::getInstance()->getPresetNames(water_presets);
LLWaterParamManager::instance().getPresetNames(water_presets);
for (LLWaterParamManager::preset_name_list_t::const_iterator it = water_presets.begin(); it != water_presets.end(); ++it)
{
LL_DEBUGS("Windlight") << " - " << *it << LL_ENDL;
@@ -375,7 +375,7 @@ void LLEnvManagerNew::dumpPresets()
// Dump sky presets.
LL_DEBUGS("Windlight") << "Skies:" << LL_ENDL;
LLWLParamManager::preset_key_list_t sky_preset_keys;
LLWLParamManager::getInstance()->getPresetKeys(sky_preset_keys);
LLWLParamManager::instance().getPresetKeys(sky_preset_keys);
for (LLWLParamManager::preset_key_list_t::const_iterator it = sky_preset_keys.begin(); it != sky_preset_keys.end(); ++it)
{
std::string preset_name = it->name;
@@ -492,7 +492,7 @@ void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content)
mCachedRegionPrefs = new_settings;
// Load region sky presets.
LLWLParamManager::getInstance()->refreshRegionPresets();
LLWLParamManager::instance().refreshRegionPresets();
bool bOverridden = M7WindlightInterface::getInstance()->hasOverride();
@@ -563,7 +563,7 @@ void LLEnvManagerNew::updateSkyFromPrefs(bool interpolate /*= false*/)
void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
{
LLWaterParamManager* water_mgr = LLWaterParamManager::getInstance();
LLWaterParamManager& water_mgr = LLWaterParamManager::instance();
LLSD target_water_params;
// Determine new water settings based on user prefs.
@@ -571,7 +571,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
{
// Fall back to default water.
LLWaterParamSet default_water;
water_mgr->getParamSet("Default", default_water);
water_mgr.getParamSet("Default", default_water);
target_water_params = default_water.getAll();
}
@@ -594,10 +594,10 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
std::string water = getWaterPresetName();
LL_DEBUGS("Windlight") << "Applying water preset [" << water << "]" << LL_ENDL;
LLWaterParamSet params;
if (!water_mgr->getParamSet(water, params))
if (!water_mgr.getParamSet(water, params))
{
llwarns << "No water preset named " << water << ", falling back to defaults" << llendl;
water_mgr->getParamSet("Default", params);
water_mgr.getParamSet("Default", params);
// *TODO: Fix user preferences accordingly.
}
@@ -605,7 +605,7 @@ void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate)
}
// Sync water with user prefs.
water_mgr->applyParams(target_water_params, interpolate);
water_mgr.applyParams(target_water_params, interpolate);
}
void LLEnvManagerNew::updateManagersFromPrefs(bool interpolate)

View File

@@ -1740,9 +1740,9 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
}
// <FS:ND> FS-5132 Only use color strider if face has colors.
// if (rebuild_color)
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
// <FS:ND> FS-5132 Only use color strider if face has colors.
// if (rebuild_color)
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
// </FS:ND>
{
LLFastTimer t(FTM_FACE_GEOM_COLOR);

View File

@@ -37,6 +37,7 @@
#include "llviewerinventory.h"
class LLMultiGesture;
class LLGestureListener;
class LLGestureStep;
class LLUUID;
class LLVFS;

View File

@@ -2,31 +2,25 @@
* @file llgroupmgr.cpp
* @brief LLGroupMgr class implementation
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* 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
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -55,11 +49,20 @@
#include "llfloatergroupinfo.h"
#include "llnotificationsutil.h"
#include "lluictrlfactory.h"
#if LL_MSVC
#pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual"
#endif
#include "lltrans.h"
#include <boost/regex.hpp>
#if LL_MSVC
#pragma warning(push)
// disable boost::lexical_cast warning
#pragma warning (disable:4702)
#endif
#include <boost/lexical_cast.hpp>
#if LL_MSVC
#pragma warning(pop) // Restore all warnings to the previous state
#endif
const U32 MAX_CACHED_GROUPS = 10;
@@ -153,7 +156,7 @@ LLGroupRoleData::~LLGroupRoleData()
{
}
S32 LLGroupRoleData::getMembersInRole(std::vector<LLUUID> members,
S32 LLGroupRoleData::getMembersInRole(uuid_vec_t members,
BOOL needs_sort)
{
if (mRoleID.isNull())
@@ -177,8 +180,8 @@ S32 LLGroupRoleData::getMembersInRole(std::vector<LLUUID> members,
// Return the number of members in the intersection.
S32 max_size = llmin( members.size(), mMemberIDs.size() );
std::vector<LLUUID> in_role( max_size );
std::vector<LLUUID>::iterator in_role_end;
uuid_vec_t in_role( max_size );
uuid_vec_t::iterator in_role_end;
in_role_end = std::set_intersection(mMemberIDs.begin(), mMemberIDs.end(),
members.begin(), members.end(),
in_role.begin());
@@ -193,7 +196,7 @@ void LLGroupRoleData::addMember(const LLUUID& member)
bool LLGroupRoleData::removeMember(const LLUUID& member)
{
std::vector<LLUUID>::iterator it = std::find(mMemberIDs.begin(),mMemberIDs.end(),member);
uuid_vec_t::iterator it = std::find(mMemberIDs.begin(),mMemberIDs.end(),member);
if (it != mMemberIDs.end())
{
@@ -850,6 +853,14 @@ void LLGroupMgr::addObserver(LLGroupMgrObserver* observer)
mObservers.insert(std::pair<LLUUID, LLGroupMgrObserver*>(observer->getID(), observer));
}
void LLGroupMgr::addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
{
if(group_id.notNull() && observer)
{
mParticularObservers[group_id].insert(observer);
}
}
void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
{
if (!observer)
@@ -872,6 +883,23 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
}
}
void LLGroupMgr::removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer)
{
if(group_id.isNull() || !observer)
{
return;
}
observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
if(obs_it == mParticularObservers.end())
return;
obs_it->second.erase(observer);
if (obs_it->second.size() == 0)
mParticularObservers.erase(obs_it);
}
LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id)
{
group_map_t::iterator gi = mGroups.find(id);
@@ -883,6 +911,21 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id)
return NULL;
}
// Helper function for LLGroupMgr::processGroupMembersReply
// This reformats date strings from MM/DD/YYYY to YYYY/MM/DD ( e.g. 1/27/2008 -> 2008/1/27 )
// so that the sorter can sort by year before month before day.
static void formatDateString(std::string &date_string)
{
tm t;
if (sscanf(date_string.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900)
{
t.tm_year -= 1900;
t.tm_mon--;
t.tm_hour = t.tm_min = t.tm_sec = 0;
timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), date_string);
}
}
// static
void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
{
@@ -891,7 +934,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
llwarns << "Got group properties reply for another agent!" << llendl;
llwarns << "Got group members reply for another agent!" << llendl;
return;
}
@@ -902,9 +945,9 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
if (group_datap->mMemberRequestID != request_id)
if (!group_datap || (group_datap->mMemberRequestID != request_id))
{
llwarns << "processGroupMembersReply: Received incorrect (stale?) request id" << llendl;
llwarns << "processGroupMembersReply: Received incorrect (stale?) group or request id" << llendl;
return;
}
@@ -932,13 +975,14 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data)
if (member_id.notNull())
{
tm t;
if (sscanf(online_status.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900)
if (online_status == "Online")
{
t.tm_year -= 1900;
t.tm_mon--;
t.tm_hour = t.tm_min = t.tm_sec = 0;
timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), online_status);
static std::string localized_online(LLTrans::getString("group_member_status_online"));
online_status = localized_online;
}
else
{
formatDateString(online_status); // reformat for sorting, e.g. 12/25/2008 -> 2008/12/25
}
//llinfos << "Member " << member_id << " has powers " << std::hex << agent_powers << std::dec << llendl;
@@ -1061,7 +1105,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
llwarns << "Got group properties reply for another agent!" << llendl;
llwarns << "Got group role data reply for another agent!" << llendl;
return;
}
@@ -1071,14 +1115,14 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
LLUUID request_id;
msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id);
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
if (group_data->mRoleDataRequestID != request_id)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
if (!group_datap || (group_datap->mRoleDataRequestID != request_id))
{
llwarns << "processGroupRoleDataReply: Received incorrect (stale?) request id" << llendl;
llwarns << "processGroupPropertiesReply: Received incorrect (stale?) group or request id" << llendl;
return;
}
msg->getS32(_PREHASH_GroupData, "RoleCount", group_data->mRoleCount );
msg->getS32(_PREHASH_GroupData, "RoleCount", group_datap->mRoleCount );
std::string name;
std::string title;
@@ -1099,24 +1143,40 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data)
msg->getU64("RoleData","Powers",powers,i);
msg->getU32("RoleData","Members",member_count,i);
//there are 3 predifined roles - Owners, Officers, Everyone
//there names are defined in lldatagroups.cpp
//lets change names from server to localized strings
if(name == "Everyone")
{
name = LLTrans::getString("group_role_everyone");
}
else if(name == "Officers")
{
name = LLTrans::getString("group_role_officers");
}
else if(name == "Owners")
{
name = LLTrans::getString("group_role_owners");
}
lldebugs << "Adding role data: " << name << " {" << role_id << "}" << llendl;
LLGroupRoleData* rd = new LLGroupRoleData(role_id,name,title,desc,powers,member_count);
group_data->mRoles[role_id] = rd;
group_datap->mRoles[role_id] = rd;
}
if (group_data->mRoles.size() == (U32)group_data->mRoleCount)
if (group_datap->mRoles.size() == (U32)group_datap->mRoleCount)
{
group_data->mRoleDataComplete = TRUE;
group_data->mRoleDataRequestID.setNull();
group_datap->mRoleDataComplete = TRUE;
group_datap->mRoleDataRequestID.setNull();
// We don't want to make role-member data requests until we have all the role data
if (group_data->mPendingRoleMemberRequest)
if (group_datap->mPendingRoleMemberRequest)
{
group_data->mPendingRoleMemberRequest = FALSE;
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_data->mID);
group_datap->mPendingRoleMemberRequest = FALSE;
LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID);
}
}
group_data->mChanged = TRUE;
group_datap->mChanged = TRUE;
#if SHY_MOD //Group title script access
gGroupRoleChanger.CheckUpdateRole(group_id,group_data->mRoles);
#endif //shy_mod
@@ -1131,7 +1191,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id );
if (gAgent.getID() != agent_id)
{
llwarns << "Got group properties reply for another agent!" << llendl;
llwarns << "Got group role members reply for another agent!" << llendl;
return;
}
@@ -1144,11 +1204,10 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
U32 total_pairs;
msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs);
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
if (group_data->mRoleMembersRequestID != request_id)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
if (!group_datap || (group_datap->mRoleMembersRequestID != request_id))
{
llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) role member request id" << llendl;
llwarns << "processGroupRoleMembersReply: Received incorrect (stale?) group or request id" << llendl;
return;
}
@@ -1173,15 +1232,15 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
if (role_id.notNull() && member_id.notNull() )
{
rd = NULL;
ri = group_data->mRoles.find(role_id);
if (ri != group_data->mRoles.end())
ri = group_datap->mRoles.find(role_id);
if (ri != group_datap->mRoles.end())
{
rd = ri->second;
}
md = NULL;
mi = group_data->mMembers.find(member_id);
if (mi != group_data->mMembers.end())
mi = group_datap->mMembers.find(member_id);
if (mi != group_datap->mMembers.end())
{
md = mi->second;
}
@@ -1200,21 +1259,21 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
}
}
group_data->mReceivedRoleMemberPairs += num_blocks;
group_datap->mReceivedRoleMemberPairs += num_blocks;
}
if (group_data->mReceivedRoleMemberPairs == total_pairs)
if (group_datap->mReceivedRoleMemberPairs == total_pairs)
{
// Add role data for the 'everyone' role to all members
LLGroupRoleData* everyone = group_data->mRoles[LLUUID::null];
LLGroupRoleData* everyone = group_datap->mRoles[LLUUID::null];
if (!everyone)
{
llwarns << "Everyone role not found!" << llendl;
}
else
{
for (LLGroupMgrGroupData::member_list_t::iterator mi = group_data->mMembers.begin();
mi != group_data->mMembers.end(); ++mi)
for (LLGroupMgrGroupData::member_list_t::iterator mi = group_datap->mMembers.begin();
mi != group_datap->mMembers.end(); ++mi)
{
LLGroupMemberData* data = mi->second;
if (data)
@@ -1224,11 +1283,11 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data)
}
}
group_data->mRoleMemberDataComplete = TRUE;
group_data->mRoleMembersRequestID.setNull();
group_datap->mRoleMemberDataComplete = TRUE;
group_datap->mRoleMembersRequestID.setNull();
}
group_data->mChanged = TRUE;
group_datap->mChanged = TRUE;
LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_MEMBER_DATA);
}
@@ -1246,15 +1305,13 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
LLUUID group_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id );
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id);
LLUUID request_id;
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id);
if (group_data->mTitlesRequestID != request_id)
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id);
if (!group_datap || (group_datap->mTitlesRequestID != request_id))
{
llwarns << "processGroupTitlesReply: Received incorrect (stale?) title request id" << llendl;
llwarns << "processGroupTitlesReply: Received incorrect (stale?) group" << llendl;
return;
}
@@ -1271,11 +1328,11 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data)
if (!title.mTitle.empty())
{
lldebugs << "LLGroupMgr adding title: " << title.mTitle << ", " << title.mRoleID << ", " << (title.mSelected ? 'Y' : 'N') << llendl;
group_data->mTitles.push_back(title);
group_datap->mTitles.push_back(title);
}
}
group_data->mChanged = TRUE;
group_datap->mChanged = TRUE;
LLGroupMgr::getInstance()->notifyObservers(GC_TITLES);
}
@@ -1418,6 +1475,18 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
oi->second->changed(gc);
}
gi->second->mChanged = FALSE;
// notify LLParticularGroupObserver
observer_map_t::iterator obs_it = mParticularObservers.find(group_id);
if(obs_it == mParticularObservers.end())
return;
observer_set_t& obs = obs_it->second;
for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ++ob_it)
{
(*ob_it)->changed(group_id, gc);
}
}
}
}
@@ -1747,15 +1816,17 @@ void LLGroupMgr::sendGroupMemberInvites(const LLUUID& group_id, std::map<LLUUID,
//static
void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
std::vector<LLUUID>& member_ids)
uuid_vec_t& member_ids)
{
bool start_message = true;
LLMessageSystem* msg = gMessageSystem;
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap) return;
for (std::vector<LLUUID>::iterator it = member_ids.begin();
for (uuid_vec_t::iterator it = member_ids.begin();
it != member_ids.end(); ++it)
{
LLUUID& ejected_member_id = (*it);

View File

@@ -2,31 +2,25 @@
* @file llgroupmgr.h
* @brief Manager for aggregating all client knowledge for specific groups
*
* $LicenseInfo:firstyear=2004&license=viewergpl$
*
* Copyright (c) 2004-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
* 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
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -45,6 +39,7 @@ class LLGroupMgrObserver
{
public:
LLGroupMgrObserver(const LLUUID& id) : mID(id){};
LLGroupMgrObserver() : mID(LLUUID::null){};
virtual ~LLGroupMgrObserver(){};
virtual void changed(LLGroupChange gc) = 0;
const LLUUID& getID() { return mID; }
@@ -52,6 +47,13 @@ protected:
LLUUID mID;
};
class LLParticularGroupObserver
{
public:
virtual ~LLParticularGroupObserver(){}
virtual void changed(const LLUUID& group_id, LLGroupChange gc) = 0;
};
class LLGroupRoleData;
class LLGroupMemberData
@@ -131,8 +133,8 @@ public:
const LLUUID& getID() const { return mRoleID; }
const std::vector<LLUUID>& getRoleMembers() const { return mMemberIDs; }
S32 getMembersInRole(std::vector<LLUUID> members, BOOL needs_sort = TRUE);
const uuid_vec_t& getRoleMembers() const { return mMemberIDs; }
S32 getMembersInRole(uuid_vec_t members, BOOL needs_sort = TRUE);
S32 getTotalMembersInRole() { return mMemberIDs.size(); }
LLRoleData getRoleData() const { return mRoleData; }
@@ -142,10 +144,10 @@ public:
bool removeMember(const LLUUID& member);
void clearMembers();
const std::vector<LLUUID>::const_iterator getMembersBegin() const
const uuid_vec_t::const_iterator getMembersBegin() const
{ return mMemberIDs.begin(); }
const std::vector<LLUUID>::const_iterator getMembersEnd() const
const uuid_vec_t::const_iterator getMembersEnd() const
{ return mMemberIDs.end(); }
@@ -156,7 +158,7 @@ protected:
LLUUID mRoleID;
LLRoleData mRoleData;
std::vector<LLUUID> mMemberIDs;
uuid_vec_t mMemberIDs;
S32 mMemberCount;
private:
@@ -304,7 +306,9 @@ public:
~LLGroupMgr();
void addObserver(LLGroupMgrObserver* observer);
void addObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
void removeObserver(LLGroupMgrObserver* observer);
void removeObserver(const LLUUID& group_id, LLParticularGroupObserver* observer);
LLGroupMgrGroupData* getGroupData(const LLUUID& id);
void sendGroupPropertiesRequest(const LLUUID& group_id);
@@ -329,7 +333,7 @@ public:
static void sendGroupMemberJoin(const LLUUID& group_id);
static void sendGroupMemberInvites(const LLUUID& group_id, std::map<LLUUID,LLUUID>& role_member_pairs);
static void sendGroupMemberEjects(const LLUUID& group_id,
std::vector<LLUUID>& member_ids);
uuid_vec_t& member_ids);
void cancelGroupRoleChanges(const LLUUID& group_id);
@@ -353,13 +357,19 @@ public:
private:
void notifyObservers(LLGroupChange gc);
void notifyObserver(const LLUUID& group_id, LLGroupChange gc);
void addGroup(LLGroupMgrGroupData* group_datap);
LLGroupMgrGroupData* createGroupData(const LLUUID &id);
typedef std::multimap<LLUUID,LLGroupMgrObserver*> observer_multimap_t;
observer_multimap_t mObservers;
typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t;
group_map_t mGroups;
typedef std::set<LLParticularGroupObserver*> observer_set_t;
typedef std::map<LLUUID,observer_set_t> observer_map_t;
observer_map_t mParticularObservers;
};

View File

@@ -76,6 +76,7 @@
#include "llinventoryclipboard.h"
#include "lllineeditor.h"
#include "llmenugl.h"
//#include "llmarketplacefunctions.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llpreviewanim.h"
@@ -131,6 +132,11 @@
#include "rlvlocks.h"
// [/RLVa:KB]
// Marketplace outbox current disabled
#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1
#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0
#define BLOCK_WORN_ITEMS_IN_OUTBOX 1
bool InventoryLinksEnabled()
{
return gHippoGridManager->getConnectedGrid()->supportsInvLinks();
@@ -184,6 +190,16 @@ bool isRemoveAction(const std::string& action)
return ("take_off" == action || "detach" == action || "deactivate" == action);
}
bool isMarketplaceCopyAction(const std::string& action)
{
return (("copy_to_outbox" == action) || ("move_to_outbox" == action));
}
bool isMarketplaceSendAction(const std::string& action)
{
return ("send_to_marketplace" == action);
}
// <edit>
void gotImageForSaveItemAs(BOOL success,
LLViewerTexture *src_vi,
@@ -678,12 +694,16 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
items.push_back(std::string("Find Links"));
}
items.push_back(std::string("Rename"));
if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
{
disabled_items.push_back(std::string("Rename"));
}
if (!isInboxFolder())
{
items.push_back(std::string("Rename"));
if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
{
disabled_items.push_back(std::string("Rename"));
}
}
if (show_asset_id)
{
items.push_back(std::string("Copy Asset UUID"));
@@ -709,13 +729,24 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
disabled_items.push_back(std::string("Copy"));
}
if (canListOnMarketplace())
{
items.push_back(std::string("Marketplace Separator"));
items.push_back(std::string("Merchant Copy"));
if (!canListOnMarketplaceNow())
{
disabled_items.push_back(std::string("Merchant Copy"));
}
}
}
}
// Don't allow items to be pasted directly into the COF.
if (!isCOFFolder())
if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder())
{
items.push_back(std::string("Paste"));
items.push_back(std::string("Paste"));
}
if (!isClipboardPasteable() || ((flags & FIRST_SELECTED_ITEM) == 0))
{
@@ -751,6 +782,10 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
else if(isOutboxFolder())
{
addOutboxContextMenuOptions(flags, items, disabled_items);
}
else
{
@@ -835,6 +870,32 @@ void LLInvFVBridge::addOpenRightClickMenuOption(menuentry_vec_t &items)
items.push_back(std::string("Open"));
}
void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags,
menuentry_vec_t &items,
menuentry_vec_t &disabled_items)
{
items.push_back(std::string("Rename"));
items.push_back(std::string("Delete"));
if ((flags & FIRST_SELECTED_ITEM) == 0)
{
disabled_items.push_back(std::string("Rename"));
}
#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
if (isOutboxFolderDirectParent())
{
items.push_back(std::string("Marketplace Separator"));
items.push_back(std::string("Marketplace Send"));
if ((flags & FIRST_SELECTED_ITEM) == 0)
{
disabled_items.push_back(std::string("Marketplace Send"));
}
}
#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
}
// *TODO: remove this
BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
{
@@ -931,6 +992,53 @@ BOOL LLInvFVBridge::isCOFFolder() const
return LLAppearanceMgr::instance().getIsInCOF(mUUID);
}
BOOL LLInvFVBridge::isInboxFolder() const
{
const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
if (inbox_id.isNull())
{
return FALSE;
}
return gInventory.isObjectDescendentOf(mUUID, inbox_id);
}
BOOL LLInvFVBridge::isOutboxFolder() const
{
const LLUUID outbox_id = getOutboxFolder();
if (outbox_id.isNull())
{
return FALSE;
}
return gInventory.isObjectDescendentOf(mUUID, outbox_id);
}
BOOL LLInvFVBridge::isOutboxFolderDirectParent() const
{
BOOL outbox_is_parent = FALSE;
const LLInventoryCategory *cat = gInventory.getCategory(mUUID);
if (cat)
{
const LLUUID outbox_id = getOutboxFolder();
outbox_is_parent = (outbox_id.notNull() && (outbox_id == cat->getParentUUID()));
}
return outbox_is_parent;
}
const LLUUID LLInvFVBridge::getOutboxFolder() const
{
const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
return outbox_id;
}
BOOL LLInvFVBridge::isItemPermissive() const
{
return FALSE;
@@ -1112,6 +1220,110 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid)
}
}
bool LLInvFVBridge::canListOnMarketplace() const
{
#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
LLInventoryModel * model = getInventoryModel();
const LLViewerInventoryCategory * cat = model->getCategory(mUUID);
if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
{
return false;
}
if (!isAgentInventory())
{
return false;
}
if (getOutboxFolder().isNull())
{
return false;
}
if (isInboxFolder() || isOutboxFolder())
{
return false;
}
LLViewerInventoryItem * item = model->getItem(mUUID);
if (item)
{
if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
{
return false;
}
if (LLAssetType::AT_CALLINGCARD == item->getType())
{
return false;
}
}
return true;
#else
return false;
#endif
}
bool LLInvFVBridge::canListOnMarketplaceNow() const
{
#if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU
bool can_list = true;
// Do not allow listing while import is in progress
/*if (LLMarketplaceInventoryImporter::instanceExists())
{
can_list = !LLMarketplaceInventoryImporter::instance().isImportInProgress();
}*/
const LLInventoryObject* obj = getInventoryObject();
can_list &= (obj != NULL);
if (can_list)
{
const LLUUID& object_id = obj->getLinkedUUID();
can_list = object_id.notNull();
if (can_list)
{
LLFolderViewFolder * object_folderp = mRoot->getFolderByID(object_id);
if (object_folderp)
{
can_list = !object_folderp->isLoading();
}
}
if (can_list)
{
// Get outbox id
const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id);
if (outbox_itemp)
{
MASK mask = 0x0;
BOOL drop = FALSE;
EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType());
void * cargo_data = (void *) obj;
can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data);
}
}
}
return can_list;
#else
return false;
#endif
}
// +=================================================+
// | InventoryFVBridgeBuilder |
// +=================================================+
@@ -1209,6 +1421,8 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
folder_view_itemp->getListener()->pasteLinkFromClipboard();
return;
}
// <edit>
else if("reupload" == action)
{
LLInventoryItem* item = model->getItem(mUUID);
@@ -1220,6 +1434,16 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
}
}
// </edit>
else if (isMarketplaceCopyAction(action))
{
llinfos << "Copy item to marketplace action!" << llendl;
LLInventoryItem* itemp = model->getItem(mUUID);
if (!itemp) return;
const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId());
}
}
// static
@@ -1456,6 +1680,10 @@ BOOL LLItemBridge::isItemRenameable() const
return FALSE;
}
// [/RLVa:KB]
if (isInboxFolder())
{
return FALSE;
}
return (item->getPermissions().allowModifyBy(gAgent.getID()));
}
@@ -1493,6 +1721,8 @@ BOOL LLItemBridge::removeItem()
{
return FALSE;
}
// move it to the trash
LLPreview::hide(mUUID, TRUE);
LLInventoryModel* model = getInventoryModel();
@@ -1815,6 +2045,38 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const
}
static BOOL can_move_to_outbox(LLInventoryItem* inv_item)
{
// Collapse links directly to items/folders
LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem();
if (linked_item != NULL)
{
inv_item = linked_item;
}
bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
if (!allow_transfer)
{
return false;
}
#if BLOCK_WORN_ITEMS_IN_OUTBOX
bool worn = get_is_item_worn(inv_item->getUUID());
if (worn)
{
return false;
}
#endif
bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType());
if (calling_card)
{
return false;
}
return true;
}
int get_folder_levels(LLInventoryCategory* inv_cat)
@@ -1872,8 +2134,11 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
const LLUUID &cat_id = inv_cat->getUUID();
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id);
const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id);
// check to make sure source is agent inventory, and is represented there.
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
@@ -1977,6 +2242,94 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
is_movable = RlvFolderLocks::instance().canMoveFolder(cat_id, mUUID);
}
// [/RLVa:KB]
if (is_movable && move_is_into_outbox)
{
const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat);
if (nested_folder_levels > (S32)gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"))
{
is_movable = FALSE;
}
else
{
int dragged_folder_count = descendent_categories.count();
int existing_item_count = 0;
int existing_folder_count = 0;
const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
if (master_folder != NULL)
{
if (model->isObjectDescendentOf(cat_id, master_folder->getUUID()))
{
// Don't use count because we're already inside the same category anyway
dragged_folder_count = 0;
}
else
{
existing_folder_count = 1; // Include the master folder in the count!
// If we're in the drop operation as opposed to the drag without drop, we are doing a
// single category at a time so don't block based on the total amount of cargo data items
if (drop)
{
dragged_folder_count += 1;
}
else
{
// NOTE: The cargo id's count is a total of categories AND items but we err on the side of
// prevention rather than letting too many folders into the hierarchy of the outbox,
// when we're dragging the item to a new parent
dragged_folder_count += LLToolDragAndDrop::instance().getCargoIDsCount();
}
}
// Tally the total number of categories and items inside the master folder
LLInventoryModel::cat_array_t existing_categories;
LLInventoryModel::item_array_t existing_items;
model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
existing_folder_count += existing_categories.count();
existing_item_count += existing_items.count();
}
else
{
// Assume a single category is being dragged to the outbox since we evaluate one at a time
// when not putting them under a parent item.
dragged_folder_count += 1;
}
const int nested_folder_count = existing_folder_count + dragged_folder_count;
const int nested_item_count = existing_item_count + descendent_items.count();
if (nested_folder_count > (S32)gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
{
is_movable = FALSE;
}
else if (nested_item_count > (S32)gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
{
is_movable = FALSE;
}
if (is_movable == TRUE)
{
for (S32 i=0; i < descendent_items.count(); ++i)
{
LLInventoryItem* item = descendent_items[i];
if (!can_move_to_outbox(item))
{
is_movable = FALSE;
break;
}
}
}
}
}
//
//--------------------------------------------------------------------------------
accept = is_movable;
@@ -2039,8 +2392,17 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
#endif
}
}
else if (move_is_into_outbox && !move_is_from_outbox)
{
copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId());
}
else
{
if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
{
set_dad_inbox_object(cat_id);
}
// Reparent the folder and restamp children if it's moving
// into trash.
LLInvFVBridge::changeCategoryParent(
@@ -2053,12 +2415,26 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
}
else if (LLToolDragAndDrop::SOURCE_WORLD == source)
{
accept = move_inv_category_world_to_agent(cat_id, mUUID, drop);
if (move_is_into_outbox)
{
accept = FALSE;
}
else
{
accept = move_inv_category_world_to_agent(cat_id, mUUID, drop);
}
}
else if (LLToolDragAndDrop::SOURCE_LIBRARY == source)
{
// Accept folders that contain complete outfits.
accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(cat_id);
if (move_is_into_outbox)
{
accept = FALSE;
}
else
{
// Accept folders that contain complete outfits.
accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(cat_id);
}
if (accept && drop)
{
@@ -2428,6 +2804,33 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
restoreItem();
return;
}
#ifndef LL_RELEASE_FOR_DOWNLOAD
else if ("delete_system_folder" == action)
{
removeSystemFolder();
}
#endif
else if (isMarketplaceCopyAction(action))
{
llinfos << "Copy folder to marketplace action!" << llendl;
LLInventoryCategory * cat = gInventory.getCategory(mUUID);
if (!cat) return;
const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId());
}
#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
else if (isMarketplaceSendAction(action))
{
llinfos << "Send to marketplace action!" << llendl;
LLInventoryCategory * cat = gInventory.getCategory(mUUID);
if (!cat) return;
send_to_marketplace(cat);
}
#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
}
void LLFolderBridge::openItem()
@@ -2750,6 +3153,10 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
mItems.clear(); // clear any items that used to exist
addTrashContextMenuOptions(mItems, mDisabledItems);
}
else if(isOutboxFolder())
{
addOutboxContextMenuOptions(flags, mItems, mDisabledItems);
}
else if(isAgentInventory()) // do not allow creating in library
{
LLViewerInventoryCategory *cat = getCategory();
@@ -2759,13 +3166,14 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
{
LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get());
if(panel && !panel->getFilterWorn())
if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox or outbox
{
mItems.push_back(std::string("New Folder"));
mItems.push_back(std::string("New Script"));
mItems.push_back(std::string("New Note"));
mItems.push_back(std::string("New Gesture"));
mItems.push_back(std::string("New Clothes"));
mItems.push_back(std::string("New Body Parts"));
mItems.push_back(std::string("New Folder"));
mItems.push_back(std::string("New Script"));
mItems.push_back(std::string("New Note"));
mItems.push_back(std::string("New Gesture"));
mItems.push_back(std::string("New Clothes"));
mItems.push_back(std::string("New Body Parts"));
}
getClipboardEntries(false, mItems, mDisabledItems, flags);
@@ -2829,6 +3237,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
if (trash_id == mUUID) return;
if (isItemInTrash()) return;
if (!isAgentInventory()) return;
if (isOutboxFolder()) return;
LLFolderType::EType type = category->getPreferredType();
const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
@@ -2914,7 +3323,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
lldebugs << "LLFolderBridge::buildContextMenu()" << llendl;
// std::vector<std::string> disabled_items;
LLInventoryModel* model = getInventoryModel();
if(!model) return;
@@ -3280,11 +3688,14 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false);
const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
const BOOL move_is_into_favorites = (mUUID == favorites_id);
const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id);
const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); //(mUUID == outbox_id);
const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_item->getUUID(), outbox_id);
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
BOOL accept = FALSE;
@@ -3378,6 +3789,32 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
accept = can_move_to_landmarks(inv_item);
}
else if (move_is_into_outbox)
{
accept = can_move_to_outbox(inv_item);
if (accept)
{
const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID);
int existing_item_count = LLToolDragAndDrop::instance().getCargoIDsCount();
if (master_folder != NULL)
{
LLInventoryModel::cat_array_t existing_categories;
LLInventoryModel::item_array_t existing_items;
gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE);
existing_item_count += existing_items.count();
}
if (existing_item_count > (S32)gSavedSettings.getU32("InventoryOutboxMaxItemCount"))
{
accept = FALSE;
}
}
}
if(accept && drop)
{
@@ -3410,10 +3847,26 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
dropToOutfit(inv_item, move_is_into_current_outfit);
}
else if (move_is_into_outbox)
{
if (move_is_from_outbox)
{
move_item_within_outbox(inv_item, mUUID, LLToolDragAndDrop::getOperationId());
}
else
{
copy_item_to_outbox(inv_item, mUUID, LLUUID::null, LLToolDragAndDrop::getOperationId());
}
}
// NORMAL or TRASH folder
// (move the item, restamp if into trash)
else
{
// set up observer to select item once drag and drop from inbox is complete
if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
{
set_dad_inbox_object(inv_item->getUUID());
}
LLInvFVBridge::changeItemParent(
model,
@@ -3471,6 +3924,11 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
{
accept = FALSE;
}
else if (move_is_into_outbox)
{
accept = FALSE;
}
if (accept && drop)
{
LLMoveInv* move_inv = new LLMoveInv;
@@ -3496,6 +3954,11 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
else if(LLToolDragAndDrop::SOURCE_NOTECARD == source)
{
if (move_is_into_outbox)
{
accept = FALSE;
}
else
{
// Don't allow placing an original item from a notecard to Current Outfit or an outfit folder
// because they must contain only links to wearable items.
@@ -3516,7 +3979,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
if(item && item->isFinished())
{
accept = TRUE;
if (move_is_into_current_outfit || move_is_into_outfit)
if (move_is_into_outbox)
{
accept = FALSE;
}
else if (move_is_into_current_outfit || move_is_into_outfit)
{
accept = can_move_to_outfit(inv_item, move_is_into_current_outfit);
}
@@ -3643,6 +4111,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addTrashContextMenuOptions(items, disabled_items);
}
else if(isOutboxFolder())
{
addOutboxContextMenuOptions(flags, items, disabled_items);
}
else
{
addOpenRightClickMenuOption(items);
@@ -3708,22 +4180,28 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
// *TODO: Translate
if(isItemInTrash())
if (isOutboxFolder())
{
addTrashContextMenuOptions(items, disabled_items);
addOutboxContextMenuOptions(flags, items, disabled_items);
}
else
{
items.push_back(std::string("Sound Open"));
items.push_back(std::string("Properties"));
if (isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
else
{
items.push_back(std::string("Sound Open"));
items.push_back(std::string("Properties"));
getClipboardEntries(true, items, disabled_items, flags);
getClipboardEntries(true, items, disabled_items, flags);
}
items.push_back(std::string("Sound Separator"));
items.push_back(std::string("Sound Play"));
}
items.push_back(std::string("Sound Separator"));
items.push_back(std::string("Sound Play"));
hide_context_entries(menu, items, disabled_items);
}
@@ -3754,23 +4232,29 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t items;
menuentry_vec_t disabled_items;
// *TODO: Translate
lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl;
if(isItemInTrash())
if(isOutboxFolder())
{
addTrashContextMenuOptions(items, disabled_items);
addOutboxContextMenuOptions(flags, items, disabled_items);
}
else
{
items.push_back(std::string("Landmark Open"));
items.push_back(std::string("Properties"));
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
else
{
items.push_back(std::string("Landmark Open"));
items.push_back(std::string("Properties"));
getClipboardEntries(true, items, disabled_items, flags);
getClipboardEntries(true, items, disabled_items, flags);
}
items.push_back(std::string("Landmark Separator"));
items.push_back(std::string("Teleport To Landmark"));
}
items.push_back(std::string("Landmark Separator"));
items.push_back(std::string("Teleport To Landmark"));
// Disable "About Landmark" menu item for
// multiple landmarks selected. Only one landmark
// info panel can be shown at a time.
@@ -3997,6 +4481,10 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
else if(isOutboxFolder())
{
items.push_back(std::string("Delete"));
}
else
{
@@ -4311,6 +4799,10 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addTrashContextMenuOptions(items, disabled_items);
}
else if(isOutboxFolder())
{
items.push_back(std::string("Delete"));
}
else
{
@@ -4322,8 +4814,8 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Gesture Separator"));
if (LLGestureMgr::instance().isGestureActive(getUUID()))
{
items.push_back(std::string("Deactivate"));
}
items.push_back(std::string("Deactivate"));
}
else
{
items.push_back(std::string("Activate"));
@@ -4357,22 +4849,29 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
menuentry_vec_t disabled_items;
lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl;
if(isItemInTrash())
if(isOutboxFolder())
{
addTrashContextMenuOptions(items, disabled_items);
items.push_back(std::string("Delete"));
}
else
{
items.push_back(std::string("Animation Open"));
items.push_back(std::string("Properties"));
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
else
{
items.push_back(std::string("Animation Open"));
items.push_back(std::string("Properties"));
getClipboardEntries(true, items, disabled_items, flags);
getClipboardEntries(true, items, disabled_items, flags);
}
items.push_back(std::string("Animation Separator"));
items.push_back(std::string("Animation Play"));
items.push_back(std::string("Animation Audition"));
}
items.push_back(std::string("Animation Separator"));
items.push_back(std::string("Animation Play"));
items.push_back(std::string("Animation Audition"));
hide_context_entries(menu, items, disabled_items);
}
@@ -4724,8 +5223,11 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemInTrash())
{
addTrashContextMenuOptions(items, disabled_items);
}
}
else if(isOutboxFolder())
{
items.push_back(std::string("Delete"));
}
else
{
items.push_back(std::string("Properties"));
@@ -5085,6 +5587,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
{
addTrashContextMenuOptions(items, disabled_items);
}
else if(isOutboxFolder())
{
items.push_back(std::string("Delete"));
}
else
{ // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere
BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM);
@@ -5537,6 +6043,10 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
items.push_back(std::string("Restore Item"));
}
else if(isOutboxFolder())
{
addOutboxContextMenuOptions(flags, items, disabled_items);
}
else
{
items.push_back(std::string("Properties"));
@@ -5544,7 +6054,6 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
getClipboardEntries(true, items, disabled_items, flags);
}
hide_context_entries(menu, items, disabled_items);
}

View File

@@ -69,6 +69,8 @@ public:
U32 flags = 0x00);
virtual ~LLInvFVBridge() {}
bool canListOnMarketplace() const;
bool canListOnMarketplaceNow() const;
//--------------------------------------------------------------------
// LLInvFVBridge functionality
@@ -128,6 +130,9 @@ protected:
virtual void addDeleteContextMenuOptions(menuentry_vec_t &items,
menuentry_vec_t &disabled_items);
virtual void addOpenRightClickMenuOption(menuentry_vec_t &items);
virtual void addOutboxContextMenuOptions(U32 flags,
menuentry_vec_t &items,
menuentry_vec_t &disabled_items);
protected:
LLInvFVBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid);
@@ -139,6 +144,11 @@ protected:
BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendent of
BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox
BOOL isOutboxFolder() const; // true if COF or descendent of marketplace outbox
BOOL isOutboxFolderDirectParent() const;
const LLUUID getOutboxFolder() const;
virtual BOOL isItemPermissive() const;
static void changeItemParent(LLInventoryModel* model,
LLViewerInventoryItem* item,

View File

@@ -55,6 +55,7 @@
#include "llinventorymodel.h"
#include "llinventorypanel.h"
#include "lllineeditor.h"
#include "llmarketplacenotifications.h"
#include "llmenugl.h"
#include "llnotificationsutil.h"
#include "llpanelmaininventory.h"
@@ -518,6 +519,177 @@ void show_item_profile(const LLUUID& item_uuid)
}
}
void open_outbox()
{
//LLFloaterReg::showInstance("outbox");
}
LLUUID create_folder_in_outbox_for_item(LLInventoryItem* item, const LLUUID& destFolderId, S32 operation_id)
{
llassert(item);
llassert(destFolderId.notNull());
LLUUID created_folder_id = gInventory.createNewCategory(destFolderId, LLFolderType::FT_NONE, item->getName());
gInventory.notifyObservers();
LLNotificationsUtil::add("OutboxFolderCreated");
return created_folder_id;
}
void move_to_outbox_cb_action(const LLSD& payload)
{
LLViewerInventoryItem * viitem = gInventory.getItem(payload["item_id"].asUUID());
LLUUID dest_folder_id = payload["dest_folder_id"].asUUID();
if (viitem)
{
// when moving item directly into outbox create folder with that name
if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
{
S32 operation_id = payload["operation_id"].asInteger();
dest_folder_id = create_folder_in_outbox_for_item(viitem, dest_folder_id, operation_id);
}
LLUUID parent = viitem->getParentUUID();
change_item_parent(
&gInventory,
viitem,
dest_folder_id,
false);
LLUUID top_level_folder = payload["top_level_folder"].asUUID();
if (top_level_folder != LLUUID::null)
{
LLViewerInventoryCategory* category;
while (parent.notNull())
{
LLInventoryModel::cat_array_t* cat_array;
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(parent,cat_array,item_array);
LLUUID next_parent;
category = gInventory.getCategory(parent);
if (!category) break;
next_parent = category->getParentUUID();
if (cat_array->empty() && item_array->empty())
{
remove_category(&gInventory, parent);
}
if (parent == top_level_folder)
{
break;
}
parent = next_parent;
}
}
open_outbox();
}
}
void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id)
{
// Collapse links directly to items/folders
LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
LLViewerInventoryCategory * linked_category = viewer_inv_item->getLinkedCategory();
if (linked_category != NULL)
{
copy_folder_to_outbox(linked_category, dest_folder, top_level_folder, operation_id);
}
else
{
LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem();
if (linked_item != NULL)
{
inv_item = (LLInventoryItem *) linked_item;
}
// Check for copy permissions
if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()))
{
// when moving item directly into outbox create folder with that name
if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
{
dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id);
}
copy_inventory_item(gAgent.getID(),
inv_item->getPermissions().getOwner(),
inv_item->getUUID(),
dest_folder,
inv_item->getName(),
LLPointer<LLInventoryCallback>(NULL));
open_outbox();
}
else
{
LLSD payload;
payload["item_id"] = inv_item->getUUID();
payload["dest_folder_id"] = dest_folder;
payload["top_level_folder"] = top_level_folder;
payload["operation_id"] = operation_id;
LLMarketplaceInventoryNotifications::addNoCopyNotification(payload, move_to_outbox_cb_action);
}
}
}
void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id)
{
// when moving item directly into outbox create folder with that name
if (dest_folder == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false))
{
dest_folder = create_folder_in_outbox_for_item(inv_item, dest_folder, operation_id);
}
LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item;
change_item_parent(&gInventory,
viewer_inv_item,
dest_folder,
false);
}
void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id)
{
LLUUID new_folder_id = gInventory.createNewCategory(dest_folder, LLFolderType::FT_NONE, inv_cat->getName());
gInventory.notifyObservers();
LLInventoryModel::cat_array_t* cat_array;
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(inv_cat->getUUID(),cat_array,item_array);
// copy the vector because otherwise the iterator won't be happy if we delete from it
LLInventoryModel::item_array_t item_array_copy = *item_array;
for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++)
{
LLInventoryItem* item = *iter;
copy_item_to_outbox(item, new_folder_id, top_level_folder, operation_id);
}
LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
{
LLViewerInventoryCategory* category = *iter;
copy_folder_to_outbox(category, new_folder_id, top_level_folder, operation_id);
}
open_outbox();
}
///----------------------------------------------------------------------------
/// LLInventoryCollectFunctor implementations
///----------------------------------------------------------------------------

View File

@@ -71,6 +71,15 @@ void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::s
// Generates a string containing the path to the item specified by item_id.
void append_path(const LLUUID& id, std::string& path);
void copy_item_to_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, const LLUUID& top_level_folder, S32 operation_id);
void move_item_within_outbox(LLInventoryItem* inv_item, LLUUID dest_folder, S32 operation_id);
void copy_folder_to_outbox(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, const LLUUID& top_level_folder, S32 operation_id);
/** Miscellaneous global functions
** **
*******************************************************************************/
/********************************************************************************
** **
** INVENTORY COLLECTOR FUNCTIONS

View File

@@ -182,6 +182,8 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id,
const BOOL break_on_recursion) const
{
if (obj_id == cat_id) return TRUE;
//The while loop will ALWAYS return false if parent_id is null, regardless of cat_id being null too. Don't bother trying.
if(cat_id.isNull()) return FALSE;
LLInventoryObject* obj = getObject(obj_id);
int depthCounter = 0;
while(obj)

View File

@@ -62,6 +62,7 @@
#include "llviewerjoint.h"
#include "llviewerobject.h"
#include "llviewerwindow.h"
#include "llviewershadermgr.h"
#include "llvoavatarself.h"
#include "llworld.h"
#include "llui.h"
@@ -1662,17 +1663,28 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
LLQuaternion grid_rotation,
LLColor4 inner_color)
{
if (!gSavedSettings.getBOOL("GridCrossSections"))
if (!gSavedSettings.getBOOL("GridCrossSections") || !LLGLSLShader::sNoFixedFunction)
{
return;
}
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
U32 types[] = { LLRenderPass::PASS_SIMPLE, LLRenderPass::PASS_ALPHA, LLRenderPass::PASS_FULLBRIGHT, LLRenderPass::PASS_SHINY };
U32 num_types = LL_ARRAY_SIZE(types);
GLuint stencil_mask = 0xFFFFFFFF;
//stencil in volumes
gGL.flush();
if (shader)
{
gClipProgram.bind();
}
{
glStencilMask(stencil_mask);
glClearStencil(1);
@@ -1683,6 +1695,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
glStencilFunc(GL_ALWAYS, 0, stencil_mask);
gGL.setColorMask(false, false);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.diffuseColor4f(1,1,1,1);
//setup clip plane
@@ -1692,10 +1705,12 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
normal = -normal;
}
F32 d = -(selection_center * normal);
F64 plane[] = { normal.mV[0], normal.mV[1], normal.mV[2], d };
LLGLEnable clip(GL_CLIP_PLANE0);
glClipPlane(GL_CLIP_PLANE0, plane);
glh::vec4f plane(normal.mV[0], normal.mV[1], normal.mV[2], d );
gGL.getModelviewMatrix().inverse().mult_vec_matrix(plane);
gClipProgram.uniform4fv("clip_plane", 1, plane.v);
BOOL particles = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_PARTICLES);
BOOL clouds = gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS);
@@ -1746,6 +1761,11 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
F32 sz = mGridSizeMeters;
F32 tiles = sz;
if (shader)
{
shader->bind();
}
//draw volume/plane intersections
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

View File

@@ -0,0 +1,90 @@
/**
* @file llmarketplacenotifications.cpp
* @brief Handler for notifications related to marketplace file I/O
* class definition
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
// Precompiled header
#include "llviewerprecompiledheaders.h"
#include "llmarketplacenotifications.h"
#include "llnotificationsutil.h"
#include "llerror.h"
#include <boost/foreach.hpp>
#include <boost/signals2.hpp>
namespace LLMarketplaceInventoryNotifications
{
typedef boost::signals2::signal<void (const LLSD& param)> no_copy_payload_cb_signal_t;
static no_copy_payload_cb_signal_t* no_copy_cb_action = NULL;
static bool no_copy_notify_active = false;
static std::list<LLSD> no_copy_payloads;
void notifyNoCopyCallback(const LLSD& notification, const LLSD& response)
{
const S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
llassert(!no_copy_payloads.empty());
llassert(no_copy_cb_action != NULL);
BOOST_FOREACH(const LLSD& payload, no_copy_payloads)
{
(*no_copy_cb_action)(payload);
}
}
delete no_copy_cb_action;
no_copy_cb_action = NULL;
no_copy_notify_active = false;
no_copy_payloads.clear();
}
void update()
{
if (!no_copy_notify_active && !no_copy_payloads.empty())
{
no_copy_notify_active = true;
LLNotificationsUtil::add("ConfirmNoCopyToOutbox", LLSD(), LLSD(), boost::bind(&notifyNoCopyCallback, _1, _2));
}
}
void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb)
{
if (no_copy_cb_action == NULL)
{
no_copy_cb_action = new no_copy_payload_cb_signal_t;
no_copy_cb_action->connect(boost::bind(cb, _1));
}
no_copy_payloads.push_back(payload);
}
}

View File

@@ -0,0 +1,57 @@
/**
* @file llmarketplacenotifications.h
* @brief Handler for notifications related to marketplace file I/O
* class definition
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLMARKETPLACENOTIFICATIONS_H
#define LL_LLMARKETPLACENOTIFICATIONS_H
#include <llsd.h>
#include <boost/function.hpp>
//
// This is a set of helper functions to handle a unique notification with multiple
// payloads, helpful when dragging and dropping items to the merchant outbox that
// trigger notifications that can potentially interfere with the current drag and
// drop operation.
//
// Notification payloads are cached locally when initiated, the notification itself
// is triggered on the following frame during the call to "update" and then the
// response is triggered once per payload.
//
namespace LLMarketplaceInventoryNotifications
{
void update();
typedef boost::function<void (const LLSD&)> NoCopyCallbackFunction;
void addNoCopyNotification(const LLSD& payload, const NoCopyCallbackFunction& cb);
};
#endif // LL_LLMARKETPLACENOTIFICATIONS_H

View File

@@ -756,7 +756,7 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)
const F32 area_for_max_settings = 0.0;
const F32 area_for_min_settings = 1400.0;
const F32 area_for_this_setting = area_for_max_settings + (area_for_min_settings-area_for_max_settings)*(1.0-lod_factor);
const F32 pixel_area = (F32) sqrt(mCharacter->getPixelArea());
const F32 pixel_area = sqrtf(mCharacter->getPixelArea());
const BOOL is_self = (dynamic_cast<LLVOAvatarSelf *>(mCharacter) != NULL);
if ((pixel_area > area_for_this_setting) || is_self)

View File

@@ -44,6 +44,7 @@
#include "lldir.h"
#include "llmultigesture.h"
#include "llvfile.h"
#include "lltrans.h"
// newview
#include "llagent.h" // todo: remove
@@ -327,7 +328,7 @@ void LLPreviewGesture::setMinimized(BOOL minimize)
bool LLPreviewGesture::handleSaveChangesDialog(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
switch(option)
{
case 0: // "Yes"
@@ -701,7 +702,7 @@ void LLPreviewGesture::refresh()
{
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
bool is_complete = (item && item->isComplete()) ? true : false;
bool is_complete = (item && item->isFinished()) ? true : false;
if (mPreviewGesture || !is_complete)
{
@@ -862,7 +863,7 @@ void LLPreviewGesture::initDefaultGesture()
item = addStep( STEP_ANIMATION );
LLGestureStepAnimation* anim = (LLGestureStepAnimation*)item->getUserdata();
anim->mAnimAssetID = ANIM_AGENT_HELLO;
anim->mAnimName = "Wave";
anim->mAnimName = LLTrans::getString("Wave");
updateLabel(item);
item = addStep( STEP_WAIT );
@@ -872,7 +873,7 @@ void LLPreviewGesture::initDefaultGesture()
item = addStep( STEP_CHAT );
LLGestureStepChat* chat_step = (LLGestureStepChat*)item->getUserdata();
chat_step->mChatText = "Hello, avatar!";
chat_step->mChatText = LLTrans::getString("HelloAvatar");
updateLabel(item);
// Start with item list selected
@@ -1084,7 +1085,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture)
// Create an enabled item with this step
LLSD row;
row["columns"][0]["value"] = new_step->getLabel();
row["columns"][0]["value"] = getLabel( new_step->getLabel());
row["columns"][0]["font"] = "SANSSERIF_SMALL";
LLScrollListItem* item = mStepList->addElement(row);
item->setUserdata(new_step);
@@ -1400,7 +1401,7 @@ void LLPreviewGesture::updateLabel(LLScrollListItem* item)
LLScrollListCell* cell = item->getColumn(0);
LLScrollListText* text_cell = (LLScrollListText*)cell;
std::string label = step->getLabel();
std::string label = getLabel( step->getLabel());
text_cell->setText(label);
}
@@ -1662,7 +1663,7 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
// Create an enabled item with this step
LLSD row;
row["columns"][0]["value"] = step->getLabel();
row["columns"][0]["value"] = getLabel(step->getLabel());
row["columns"][0]["font"] = "SANSSERIF_SMALL";
LLScrollListItem* step_item = mStepList->addElement(row);
step_item->setUserdata(step);
@@ -1676,6 +1677,63 @@ LLScrollListItem* LLPreviewGesture::addStep( const EStepType step_type )
return step_item;
}
// static
std::string LLPreviewGesture::getLabel(std::vector<std::string> labels)
{
std::vector<std::string> v_labels = labels ;
std::string result("");
if( v_labels.size() != 2)
{
return result;
}
if(v_labels[0]=="Chat")
{
result=LLTrans::getString("Chat Message");
}
else if(v_labels[0]=="Sound")
{
result=LLTrans::getString("Sound");
}
else if(v_labels[0]=="Wait")
{
result=LLTrans::getString("Wait");
}
else if(v_labels[0]=="AnimFlagStop")
{
result=LLTrans::getString("AnimFlagStop");
}
else if(v_labels[0]=="AnimFlagStart")
{
result=LLTrans::getString("AnimFlagStart");
}
// lets localize action value
std::string action = v_labels[1];
if ("None" == action)
{
action = LLTrans::getString("GestureActionNone");
}
else if ("until animations are done" == action)
{
//action = LLFloaterReg::getInstance("preview_gesture")->getChild<LLCheckBoxCtrl>("wait_anim_check")->getLabel();
//Worst. Thing. Ever. We are in a static function. Find any existing gesture preview and grab the label from its 'wait_anim_check' element.
for(preview_map_t::iterator it = LLPreview::sInstances.begin(); it != LLPreview::sInstances.end();++it)
{
LLPreviewGesture* pPreview = dynamic_cast<LLPreviewGesture*>(it->second);
if(pPreview)
{
pPreview->getChild<LLCheckBoxCtrl>("wait_anim_check")->getLabel();
break;
}
}
}
result.append(action);
return result;
}
// static
void LLPreviewGesture::onClickUp(void* data)
{

View File

@@ -113,6 +113,7 @@ protected:
// "Sound", "Chat", or "Wait"
LLScrollListItem* addStep(const enum EStepType step_type);
static std::string getLabel(std::vector<std::string> labels);
static void updateLabel(LLScrollListItem* item);
static void onCommitSetDirty(LLUICtrl* ctrl, void* data);

View File

@@ -2,31 +2,25 @@
* @file llresourcedata.h
* @brief Tracking object for uploads.
*
* $LicenseInfo:firstyear=2006&license=viewergpl$
*
* Copyright (c) 2006-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2006&license=viewerlgpl$
* 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
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -44,6 +38,7 @@ struct LLResourceData
U32 mNextOwnerPerm;
S32 mExpectedUploadCost;
void *mUserData;
static const S8 INVALID_LOCATION = -2;
};
#endif

View File

@@ -1747,6 +1747,7 @@ bool idle_startup()
set_startup_status(0.4f, LLTrans::getString("LoginRequestSeedCapGrant"), gAgent.mMOTD);
}
}
display_startup();
return FALSE;
}
@@ -2432,10 +2433,9 @@ bool idle_startup()
item_ids.push_back(item_id);
}
}
LLGestureInventoryFetchObserver* fetch = new LLGestureInventoryFetchObserver(item_ids);
// deletes itself when done
gInventory.addObserver(fetch);
// no need to add gesture to inventory observer, it's already made in constructor
LLGestureMgr::instance().setFetchIDs(item_ids);
LLGestureMgr::instance().startFetch();
}
}
gDisplaySwapBuffers = TRUE;
@@ -2646,10 +2646,11 @@ bool idle_startup()
LLViewerParcelMedia::loadDomainFilterList();
// Let the map know about the inventory.
if(gFloaterWorldMap)
LLFloaterWorldMap* floater_world_map = gFloaterWorldMap;
if(floater_world_map)
{
gFloaterWorldMap->observeInventory(&gInventory);
gFloaterWorldMap->observeFriends();
floater_world_map->observeInventory(&gInventory);
floater_world_map->observeFriends();
}
// Start the AO now that settings have loaded and login successful -- MC
@@ -2735,332 +2736,6 @@ bool idle_startup()
return TRUE;
}
bool process_login_success_response(std::string& password)
{
LLSD response = LLUserAuth::getInstance()->getResponse();
std::string text(response["udp_blacklist"]);
if(!text.empty())
{
apply_udp_blacklist(text);
}
// unpack login data needed by the application
text = response["agent_id"].asString();
if(!text.empty()) gAgentID.set(text);
gDebugInfo["AgentID"] = text;
text = response["session_id"].asString();
if(!text.empty()) gAgentSessionID.set(text);
gDebugInfo["SessionID"] = text;
text = response["secure_session_id"].asString();
if(!text.empty()) gAgent.mSecureSessionID.set(text);
std::string firstname;
std::string lastname;
text = response["first_name"].asString();
if(!text.empty())
{
// Remove quotes from string. Login.cgi sends these to force
// names that look like numbers into strings.
firstname.assign(text);
LLStringUtil::replaceChar(firstname, '"', ' ');
LLStringUtil::trim(firstname);
}
text = response["last_name"].asString();
if(!text.empty()) lastname.assign(text);
gSavedSettings.setString("FirstName", firstname);
gSavedSettings.setString("LastName", lastname);
// <edit>
gFullName = utf8str_tolower(firstname + " " + lastname);
// </edit>
if (gSavedSettings.getBOOL("RememberPassword"))
{
// Successful login means the password is valid, so save it.
LLStartUp::savePasswordToDisk(password);
}
else
{
// Don't leave password from previous session sitting around
// during this login session.
LLStartUp::deletePasswordFromDisk();
password.assign(""); // clear the password so it isn't saved to login history either
}
{
// Save the login history data to disk
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName();
history_data.deleteEntry(firstname, lastname, grid_nick);
if (gSavedSettings.getBOOL("RememberLogin"))
{
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_nick);
history_data.addEntry(login_entry);
}
else
{
// Clear the old-style login data as well
gSavedSettings.setString("FirstName", std::string(""));
gSavedSettings.setString("LastName", std::string(""));
}
LLSavedLogins::saveFile(history_data, history_file);
}
// this is their actual ability to access content
text = response["agent_access_max"].asString();
if (!text.empty())
{
// agent_access can be 'A', 'M', and 'PG'.
gAgent.setMaturity(text[0]);
}
// this is the value of their preference setting for that content
// which will always be <= agent_access_max
text = response["agent_region_access"].asString();
if (!text.empty())
{
U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]);
gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
}
// During the AO transition, this flag will be true. Then the flag will
// go away. After the AO transition, this code and all the code that
// uses it can be deleted.
text = response["ao_transition"].asString();
if (!text.empty())
{
if (text == "1")
{
gAgent.setAOTransition();
}
}
text = response["start_location"].asString();
if(!text.empty())
{
gAgentStartLocation.assign(text);
}
text = response["circuit_code"].asString();
if(!text.empty())
{
gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
}
std::string sim_ip_str = response["sim_ip"];
std::string sim_port_str = response["sim_port"];
if(!sim_ip_str.empty() && !sim_port_str.empty())
{
U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
gFirstSim.set(sim_ip_str, sim_port);
if (gFirstSim.isOk())
{
gMessageSystem->enableCircuit(gFirstSim, TRUE);
}
}
std::string region_x_str = response["region_x"];
std::string region_y_str = response["region_y"];
if(!region_x_str.empty() && !region_y_str.empty())
{
U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
gFirstSimHandle = to_region_handle(region_x, region_y);
}
const std::string look_at_str = response["look_at"];
if (!look_at_str.empty())
{
size_t len = look_at_str.size();
LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
gAgentStartLookAt = ll_vector3_from_sd(sd);
}
text = response["seed_capability"].asString();
if (!text.empty()) gFirstSimSeedCap = text;
text = response["seconds_since_epoch"].asString();
if(!text.empty())
{
U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
if(server_utc_time)
{
time_t now = time(NULL);
gUTCOffset = (server_utc_time - now);
}
}
std::string home_location = response["home"];
if(!home_location.empty())
{
size_t len = home_location.size();
LLMemoryStream mstr((U8*)home_location.c_str(), len);
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
S32 region_x = sd["region_handle"][0].asInteger();
S32 region_y = sd["region_handle"][1].asInteger();
U64 region_handle = to_region_handle(region_x, region_y);
LLVector3 position = ll_vector3_from_sd(sd["position"]);
gAgent.setHomePosRegion(region_handle, position);
}
gAgent.mMOTD.assign(response["message"]);
// Options...
// Each 'option' is an array of submaps.
// It appears that we only ever use the first element of the array.
LLUUID inv_root_folder_id = response["inventory-root"][0]["folder_id"];
if(inv_root_folder_id.notNull())
{
gInventory.setRootFolderID(inv_root_folder_id);
//gInventory.mock(gAgent.getInventoryRootID());
}
LLSD login_flags = response["login-flags"][0];
if(login_flags.size())
{
std::string flag = login_flags["ever_logged_in"];
if(!flag.empty())
{
gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE);
}
/* Flag is currently ignored by the viewer.
flag = login_flags["stipend_since_login"];
if(flag == "Y")
{
stipend_since_login = true;
}
*/
flag = login_flags["gendered"].asString();
if(flag == "Y")
{
gAgent.setGenderChosen(TRUE);
}
flag = login_flags["daylight_savings"].asString();
if(flag == "Y")
{
gPacificDaylightTime = (flag == "Y");
}
}
std::string map_server_url = response["map-server-url"];
if(!map_server_url.empty())
{
gSavedSettings.setString("MapServerURL", map_server_url);
LLWorldMap::gotMapServerURL(true);
}
// Initial outfit for the user.
LLSD initial_outfit = response["initial-outfit"][0];
if(initial_outfit.size())
{
std::string flag = initial_outfit["folder_name"];
if(!flag.empty())
{
// Initial outfit is a folder in your inventory,
// must be an exact folder-name match.
sInitialOutfit = flag;
}
flag = initial_outfit["gender"].asString();
if(!flag.empty())
{
sInitialOutfitGender = flag;
}
}
LLSD global_textures = response["global-textures"][0];
if(global_textures.size())
{
// Extract sun and moon texture IDs. These are used
// in the LLVOSky constructor, but I can't figure out
// how to pass them in. JC
LLUUID id = global_textures["sun_texture_id"];
if(id.notNull())
{
gSunTextureID = id;
}
id = global_textures["moon_texture_id"];
if(id.notNull())
{
gMoonTextureID = id;
}
id = global_textures["cloud_texture_id"];
if(id.notNull())
{
gCloudTextureID = id;
}
}
// Override grid info with anything sent in the login response
std::string tmp = response["gridname"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
tmp = response["loginuri"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
tmp = response["welcome"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
tmp = response["loginpage"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
tmp = response["economy"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
tmp = response["helperuri"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
tmp = response["about"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
tmp = response["website"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
tmp = response["help"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
tmp = response["support"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
tmp = response["register"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
tmp = response["account"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
tmp = response["password"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
tmp = response["search"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
tmp = response["currency"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
tmp = response["real_currency"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
tmp = response["directory_fee"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
tmp = response["max_groups"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
tmp = response["max-agent-groups"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
tmp = response["VoiceConnector"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
gHippoGridManager->saveFile();
gHippoLimits->setLimits();
gIMMgr->loadIgnoreGroup();
bool success = false;
// JC: gesture loading done below, when we have an asset system
// in place. Don't delete/clear user_credentials until then.
if(gAgentID.notNull()
&& gAgentSessionID.notNull()
&& gMessageSystem->mOurCircuitCode
&& gFirstSim.isOk()
&& gInventory.getRootFolderID().notNull())
{
success = true;
}
return success;
}
//
// local function definition
@@ -4353,3 +4028,327 @@ bool LLStartUp::startLLProxy()
return proxy_ok;
}
bool process_login_success_response(std::string& password)
{
LLSD response = LLUserAuth::getInstance()->getResponse();
std::string text(response["udp_blacklist"]);
if(!text.empty())
{
apply_udp_blacklist(text);
}
// unpack login data needed by the application
text = response["agent_id"].asString();
if(!text.empty()) gAgentID.set(text);
gDebugInfo["AgentID"] = text;
text = response["session_id"].asString();
if(!text.empty()) gAgentSessionID.set(text);
gDebugInfo["SessionID"] = text;
text = response["secure_session_id"].asString();
if(!text.empty()) gAgent.mSecureSessionID.set(text);
std::string firstname;
std::string lastname;
text = response["first_name"].asString();
if(!text.empty())
{
// Remove quotes from string. Login.cgi sends these to force
// names that look like numbers into strings.
firstname.assign(text);
LLStringUtil::replaceChar(firstname, '"', ' ');
LLStringUtil::trim(firstname);
}
text = response["last_name"].asString();
if(!text.empty()) lastname.assign(text);
gSavedSettings.setString("FirstName", firstname);
gSavedSettings.setString("LastName", lastname);
// <edit>
gFullName = utf8str_tolower(firstname + " " + lastname);
// </edit>
if (gSavedSettings.getBOOL("RememberPassword"))
{
// Successful login means the password is valid, so save it.
LLStartUp::savePasswordToDisk(password);
}
else
{
// Don't leave password from previous session sitting around
// during this login session.
LLStartUp::deletePasswordFromDisk();
password.assign(""); // clear the password so it isn't saved to login history either
}
{
// Save the login history data to disk
std::string history_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml");
LLSavedLogins history_data = LLSavedLogins::loadFile(history_file);
std::string grid_nick = gHippoGridManager->getConnectedGrid()->getGridName();
history_data.deleteEntry(firstname, lastname, grid_nick);
if (gSavedSettings.getBOOL("RememberLogin"))
{
LLSavedLoginEntry login_entry(firstname, lastname, password, grid_nick);
history_data.addEntry(login_entry);
}
else
{
// Clear the old-style login data as well
gSavedSettings.setString("FirstName", std::string(""));
gSavedSettings.setString("LastName", std::string(""));
}
LLSavedLogins::saveFile(history_data, history_file);
}
// this is their actual ability to access content
text = response["agent_access_max"].asString();
if (!text.empty())
{
// agent_access can be 'A', 'M', and 'PG'.
gAgent.setMaturity(text[0]);
}
// this is the value of their preference setting for that content
// which will always be <= agent_access_max
text = response["agent_region_access"].asString();
if (!text.empty())
{
U32 preferredMaturity = (U32)LLAgent::convertTextToMaturity(text[0]);
gSavedSettings.setU32("PreferredMaturity", preferredMaturity);
}
// During the AO transition, this flag will be true. Then the flag will
// go away. After the AO transition, this code and all the code that
// uses it can be deleted.
text = response["ao_transition"].asString();
if (!text.empty())
{
if (text == "1")
{
gAgent.setAOTransition();
}
}
text = response["start_location"].asString();
if(!text.empty())
{
gAgentStartLocation.assign(text);
}
text = response["circuit_code"].asString();
if(!text.empty())
{
gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
}
std::string sim_ip_str = response["sim_ip"];
std::string sim_port_str = response["sim_port"];
if(!sim_ip_str.empty() && !sim_port_str.empty())
{
U32 sim_port = strtoul(sim_port_str.c_str(), NULL, 10);
gFirstSim.set(sim_ip_str, sim_port);
if (gFirstSim.isOk())
{
gMessageSystem->enableCircuit(gFirstSim, TRUE);
}
}
std::string region_x_str = response["region_x"];
std::string region_y_str = response["region_y"];
if(!region_x_str.empty() && !region_y_str.empty())
{
U32 region_x = strtoul(region_x_str.c_str(), NULL, 10);
U32 region_y = strtoul(region_y_str.c_str(), NULL, 10);
gFirstSimHandle = to_region_handle(region_x, region_y);
}
const std::string look_at_str = response["look_at"];
if (!look_at_str.empty())
{
size_t len = look_at_str.size();
LLMemoryStream mstr((U8*)look_at_str.c_str(), len);
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
gAgentStartLookAt = ll_vector3_from_sd(sd);
}
text = response["seed_capability"].asString();
if (!text.empty()) gFirstSimSeedCap = text;
text = response["seconds_since_epoch"].asString();
if(!text.empty())
{
U32 server_utc_time = strtoul(text.c_str(), NULL, 10);
if(server_utc_time)
{
time_t now = time(NULL);
gUTCOffset = (server_utc_time - now);
}
}
std::string home_location = response["home"];
if(!home_location.empty())
{
size_t len = home_location.size();
LLMemoryStream mstr((U8*)home_location.c_str(), len);
LLSD sd = LLSDSerialize::fromNotation(mstr, len);
S32 region_x = sd["region_handle"][0].asInteger();
S32 region_y = sd["region_handle"][1].asInteger();
U64 region_handle = to_region_handle(region_x, region_y);
LLVector3 position = ll_vector3_from_sd(sd["position"]);
gAgent.setHomePosRegion(region_handle, position);
}
gAgent.mMOTD.assign(response["message"]);
// Options...
// Each 'option' is an array of submaps.
// It appears that we only ever use the first element of the array.
LLUUID inv_root_folder_id = response["inventory-root"][0]["folder_id"];
if(inv_root_folder_id.notNull())
{
gInventory.setRootFolderID(inv_root_folder_id);
//gInventory.mock(gAgent.getInventoryRootID());
}
LLSD login_flags = response["login-flags"][0];
if(login_flags.size())
{
std::string flag = login_flags["ever_logged_in"];
if(!flag.empty())
{
gAgent.setFirstLogin((flag == "N") ? TRUE : FALSE);
}
/* Flag is currently ignored by the viewer.
flag = login_flags["stipend_since_login"];
if(flag == "Y")
{
stipend_since_login = true;
}
*/
flag = login_flags["gendered"].asString();
if(flag == "Y")
{
gAgent.setGenderChosen(TRUE);
}
flag = login_flags["daylight_savings"].asString();
if(flag == "Y")
{
gPacificDaylightTime = (flag == "Y");
}
}
std::string map_server_url = response["map-server-url"];
if(!map_server_url.empty())
{
gSavedSettings.setString("MapServerURL", map_server_url);
LLWorldMap::gotMapServerURL(true);
}
// Initial outfit for the user.
LLSD initial_outfit = response["initial-outfit"][0];
if(initial_outfit.size())
{
std::string flag = initial_outfit["folder_name"];
if(!flag.empty())
{
// Initial outfit is a folder in your inventory,
// must be an exact folder-name match.
sInitialOutfit = flag;
}
flag = initial_outfit["gender"].asString();
if(!flag.empty())
{
sInitialOutfitGender = flag;
}
}
LLSD global_textures = response["global-textures"][0];
if(global_textures.size())
{
// Extract sun and moon texture IDs. These are used
// in the LLVOSky constructor, but I can't figure out
// how to pass them in. JC
LLUUID id = global_textures["sun_texture_id"];
if(id.notNull())
{
gSunTextureID = id;
}
id = global_textures["moon_texture_id"];
if(id.notNull())
{
gMoonTextureID = id;
}
id = global_textures["cloud_texture_id"];
if(id.notNull())
{
gCloudTextureID = id;
}
}
// Override grid info with anything sent in the login response
std::string tmp = response["gridname"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
tmp = response["loginuri"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
tmp = response["welcome"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
tmp = response["loginpage"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
tmp = response["economy"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
tmp = response["helperuri"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
tmp = response["about"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
tmp = response["website"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
tmp = response["help"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
tmp = response["support"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
tmp = response["register"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
tmp = response["account"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
tmp = response["password"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
tmp = response["search"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
tmp = response["currency"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
tmp = response["real_currency"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
tmp = response["directory_fee"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
tmp = response["max_groups"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
tmp = response["max-agent-groups"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
tmp = response["VoiceConnector"];
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
gHippoGridManager->saveFile();
gHippoLimits->setLimits();
gIMMgr->loadIgnoreGroup();
bool success = false;
// JC: gesture loading done below, when we have an asset system
// in place. Don't delete/clear user_credentials until then.
if(gAgentID.notNull()
&& gAgentSessionID.notNull()
&& gMessageSystem->mOurCircuitCode
&& gFirstSim.isOk()
&& gInventory.getRootFolderID().notNull())
{
success = true;
}
return success;
}

View File

@@ -317,139 +317,54 @@ void LLCategoryDropDescendentsObserver::done()
}
*/
// This array is used to more easily control what happens when a 3d
// drag and drop event occurs. Since there's an array of drop target
// and cargo type, it's implemented as an array of pointers to member
// functions which correctly carry out the actual drop.
LLToolDragAndDrop::dragOrDrop3dImpl LLToolDragAndDrop::sDragAndDrop3d[DAD_COUNT][LLToolDragAndDrop::DT_COUNT] =
S32 LLToolDragAndDrop::sOperationId = 0;
LLToolDragAndDrop::DragAndDropEntry::DragAndDropEntry(dragOrDrop3dImpl f_none,
dragOrDrop3dImpl f_self,
dragOrDrop3dImpl f_avatar,
dragOrDrop3dImpl f_object,
dragOrDrop3dImpl f_land) :
LLDictionaryEntry("")
{
// Source: DAD_NONE
mFunctions[DT_NONE] = f_none;
mFunctions[DT_SELF] = f_self;
mFunctions[DT_AVATAR] = f_avatar;
mFunctions[DT_OBJECT] = f_object;
mFunctions[DT_LAND] = f_land;
}
LLToolDragAndDrop::dragOrDrop3dImpl LLToolDragAndDrop::LLDragAndDropDictionary::get(EDragAndDropType dad_type, LLToolDragAndDrop::EDropTarget drop_target)
{
const DragAndDropEntry *entry = lookup(dad_type);
if (entry)
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND
},
// Source: DAD_TEXTURE
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dTextureObject, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_SOUND
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_CALLINGCARD
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
// <edit>
//&LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR
//&LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
// </edit>
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND
},
// Source: DAD_LANDMARK
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_SCRIPT
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dRezScript, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_CLOTHING
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dWearItem, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_OBJECT
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dRezAttachmentFromInv, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventoryObject, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dRezObjectOnObject, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dRezObjectOnLand, // Dest: DT_LAND
},
// Source: DAD_NOTECARD
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_CATEGORY
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dWearCategory, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventoryCategory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventoryCategory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dCategoryOnLand, // Dest: DT_LAND
},
// Source: DAD_ROOT
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_LAND
},
// Source: DAD_BODYPART
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dWearItem, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_ANIMATION
return (entry->mFunctions[(U8)drop_target]);
}
return &LLToolDragAndDrop::dad3dNULL;
}
LLToolDragAndDrop::LLDragAndDropDictionary::LLDragAndDropDictionary()
{
// DT_NONE DT_SELF DT_AVATAR DT_OBJECT DT_LAND
// |-------------------------------|----------------------------------------------|-----------------------------------------------|---------------------------------------------------|--------------------------------|
addEntry(DAD_NONE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_TEXTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dTextureObject, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_SOUND, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_CALLINGCARD, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_LANDMARK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_SCRIPT, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dRezScript, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_CLOTHING, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_OBJECT, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dRezAttachmentFromInv, &LLToolDragAndDrop::dad3dGiveInventoryObject, &LLToolDragAndDrop::dad3dRezObjectOnObject, &LLToolDragAndDrop::dad3dRezObjectOnLand));
addEntry(DAD_NOTECARD, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearCategory, &LLToolDragAndDrop::dad3dGiveInventoryCategory, &LLToolDragAndDrop::dad3dUpdateInventoryCategory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_ROOT_CATEGORY, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_BODYPART, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dWearItem, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_ANIMATION, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_GESTURE, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dActivateGesture, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dUpdateInventory, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_LINK, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL));
addEntry(DAD_MESH, new DragAndDropEntry(&LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dNULL, &LLToolDragAndDrop::dad3dGiveInventory, &LLToolDragAndDrop::dad3dMeshObject, &LLToolDragAndDrop::dad3dNULL));
// TODO: animation on self could play it? edit it?
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_GESTURE
// TODO: gesture on self could play it? edit it?
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dActivateGesture, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dGiveInventory, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dUpdateInventory, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
// Source: DAD_LINK
// TODO: gesture on self could play it? edit it?
{
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_NONE
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_SELF
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_AVATAR
&LLToolDragAndDrop::dad3dNULL, // Dest: DT_OBJECT
&LLToolDragAndDrop::dad3dNULL,//dad3dAssetOnLand, // Dest: DT_LAND
},
};
LLToolDragAndDrop::LLToolDragAndDrop()
@@ -758,6 +673,12 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
mToolTipMsg.clear();
// Increment the operation id for every drop
if (drop)
{
sOperationId++;
}
if(top_view)
{
handled = TRUE;
@@ -886,6 +807,21 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
if ( !handled )
{
// Disallow drag and drop to 3D from the outbox
const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
if (outbox_id.notNull())
{
for (S32 item_index = 0; item_index < (S32)mCargoIDs.size(); item_index++)
{
if (gInventory.isObjectDescendentOf(mCargoIDs[item_index], outbox_id))
{
*acceptance = ACCEPT_NO;
mToolTipMsg = LLTrans::getString("TooltipOutboxDragToWorld");
return;
}
}
}
dragOrDrop3D( x, y, mask, drop, acceptance );
}
}
@@ -896,7 +832,7 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep
if (mDrop)
{
// don't allow drag and drop onto transparent objects
pickCallback(gViewerWindow->pickImmediate(x, y, FALSE));
pick(gViewerWindow->pickImmediate(x, y, FALSE));
}
else
{
@@ -908,35 +844,42 @@ void LLToolDragAndDrop::dragOrDrop3D( S32 x, S32 y, MASK mask, BOOL drop, EAccep
}
void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info)
{
if (getInstance() != NULL)
{
getInstance()->pick(pick_info);
}
}
void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
{
EDropTarget target = DT_NONE;
S32 hit_face = -1;
LLViewerObject* hit_obj = pick_info.getObject();
LLSelectMgr::getInstance()->unhighlightAll();
bool highlight_object = false;
// Treat attachments as part of the avatar they are attached to.
if (hit_obj)
if (hit_obj != NULL)
{
// don't allow drag and drop on grass, trees, etc.
if(pick_info.mPickType == LLPickInfo::PICK_FLORA)
if (pick_info.mPickType == LLPickInfo::PICK_FLORA)
{
LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO;
gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor );
mCursor = UI_CURSOR_NO;
gViewerWindow->getWindow()->setCursor( mCursor );
return;
}
if(hit_obj->isAttachment() && !hit_obj->isHUDAttachment())
if (hit_obj->isAttachment() && !hit_obj->isHUDAttachment())
{
LLVOAvatar* avatar = LLVOAvatar::findAvatarFromAttachment( hit_obj );
if( !avatar )
if (!avatar)
{
LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO;
LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO;
gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor );
mLastAccept = ACCEPT_NO;
mCursor = UI_CURSOR_NO;
gViewerWindow->getWindow()->setCursor( mCursor );
return;
}
hit_obj = avatar;
}
@@ -957,16 +900,7 @@ void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info)
{
target = DT_OBJECT;
hit_face = pick_info.mObjectFace;
// if any item being dragged will be applied to the object under our cursor
// highlight that object
for (S32 i = 0; i < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); i++)
{
if (LLToolDragAndDrop::getInstance()->mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL))
{
LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj);
break;
}
}
highlight_object = true;
}
}
else if(pick_info.mPickType == LLPickInfo::PICK_LAND)
@@ -975,49 +909,61 @@ void LLToolDragAndDrop::pickCallback(const LLPickInfo& pick_info)
hit_face = -1;
}
LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_YES_MULTI;
mLastAccept = ACCEPT_YES_MULTI;
for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size();
LLToolDragAndDrop::getInstance()->mCurItemIndex++)
for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++)
{
const S32 item_index = mCurItemIndex;
const EDragAndDropType dad_type = mCargoTypes[item_index];
// Call the right implementation function
LLToolDragAndDrop::getInstance()->mLastAccept = (EAcceptance)llmin(
(U32)LLToolDragAndDrop::getInstance()->mLastAccept,
(U32)callMemberFunction((*LLToolDragAndDrop::getInstance()),
LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target])
mLastAccept = (EAcceptance)llmin(
(U32)mLastAccept,
(U32)callMemberFunction(*this,
LLDragAndDropDictionary::instance().get(dad_type, target))
(hit_obj, hit_face, pick_info.mKeyMask, FALSE));
}
if (LLToolDragAndDrop::getInstance()->mDrop &&
(U32)LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_SINGLE)
if (mDrop && ((U32)mLastAccept >= ACCEPT_YES_COPY_SINGLE))
{
// if target allows multi-drop or there is only one item being dropped, go ahead
if (LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_MULTI ||
LLToolDragAndDrop::getInstance()->mCargoIDs.size() == 1)
if ((mLastAccept >= ACCEPT_YES_COPY_MULTI) || (mCargoIDs.size() == 1))
{
// Target accepts multi, or cargo is a single-drop
for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0;
LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size();
LLToolDragAndDrop::getInstance()->mCurItemIndex++)
for (mCurItemIndex = 0; mCurItemIndex < (S32)mCargoIDs.size(); mCurItemIndex++)
{
const S32 item_index = mCurItemIndex;
const EDragAndDropType dad_type = mCargoTypes[item_index];
// Call the right implementation function
(U32)callMemberFunction((*LLToolDragAndDrop::getInstance()),
LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target])
(U32)callMemberFunction(*this,
LLDragAndDropDictionary::instance().get(dad_type, target))
(hit_obj, hit_face, pick_info.mKeyMask, TRUE);
}
}
else
{
// Target does not accept multi, but cargo is multi
LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO;
mLastAccept = ACCEPT_NO;
}
}
ECursorType cursor = LLToolDragAndDrop::getInstance()->acceptanceToCursor( LLToolDragAndDrop::getInstance()->mLastAccept );
if (highlight_object && mLastAccept > ACCEPT_NO_LOCKED)
{
// if any item being dragged will be applied to the object under our cursor
// highlight that object
for (S32 i = 0; i < (S32)mCargoIDs.size(); i++)
{
if (mCargoTypes[i] != DAD_OBJECT || (pick_info.mKeyMask & MASK_CONTROL))
{
LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj);
break;
}
}
}
ECursorType cursor = acceptanceToCursor( mLastAccept );
gViewerWindow->getWindow()->setCursor( cursor );
LLToolDragAndDrop::getInstance()->mLastHitPos = pick_info.mPosGlobal;
LLToolDragAndDrop::getInstance()->mLastCameraPos = gAgentCamera.getCameraPositionGlobal();
mLastHitPos = pick_info.mPosGlobal;
mLastCameraPos = gAgentCamera.getCameraPositionGlobal();
}
// static
@@ -1143,6 +1089,31 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj,
hit_obj->sendTEUpdate();
}
void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj,
LLInventoryItem* item,
LLToolDragAndDrop::ESource source,
const LLUUID& src_id)
{
if (!item)
{
llwarns << "no inventory item." << llendl;
return;
}
LLUUID asset_id = item->getAssetUUID();
BOOL success = handleDropTextureProtections(hit_obj, item, source, src_id);
if(!success)
{
return;
}
LLSculptParams sculpt_params;
sculpt_params.setSculptTexture(asset_id);
sculpt_params.setSculptType(LL_SCULPT_TYPE_MESH);
hit_obj->setParameterEntry(LLNetworkData::PARAMS_SCULPT, sculpt_params, TRUE);
dialog_refresh_all();
}
/*
void LLToolDragAndDrop::dropTextureOneFaceAvatar(LLVOAvatar* avatar, S32 hit_face, LLInventoryItem* item)
{
@@ -1557,6 +1528,10 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
worn = TRUE;
}
break;
case LLAssetType::AT_CALLINGCARD:
// Calling Cards in object are disabled for now
// because of incomplete LSL support. See STORM-1117.
return ACCEPT_NO;
default:
break;
}
@@ -1961,10 +1936,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezScript(
return rv;
}
EAcceptance LLToolDragAndDrop::dad3dTextureObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
EAcceptance LLToolDragAndDrop::dad3dApplyToObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type)
{
lldebugs << "LLToolDragAndDrop::dad3dTextureObject()" << llendl;
lldebugs << "LLToolDragAndDrop::dad3dApplyToObject()" << llendl;
// <edit>
// Fuck this
@@ -2005,15 +1980,25 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject(
if(drop && (ACCEPT_YES_SINGLE <= rv))
{
if((mask & MASK_SHIFT))
if (cargo_type == DAD_TEXTURE)
{
dropTextureAllFaces(obj, item, mSource, mSourceID);
if((mask & MASK_SHIFT))
{
dropTextureAllFaces(obj, item, mSource, mSourceID);
}
else
{
dropTextureOneFace(obj, face, item, mSource, mSourceID);
}
}
else if (cargo_type == DAD_MESH)
{
dropMesh(obj, item, mSource, mSourceID);
}
else
{
dropTextureOneFace(obj, face, item, mSource, mSourceID);
llwarns << "unsupported asset type" << llendl;
}
// VEFFECT: SetTexture
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE);
@@ -2026,6 +2011,21 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject(
// enable multi-drop, although last texture will win
return ACCEPT_YES_MULTI;
}
EAcceptance LLToolDragAndDrop::dad3dTextureObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
return dad3dApplyToObject(obj, face, mask, drop, DAD_TEXTURE);
}
EAcceptance LLToolDragAndDrop::dad3dMeshObject(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
{
return dad3dApplyToObject(obj, face, mask, drop, DAD_MESH);
}
/*
EAcceptance LLToolDragAndDrop::dad3dTextureSelf(
LLViewerObject* obj, S32 face, MASK mask, BOOL drop)
@@ -2169,6 +2169,12 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
return ACCEPT_NO;
}
const LLUUID &outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
if(gInventory.isObjectDescendentOf(category->getUUID(), outbox_id))
{
return ACCEPT_NO;
}
if(drop)
{
BOOL append = ( (mask & MASK_SHIFT) ? TRUE : FALSE );
@@ -2590,11 +2596,10 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory(
}
else if(mSource == SOURCE_NOTECARD)
{
LLPreviewNotecard* card;
card = (LLPreviewNotecard*)LLPreview::find(mSourceID);
if(card)
LLPreviewNotecard* preview = dynamic_cast<LLPreviewNotecard*>(LLPreview::find(mSourceID));
if(preview)
{
item = (LLViewerInventoryItem*)card->getDragItem();
item = (LLViewerInventoryItem*)preview->getDragItem();
}
}
if(item) return item;

View File

@@ -78,7 +78,7 @@ public:
const LLUUID& source_id = LLUUID::null,
const LLUUID& object_id = LLUUID::null);
void beginMultiDrag(const std::vector<EDragAndDropType> types,
const std::vector<LLUUID>& cargo_ids,
const uuid_vec_t& cargo_ids,
ESource source,
const LLUUID& source_id = LLUUID::null);
void endDrag();
@@ -86,6 +86,9 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLUUID& getObjectID() const { return mObjectID; }
EAcceptance getLastAccept() { return mLastAccept; }
uuid_vec_t::size_type getCargoIDsCount() const { return mCargoIDs.size(); }
static S32 getOperationId() { return sOperationId; }
protected:
enum EDropTarget
@@ -109,6 +112,7 @@ protected:
void dragOrDrop3D(S32 x, S32 y, MASK mask, BOOL drop,
EAcceptance* acceptance);
static void pickCallback(const LLPickInfo& pick_info);
void pick(const LLPickInfo& pick_info);
protected:
@@ -117,11 +121,13 @@ protected:
std::vector<EDragAndDropType> mCargoTypes;
//void* mCargoData;
std::vector<LLUUID> mCargoIDs;
uuid_vec_t mCargoIDs;
ESource mSource;
LLUUID mSourceID;
LLUUID mObjectID;
static S32 sOperationId;
LLVector3d mLastCameraPos;
LLVector3d mLastHitPos;
@@ -131,10 +137,6 @@ protected:
S32 mCurItemIndex;
std::string mToolTipMsg;
// array of pointers to functions that implement the logic to
// dragging and dropping into the simulator.
static dragOrDrop3dImpl sDragAndDrop3d[DAD_COUNT][DT_COUNT];
protected:
// 3d drop functions. these call down into the static functions
// named drop<ThingToDrop> if drop is TRUE and permissions allow
@@ -148,6 +150,8 @@ protected:
MASK mask, BOOL drop);
EAcceptance dad3dTextureObject(LLViewerObject* obj, S32 face,
MASK mask, BOOL drop);
EAcceptance dad3dMeshObject(LLViewerObject* obj, S32 face,
MASK mask, BOOL drop);
// EAcceptance dad3dTextureSelf(LLViewerObject* obj, S32 face,
// MASK mask, BOOL drop);
EAcceptance dad3dWearItem(LLViewerObject* obj, S32 face,
@@ -179,6 +183,11 @@ protected:
EAcceptance dad3dActivateGesture(LLViewerObject *obj, S32 face,
MASK mask, BOOL drop);
// helper called by methods above to handle "application" of an item
// to an object (texture applied to face, mesh applied to shape, etc.)
EAcceptance dad3dApplyToObject(LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type);
// set the LLToolDragAndDrop's cursor based on the given acceptance
ECursorType acceptanceToCursor( EAcceptance acceptance );
@@ -212,7 +221,6 @@ public:
// helper functions
static BOOL isInventoryDropAcceptable(LLViewerObject* obj, LLInventoryItem* item) { return (ACCEPT_YES_COPY_SINGLE <= willObjectAcceptInventory(obj, item)); }
BOOL dadUpdateInventory(LLViewerObject* obj, BOOL drop);
BOOL dadUpdateInventoryCategory(LLViewerObject* obj, BOOL drop);
@@ -230,6 +238,11 @@ public:
LLInventoryItem* item,
ESource source,
const LLUUID& src_id);
static void dropMesh(LLViewerObject* hit_obj,
LLInventoryItem* item,
ESource source,
const LLUUID& src_id);
//static void dropTextureOneFaceAvatar(LLVOAvatar* avatar,S32 hit_face,
// LLInventoryItem* item)
@@ -242,6 +255,25 @@ public:
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept);
// Classes used for determining 3d drag and drop types.
private:
struct DragAndDropEntry : public LLDictionaryEntry
{
DragAndDropEntry(dragOrDrop3dImpl f_none,
dragOrDrop3dImpl f_self,
dragOrDrop3dImpl f_avatar,
dragOrDrop3dImpl f_object,
dragOrDrop3dImpl f_land);
dragOrDrop3dImpl mFunctions[DT_COUNT];
};
class LLDragAndDropDictionary : public LLSingleton<LLDragAndDropDictionary>,
public LLDictionary<EDragAndDropType, DragAndDropEntry>
{
public:
LLDragAndDropDictionary();
dragOrDrop3dImpl get(EDragAndDropType dad_type, EDropTarget drop_target);
};
};
// utility functions

View File

@@ -171,14 +171,12 @@ void LLToolCamera::pickCallback(const LLPickInfo& pick_info)
BOOL good_customize_avatar_hit = FALSE;
if( hit_obj )
{
LLVOAvatar* avatar = gAgentAvatarp;
if( hit_obj == avatar)
if (isAgentAvatarValid() && (hit_obj == gAgentAvatarp))
{
// It's you
good_customize_avatar_hit = TRUE;
}
else
if( hit_obj->isAttachment() && hit_obj->permYouOwner() )
else if (hit_obj->isAttachment() && hit_obj->permYouOwner())
{
// It's an attachment that you're wearing
good_customize_avatar_hit = TRUE;
@@ -361,7 +359,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
// Orbit tool
if (hasMouseCapture())
{
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthScaled();
if (dx != 0)
{
@@ -389,7 +387,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
F32 dist = (F32) camera_to_focus.normVec();
// Fudge factor for pan
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWindowWidth();
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWorldViewWidthScaled();
if (dx != 0)
{
@@ -411,7 +409,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (hasMouseCapture())
{
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthScaled();
if (dx != 0)
{

View File

@@ -2,31 +2,25 @@
* @file lltoolgrab.cpp
* @brief LLToolGrab class implementation
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* 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
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -394,22 +388,7 @@ void LLToolGrab::startGrab()
mDragStartPointGlobal = grab_start_global;
mDragStartFromCamera = grab_start_global - gAgentCamera.getCameraPositionGlobal();
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset );
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(mGrabPick.mUVCoords));
msg->addVector3("STCoord", LLVector3(mGrabPick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, mGrabPick.mObjectFace);
msg->addVector3("Position", mGrabPick.mIntersection);
msg->addVector3("Normal", mGrabPick.mNormal);
msg->addVector3("Binormal", mGrabPick.mBinormal);
msg->sendMessage( objectp->getRegion()->getHost());
send_ObjectGrab_message(objectp, mGrabPick, grab_offset);
mGrabOffsetFromCenterInitial = grab_offset;
mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
@@ -534,8 +513,8 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
const F32 RADIANS_PER_PIXEL_X = 0.01f;
const F32 RADIANS_PER_PIXEL_Y = 0.01f;
S32 dx = x - (gViewerWindow->getWindowWidth() / 2);
S32 dy = y - (gViewerWindow->getWindowHeight() / 2);
S32 dx = x - (gViewerWindow->getWorldViewWidthScaled() / 2);
S32 dy = y - (gViewerWindow->getWorldViewHeightScaled() / 2);
if (dx != 0 || dy != 0)
{
@@ -655,10 +634,10 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
// Handle auto-rotation at screen edge.
LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global );
LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2);
LLCoordGL grab_center_gl( gViewerWindow->getWorldViewWidthScaled() / 2, gViewerWindow->getWorldViewHeightScaled() / 2);
LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl);
const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20;
const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidthScaled() / 20;
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...build mode moves camera about focus point
@@ -673,7 +652,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
gAgentCamera.cameraOrbitAround(rotate_angle);
}
}
else if (grab_center_gl.mX > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
else if (grab_center_gl.mX > gViewerWindow->getWorldViewWidthScaled() - ROTATE_H_MARGIN)
{
if (gAgentCamera.getFocusOnAvatar())
{
@@ -686,7 +665,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
}
// Don't move above top of screen or below bottom
if ((grab_center_gl.mY < gViewerWindow->getWindowHeight() - 6)
if ((grab_center_gl.mY < gViewerWindow->getWorldViewHeightScaled() - 6)
&& (grab_center_gl.mY > 24))
{
// Transmit update to simulator
@@ -1082,28 +1061,12 @@ void LLToolGrab::stopGrab()
}
// Next, send messages to simulator
LLMessageSystem *msg = gMessageSystem;
switch(mMode)
{
case GRAB_ACTIVE_CENTER:
case GRAB_NONPHYSICAL:
case GRAB_LOCKED:
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, objectp->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage(objectp->getRegion()->getHost());
send_ObjectDeGrab_message(objectp, pick);
mVerticalDragging = FALSE;
break;
@@ -1155,3 +1118,62 @@ LLVector3d LLToolGrab::getGrabPointGlobal()
return gAgent.getPositionGlobal();
}
}
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast( _PREHASH_ObjectData);
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
llinfos << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
<< llendl;
llinfos << "Avatar pos: " << gAgent.getPositionAgent() << llendl;
llinfos << "Object pos: " << object->getPosition() << llendl;
*/
}
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage(object->getRegion()->getHost());
}

View File

@@ -2,31 +2,25 @@
* @file lltoolgrab.h
* @brief LLToolGrab class header file
*
* $LicenseInfo:firstyear=2001&license=viewergpl$
*
* Copyright (c) 2001-2009, Linden Research, Inc.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* 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
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* Copyright (C) 2010, Linden Research, Inc.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -45,6 +39,13 @@ class LLTextBox;
class LLViewerObject;
class LLPickInfo;
// Message utilities
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset);
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick);
class LLToolGrab : public LLTool, public LLSingleton<LLToolGrab>
{
public:

View File

@@ -65,8 +65,7 @@ LLToolContainer::~LLToolContainer()
LLToolView::LLToolView(const std::string& name, const LLRect& rect)
: LLView(name, rect, MOUSE_OPAQUE),
mButtonCount(0)
: mButtonCount(0), LLView(name, rect, true)
{
}

View File

@@ -969,12 +969,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
stop_glerror();
}
for (U32 i = 0; i < (U32)gGLManager.mNumTextureImageUnits; i++)
//Reversed this. disabling a texunit sets its index as current.. randomly breaking LLRender::matrixMode(U32 mode). Make sure unit0 is the 'current' unit.
for (S32 i = gGLManager.mNumTextureImageUnits-1; i >= 0; --i)
{ //dummy cleanup of any currently bound textures
if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
if (gGL.getTexUnit((U32)i)->getCurrType() != LLTexUnit::TT_NONE)
{
gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
gGL.getTexUnit(i)->disable();
gGL.getTexUnit((U32)i)->unbind(gGL.getTexUnit((U32)i)->getCurrType());
gGL.getTexUnit((U32)i)->disable();
}
}
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush");

View File

@@ -189,6 +189,7 @@ extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only
//
const F32 BIRD_AUDIBLE_RADIUS = 32.0f;
const F32 SIT_DISTANCE_FROM_TARGET = 0.25f;
const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f;
static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting.
// Determine how quickly residents' scripts can issue question dialogs
@@ -1061,6 +1062,12 @@ void LLViewerInventoryMoveObserver::changed(U32 mask)
}
}
void set_dad_inbox_object(const LLUUID& object_id)
{
LLViewerInventoryMoveObserver* move_observer = new LLViewerInventoryMoveObserver(object_id);
gInventory.addObserver(move_observer);
}
//unlike the FetchObserver for AgentOffer, we only make one
//instance of the AddedObserver for TaskOffers
//and it never dies. We do this because we don't know the UUID of
@@ -1355,20 +1362,12 @@ bool highlight_offered_object(const LLUUID& obj_id)
void inventory_offer_mute_callback(const LLUUID& blocked_id,
const std::string& full_name,
bool is_group )
bool is_group)
{
std::string from_name = full_name;
LLMute::EType type;
if (is_group)
{
type = LLMute::GROUP;
}
else
{
type = LLMute::AGENT;
}
// *NOTE: blocks owner if the offer came from an object
LLMute::EType mute_type = is_group ? LLMute::GROUP : LLMute::AGENT;
LLMute mute(blocked_id, from_name, type);
LLMute mute(blocked_id, full_name, mute_type);
if (LLMuteList::getInstance()->add(mute))
{
LLFloaterMute::showInstance();
@@ -3214,8 +3213,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**)
LLNameValue* nvlast = source->getNVPair("LastName");
if (nvfirst && nvlast)
{
source_name = std::string(nvfirst->getString()) + " " + nvlast->getString();
args["NAME"] = source_name;
args["NAME"] = LLCacheName::buildFullName(
nvfirst->getString(), nvlast->getString());
}
}
@@ -4374,6 +4373,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
return;
}
LL_INFOS("Messaging") << "process_crossed_region()" << LL_ENDL;
gAgentAvatarp->resetRegionCrossingTimer();
U32 sim_ip;
msg->getIPAddrFast(_PREHASH_RegionData, _PREHASH_SimIP, sim_ip);
@@ -4849,6 +4849,12 @@ void process_sound_trigger(LLMessageSystem *msg, void **)
{
return;
}
// Don't play sounds from gestures if they are not enabled.
if (object_id == owner_id && !gSavedSettings.getBOOL("EnableGestureSounds"))
{
return;
}
// <edit>
//gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);
@@ -5290,7 +5296,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
BOOL force_mouselook;
mesgsys->getBOOLFast(_PREHASH_SitTransform, _PREHASH_ForceMouselook, force_mouselook);
if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > 0.0001f)
if (isAgentAvatarValid() && dist_vec_squared(camera_eye, camera_at) > CAMERA_POSITION_THRESHOLD_SQUARED)
{
gAgentCamera.setSitCamera(sitObjectID, camera_eye, camera_at);
}
@@ -5693,6 +5699,12 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
{
// notification was specified using the new mechanism, so we can just handle it here
std::string notificationID;
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
if (!LLNotifications::getInstance()->templateExists(notificationID))
{
return false;
}
std::string llsdRaw;
LLSD llsdBlock;
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
@@ -6301,7 +6313,7 @@ void container_inventory_arrived(LLViewerObject* object,
gAgentCamera.changeCameraToDefault();
}
LLInventoryView* view = LLInventoryView::getActiveInventory();
LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel();
if (inventory->size() > 2)
{
@@ -6339,9 +6351,9 @@ void container_inventory_arrived(LLViewerObject* object,
}
}
gInventory.notifyObservers();
if(view)
if(active_panel)
{
view->getPanel()->setSelection(cat_id, TAKE_FOCUS_NO);
active_panel->setSelection(cat_id, TAKE_FOCUS_NO);
}
}
else if (inventory->size() == 2)
@@ -6375,9 +6387,9 @@ void container_inventory_arrived(LLViewerObject* object,
new_item->updateServer(TRUE);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
if(view)
if(active_panel)
{
view->getPanel()->setSelection(item_id, TAKE_FOCUS_NO);
active_panel->setSelection(item_id, TAKE_FOCUS_NO);
}
}

View File

@@ -214,6 +214,7 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
bool highlight_offered_object(const LLUUID& obj_id);
void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid);
void set_dad_inbox_object(const LLUUID& object_id);
struct LLOfferInfo
{

View File

@@ -5744,17 +5744,13 @@ void LLViewerObject::resetChildrenPosition(const LLVector3& offset, BOOL simplif
// <edit>
S32 LLViewerObject::getAttachmentPoint()
{
return ((S32)((((U8)mState & AGENT_ATTACH_MASK) >> 4) | (((U8)mState & ~AGENT_ATTACH_MASK) << 4)));
}
std::string LLViewerObject::getAttachmentPointName()
{
S32 point = getAttachmentPoint();
if((point > 0) && (point < 39))
S32 point = ATTACHMENT_ID_FROM_STATE(mState);
LLVOAvatar::attachment_map_t::iterator it = gAgentAvatarp->mAttachmentPoints.find(point);
if(it != gAgentAvatarp->mAttachmentPoints.end())
{
return gAgentAvatarp->mAttachmentPoints[point]->getName();
return it->second->getName();
}
return llformat("unsupported point %d", point);
}

View File

@@ -772,7 +772,6 @@ private:
//--------------------------------------------------------------------
public:
// <edit>
S32 getAttachmentPoint();
std::string getAttachmentPointName();
// </edit>
const LLUUID &getAttachmentItemID() const;
@@ -788,8 +787,6 @@ private:
BOOL mLastUpdateCached;
};
typedef std::vector<LLViewerObject*> llvo_vec_t;
///////////////////
//
// Inlines

View File

@@ -1008,7 +1008,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)
bool callback_god_force_owner(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if(0 == option)
{
LLMessageSystem* msg = gMessageSystem;
@@ -1472,6 +1472,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
S32 other_clean_time = 0;
LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance();
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result );
msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id );
@@ -1487,31 +1489,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (sequence_id == SELECTED_PARCEL_SEQ_ID)
{
// ...selected parcels report this sequence id
LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS;
parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel;
parcel_mgr.mRequestResult = PARCEL_RESULT_SUCCESS;
parcel = parcel_mgr.mCurrentParcel;
}
else if (sequence_id == HOVERED_PARCEL_SEQ_ID)
{
LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
parcel = LLViewerParcelMgr::getInstance()->mHoverParcel;
parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
parcel = parcel_mgr.mHoverParcel;
}
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID ||
sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
{
LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS;
parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel;
parcel_mgr.mHoverRequestResult = PARCEL_RESULT_SUCCESS;
parcel = parcel_mgr.mCollisionParcel;
}
else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID)
else if (sequence_id == 0 || sequence_id > parcel_mgr.mAgentParcelSequenceID)
{
// new agent parcel
LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id;
parcel = LLViewerParcelMgr::getInstance()->mAgentParcel;
parcel_mgr.mAgentParcelSequenceID = sequence_id;
parcel = parcel_mgr.mAgentParcel;
}
else
{
llinfos << "out of order agent parcel sequence id " << sequence_id
<< " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID
<< " last good " << parcel_mgr.mAgentParcelSequenceID
<< llendl;
return;
}
@@ -1582,15 +1584,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override);
parcel->unpackMessage(msg);
if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel)
if (parcel == parcel_mgr.mAgentParcel)
{
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
* parcel_mgr.mParcelsPerEdge
/ 8;
U8* bitmap = new U8[ bitmap_size ];
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap);
parcel_mgr.writeAgentParcelFromBitmap(bitmap);
delete[] bitmap;
// Let interesting parties know about agent parcel change.
@@ -1612,11 +1614,11 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (sequence_id == SELECTED_PARCEL_SEQ_ID)
{
// Update selected counts
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count;
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count;
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count;
parcel_mgr.mCurrentParcelSelection->mSelectedSelfCount = self_count;
parcel_mgr.mCurrentParcelSelection->mSelectedOtherCount = other_count;
parcel_mgr.mCurrentParcelSelection->mSelectedPublicCount = public_count;
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners =
parcel_mgr.mCurrentParcelSelection->mSelectedMultipleOwners =
(request_result == PARCEL_RESULT_MULTIPLE);
// Select the whole parcel
@@ -1627,67 +1629,67 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
{
// don't muck with the westsouth and eastnorth.
// just highlight it
LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth);
LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth);
LLVector3 west_south = region->getPosRegionFromGlobal(parcel_mgr.mWestSouth);
LLVector3 east_north = region->getPosRegionFromGlobal(parcel_mgr.mEastNorth);
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
LLViewerParcelMgr::getInstance()->writeHighlightSegments(
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
parcel_mgr.writeHighlightSegments(
west_south.mV[VX],
west_south.mV[VY],
east_north.mV[VX],
east_north.mV[VY] );
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE;
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = FALSE;
}
else if (0 == local_id)
{
// this is public land, just highlight the selection
LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
LLViewerParcelMgr::getInstance()->writeHighlightSegments(
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
parcel_mgr.writeHighlightSegments(
aabb_min.mV[VX],
aabb_min.mV[VY],
aabb_max.mV[VX],
aabb_max.mV[VY] );
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
}
else
{
LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min );
LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max );
parcel_mgr.mWestSouth = region->getPosGlobalFromRegion( aabb_min );
parcel_mgr.mEastNorth = region->getPosGlobalFromRegion( aabb_max );
// Owned land, highlight the boundaries
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
* parcel_mgr.mParcelsPerEdge
/ 8;
U8* bitmap = new U8[ bitmap_size ];
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments);
LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments );
parcel_mgr.resetSegments(parcel_mgr.mHighlightSegments);
parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mHighlightSegments );
delete[] bitmap;
bitmap = NULL;
LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE;
parcel_mgr.mCurrentParcelSelection->mWholeParcelSelected = TRUE;
}
// Request access list information for this land
LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
parcel_mgr.sendParcelAccessListRequest(AL_ACCESS | AL_BAN);
// Request the media url filter list for this land
LLViewerParcelMgr::getInstance()->requestParcelMediaURLFilter();
parcel_mgr.requestParcelMediaURLFilter();
// Request dwell for this land, if it's not public land.
LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f;
parcel_mgr.mSelectedDwell = 0.f;
if (0 != local_id)
{
LLViewerParcelMgr::getInstance()->sendParcelDwellRequest();
parcel_mgr.sendParcelDwellRequest();
}
LLViewerParcelMgr::getInstance()->mSelected = TRUE;
LLViewerParcelMgr::getInstance()->notifyObservers();
parcel_mgr.mSelected = TRUE;
parcel_mgr.notifyObservers();
}
}
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID ||
@@ -1695,32 +1697,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
{
// We're about to collide with this parcel
LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE;
LLViewerParcelMgr::getInstance()->mCollisionTimer.reset();
parcel_mgr.mRenderCollision = TRUE;
parcel_mgr.mCollisionTimer.reset();
// Differentiate this parcel if we are banned from it.
if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)
{
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED;
parcel_mgr.mCollisionBanned = BA_BANNED;
}
else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID)
{
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP;
parcel_mgr.mCollisionBanned = BA_NOT_IN_GROUP;
}
else
{
LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST;
parcel_mgr.mCollisionBanned = BA_NOT_ON_LIST;
}
S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge
* LLViewerParcelMgr::getInstance()->mParcelsPerEdge
S32 bitmap_size = parcel_mgr.mParcelsPerEdge
* parcel_mgr.mParcelsPerEdge
/ 8;
U8* bitmap = new U8[ bitmap_size ];
msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size);
LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments);
LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments );
parcel_mgr.resetSegments(parcel_mgr.mCollisionSegments);
parcel_mgr.writeSegmentsFromBitmap( bitmap, parcel_mgr.mCollisionSegments );
delete[] bitmap;
bitmap = NULL;
@@ -1731,13 +1733,13 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() );
if (region)
{
LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
parcel_mgr.mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min );
parcel_mgr.mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max );
}
else
{
LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec();
LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec();
parcel_mgr.mHoverWestSouth.clearVec();
parcel_mgr.mHoverEastNorth.clearVec();
}
}
else
@@ -2092,7 +2094,7 @@ void LLViewerParcelMgr::deedLandToGroup()
// static
bool LLViewerParcelMgr::deedAlertCB(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel();
@@ -2259,7 +2261,7 @@ void LLViewerParcelMgr::startDivideLand()
// static
bool LLViewerParcelMgr::callbackDivideLand(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]);
LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]);
LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0;
@@ -2322,7 +2324,7 @@ void LLViewerParcelMgr::startJoinLand()
// static
bool LLViewerParcelMgr::callbackJoinLand(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
LLVector3d west_south_d = ll_vector3d_from_sd(notification["payload"]["west_south_border"]);
LLVector3d east_north_d = ll_vector3d_from_sd(notification["payload"]["east_north_border"]);
LLVector3d parcel_center = (west_south_d + east_north_d) / 2.0;
@@ -2421,7 +2423,7 @@ void LLViewerParcelMgr::reclaimParcel()
// static
bool LLViewerParcelMgr::releaseAlertCB(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotification::getSelectedOption(notification, response);
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
// Send the release message, not a force

View File

@@ -264,7 +264,7 @@ public:
BOOL remove_contribution);
// callers responsibility to call deleteParcelBuy() on return value
void sendParcelBuy(ParcelBuyInfo*);
void deleteParcelBuy(ParcelBuyInfo* *);
void deleteParcelBuy(ParcelBuyInfo* *info);
void sendParcelDeed(const LLUUID& group_id);

View File

@@ -335,7 +335,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
{
U8 ownership = mOwnership[i];
U8 r,g,b,a;
F32 r,g,b,a;
// Color stored in low three bits
switch( ownership & 0x7 )
@@ -384,10 +384,10 @@ void LLViewerParcelOverlay::updateOverlayTexture()
break;
}
raw[pixel_index + 0] = r;
raw[pixel_index + 1] = g;
raw[pixel_index + 2] = b;
raw[pixel_index + 3] = a;
raw[pixel_index + 0] = (U8)r;
raw[pixel_index + 1] = (U8)g;
raw[pixel_index + 2] = (U8)b;
raw[pixel_index + 3] = (U8)a;
pixel_index += OVERLAY_IMG_COMPONENTS;
}

View File

@@ -83,6 +83,7 @@ LLGLSLShader gGlowCombineFXAAProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gTwoTextureAddProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gOneTextureNoColorProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gDebugProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gClipProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gAlphaMaskProgram(LLViewerShaderMgr::SHADER_INTERFACE);
LLGLSLShader gUIProgram(LLViewerShaderMgr::SHADER_INTERFACE);
@@ -2474,6 +2475,16 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
success = gDebugProgram.createShader(NULL, NULL);
}
if (success)
{
gClipProgram.mName = "Clip Shader";
gClipProgram.mShaderFiles.clear();
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipV.glsl", GL_VERTEX_SHADER_ARB));
gClipProgram.mShaderFiles.push_back(make_pair("interface/clipF.glsl", GL_FRAGMENT_SHADER_ARB));
gClipProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE];
success = gClipProgram.createShader(NULL, NULL);
}
if (success)
{
gAlphaMaskProgram.mName = "Alpha Mask Shader";

View File

@@ -234,6 +234,7 @@ extern LLGLSLShader gGlowCombineProgram;
extern LLGLSLShader gSplatTextureRectProgram;
extern LLGLSLShader gGlowCombineFXAAProgram;
extern LLGLSLShader gDebugProgram;
extern LLGLSLShader gClipProgram;
extern LLGLSLShader gAlphaMaskProgram;
//output tex0[tc0] + tex1[tc1]

View File

@@ -4456,64 +4456,71 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
gDisplaySwapBuffers = FALSE;
gDepthDirty = TRUE;
{
const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor));
display(do_rebuild, scale_factor, subfield, TRUE, is_tiling);
// Required for showing the GUI in snapshots? See DEV-16350 for details. JC
render_ui(scale_factor, subfield, is_tiling);
}
S32 subimage_x_offset = llclamp(buffer_x_offset - (subimage_x * window_width), 0, window_width);
// handle fractional rows
U32 read_width = llmax(0, (window_width - subimage_x_offset) -
llmax(0, (window_width * (subimage_x + 1)) - (buffer_x_offset + raw->getWidth())));
for(U32 out_y = 0; out_y < read_height ; out_y++)
// Skip rendering and sampling altogether if either width or height is degenerated to 0 (common in cropping cases)
if (read_width && read_height)
{
S32 output_buffer_offset = (
(out_y * (raw->getWidth())) // ...plus iterated y...
+ (window_width * subimage_x) // ...plus subimage start in x...
+ (raw->getWidth() * window_height * subimage_y) // ...plus subimage start in y...
- output_buffer_offset_x // ...minus buffer padding x...
- (output_buffer_offset_y * (raw->getWidth())) // ...minus buffer padding y...
) * raw->getComponents();
const U32 subfield = subimage_x+(subimage_y*llceil(scale_factor));
display(do_rebuild, scale_factor, subfield, TRUE, is_tiling);
// Ping the wathdog thread every 100 lines to keep us alive (arbitrary number, feel free to change)
if (out_y % 100 == 0)
if (!LLPipeline::sRenderDeferred)
{
LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot");
// Required for showing the GUI in snapshots and performing bloom composite overlay
// Call even if show_ui is FALSE
render_ui(scale_factor, subfield);
}
if (type == SNAPSHOT_TYPE_COLOR)
for (U32 out_y = 0; out_y < read_height ; out_y++)
{
glReadPixels(
subimage_x_offset,
out_y + subimage_y_offset,
read_width, 1,
GL_RGB, GL_UNSIGNED_BYTE,
raw->getData() + output_buffer_offset
);
}
else // SNAPSHOT_TYPE_DEPTH
{
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
S32 output_buffer_offset = (
(out_y * (raw->getWidth())) // ...plus iterated y...
+ (window_width * subimage_x) // ...plus subimage start in x...
+ (raw->getWidth() * window_height * subimage_y) // ...plus subimage start in y...
- output_buffer_offset_x // ...minus buffer padding x...
- (output_buffer_offset_y * (raw->getWidth())) // ...minus buffer padding y...
) * raw->getComponents();
// Ping the watchdog thread every 100 lines to keep us alive (arbitrary number, feel free to change)
if (out_y % 100 == 0)
{
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
//write converted scanline out to result image
for(S32 j = 0; j < raw->getComponents(); j++)
LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot");
}
if (type == SNAPSHOT_TYPE_COLOR)
{
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_RGB, GL_UNSIGNED_BYTE,
raw->getData() + output_buffer_offset
);
}
else // SNAPSHOT_TYPE_DEPTH
{
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
// write converted scanline out to result image
for (S32 j = 0; j < raw->getComponents(); j++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
}
}
}
}

View File

@@ -447,14 +447,21 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
continue;
}
count++;
facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis();
obj->mDepth += facep->mDistance;
if ((facep->getGeomCount() + vertex_count) <= 65536)
{
count++;
facep->mDistance = (facep->mCenterLocal - camera->getOrigin()) * camera->getAtAxis();
obj->mDepth += facep->mDistance;
mFaceList.push_back(facep);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
llassert(facep->getIndicesCount() < 65536);
mFaceList.push_back(facep);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
llassert(facep->getIndicesCount() < 65536);
}
else
{
facep->clearVertexBuffer();
}
}
obj->mDepth /= count;

View File

@@ -80,7 +80,7 @@ void LLWLDayCycle::loadDayCycle(const LLSD& day_data, LLWLParamKey::EScope scope
// alert the user
LLSD args;
args["SKY"] = day_data[i][1].asString();
LLNotificationsUtil::add("WLMissingSky", args, LLSD());
LLNotifications::instance().add("WLMissingSky", args, LLSD());
continue;
}
}
@@ -161,13 +161,13 @@ LLSD LLWLDayCycle::asLLSD()
bool LLWLDayCycle::getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const
{
bool result = true;
LLWLParamManager* wl_mgr = LLWLParamManager::getInstance();
LLWLParamManager& wl_mgr = LLWLParamManager::instance();
refs.clear();
for (std::map<F32, LLWLParamKey>::const_iterator iter = mTimeMap.begin(); iter != mTimeMap.end(); ++iter)
{
const LLWLParamKey& key = iter->second;
if (!wl_mgr->getParamSet(key, refs[key]))
if (!wl_mgr.getParamSet(key, refs[key]))
{
llwarns << "Cannot find sky [" << key.name << "] referenced by a day cycle" << llendl;
result = false;

View File

@@ -37,7 +37,7 @@
#include "llagent.h"
#include "llviewerregion.h"
#include "llenvmanager.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
/****
* LLEnvironmentRequest
@@ -144,7 +144,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
{
LLSD args(LLSD::emptyMap());
args["WAIT"] = (F64)UPDATE_WAIT_SECONDS;
LLNotifications::instance().add("EnvUpdateRate", args);
LLNotificationsUtil::add("EnvUpdateRate", args);
return false;
}
@@ -186,7 +186,7 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
LL_WARNS("WindlightCaps") << "Region couldn't apply windlight settings! Reason from sim: " << content["fail_reason"].asString() << LL_ENDL;
LLSD args(LLSD::emptyMap());
args["FAIL_REASON"] = content["fail_reason"].asString();
LLNotifications::instance().add("WLRegionApplyFail", args);
LLNotificationsUtil::add("WLRegionApplyFail", args);
LLEnvManagerNew::instance().onRegionSettingsApplyResponse(false);
}
}
@@ -199,5 +199,5 @@ bool LLEnvironmentApply::initiateRequest(const LLSD& content)
LLSD args(LLSD::emptyMap());
args["FAIL_REASON"] = msg.str();
LLNotifications::instance().add("WLRegionApplyFail", args);
LLNotificationsUtil::add("WLRegionApplyFail", args);
}

View File

@@ -301,6 +301,13 @@
name="Take Off" width="128">
<on_click filter="" function="Inventory.DoToSelected" userdata="take_off" />
</menu_item_call>
<menu_item_separator name="Marketplace Separator" />
<menu_item_call bottom_delta="-18" height="18" label="Copy to Merchant Outbox" left="0" mouse_opaque="true"
name="Merchant Copy" width="128">
<on_click filter="" function="Inventory.DoToSelected" userdata="copy_to_outbox" />
<menu_item_call bottom_delta="-18" height="18" label="Send to Marketplace" left="0" mouse_opaque="true"
name="Marketplace Send" width="128">
<on_click filter="" function="Inventory.DoToSelected" userdata="send_to_marketplace" />
<menu_item_call bottom_delta="-18" height="18" label="--no options--" left="0"
mouse_opaque="true" name="--no options--" width="128" />
<!--menu_item_separator name="Wearable Separator" -->

View File

@@ -283,8 +283,87 @@ Save changes to current clothing/body part?
notext="Don&apos;t Save"
yestext="Save"/>
</notification>
<notification
icon="alertmodal.tga"
name="ConfirmNoCopyToOutbox"
type="alertmodal">
You don't have permission to copy one or more of these items to the Merchant Outbox. You can move them or leave them behind.
<usetemplate
name="okcancelbuttons"
notext="Don't move item(s)"
yestext="Move item(s)"/>
</notification>
<notification
icon="OutboxStatus_Success"
name="OutboxFolderCreated"
type="outbox">
<unique/>
A new folder has been created for each item you have transferred into the top level of your Merchant Outbox.
<usetemplate
ignoretext="A new folder was created in the Merchant Outbox"
name="okignore"
yestext="OK"/>
</notification>
<notification
icon="OutboxStatus_Success"
name="OutboxImportComplete"
type="outbox">
Success
All folders were successfully sent to the Marketplace.
<usetemplate
ignoretext="All folders sent to the Marketplace"
name="okignore"
yestext="OK"/>
</notification>
<notification
icon="OutboxStatus_Warning"
name="OutboxImportHadErrors"
type="outbox">
Some folders did not transfer
Errors occurred when some folders were sent to the Marketplace. Those folders are still in your Merchant Outbox.
See the [[MARKETPLACE_IMPORTS_URL] error log] for more information.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="OutboxStatus_Error"
name="OutboxImportFailed"
type="outbox">
Transfer failed
No folders were sent to the Marketplace because of a system or network error. Try again later.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="OutboxStatus_Error"
name="OutboxInitFailed"
type="outbox">
Marketplace initialization failed
Initialization with the Marketplace failed because of a system or network error. Try again later.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="CompileQueueSaveText"
type="alertmodal">

View File

@@ -96,6 +96,17 @@
<string name="TooltipLand">Land:</string>
<string name="TooltipMustSingleDrop">Only a single item can be dragged here</string>
<string name="TooltipOutboxDragToWorld">You can not rez items in your merchant outbox</string>
<string name="TooltipOutboxNoTransfer">One or more of these objects cannot be sold or transferred.</string>
<string name="TooltipOutboxNotInInventory">Your merchant outbox can only accept items directly from your inventory</string>
<string name="TooltipOutboxWorn">You can not put items you are wearing into your merchant outbox</string>
<string name="TooltipOutboxCallingCard">You can not put calling cards into your merchant outbox</string>
<string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds 3</string>
<string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds 20</string>
<string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds 200</string>
<string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string>
<string name="TooltipDragOntoSelf">You can't move a folder into itself</string>
<!-- Indicates that an avatar's name or other similar datum is being retrieved. General usage. -->
<string name="RetrievingData">Retrieving...</string>
@@ -212,6 +223,8 @@
<string name="texture_loading">Loading...</string>
<string name="worldmap_offline">Offline</string>
<!-- animations uploading status codes -->
<string name="Ok">OK</string>
<!-- Chat -->
<string name="whisper">whispers:</string>
<string name="shout">shouts:</string>
@@ -247,6 +260,7 @@
<string name="load_files">Load Files</string>
<string name="choose_the_directory">Choose Directory</string>
<!-- LSL Usage Hover Tips -->
<string name="LSLTipSleepTime">
Sleeps script for [SLEEP_TIME] seconds.
@@ -1819,6 +1833,7 @@ Returns a key that is the UUID of the user seated on the prim.
<string name="ok">OK</string>
<!-- mouselook -->
<string name="LeaveMouselook">Press ESC to return to World View</string>
<!-- use value="" because they have preceding spaces -->
@@ -1835,6 +1850,18 @@ Returns a key that is the UUID of the user seated on the prim.
<string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" />
<string name="LockedOnAttachmentPoint" value=" (locked to [ATTACHMENT_POINT])" />
<string name="ActiveGesture" value="[GESLABEL] (active)"/>
<!-- Gestures labels -->
<!-- use value="" because they have preceding spaces -->
<string name="Chat Message" value=" Chat : " />
<string name="Sound" value=" Sound : " />
<string name="Wait" value=" --- Wait : " />
<string name="AnimFlagStop" value=" Stop Animation : " />
<string name="AnimFlagStart" value=" Start Animation : " />
<string name="Wave" value=" Wave " />
<string name="GestureActionNone" value="None" />
<string name="HelloAvatar" value=" Hello, avatar! " />
<string name="ViewAllGestures" value=" View All &gt;&gt;" />
<string name="GetMoreGestures" value=" Get More &gt;&gt;" />
<string name="Stone">Stone</string>
<string name="Metal">Metal</string>
<string name="Glass">Glass</string>
@@ -1843,6 +1870,12 @@ Returns a key that is the UUID of the user seated on the prim.
<string name="Plastic">Plastic</string>
<string name="Rubber">Rubber</string>
<string name="Light">Light</string>
<string name="Unknown">(Unknown)</string>
<!-- Environment settings -->
<string name="Local">Local</string>
<string name="LocalSettings">Local Settings</string>
<string name="Region">Region</string>
<string name="RegionSettings">Region Settings</string>
<!-- menu accelerators -->
<string name="accel-mac-control">Ctrl-</string>
<string name="accel-mac-command">Cmd-</string>
@@ -1912,6 +1945,22 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
If you continue to receive this message, contact the [SUPPORT_SITE].
</string>
<string name="group_role_everyone">Everyone</string>
<string name="group_role_officers">Officers</string>
<string name="group_role_owners">Owners</string>
<string name="group_member_status_online">Online</string>
<string name="Chat">Chat</string>
<!-- External editor status codes -->
<string name="ExternalEditorNotSet">Select an editor using the ExternalEditor setting.</string>
<string name="ExternalEditorNotFound">Cannot find the external editor you specified.
Try enclosing path to the editor with double quotes.
(e.g. "/path to my/editor" "%s")</string>
<string name="ExternalEditorCommandParseError">Error parsing the external editor command.</string>
<string name="ExternalEditorFailedToRun">External editor failed to run.</string>
<!-- Addition of OSSL commands for use in OpenSimulator based regions, including Aurora -->
<string name="LSLTipText_osSetRegionWaterHeight">
osSetRegionWaterHeight(float height)