diff options
357 files changed, 19442 insertions, 15607 deletions
@@ -141,3 +141,5 @@ be963a4eef635542f9617d7f5fd22ba48fb71958 DRTVWR-67_2.7.4-beta1 be963a4eef635542f9617d7f5fd22ba48fb71958 2.7.4-beta1 a9abb9633a266c8d2fe62411cfd1c86d32da72bf 2.7.1-release 19a498fa62570f352d7d246f17e3c81cc1d82d8b 2.7.5-start +09984bfa6cae17e0f72d02b75c1b7393c65eecfc DRTVWR-69_2.7.5-beta1 +09984bfa6cae17e0f72d02b75c1b7393c65eecfc 2.7.5-beta1 diff --git a/BuildParams b/BuildParams index 88d2c02780..9433e335fe 100644 --- a/BuildParams +++ b/BuildParams @@ -120,6 +120,10 @@ cg_viewer-development_lenny.email = cg@lindenlab.com # oz # ================ +snowstorm_project-windlight.build_debug_release_separately = true +snowstorm_project-windlight.viewer_channel = "Second Life Project Windlight Region" +snowstorm_project-windlight.login_channel = "Second Life Project Windlight Region" + oz_viewer-devreview.build_debug_release_separately = true oz_viewer-devreview.codeticket_add_context = false @@ -155,4 +159,10 @@ viewer-asset-delivery-metrics.email = monty@lindenlab.com viewer-asset-delivery-metrics.build_server = false viewer-asset-delivery-metrics.build_server_tests = false +# ======================================== +# Simon says +# ======================================== +simon_viewer-dev-private.public_build = false + + # eof diff --git a/autobuild.xml b/autobuild.xml index 083bd1b011..dfae7c6262 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1206,9 +1206,9 @@ <key>archive</key> <map> <key>hash</key> - <string>82798d0da3ac3d97c91517a575d9ea1c</string> + <string>a7c80fd8516df3b879b669b2b220067f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110526.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110608.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1230,9 +1230,9 @@ <key>archive</key> <map> <key>hash</key> - <string>f0708d18943a05013493f69ab7dc6429</string> + <string>b9cc0333cc274c9cc40256ab7146b4fc</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110526.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110608.tar.bz2</string> </map> <key>name</key> <string>windows</string> @@ -1570,9 +1570,9 @@ <key>archive</key> <map> <key>hash</key> - <string>e19576af3c0affc71293d8f0bcce2606</string> + <string>24e735ae005f3ce7a21a09cc02cece17</string> <key>url</key> - <string> http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-darwin-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Darwin/installer/slvoice-3.2.0002.10426-darwin-20110601.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1582,9 +1582,9 @@ <key>archive</key> <map> <key>hash</key> - <string>53fefed8120d7c6a0eb6778edae6fa32</string> + <string>8a0bc982367d6fdc20a28b391cd40566</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-linux-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Linux/installer/slvoice-3.2.0002.10426-linux-20110601.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1594,9 +1594,9 @@ <key>archive</key> <map> <key>hash</key> - <string>44f84b3b45f7067a104a7c34d50d62f0</string> + <string>1e821cc7d25eabad013b7f3db260dd6b</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-windows-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/CYGWIN/installer/slvoice-3.2.0002.10426-windows-20110601.tar.bz2</string> </map> <key>name</key> <string>windows</string> diff --git a/doc/contributions.txt b/doc/contributions.txt index 67e78e87ee..bad78dcd5f 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -103,8 +103,6 @@ Ales Beaumont Alexandrea Fride STORM-255 STORM-960 - STORM-1327 - STORM-1406 Alissa Sabre VWR-81 VWR-83 @@ -161,6 +159,7 @@ Ann Congrejo Ansariel Hiller STORM-1101 VWR-25480 + VWR-26150 Ardy Lay STORM-859 VWR-19499 @@ -446,20 +445,10 @@ Jonathan Yap STORM-1236 STORM-1259 STORM-787 - VWR-25480 - STORM-1334 STORM-1313 STORM-899 STORM-1273 - STORM-457 - STORM-1452 - STORM-1406 - STORM-1327 - STORM-1396 - STORM-1292 - STORM-1392 - STORM-1302 - STORM-1326 + STORM-1462 Kage Pixel VWR-11 Ken March @@ -792,7 +781,6 @@ Strife Onizuka SNOW-691 TankMaster Finesmith STORM-1100 - STORM-1452 Tayra Dagostino SNOW-517 SNOW-543 @@ -925,7 +913,6 @@ WolfPup Lowenhar STORM-825 STORM-859 STORM-1098 - STORM-1393 VWR-20741 VWR-20933 Zai Lynch diff --git a/indra/integration_tests/llui_libtest/llwidgetreg.cpp b/indra/integration_tests/llui_libtest/llwidgetreg.cpp index 0d0d9fbff6..cbf6021119 100644 --- a/indra/integration_tests/llui_libtest/llwidgetreg.cpp +++ b/indra/integration_tests/llui_libtest/llwidgetreg.cpp @@ -49,6 +49,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "lltexteditor.h" +#include "lltimectrl.h" #include "llflyoutbutton.h" #include "llfiltereditor.h" #include "lllayoutstack.h" @@ -92,6 +93,7 @@ void LLWidgetReg::initClass(bool register_widgets) //LLDefaultChildRegistry::Register<LLPlaceHolderPanel> placeholder("placeholder"); LLDefaultChildRegistry::Register<LLTabContainer> tab_container("tab_container"); LLDefaultChildRegistry::Register<LLTextBox> text("text"); + LLDefaultChildRegistry::Register<LLTimeCtrl> time("time"); LLDefaultChildRegistry::Register<LLTextEditor> simple_text_editor("simple_text_editor"); LLDefaultChildRegistry::Register<LLUICtrl> ui_ctrl("ui_ctrl"); LLDefaultChildRegistry::Register<LLStatView> stat_view("stat_view"); diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index c2cfb7286e..f6d0f5bce8 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -93,6 +93,8 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_MESH, new FolderEntry("mesh", TRUE)); addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE)); + addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE)); + addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index cb32cb075b..a0c847914f 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -83,8 +83,11 @@ public: FT_MESH = 49, FT_INBOX = 50, + FT_OUTBOX = 51, - FT_COUNT = 51, + FT_BASIC_ROOT = 52, + + FT_COUNT, FT_NONE = -1 }; diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 69720bb903..3dcaca4f16 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -28,8 +28,8 @@ #define LL_LLVERSIONVIEWER_H const S32 LL_VERSION_MAJOR = 2; -const S32 LL_VERSION_MINOR = 7; -const S32 LL_VERSION_PATCH = 6; +const S32 LL_VERSION_MINOR = 8; +const S32 LL_VERSION_PATCH = 0; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index e8cd871157..c95f922301 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -226,6 +226,11 @@ void LLParcel::init(const LLUUID &owner_id, setPreviousOwnerID(LLUUID::null); setPreviouslyGroupOwned(FALSE); + + setSeeAVs(TRUE); + setAllowGroupAVSounds(TRUE); + setAllowAnyAVSounds(TRUE); + setHaveNewParcelLimitData(FALSE); } void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) @@ -702,7 +707,9 @@ void LLParcel::packMessage(LLSD& msg) msg["user_location"] = ll_sd_from_vector3(mUserLocation); msg["user_look_at"] = ll_sd_from_vector3(mUserLookAt); msg["landing_type"] = (U8)mLandingType; - + msg["see_avs"] = (LLSD::Boolean) getSeeAVs(); + msg["group_av_sounds"] = (LLSD::Boolean) getAllowGroupAVSounds(); + msg["any_av_sounds"] = (LLSD::Boolean) getAllowAnyAVSounds(); } @@ -721,6 +728,24 @@ void LLParcel::unpackMessage(LLMessageSystem* msg) msg->getStringFast( _PREHASH_ParcelData,_PREHASH_MediaURL, buffer ); setMediaURL(buffer); + BOOL see_avs = TRUE; // All default to true for legacy server behavior + BOOL any_av_sounds = TRUE; + BOOL group_av_sounds = TRUE; + bool have_new_parcel_limit_data = (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_SeeAVs) > 0); // New version of server should send all 3 of these values + have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds) > 0); + have_new_parcel_limit_data &= (msg->getSizeFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds) > 0); + if (have_new_parcel_limit_data) + { + msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_SeeAVs, see_avs); + msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_AnyAVSounds, any_av_sounds); + msg->getBOOLFast(_PREHASH_ParcelData, _PREHASH_GroupAVSounds, group_av_sounds); + } + setSeeAVs((bool) see_avs); + setAllowAnyAVSounds((bool) any_av_sounds); + setAllowGroupAVSounds((bool) group_av_sounds); + + setHaveNewParcelLimitData(have_new_parcel_limit_data); + // non-optimized version msg->getU8 ( "ParcelData", "MediaAutoScale", mMediaAutoScale ); diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 4893337967..ff35caab4c 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -75,7 +75,7 @@ const U8 PARCEL_AUCTION = 0x05; // unused 0x06 // unused 0x07 // flag, unused 0x08 -// flag, unused 0x10 +const U8 PARCEL_HIDDENAVS = 0x10; // avatars not visible outside of parcel. Used for 'see avs' feature, but must be off for compatibility const U8 PARCEL_SOUND_LOCAL = 0x20; const U8 PARCEL_WEST_LINE = 0x40; // flag, property line on west edge const U8 PARCEL_SOUTH_LINE = 0x80; // flag, property line on south edge @@ -130,6 +130,12 @@ class LLSD; class LLAccessEntry { public: + LLAccessEntry() + : mID(), + mTime(0), + mFlags(0) + {} + LLUUID mID; // Agent ID S32 mTime; // Time (unix seconds) when entry expires U32 mFlags; // Not used - currently should always be zero @@ -265,6 +271,8 @@ public: void setUserLocation(const LLVector3& pos) { mUserLocation = pos; } void setUserLookAt(const LLVector3& rot) { mUserLookAt = rot; } void setLandingType(const ELandingType type) { mLandingType = type; } + void setSeeAVs(BOOL see_avs) { mSeeAVs = see_avs; } + void setHaveNewParcelLimitData(bool have_new_parcel_data) { mHaveNewParcelLimitData = have_new_parcel_data; } // Remove this once hidden AV feature is fully available grid-wide void setAuctionID(U32 auction_id) { mAuctionID = auction_id;} @@ -291,6 +299,8 @@ public: void setDenyAnonymous(BOOL b) { setParcelFlag(PF_DENY_ANONYMOUS, b); } void setDenyAgeUnverified(BOOL b) { setParcelFlag(PF_DENY_AGEUNVERIFIED, b); } void setRestrictPushObject(BOOL b) { setParcelFlag(PF_RESTRICT_PUSHOBJECT, b); } + void setAllowGroupAVSounds(BOOL b) { mAllowGroupAVSounds = b; } + void setAllowAnyAVSounds(BOOL b) { mAllowAnyAVSounds = b; } void setDrawDistance(F32 dist) { mDrawDistance = dist; } void setSalePrice(S32 price) { mSalePrice = price; } @@ -367,6 +377,8 @@ public: const LLVector3& getUserLocation() const { return mUserLocation; } const LLVector3& getUserLookAt() const { return mUserLookAt; } ELandingType getLandingType() const { return mLandingType; } + BOOL getSeeAVs() const { return mSeeAVs; } + BOOL getHaveNewParcelLimitData() const { return mHaveNewParcelLimitData; } // User-specified snapshot const LLUUID& getSnapshotID() const { return mSnapshotID; } @@ -496,6 +508,9 @@ public: BOOL getRegionDenyAgeUnverifiedOverride() const { return mRegionDenyAgeUnverifiedOverride; } + BOOL getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } + BOOL getAllowAnyAVSounds() const { return mAllowAnyAVSounds; } + F32 getDrawDistance() const { return mDrawDistance; } S32 getSalePrice() const { return mSalePrice; } time_t getClaimDate() const { return mClaimDate; } @@ -606,6 +621,8 @@ protected: LLVector3 mUserLocation; LLVector3 mUserLookAt; ELandingType mLandingType; + BOOL mSeeAVs; // Avatars on this parcel are visible from outside it + BOOL mHaveNewParcelLimitData; // Remove once hidden AV feature is grid-wide LLTimer mSaleTimerExpires; LLTimer mMediaResetTimer; @@ -661,6 +678,8 @@ protected: BOOL mRegionPushOverride; BOOL mRegionDenyAnonymousOverride; BOOL mRegionDenyAgeUnverifiedOverride; + BOOL mAllowGroupAVSounds; + BOOL mAllowAnyAVSounds; ParcelQuota mQuota; diff --git a/indra/llinventory/llparcelflags.h b/indra/llinventory/llparcelflags.h index a61130132a..b1a917df73 100644 --- a/indra/llinventory/llparcelflags.h +++ b/indra/llinventory/llparcelflags.h @@ -126,5 +126,7 @@ const S32 PARCEL_DETAILS_DESC = 1; const S32 PARCEL_DETAILS_OWNER = 2; const S32 PARCEL_DETAILS_GROUP = 3; const S32 PARCEL_DETAILS_AREA = 4; +const S32 PARCEL_DETAILS_ID = 5; +const S32 PARCEL_DETAILS_SEE_AVATARS = 6; #endif diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index bddb8d8c66..2893e746e9 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -3303,7 +3303,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, { F32 area = sculptGetSurfaceArea(); - const F32 SCULPT_MAX_AREA = 32.f; + const F32 SCULPT_MAX_AREA = 384.f; if (area < SCULPT_MIN_AREA || area > SCULPT_MAX_AREA) { diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 6133f50637..e71fb96540 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1376,3 +1376,6 @@ char const* const _PREHASH_VCoord = LLMessageStringTable::getInstance()->getStri char const* const _PREHASH_FaceIndex = LLMessageStringTable::getInstance()->getString("FaceIndex"); char const* const _PREHASH_StatusData = LLMessageStringTable::getInstance()->getString("StatusData"); char const* const _PREHASH_ProductSKU = LLMessageStringTable::getInstance()->getString("ProductSKU"); +char const* const _PREHASH_SeeAVs = LLMessageStringTable::getInstance()->getString("SeeAVs"); +char const* const _PREHASH_AnyAVSounds = LLMessageStringTable::getInstance()->getString("AnyAVSounds"); +char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()->getString("GroupAVSounds"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index f94ee1ed22..dd2c2dbd64 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1376,4 +1376,7 @@ extern char const* const _PREHASH_VCoord; extern char const* const _PREHASH_FaceIndex; extern char const* const _PREHASH_StatusData; extern char const* const _PREHASH_ProductSKU; +extern char const* const _PREHASH_SeeAVs; +extern char const* const _PREHASH_AnyAVSounds; +extern char const* const _PREHASH_GroupAVSounds; #endif diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 9f666369d4..d3d0403bbb 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1,1436 +1,1424 @@ -/** - * @file llpluginclassmedia.cpp - * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class. - * - * @cond - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - * @endcond - */ - -#include "linden_common.h" -#include "indra_constants.h" - -#include "llpluginclassmedia.h" -#include "llpluginmessageclasses.h" - -#include "llqtwebkit.h" - -static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256; - -static int nextPowerOf2( int value ) -{ - int next_power_of_2 = 1; - while ( next_power_of_2 < value ) - { - next_power_of_2 <<= 1; - } - - return next_power_of_2; -} - -LLPluginClassMedia::LLPluginClassMedia(LLPluginClassMediaOwner *owner) -{ - mOwner = owner; - mPlugin = NULL; - reset(); - - //debug use - mDeleteOK = true ; -} - - -LLPluginClassMedia::~LLPluginClassMedia() -{ - llassert_always(mDeleteOK) ; - reset(); -} - -bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_dir, const std::string &plugin_filename, bool debug) -{ - LL_DEBUGS("Plugin") << "launcher: " << launcher_filename << LL_ENDL; - LL_DEBUGS("Plugin") << "dir: " << plugin_dir << LL_ENDL; - LL_DEBUGS("Plugin") << "plugin: " << plugin_filename << LL_ENDL; - - mPlugin = new LLPluginProcessParent(this); - mPlugin->setSleepTime(mSleepTime); - - // Queue up the media init message -- it will be sent after all the currently queued messages. - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "init"); - message.setValue("target", mTarget); - sendMessage(message); - - mPlugin->init(launcher_filename, plugin_dir, plugin_filename, debug); - - return true; -} - - -void LLPluginClassMedia::reset() -{ - if(mPlugin != NULL) - { - delete mPlugin; - mPlugin = NULL; - } - - mTextureParamsReceived = false; - mRequestedTextureDepth = 0; - mRequestedTextureInternalFormat = 0; - mRequestedTextureFormat = 0; - mRequestedTextureType = 0; - mRequestedTextureSwapBytes = false; - mRequestedTextureCoordsOpenGL = false; - mTextureSharedMemorySize = 0; - mTextureSharedMemoryName.clear(); - mDefaultMediaWidth = 0; - mDefaultMediaHeight = 0; - mNaturalMediaWidth = 0; - mNaturalMediaHeight = 0; - mSetMediaWidth = -1; - mSetMediaHeight = -1; - mRequestedMediaWidth = 0; - mRequestedMediaHeight = 0; - mRequestedTextureWidth = 0; - mRequestedTextureHeight = 0; - mFullMediaWidth = 0; - mFullMediaHeight = 0; - mTextureWidth = 0; - mTextureHeight = 0; - mMediaWidth = 0; - mMediaHeight = 0; - mDirtyRect = LLRect::null; - mAutoScaleMedia = false; - mRequestedVolume = 1.0f; - mPriority = PRIORITY_NORMAL; - mLowPrioritySizeLimit = LOW_PRIORITY_TEXTURE_SIZE_DEFAULT; - mAllowDownsample = false; - mPadding = 0; - mLastMouseX = 0; - mLastMouseY = 0; - mStatus = LLPluginClassMediaOwner::MEDIA_NONE; - mSleepTime = 1.0f / 100.0f; - mCanCut = false; - mCanCopy = false; - mCanPaste = false; - mMediaName.clear(); - mMediaDescription.clear(); - mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f); - - // media_browser class - mNavigateURI.clear(); - mNavigateResultCode = -1; - mNavigateResultString.clear(); - mHistoryBackAvailable = false; - mHistoryForwardAvailable = false; - mStatusText.clear(); - mProgressPercent = 0; - mClickURL.clear(); - mClickNavType.clear(); - mClickTarget.clear(); - mClickUUID.clear(); - mStatusCode = 0; - - // media_time class - mCurrentTime = 0.0f; - mDuration = 0.0f; - mCurrentRate = 0.0f; - mLoadedDuration = 0.0f; -} - -void LLPluginClassMedia::idle(void) -{ - if(mPlugin) - { - mPlugin->idle(); - } - - if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()) || (mOwner == NULL)) - { - // Can't process a size change at this time - } - else if((mRequestedMediaWidth != mMediaWidth) || (mRequestedMediaHeight != mMediaHeight)) - { - // Calculate the correct size for the media texture - mRequestedTextureHeight = mRequestedMediaHeight; - if(mPadding < 0) - { - // negative values indicate the plugin wants a power of 2 - mRequestedTextureWidth = nextPowerOf2(mRequestedMediaWidth); - } - else - { - mRequestedTextureWidth = mRequestedMediaWidth; - - if(mPadding > 1) - { - // Pad up to a multiple of the specified number of bytes per row - int rowbytes = mRequestedTextureWidth * mRequestedTextureDepth; - int pad = rowbytes % mPadding; - if(pad != 0) - { - rowbytes += mPadding - pad; - } - - if(rowbytes % mRequestedTextureDepth == 0) - { - mRequestedTextureWidth = rowbytes / mRequestedTextureDepth; - } - else - { - LL_WARNS("Plugin") << "Unable to pad texture width, padding size " << mPadding << "is not a multiple of pixel size " << mRequestedTextureDepth << LL_ENDL; - } - } - } - - - // Size change has been requested but not initiated yet. - size_t newsize = mRequestedTextureWidth * mRequestedTextureHeight * mRequestedTextureDepth; - - // Add an extra line for padding, just in case. - newsize += mRequestedTextureWidth * mRequestedTextureDepth; - - if(newsize != mTextureSharedMemorySize) - { - if(!mTextureSharedMemoryName.empty()) - { - // Tell the plugin to remove the old memory segment - mPlugin->removeSharedMemory(mTextureSharedMemoryName); - mTextureSharedMemoryName.clear(); - } - - mTextureSharedMemorySize = newsize; - mTextureSharedMemoryName = mPlugin->addSharedMemory(mTextureSharedMemorySize); - if(!mTextureSharedMemoryName.empty()) - { - void *addr = mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName); - - // clear texture memory to avoid random screen visual fuzz from uninitialized texture data - memset( addr, 0x00, newsize ); - - // We could do this to force an update, but textureValid() will still be returning false until the first roundtrip to the plugin, - // so it may not be worthwhile. - // mDirtyRect.setOriginAndSize(0, 0, mRequestedMediaWidth, mRequestedMediaHeight); - } - } - - // This is our local indicator that a change is in progress. - mTextureWidth = -1; - mTextureHeight = -1; - mMediaWidth = -1; - mMediaHeight = -1; - - // This invalidates any existing dirty rect. - resetDirty(); - - // Send a size change message to the plugin - { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change"); - message.setValue("name", mTextureSharedMemoryName); - message.setValueS32("width", mRequestedMediaWidth); - message.setValueS32("height", mRequestedMediaHeight); - message.setValueS32("texture_width", mRequestedTextureWidth); - message.setValueS32("texture_height", mRequestedTextureHeight); - message.setValueReal("background_r", mBackgroundColor.mV[VX]); - message.setValueReal("background_g", mBackgroundColor.mV[VY]); - message.setValueReal("background_b", mBackgroundColor.mV[VZ]); - message.setValueReal("background_a", mBackgroundColor.mV[VW]); - mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue. - - LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL; - } - } - - if(mPlugin && mPlugin->isRunning()) - { - // Send queued messages - while(!mSendQueue.empty()) - { - LLPluginMessage message = mSendQueue.front(); - mSendQueue.pop(); - mPlugin->sendMessage(message); - } - } -} - -int LLPluginClassMedia::getTextureWidth() const -{ - return nextPowerOf2(mTextureWidth); -} - -int LLPluginClassMedia::getTextureHeight() const -{ - return nextPowerOf2(mTextureHeight); -} - -unsigned char* LLPluginClassMedia::getBitsData() -{ - unsigned char *result = NULL; - if((mPlugin != NULL) && !mTextureSharedMemoryName.empty()) - { - result = (unsigned char*)mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName); - } - return result; -} - -void LLPluginClassMedia::setSize(int width, int height) -{ - if((width > 0) && (height > 0)) - { - mSetMediaWidth = width; - mSetMediaHeight = height; - } - else - { - mSetMediaWidth = -1; - mSetMediaHeight = -1; - } - - setSizeInternal(); -} - -void LLPluginClassMedia::setSizeInternal(void) -{ - if((mSetMediaWidth > 0) && (mSetMediaHeight > 0)) - { - mRequestedMediaWidth = mSetMediaWidth; - mRequestedMediaHeight = mSetMediaHeight; - } - else if((mNaturalMediaWidth > 0) && (mNaturalMediaHeight > 0)) - { - mRequestedMediaWidth = mNaturalMediaWidth; - mRequestedMediaHeight = mNaturalMediaHeight; - } - else - { - mRequestedMediaWidth = mDefaultMediaWidth; - mRequestedMediaHeight = mDefaultMediaHeight; - } - - // Save these for size/interest calculations - mFullMediaWidth = mRequestedMediaWidth; - mFullMediaHeight = mRequestedMediaHeight; - - if(mAllowDownsample) - { - switch(mPriority) - { - case PRIORITY_SLIDESHOW: - case PRIORITY_LOW: - // Reduce maximum texture dimension to (or below) mLowPrioritySizeLimit - while((mRequestedMediaWidth > mLowPrioritySizeLimit) || (mRequestedMediaHeight > mLowPrioritySizeLimit)) - { - mRequestedMediaWidth /= 2; - mRequestedMediaHeight /= 2; - } - break; - - default: - // Don't adjust texture size - break; - } - } - - if(mAutoScaleMedia) - { - mRequestedMediaWidth = nextPowerOf2(mRequestedMediaWidth); - mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight); - } - - if(mRequestedMediaWidth > 2048) - mRequestedMediaWidth = 2048; - - if(mRequestedMediaHeight > 2048) - mRequestedMediaHeight = 2048; -} - -void LLPluginClassMedia::setAutoScale(bool auto_scale) -{ - if(auto_scale != mAutoScaleMedia) - { - mAutoScaleMedia = auto_scale; - setSizeInternal(); - } -} - -bool LLPluginClassMedia::textureValid(void) -{ - if( - !mTextureParamsReceived || - mTextureWidth <= 0 || - mTextureHeight <= 0 || - mMediaWidth <= 0 || - mMediaHeight <= 0 || - mRequestedMediaWidth != mMediaWidth || - mRequestedMediaHeight != mMediaHeight || - getBitsData() == NULL - ) - return false; - - return true; -} - -bool LLPluginClassMedia::getDirty(LLRect *dirty_rect) -{ - bool result = !mDirtyRect.isEmpty(); - - if(dirty_rect != NULL) - { - *dirty_rect = mDirtyRect; - } - - return result; -} - -void LLPluginClassMedia::resetDirty(void) -{ - mDirtyRect = LLRect::null; -} - -std::string LLPluginClassMedia::translateModifiers(MASK modifiers) -{ - std::string result; - - - if(modifiers & MASK_CONTROL) - { - result += "control|"; - } - - if(modifiers & MASK_ALT) - { - result += "alt|"; - } - - if(modifiers & MASK_SHIFT) - { - result += "shift|"; - } - - // TODO: should I deal with platform differences here or in callers? - // TODO: how do we deal with the Mac "command" key? -/* - if(modifiers & MASK_SOMETHING) - { - result += "meta|"; - } -*/ - return result; -} - -void LLPluginClassMedia::jsExposeObjectEvent( bool expose ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_expose_object"); - message.setValueBoolean( "expose", expose ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsValuesValidEvent( bool valid ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_values_valid"); - message.setValueBoolean( "valid", valid ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentLocationEvent( double x, double y, double z ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_location"); - message.setValueReal( "x", x ); - message.setValueReal( "y", y ); - message.setValueReal( "z", z ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentGlobalLocationEvent( double x, double y, double z ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_global_location"); - message.setValueReal( "x", x ); - message.setValueReal( "y", y ); - message.setValueReal( "z", z ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentOrientationEvent( double angle ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_orientation"); - message.setValueReal( "angle", angle ); - - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentLanguageEvent( const std::string& language ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_language"); - message.setValue( "language", language ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentRegionEvent( const std::string& region ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_region"); - message.setValue( "region", region ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsAgentMaturityEvent( const std::string& maturity ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_maturity"); - message.setValue( "maturity", maturity ); - sendMessage( message ); -} - -void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers) -{ - if(type == MOUSE_EVENT_MOVE) - { - if(!mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked()) - { - // Don't queue up mouse move events that can't be delivered. - return; - } - - if((x == mLastMouseX) && (y == mLastMouseY)) - { - // Don't spam unnecessary mouse move events. - return; - } - - mLastMouseX = x; - mLastMouseY = y; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "mouse_event"); - std::string temp; - switch(type) - { - case MOUSE_EVENT_DOWN: temp = "down"; break; - case MOUSE_EVENT_UP: temp = "up"; break; - case MOUSE_EVENT_MOVE: temp = "move"; break; - case MOUSE_EVENT_DOUBLE_CLICK: temp = "double_click"; break; - } - message.setValue("event", temp); - - message.setValueS32("button", button); - - message.setValueS32("x", x); - - // Incoming coordinates are OpenGL-style ((0,0) = lower left), so flip them here if the plugin has requested it. - if(!mRequestedTextureCoordsOpenGL) - { - // TODO: Should I use mMediaHeight or mRequestedMediaHeight here? - y = mMediaHeight - y; - } - message.setValueS32("y", y); - - message.setValue("modifiers", translateModifiers(modifiers)); - - sendMessage(message); -} - -bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data) -{ - bool result = true; - - // FIXME: - // HACK: we don't have an easy way to tell if the plugin is going to handle a particular keycode. - // For now, return false for the ones the webkit plugin won't handle properly. - - switch(key_code) - { - case KEY_BACKSPACE: - case KEY_TAB: - case KEY_RETURN: - case KEY_PAD_RETURN: - case KEY_SHIFT: - case KEY_CONTROL: - case KEY_ALT: - case KEY_CAPSLOCK: - case KEY_ESCAPE: - case KEY_PAGE_UP: - case KEY_PAGE_DOWN: - case KEY_END: - case KEY_HOME: - case KEY_LEFT: - case KEY_UP: - case KEY_RIGHT: - case KEY_DOWN: - case KEY_INSERT: - case KEY_DELETE: - // These will be handled - break; - - default: - // regular ASCII characters will also be handled - if(key_code >= KEY_SPECIAL) - { - // Other "special" codes will not work properly. - result = false; - } - break; - } - -#if LL_DARWIN - if(modifiers & MASK_ALT) - { - // Option-key modified characters should be handled by the unicode input path instead of this one. - result = false; - } -#endif - - if(result) - { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "key_event"); - std::string temp; - switch(type) - { - case KEY_EVENT_DOWN: temp = "down"; break; - case KEY_EVENT_UP: temp = "up"; break; - case KEY_EVENT_REPEAT: temp = "repeat"; break; - } - message.setValue("event", temp); - - message.setValueS32("key", key_code); - - message.setValue("modifiers", translateModifiers(modifiers)); - message.setValueLLSD("native_key_data", native_key_data); - - sendMessage(message); - } - - return result; -} - -void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event"); - - message.setValueS32("x", x); - message.setValueS32("y", y); - message.setValue("modifiers", translateModifiers(modifiers)); - - sendMessage(message); -} - -bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers, LLSD native_key_data) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event"); - - message.setValue("text", text); - message.setValue("modifiers", translateModifiers(modifiers)); - message.setValueLLSD("native_key_data", native_key_data); - - sendMessage(message); - - return true; -} - -void LLPluginClassMedia::loadURI(const std::string &uri) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "load_uri"); - - message.setValue("uri", uri); - - sendMessage(message); -} - -const char* LLPluginClassMedia::priorityToString(EPriority priority) -{ - const char* result = "UNKNOWN"; - switch(priority) - { - case PRIORITY_UNLOADED: result = "unloaded"; break; - case PRIORITY_STOPPED: result = "stopped"; break; - case PRIORITY_HIDDEN: result = "hidden"; break; - case PRIORITY_SLIDESHOW: result = "slideshow"; break; - case PRIORITY_LOW: result = "low"; break; - case PRIORITY_NORMAL: result = "normal"; break; - case PRIORITY_HIGH: result = "high"; break; - } - - return result; -} - -void LLPluginClassMedia::setPriority(EPriority priority) -{ - if(mPriority != priority) - { - mPriority = priority; - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_priority"); - - std::string priority_string = priorityToString(priority); - switch(priority) - { - case PRIORITY_UNLOADED: - mSleepTime = 1.0f; - break; - case PRIORITY_STOPPED: - mSleepTime = 1.0f; - break; - case PRIORITY_HIDDEN: - mSleepTime = 1.0f; - break; - case PRIORITY_SLIDESHOW: - mSleepTime = 1.0f; - break; - case PRIORITY_LOW: - mSleepTime = 1.0f / 25.0f; - break; - case PRIORITY_NORMAL: - mSleepTime = 1.0f / 50.0f; - break; - case PRIORITY_HIGH: - mSleepTime = 1.0f / 100.0f; - break; - } - - message.setValue("priority", priority_string); - - sendMessage(message); - - if(mPlugin) - { - mPlugin->setSleepTime(mSleepTime); - } - - LL_DEBUGS("PluginPriority") << this << ": setting priority to " << priority_string << LL_ENDL; - - // This may affect the calculated size, so recalculate it here. - setSizeInternal(); - } -} - -void LLPluginClassMedia::setLowPrioritySizeLimit(int size) -{ - int power = nextPowerOf2(size); - if(mLowPrioritySizeLimit != power) - { - mLowPrioritySizeLimit = power; - - // This may affect the calculated size, so recalculate it here. - setSizeInternal(); - } -} - -F64 LLPluginClassMedia::getCPUUsage() -{ - F64 result = 0.0f; - - if(mPlugin) - { - result = mPlugin->getCPUUsage(); - } - - return result; -} - -void LLPluginClassMedia::sendPickFileResponse(const std::string &file) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response"); - message.setValue("file", file); - if(mPlugin && mPlugin->isBlocked()) - { - // If the plugin sent a blocking pick-file request, the response should unblock it. - message.setValueBoolean("blocking_response", true); - } - sendMessage(message); -} - -void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, const std::string &password) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_response"); - message.setValueBoolean("ok", ok); - message.setValue("username", username); - message.setValue("password", password); - if(mPlugin && mPlugin->isBlocked()) - { - // If the plugin sent a blocking pick-file request, the response should unblock it. - message.setValueBoolean("blocking_response", true); - } - sendMessage(message); -} - -void LLPluginClassMedia::cut() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut"); - sendMessage(message); -} - -void LLPluginClassMedia::copy() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_copy"); - sendMessage(message); -} - -void LLPluginClassMedia::paste() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_paste"); - sendMessage(message); -} - -void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path"); - message.setValue("path", user_data_path); - sendMessage(message); -} - -void LLPluginClassMedia::setLanguageCode(const std::string &language_code) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_language_code"); - message.setValue("language", language_code); - sendMessage(message); -} - -void LLPluginClassMedia::setPluginsEnabled(const bool enabled) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "plugins_enabled"); - message.setValueBoolean("enable", enabled); - sendMessage(message); -} - -void LLPluginClassMedia::setJavascriptEnabled(const bool enabled) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "javascript_enabled"); - message.setValueBoolean("enable", enabled); - sendMessage(message); -} - -void LLPluginClassMedia::setTarget(const std::string &target) -{ - mTarget = target; -} - -/* virtual */ -void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) -{ - std::string message_class = message.getClass(); - - if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) - { - std::string message_name = message.getName(); - if(message_name == "texture_params") - { - mRequestedTextureDepth = message.getValueS32("depth"); - mRequestedTextureInternalFormat = message.getValueU32("internalformat"); - mRequestedTextureFormat = message.getValueU32("format"); - mRequestedTextureType = message.getValueU32("type"); - mRequestedTextureSwapBytes = message.getValueBoolean("swap_bytes"); - mRequestedTextureCoordsOpenGL = message.getValueBoolean("coords_opengl"); - - // These two are optional, and will default to 0 if they're not specified. - mDefaultMediaWidth = message.getValueS32("default_width"); - mDefaultMediaHeight = message.getValueS32("default_height"); - - mAllowDownsample = message.getValueBoolean("allow_downsample"); - mPadding = message.getValueS32("padding"); - - setSizeInternal(); - - mTextureParamsReceived = true; - } - else if(message_name == "updated") - { - if(message.hasValue("left")) - { - LLRect newDirtyRect; - newDirtyRect.mLeft = message.getValueS32("left"); - newDirtyRect.mTop = message.getValueS32("top"); - newDirtyRect.mRight = message.getValueS32("right"); - newDirtyRect.mBottom = message.getValueS32("bottom"); - - // The plugin is likely to have top and bottom switched, due to vertical flip and OpenGL coordinate confusion. - // If they're backwards, swap them. - if(newDirtyRect.mTop < newDirtyRect.mBottom) - { - S32 temp = newDirtyRect.mTop; - newDirtyRect.mTop = newDirtyRect.mBottom; - newDirtyRect.mBottom = temp; - } - - if(mDirtyRect.isEmpty()) - { - mDirtyRect = newDirtyRect; - } - else - { - mDirtyRect.unionWith(newDirtyRect); - } - - LL_DEBUGS("Plugin") << "adjusted incoming rect is: (" - << newDirtyRect.mLeft << ", " - << newDirtyRect.mTop << ", " - << newDirtyRect.mRight << ", " - << newDirtyRect.mBottom << "), new dirty rect is: (" - << mDirtyRect.mLeft << ", " - << mDirtyRect.mTop << ", " - << mDirtyRect.mRight << ", " - << mDirtyRect.mBottom << ")" - << LL_ENDL; - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CONTENT_UPDATED); - } - - - bool time_duration_updated = false; - int previous_percent = mProgressPercent; - - if(message.hasValue("current_time")) - { - mCurrentTime = message.getValueReal("current_time"); - time_duration_updated = true; - } - if(message.hasValue("duration")) - { - mDuration = message.getValueReal("duration"); - time_duration_updated = true; - } - - if(message.hasValue("current_rate")) - { - mCurrentRate = message.getValueReal("current_rate"); - } - - if(message.hasValue("loaded_duration")) - { - mLoadedDuration = message.getValueReal("loaded_duration"); - time_duration_updated = true; - } - else - { - // If the message doesn't contain a loaded_duration param, assume it's equal to duration - mLoadedDuration = mDuration; - } - - // Calculate a percentage based on the loaded duration and total duration. - if(mDuration != 0.0f) // Don't divide by zero. - { - mProgressPercent = (int)((mLoadedDuration * 100.0f)/mDuration); - } - - if(time_duration_updated) - { - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_TIME_DURATION_UPDATED); - } - - if(previous_percent != mProgressPercent) - { - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED); - } - } - else if(message_name == "media_status") - { - std::string status = message.getValue("status"); - - LL_DEBUGS("Plugin") << "Status changed to: " << status << LL_ENDL; - - if(status == "loading") - { - mStatus = LLPluginClassMediaOwner::MEDIA_LOADING; - } - else if(status == "loaded") - { - mStatus = LLPluginClassMediaOwner::MEDIA_LOADED; - } - else if(status == "error") - { - mStatus = LLPluginClassMediaOwner::MEDIA_ERROR; - } - else if(status == "playing") - { - mStatus = LLPluginClassMediaOwner::MEDIA_PLAYING; - } - else if(status == "paused") - { - mStatus = LLPluginClassMediaOwner::MEDIA_PAUSED; - } - else if(status == "done") - { - mStatus = LLPluginClassMediaOwner::MEDIA_DONE; - } - else - { - // empty string or any unknown string - mStatus = LLPluginClassMediaOwner::MEDIA_NONE; - } - } - else if(message_name == "size_change_request") - { - S32 width = message.getValueS32("width"); - S32 height = message.getValueS32("height"); - std::string name = message.getValue("name"); - - // TODO: check that name matches? - mNaturalMediaWidth = width; - mNaturalMediaHeight = height; - - setSizeInternal(); - } - else if(message_name == "size_change_response") - { - std::string name = message.getValue("name"); - - // TODO: check that name matches? - - mTextureWidth = message.getValueS32("texture_width"); - mTextureHeight = message.getValueS32("texture_height"); - mMediaWidth = message.getValueS32("width"); - mMediaHeight = message.getValueS32("height"); - - // This invalidates any existing dirty rect. - resetDirty(); - - // TODO: should we verify that the plugin sent back the right values? - // Two size changes in a row may cause them to not match, due to queueing, etc. - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_SIZE_CHANGED); - } - else if(message_name == "cursor_changed") - { - mCursorName = message.getValue("name"); - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CURSOR_CHANGED); - } - else if(message_name == "edit_state") - { - if(message.hasValue("cut")) - { - mCanCut = message.getValueBoolean("cut"); - } - if(message.hasValue("copy")) - { - mCanCopy = message.getValueBoolean("copy"); - } - if(message.hasValue("paste")) - { - mCanPaste = message.getValueBoolean("paste"); - } - } - else if(message_name == "name_text") - { - mMediaName = message.getValue("name"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED); - } - else if(message_name == "pick_file") - { - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PICK_FILE_REQUEST); - } - else if(message_name == "auth_request") - { - mAuthURL = message.getValue("url"); - mAuthRealm = message.getValue("realm"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST); - } - else - { - LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; - } - } - else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) - { - std::string message_name = message.getName(); - if(message_name == "navigate_begin") - { - mNavigateURI = message.getValue("uri"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_BEGIN); - } - else if(message_name == "navigate_complete") - { - mNavigateURI = message.getValue("uri"); - mNavigateResultCode = message.getValueS32("result_code"); - mNavigateResultString = message.getValue("result_string"); - mHistoryBackAvailable = message.getValueBoolean("history_back_available"); - mHistoryForwardAvailable = message.getValueBoolean("history_forward_available"); - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE); - } - else if(message_name == "progress") - { - mProgressPercent = message.getValueS32("percent"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED); - } - else if(message_name == "status_text") - { - mStatusText = message.getValue("status"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_STATUS_TEXT_CHANGED); - } - else if(message_name == "location_changed") - { - mLocation = message.getValue("uri"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LOCATION_CHANGED); - } - else if(message_name == "click_href") - { - mClickURL = message.getValue("uri"); - mClickTarget = message.getValue("target"); - mClickUUID = message.getValue("uuid"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF); - } - else if(message_name == "click_nofollow") - { - mClickURL = message.getValue("uri"); - mClickNavType = message.getValue("nav_type"); - mClickTarget.clear(); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW); - } - else if(message_name == "navigate_error_page") - { - mStatusCode = message.getValueS32("status_code"); - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_ERROR_PAGE); - } - else if(message_name == "cookie_set") - { - if(mOwner) - { - mOwner->handleCookieSet(this, message.getValue("cookie")); - } - } - else if(message_name == "close_request") - { - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLOSE_REQUEST); - } - else if(message_name == "geometry_change") - { - mClickUUID = message.getValue("uuid"); - mGeometryX = message.getValueS32("x"); - mGeometryY = message.getValueS32("y"); - mGeometryWidth = message.getValueS32("width"); - mGeometryHeight = message.getValueS32("height"); - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE); - } - else if(message_name == "link_hovered") - { - // text is not currently used -- the tooltip hover text is taken from the "title". - mHoverLink = message.getValue("link"); - mHoverText = message.getValue("title"); - // message.getValue("text"); - - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LINK_HOVERED); - } - else - { - LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; - } - } - else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME) - { - std::string message_name = message.getName(); - - // This class hasn't defined any incoming messages yet. -// if(message_name == "message_name") -// { -// } -// else - { - LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; - } - } - -} - -/* virtual */ -void LLPluginClassMedia::pluginLaunchFailed() -{ - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED_LAUNCH); -} - -/* virtual */ -void LLPluginClassMedia::pluginDied() -{ - mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED); -} - -void LLPluginClassMedia::mediaEvent(LLPluginClassMediaOwner::EMediaEvent event) -{ - if(mOwner) - { - mOwner->handleMediaEvent(this, event); - } -} - -void LLPluginClassMedia::sendMessage(const LLPluginMessage &message) -{ - if(mPlugin && mPlugin->isRunning()) - { - mPlugin->sendMessage(message); - } - else - { - // The plugin isn't set up yet -- queue this message to be sent after initialization. - mSendQueue.push(message); - } -} - -//////////////////////////////////////////////////////////// -// MARK: media_browser class functions -bool LLPluginClassMedia::pluginSupportsMediaBrowser(void) -{ - std::string version = mPlugin->getMessageClassVersion(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER); - return !version.empty(); -} - -void LLPluginClassMedia::focus(bool focused) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "focus"); - - message.setValueBoolean("focused", focused); - - sendMessage(message); -} - -void LLPluginClassMedia::clear_cache() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cache"); - sendMessage(message); -} - -void LLPluginClassMedia::clear_cookies() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cookies"); - sendMessage(message); -} - -void LLPluginClassMedia::set_cookies(const std::string &cookies) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_cookies"); - message.setValue("cookies", cookies); - sendMessage(message); -} - -void LLPluginClassMedia::enable_cookies(bool enable) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "enable_cookies"); - message.setValueBoolean("enable", enable); - sendMessage(message); -} - -void LLPluginClassMedia::proxy_setup(bool enable, const std::string &host, int port) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_setup"); - - message.setValueBoolean("enable", enable); - message.setValue("host", host); - message.setValueS32("port", port); - - sendMessage(message); -} - -void LLPluginClassMedia::browse_stop() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_stop"); - sendMessage(message); -} - -void LLPluginClassMedia::browse_reload(bool ignore_cache) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_reload"); - - message.setValueBoolean("ignore_cache", ignore_cache); - - sendMessage(message); -} - -void LLPluginClassMedia::browse_forward() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_forward"); - sendMessage(message); -} - -void LLPluginClassMedia::browse_back() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_back"); - sendMessage(message); -} - -void LLPluginClassMedia::setBrowserUserAgent(const std::string& user_agent) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_user_agent"); - - message.setValue("user_agent", user_agent); - - sendMessage(message); -} - -void LLPluginClassMedia::proxyWindowOpened(const std::string &target, const std::string &uuid) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_opened"); - - message.setValue("target", target); - message.setValue("uuid", uuid); - - sendMessage(message); -} - -void LLPluginClassMedia::proxyWindowClosed(const std::string &uuid) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_closed"); - - message.setValue("uuid", uuid); - - sendMessage(message); -} - -void LLPluginClassMedia::ignore_ssl_cert_errors(bool ignore) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "ignore_ssl_cert_errors"); - message.setValueBoolean("ignore", ignore); - sendMessage(message); -} - -void LLPluginClassMedia::addCertificateFilePath(const std::string& path) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "add_certificate_file_path"); - message.setValue("path", path); - sendMessage(message); -} - -void LLPluginClassMedia::crashPlugin() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash"); - - sendMessage(message); -} - -void LLPluginClassMedia::hangPlugin() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "hang"); - - sendMessage(message); -} - - -//////////////////////////////////////////////////////////// -// MARK: media_time class functions -bool LLPluginClassMedia::pluginSupportsMediaTime(void) -{ - std::string version = mPlugin->getMessageClassVersion(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME); - return !version.empty(); -} - -void LLPluginClassMedia::stop() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "stop"); - sendMessage(message); -} - -void LLPluginClassMedia::start(float rate) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "start"); - - message.setValueReal("rate", rate); - - sendMessage(message); -} - -void LLPluginClassMedia::pause() -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "pause"); - sendMessage(message); -} - -void LLPluginClassMedia::seek(float time) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "seek"); - - message.setValueReal("time", time); - - sendMessage(message); -} - -void LLPluginClassMedia::setLoop(bool loop) -{ - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "set_loop"); - - message.setValueBoolean("loop", loop); - - sendMessage(message); -} - -void LLPluginClassMedia::setVolume(float volume) -{ - if(volume != mRequestedVolume) - { - mRequestedVolume = volume; - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "set_volume"); - - message.setValueReal("volume", volume); - - sendMessage(message); - } -} - -float LLPluginClassMedia::getVolume() -{ - return mRequestedVolume; -} - -void LLPluginClassMedia::initializeUrlHistory(const LLSD& url_history) -{ - // Send URL history to plugin - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "init_history"); - message.setValueLLSD("history", url_history); - sendMessage(message); - - LL_DEBUGS("Plugin") << "Sending history" << LL_ENDL; -} - +/**
+ * @file llpluginclassmedia.cpp
+ * @brief LLPluginClassMedia handles a plugin which knows about the "media" message class.
+ *
+ * @cond
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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$
+ * @endcond
+ */
+
+#include "linden_common.h"
+#include "indra_constants.h"
+
+#include "llpluginclassmedia.h"
+#include "llpluginmessageclasses.h"
+
+#include "llqtwebkit.h"
+
+static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256;
+
+static int nextPowerOf2( int value )
+{
+ int next_power_of_2 = 1;
+ while ( next_power_of_2 < value )
+ {
+ next_power_of_2 <<= 1;
+ }
+
+ return next_power_of_2;
+}
+
+LLPluginClassMedia::LLPluginClassMedia(LLPluginClassMediaOwner *owner)
+{
+ mOwner = owner;
+ mPlugin = NULL;
+ reset();
+
+ //debug use
+ mDeleteOK = true ;
+}
+
+
+LLPluginClassMedia::~LLPluginClassMedia()
+{
+ llassert_always(mDeleteOK) ;
+ reset();
+}
+
+bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_dir, const std::string &plugin_filename, bool debug)
+{
+ LL_DEBUGS("Plugin") << "launcher: " << launcher_filename << LL_ENDL;
+ LL_DEBUGS("Plugin") << "dir: " << plugin_dir << LL_ENDL;
+ LL_DEBUGS("Plugin") << "plugin: " << plugin_filename << LL_ENDL;
+
+ mPlugin = new LLPluginProcessParent(this);
+ mPlugin->setSleepTime(mSleepTime);
+
+ // Queue up the media init message -- it will be sent after all the currently queued messages.
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "init");
+ message.setValue("target", mTarget);
+ sendMessage(message);
+
+ mPlugin->init(launcher_filename, plugin_dir, plugin_filename, debug);
+
+ return true;
+}
+
+
+void LLPluginClassMedia::reset()
+{
+ if(mPlugin != NULL)
+ {
+ delete mPlugin;
+ mPlugin = NULL;
+ }
+
+ mTextureParamsReceived = false;
+ mRequestedTextureDepth = 0;
+ mRequestedTextureInternalFormat = 0;
+ mRequestedTextureFormat = 0;
+ mRequestedTextureType = 0;
+ mRequestedTextureSwapBytes = false;
+ mRequestedTextureCoordsOpenGL = false;
+ mTextureSharedMemorySize = 0;
+ mTextureSharedMemoryName.clear();
+ mDefaultMediaWidth = 0;
+ mDefaultMediaHeight = 0;
+ mNaturalMediaWidth = 0;
+ mNaturalMediaHeight = 0;
+ mSetMediaWidth = -1;
+ mSetMediaHeight = -1;
+ mRequestedMediaWidth = 0;
+ mRequestedMediaHeight = 0;
+ mRequestedTextureWidth = 0;
+ mRequestedTextureHeight = 0;
+ mFullMediaWidth = 0;
+ mFullMediaHeight = 0;
+ mTextureWidth = 0;
+ mTextureHeight = 0;
+ mMediaWidth = 0;
+ mMediaHeight = 0;
+ mDirtyRect = LLRect::null;
+ mAutoScaleMedia = false;
+ mRequestedVolume = 1.0f;
+ mPriority = PRIORITY_NORMAL;
+ mLowPrioritySizeLimit = LOW_PRIORITY_TEXTURE_SIZE_DEFAULT;
+ mAllowDownsample = false;
+ mPadding = 0;
+ mLastMouseX = 0;
+ mLastMouseY = 0;
+ mStatus = LLPluginClassMediaOwner::MEDIA_NONE;
+ mSleepTime = 1.0f / 100.0f;
+ mCanCut = false;
+ mCanCopy = false;
+ mCanPaste = false;
+ mMediaName.clear();
+ mMediaDescription.clear();
+ mBackgroundColor = LLColor4(1.0f, 1.0f, 1.0f, 1.0f);
+
+ // media_browser class
+ mNavigateURI.clear();
+ mNavigateResultCode = -1;
+ mNavigateResultString.clear();
+ mHistoryBackAvailable = false;
+ mHistoryForwardAvailable = false;
+ mStatusText.clear();
+ mProgressPercent = 0;
+ mClickURL.clear();
+ mClickNavType.clear();
+ mClickTarget.clear();
+ mClickUUID.clear();
+ mStatusCode = 0;
+
+ // media_time class
+ mCurrentTime = 0.0f;
+ mDuration = 0.0f;
+ mCurrentRate = 0.0f;
+ mLoadedDuration = 0.0f;
+}
+
+void LLPluginClassMedia::idle(void)
+{
+ if(mPlugin)
+ {
+ mPlugin->idle();
+ }
+
+ if((mMediaWidth == -1) || (!mTextureParamsReceived) || (mPlugin == NULL) || (mPlugin->isBlocked()) || (mOwner == NULL))
+ {
+ // Can't process a size change at this time
+ }
+ else if((mRequestedMediaWidth != mMediaWidth) || (mRequestedMediaHeight != mMediaHeight))
+ {
+ // Calculate the correct size for the media texture
+ mRequestedTextureHeight = mRequestedMediaHeight;
+ if(mPadding < 0)
+ {
+ // negative values indicate the plugin wants a power of 2
+ mRequestedTextureWidth = nextPowerOf2(mRequestedMediaWidth);
+ }
+ else
+ {
+ mRequestedTextureWidth = mRequestedMediaWidth;
+
+ if(mPadding > 1)
+ {
+ // Pad up to a multiple of the specified number of bytes per row
+ int rowbytes = mRequestedTextureWidth * mRequestedTextureDepth;
+ int pad = rowbytes % mPadding;
+ if(pad != 0)
+ {
+ rowbytes += mPadding - pad;
+ }
+
+ if(rowbytes % mRequestedTextureDepth == 0)
+ {
+ mRequestedTextureWidth = rowbytes / mRequestedTextureDepth;
+ }
+ else
+ {
+ LL_WARNS("Plugin") << "Unable to pad texture width, padding size " << mPadding << "is not a multiple of pixel size " << mRequestedTextureDepth << LL_ENDL;
+ }
+ }
+ }
+
+
+ // Size change has been requested but not initiated yet.
+ size_t newsize = mRequestedTextureWidth * mRequestedTextureHeight * mRequestedTextureDepth;
+
+ // Add an extra line for padding, just in case.
+ newsize += mRequestedTextureWidth * mRequestedTextureDepth;
+
+ if(newsize != mTextureSharedMemorySize)
+ {
+ if(!mTextureSharedMemoryName.empty())
+ {
+ // Tell the plugin to remove the old memory segment
+ mPlugin->removeSharedMemory(mTextureSharedMemoryName);
+ mTextureSharedMemoryName.clear();
+ }
+
+ mTextureSharedMemorySize = newsize;
+ mTextureSharedMemoryName = mPlugin->addSharedMemory(mTextureSharedMemorySize);
+ if(!mTextureSharedMemoryName.empty())
+ {
+ void *addr = mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName);
+
+ // clear texture memory to avoid random screen visual fuzz from uninitialized texture data
+ memset( addr, 0x00, newsize );
+
+ // We could do this to force an update, but textureValid() will still be returning false until the first roundtrip to the plugin,
+ // so it may not be worthwhile.
+ // mDirtyRect.setOriginAndSize(0, 0, mRequestedMediaWidth, mRequestedMediaHeight);
+ }
+ }
+
+ // This is our local indicator that a change is in progress.
+ mTextureWidth = -1;
+ mTextureHeight = -1;
+ mMediaWidth = -1;
+ mMediaHeight = -1;
+
+ // This invalidates any existing dirty rect.
+ resetDirty();
+
+ // Send a size change message to the plugin
+ {
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change");
+ message.setValue("name", mTextureSharedMemoryName);
+ message.setValueS32("width", mRequestedMediaWidth);
+ message.setValueS32("height", mRequestedMediaHeight);
+ message.setValueS32("texture_width", mRequestedTextureWidth);
+ message.setValueS32("texture_height", mRequestedTextureHeight);
+ message.setValueReal("background_r", mBackgroundColor.mV[VX]);
+ message.setValueReal("background_g", mBackgroundColor.mV[VY]);
+ message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
+ message.setValueReal("background_a", mBackgroundColor.mV[VW]);
+ mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
+
+ LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;
+ }
+ }
+
+ if(mPlugin && mPlugin->isRunning())
+ {
+ // Send queued messages
+ while(!mSendQueue.empty())
+ {
+ LLPluginMessage message = mSendQueue.front();
+ mSendQueue.pop();
+ mPlugin->sendMessage(message);
+ }
+ }
+}
+
+int LLPluginClassMedia::getTextureWidth() const
+{
+ return nextPowerOf2(mTextureWidth);
+}
+
+int LLPluginClassMedia::getTextureHeight() const
+{
+ return nextPowerOf2(mTextureHeight);
+}
+
+unsigned char* LLPluginClassMedia::getBitsData()
+{
+ unsigned char *result = NULL;
+ if((mPlugin != NULL) && !mTextureSharedMemoryName.empty())
+ {
+ result = (unsigned char*)mPlugin->getSharedMemoryAddress(mTextureSharedMemoryName);
+ }
+ return result;
+}
+
+void LLPluginClassMedia::setSize(int width, int height)
+{
+ if((width > 0) && (height > 0))
+ {
+ mSetMediaWidth = width;
+ mSetMediaHeight = height;
+ }
+ else
+ {
+ mSetMediaWidth = -1;
+ mSetMediaHeight = -1;
+ }
+
+ setSizeInternal();
+}
+
+void LLPluginClassMedia::setSizeInternal(void)
+{
+ if((mSetMediaWidth > 0) && (mSetMediaHeight > 0))
+ {
+ mRequestedMediaWidth = mSetMediaWidth;
+ mRequestedMediaHeight = mSetMediaHeight;
+ }
+ else if((mNaturalMediaWidth > 0) && (mNaturalMediaHeight > 0))
+ {
+ mRequestedMediaWidth = mNaturalMediaWidth;
+ mRequestedMediaHeight = mNaturalMediaHeight;
+ }
+ else
+ {
+ mRequestedMediaWidth = mDefaultMediaWidth;
+ mRequestedMediaHeight = mDefaultMediaHeight;
+ }
+
+ // Save these for size/interest calculations
+ mFullMediaWidth = mRequestedMediaWidth;
+ mFullMediaHeight = mRequestedMediaHeight;
+
+ if(mAllowDownsample)
+ {
+ switch(mPriority)
+ {
+ case PRIORITY_SLIDESHOW:
+ case PRIORITY_LOW:
+ // Reduce maximum texture dimension to (or below) mLowPrioritySizeLimit
+ while((mRequestedMediaWidth > mLowPrioritySizeLimit) || (mRequestedMediaHeight > mLowPrioritySizeLimit))
+ {
+ mRequestedMediaWidth /= 2;
+ mRequestedMediaHeight /= 2;
+ }
+ break;
+
+ default:
+ // Don't adjust texture size
+ break;
+ }
+ }
+
+ if(mAutoScaleMedia)
+ {
+ mRequestedMediaWidth = nextPowerOf2(mRequestedMediaWidth);
+ mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight);
+ }
+
+ if(mRequestedMediaWidth > 2048)
+ mRequestedMediaWidth = 2048;
+
+ if(mRequestedMediaHeight > 2048)
+ mRequestedMediaHeight = 2048;
+}
+
+void LLPluginClassMedia::setAutoScale(bool auto_scale)
+{
+ if(auto_scale != mAutoScaleMedia)
+ {
+ mAutoScaleMedia = auto_scale;
+ setSizeInternal();
+ }
+}
+
+bool LLPluginClassMedia::textureValid(void)
+{
+ if(
+ !mTextureParamsReceived ||
+ mTextureWidth <= 0 ||
+ mTextureHeight <= 0 ||
+ mMediaWidth <= 0 ||
+ mMediaHeight <= 0 ||
+ mRequestedMediaWidth != mMediaWidth ||
+ mRequestedMediaHeight != mMediaHeight ||
+ getBitsData() == NULL
+ )
+ return false;
+
+ return true;
+}
+
+bool LLPluginClassMedia::getDirty(LLRect *dirty_rect)
+{
+ bool result = !mDirtyRect.isEmpty();
+
+ if(dirty_rect != NULL)
+ {
+ *dirty_rect = mDirtyRect;
+ }
+
+ return result;
+}
+
+void LLPluginClassMedia::resetDirty(void)
+{
+ mDirtyRect = LLRect::null;
+}
+
+std::string LLPluginClassMedia::translateModifiers(MASK modifiers)
+{
+ std::string result;
+
+
+ if(modifiers & MASK_CONTROL)
+ {
+ result += "control|";
+ }
+
+ if(modifiers & MASK_ALT)
+ {
+ result += "alt|";
+ }
+
+ if(modifiers & MASK_SHIFT)
+ {
+ result += "shift|";
+ }
+
+ // TODO: should I deal with platform differences here or in callers?
+ // TODO: how do we deal with the Mac "command" key?
+/*
+ if(modifiers & MASK_SOMETHING)
+ {
+ result += "meta|";
+ }
+*/
+ return result;
+}
+
+void LLPluginClassMedia::jsEnableObject( bool enable )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_enable_object");
+ message.setValueBoolean( "enable", enable );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentLocationEvent( double x, double y, double z )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_location");
+ message.setValueReal( "x", x );
+ message.setValueReal( "y", y );
+ message.setValueReal( "z", z );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentGlobalLocationEvent( double x, double y, double z )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_global_location");
+ message.setValueReal( "x", x );
+ message.setValueReal( "y", y );
+ message.setValueReal( "z", z );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentOrientationEvent( double angle )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_orientation");
+ message.setValueReal( "angle", angle );
+
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentLanguageEvent( const std::string& language )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_language");
+ message.setValue( "language", language );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentRegionEvent( const std::string& region )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_region");
+ message.setValue( "region", region );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::jsAgentMaturityEvent( const std::string& maturity )
+{
+ if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() )
+ {
+ return;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_agent_maturity");
+ message.setValue( "maturity", maturity );
+ sendMessage( message );
+}
+
+void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers)
+{
+ if(type == MOUSE_EVENT_MOVE)
+ {
+ if(!mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked())
+ {
+ // Don't queue up mouse move events that can't be delivered.
+ return;
+ }
+
+ if((x == mLastMouseX) && (y == mLastMouseY))
+ {
+ // Don't spam unnecessary mouse move events.
+ return;
+ }
+
+ mLastMouseX = x;
+ mLastMouseY = y;
+ }
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "mouse_event");
+ std::string temp;
+ switch(type)
+ {
+ case MOUSE_EVENT_DOWN: temp = "down"; break;
+ case MOUSE_EVENT_UP: temp = "up"; break;
+ case MOUSE_EVENT_MOVE: temp = "move"; break;
+ case MOUSE_EVENT_DOUBLE_CLICK: temp = "double_click"; break;
+ }
+ message.setValue("event", temp);
+
+ message.setValueS32("button", button);
+
+ message.setValueS32("x", x);
+
+ // Incoming coordinates are OpenGL-style ((0,0) = lower left), so flip them here if the plugin has requested it.
+ if(!mRequestedTextureCoordsOpenGL)
+ {
+ // TODO: Should I use mMediaHeight or mRequestedMediaHeight here?
+ y = mMediaHeight - y;
+ }
+ message.setValueS32("y", y);
+
+ message.setValue("modifiers", translateModifiers(modifiers));
+
+ sendMessage(message);
+}
+
+bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data)
+{
+ bool result = true;
+
+ // FIXME:
+ // HACK: we don't have an easy way to tell if the plugin is going to handle a particular keycode.
+ // For now, return false for the ones the webkit plugin won't handle properly.
+
+ switch(key_code)
+ {
+ case KEY_BACKSPACE:
+ case KEY_TAB:
+ case KEY_RETURN:
+ case KEY_PAD_RETURN:
+ case KEY_SHIFT:
+ case KEY_CONTROL:
+ case KEY_ALT:
+ case KEY_CAPSLOCK:
+ case KEY_ESCAPE:
+ case KEY_PAGE_UP:
+ case KEY_PAGE_DOWN:
+ case KEY_END:
+ case KEY_HOME:
+ case KEY_LEFT:
+ case KEY_UP:
+ case KEY_RIGHT:
+ case KEY_DOWN:
+ case KEY_INSERT:
+ case KEY_DELETE:
+ // These will be handled
+ break;
+
+ default:
+ // regular ASCII characters will also be handled
+ if(key_code >= KEY_SPECIAL)
+ {
+ // Other "special" codes will not work properly.
+ result = false;
+ }
+ break;
+ }
+
+#if LL_DARWIN
+ if(modifiers & MASK_ALT)
+ {
+ // Option-key modified characters should be handled by the unicode input path instead of this one.
+ result = false;
+ }
+#endif
+
+ if(result)
+ {
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "key_event");
+ std::string temp;
+ switch(type)
+ {
+ case KEY_EVENT_DOWN: temp = "down"; break;
+ case KEY_EVENT_UP: temp = "up"; break;
+ case KEY_EVENT_REPEAT: temp = "repeat"; break;
+ }
+ message.setValue("event", temp);
+
+ message.setValueS32("key", key_code);
+
+ message.setValue("modifiers", translateModifiers(modifiers));
+ message.setValueLLSD("native_key_data", native_key_data);
+
+ sendMessage(message);
+ }
+
+ return result;
+}
+
+void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event");
+
+ message.setValueS32("x", x);
+ message.setValueS32("y", y);
+ message.setValue("modifiers", translateModifiers(modifiers));
+
+ sendMessage(message);
+}
+
+bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers, LLSD native_key_data)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event");
+
+ message.setValue("text", text);
+ message.setValue("modifiers", translateModifiers(modifiers));
+ message.setValueLLSD("native_key_data", native_key_data);
+
+ sendMessage(message);
+
+ return true;
+}
+
+void LLPluginClassMedia::loadURI(const std::string &uri)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "load_uri");
+
+ message.setValue("uri", uri);
+
+ sendMessage(message);
+}
+
+const char* LLPluginClassMedia::priorityToString(EPriority priority)
+{
+ const char* result = "UNKNOWN";
+ switch(priority)
+ {
+ case PRIORITY_UNLOADED: result = "unloaded"; break;
+ case PRIORITY_STOPPED: result = "stopped"; break;
+ case PRIORITY_HIDDEN: result = "hidden"; break;
+ case PRIORITY_SLIDESHOW: result = "slideshow"; break;
+ case PRIORITY_LOW: result = "low"; break;
+ case PRIORITY_NORMAL: result = "normal"; break;
+ case PRIORITY_HIGH: result = "high"; break;
+ }
+
+ return result;
+}
+
+void LLPluginClassMedia::setPriority(EPriority priority)
+{
+ if(mPriority != priority)
+ {
+ mPriority = priority;
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_priority");
+
+ std::string priority_string = priorityToString(priority);
+ switch(priority)
+ {
+ case PRIORITY_UNLOADED:
+ mSleepTime = 1.0f;
+ break;
+ case PRIORITY_STOPPED:
+ mSleepTime = 1.0f;
+ break;
+ case PRIORITY_HIDDEN:
+ mSleepTime = 1.0f;
+ break;
+ case PRIORITY_SLIDESHOW:
+ mSleepTime = 1.0f;
+ break;
+ case PRIORITY_LOW:
+ mSleepTime = 1.0f / 25.0f;
+ break;
+ case PRIORITY_NORMAL:
+ mSleepTime = 1.0f / 50.0f;
+ break;
+ case PRIORITY_HIGH:
+ mSleepTime = 1.0f / 100.0f;
+ break;
+ }
+
+ message.setValue("priority", priority_string);
+
+ sendMessage(message);
+
+ if(mPlugin)
+ {
+ mPlugin->setSleepTime(mSleepTime);
+ }
+
+ LL_DEBUGS("PluginPriority") << this << ": setting priority to " << priority_string << LL_ENDL;
+
+ // This may affect the calculated size, so recalculate it here.
+ setSizeInternal();
+ }
+}
+
+void LLPluginClassMedia::setLowPrioritySizeLimit(int size)
+{
+ int power = nextPowerOf2(size);
+ if(mLowPrioritySizeLimit != power)
+ {
+ mLowPrioritySizeLimit = power;
+
+ // This may affect the calculated size, so recalculate it here.
+ setSizeInternal();
+ }
+}
+
+F64 LLPluginClassMedia::getCPUUsage()
+{
+ F64 result = 0.0f;
+
+ if(mPlugin)
+ {
+ result = mPlugin->getCPUUsage();
+ }
+
+ return result;
+}
+
+void LLPluginClassMedia::sendPickFileResponse(const std::string &file)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response");
+ message.setValue("file", file);
+ if(mPlugin && mPlugin->isBlocked())
+ {
+ // If the plugin sent a blocking pick-file request, the response should unblock it.
+ message.setValueBoolean("blocking_response", true);
+ }
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, const std::string &password)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_response");
+ message.setValueBoolean("ok", ok);
+ message.setValue("username", username);
+ message.setValue("password", password);
+ if(mPlugin && mPlugin->isBlocked())
+ {
+ // If the plugin sent a blocking pick-file request, the response should unblock it.
+ message.setValueBoolean("blocking_response", true);
+ }
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::cut()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_cut");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::copy()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_copy");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::paste()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_paste");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path");
+ message.setValue("path", user_data_path);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setLanguageCode(const std::string &language_code)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_language_code");
+ message.setValue("language", language_code);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setPluginsEnabled(const bool enabled)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "plugins_enabled");
+ message.setValueBoolean("enable", enabled);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setJavascriptEnabled(const bool enabled)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "javascript_enabled");
+ message.setValueBoolean("enable", enabled);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setTarget(const std::string &target)
+{
+ mTarget = target;
+}
+
+/* virtual */
+void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message)
+{
+ std::string message_class = message.getClass();
+
+ if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
+ {
+ std::string message_name = message.getName();
+ if(message_name == "texture_params")
+ {
+ mRequestedTextureDepth = message.getValueS32("depth");
+ mRequestedTextureInternalFormat = message.getValueU32("internalformat");
+ mRequestedTextureFormat = message.getValueU32("format");
+ mRequestedTextureType = message.getValueU32("type");
+ mRequestedTextureSwapBytes = message.getValueBoolean("swap_bytes");
+ mRequestedTextureCoordsOpenGL = message.getValueBoolean("coords_opengl");
+
+ // These two are optional, and will default to 0 if they're not specified.
+ mDefaultMediaWidth = message.getValueS32("default_width");
+ mDefaultMediaHeight = message.getValueS32("default_height");
+
+ mAllowDownsample = message.getValueBoolean("allow_downsample");
+ mPadding = message.getValueS32("padding");
+
+ setSizeInternal();
+
+ mTextureParamsReceived = true;
+ }
+ else if(message_name == "updated")
+ {
+ if(message.hasValue("left"))
+ {
+ LLRect newDirtyRect;
+ newDirtyRect.mLeft = message.getValueS32("left");
+ newDirtyRect.mTop = message.getValueS32("top");
+ newDirtyRect.mRight = message.getValueS32("right");
+ newDirtyRect.mBottom = message.getValueS32("bottom");
+
+ // The plugin is likely to have top and bottom switched, due to vertical flip and OpenGL coordinate confusion.
+ // If they're backwards, swap them.
+ if(newDirtyRect.mTop < newDirtyRect.mBottom)
+ {
+ S32 temp = newDirtyRect.mTop;
+ newDirtyRect.mTop = newDirtyRect.mBottom;
+ newDirtyRect.mBottom = temp;
+ }
+
+ if(mDirtyRect.isEmpty())
+ {
+ mDirtyRect = newDirtyRect;
+ }
+ else
+ {
+ mDirtyRect.unionWith(newDirtyRect);
+ }
+
+ LL_DEBUGS("Plugin") << "adjusted incoming rect is: ("
+ << newDirtyRect.mLeft << ", "
+ << newDirtyRect.mTop << ", "
+ << newDirtyRect.mRight << ", "
+ << newDirtyRect.mBottom << "), new dirty rect is: ("
+ << mDirtyRect.mLeft << ", "
+ << mDirtyRect.mTop << ", "
+ << mDirtyRect.mRight << ", "
+ << mDirtyRect.mBottom << ")"
+ << LL_ENDL;
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CONTENT_UPDATED);
+ }
+
+
+ bool time_duration_updated = false;
+ int previous_percent = mProgressPercent;
+
+ if(message.hasValue("current_time"))
+ {
+ mCurrentTime = message.getValueReal("current_time");
+ time_duration_updated = true;
+ }
+ if(message.hasValue("duration"))
+ {
+ mDuration = message.getValueReal("duration");
+ time_duration_updated = true;
+ }
+
+ if(message.hasValue("current_rate"))
+ {
+ mCurrentRate = message.getValueReal("current_rate");
+ }
+
+ if(message.hasValue("loaded_duration"))
+ {
+ mLoadedDuration = message.getValueReal("loaded_duration");
+ time_duration_updated = true;
+ }
+ else
+ {
+ // If the message doesn't contain a loaded_duration param, assume it's equal to duration
+ mLoadedDuration = mDuration;
+ }
+
+ // Calculate a percentage based on the loaded duration and total duration.
+ if(mDuration != 0.0f) // Don't divide by zero.
+ {
+ mProgressPercent = (int)((mLoadedDuration * 100.0f)/mDuration);
+ }
+
+ if(time_duration_updated)
+ {
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_TIME_DURATION_UPDATED);
+ }
+
+ if(previous_percent != mProgressPercent)
+ {
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED);
+ }
+ }
+ else if(message_name == "media_status")
+ {
+ std::string status = message.getValue("status");
+
+ LL_DEBUGS("Plugin") << "Status changed to: " << status << LL_ENDL;
+
+ if(status == "loading")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_LOADING;
+ }
+ else if(status == "loaded")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_LOADED;
+ }
+ else if(status == "error")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_ERROR;
+ }
+ else if(status == "playing")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_PLAYING;
+ }
+ else if(status == "paused")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_PAUSED;
+ }
+ else if(status == "done")
+ {
+ mStatus = LLPluginClassMediaOwner::MEDIA_DONE;
+ }
+ else
+ {
+ // empty string or any unknown string
+ mStatus = LLPluginClassMediaOwner::MEDIA_NONE;
+ }
+ }
+ else if(message_name == "size_change_request")
+ {
+ S32 width = message.getValueS32("width");
+ S32 height = message.getValueS32("height");
+ std::string name = message.getValue("name");
+
+ // TODO: check that name matches?
+ mNaturalMediaWidth = width;
+ mNaturalMediaHeight = height;
+
+ setSizeInternal();
+ }
+ else if(message_name == "size_change_response")
+ {
+ std::string name = message.getValue("name");
+
+ // TODO: check that name matches?
+
+ mTextureWidth = message.getValueS32("texture_width");
+ mTextureHeight = message.getValueS32("texture_height");
+ mMediaWidth = message.getValueS32("width");
+ mMediaHeight = message.getValueS32("height");
+
+ // This invalidates any existing dirty rect.
+ resetDirty();
+
+ // TODO: should we verify that the plugin sent back the right values?
+ // Two size changes in a row may cause them to not match, due to queueing, etc.
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_SIZE_CHANGED);
+ }
+ else if(message_name == "cursor_changed")
+ {
+ mCursorName = message.getValue("name");
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CURSOR_CHANGED);
+ }
+ else if(message_name == "edit_state")
+ {
+ if(message.hasValue("cut"))
+ {
+ mCanCut = message.getValueBoolean("cut");
+ }
+ if(message.hasValue("copy"))
+ {
+ mCanCopy = message.getValueBoolean("copy");
+ }
+ if(message.hasValue("paste"))
+ {
+ mCanPaste = message.getValueBoolean("paste");
+ }
+ }
+ else if(message_name == "name_text")
+ {
+ mMediaName = message.getValue("name");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAME_CHANGED);
+ }
+ else if(message_name == "pick_file")
+ {
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PICK_FILE_REQUEST);
+ }
+ else if(message_name == "auth_request")
+ {
+ mAuthURL = message.getValue("url");
+ mAuthRealm = message.getValue("realm");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST);
+ }
+ else
+ {
+ LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
+ }
+ }
+ else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
+ {
+ std::string message_name = message.getName();
+ if(message_name == "navigate_begin")
+ {
+ mNavigateURI = message.getValue("uri");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_BEGIN);
+ }
+ else if(message_name == "navigate_complete")
+ {
+ mNavigateURI = message.getValue("uri");
+ mNavigateResultCode = message.getValueS32("result_code");
+ mNavigateResultString = message.getValue("result_string");
+ mHistoryBackAvailable = message.getValueBoolean("history_back_available");
+ mHistoryForwardAvailable = message.getValueBoolean("history_forward_available");
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE);
+ }
+ else if(message_name == "progress")
+ {
+ mProgressPercent = message.getValueS32("percent");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PROGRESS_UPDATED);
+ }
+ else if(message_name == "status_text")
+ {
+ mStatusText = message.getValue("status");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_STATUS_TEXT_CHANGED);
+ }
+ else if(message_name == "location_changed")
+ {
+ mLocation = message.getValue("uri");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LOCATION_CHANGED);
+ }
+ else if(message_name == "click_href")
+ {
+ mClickURL = message.getValue("uri");
+ mClickTarget = message.getValue("target");
+ mClickUUID = message.getValue("uuid");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_HREF);
+ }
+ else if(message_name == "click_nofollow")
+ {
+ mClickURL = message.getValue("uri");
+ mClickNavType = message.getValue("nav_type");
+ mClickTarget.clear();
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLICK_LINK_NOFOLLOW);
+ }
+ else if(message_name == "navigate_error_page")
+ {
+ mStatusCode = message.getValueS32("status_code");
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_ERROR_PAGE);
+ }
+ else if(message_name == "cookie_set")
+ {
+ if(mOwner)
+ {
+ mOwner->handleCookieSet(this, message.getValue("cookie"));
+ }
+ }
+ else if(message_name == "close_request")
+ {
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_CLOSE_REQUEST);
+ }
+ else if(message_name == "geometry_change")
+ {
+ mClickUUID = message.getValue("uuid");
+ mGeometryX = message.getValueS32("x");
+ mGeometryY = message.getValueS32("y");
+ mGeometryWidth = message.getValueS32("width");
+ mGeometryHeight = message.getValueS32("height");
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE);
+ }
+ else if(message_name == "link_hovered")
+ {
+ // text is not currently used -- the tooltip hover text is taken from the "title".
+ mHoverLink = message.getValue("link");
+ mHoverText = message.getValue("title");
+ // message.getValue("text");
+
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LINK_HOVERED);
+ }
+ else
+ {
+ LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
+ }
+ }
+ else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME)
+ {
+ std::string message_name = message.getName();
+
+ // This class hasn't defined any incoming messages yet.
+// if(message_name == "message_name")
+// {
+// }
+// else
+ {
+ LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL;
+ }
+ }
+
+}
+
+/* virtual */
+void LLPluginClassMedia::pluginLaunchFailed()
+{
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED_LAUNCH);
+}
+
+/* virtual */
+void LLPluginClassMedia::pluginDied()
+{
+ mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED);
+}
+
+void LLPluginClassMedia::mediaEvent(LLPluginClassMediaOwner::EMediaEvent event)
+{
+ if(mOwner)
+ {
+ mOwner->handleMediaEvent(this, event);
+ }
+}
+
+void LLPluginClassMedia::sendMessage(const LLPluginMessage &message)
+{
+ if(mPlugin && mPlugin->isRunning())
+ {
+ mPlugin->sendMessage(message);
+ }
+ else
+ {
+ // The plugin isn't set up yet -- queue this message to be sent after initialization.
+ mSendQueue.push(message);
+ }
+}
+
+////////////////////////////////////////////////////////////
+// MARK: media_browser class functions
+bool LLPluginClassMedia::pluginSupportsMediaBrowser(void)
+{
+ std::string version = mPlugin->getMessageClassVersion(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER);
+ return !version.empty();
+}
+
+void LLPluginClassMedia::focus(bool focused)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "focus");
+
+ message.setValueBoolean("focused", focused);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::clear_cache()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cache");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::clear_cookies()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "clear_cookies");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::set_cookies(const std::string &cookies)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_cookies");
+ message.setValue("cookies", cookies);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::enable_cookies(bool enable)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "enable_cookies");
+ message.setValueBoolean("enable", enable);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::proxy_setup(bool enable, const std::string &host, int port)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_setup");
+
+ message.setValueBoolean("enable", enable);
+ message.setValue("host", host);
+ message.setValueS32("port", port);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::browse_stop()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_stop");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::browse_reload(bool ignore_cache)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_reload");
+
+ message.setValueBoolean("ignore_cache", ignore_cache);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::browse_forward()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_forward");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::browse_back()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "browse_back");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setBrowserUserAgent(const std::string& user_agent)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_user_agent");
+
+ message.setValue("user_agent", user_agent);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::proxyWindowOpened(const std::string &target, const std::string &uuid)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_opened");
+
+ message.setValue("target", target);
+ message.setValue("uuid", uuid);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::proxyWindowClosed(const std::string &uuid)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "proxy_window_closed");
+
+ message.setValue("uuid", uuid);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::ignore_ssl_cert_errors(bool ignore)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "ignore_ssl_cert_errors");
+ message.setValueBoolean("ignore", ignore);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::addCertificateFilePath(const std::string& path)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "add_certificate_file_path");
+ message.setValue("path", path);
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::crashPlugin()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "crash");
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::hangPlugin()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "hang");
+
+ sendMessage(message);
+}
+
+
+////////////////////////////////////////////////////////////
+// MARK: media_time class functions
+bool LLPluginClassMedia::pluginSupportsMediaTime(void)
+{
+ std::string version = mPlugin->getMessageClassVersion(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME);
+ return !version.empty();
+}
+
+void LLPluginClassMedia::stop()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "stop");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::start(float rate)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "start");
+
+ message.setValueReal("rate", rate);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::pause()
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "pause");
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::seek(float time)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "seek");
+
+ message.setValueReal("time", time);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setLoop(bool loop)
+{
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "set_loop");
+
+ message.setValueBoolean("loop", loop);
+
+ sendMessage(message);
+}
+
+void LLPluginClassMedia::setVolume(float volume)
+{
+ if(volume != mRequestedVolume)
+ {
+ mRequestedVolume = volume;
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME, "set_volume");
+
+ message.setValueReal("volume", volume);
+
+ sendMessage(message);
+ }
+}
+
+float LLPluginClassMedia::getVolume()
+{
+ return mRequestedVolume;
+}
+
+void LLPluginClassMedia::initializeUrlHistory(const LLSD& url_history)
+{
+ // Send URL history to plugin
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "init_history");
+ message.setValueLLSD("history", url_history);
+ sendMessage(message);
+
+ LL_DEBUGS("Plugin") << "Sending history" << LL_ENDL;
+}
+
diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index fea836aa68..f8ed89f644 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -1,426 +1,425 @@ -/** - * @file llpluginclassmedia.h - * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class. - * - * @cond - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - * @endcond - */ - -#ifndef LL_LLPLUGINCLASSMEDIA_H -#define LL_LLPLUGINCLASSMEDIA_H - -#include "llgltypes.h" -#include "llpluginprocessparent.h" -#include "llrect.h" -#include "llpluginclassmediaowner.h" -#include <queue> -#include "v4color.h" - -class LLPluginClassMedia : public LLPluginProcessParentOwner -{ - LOG_CLASS(LLPluginClassMedia); -public: - LLPluginClassMedia(LLPluginClassMediaOwner *owner); - virtual ~LLPluginClassMedia(); - - // local initialization, called by the media manager when creating a source - virtual bool init(const std::string &launcher_filename, - const std::string &plugin_dir, - const std::string &plugin_filename, - bool debug); - - // undoes everything init() didm called by the media manager when destroying a source - virtual void reset(); - - void idle(void); - - // All of these may return 0 or an actual valid value. - // Callers need to check the return for 0, and not use the values in that case. - int getWidth() const { return (mMediaWidth > 0) ? mMediaWidth : 0; }; - int getHeight() const { return (mMediaHeight > 0) ? mMediaHeight : 0; }; - int getNaturalWidth() const { return mNaturalMediaWidth; }; - int getNaturalHeight() const { return mNaturalMediaHeight; }; - int getSetWidth() const { return mSetMediaWidth; }; - int getSetHeight() const { return mSetMediaHeight; }; - int getBitsWidth() const { return (mTextureWidth > 0) ? mTextureWidth : 0; }; - int getBitsHeight() const { return (mTextureHeight > 0) ? mTextureHeight : 0; }; - int getTextureWidth() const; - int getTextureHeight() const; - int getFullWidth() const { return mFullMediaWidth; }; - int getFullHeight() const { return mFullMediaHeight; }; - - // This may return NULL. Callers need to check for and handle this case. - unsigned char* getBitsData(); - - // gets the format details of the texture data - // These may return 0 if they haven't been set up yet. The caller needs to detect this case. - int getTextureDepth() const { return mRequestedTextureDepth; }; - int getTextureFormatInternal() const { return mRequestedTextureInternalFormat; }; - int getTextureFormatPrimary() const { return mRequestedTextureFormat; }; - int getTextureFormatType() const { return mRequestedTextureType; }; - bool getTextureFormatSwapBytes() const { return mRequestedTextureSwapBytes; }; - bool getTextureCoordsOpenGL() const { return mRequestedTextureCoordsOpenGL; }; - - void setSize(int width, int height); - void setAutoScale(bool auto_scale); - - void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; }; - - void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; }; - - // Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent. - // This will initially be false, and will also be false for some time after setSize while the resize is processed. - // Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values - // until you call idle() again. - bool textureValid(void); - - bool getDirty(LLRect *dirty_rect = NULL); - void resetDirty(void); - - typedef enum - { - MOUSE_EVENT_DOWN, - MOUSE_EVENT_UP, - MOUSE_EVENT_MOVE, - MOUSE_EVENT_DOUBLE_CLICK - }EMouseEventType; - - void mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers); - - typedef enum - { - KEY_EVENT_DOWN, - KEY_EVENT_UP, - KEY_EVENT_REPEAT - }EKeyEventType; - - bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data); - - void scrollEvent(int x, int y, MASK modifiers); - - // Javascript <-> viewer events - void jsExposeObjectEvent( bool expose ); - void jsValuesValidEvent( bool valid ); - void jsAgentLocationEvent( double x, double y, double z ); - void jsAgentGlobalLocationEvent( double x, double y, double z ); - void jsAgentOrientationEvent( double angle ); - void jsAgentLanguageEvent( const std::string& language ); - void jsAgentRegionEvent( const std::string& region_name ); - void jsAgentMaturityEvent( const std::string& maturity ); - - // Text may be unicode (utf8 encoded) - bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data); - - void loadURI(const std::string &uri); - - // "Loading" means uninitialized or any state prior to fully running (processing commands) - bool isPluginLoading(void) { return mPlugin?mPlugin->isLoading():false; }; - - // "Running" means the steady state -- i.e. processing messages - bool isPluginRunning(void) { return mPlugin?mPlugin->isRunning():false; }; - - // "Exited" means any regular or error state after "Running" (plugin may have crashed or exited normally) - bool isPluginExited(void) { return mPlugin?mPlugin->isDone():false; }; - - std::string getPluginVersion() { return mPlugin?mPlugin->getPluginVersion():std::string(""); }; - - bool getDisableTimeout() { return mPlugin?mPlugin->getDisableTimeout():false; }; - void setDisableTimeout(bool disable) { if(mPlugin) mPlugin->setDisableTimeout(disable); }; - - // Inherited from LLPluginProcessParentOwner - /* virtual */ void receivePluginMessage(const LLPluginMessage &message); - /* virtual */ void pluginLaunchFailed(); - /* virtual */ void pluginDied(); - - - typedef enum - { - PRIORITY_UNLOADED, // media plugin isn't even loaded. - PRIORITY_STOPPED, // media is not playing, shouldn't need to update at all. - PRIORITY_HIDDEN, // media is not being displayed or is out of view, don't need to do graphic updates, but may still update audio, playhead, etc. - PRIORITY_SLIDESHOW, // media is in the far distance, updates very infrequently - PRIORITY_LOW, // media is in the distance, may be rendered at reduced size - PRIORITY_NORMAL, // normal (default) priority - PRIORITY_HIGH // media has user focus and/or is taking up most of the screen - }EPriority; - - static const char* priorityToString(EPriority priority); - void setPriority(EPriority priority); - void setLowPrioritySizeLimit(int size); - - F64 getCPUUsage(); - - void sendPickFileResponse(const std::string &file); - - void sendAuthResponse(bool ok, const std::string &username, const std::string &password); - - // Valid after a MEDIA_EVENT_CURSOR_CHANGED event - std::string getCursorName() const { return mCursorName; }; - - LLPluginClassMediaOwner::EMediaStatus getStatus() const { return mStatus; } - - void cut(); - bool canCut() const { return mCanCut; }; - - void copy(); - bool canCopy() const { return mCanCopy; }; - - void paste(); - bool canPaste() const { return mCanPaste; }; - - // These can be called before init(), and they will be queued and sent before the media init message. - void setUserDataPath(const std::string &user_data_path); - void setLanguageCode(const std::string &language_code); - void setPluginsEnabled(const bool enabled); - void setJavascriptEnabled(const bool enabled); - void setTarget(const std::string &target); - - /////////////////////////////////// - // media browser class functions - bool pluginSupportsMediaBrowser(void); - - void focus(bool focused); - void clear_cache(); - void clear_cookies(); - void set_cookies(const std::string &cookies); - void enable_cookies(bool enable); - void proxy_setup(bool enable, const std::string &host = LLStringUtil::null, int port = 0); - void browse_stop(); - void browse_reload(bool ignore_cache = false); - void browse_forward(); - void browse_back(); - void setBrowserUserAgent(const std::string& user_agent); - void proxyWindowOpened(const std::string &target, const std::string &uuid); - void proxyWindowClosed(const std::string &uuid); - void ignore_ssl_cert_errors(bool ignore); - void addCertificateFilePath(const std::string& path); - - // This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE - std::string getNavigateURI() const { return mNavigateURI; }; - - // These are valid after MEDIA_EVENT_NAVIGATE_COMPLETE - S32 getNavigateResultCode() const { return mNavigateResultCode; }; - std::string getNavigateResultString() const { return mNavigateResultString; }; - bool getHistoryBackAvailable() const { return mHistoryBackAvailable; }; - bool getHistoryForwardAvailable() const { return mHistoryForwardAvailable; }; - - // This is valid after MEDIA_EVENT_PROGRESS_UPDATED - int getProgressPercent() const { return mProgressPercent; }; - - // This is valid after MEDIA_EVENT_STATUS_TEXT_CHANGED - std::string getStatusText() const { return mStatusText; }; - - // This is valid after MEDIA_EVENT_LOCATION_CHANGED - std::string getLocation() const { return mLocation; }; - - // This is valid after MEDIA_EVENT_CLICK_LINK_HREF or MEDIA_EVENT_CLICK_LINK_NOFOLLOW - std::string getClickURL() const { return mClickURL; }; - - // This is valid after MEDIA_EVENT_CLICK_LINK_NOFOLLOW - std::string getClickNavType() const { return mClickNavType; }; - - // This is valid after MEDIA_EVENT_CLICK_LINK_HREF - std::string getClickTarget() const { return mClickTarget; }; - - // This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE - std::string getClickUUID() const { return mClickUUID; }; - - // This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE - S32 getStatusCode() const { return mStatusCode; }; - - // These are valid during MEDIA_EVENT_GEOMETRY_CHANGE - S32 getGeometryX() const { return mGeometryX; }; - S32 getGeometryY() const { return mGeometryY; }; - S32 getGeometryWidth() const { return mGeometryWidth; }; - S32 getGeometryHeight() const { return mGeometryHeight; }; - - // These are valid during MEDIA_EVENT_AUTH_REQUEST - std::string getAuthURL() const { return mAuthURL; }; - std::string getAuthRealm() const { return mAuthRealm; }; - - // These are valid during MEDIA_EVENT_LINK_HOVERED - std::string getHoverText() const { return mHoverText; }; - std::string getHoverLink() const { return mHoverLink; }; - - std::string getMediaName() const { return mMediaName; }; - std::string getMediaDescription() const { return mMediaDescription; }; - - // Crash the plugin. If you use this outside of a testbed, you will be punished. - void crashPlugin(); - - // Hang the plugin. If you use this outside of a testbed, you will be punished. - void hangPlugin(); - - /////////////////////////////////// - // media time class functions - bool pluginSupportsMediaTime(void); - void stop(); - void start(float rate = 0.0f); - void pause(); - void seek(float time); - void setLoop(bool loop); - void setVolume(float volume); - float getVolume(); - - F64 getCurrentTime(void) const { return mCurrentTime; }; - F64 getDuration(void) const { return mDuration; }; - F64 getCurrentPlayRate(void) { return mCurrentRate; }; - F64 getLoadedDuration(void) const { return mLoadedDuration; }; - - // Initialize the URL history of the plugin by sending - // "init_history" message - void initializeUrlHistory(const LLSD& url_history); - -protected: - - LLPluginClassMediaOwner *mOwner; - - // Notify this object's owner that an event has occurred. - void mediaEvent(LLPluginClassMediaOwner::EMediaEvent event); - - void sendMessage(const LLPluginMessage &message); // Send message internally, either queueing or sending directly. - std::queue<LLPluginMessage> mSendQueue; // Used to queue messages while the plugin initializes. - - void setSizeInternal(void); - - bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true - S32 mRequestedTextureDepth; - LLGLenum mRequestedTextureInternalFormat; - LLGLenum mRequestedTextureFormat; - LLGLenum mRequestedTextureType; - bool mRequestedTextureSwapBytes; - bool mRequestedTextureCoordsOpenGL; - - std::string mTextureSharedMemoryName; - size_t mTextureSharedMemorySize; - - // True to scale requested media up to the full size of the texture (i.e. next power of two) - bool mAutoScaleMedia; - - // default media size for the plugin, from the texture_params message. - int mDefaultMediaWidth; - int mDefaultMediaHeight; - - // Size that has been requested by the plugin itself - int mNaturalMediaWidth; - int mNaturalMediaHeight; - - // Size that has been requested with setSize() - int mSetMediaWidth; - int mSetMediaHeight; - - // Full calculated media size (before auto-scale and downsample calculations) - int mFullMediaWidth; - int mFullMediaHeight; - - // Actual media size being set (after auto-scale) - int mRequestedMediaWidth; - int mRequestedMediaHeight; - - // Texture size calculated from actual media size - int mRequestedTextureWidth; - int mRequestedTextureHeight; - - // Size that the plugin has acknowledged - int mTextureWidth; - int mTextureHeight; - int mMediaWidth; - int mMediaHeight; - - float mRequestedVolume; - - // Priority of this media stream - EPriority mPriority; - int mLowPrioritySizeLimit; - - bool mAllowDownsample; - int mPadding; - - - LLPluginProcessParent *mPlugin; - - LLRect mDirtyRect; - - std::string translateModifiers(MASK modifiers); - - std::string mCursorName; - int mLastMouseX; - int mLastMouseY; - - LLPluginClassMediaOwner::EMediaStatus mStatus; - - F64 mSleepTime; - - bool mCanCut; - bool mCanCopy; - bool mCanPaste; - - std::string mMediaName; - std::string mMediaDescription; - - LLColor4 mBackgroundColor; - - std::string mTarget; - - ///////////////////////////////////////// - // media_browser class - std::string mNavigateURI; - S32 mNavigateResultCode; - std::string mNavigateResultString; - bool mHistoryBackAvailable; - bool mHistoryForwardAvailable; - std::string mStatusText; - int mProgressPercent; - std::string mLocation; - std::string mClickURL; - std::string mClickNavType; - std::string mClickTarget; - std::string mClickUUID; - S32 mGeometryX; - S32 mGeometryY; - S32 mGeometryWidth; - S32 mGeometryHeight; - S32 mStatusCode; - std::string mAuthURL; - std::string mAuthRealm; - std::string mHoverText; - std::string mHoverLink; - - ///////////////////////////////////////// - // media_time class - F64 mCurrentTime; - F64 mDuration; - F64 mCurrentRate; - F64 mLoadedDuration; - -//-------------------------------------- - //debug use only - // -private: - bool mDeleteOK ; -public: - void setDeleteOK(bool flag) { mDeleteOK = flag ;} -//-------------------------------------- -}; - -#endif // LL_LLPLUGINCLASSMEDIA_H +/**
+ * @file llpluginclassmedia.h
+ * @brief LLPluginClassMedia handles interaction with a plugin which knows about the "media" message class.
+ *
+ * @cond
+ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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$
+ * @endcond
+ */
+
+#ifndef LL_LLPLUGINCLASSMEDIA_H
+#define LL_LLPLUGINCLASSMEDIA_H
+
+#include "llgltypes.h"
+#include "llpluginprocessparent.h"
+#include "llrect.h"
+#include "llpluginclassmediaowner.h"
+#include <queue>
+#include "v4color.h"
+
+class LLPluginClassMedia : public LLPluginProcessParentOwner
+{
+ LOG_CLASS(LLPluginClassMedia);
+public:
+ LLPluginClassMedia(LLPluginClassMediaOwner *owner);
+ virtual ~LLPluginClassMedia();
+
+ // local initialization, called by the media manager when creating a source
+ virtual bool init(const std::string &launcher_filename,
+ const std::string &plugin_dir,
+ const std::string &plugin_filename,
+ bool debug);
+
+ // undoes everything init() didm called by the media manager when destroying a source
+ virtual void reset();
+
+ void idle(void);
+
+ // All of these may return 0 or an actual valid value.
+ // Callers need to check the return for 0, and not use the values in that case.
+ int getWidth() const { return (mMediaWidth > 0) ? mMediaWidth : 0; };
+ int getHeight() const { return (mMediaHeight > 0) ? mMediaHeight : 0; };
+ int getNaturalWidth() const { return mNaturalMediaWidth; };
+ int getNaturalHeight() const { return mNaturalMediaHeight; };
+ int getSetWidth() const { return mSetMediaWidth; };
+ int getSetHeight() const { return mSetMediaHeight; };
+ int getBitsWidth() const { return (mTextureWidth > 0) ? mTextureWidth : 0; };
+ int getBitsHeight() const { return (mTextureHeight > 0) ? mTextureHeight : 0; };
+ int getTextureWidth() const;
+ int getTextureHeight() const;
+ int getFullWidth() const { return mFullMediaWidth; };
+ int getFullHeight() const { return mFullMediaHeight; };
+
+ // This may return NULL. Callers need to check for and handle this case.
+ unsigned char* getBitsData();
+
+ // gets the format details of the texture data
+ // These may return 0 if they haven't been set up yet. The caller needs to detect this case.
+ int getTextureDepth() const { return mRequestedTextureDepth; };
+ int getTextureFormatInternal() const { return mRequestedTextureInternalFormat; };
+ int getTextureFormatPrimary() const { return mRequestedTextureFormat; };
+ int getTextureFormatType() const { return mRequestedTextureType; };
+ bool getTextureFormatSwapBytes() const { return mRequestedTextureSwapBytes; };
+ bool getTextureCoordsOpenGL() const { return mRequestedTextureCoordsOpenGL; };
+
+ void setSize(int width, int height);
+ void setAutoScale(bool auto_scale);
+
+ void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
+
+ void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
+
+ // Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent.
+ // This will initially be false, and will also be false for some time after setSize while the resize is processed.
+ // Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values
+ // until you call idle() again.
+ bool textureValid(void);
+
+ bool getDirty(LLRect *dirty_rect = NULL);
+ void resetDirty(void);
+
+ typedef enum
+ {
+ MOUSE_EVENT_DOWN,
+ MOUSE_EVENT_UP,
+ MOUSE_EVENT_MOVE,
+ MOUSE_EVENT_DOUBLE_CLICK
+ }EMouseEventType;
+
+ void mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers);
+
+ typedef enum
+ {
+ KEY_EVENT_DOWN,
+ KEY_EVENT_UP,
+ KEY_EVENT_REPEAT
+ }EKeyEventType;
+
+ bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
+
+ void scrollEvent(int x, int y, MASK modifiers);
+
+ // Javascript <-> viewer events
+ void jsEnableObject( bool enable );
+ void jsAgentLocationEvent( double x, double y, double z );
+ void jsAgentGlobalLocationEvent( double x, double y, double z );
+ void jsAgentOrientationEvent( double angle );
+ void jsAgentLanguageEvent( const std::string& language );
+ void jsAgentRegionEvent( const std::string& region_name );
+ void jsAgentMaturityEvent( const std::string& maturity );
+
+ // Text may be unicode (utf8 encoded)
+ bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data);
+
+ void loadURI(const std::string &uri);
+
+ // "Loading" means uninitialized or any state prior to fully running (processing commands)
+ bool isPluginLoading(void) { return mPlugin?mPlugin->isLoading():false; };
+
+ // "Running" means the steady state -- i.e. processing messages
+ bool isPluginRunning(void) { return mPlugin?mPlugin->isRunning():false; };
+
+ // "Exited" means any regular or error state after "Running" (plugin may have crashed or exited normally)
+ bool isPluginExited(void) { return mPlugin?mPlugin->isDone():false; };
+
+ std::string getPluginVersion() { return mPlugin?mPlugin->getPluginVersion():std::string(""); };
+
+ bool getDisableTimeout() { return mPlugin?mPlugin->getDisableTimeout():false; };
+ void setDisableTimeout(bool disable) { if(mPlugin) mPlugin->setDisableTimeout(disable); };
+
+ // Inherited from LLPluginProcessParentOwner
+ /* virtual */ void receivePluginMessage(const LLPluginMessage &message);
+ /* virtual */ void pluginLaunchFailed();
+ /* virtual */ void pluginDied();
+
+
+ typedef enum
+ {
+ PRIORITY_UNLOADED, // media plugin isn't even loaded.
+ PRIORITY_STOPPED, // media is not playing, shouldn't need to update at all.
+ PRIORITY_HIDDEN, // media is not being displayed or is out of view, don't need to do graphic updates, but may still update audio, playhead, etc.
+ PRIORITY_SLIDESHOW, // media is in the far distance, updates very infrequently
+ PRIORITY_LOW, // media is in the distance, may be rendered at reduced size
+ PRIORITY_NORMAL, // normal (default) priority
+ PRIORITY_HIGH // media has user focus and/or is taking up most of the screen
+ }EPriority;
+
+ static const char* priorityToString(EPriority priority);
+ void setPriority(EPriority priority);
+ void setLowPrioritySizeLimit(int size);
+
+ F64 getCPUUsage();
+
+ void sendPickFileResponse(const std::string &file);
+
+ void sendAuthResponse(bool ok, const std::string &username, const std::string &password);
+
+ // Valid after a MEDIA_EVENT_CURSOR_CHANGED event
+ std::string getCursorName() const { return mCursorName; };
+
+ LLPluginClassMediaOwner::EMediaStatus getStatus() const { return mStatus; }
+
+ void cut();
+ bool canCut() const { return mCanCut; };
+
+ void copy();
+ bool canCopy() const { return mCanCopy; };
+
+ void paste();
+ bool canPaste() const { return mCanPaste; };
+
+ // These can be called before init(), and they will be queued and sent before the media init message.
+ void setUserDataPath(const std::string &user_data_path);
+ void setLanguageCode(const std::string &language_code);
+ void setPluginsEnabled(const bool enabled);
+ void setJavascriptEnabled(const bool enabled);
+ void setTarget(const std::string &target);
+
+ ///////////////////////////////////
+ // media browser class functions
+ bool pluginSupportsMediaBrowser(void);
+
+ void focus(bool focused);
+ void clear_cache();
+ void clear_cookies();
+ void set_cookies(const std::string &cookies);
+ void enable_cookies(bool enable);
+ void proxy_setup(bool enable, const std::string &host = LLStringUtil::null, int port = 0);
+ void browse_stop();
+ void browse_reload(bool ignore_cache = false);
+ void browse_forward();
+ void browse_back();
+ void setBrowserUserAgent(const std::string& user_agent);
+ void proxyWindowOpened(const std::string &target, const std::string &uuid);
+ void proxyWindowClosed(const std::string &uuid);
+ void ignore_ssl_cert_errors(bool ignore);
+ void addCertificateFilePath(const std::string& path);
+
+ // This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE
+ std::string getNavigateURI() const { return mNavigateURI; };
+
+ // These are valid after MEDIA_EVENT_NAVIGATE_COMPLETE
+ S32 getNavigateResultCode() const { return mNavigateResultCode; };
+ std::string getNavigateResultString() const { return mNavigateResultString; };
+ bool getHistoryBackAvailable() const { return mHistoryBackAvailable; };
+ bool getHistoryForwardAvailable() const { return mHistoryForwardAvailable; };
+
+ // This is valid after MEDIA_EVENT_PROGRESS_UPDATED
+ int getProgressPercent() const { return mProgressPercent; };
+
+ // This is valid after MEDIA_EVENT_STATUS_TEXT_CHANGED
+ std::string getStatusText() const { return mStatusText; };
+
+ // This is valid after MEDIA_EVENT_LOCATION_CHANGED
+ std::string getLocation() const { return mLocation; };
+
+ // This is valid after MEDIA_EVENT_CLICK_LINK_HREF or MEDIA_EVENT_CLICK_LINK_NOFOLLOW
+ std::string getClickURL() const { return mClickURL; };
+
+ // This is valid after MEDIA_EVENT_CLICK_LINK_NOFOLLOW
+ std::string getClickNavType() const { return mClickNavType; };
+
+ // This is valid after MEDIA_EVENT_CLICK_LINK_HREF
+ std::string getClickTarget() const { return mClickTarget; };
+
+ // This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE
+ std::string getClickUUID() const { return mClickUUID; };
+
+ // This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE
+ S32 getStatusCode() const { return mStatusCode; };
+
+ // These are valid during MEDIA_EVENT_GEOMETRY_CHANGE
+ S32 getGeometryX() const { return mGeometryX; };
+ S32 getGeometryY() const { return mGeometryY; };
+ S32 getGeometryWidth() const { return mGeometryWidth; };
+ S32 getGeometryHeight() const { return mGeometryHeight; };
+
+ // These are valid during MEDIA_EVENT_AUTH_REQUEST
+ std::string getAuthURL() const { return mAuthURL; };
+ std::string getAuthRealm() const { return mAuthRealm; };
+
+ // These are valid during MEDIA_EVENT_LINK_HOVERED
+ std::string getHoverText() const { return mHoverText; };
+ std::string getHoverLink() const { return mHoverLink; };
+
+ std::string getMediaName() const { return mMediaName; };
+ std::string getMediaDescription() const { return mMediaDescription; };
+
+ // Crash the plugin. If you use this outside of a testbed, you will be punished.
+ void crashPlugin();
+
+ // Hang the plugin. If you use this outside of a testbed, you will be punished.
+ void hangPlugin();
+
+ ///////////////////////////////////
+ // media time class functions
+ bool pluginSupportsMediaTime(void);
+ void stop();
+ void start(float rate = 0.0f);
+ void pause();
+ void seek(float time);
+ void setLoop(bool loop);
+ void setVolume(float volume);
+ float getVolume();
+
+ F64 getCurrentTime(void) const { return mCurrentTime; };
+ F64 getDuration(void) const { return mDuration; };
+ F64 getCurrentPlayRate(void) { return mCurrentRate; };
+ F64 getLoadedDuration(void) const { return mLoadedDuration; };
+
+ // Initialize the URL history of the plugin by sending
+ // "init_history" message
+ void initializeUrlHistory(const LLSD& url_history);
+
+protected:
+
+ LLPluginClassMediaOwner *mOwner;
+
+ // Notify this object's owner that an event has occurred.
+ void mediaEvent(LLPluginClassMediaOwner::EMediaEvent event);
+
+ void sendMessage(const LLPluginMessage &message); // Send message internally, either queueing or sending directly.
+ std::queue<LLPluginMessage> mSendQueue; // Used to queue messages while the plugin initializes.
+
+ void setSizeInternal(void);
+
+ bool mTextureParamsReceived; // the mRequestedTexture* fields are only valid when this is true
+ S32 mRequestedTextureDepth;
+ LLGLenum mRequestedTextureInternalFormat;
+ LLGLenum mRequestedTextureFormat;
+ LLGLenum mRequestedTextureType;
+ bool mRequestedTextureSwapBytes;
+ bool mRequestedTextureCoordsOpenGL;
+
+ std::string mTextureSharedMemoryName;
+ size_t mTextureSharedMemorySize;
+
+ // True to scale requested media up to the full size of the texture (i.e. next power of two)
+ bool mAutoScaleMedia;
+
+ // default media size for the plugin, from the texture_params message.
+ int mDefaultMediaWidth;
+ int mDefaultMediaHeight;
+
+ // Size that has been requested by the plugin itself
+ int mNaturalMediaWidth;
+ int mNaturalMediaHeight;
+
+ // Size that has been requested with setSize()
+ int mSetMediaWidth;
+ int mSetMediaHeight;
+
+ // Full calculated media size (before auto-scale and downsample calculations)
+ int mFullMediaWidth;
+ int mFullMediaHeight;
+
+ // Actual media size being set (after auto-scale)
+ int mRequestedMediaWidth;
+ int mRequestedMediaHeight;
+
+ // Texture size calculated from actual media size
+ int mRequestedTextureWidth;
+ int mRequestedTextureHeight;
+
+ // Size that the plugin has acknowledged
+ int mTextureWidth;
+ int mTextureHeight;
+ int mMediaWidth;
+ int mMediaHeight;
+
+ float mRequestedVolume;
+
+ // Priority of this media stream
+ EPriority mPriority;
+ int mLowPrioritySizeLimit;
+
+ bool mAllowDownsample;
+ int mPadding;
+
+
+ LLPluginProcessParent *mPlugin;
+
+ LLRect mDirtyRect;
+
+ std::string translateModifiers(MASK modifiers);
+
+ std::string mCursorName;
+ int mLastMouseX;
+ int mLastMouseY;
+
+ LLPluginClassMediaOwner::EMediaStatus mStatus;
+
+ F64 mSleepTime;
+
+ bool mCanCut;
+ bool mCanCopy;
+ bool mCanPaste;
+
+ std::string mMediaName;
+ std::string mMediaDescription;
+
+ LLColor4 mBackgroundColor;
+
+ std::string mTarget;
+
+ /////////////////////////////////////////
+ // media_browser class
+ std::string mNavigateURI;
+ S32 mNavigateResultCode;
+ std::string mNavigateResultString;
+ bool mHistoryBackAvailable;
+ bool mHistoryForwardAvailable;
+ std::string mStatusText;
+ int mProgressPercent;
+ std::string mLocation;
+ std::string mClickURL;
+ std::string mClickNavType;
+ std::string mClickTarget;
+ std::string mClickUUID;
+ S32 mGeometryX;
+ S32 mGeometryY;
+ S32 mGeometryWidth;
+ S32 mGeometryHeight;
+ S32 mStatusCode;
+ std::string mAuthURL;
+ std::string mAuthRealm;
+ std::string mHoverText;
+ std::string mHoverLink;
+
+ /////////////////////////////////////////
+ // media_time class
+ F64 mCurrentTime;
+ F64 mDuration;
+ F64 mCurrentRate;
+ F64 mLoadedDuration;
+
+//--------------------------------------
+ //debug use only
+ //
+private:
+ bool mDeleteOK ;
+public:
+ void setDeleteOK(bool flag) { mDeleteOK = flag ;}
+//--------------------------------------
+};
+
+#endif // LL_LLPLUGINCLASSMEDIA_H
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index d3f42c63d5..ba7abd4c79 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1209,10 +1209,23 @@ void LLModel::generateNormals(F32 angle_cutoff) LLVolumeFace::VertexData v; new_face.mPositions[i] = vol_face.mPositions[idx]; new_face.mNormals[i].clear(); - new_face.mTexCoords[i] = vol_face.mTexCoords[idx]; new_face.mIndices[i] = i; } + if (vol_face.mTexCoords) + { + for (U32 i = 0; i < vol_face.mNumIndices; i++) + { + U32 idx = vol_face.mIndices[i]; + new_face.mTexCoords[i] = vol_face.mTexCoords[idx]; + } + } + else + { + ll_aligned_free_16(new_face.mTexCoords); + new_face.mTexCoords = NULL; + } + //generate normals for new face for (U32 i = 0; i < new_face.mNumIndices; i += 3) { //for each triangle @@ -1378,6 +1391,14 @@ LLSD LLModel::writeModel( } } + if (as_slm) + { //save material list names + for (U32 i = 0; i < high->mMaterialList.size(); ++i) + { + mdl["material_list"][i] = high->mMaterialList[i]; + } + } + for (U32 idx = 0; idx < MODEL_NAMES_LENGTH; ++idx) { if (model[idx] && model[idx]->getNumVolumeFaces() > 0) @@ -1565,10 +1586,10 @@ LLSD LLModel::writeModel( } } - return writeModelToStream(ostr, mdl, nowrite); + return writeModelToStream(ostr, mdl, nowrite, as_slm); } -LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite) +LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite, BOOL as_slm) { U32 bytes = 0; @@ -1576,6 +1597,11 @@ LLSD LLModel::writeModelToStream(std::ostream& ostr, LLSD& mdl, BOOL nowrite) LLSD header; + if (as_slm && mdl.has("material_list")) + { //save material binding names to header + header["material_list"] = mdl["material_list"]; + } + std::string skin; if (mdl.has("skin")) @@ -1769,6 +1795,15 @@ bool LLModel::loadModel(std::istream& is) } } + if (header.has("material_list")) + { //load material list names + mMaterialList.clear(); + for (U32 i = 0; i < header["material_list"].size(); ++i) + { + mMaterialList.push_back(header["material_list"][i].asString()); + } + } + std::string nm[] = { "lowest_lod", @@ -1855,6 +1890,57 @@ bool LLModel::loadModel(std::istream& is) } +void LLModel::matchMaterialOrder(LLModel* ref) +{ + llassert(ref->mMaterialList.size() == mMaterialList.size()); + + std::map<std::string, U32> index_map; + + //build a map of material slot names to face indexes + bool reorder = false; + std::set<std::string> base_mat; + std::set<std::string> cur_mat; + + for (U32 i = 0; i < mMaterialList.size(); i++) + { + index_map[ref->mMaterialList[i]] = i; + if (!reorder) + { //if any material name does not match reference, we need to reorder + reorder = ref->mMaterialList[i] != mMaterialList[i]; + } + base_mat.insert(ref->mMaterialList[i]); + cur_mat.insert(mMaterialList[i]); + } + + + if (reorder && + base_mat == cur_mat) //don't reorder if material name sets don't match + { + std::vector<LLVolumeFace> new_face_list; + new_face_list.resize(mVolumeFaces.size()); + + std::vector<std::string> new_material_list; + new_material_list.resize(mVolumeFaces.size()); + + //rebuild face list so materials have the same order + //as the reference model + for (U32 i = 0; i < mMaterialList.size(); ++i) + { + U32 ref_idx = index_map[mMaterialList[i]]; + new_face_list[ref_idx] = mVolumeFaces[i]; + + new_material_list[ref_idx] = mMaterialList[i]; + } + + llassert(new_material_list == ref->mMaterialList); + + mVolumeFaces = new_face_list; + } + + //override material list with reference model ordering + mMaterialList = ref->mMaterialList; +} + bool LLModel::loadSkinInfo(LLSD& header, std::istream &is) { diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 1ece877f0f..3f58eba07d 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -143,7 +143,7 @@ public: static LLSD writeModelToStream( std::ostream& ostr, LLSD& mdl, - BOOL nowrite = FALSE); + BOOL nowrite = FALSE, BOOL as_slm = FALSE); static LLModel* loadModelFromDomMesh(domMesh* mesh); static std::string getElementLabel(daeElement* element); @@ -172,6 +172,11 @@ public: void optimizeVolumeFaces(); void offsetMesh( const LLVector3& pivotPoint ); void getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& translation_out); + + //reorder face list based on mMaterialList in this and reference so + //order matches that of reference (material ordering touchup) + void matchMaterialOrder(LLModel* reference); + std::vector<std::string> mMaterialList; //data used for skin weights diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 6a3f186531..1d82dda30f 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -294,7 +294,7 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); texture->updateBindStats(texture->mTextureMemory); mHasMipMaps = texture->mHasMipMaps; - if (mIndex == 0 && texture->mTexOptionsDirty) + if (texture->mTexOptionsDirty) { texture->mTexOptionsDirty = false; setTextureAddressMode(texture->mAddressMode); diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 684e393cba..0bbdcfd6ff 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -28,6 +28,8 @@ include_directories( set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp + llbadge.cpp + llbadgeowner.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -93,6 +95,7 @@ set(llui_SOURCE_FILES lltextparser.cpp lltextutil.cpp lltextvalidate.cpp + lltimectrl.cpp lltransutil.cpp lltoggleablemenu.cpp lltooltip.cpp @@ -119,6 +122,8 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h + llbadge.h + llbadgeowner.h llbutton.h llcallbackmap.h llcheckboxctrl.h @@ -191,6 +196,7 @@ set(llui_HEADER_FILES lltextparser.h lltextutil.h lltextvalidate.h + lltimectrl.h lltoggleablemenu.h lltooltip.h lltransutil.h @@ -245,11 +251,11 @@ target_link_libraries(llui ) # Add tests -if (LL_TESTS) - include(LLAddBuildTest) - SET(llui_TEST_SOURCE_FILES - llurlmatch.cpp - llurlentry.cpp - ) - LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") -endif (LL_TESTS)
\ No newline at end of file +if(LL_TESTS) + include(LLAddBuildTest) + SET(llui_TEST_SOURCE_FILES + llurlmatch.cpp + llurlentry.cpp + ) + LL_ADD_PROJECT_UNIT_TESTS(llui "${llui_TEST_SOURCE_FILES}") +endif(LL_TESTS) diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 9e4849c58b..6afe276379 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -1022,7 +1022,7 @@ void LLAccordionCtrlTab::updateLayout ( const LLRect& child_rect ) S32 panel_width = child_rect.getWidth(); static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); - if(mScrollbar->getVisible() != false) + if(mScrollbar && mScrollbar->getVisible() != false) { panel_top+=mScrollbar->getDocPos(); panel_width-=scrollbar_size; diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp new file mode 100644 index 0000000000..c28a947a7f --- /dev/null +++ b/indra/llui/llbadge.cpp @@ -0,0 +1,274 @@ +/** + * @file llbadge.cpp + * @brief Implementation for badges + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#define LLBADGE_CPP +#include "llbadge.h" + +#include "lluictrlfactory.h" + + +static LLDefaultChildRegistry::Register<LLBadge> r("badge"); + +// Compiler optimization, generate extern template +template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const; + + +LLBadge::Params::Params() + : image("image") + , border_image("border_image") + , border_color("border_color") + , image_color("image_color") + , label("label") + , label_color("label_color") + , location("location", LLRelPos::TOP_LEFT) + , location_percent_hcenter("location_percent_hcenter") + , location_percent_vcenter("location_percent_vcenter") + , padding_horiz("padding_horiz") + , padding_vert("padding_vert") +{ + // We set a name here so the name isn't necessary in any xml files that use badges + name = "badge"; +} + +bool LLBadge::Params::equals(const Params& a) const +{ + bool comp = true; + + // skip owner in comparison on purpose + + comp &= (border_image() == a.border_image()); + comp &= (border_color() == a.border_color()); + comp &= (image() == a.image()); + comp &= (image_color() == a.image_color()); + comp &= (label() == a.label()); + comp &= (label_color() == a.label_color()); + comp &= (location() == a.location()); + comp &= (location_percent_hcenter() == a.location_percent_hcenter()); + comp &= (location_percent_vcenter() == a.location_percent_vcenter()); + comp &= (padding_horiz() == a.padding_horiz()); + comp &= (padding_vert() == a.padding_vert()); + + return comp; +} + +LLBadge::LLBadge(const LLBadge::Params& p) + : LLUICtrl(p) + , mOwner(p.owner) + , mBorderImage(p.border_image) + , mBorderColor(p.border_color) + , mGLFont(p.font) + , mImage(p.image) + , mImageColor(p.image_color) + , mLabel(p.label) + , mLabelColor(p.label_color) + , mLocation(p.location) + , mLocationPercentHCenter(0.5f) + , mLocationPercentVCenter(0.5f) + , mPaddingHoriz(p.padding_horiz) + , mPaddingVert(p.padding_vert) +{ + if (mImage.isNull()) + { + llwarns << "Badge: " << getName() << " with no image!" << llendl; + } + + // + // The following logic is to set the mLocationPercentHCenter and mLocationPercentVCenter + // based on the Location enum and our horizontal and vertical location percentages. The + // draw code then uses this on the owner rectangle to compute the screen location for + // the badge. + // + + if (!LLRelPos::IsCenter(mLocation)) + { + F32 h_center = p.location_percent_hcenter * 0.01f; + F32 v_center = p.location_percent_vcenter * 0.01f; + + if (LLRelPos::IsRight(mLocation)) + { + mLocationPercentHCenter = 0.5f * (1.0f + h_center); + } + else if (LLRelPos::IsLeft(mLocation)) + { + mLocationPercentHCenter = 0.5f * (1.0f - h_center); + } + + if (LLRelPos::IsTop(mLocation)) + { + mLocationPercentVCenter = 0.5f * (1.0f + v_center); + } + else if (LLRelPos::IsBottom(mLocation)) + { + mLocationPercentVCenter = 0.5f * (1.0f - v_center); + } + } +} + +LLBadge::~LLBadge() +{ +} + +void LLBadge::setLabel(const LLStringExplicit& label) +{ + mLabel = label; +} + +// +// This is a fallback function to render a rectangle for badges without a valid image +// +void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, const LLColor4U &color) +{ + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + gGL.setSceneBlendType(LLRender::BT_REPLACE); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + gGL.color4ubv(color.mV); + gGL.texCoord2i(0, 0); + + F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f; + F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f; + + LLRectf screen_rect(llround(x), + llround(y), + llround(x) + width, + llround(y) + height); + + LLVector3 vertices[4]; + vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); + vertices[1] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 1.0f); + vertices[2] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 1.0f); + vertices[3] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 1.0f); + + gGL.begin(LLRender::QUADS); + { + gGL.vertexBatchPreTransformed(vertices, 4); + } + gGL.end(); + + gGL.popUIMatrix(); +} + + +// virtual +void LLBadge::draw() +{ + if (!mLabel.empty()) + { + LLView* owner_view = mOwner.get(); + + if (owner_view) + { + // + // Calculate badge position based on owner + // + + LLRect owner_rect; + owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this); + + F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter; + F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; + + // + // Calculate badge size based on label text + // + + LLWString badge_label_wstring = mLabel; + + S32 badge_label_begin_offset = 0; + S32 badge_char_length = S32_MAX; + S32 badge_pixel_length = S32_MAX; + F32 *right_position_out = NULL; + BOOL do_not_use_ellipses = false; + + F32 badge_width = (2.0f * mPaddingHoriz) + + mGLFont->getWidthF32(badge_label_wstring.c_str(), badge_label_begin_offset, badge_char_length); + + F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight(); + + // + // Draw button image, if available. + // Otherwise draw basic rectangular button. + // + + F32 alpha = getDrawContext().mAlpha; + + if (!mImage.isNull()) + { + F32 badge_x = badge_center_x - badge_width * 0.5f; + F32 badge_y = badge_center_y - badge_height * 0.5f; + + mImage->drawSolid((S32) badge_x, (S32) badge_y, (S32) badge_width, (S32) badge_height, mImageColor % alpha); + + if (!mBorderImage.isNull()) + { + mBorderImage->drawSolid((S32) badge_x, (S32) badge_y, (S32) badge_width, (S32) badge_height, mBorderColor % alpha); + } + } + else + { + lldebugs << "No image for badge " << getName() << " on owner " << owner_view->getName() << llendl; + + renderBadgeBackground(badge_center_x, badge_center_y, + badge_width, badge_height, + mImageColor % alpha); + } + + // + // Draw the label + // + + mGLFont->render(badge_label_wstring, badge_label_begin_offset, + badge_center_x, badge_center_y, + mLabelColor % alpha, + LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position + LLFontGL::NORMAL, // normal text (not bold, italics, etc.) + LLFontGL::DROP_SHADOW_SOFT, + badge_char_length, badge_pixel_length, + right_position_out, do_not_use_ellipses); + } + } +} + + +namespace LLInitParam +{ + void TypeValues<LLRelPos::Location>::declareValues() + { + declare("bottom", LLRelPos::BOTTOM); + declare("bottom_left", LLRelPos::BOTTOM_LEFT); + declare("bottom_right", LLRelPos::BOTTOM_RIGHT); + declare("center", LLRelPos::CENTER); + declare("left", LLRelPos::LEFT); + declare("right", LLRelPos::RIGHT); + declare("top", LLRelPos::TOP); + declare("top_left", LLRelPos::TOP_LEFT); + declare("top_right", LLRelPos::TOP_RIGHT); + } +} + + +// eof diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h new file mode 100644 index 0000000000..0f923ef01b --- /dev/null +++ b/indra/llui/llbadge.h @@ -0,0 +1,159 @@ +/** + * @file llbadge.h + * @brief Header for badges + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLBADGE_H +#define LL_LLBADGE_H + +#include <string> + +#include "lluicolor.h" +#include "lluictrl.h" +#include "llstring.h" +#include "lluiimage.h" +#include "llview.h" + +// +// Declarations +// + +class LLUICtrlFactory; +class LLFontGL; + +// +// Relative Position Alignment +// + +namespace LLRelPos +{ + enum Location + { + CENTER = 0, + + LEFT = (1 << 0), + RIGHT = (1 << 1), + + TOP = (1 << 2), + BOTTOM = (1 << 3), + + BOTTOM_LEFT = (BOTTOM | LEFT), + BOTTOM_RIGHT = (BOTTOM | RIGHT), + + TOP_LEFT = (TOP | LEFT), + TOP_RIGHT = (TOP | RIGHT), + }; + + inline bool IsBottom(Location relPos) { return (relPos & BOTTOM) == BOTTOM; } + inline bool IsCenter(Location relPos) { return (relPos == CENTER); } + inline bool IsLeft(Location relPos) { return (relPos & LEFT) == LEFT; } + inline bool IsRight(Location relPos) { return (relPos & RIGHT) == RIGHT; } + inline bool IsTop(Location relPos) { return (relPos & TOP) == TOP; } +} + +// NOTE: This needs to occur before Optional<LLRelPos::Location> declaration for proper compilation. +namespace LLInitParam +{ + template<> + struct TypeValues<LLRelPos::Location> : public TypeValuesHelper<LLRelPos::Location> + { + static void declareValues(); + }; +} + +// +// Classes +// + +class LLBadge +: public LLUICtrl +{ +public: + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional< LLHandle<LLView> > owner; // Mandatory in code but not in xml + + Optional< LLUIImage* > border_image; + Optional< LLUIColor > border_color; + + Optional< LLUIImage* > image; + Optional< LLUIColor > image_color; + + Optional< std::string > label; + Optional< LLUIColor > label_color; + + Optional< LLRelPos::Location > location; + Optional< U32 > location_percent_hcenter; + Optional< U32 > location_percent_vcenter; + + Optional< F32 > padding_horiz; + Optional< F32 > padding_vert; + + Params(); + + bool equals(const Params&) const; + }; + +protected: + friend class LLUICtrlFactory; + LLBadge(const Params& p); + +public: + + ~LLBadge(); + + virtual void draw(); + + const std::string getLabel() const { return wstring_to_utf8str(mLabel); } + void setLabel( const LLStringExplicit& label); + +private: + LLPointer< LLUIImage > mBorderImage; + LLUIColor mBorderColor; + + const LLFontGL* mGLFont; + + LLPointer< LLUIImage > mImage; + LLUIColor mImageColor; + + LLUIString mLabel; + LLUIColor mLabelColor; + + LLRelPos::Location mLocation; + F32 mLocationPercentHCenter; + F32 mLocationPercentVCenter; + + LLHandle< LLView > mOwner; + + F32 mPaddingHoriz; + F32 mPaddingVert; +}; + +// Build time optimization, generate once in .cpp file +#ifndef LLBADGE_CPP +extern template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const; +#endif + +#endif // LL_LLBADGE_H diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp new file mode 100644 index 0000000000..77f15567bf --- /dev/null +++ b/indra/llui/llbadgeowner.cpp @@ -0,0 +1,126 @@ +/** + * @file llbadgeowner.cpp + * @brief Class to manage badges attached to a UI control + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#include "linden_common.h" + +#include "llbadgeowner.h" +#include "llpanel.h" + +// +// Classes +// + +LLBadgeOwner::LLBadgeOwner(LLHandle< LLView > viewHandle) + : mBadge(NULL) + , mBadgeOwnerView(viewHandle) +{ +} + +void LLBadgeOwner::initBadgeParams(const LLBadge::Params& p) +{ + if (!p.equals(LLUICtrlFactory::getDefaultParams<LLBadge>())) + { + mBadge = createBadge(p); + } +} + +void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label) +{ + if (mBadge == NULL) + { + mBadge = createBadge(LLUICtrlFactory::getDefaultParams<LLBadge>()); + + addBadgeToParentPanel(); + } + + if (mBadge) + { + mBadge->setLabel(label); + + // + // Push the badge to the front so it renders on top + // + + LLView * parent = mBadge->getParent(); + + if (parent) + { + parent->sendChildToFront(mBadge); + } + } +} + +void LLBadgeOwner::setBadgeVisibility(bool visible) +{ + if (mBadge) + { + mBadge->setVisible(visible); + } +} + +void LLBadgeOwner::addBadgeToParentPanel() +{ + LLView * owner_view = mBadgeOwnerView.get(); + + if (mBadge && owner_view) + { + // Badge parent is badge owner by default + LLView * badge_parent = owner_view; + + // Find the appropriate parent for the badge + LLView * parent = owner_view->getParent(); + + while (parent) + { + LLPanel * parent_panel = dynamic_cast<LLPanel *>(parent); + + if (parent_panel && parent_panel->acceptsBadge()) + { + badge_parent = parent; + break; + } + + parent = parent->getParent(); + } + + if (badge_parent) + { + badge_parent->addChild(mBadge); + } + else + { + llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on " << owner_view->getName() << llendl; + } + } +} + +LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p) +{ + LLBadge::Params badge_params(p); + badge_params.owner = mBadgeOwnerView; + + return LLUICtrlFactory::create<LLBadge>(badge_params); +} diff --git a/indra/newview/lldrawpoolclouds.h b/indra/llui/llbadgeowner.h index 019f11a795..a2399189a5 100644 --- a/indra/newview/lldrawpoolclouds.h +++ b/indra/llui/llbadgeowner.h @@ -1,8 +1,8 @@ /** - * @file lldrawpoolclouds.h - * @brief LLDrawPoolClouds class definition + * @file llbadgeowner.h + * @brief Header for badge owners * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * @@ -24,31 +24,38 @@ * $/LicenseInfo$ */ -#ifndef LL_LLDRAWPOOLCLOUDS_H -#define LL_LLDRAWPOOLCLOUDS_H +#ifndef LL_LLBADGEOWNER_H +#define LL_LLBADGEOWNER_H -#include "lldrawpool.h" +#include "llbadge.h" +#include "llview.h" -class LLDrawPoolClouds : public LLDrawPool +// +// Classes +// + +class LLBadgeOwner { public: - enum - { - VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | - LLVertexBuffer::MAP_NORMAL | - LLVertexBuffer::MAP_TEXCOORD0 - }; - - BOOL addFace(LLFace* face); - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } - - LLDrawPoolClouds(); - - /*virtual*/ void prerender(); - /*virtual*/ LLDrawPool *instancePool(); - /*virtual*/ void enqueue(LLFace *face); - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void render(S32 pass = 0); + + LLBadgeOwner(LLHandle< LLView > viewHandle); + + void initBadgeParams(const LLBadge::Params& p); + void addBadgeToParentPanel(); + + bool badgeHasParent() const { return (mBadge && mBadge->getParent()); } + + void setBadgeLabel(const LLStringExplicit& label); + void setBadgeVisibility(bool visible); + +private: + + LLBadge* createBadge(const LLBadge::Params& p); + +private: + + LLBadge* mBadge; + LLHandle< LLView > mBadgeOwnerView; }; -#endif // LL_LLDRAWPOOLSKY_H +#endif // LL_LLBADGEOWNER_H diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 45ceaff696..7b015bd576 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -99,7 +99,9 @@ LLButton::Params::Params() scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), - use_draw_context_alpha("use_draw_context_alpha", true) + use_draw_context_alpha("use_draw_context_alpha", true), + badge("badge"), + handle_right_mouse("handle_right_mouse") { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -109,6 +111,7 @@ LLButton::Params::Params() LLButton::LLButton(const LLButton::Params& p) : LLUICtrl(p), + LLBadgeOwner(LLView::getHandle()), mMouseDownFrame(0), mMouseHeldDownCount(0), mBorderEnabled( FALSE ), @@ -160,8 +163,8 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownSignal(NULL), mMouseUpSignal(NULL), mHeldDownSignal(NULL), - mUseDrawContextAlpha(p.use_draw_context_alpha) - + mUseDrawContextAlpha(p.use_draw_context_alpha), + mHandleRightMouse(p.handle_right_mouse) { static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>()); @@ -244,6 +247,11 @@ LLButton::LLButton(const LLButton::Params& p) { setHeldDownCallback(initCommitCallback(p.mouse_held_callback)); } + + if (p.badge.isProvided()) + { + LLBadgeOwner::initBadgeParams(p.badge()); + } } LLButton::~LLButton() @@ -327,8 +335,12 @@ boost::signals2::connection LLButton::setHeldDownCallback( button_callback_t cb, BOOL LLButton::postBuild() { autoResize(); - return TRUE; + + addBadgeToParentPanel(); + + return LLUICtrl::postBuild(); } + BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) { BOOL handled = FALSE; @@ -447,7 +459,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (!childrenHandleRightMouseDown(x, y, mask)) + if (mHandleRightMouse && !childrenHandleRightMouseDown(x, y, mask)) { // Route future Mouse messages here preemptively. (Release on mouse up.) gFocusMgr.setMouseCapture( this ); @@ -460,37 +472,42 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask) // if (pointInView(x, y)) // { // } + // send the mouse down signal + LLUICtrl::handleRightMouseDown(x,y,mask); + // *TODO: Return result of LLUICtrl call above? Should defer to base class + // but this might change the mouse handling of existing buttons in a bad way + // if they are not mouse opaque. } - // send the mouse down signal - LLUICtrl::handleRightMouseDown(x,y,mask); - // *TODO: Return result of LLUICtrl call above? Should defer to base class - // but this might change the mouse handling of existing buttons in a bad way - // if they are not mouse opaque. + return TRUE; } BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask) { - // We only handle the click if the click both started and ended within us - if( hasMouseCapture() ) + if (mHandleRightMouse) { - // Always release the mouse - gFocusMgr.setMouseCapture( NULL ); + // We only handle the click if the click both started and ended within us + if( hasMouseCapture() ) + { + // Always release the mouse + gFocusMgr.setMouseCapture( NULL ); -// if (pointInView(x, y)) -// { -// mRightMouseUpSignal(this, x,y,mask); -// } - } - else - { - childrenHandleRightMouseUp(x, y, mask); + // if (pointInView(x, y)) + // { + // mRightMouseUpSignal(this, x,y,mask); + // } + } + else + { + childrenHandleRightMouseUp(x, y, mask); + } + + // send the mouse up signal + LLUICtrl::handleRightMouseUp(x,y,mask); + // *TODO: Return result of LLUICtrl call above? Should defer to base class + // but this might change the mouse handling of existing buttons in a bad way. + // if they are not mouse opaque. } - // send the mouse up signal - LLUICtrl::handleRightMouseUp(x,y,mask); - // *TODO: Return result of LLUICtrl call above? Should defer to base class - // but this might change the mouse handling of existing buttons in a bad way. - // if they are not mouse opaque. return TRUE; } diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 0cfc393e05..5968916006 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -27,6 +27,8 @@ #ifndef LL_LLBUTTON_H #define LL_LLBUTTON_H +#include "lluuid.h" +#include "llbadgeowner.h" #include "llcontrol.h" #include "lluictrl.h" #include "v4color.h" @@ -52,15 +54,13 @@ S32 round_up(S32 grid, S32 value); class LLUICtrlFactory; -class LLUIImage; -class LLUUID; // // Classes // class LLButton -: public LLUICtrl +: public LLUICtrl, public LLBadgeOwner { public: struct Params @@ -125,7 +125,11 @@ public: Optional<F32> hover_glow_amount; Optional<TimeIntervalParam> held_down_delay; - Optional<bool> use_draw_context_alpha; + Optional<bool> use_draw_context_alpha; + + Optional<LLBadge::Params> badge; + + Optional<bool> handle_right_mouse; Params(); }; @@ -249,7 +253,7 @@ public: void setImageDisabledSelected(LLPointer<LLUIImage> image); void setImageFlash(LLPointer<LLUIImage> image); void setImagePressed(LLPointer<LLUIImage> image); - + void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } BOOL getCommitOnReturn() const { return mCommitOnReturn; } @@ -357,6 +361,8 @@ private: bool mForcePressedState; LLFrameTimer mFlashingTimer; + + bool mHandleRightMouse; }; // Build time optimization, generate once in .cpp file diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 9b6830a816..6a91ec56e4 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -49,6 +49,8 @@ void LLLayoutStack::OrientationNames::declareValues() // LLLayoutPanel::LLLayoutPanel(const Params& p) : LLPanel(p), + mExpandedMinDimSpecified(false), + mExpandedMinDim(p.min_dim), mMinDim(p.min_dim), mMaxDim(p.max_dim), mAutoResize(p.auto_resize), @@ -58,6 +60,13 @@ LLLayoutPanel::LLLayoutPanel(const Params& p) mVisibleAmt(1.f), // default to fully visible mResizeBar(NULL) { + // Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value + if (p.expanded_min_dim.isProvided()) + { + mExpandedMinDimSpecified = true; + mExpandedMinDim = p.expanded_min_dim(); + } + // panels initialized as hidden should not start out partially visible if (!getVisible()) { @@ -78,20 +87,20 @@ LLLayoutPanel::~LLLayoutPanel() delete mResizeBar; mResizeBar = NULL; } - + F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation) { if (orientation == LLLayoutStack::HORIZONTAL) { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getWidth())); return mVisibleAmt * collapse_amt; } else { - F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight()))); - return mVisibleAmt * collapse_amt; + F32 collapse_amt = + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getHeight()))); + return mVisibleAmt * collapse_amt; } } @@ -182,14 +191,14 @@ BOOL LLLayoutStack::postBuild() } bool LLLayoutStack::addChild(LLView* child, S32 tab_group) - { +{ LLLayoutPanel* panelp = dynamic_cast<LLLayoutPanel*>(child); - if (panelp) - { + if (panelp) + { mPanels.push_back(panelp); - } + } return LLView::addChild(child, tab_group); - } +} S32 LLLayoutStack::getDefaultHeight(S32 cur_height) @@ -281,9 +290,9 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_dimp { LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name); - if (panel) + if (panel && min_dimp) { - if (min_dimp) *min_dimp = panel->mMinDim; + *min_dimp = panel->getRelevantMinDim(); } return NULL != panel; @@ -316,23 +325,23 @@ void LLLayoutStack::updateLayout(BOOL force_resize) e_panel_list_t::iterator panel_it; for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); if (panelp->getVisible()) { if (mAnimate) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); - if ((*panel_it)->mVisibleAmt > 0.99f) + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); + if (panelp->mVisibleAmt > 0.99f) { - (*panel_it)->mVisibleAmt = 1.f; + panelp->mVisibleAmt = 1.f; } } } else { - (*panel_it)->mVisibleAmt = 1.f; + panelp->mVisibleAmt = 1.f; } } else // not visible @@ -341,36 +350,36 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); - if ((*panel_it)->mVisibleAmt < 0.001f) + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + if (panelp->mVisibleAmt < 0.001f) { - (*panel_it)->mVisibleAmt = 0.f; + panelp->mVisibleAmt = 0.f; } } } else { - (*panel_it)->mVisibleAmt = 0.f; + panelp->mVisibleAmt = 0.f; } } - if ((*panel_it)->mCollapsed) + if (panelp->mCollapsed) { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } else { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } if (mOrientation == HORIZONTAL) { // enforce minimize size constraint by default - if (panelp->getRect().getWidth() < (*panel_it)->mMinDim) + if (panelp->getRect().getWidth() < panelp->getRelevantMinDim()) { - panelp->reshape((*panel_it)->mMinDim, panelp->getRect().getHeight()); + panelp->reshape(panelp->getRelevantMinDim(), panelp->getRect().getHeight()); } - total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor(mOrientation)); + total_width += llround(panelp->getRect().getWidth() * panelp->getCollapseFactor(mOrientation)); // want n-1 panel gaps for n panels if (panel_it != mPanels.begin()) { @@ -380,11 +389,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize) else //VERTICAL { // enforce minimize size constraint by default - if (panelp->getRect().getHeight() < (*panel_it)->mMinDim) + if (panelp->getRect().getHeight() < panelp->getRelevantMinDim()) { - panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinDim); + panelp->reshape(panelp->getRect().getWidth(), panelp->getRelevantMinDim()); } - total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor(mOrientation)); + total_height += llround(panelp->getRect().getHeight() * panelp->getCollapseFactor(mOrientation)); if (panel_it != mPanels.begin()) { total_height += mPanelSpacing; @@ -403,34 +412,23 @@ void LLLayoutStack::updateLayout(BOOL force_resize) continue; } + S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); + S32 relevant_min = (*panel_it)->getRelevantMinDim(); + // if currently resizing a panel or the panel is flagged as not automatically resizing // only track total available headroom, but don't use it for automatic resize logic if ((*panel_it)->mResizeBar->hasMouseCapture() || (!(*panel_it)->mAutoResize && !force_resize)) { - if (mOrientation == HORIZONTAL) - { - shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - } - else //VERTICAL - { - shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - } + shrink_headroom_total += relevant_dimension - relevant_min; } else { num_resizable_panels++; - if (mOrientation == HORIZONTAL) - { - shrink_headroom_available += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - } - else //VERTICAL - { - shrink_headroom_available += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - } + + shrink_headroom_available += relevant_dimension - relevant_min; + shrink_headroom_total += relevant_dimension - relevant_min; } } @@ -452,27 +450,28 @@ void LLLayoutStack::updateLayout(BOOL force_resize) for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); S32 cur_width = panelp->getRect().getWidth(); S32 cur_height = panelp->getRect().getHeight(); S32 new_width = cur_width; - S32 new_height = cur_height; + S32 new_height = cur_height; + S32 relevant_min = panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { - new_width = llmax((*panel_it)->mMinDim, new_width); + new_width = llmax(relevant_min, new_width); } else { - new_height = llmax((*panel_it)->mMinDim, new_height); + new_height = llmax(relevant_min, new_height); } S32 delta_size = 0; // if panel can automatically resize (not animating, and resize flag set)... - if ((*panel_it)->getCollapseFactor(mOrientation) == 1.f - && (force_resize || (*panel_it)->mAutoResize) - && !(*panel_it)->mResizeBar->hasMouseCapture()) + if (panelp->getCollapseFactor(mOrientation) == 1.f + && (force_resize || panelp->mAutoResize) + && !panelp->mResizeBar->hasMouseCapture()) { if (mOrientation == HORIZONTAL) { @@ -481,8 +480,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { // shrink proportionally to amount over minimum // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_width - (*panel_it)->mMinDim); + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - relevant_min) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_width - relevant_min); } else { @@ -491,7 +490,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) num_resizable_panels--; } pixels_to_distribute -= delta_size; - new_width = llmax((*panel_it)->mMinDim, cur_width + delta_size); + new_width = llmax(relevant_min, cur_width + delta_size); } else { @@ -504,8 +503,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { // shrink proportionally to amount over minimum // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_height - (*panel_it)->mMinDim); + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - relevant_min) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_height - relevant_min); } else { @@ -513,7 +512,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) num_resizable_panels--; } pixels_to_distribute -= delta_size; - new_height = llmax((*panel_it)->mMinDim, cur_height + delta_size); + new_height = llmax(relevant_min, cur_height + delta_size); } else { @@ -566,19 +565,20 @@ void LLLayoutStack::updateLayout(BOOL force_resize) LLLayoutPanel* last_resizeable_panel = NULL; for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); + S32 relevant_min = panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinDim, - (*panel_it)->mMinDim + shrink_headroom_total); + relevant_min, + relevant_min + shrink_headroom_total); } else //VERTICAL { (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinDim, - (*panel_it)->mMinDim + shrink_headroom_total); + relevant_min, + relevant_min + shrink_headroom_total); } // toggle resize bars based on panel visibility, resizability, etc @@ -658,7 +658,7 @@ void LLLayoutStack::calcMinExtents() { if (mOrientation == HORIZONTAL) { - mMinWidth += (*panel_it)->mMinDim; + mMinWidth += (*panel_it)->getRelevantMinDim(); if (panel_it != mPanels.begin()) { mMinWidth += mPanelSpacing; @@ -666,7 +666,7 @@ void LLLayoutStack::calcMinExtents() } else //VERTICAL { - mMinHeight += (*panel_it)->mMinDim; + mMinHeight += (*panel_it)->getRelevantMinDim(); if (panel_it != mPanels.begin()) { mMinHeight += mPanelSpacing; @@ -688,7 +688,7 @@ void LLLayoutStack::createResizeBars() LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); - resize_params.min_size(lp->mMinDim); + resize_params.min_size(lp->getRelevantMinDim()); resize_params.side(side); resize_params.snapping_enabled(false); LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params); diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 4ac8ef0ee9..d8ef0aeaca 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -30,10 +30,10 @@ #include "llpanel.h" -class LLPanel; class LLLayoutPanel; + class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack> { public: @@ -149,6 +149,7 @@ private: F32 mCloseTimeConstant; }; // end class LLLayoutStack + class LLLayoutPanel : public LLPanel { friend class LLLayoutStack; @@ -156,13 +157,15 @@ friend class LLUICtrlFactory; public: struct Params : public LLInitParam::Block<Params, LLPanel::Params> { - Optional<S32> min_dim, + Optional<S32> expanded_min_dim, + min_dim, max_dim; Optional<bool> user_resize, auto_resize; Params() - : min_dim("min_dim", 0), + : expanded_min_dim("expanded_min_dim", 0), + min_dim("min_dim", 0), max_dim("max_dim", 0), user_resize("user_resize", true), auto_resize("auto_resize", true) @@ -177,15 +180,36 @@ public: ~LLLayoutPanel(); void initFromParams(const Params& p); - void setMinDim(S32 value) { mMinDim = value; } + + S32 getMinDim() const { return mMinDim; } + void setMinDim(S32 value) { mMinDim = value; if (!mExpandedMinDimSpecified) mExpandedMinDim = value; } + + S32 getMaxDim() const { return mMaxDim; } void setMaxDim(S32 value) { mMaxDim = value; } -protected: - LLLayoutPanel(const Params& p) ; + S32 getExpandedMinDim() const { return mExpandedMinDim; } + void setExpandedMinDim(S32 value) { mExpandedMinDim = value; mExpandedMinDimSpecified = true; } + + S32 getRelevantMinDim() const + { + S32 min_dim = mMinDim; + + if (!mCollapsed) + { + min_dim = mExpandedMinDim; + } + + return min_dim; + } +protected: + LLLayoutPanel(const Params& p); F32 getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation); + bool mExpandedMinDimSpecified; + S32 mExpandedMinDim; + S32 mMinDim; S32 mMaxDim; BOOL mAutoResize; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 0196080d90..123997e5e9 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -81,6 +81,7 @@ LLLineEditor::Params::Params() : max_length(""), keystroke_callback("keystroke_callback"), prevalidate_callback("prevalidate_callback"), + prevalidate_input_callback("prevalidate_input_callback"), background_image("background_image"), background_image_disabled("background_image_disabled"), background_image_focused("background_image_focused"), @@ -173,6 +174,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) updateTextPadding(); setCursor(mText.length()); + setPrevalidateInput(p.prevalidate_input_callback()); setPrevalidate(p.prevalidate_callback()); LLContextMenu* menu = LLUICtrlFactory::instance().createFromFile<LLContextMenu> @@ -405,23 +407,15 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) // Picks a new cursor position based on the actual screen size of text being drawn. void LLLineEditor::setCursorAtLocalPos( S32 local_mouse_x ) { - const llwchar* wtext = mText.getWString().c_str(); - LLWString asterix_text; - if (mDrawAsterixes) - { - for (S32 i = 0; i < mText.length(); i++) - { - asterix_text += utf8str_to_wstring(PASSWORD_ASTERISK); - } - wtext = asterix_text.c_str(); - } + S32 cursor_pos = calcCursorPos(local_mouse_x); + + S32 left_pos = llmin( mSelectionStart, cursor_pos ); + S32 length = llabs( mSelectionStart - cursor_pos ); + const LLWString& substr = mText.getWString().substr(left_pos, length); + + if (mIsSelecting && !prevalidateInput(substr)) + return; - S32 cursor_pos = - mScrollHPos + - mGLFont->charFromPixelOffset( - wtext, mScrollHPos, - (F32)(local_mouse_x - mTextLeftEdge), - (F32)(mTextRightEdge - mTextLeftEdge + 1)); // min-max range is inclusive setCursor(cursor_pos); } @@ -505,6 +499,11 @@ BOOL LLLineEditor::canSelectAll() const void LLLineEditor::selectAll() { + if (!prevalidateInput(mText.getWString())) + { + return; + } + mSelectionStart = mText.length(); mSelectionEnd = 0; setCursor(mSelectionEnd); @@ -590,6 +589,9 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) if (mask & MASK_SHIFT) { + // assume we're starting a drag select + mIsSelecting = TRUE; + // Handle selection extension S32 old_cursor_pos = getCursor(); setCursorAtLocalPos(x); @@ -624,8 +626,6 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) mSelectionStart = old_cursor_pos; mSelectionEnd = getCursor(); } - // assume we're starting a drag select - mIsSelecting = TRUE; } else { @@ -796,6 +796,9 @@ void LLLineEditor::removeChar() { if( getCursor() > 0 ) { + if (!prevalidateInput(mText.getWString().substr(getCursor()-1, 1))) + return; + mText.erase(getCursor() - 1, 1); setCursor(getCursor() - 1); @@ -816,6 +819,9 @@ void LLLineEditor::addChar(const llwchar uni_char) } else if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode()) { + if (!prevalidateInput(mText.getWString().substr(getCursor(), 1))) + return; + mText.erase(getCursor(), 1); } @@ -864,6 +870,13 @@ void LLLineEditor::extendSelection( S32 new_cursor_pos ) startSelection(); } + S32 left_pos = llmin( mSelectionStart, new_cursor_pos ); + S32 selection_length = llabs( mSelectionStart - new_cursor_pos ); + const LLWString& selection = mText.getWString().substr(left_pos, selection_length); + + if (!prevalidateInput(selection)) + return; + setCursor(new_cursor_pos); mSelectionEnd = getCursor(); } @@ -994,8 +1007,12 @@ void LLLineEditor::deleteSelection() { if( !mReadOnly && hasSelection() ) { - S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); - S32 selection_length = llabs( mSelectionStart - mSelectionEnd ); + S32 left_pos, selection_length; + getSelectionRange(&left_pos, &selection_length); + const LLWString& selection = mText.getWString().substr(left_pos, selection_length); + + if (!prevalidateInput(selection)) + return; mText.erase(left_pos, selection_length); deselect(); @@ -1013,12 +1030,16 @@ void LLLineEditor::cut() { if( canCut() ) { + S32 left_pos, length; + getSelectionRange(&left_pos, &length); + const LLWString& selection = mText.getWString().substr(left_pos, length); + + if (!prevalidateInput(selection)) + return; + // Prepare for possible rollback LLLineEditorRollback rollback( this ); - - S32 left_pos = llmin( mSelectionStart, mSelectionEnd ); - S32 length = llabs( mSelectionStart - mSelectionEnd ); gClipboard.copyFromSubstring( mText.getWString(), left_pos, length ); deleteSelection(); @@ -1098,6 +1119,9 @@ void LLLineEditor::pasteHelper(bool is_primary) if (!paste.empty()) { + if (!prevalidateInput(paste)) + return; + // Prepare for possible rollback LLLineEditorRollback rollback(this); @@ -1445,6 +1469,13 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) LLLineEditorRollback rollback( this ); + { + LLWString u_char; + u_char.assign(1, uni_char); + if (!prevalidateInput(u_char)) + return handled; + } + addChar(uni_char); mKeystrokeTimer.reset(); @@ -1496,6 +1527,15 @@ void LLLineEditor::doDelete() } else if ( getCursor() < mText.length()) { + const LLWString& text_to_delete = mText.getWString().substr(getCursor(), 1); + + if (!prevalidateInput(text_to_delete)) + { + if( mKeystrokeCallback ) + mKeystrokeCallback( this ); + + return; + } setCursor(getCursor() + 1); removeChar(); } @@ -1843,6 +1883,27 @@ S32 LLLineEditor::findPixelNearestPos(const S32 cursor_offset) const return result; } +S32 LLLineEditor::calcCursorPos(S32 mouse_x) +{ + const llwchar* wtext = mText.getWString().c_str(); + LLWString asterix_text; + if (mDrawAsterixes) + { + for (S32 i = 0; i < mText.length(); i++) + { + asterix_text += utf8str_to_wstring(PASSWORD_ASTERISK); + } + wtext = asterix_text.c_str(); + } + + S32 cur_pos = mScrollHPos + + mGLFont->charFromPixelOffset( + wtext, mScrollHPos, + (F32)(mouse_x - mTextLeftEdge), + (F32)(mTextRightEdge - mTextLeftEdge + 1)); // min-max range is inclusive + + return cur_pos; +} //virtual void LLLineEditor::clear() { @@ -1936,6 +1997,22 @@ void LLLineEditor::setPrevalidate(LLTextValidate::validate_func_t func) updateAllowingLanguageInput(); } +void LLLineEditor::setPrevalidateInput(LLTextValidate::validate_func_t func) +{ + mPrevalidateInputFunc = func; + updateAllowingLanguageInput(); +} + +bool LLLineEditor::prevalidateInput(const LLWString& wstr) +{ + if (mPrevalidateInputFunc && !mPrevalidateInputFunc(wstr)) + { + return false; + } + + return true; +} + // static BOOL LLLineEditor::postvalidateFloat(const std::string &str) { diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index fe191e5971..4b77708590 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -76,6 +76,7 @@ public: Optional<keystroke_callback_t> keystroke_callback; Optional<LLTextValidate::validate_func_t, LLTextValidate::ValidateTextNamedFuncs> prevalidate_callback; + Optional<LLTextValidate::validate_func_t, LLTextValidate::ValidateTextNamedFuncs> prevalidate_input_callback; Optional<LLViewBorder::Params> border; @@ -232,8 +233,15 @@ public: // Prevalidation controls which keystrokes can affect the editor void setPrevalidate( LLTextValidate::validate_func_t func ); + // This method sets callback that prevents from: + // - deleting, selecting, typing, cutting, pasting characters that are not valid. + // Also callback that this method sets differs from setPrevalidate in a way that it validates just inputed + // symbols, before existing text is modified, but setPrevalidate validates line after it was modified. + void setPrevalidateInput(LLTextValidate::validate_func_t func); static BOOL postvalidateFloat(const std::string &str); + bool prevalidateInput(const LLWString& wstr); + // line history support: void setEnableLineHistory( BOOL enabled ) { mHaveHistory = enabled; } // switches line history on or off void updateHistory(); // stores current line in history @@ -251,6 +259,7 @@ private: void addChar(const llwchar c); void setCursorAtLocalPos(S32 local_mouse_x); S32 findPixelNearestPos(S32 cursor_offset = 0) const; + S32 calcCursorPos(S32 mouse_x); BOOL handleSpecialKey(KEY key, MASK mask); BOOL handleSelectionKey(KEY key, MASK mask); BOOL handleControlKey(KEY key, MASK mask); @@ -312,6 +321,7 @@ protected: S32 mLastSelectionEnd; LLTextValidate::validate_func_t mPrevalidateFunc; + LLTextValidate::validate_func_t mPrevalidateInputFunc; LLFrameTimer mKeystrokeTimer; LLTimer mTripleClickTimer; diff --git a/indra/llui/llloadingindicator.h b/indra/llui/llloadingindicator.h index 4c47cc267c..7c44478848 100644 --- a/indra/llui/llloadingindicator.h +++ b/indra/llui/llloadingindicator.h @@ -86,6 +86,8 @@ public: */ void start(); + void reset() { mCurImageIdx = 0; } + private: LLLoadingIndicator(const Params&); void initFromParams(const Params&); diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index f744e9db41..9052bc7d1d 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -511,7 +511,7 @@ void LLMultiSlider::draw() mIt->second.mTop + extra_triangle_height, mIt->second.mLeft + mIt->second.getWidth() / 2, mIt->second.mBottom - extra_triangle_height, - mTriangleColor.get(), TRUE); + mTriangleColor.get() % opacity, TRUE); } } else if (!thumb_imagep) diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index b2383106a8..1dcdd79efa 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -87,7 +87,8 @@ LLPanel::Params::Params() filename("filename"), class_name("class"), help_topic("help_topic"), - visible_callback("visible_callback") + visible_callback("visible_callback"), + accepts_badge("accepts_badge") { name = "panel"; addSynonym(background_visible, "bg_visible"); @@ -113,7 +114,8 @@ LLPanel::LLPanel(const LLPanel::Params& p) mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename), - mVisibleSignal(NULL) + mVisibleSignal(NULL), + mAcceptsBadge(p.accepts_badge) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { @@ -485,6 +487,8 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgAlphaImage = p.bg_alpha_image(); mBgOpaqueImageOverlay = p.bg_opaque_image_overlay; mBgAlphaImageOverlay = p.bg_alpha_image_overlay; + + mAcceptsBadge = p.accepts_badge; } static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 7bbbeaf709..67674fab7e 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -89,6 +89,8 @@ public: Multiple<LocalizedString> strings; Optional<CommitCallbackParam> visible_callback; + + Optional<bool> accepts_badge; Params(); }; @@ -250,6 +252,8 @@ public: boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb ); + bool acceptsBadge() const { return mAcceptsBadge; } + protected: // Override to set not found list LLButton* getDefaultButton() { return mDefaultBtn; } @@ -264,6 +268,7 @@ protected: static factory_stack_t sFactoryStack; private: + bool mAcceptsBadge; BOOL mBgVisible; // any background at all? BOOL mBgOpaque; // use opaque color or image LLUIColor mBgOpaqueColor; diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp index 4b9faa0560..234e600ccd 100644 --- a/indra/llui/lltextvalidate.cpp +++ b/indra/llui/lltextvalidate.cpp @@ -188,6 +188,39 @@ namespace LLTextValidate return success; } + bool validateNonNegativeS32NoSpace(const LLWString &str) + { + LLLocale locale(LLLocale::USER_LOCALE); + + LLWString test_str = str; + S32 len = test_str.length(); + bool success = TRUE; + if(0 < len) + { + if('-' == test_str[0]) + { + success = FALSE; + } + S32 i = 0; + while(success && (i < len)) + { + if(!LLStringOps::isDigit(test_str[i]) || LLStringOps::isSpace(test_str[i++])) + { + success = FALSE; + } + } + } + if (success) + { + S32 val = strtol(wstring_to_utf8str(test_str).c_str(), NULL, 10); + if (val < 0) + { + success = FALSE; + } + } + return success; + } + bool validateAlphaNum(const LLWString &str) { LLLocale locale(LLLocale::USER_LOCALE); diff --git a/indra/llui/lltextvalidate.h b/indra/llui/lltextvalidate.h index 84644be30c..5c830d7db3 100644 --- a/indra/llui/lltextvalidate.h +++ b/indra/llui/lltextvalidate.h @@ -46,6 +46,7 @@ namespace LLTextValidate bool validateInt(const LLWString &str ); bool validatePositiveS32(const LLWString &str); bool validateNonNegativeS32(const LLWString &str); + bool validateNonNegativeS32NoSpace(const LLWString &str); bool validateAlphaNum(const LLWString &str ); bool validateAlphaNumSpace(const LLWString &str ); bool validateASCIIPrintableNoPipe(const LLWString &str); diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp new file mode 100644 index 0000000000..9ea1e8815e --- /dev/null +++ b/indra/llui/lltimectrl.cpp @@ -0,0 +1,432 @@ +/** + * @file lltimectrl.cpp + * @brief LLTimeCtrl base class + * + * $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$ + */ + +#include "linden_common.h" + +#include "lltimectrl.h" + +#include "llui.h" +#include "lluiconstants.h" + +#include "llbutton.h" +#include "llfontgl.h" +#include "lllineeditor.h" +#include "llkeyboard.h" +#include "llstring.h" +#include "lltextbox.h" +#include "lluictrlfactory.h" + +static LLDefaultChildRegistry::Register<LLTimeCtrl> time_r("time"); + +const U32 AMPM_LEN = 3; +const U32 MINUTES_MIN = 0; +const U32 MINUTES_MAX = 59; +const U32 HOURS_MIN = 1; +const U32 HOURS_MAX = 12; +const U32 MINUTES_PER_HOUR = 60; +const U32 MINUTES_PER_DAY = 24 * MINUTES_PER_HOUR; + + +LLTimeCtrl::Params::Params() +: label_width("label_width"), + snap_to("snap_to"), + allow_text_entry("allow_text_entry", true), + text_enabled_color("text_enabled_color"), + text_disabled_color("text_disabled_color"), + up_button("up_button"), + down_button("down_button") +{} + +LLTimeCtrl::LLTimeCtrl(const LLTimeCtrl::Params& p) +: LLUICtrl(p), + mLabelBox(NULL), + mTextEnabledColor(p.text_enabled_color()), + mTextDisabledColor(p.text_disabled_color()), + mTime(0), + mSnapToMin(5) +{ + static LLUICachedControl<S32> spinctrl_spacing ("UISpinctrlSpacing", 0); + static LLUICachedControl<S32> spinctrl_btn_width ("UISpinctrlBtnWidth", 0); + static LLUICachedControl<S32> spinctrl_btn_height ("UISpinctrlBtnHeight", 0); + S32 centered_top = getRect().getHeight(); + S32 centered_bottom = getRect().getHeight() - 2 * spinctrl_btn_height; + S32 label_width = llclamp(p.label_width(), 0, llmax(0, getRect().getWidth() - 40)); + S32 editor_left = label_width + spinctrl_spacing; + + //================= Label =================// + if( !p.label().empty() ) + { + LLRect label_rect( 0, centered_top, label_width, centered_bottom ); + LLTextBox::Params params; + params.name("TimeCtrl Label"); + params.rect(label_rect); + params.initial_value(p.label()); + if (p.font.isProvided()) + { + params.font(p.font); + } + mLabelBox = LLUICtrlFactory::create<LLTextBox> (params); + addChild(mLabelBox); + + editor_left = label_rect.mRight + spinctrl_spacing; + } + + S32 editor_right = getRect().getWidth() - spinctrl_btn_width - spinctrl_spacing; + + //================= Editor ================// + LLRect editor_rect( editor_left, centered_top, editor_right, centered_bottom ); + LLLineEditor::Params params; + params.name("SpinCtrl Editor"); + params.rect(editor_rect); + if (p.font.isProvided()) + { + params.font(p.font); + } + + params.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); + params.max_length.chars(8); + params.keystroke_callback(boost::bind(&LLTimeCtrl::onTextEntry, this, _1)); + mEditor = LLUICtrlFactory::create<LLLineEditor> (params); + mEditor->setPrevalidateInput(LLTextValidate::validateNonNegativeS32NoSpace); + mEditor->setPrevalidate(boost::bind(&LLTimeCtrl::isTimeStringValid, this, _1)); + mEditor->setText(LLStringExplicit("12:00 AM")); + addChild(mEditor); + + //================= Spin Buttons ==========// + LLButton::Params up_button_params(p.up_button); + up_button_params.rect = LLRect(editor_right + 1, getRect().getHeight(), editor_right + spinctrl_btn_width, getRect().getHeight() - spinctrl_btn_height); + + up_button_params.click_callback.function(boost::bind(&LLTimeCtrl::onUpBtn, this)); + up_button_params.mouse_held_callback.function(boost::bind(&LLTimeCtrl::onUpBtn, this)); + mUpBtn = LLUICtrlFactory::create<LLButton>(up_button_params); + addChild(mUpBtn); + + LLButton::Params down_button_params(p.down_button); + down_button_params.rect = LLRect(editor_right + 1, getRect().getHeight() - spinctrl_btn_height, editor_right + spinctrl_btn_width, getRect().getHeight() - 2 * spinctrl_btn_height); + down_button_params.click_callback.function(boost::bind(&LLTimeCtrl::onDownBtn, this)); + down_button_params.mouse_held_callback.function(boost::bind(&LLTimeCtrl::onDownBtn, this)); + mDownBtn = LLUICtrlFactory::create<LLButton>(down_button_params); + addChild(mDownBtn); + + setUseBoundingRect( TRUE ); +} + +F32 LLTimeCtrl::getTime24() const +{ + // 0.0 - 23.99; + return mTime / 60.0f; +} + +U32 LLTimeCtrl::getHours24() const +{ + return (U32) getTime24(); +} + +U32 LLTimeCtrl::getMinutes() const +{ + return mTime % MINUTES_PER_HOUR; +} + +void LLTimeCtrl::setTime24(F32 time) +{ + time = llclamp(time, 0.0f, 23.99f); // fix out of range values + mTime = llround(time * MINUTES_PER_HOUR); // fixes values like 4.99999 + + updateText(); +} + +BOOL LLTimeCtrl::handleKeyHere(KEY key, MASK mask) +{ + if (mEditor->hasFocus()) + { + if(key == KEY_UP) + { + onUpBtn(); + return TRUE; + } + if(key == KEY_DOWN) + { + onDownBtn(); + return TRUE; + } + if (key == KEY_RETURN) + { + onCommit(); + return TRUE; + } + } + return FALSE; +} + +void LLTimeCtrl::onUpBtn() +{ + switch(getEditingPart()) + { + case HOURS: + increaseHours(); + break; + case MINUTES: + increaseMinutes(); + break; + case DAYPART: + switchDayPeriod(); + break; + default: + break; + } + + updateText(); + onCommit(); +} + +void LLTimeCtrl::onDownBtn() +{ + switch(getEditingPart()) + { + case HOURS: + decreaseHours(); + break; + case MINUTES: + decreaseMinutes(); + break; + case DAYPART: + switchDayPeriod(); + break; + default: + break; + } + + updateText(); + onCommit(); +} + +void LLTimeCtrl::onFocusLost() +{ + updateText(); + onCommit(); + LLUICtrl::onFocusLost(); +} + +void LLTimeCtrl::onTextEntry(LLLineEditor* line_editor) +{ + std::string time_str = line_editor->getText(); + U32 h12 = parseHours(getHoursString(time_str)); + U32 m = parseMinutes(getMinutesString(time_str)); + bool pm = parseAMPM(getAMPMString(time_str)); + + if (h12 == 12) + { + h12 = 0; + } + + U32 h24 = pm ? h12 + 12 : h12; + + mTime = h24 * MINUTES_PER_HOUR + m; +} + +bool LLTimeCtrl::isTimeStringValid(const LLWString &wstr) +{ + std::string str = wstring_to_utf8str(wstr); + + return isHoursStringValid(getHoursString(str)) && + isMinutesStringValid(getMinutesString(str)) && + isPMAMStringValid(getAMPMString(str)); +} + +void LLTimeCtrl::increaseMinutes() +{ + mTime = (mTime + mSnapToMin) % MINUTES_PER_DAY - (mTime % mSnapToMin); +} + +void LLTimeCtrl::increaseHours() +{ + mTime = (mTime + MINUTES_PER_HOUR) % MINUTES_PER_DAY; +} + +void LLTimeCtrl::decreaseMinutes() +{ + if (mTime < mSnapToMin) + { + mTime = MINUTES_PER_DAY - mTime; + } + + mTime -= (mTime % mSnapToMin) ? mTime % mSnapToMin : mSnapToMin; +} + +void LLTimeCtrl::decreaseHours() +{ + if (mTime < MINUTES_PER_HOUR) + { + mTime = 23 * MINUTES_PER_HOUR + mTime; + } + else + { + mTime -= MINUTES_PER_HOUR; + } +} + +bool LLTimeCtrl::isPM() const +{ + return mTime >= (MINUTES_PER_DAY / 2); +} + +void LLTimeCtrl::switchDayPeriod() +{ + if (isPM()) + { + mTime -= MINUTES_PER_DAY / 2; + } + else + { + mTime += MINUTES_PER_DAY / 2; + } +} + +void LLTimeCtrl::updateText() +{ + U32 h24 = getHours24(); + U32 m = getMinutes(); + U32 h12 = h24 > 12 ? h24 - 12 : h24; + + if (h12 == 0) + h12 = 12; + + mEditor->setText(llformat("%d:%02d %s", h12, m, isPM() ? "PM":"AM")); +} + +LLTimeCtrl::EEditingPart LLTimeCtrl::getEditingPart() +{ + S32 cur_pos = mEditor->getCursor(); + std::string time_str = mEditor->getText(); + + S32 colon_index = time_str.find_first_of(':'); + + if (cur_pos <= colon_index) + { + return HOURS; + } + else if (cur_pos > colon_index && cur_pos <= (S32)(time_str.length() - AMPM_LEN)) + { + return MINUTES; + } + else if (cur_pos > (S32)(time_str.length() - AMPM_LEN)) + { + return DAYPART; + } + + return NONE; +} + +// static +std::string LLTimeCtrl::getHoursString(const std::string& str) +{ + size_t colon_index = str.find_first_of(':'); + std::string hours_str = str.substr(0, colon_index); + + return hours_str; +} + +// static +std::string LLTimeCtrl::getMinutesString(const std::string& str) +{ + size_t colon_index = str.find_first_of(':'); + ++colon_index; + + int minutes_len = str.length() - colon_index - AMPM_LEN; + std::string minutes_str = str.substr(colon_index, minutes_len); + + return minutes_str; +} + +// static +std::string LLTimeCtrl::getAMPMString(const std::string& str) +{ + return str.substr(str.size() - 2, 2); // returns last two characters +} + +// static +bool LLTimeCtrl::isHoursStringValid(const std::string& str) +{ + U32 hours; + if ((!LLStringUtil::convertToU32(str, hours) || (hours <= HOURS_MAX)) && str.length() < 3) + return true; + + return false; +} + +// static +bool LLTimeCtrl::isMinutesStringValid(const std::string& str) +{ + U32 minutes; + if (!LLStringUtil::convertToU32(str, minutes) || (minutes <= MINUTES_MAX) && str.length() < 3) + return true; + + return false; +} + +// static +bool LLTimeCtrl::isPMAMStringValid(const std::string& str) +{ + S32 len = str.length(); + + bool valid = (str[--len] == 'M') && (str[--len] == 'P' || str[len] == 'A'); + + return valid; +} + +// static +U32 LLTimeCtrl::parseHours(const std::string& str) +{ + U32 hours; + if (LLStringUtil::convertToU32(str, hours) && (hours >= HOURS_MIN) && (hours <= HOURS_MAX)) + { + return hours; + } + else + { + return HOURS_MIN; + } +} + +// static +U32 LLTimeCtrl::parseMinutes(const std::string& str) +{ + U32 minutes; + if (LLStringUtil::convertToU32(str, minutes) && (minutes >= MINUTES_MIN) && (minutes <= MINUTES_MAX)) + { + return minutes; + } + else + { + return MINUTES_MIN; + } +} + +// static +bool LLTimeCtrl::parseAMPM(const std::string& str) +{ + return str == "PM"; +} diff --git a/indra/llui/lltimectrl.h b/indra/llui/lltimectrl.h new file mode 100644 index 0000000000..b5f268c76a --- /dev/null +++ b/indra/llui/lltimectrl.h @@ -0,0 +1,131 @@ +/** + * @file lltimectrl.h + * @brief Time control + * + * $LicenseInfo:firstyear=2002&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 LLTIMECTRL_H_ +#define LLTIMECTRL_H_ + +#include "stdtypes.h" +#include "llbutton.h" +#include "v4color.h" +#include "llrect.h" + +class LLLineEditor; + +class LLTimeCtrl +: public LLUICtrl +{ + LOG_CLASS(LLTimeCtrl); +public: + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional<S32> label_width; + Optional<S32> snap_to; + Optional<bool> allow_text_entry; + + Optional<LLUIColor> text_enabled_color; + Optional<LLUIColor> text_disabled_color; + + Optional<LLButton::Params> up_button; + Optional<LLButton::Params> down_button; + + Params(); + }; + + F32 getTime24() const; // 0.0 - 24.0 + U32 getHours24() const; // 0 - 23 + U32 getMinutes() const; // 0 - 59 + + void setTime24(F32 time); // 0.0 - 23.98(3) + +protected: + LLTimeCtrl(const Params&); + friend class LLUICtrlFactory; + +private: + + enum EDayPeriod + { + AM, + PM + }; + + enum EEditingPart + { + HOURS, + MINUTES, + DAYPART, + NONE + }; + + virtual void onFocusLost(); + virtual BOOL handleKeyHere(KEY key, MASK mask); + + void onUpBtn(); + void onDownBtn(); + void onTextEntry(LLLineEditor* line_editor); + + bool isTimeStringValid(const LLWString& wstr); + + void increaseMinutes(); + void increaseHours(); + + void decreaseMinutes(); + void decreaseHours(); + + bool isPM() const; + void switchDayPeriod(); + + void updateText(); + + EEditingPart getEditingPart(); + + static std::string getHoursString(const std::string& str); + static std::string getMinutesString(const std::string& str); + static std::string getAMPMString(const std::string& str); + + static bool isHoursStringValid(const std::string& str); + static bool isMinutesStringValid(const std::string& str); + static bool isPMAMStringValid(const std::string& str); + + static U32 parseHours(const std::string& str); + static U32 parseMinutes(const std::string& str); + static bool parseAMPM(const std::string& str); + + class LLTextBox* mLabelBox; + + class LLLineEditor* mEditor; + LLUIColor mTextEnabledColor; + LLUIColor mTextDisabledColor; + + class LLButton* mUpBtn; + class LLButton* mDownBtn; + + U32 mTime; // minutes since midnight: 0 - 1439 + U32 mSnapToMin; // interval in minutes to snap to + + BOOL mAllowEdit; +}; +#endif /* LLTIMECTRL_H_ */ diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0a06b5e74f..d58df5801b 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -68,6 +68,7 @@ LLUICtrl::ControlVisibility::ControlVisibility() LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), + requests_front("requests_front", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -96,9 +97,10 @@ const LLUICtrl::Params& LLUICtrl::getDefaultParams() LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) : LLView(p), - mTentative(FALSE), mIsChrome(FALSE), + mRequestsFront(p.requests_front), mTabStop(FALSE), + mTentative(FALSE), mViewModel(viewmodel), mControlVariable(NULL), mEnabledControlVariable(NULL), @@ -123,6 +125,8 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + mRequestsFront = p.requests_front; + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) @@ -403,6 +407,36 @@ LLViewModel* LLUICtrl::getViewModel() const return mViewModel; } +//virtual +BOOL LLUICtrl::postBuild() +{ + // + // Find all of the children that want to be in front and move them to the front + // + + if (getChildCount() > 0) + { + std::vector<LLUICtrl*> childrenToMoveToFront; + + for (LLView::child_list_const_iter_t child_it = beginChild(); child_it != endChild(); ++child_it) + { + LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(*child_it); + + if (uictrl && uictrl->mRequestsFront) + { + childrenToMoveToFront.push_back(uictrl); + } + } + + for (std::vector<LLUICtrl*>::iterator it = childrenToMoveToFront.begin(); it != childrenToMoveToFront.end(); ++it) + { + sendChildToFront(*it); + } + } + + return LLView::postBuild(); +} + bool LLUICtrl::setControlValue(const LLSD& value) { if (mControlVariable) diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index b37e9f6b1b..09bed9b958 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -94,7 +94,8 @@ public: { Optional<std::string> label; Optional<bool> tab_stop, - chrome; + chrome, + requests_front; Optional<LLSD> initial_value; Optional<CommitCallbackParam> init_callback, @@ -143,6 +144,8 @@ protected: virtual LLViewModel* getViewModel() const; // We shouldn't ever need to set this directly //virtual void setViewModel(const LLViewModelPtr&); + + virtual BOOL postBuild(); public: // LLView interface @@ -301,8 +304,9 @@ protected: private: - BOOL mTabStop; BOOL mIsChrome; + BOOL mRequestsFront; + BOOL mTabStop; BOOL mTentative; LLRootHandle<LLUICtrl> mUICtrlHandle; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 245126d178..8803d106ba 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1299,15 +1299,7 @@ void LLView::drawChildren() { if (!mChildList.empty()) { - static const LLRect* rootRect = NULL; - - if (!mParentView) - { - rootRect = &mRect; - } - - LLRect screenRect; - + LLView* rootp = LLUI::getRootView(); ++sDepth; for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter) @@ -1317,9 +1309,8 @@ void LLView::drawChildren() if (viewp->getVisible() && viewp->getRect().isValid()) { - // Only draw views that are within the root view - localRectToScreen(viewp->getRect(),&screenRect); - if ( rootRect->overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect)) + LLRect screen_rect = viewp->calcScreenRect(); + if ( rootp->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) { LLUI::pushMatrix(); { diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index e09ef33d49..3cd61e574e 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -95,7 +95,7 @@ namespace LLInitParam { const U8* my_addr = reinterpret_cast<const U8*>(this); const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); - mEnclosingBlockOffset = (U16)(my_addr - block_addr); + mEnclosingBlockOffset = 0x7FFFffff & ((U32)(my_addr - block_addr)); } bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, S32 generation){ return true; } diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index b3312798dd..c024fd405e 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -40,7 +40,7 @@ namespace LLInitParam { const U8* my_addr = reinterpret_cast<const U8*>(this); const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); - mEnclosingBlockOffset = (U16)(my_addr - block_addr); + mEnclosingBlockOffset = 0x7FFFffff & ((U32)(my_addr - block_addr)); } // diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index a853999e94..35c889b69f 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -34,6 +34,8 @@ #include <boost/unordered_map.hpp> #include <boost/shared_ptr.hpp> +#include "llerror.h" + namespace LLInitParam { template<typename T> const T& defaultValue() { static T value; return value; } @@ -302,8 +304,9 @@ namespace LLInitParam private: friend class BaseBlock; - U16 mEnclosingBlockOffset; - bool mIsProvided; + U32 mEnclosingBlockOffset:31; + U32 mIsProvided:1; + }; // various callbacks and constraints associated with an individual param diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l index 188c9e1950..4e103ae2ba 100644 --- a/indra/lscript/lscript_compile/indra.l +++ b/indra/lscript/lscript_compile/indra.l @@ -603,6 +603,8 @@ extern "C" { int yyerror(const char *fmt, ...); } "PARCEL_DETAILS_OWNER" { count(); yylval.ival = PARCEL_DETAILS_OWNER; return(INTEGER_CONSTANT); } "PARCEL_DETAILS_GROUP" { count(); yylval.ival = PARCEL_DETAILS_GROUP; return(INTEGER_CONSTANT); } "PARCEL_DETAILS_AREA" { count(); yylval.ival = PARCEL_DETAILS_AREA; return(INTEGER_CONSTANT); } +"PARCEL_DETAILS_ID" { count(); yylval.ival = PARCEL_DETAILS_ID; return(INTEGER_CONSTANT); } +"PARCEL_DETAILS_SEE_AVATARS" { count(); yylval.ival = PARCEL_DETAILS_SEE_AVATARS; return(INTEGER_CONSTANT); } "STRING_TRIM_HEAD" { count(); yylval.ival = STRING_TRIM_HEAD; return(INTEGER_CONSTANT); } "STRING_TRIM_TAIL" { count(); yylval.ival = STRING_TRIM_TAIL; return(INTEGER_CONSTANT); } diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 27f3c7260e..fca071c628 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1168,19 +1168,11 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) authResponse(message_in); } else - if(message_name == "js_expose_object") + if(message_name == "js_enable_object") { #if LLQTWEBKIT_API_VERSION >= 9 - bool expose_object = message_in.getValueBoolean( "expose" ); - LLQtWebKit::getInstance()->setExposeObject( expose_object ); -#endif - } - else - if(message_name == "js_values_valid") - { -#if LLQTWEBKIT_API_VERSION >= 9 - bool valid = message_in.getValueBoolean( "valid" ); - LLQtWebKit::getInstance()->setValuesValid( valid ); + bool enable = message_in.getValueBoolean( "enable" ); + LLQtWebKit::getInstance()->setSLObjectEnabled( enable ); #endif } else @@ -1191,6 +1183,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) F32 y = message_in.getValueReal("y"); F32 z = message_in.getValueReal("z"); LLQtWebKit::getInstance()->setAgentLocation( x, y, z ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1201,6 +1194,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) F32 y = message_in.getValueReal("y"); F32 z = message_in.getValueReal("z"); LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1209,6 +1203,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) #if LLQTWEBKIT_API_VERSION >= 9 F32 angle = message_in.getValueReal("angle"); LLQtWebKit::getInstance()->setAgentOrientation( angle ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1217,14 +1212,25 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) #if LLQTWEBKIT_API_VERSION >= 9 const std::string& region = message_in.getValue("region"); LLQtWebKit::getInstance()->setAgentRegion( region ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else - if(message_name == "js_agent_maturity") + if(message_name == "js_agent_maturity") + { +#if LLQTWEBKIT_API_VERSION >= 9 + const std::string& maturity = message_in.getValue("maturity"); + LLQtWebKit::getInstance()->setAgentMaturity( maturity ); + LLQtWebKit::getInstance()->emitMaturity(); +#endif + } + else + if(message_name == "js_agent_language") { #if LLQTWEBKIT_API_VERSION >= 9 - const std::string& maturity = message_in.getValue("maturity"); - LLQtWebKit::getInstance()->setAgentMaturity( maturity ); + const std::string& language = message_in.getValue("language"); + LLQtWebKit::getInstance()->setAgentLanguage( language ); + LLQtWebKit::getInstance()->emitLanguage(); #endif } else @@ -1384,3 +1390,5 @@ int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void return 0; } + + diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c4018cd79c..703f7b5ea6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -120,7 +120,6 @@ set(viewer_SOURCE_FILES llchiclet.cpp llclassifiedinfo.cpp llclassifiedstatsresponder.cpp - llcloud.cpp llcofwearables.cpp llcolorswatch.cpp llcommanddispatcherlistener.cpp @@ -131,6 +130,7 @@ set(viewer_SOURCE_FILES llcurrencyuimanager.cpp llcylinder.cpp lldateutil.cpp + lldaycyclemanager.cpp lldebugmessagebox.cpp lldebugview.cpp lldelayedgestureerror.cpp @@ -150,6 +150,7 @@ set(viewer_SOURCE_FILES lldrawpoolwlsky.cpp lldriverparam.cpp lldynamictexture.cpp + llenvmanager.cpp llemote.cpp lleventnotifier.cpp lleventpoll.cpp @@ -179,9 +180,12 @@ set(viewer_SOURCE_FILES llfloaterbuyland.cpp llfloatercamera.cpp llfloatercolorpicker.cpp - llfloaterdaycycle.cpp + llfloaterdeleteenvpreset.cpp llfloaterdisplayname.cpp - llfloaterenvsettings.cpp + llfloatereditdaycycle.cpp + llfloatereditsky.cpp + llfloatereditwater.cpp + llfloaterenvironmentsettings.cpp llfloaterevent.cpp llfloaterfonttest.cpp llfloatergesture.cpp @@ -235,10 +239,8 @@ set(viewer_SOURCE_FILES llfloateruipreview.cpp llfloaterurlentry.cpp llfloatervoiceeffect.cpp - llfloaterwater.cpp llfloaterwebcontent.cpp llfloaterwhitelistentry.cpp - llfloaterwindlight.cpp llfloaterwindowsize.cpp llfloaterworldmap.cpp llfolderview.cpp @@ -362,6 +364,9 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp + llpanelmarketplaceinbox.cpp + llpanelmarketplaceinboxinventory.cpp + llpanelmarketplaceoutbox.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -412,6 +417,7 @@ set(viewer_SOURCE_FILES llproductinforequest.cpp llprogressview.cpp llrecentpeople.cpp + llregioninfomodel.cpp llregionposition.cpp llremoteparcelrequest.cpp llsavedsettingsglue.cpp @@ -521,7 +527,7 @@ set(viewer_SOURCE_FILES llviewerfloaterreg.cpp llviewerfoldertype.cpp llviewergenericmessage.cpp - llviewergesture.cpp + llviewergesture.cpp llviewerhelp.cpp llviewerhelputil.cpp llviewerhome.cpp @@ -568,7 +574,6 @@ set(viewer_SOURCE_FILES llvoavatardefines.cpp llvoavatarself.cpp llvocache.cpp - llvoclouds.cpp llvograss.cpp llvoground.cpp llvoicecallhandler.cpp @@ -597,6 +602,7 @@ set(viewer_SOURCE_FILES llwind.cpp llwlanimator.cpp llwldaycycle.cpp + llwlhandlers.cpp llwlparammanager.cpp llwlparamset.cpp llworld.cpp @@ -675,7 +681,6 @@ set(viewer_HEADER_FILES llchiclet.h llclassifiedinfo.h llclassifiedstatsresponder.h - llcloud.h llcofwearables.h llcolorswatch.h llcommanddispatcherlistener.h @@ -686,6 +691,7 @@ set(viewer_HEADER_FILES llcurrencyuimanager.h llcylinder.h lldateutil.h + lldaycyclemanager.h lldebugmessagebox.h lldebugview.h lldelayedgestureerror.h @@ -696,7 +702,6 @@ set(viewer_HEADER_FILES lldrawpoolalpha.h lldrawpoolavatar.h lldrawpoolbump.h - lldrawpoolclouds.h lldrawpoolground.h lldrawpoolsimple.h lldrawpoolsky.h @@ -707,6 +712,7 @@ set(viewer_HEADER_FILES lldriverparam.h lldynamictexture.h llemote.h + llenvmanager.h lleventnotifier.h lleventpoll.h llexpandabletextbox.h @@ -735,9 +741,12 @@ set(viewer_HEADER_FILES llfloaterbuyland.h llfloatercamera.h llfloatercolorpicker.h - llfloaterdaycycle.h + llfloaterdeleteenvpreset.h llfloaterdisplayname.h - llfloaterenvsettings.h + llfloatereditdaycycle.h + llfloatereditsky.h + llfloatereditwater.h + llfloaterenvironmentsettings.h llfloaterevent.h llfloaterfonttest.h llfloatergesture.h @@ -791,10 +800,8 @@ set(viewer_HEADER_FILES llfloateruipreview.h llfloaterurlentry.h llfloatervoiceeffect.h - llfloaterwater.h llfloaterwebcontent.h llfloaterwhitelistentry.h - llfloaterwindlight.h llfloaterwindowsize.h llfloaterworldmap.h llfolderview.h @@ -912,6 +919,9 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h + llpanelmarketplaceinbox.h + llpanelmarketplaceinboxinventory.h + llpanelmarketplaceoutbox.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h @@ -962,6 +972,7 @@ set(viewer_HEADER_FILES llproductinforequest.h llprogressview.h llrecentpeople.h + llregioninfomodel.h llregionposition.h llremoteparcelrequest.h llresourcedata.h @@ -1001,7 +1012,7 @@ set(viewer_HEADER_FILES llsurface.h llsurfacepatch.h llsyswellitem.h - llsyswellwindow.h + llsyswellwindow.h lltable.h llteleporthistory.h llteleporthistorystorage.h @@ -1074,7 +1085,7 @@ set(viewer_HEADER_FILES llviewerfloaterreg.h llviewerfoldertype.h llviewergenericmessage.h - llviewergesture.h + llviewergesture.h llviewerhelp.h llviewerhome.h llviewerinventory.h @@ -1118,7 +1129,6 @@ set(viewer_HEADER_FILES llvoavatardefines.h llvoavatarself.h llvocache.h - llvoclouds.h llvograss.h llvoground.h llvoicechannel.h @@ -1147,6 +1157,7 @@ set(viewer_HEADER_FILES llwind.h llwlanimator.h llwldaycycle.h + llwlhandlers.h llwlparammanager.h llwlparamset.h llworld.h @@ -1229,7 +1240,7 @@ if (WINDOWS) # precompiled header configuration # llviewerprecompiledheaders.cpp generates # the .pch file. - # All sources added to viewer_SOURCE_FILES + # All sources added to viewer_SOURCE_FILES # at this point use it. if(USE_PRECOMPILED_HEADERS) set_source_files_properties(llviewerprecompiledheaders.cpp @@ -1238,7 +1249,7 @@ if (WINDOWS) ) set(viewer_SOURCE_FILES "${viewer_SOURCE_FILES}" llviewerprecompiledheaders.cpp) endif(USE_PRECOMPILED_HEADERS) - + # Add resource files to the project. # viewerRes.rc is the only buildable file, but # the rest are all dependencies of it. @@ -1283,8 +1294,8 @@ if (WINDOWS) set_source_files_properties(${viewer_RESOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) - set(viewer_RESOURCE_FILES - res/viewerRes.rc + set(viewer_RESOURCE_FILES + res/viewerRes.rc ${viewer_RESOURCE_FILES} ) @@ -1292,7 +1303,7 @@ if (WINDOWS) if (NOT STANDALONE) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) - endif (NOT STANDALONE) + endif (NOT STANDALONE) find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR}) find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR}) @@ -1469,7 +1480,7 @@ set(PACKAGE ON CACHE BOOL "Add a package target that builds an installer package.") if (WINDOWS) - set_target_properties(${VIEWER_BINARY_NAME} + set_target_properties(${VIEWER_BINARY_NAME} PROPERTIES # *TODO -reenable this once we get server usage sorted out #LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT /SUBSYSTEM:WINDOWS /INCLUDE:\"__tcmalloc\"" @@ -1501,7 +1512,7 @@ if (WINDOWS) ${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll ) endif(USE_GOOGLE_PERFTOOLS) - + set(COPY_INPUT_DEPENDENCIES # The following commented dependencies are determined at variably at build time. Can't do this here. @@ -1599,24 +1610,24 @@ if (WINDOWS) --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat - DEPENDS + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py stage_third_party_libs ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" ) - - add_custom_target(copy_w_viewer_manifest ALL DEPENDS ${CMAKE_CFG_INTDIR}/copy_touched.bat) + + add_custom_target(copy_w_viewer_manifest ALL DEPENDS ${CMAKE_CFG_INTDIR}/copy_touched.bat) add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon copy_w_viewer_manifest) - + if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts) endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) - - add_dependencies(${VIEWER_BINARY_NAME} - SLPlugin - windows-updater + + add_dependencies(${VIEWER_BINARY_NAME} + SLPlugin + windows-updater windows-crash-logger ) @@ -1626,7 +1637,7 @@ if (WINDOWS) TARGET ${VIEWER_BINARY_NAME} POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/tools/vstool/vstool.exe ARGS - --solution + --solution ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln --workingdir ${VIEWER_BINARY_NAME} @@ -1644,12 +1655,12 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CFG_INTDIR} - DEPENDS - lleventhost + DEPENDS + lleventhost ${EVENT_HOST_SCRIPTS} ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py ) - + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat COMMAND ${PYTHON_EXECUTABLE} @@ -1665,15 +1676,15 @@ if (WINDOWS) --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat - DEPENDS - ${VIEWER_BINARY_NAME} + DEPENDS + ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} ) - add_custom_target(package ALL DEPENDS + add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat - windows-setup-build-all + windows-setup-build-all ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... @@ -1741,7 +1752,7 @@ else (USE_KDU) ${LLIMAGEJ2COJ_LIBRARIES} ) endif (USE_KDU) - + build_version(viewer) set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH @@ -1800,13 +1811,13 @@ if (LINUX) --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged --grid=${GRID} --source=${CMAKE_CURRENT_SOURCE_DIR} - DEPENDS + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${COPY_INPUT_DEPENDENCIES} COMMENT "Performing viewer_manifest copy" ) - - add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) + + add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) add_custom_target(package ALL DEPENDS ${product}.tar.bz2) @@ -1851,7 +1862,7 @@ if (DARWIN) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-updater mac-crash-logger) if (PACKAGE) - add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) + add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) add_custom_command( TARGET package POST_BUILD @@ -1946,7 +1957,7 @@ if (LL_TESTS) ) ################################################## - # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS + # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS ################################################## # if(USE_PRECOMPILED_HEADERS) # set_source_files_properties( @@ -1960,33 +1971,33 @@ if (LL_TESTS) #set(TEST_DEBUG on) set(test_sources llcapabilitylistener.cpp) ################################################## - # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS + # DISABLING PRECOMPILED HEADERS USAGE FOR TESTS ################################################## # if(USE_PRECOMPILED_HEADERS) # set(test_sources "${test_sources}" llviewerprecompiledheaders.cpp) # endif(USE_PRECOMPILED_HEADERS) - set(test_libs - ${LLMESSAGE_LIBRARIES} - ${WINDOWS_LIBRARIES} + set(test_libs + ${LLMESSAGE_LIBRARIES} + ${WINDOWS_LIBRARIES} ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${GOOGLEMOCK_LIBRARIES} ) - LL_ADD_INTEGRATION_TEST(llcapabilitylistener - "${test_sources}" + LL_ADD_INTEGRATION_TEST(llcapabilitylistener + "${test_sources}" "${test_libs}" ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/llmessage/tests/test_llsdmessage_peer.py" ) - set(test_libs - ${LLMESSAGE_LIBRARIES} - ${WINDOWS_LIBRARIES} + set(test_libs + ${LLMESSAGE_LIBRARIES} + ${WINDOWS_LIBRARIES} ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} + ${LLCOMMON_LIBRARIES} ${GOOGLEMOCK_LIBRARIES} ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARIES} @@ -2034,6 +2045,22 @@ if (LL_TESTS) #ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer) #ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer) +include(LLAddBuildTest) +SET(viewer_TEST_SOURCE_FILES + llagentaccess.cpp + llwlparammanager.cpp + # Not *actually* a unit test, it's an integration test. + # Because it won't work in the new unit test iface, i've commented out + # and notified Nat. Delete this when it's replaced! + # + poppy & brad 2009-06-05 + # llcapabilitylistener.cpp + ) +set_source_files_properties( + ${viewer_TEST_SOURCE_FILES} + PROPERTIES + LL_TEST_ADDITIONAL_SOURCE_FILES llviewerprecompiledheaders.cpp + ) + endif (LL_TESTS) check_message_template(${VIEWER_BINARY_NAME}) diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml index d085475c6c..6e3673e7d9 100644 --- a/indra/newview/app_settings/keys.xml +++ b/indra/newview/app_settings/keys.xml @@ -181,7 +181,7 @@ <binding key="PAD_DIVIDE" mask="CTL_ALT_SHIFT" command="start_gesture"/> </third_person> - # Basic editing camera control + <!-- Basic editing camera control --> <edit> <binding key="A" mask="NONE" command="spin_around_cw"/> <binding key="D" mask="NONE" command="spin_around_ccw"/> diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 263b73ba23..9fa4046fdf 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -498,6 +498,7 @@ PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id. PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id. PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters. PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id. +PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting. STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string. STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string. diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2372c19fb9..b57657540c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1935,17 +1935,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>DebugShowUploadCost</key> - <map> - <key>Comment</key> - <string>Show what it would cost to upload assets in current scene</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>DebugShowRenderMatrices</key> <map> <key>Comment</key> @@ -4180,6 +4169,28 @@ <key>Value</key> <real>1.0</real> </map> + <key>InventoryDisplayInbox</key> + <map> + <key>Comment</key> + <string>Override received items inventory inbox display</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>InventoryDisplayOutbox</key> + <map> + <key>Comment</key> + <string>Override merchant inventory outbox display</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>InventoryLinking</key> <map> <key>Comment</key> @@ -4422,6 +4433,17 @@ <key>Value</key> <real>2.0</real> </map> + <key>LastInventoryInboxExpand</key> + <map> + <key>Comment</key> + <string>The last time the received items inbox was expanded.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> <key>LCDDestination</key> <map> <key>Comment</key> @@ -6557,7 +6579,28 @@ <key>Value</key> <integer>0</integer> </map> - + <key>PostFirstLoginIntroURL</key> + <map> + <key>Comment</key> + <string>URL of intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> + <key>PostFirstLoginIntroViewed</key> + <map> + <key>Comment</key> + <string>Flag indicating if user has seen intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <string>0</string> + </map> <key>PrecachingDelay</key> <map> <key>Comment</key> @@ -7193,7 +7236,7 @@ </array> </map> - <key>RenderAnisotropic</key> + <key>RenderAnisotropic</key> <map> <key>Comment</key> <string>Render textures using anisotropic filtering</string> @@ -9672,7 +9715,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowSnapshotButton</key> <map> @@ -10282,17 +10325,6 @@ <key>Value</key> <real>0.300000011921</real> </map> - <key>SkyEditPresets</key> - <map> - <key>Comment</key> - <string>Whether to be able to edit the sky defaults or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>SkyNightColorShift</key> <map> <key>Comment</key> @@ -10334,17 +10366,6 @@ <real>0.1</real> </array> </map> - <key>SkyUseClassicClouds</key> - <map> - <key>Comment</key> - <string>Whether to use the old Second Life particle clouds or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>1</integer> - </map> <key>SnapEnabled</key> <map> <key>Comment</key> @@ -10959,7 +10980,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <real>-2</real> + <real>-1</real> </map> <key>UIExtraTriangleWidth</key> <map> @@ -10970,7 +10991,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <real>2</real> + <real>4</real> </map> <key>UIFloaterCloseBoxSize</key> <map> @@ -11962,6 +11983,61 @@ <key>Value</key> <integer>1</integer> </map> + <key>UseEnvironmentFromRegion</key> + <map> + <key>Comment</key> + <string>Choose whether to use the region's environment settings, or override them with the local settings.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>UseDayCycle</key> + <map> + <key>Comment</key> + <string>Whether to use use a day cycle or a fixed sky.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>WaterPresetName</key> + <map> + <key>Comment</key> + <string>Water preset to use. May be superseded by region settings.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>Default</string> + </map> + <key>SkyPresetName</key> + <map> + <key>Comment</key> + <string>Sky preset to use. May be superseded by region settings or by a day cycle (see DayCycleName).</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>Default</string> + </map> + <key>DayCycleName</key> + <map> + <key>Comment</key> + <string>Day cycle to use. May be superseded by region settings.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string>Default</string> + </map> <key>UseExternalBrowser</key> <map> <key>Comment</key> @@ -12544,44 +12620,6 @@ <key>Value</key> <integer>20</integer> </map> - <key>WaterEditPresets</key> - <map> - <key>Comment</key> - <string>Whether to be able to edit the water defaults or not</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> - <key>WaterFogColor</key> - <map> - <key>Comment</key> - <string>Water fog color</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Color4</string> - <key>Value</key> - <array> - <real>0.0863</real> - <real>0.168</real> - <real>0.212</real> - <real>0</real> - </array> - </map> - <key>WaterFogDensity</key> - <map> - <key>Comment</key> - <string>Water fog density</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>F32</string> - <key>Value</key> - <real>16.0</real> - </map> <key>WaterGLFogDensityScale</key> <map> <key>Comment</key> @@ -13396,5 +13434,43 @@ <key>Value</key> <integer>1</integer> </map> + <key>WebProfileRect</key> + <map> + <key>Comment</key> + <string>Web profile dimensions</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Rect</string> + <key>Value</key> + <array> + <integer>0</integer> + <integer>650</integer> + <integer>490</integer> + <integer>0</integer> + </array> + </map> + <key>HelpFloaterOpen</key> + <map> + <key>Comment</key> + <string>Show Help Floater on login?</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>ShowHelpOnFirstLogin</key> + <map> + <key>Comment</key> + <string>Show Help Floater on first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> </map> </llsd> diff --git a/indra/newview/app_settings/settings_minimal.xml b/indra/newview/app_settings/settings_minimal.xml index 70a75cb4ca..29e52ab054 100644 --- a/indra/newview/app_settings/settings_minimal.xml +++ b/indra/newview/app_settings/settings_minimal.xml @@ -459,5 +459,16 @@ <key>Value</key> <integer>0</integer> </map> - </map> + <key>ShowHelpOnFirstLogin</key> + <map> + <key>Comment</key> + <string>Show Help Floater on first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + </map> </llsd> diff --git a/indra/newview/app_settings/windlight/days/Colder%20Tones.xml b/indra/newview/app_settings/windlight/days/Colder%20Tones.xml new file mode 100644 index 0000000000..63d0b099e1 --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Colder%20Tones.xml @@ -0,0 +1,28 @@ +<llsd> + <array> + <array> + <real>0</real> + <string>Midnight</string> + </array> + <array> + <real>0.24999989569187164</real> + <string>Purple</string> + </array> + <array> + <real>0.49999979138374329</real> + <string>Blue Midday</string> + </array> + <array> + <real>0.74999970197677612</real> + <string>Blizzard</string> + </array> + <array> + <real>0.87499958276748657</real> + <string>Ghost</string> + </array> + <array> + <real>0.99999958276748657</real> + <string>Midnight</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/days/Dynamic%20Richness.xml b/indra/newview/app_settings/windlight/days/Dynamic%20Richness.xml new file mode 100644 index 0000000000..f75b52e6ed --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Dynamic%20Richness.xml @@ -0,0 +1,32 @@ +<llsd> + <array> + <array> + <real>0</real> + <string>Night</string> + </array> + <array> + <real>0.12499994784593582</real> + <string>Blizzard</string> + </array> + <array> + <real>0.24999989569187164</real> + <string>Sunrise</string> + </array> + <array> + <real>0.49999979138374329</real> + <string>Midday 3</string> + </array> + <array> + <real>0.68749970197677612</real> + <string>Pirate</string> + </array> + <array> + <real>0.81249970197677612</real> + <string>Coastal Sunset</string> + </array> + <array> + <real>0.99999958276748657</real> + <string>Midnight</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/days/Pirate%27s%20Dream.xml b/indra/newview/app_settings/windlight/days/Pirate%27s%20Dream.xml new file mode 100644 index 0000000000..6dc1ba9f4d --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Pirate%27s%20Dream.xml @@ -0,0 +1,44 @@ +<llsd> + <array> + <array> + <real>0</real> + <string>A-12AM</string> + </array> + <array> + <real>0.12499994784593582</real> + <string>A-3AM</string> + </array> + <array> + <real>0.22222213447093964</real> + <string>Barcelona</string> + </array> + <array> + <real>0.30208322405815125</real> + <string>Sunrise</string> + </array> + <array> + <real>0.37499985098838806</real> + <string>Sailor's Delight</string> + </array> + <array> + <real>0.53819423913955688</real> + <string>Coastal Afternoon</string> + </array> + <array> + <real>0.63194417953491211</real> + <string>Pirate</string> + </array> + <array> + <real>0.7048608660697937</real> + <string>Desert Sunset</string> + </array> + <array> + <real>0.74999970197677612</real> + <string>Coastal Sunset</string> + </array> + <array> + <real>0.87499958276748657</real> + <string>Blizzard</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/days/Psycho%20Strobe%21.xml b/indra/newview/app_settings/windlight/days/Psycho%20Strobe%21.xml new file mode 100644 index 0000000000..302af5a9ba --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Psycho%20Strobe%21.xml @@ -0,0 +1,72 @@ +<llsd> + <array> + <array> + <real>0</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.062499973922967911</real> + <string>A-12AM</string> + </array> + <array> + <real>0.12499994784593582</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.18749992549419403</real> + <string>A-3AM</string> + </array> + <array> + <real>0.24999989569187164</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.31249985098838806</real> + <string>A-6AM</string> + </array> + <array> + <real>0.37499985098838806</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.43749979138374329</real> + <string>A-9AM</string> + </array> + <array> + <real>0.49999979138374329</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.5624997615814209</real> + <string>A-12PM</string> + </array> + <array> + <real>0.62499970197677612</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.68749970197677612</real> + <string>A-3PM</string> + </array> + <array> + <real>0.74999970197677612</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.81249970197677612</real> + <string>A-6PM</string> + </array> + <array> + <real>0.87499958276748657</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.93749958276748657</real> + <string>A-9PM</string> + </array> + <array> + <real>0.99999958276748657</real> + <string>Sheer Surreality</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/days/Tropicalia.xml b/indra/newview/app_settings/windlight/days/Tropicalia.xml new file mode 100644 index 0000000000..89a56d4a13 --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Tropicalia.xml @@ -0,0 +1,32 @@ +<llsd> + <array> + <array> + <real>0.062499973922967911</real> + <string>Purple</string> + </array> + <array> + <real>0.16666659712791443</real> + <string>Funky Funky</string> + </array> + <array> + <real>0.31249985098838806</real> + <string>Sunrise</string> + </array> + <array> + <real>0.49999979138374329</real> + <string>Fine Day</string> + </array> + <array> + <real>0.66666638851165771</real> + <string>Desert Sunset</string> + </array> + <array> + <real>0.74999970197677612</real> + <string>Sailor's Delight</string> + </array> + <array> + <real>0.95833295583724976</real> + <string>Midnight</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/days/Weird-O.xml b/indra/newview/app_settings/windlight/days/Weird-O.xml new file mode 100644 index 0000000000..1e312f2464 --- /dev/null +++ b/indra/newview/app_settings/windlight/days/Weird-O.xml @@ -0,0 +1,56 @@ +<llsd> + <array> + <array> + <real>0</real> + <string>Funky Funky</string> + </array> + <array> + <real>0.13194438815116882</real> + <string>Funky Funky Funky</string> + </array> + <array> + <real>0.26041656732559204</real> + <string>Gelatto</string> + </array> + <array> + <real>0.40624985098838806</real> + <string>Funky Funky Funky</string> + </array> + <array> + <real>0.43749979138374329</real> + <string>Ghost</string> + </array> + <array> + <real>0.46874979138374329</real> + <string>Gelatto</string> + </array> + <array> + <real>0.5486108660697937</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.6076386570930481</real> + <string>Gelatto</string> + </array> + <array> + <real>0.68055528402328491</real> + <string>Ghost</string> + </array> + <array> + <real>0.75694411993026733</real> + <string>Sheer Surreality</string> + </array> + <array> + <real>0.87847185134887695</real> + <string>Gelatto</string> + </array> + <array> + <real>0.91319411993026733</real> + <string>Funky Funky Funky</string> + </array> + <array> + <real>0.96527737379074097</real> + <string>Funky Funky Funky</string> + </array> + </array> +</llsd> diff --git a/indra/newview/app_settings/windlight/skies/Midday.xml b/indra/newview/app_settings/windlight/skies/Midday.xml new file mode 100644 index 0000000000..119b3e1418 --- /dev/null +++ b/indra/newview/app_settings/windlight/skies/Midday.xml @@ -0,0 +1,141 @@ +<llsd> + <map> + <key>ambient</key> + <array> + <real>1.0499999523162842</real> + <real>1.0499999523162842</real> + <real>1.0499999523162842</real> + <real>0.34999999403953552</real> + </array> + <key>blue_density</key> + <array> + <real>0.24475815892219543</real> + <real>0.44872328639030457</real> + <real>0.75999999046325684</real> + <real>0.37999999523162842</real> + </array> + <key>blue_horizon</key> + <array> + <real>0.49548381567001343</real> + <real>0.49548381567001343</real> + <real>0.63999998569488525</real> + <real>0.31999999284744263</real> + </array> + <key>cloud_color</key> + <array> + <real>0.40999999642372131</real> + <real>0.40999999642372131</real> + <real>0.40999999642372131</real> + <real>0.40999999642372131</real> + </array> + <key>cloud_pos_density1</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>1</real> + <real>1</real> + </array> + <key>cloud_pos_density2</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.125</real> + <real>1</real> + </array> + <key>cloud_scale</key> + <array> + <real>0.41999998688697815</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>cloud_scroll_rate</key> + <array> + <real>10.199999809265137</real> + <real>10.01099967956543</real> + </array> + <key>cloud_shadow</key> + <array> + <real>0.26999998092651367</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>density_multiplier</key> + <array> + <real>0.00017999998817685992</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>distance_multiplier</key> + <array> + <real>0.80000001192092896</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>east_angle</key> + <real>0</real> + <key>enable_cloud_scroll</key> + <array> + <boolean>1</boolean> + <boolean>1</boolean> + </array> + <key>gamma</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>glow</key> + <array> + <real>5</real> + <real>0.0010000000474974513</real> + <real>-0.47999998927116394</real> + <real>1</real> + </array> + <key>haze_density</key> + <array> + <real>0.69999998807907104</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>haze_horizon</key> + <array> + <real>0.18999999761581421</real> + <real>0.19915600121021271</real> + <real>0.19915600121021271</real> + <real>1</real> + </array> + <key>lightnorm</key> + <array> + <real>0</real> + <real>1</real> + <real>-4.3711388286737929e-008</real> + <real>0</real> + </array> + <key>max_y</key> + <array> + <real>1605</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>preset_num</key> + <integer>22</integer> + <key>star_brightness</key> + <real>0</real> + <key>sun_angle</key> + <real>1.5707963705062866</real> + <key>sunlight_color</key> + <array> + <real>0.7342105507850647</real> + <real>0.78157895803451538</real> + <real>0.89999997615814209</real> + <real>0.29999998211860657</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/windlight/skies/Midnight.xml b/indra/newview/app_settings/windlight/skies/Midnight.xml new file mode 100644 index 0000000000..0aba31214a --- /dev/null +++ b/indra/newview/app_settings/windlight/skies/Midnight.xml @@ -0,0 +1,141 @@ +<llsd> + <map> + <key>ambient</key> + <array> + <real>0.20405027270317078</real> + <real>0.24246673285961151</real> + <real>0.32999998331069946</real> + <real>0.10999999940395355</real> + </array> + <key>blue_density</key> + <array> + <real>0.44999998807907104</real> + <real>0.44999998807907104</real> + <real>0.44999998807907104</real> + <real>1</real> + </array> + <key>blue_horizon</key> + <array> + <real>0.23999999463558197</real> + <real>0.23999999463558197</real> + <real>0.23999999463558197</real> + <real>1</real> + </array> + <key>cloud_color</key> + <array> + <real>0.22615399956703186</real> + <real>0.22615399956703186</real> + <real>0.22615399956703186</real> + <real>1</real> + </array> + <key>cloud_pos_density1</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.87999999523162842</real> + <real>1</real> + </array> + <key>cloud_pos_density2</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.125</real> + <real>1</real> + </array> + <key>cloud_scale</key> + <array> + <real>0.41999998688697815</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>cloud_scroll_rate</key> + <array> + <real>10.49940013885498</real> + <real>10.01099967956543</real> + </array> + <key>cloud_shadow</key> + <array> + <real>0.26999998092651367</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>density_multiplier</key> + <array> + <real>0.00030000001424923539</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>distance_multiplier</key> + <array> + <real>0</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>east_angle</key> + <real>0</real> + <key>enable_cloud_scroll</key> + <array> + <boolean>1</boolean> + <boolean>1</boolean> + </array> + <key>gamma</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>glow</key> + <array> + <real>5</real> + <real>0.0010000000474974513</real> + <real>-0.47999998927116394</real> + <real>1</real> + </array> + <key>haze_density</key> + <array> + <real>4</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>haze_horizon</key> + <array> + <real>0</real> + <real>0.19915600121021271</real> + <real>0.19915600121021271</real> + <real>1</real> + </array> + <key>lightnorm</key> + <array> + <real>0</real> + <real>1</real> + <real>-4.8876205482883961e-007</real> + <real>1</real> + </array> + <key>max_y</key> + <array> + <real>906.20001220703125</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>preset_num</key> + <integer>22</integer> + <key>star_brightness</key> + <real>2</real> + <key>sun_angle</key> + <real>4.7123894691467285</real> + <key>sunlight_color</key> + <array> + <real>0.34876692295074463</real> + <real>0.35574248433113098</real> + <real>0.65999996662139893</real> + <real>0.2199999988079071</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/windlight/skies/Sunrise.xml b/indra/newview/app_settings/windlight/skies/Sunrise.xml new file mode 100644 index 0000000000..bbc7aeec59 --- /dev/null +++ b/indra/newview/app_settings/windlight/skies/Sunrise.xml @@ -0,0 +1,141 @@ +<llsd> + <map> + <key>ambient</key> + <array> + <real>0.80999994277954102</real> + <real>0.46289783716201782</real> + <real>0.62999993562698364</real> + <real>0.26999998092651367</real> + </array> + <key>blue_density</key> + <array> + <real>0.15793180465698242</real> + <real>0.43499568104743958</real> + <real>0.87000000476837158</real> + <real>0.87000000476837158</real> + </array> + <key>blue_horizon</key> + <array> + <real>0.20673196017742157</real> + <real>0.40988314151763916</real> + <real>0.47999998927116394</real> + <real>0.47999998927116394</real> + </array> + <key>cloud_color</key> + <array> + <real>0.22616604226328718</real> + <real>0.22616604226328718</real> + <real>0.22616604226328718</real> + <real>0.99997219085526012</real> + </array> + <key>cloud_pos_density1</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.88000025272481253</real> + <real>1</real> + </array> + <key>cloud_pos_density2</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.125</real> + <real>1</real> + </array> + <key>cloud_scale</key> + <array> + <real>0.41999998688697815</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>cloud_scroll_rate</key> + <array> + <real>10.49940013883861</real> + <real>10.010999679576344</real> + </array> + <key>cloud_shadow</key> + <array> + <real>0.26999998092651367</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>density_multiplier</key> + <array> + <real>0.00062000000616535544</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>distance_multiplier</key> + <array> + <real>2.6999279499073054</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>east_angle</key> + <real>0</real> + <key>enable_cloud_scroll</key> + <array> + <boolean>1</boolean> + <boolean>1</boolean> + </array> + <key>gamma</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>glow</key> + <array> + <real>5.0009990693069994</real> + <real>0.0010000000474963411</real> + <real>-0.48000101923815919</real> + <real>1</real> + </array> + <key>haze_density</key> + <array> + <real>0.53999996185302734</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>haze_horizon</key> + <array> + <real>0.15999999642372131</real> + <real>0.19915600121021271</real> + <real>0.19915600121021271</real> + <real>1</real> + </array> + <key>lightnorm</key> + <array> + <real>0</real> + <real>0.094108223915100098</real> + <real>0.99556195735931396</real> + <real>0</real> + </array> + <key>max_y</key> + <array> + <real>563</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>preset_num</key> + <integer>22</integer> + <key>star_brightness</key> + <real>0</real> + <key>sun_angle</key> + <real>0.094247691333293915</real> + <key>sunlight_color</key> + <array> + <real>2.369999885559082</real> + <real>2.369999885559082</real> + <real>2.369999885559082</real> + <real>0.78999996185302734</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/windlight/skies/Sunset.xml b/indra/newview/app_settings/windlight/skies/Sunset.xml new file mode 100644 index 0000000000..ebf08e1a3f --- /dev/null +++ b/indra/newview/app_settings/windlight/skies/Sunset.xml @@ -0,0 +1,142 @@ +<llsd> + <map> + <key>ambient</key> + <array> + <real>1.0199999809265137</real> + <real>0.80999994277954102</real> + <real>0.80999994277954102</real> + <real>1.0199999809265137</real> + </array> + <key>blue_density</key> + <array> + <real>0.14522500336170197</real> + <real>0.39999699592590332</real> + <real>0.80000197887420654</real> + <real>1</real> + </array> + <key>blue_horizon</key> + <array> + <real>0.10767599940299988</real> + <real>0.21348699927330017</real> + <real>0.25</real> + <real>1</real> + </array> + <key>cloud_color</key> + <array> + <real>0.22615399956703186</real> + <real>0.22615399956703186</real> + <real>0.22615399956703186</real> + <real>1</real> + </array> + <key>cloud_pos_density1</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.87999999523162842</real> + <real>1</real> + </array> + <key>cloud_pos_density2</key> + <array> + <real>1.6884100437164307</real> + <real>0.52609699964523315</real> + <real>0.125</real> + <real>1</real> + </array> + <key>cloud_scale</key> + <array> + <real>0.41999998688697815</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>cloud_scroll_rate</key> + <array> + <real>10.49940013885498</real> + <real>10.01099967956543</real> + </array> + <key>cloud_shadow</key> + <array> + <real>0.26999998092651367</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>density_multiplier</key> + <array> + <real>0.00046000001020729542</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>distance_multiplier</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>east_angle</key> + <real>0</real> + <key>enable_cloud_scroll</key> + <array> + <boolean>1</boolean> + <boolean>1</boolean> + </array> + <key>gamma</key> + <array> + <real>1</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>glow</key> + <array> + <real>5</real> + <real>0.0010000000474974513</real> + <real>-0.47999998927116394</real> + <real>1</real> + </array> + <key>haze_density</key> + <array> + <real>0.69999998807907104</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>haze_horizon</key> + <array> + <real>0.15999999642372131</real> + <real>0.19915600121021271</real> + <real>0.19915600121021271</real> + <real>1</real> + </array> + <key>lightnorm</key> + <array> + <real>0</real> + <real>0.07532646507024765</real> + <real>-0.99715894460678101</real> + <real>0</real> + </array> + <key>max_y</key> + <array> + <real>562.5</real> + <real>0</real> + <real>0</real> + <real>1</real> + </array> + <key>preset_num</key> + <integer>22</integer> + <key>star_brightness</key> + <real>0</real> + <key>sun_angle</key> + <real>3.0661947727203369</real> + <key>sunlight_color</key> + <array> + <real>2.8385701179504395</real> + <real>2.8385701179504395</real> + <real>2.8385701179504395</real> + <real>1</real> + </array> + </map> +</llsd> + diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 5384660d4c..22c79a4cbd 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -60,7 +60,6 @@ Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 -SkyUseClassicClouds 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 WatchdogDisabled 1 1 @@ -93,7 +92,6 @@ RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index dab73dc3d1..649f5ebd18 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -58,7 +58,6 @@ WLSkyDetail 1 128 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 -SkyUseClassicClouds 1 1 RenderShaderLightingMaxLevel 1 3 RenderDeferred 1 1 RenderDeferredSSAO 1 1 @@ -91,7 +90,6 @@ RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index a1e25aae08..ee08e78af5 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -59,7 +59,6 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 0.5 RenderShaderLightingMaxLevel 1 3 -SkyUseClassicClouds 1 1 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 @@ -93,7 +92,6 @@ RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index ce2adac221..ba74f9a6c2 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -59,7 +59,6 @@ Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 1.0 RenderShaderLightingMaxLevel 1 3 -SkyUseClassicClouds 1 1 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 @@ -93,7 +92,6 @@ RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 -SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 0 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 446ded8096..8954937f69 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -41,6 +41,7 @@ #include "llcapabilitylistener.h" #include "llchannelmanager.h" #include "llconsole.h" +#include "llenvmanager.h" #include "llfirstuse.h" #include "llfloatercamera.h" #include "llfloaterreg.h" @@ -84,6 +85,7 @@ #include "llwindow.h" #include "llworld.h" #include "llworldmap.h" +#include "stringize.h" using namespace LLVOAvatarDefines; @@ -608,6 +610,8 @@ void LLAgent::standUp() //----------------------------------------------------------------------------- void LLAgent::setRegion(LLViewerRegion *regionp) { + bool teleport = true; + llassert(regionp); if (mRegionp != regionp) { @@ -645,6 +649,8 @@ void LLAgent::setRegion(LLViewerRegion *regionp) gSky.mVOGroundp->setRegion(regionp); } + // Notify windlight managers + teleport = (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE); } else { @@ -685,6 +691,15 @@ void LLAgent::setRegion(LLViewerRegion *regionp) LLSelectMgr::getInstance()->updateSelectionCenter(); LLFloaterMove::sUpdateFlyingStatus(); + + if (teleport) + { + LLEnvManagerNew::instance().onTeleport(); + } + else + { + LLEnvManagerNew::instance().onRegionCrossing(); + } } @@ -3335,6 +3350,9 @@ bool LLAgent::teleportCore(bool is_local) // hide land floater too - it'll be out of date LLFloaterReg::hideInstance("about_land"); + // hide the Region/Estate floater + LLFloaterReg::hideInstance("region_info"); + // hide the search floater (EXT-8276) LLFloaterReg::hideInstance("search"); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d426afb17c..36272f0c7c 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -33,7 +33,6 @@ #include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" -#include "llfolderview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" @@ -45,6 +44,7 @@ #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltexlayer.h" +#include "lltooldraganddrop.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "llwearable.h" diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d2582d524d..1d9519d675 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1,4 +1,4 @@ - /** +/** * @file llappviewer.cpp * @brief The LLAppViewer class definitions * @@ -1640,9 +1640,7 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning up Objects" << llendflush; LLViewerObject::cleanupVOClasses(); - - LLWaterParamManager::cleanupClass(); - LLWLParamManager::cleanupClass(); + LLPostProcess::cleanupClass(); LLTracker::cleanupInstance(); @@ -4341,7 +4339,6 @@ void LLAppViewer::idle() // // Update weather effects // - LLWorld::getInstance()->updateClouds(gFrameDTClamped); gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets // Update wind vector @@ -4357,9 +4354,6 @@ void LLAppViewer::idle() // Compute average wind and use to drive motion of water average_wind = regionp->mWind.getAverage(); - F32 cloud_density = regionp->mCloudLayer.getDensityRegion(wind_position_region); - - gSky.setCloudDensityAtAgent(cloud_density); gSky.setWind(average_wind); //LLVOWater::setWind(average_wind); } diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 955f19c82c..8344b08bfb 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -49,6 +49,7 @@ #include "llfloaterpay.h" #include "llfloaterwebcontent.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llgiveinventory.h" #include "llinventorybridge.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType @@ -69,6 +70,7 @@ #include "lltrans.h" #include "llcallingcard.h" #include "llslurl.h" // IDEVO +#include "llsidepanelinventory.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -312,7 +314,9 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa std::string url = getProfileURL(username); // PROFILES: open in webkit window - LLWeb::loadWebURLInternal(url, "", agent_id.asString()); + const bool show_chrome = false; + static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); + LLFloaterWebContent::create(url, "", agent_id.asString(), show_chrome, profile_rect); } // static @@ -444,8 +448,6 @@ void LLAvatarActions::share(const LLUUID& id) namespace action_give_inventory { - typedef std::set<LLUUID> uuid_set_t; - /** * Returns a pointer to 'Add More' inventory panel of Edit Outfit SP. */ @@ -475,18 +477,16 @@ namespace action_give_inventory /** * Checks My Inventory visibility. */ + static bool is_give_inventory_acceptable() { - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return false; - // check selection in the panel - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool acceptable = false; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); @@ -529,12 +529,12 @@ namespace action_give_inventory } } - static void build_items_string(const uuid_set_t& inventory_selected_uuids , std::string& items_string) + static void build_items_string(const std::set<LLUUID>& inventory_selected_uuids , std::string& items_string) { llassert(inventory_selected_uuids.size() > 0); const std::string& separator = LLTrans::getString("words_separator"); - for (uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); ; ) + for (std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); ; ) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); if (NULL != inv_cat) @@ -570,10 +570,7 @@ namespace action_give_inventory return; } - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -590,8 +587,8 @@ namespace action_give_inventory // We souldn't open IM session, just calculate session ID for logging purpose. See EXT-6710 const LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, avatar_uuid); - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); const std::string& separator = LLTrans::getString("words_separator"); std::string noncopy_item_names; @@ -654,10 +651,7 @@ namespace action_give_inventory { llassert(avatar_names.size() == avatar_uuids.size()); - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -678,6 +672,33 @@ namespace action_give_inventory } } + + +//static +std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs() +{ + std::set<LLUUID> inventory_selected_uuids; + + LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); + if (active_panel) + { + inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + } + + if (inventory_selected_uuids.empty()) + { + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + LLInventoryPanel * inbox = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + inventory_selected_uuids = inbox->getRootFolder()->getSelectionList(); + } + + } + + return inventory_selected_uuids; +} + //static void LLAvatarActions::shareWithAvatars() { @@ -705,12 +726,12 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL // check selection in the panel LLFolderView* root_folder = inv_panel->getRootFolder(); - const uuid_set_t inventory_selected_uuids = root_folder->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = root_folder->getSelectionList(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool can_share = true; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 956fed7461..fbfd815f41 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -36,6 +36,7 @@ class LLInventoryPanel; + /** * Friend-related actions (add, remove, offer teleport, etc) */ @@ -196,6 +197,8 @@ public: */ static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL); + static std::set<LLUUID> getInventorySelectedUUIDs(); + private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp deleted file mode 100644 index cda0f6e4a2..0000000000 --- a/indra/newview/llcloud.cpp +++ /dev/null @@ -1,538 +0,0 @@ -/** - * @file llcloud.cpp - * @brief Implementation of viewer LLCloudLayer class - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llmath.h" -//#include "vmath.h" -#include "v3math.h" -#include "v4math.h" -#include "llquaternion.h" -#include "llrand.h" -#include "v4color.h" - -#include "llwind.h" -#include "llcloud.h" -#include "llgl.h" -#include "llviewerobjectlist.h" -#include "llvoclouds.h" -#include "llvosky.h" -#include "llsky.h" -#include "llviewerregion.h" -#include "patch_dct.h" -#include "patch_code.h" -#include "llglheaders.h" -#include "pipeline.h" -#include "lldrawpool.h" -#include "llworld.h" - -extern LLPipeline gPipeline; - -const F32 CLOUD_UPDATE_RATE = 1.0f; // Global time dilation for clouds -const F32 CLOUD_GROW_RATE = 0.05f; -const F32 CLOUD_DECAY_RATE = -0.05f; -const F32 CLOUD_VELOCITY_SCALE = 0.01f; -const F32 CLOUD_DENSITY = 25.f; -const S32 CLOUD_COUNT_MAX = 20; -const F32 CLOUD_HEIGHT_RANGE = 48.f; -const F32 CLOUD_HEIGHT_MEAN = 192.f; - -enum -{ - LL_PUFF_GROWING = 0, - LL_PUFF_DYING = 1 -}; - -// Used for patch decoder -S32 gBuffer[16*16]; - - -//static -S32 LLCloudPuff::sPuffCount = 0; - -LLCloudPuff::LLCloudPuff() : - mAlpha(0.01f), - mRate(CLOUD_GROW_RATE*CLOUD_UPDATE_RATE), - mLifeState(LL_PUFF_GROWING) -{ -} - -LLCloudGroup::LLCloudGroup() : - mCloudLayerp(NULL), - mDensity(0.f), - mTargetPuffCount(0), - mVOCloudsp(NULL) -{ -} - -void LLCloudGroup::cleanup() -{ - if (mVOCloudsp) - { - if (!mVOCloudsp->isDead()) - { - gObjectList.killObject(mVOCloudsp); - } - mVOCloudsp = NULL; - } -} - -void LLCloudGroup::setCenterRegion(const LLVector3 ¢er) -{ - mCenterRegion = center; -} - -void LLCloudGroup::updatePuffs(const F32 dt) -{ - mDensity = mCloudLayerp->getDensityRegion(mCenterRegion); - - if (!mVOCloudsp) - { - mVOCloudsp = (LLVOClouds *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_CLOUDS, mCloudLayerp->getRegion()); - mVOCloudsp->setCloudGroup(this); - mVOCloudsp->setPositionRegion(mCenterRegion); - mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, - 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, - CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)*0.5f); - gPipeline.createObject(mVOCloudsp); - } - - LLVector3 velocity; - LLVector3d vel_d; - // Update the positions of all of the clouds - for (U32 i = 0; i < mCloudPuffs.size(); i++) - { - LLCloudPuff &puff = mCloudPuffs[i]; - velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal)); - velocity *= CLOUD_VELOCITY_SCALE*CLOUD_UPDATE_RATE; - vel_d.setVec(velocity); - mCloudPuffs[i].mPositionGlobal += vel_d; - mCloudPuffs[i].mAlpha += mCloudPuffs[i].mRate * dt; - mCloudPuffs[i].mAlpha = llmin(1.f, mCloudPuffs[i].mAlpha); - mCloudPuffs[i].mAlpha = llmax(0.f, mCloudPuffs[i].mAlpha); - } -} - -void LLCloudGroup::updatePuffOwnership() -{ - U32 i = 0; - while (i < mCloudPuffs.size()) - { - if (mCloudPuffs[i].getLifeState() == LL_PUFF_DYING) - { - i++; - continue; - } - if (inGroup(mCloudPuffs[i])) - { - i++; - continue; - } - - //llinfos << "Cloud moving to new group" << llendl; - LLCloudGroup *new_cgp = LLWorld::getInstance()->findCloudGroup(mCloudPuffs[i]); - if (!new_cgp) - { - //llinfos << "Killing puff not in group" << llendl; - mCloudPuffs[i].setLifeState(LL_PUFF_DYING); - mCloudPuffs[i].mRate = CLOUD_DECAY_RATE*CLOUD_UPDATE_RATE; - i++; - continue; - } - //llinfos << "Puff handed off!" << llendl; - LLCloudPuff puff; - puff.mPositionGlobal = mCloudPuffs[i].mPositionGlobal; - puff.mAlpha = mCloudPuffs[i].mAlpha; - mCloudPuffs.erase(mCloudPuffs.begin() + i); - new_cgp->mCloudPuffs.push_back(puff); - } - - //llinfos << "Puff count: " << LLCloudPuff::sPuffCount << llendl; -} - -void LLCloudGroup::updatePuffCount() -{ - if (!mVOCloudsp) - { - return; - } - S32 i; - S32 target_puff_count = llround(CLOUD_DENSITY * mDensity); - target_puff_count = llmax(0, target_puff_count); - target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count); - S32 current_puff_count = (S32) mCloudPuffs.size(); - // Create a new cloud if we need one - if (current_puff_count < target_puff_count) - { - LLVector3d puff_pos_global; - mCloudPuffs.resize(target_puff_count); - for (i = current_puff_count; i < target_puff_count; i++) - { - puff_pos_global = mVOCloudsp->getPositionGlobal(); - F32 x = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE; - F32 y = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE; - F32 z = ll_frand(CLOUD_HEIGHT_RANGE) - 0.5f*CLOUD_HEIGHT_RANGE; - puff_pos_global += LLVector3d(x, y, z); - mCloudPuffs[i].mPositionGlobal = puff_pos_global; - mCloudPuffs[i].mAlpha = 0.01f; - LLCloudPuff::sPuffCount++; - } - } - - // Count the number of live puffs - S32 live_puff_count = 0; - for (i = 0; i < (S32) mCloudPuffs.size(); i++) - { - if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING) - { - live_puff_count++; - } - } - - - // Start killing enough puffs so the live puff count == target puff count - S32 new_dying_count = llmax(0, live_puff_count - target_puff_count); - i = 0; - while (new_dying_count > 0) - { - if (mCloudPuffs[i].getLifeState() != LL_PUFF_DYING) - { - //llinfos << "Killing extra live cloud" << llendl; - mCloudPuffs[i].setLifeState(LL_PUFF_DYING); - mCloudPuffs[i].mRate = CLOUD_DECAY_RATE*CLOUD_UPDATE_RATE; - new_dying_count--; - } - i++; - } - - // Remove fully dead puffs - i = 0; - while (i < (S32) mCloudPuffs.size()) - { - if (mCloudPuffs[i].isDead()) - { - //llinfos << "Removing dead puff!" << llendl; - mCloudPuffs.erase(mCloudPuffs.begin() + i); - LLCloudPuff::sPuffCount--; - } - else - { - i++; - } - } -} - -BOOL LLCloudGroup::inGroup(const LLCloudPuff &puff) const -{ - // Do min/max check on center of the cloud puff - F32 min_x, min_y, max_x, max_y; - F32 delta = 128.f/CLOUD_GROUPS_PER_EDGE; - min_x = mCenterRegion.mV[VX] - delta; - min_y = mCenterRegion.mV[VY] - delta; - max_x = mCenterRegion.mV[VX] + delta; - max_y = mCenterRegion.mV[VY] + delta; - - LLVector3 pos_region = mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.getPositionGlobal()); - - if ((pos_region.mV[VX] < min_x) - || (pos_region.mV[VY] < min_y) - || (pos_region.mV[VX] > max_x) - || (pos_region.mV[VY] > max_y)) - { - return FALSE; - } - return TRUE; -} - -LLCloudLayer::LLCloudLayer() -: mOriginGlobal(0.0f, 0.0f, 0.0f), - mMetersPerEdge(1.0f), - mMetersPerGrid(1.0f), - mWindp(NULL), - mDensityp(NULL) -{ - S32 i, j; - for (i = 0; i < 4; i++) - { - mNeighbors[i] = NULL; - } - - F32 x, y; - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - y = (0.5f + i)*(256.f/CLOUD_GROUPS_PER_EDGE); - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - x = (0.5f + j)*(256.f/CLOUD_GROUPS_PER_EDGE); - - mCloudGroups[i][j].setCloudLayerp(this); - mCloudGroups[i][j].setCenterRegion(LLVector3(x, y, CLOUD_HEIGHT_MEAN)); - } - } -} - - - -LLCloudLayer::~LLCloudLayer() -{ - destroy(); -} - - -void LLCloudLayer::create(LLViewerRegion *regionp) -{ - llassert(regionp); - - mRegionp = regionp; - mDensityp = new F32 [CLOUD_GRIDS_PER_EDGE * CLOUD_GRIDS_PER_EDGE]; - - U32 i; - for (i = 0; i < CLOUD_GRIDS_PER_EDGE*CLOUD_GRIDS_PER_EDGE; i++) - { - mDensityp[i] = 0.f; - } -} - -void LLCloudLayer::setRegion(LLViewerRegion *regionp) -{ - mRegionp = regionp; -} - -void LLCloudLayer::destroy() -{ - reset(); - - delete [] mDensityp; - mDensityp = NULL; - mWindp = NULL; -} - - -void LLCloudLayer::reset() -{ - // Kill all of the existing puffs - S32 i, j; - - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - mCloudGroups[i][j].cleanup(); - } - } -} - -void LLCloudLayer::setWindPointer(LLWind *windp) -{ - if (mWindp) - { - mWindp->setCloudDensityPointer(NULL); - } - mWindp = windp; - if (mWindp) - { - mWindp->setCloudDensityPointer(mDensityp); - } -} - - -void LLCloudLayer::setWidth(F32 width) -{ - mMetersPerEdge = width; - mMetersPerGrid = width / CLOUD_GRIDS_PER_EDGE; -} - - -F32 LLCloudLayer::getDensityRegion(const LLVector3 &pos_region) -{ - // "position" is region-local - S32 i, j, ii, jj; - - i = lltrunc(pos_region.mV[VX] / mMetersPerGrid); - j = lltrunc(pos_region.mV[VY] / mMetersPerGrid); - ii = i + 1; - jj = j + 1; - - - // clamp - if (i >= (S32)CLOUD_GRIDS_PER_EDGE) - { - i = CLOUD_GRIDS_PER_EDGE - 1; - ii = i; - } - else if (i < 0) - { - i = 0; - ii = i; - } - else if (ii >= (S32)CLOUD_GRIDS_PER_EDGE || ii < 0) - { - ii = i; - } - - if (j >= (S32)CLOUD_GRIDS_PER_EDGE) - { - j = CLOUD_GRIDS_PER_EDGE - 1; - jj = j; - } - else if (j < 0) - { - j = 0; - jj = j; - } - else if (jj >= (S32)CLOUD_GRIDS_PER_EDGE || jj < 0) - { - jj = j; - } - - F32 dx = (pos_region.mV[VX] - (F32) i * mMetersPerGrid) / mMetersPerGrid; - F32 dy = (pos_region.mV[VY] - (F32) j * mMetersPerGrid) / mMetersPerGrid; - F32 omdx = 1.0f - dx; - F32 omdy = 1.0f - dy; - - F32 density = dx * dy * *(mDensityp + ii + jj * CLOUD_GRIDS_PER_EDGE) + - dx * omdy * *(mDensityp + i + jj * CLOUD_GRIDS_PER_EDGE) + - omdx * dy * *(mDensityp + ii + j * CLOUD_GRIDS_PER_EDGE) + - omdx * omdy * *(mDensityp + i + j * CLOUD_GRIDS_PER_EDGE); - - return density; -} - -void LLCloudLayer::decompress(LLBitPack &bitpack, LLGroupHeader *group_headerp) -{ - LLPatchHeader patch_header; - - init_patch_decompressor(group_headerp->patch_size); - - // Don't use the packed group_header stride because the strides used on - // simulator and viewer are not equal. - group_headerp->stride = group_headerp->patch_size; // offset required to step up one row - set_group_of_patch_header(group_headerp); - - decode_patch_header(bitpack, &patch_header); - decode_patch(bitpack, gBuffer); - decompress_patch(mDensityp, gBuffer, &patch_header); -} - -void LLCloudLayer::updatePuffs(const F32 dt) -{ - // We want to iterate through all of the cloud groups - // and update their density targets - - S32 i, j; - - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - mCloudGroups[i][j].updatePuffs(dt); - } - } -} - -void LLCloudLayer::updatePuffOwnership() -{ - S32 i, j; - - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - mCloudGroups[i][j].updatePuffOwnership(); - } - } -} - -void LLCloudLayer::updatePuffCount() -{ - S32 i, j; - - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - mCloudGroups[i][j].updatePuffCount(); - } - } -} - -LLCloudGroup *LLCloudLayer::findCloudGroup(const LLCloudPuff &puff) -{ - S32 i, j; - - for (i = 0; i < CLOUD_GROUPS_PER_EDGE; i++) - { - for (j = 0; j < CLOUD_GROUPS_PER_EDGE; j++) - { - if (mCloudGroups[i][j].inGroup(puff)) - { - return &(mCloudGroups[i][j]); - } - } - } - return NULL; -} - - - -void LLCloudLayer::connectNeighbor(LLCloudLayer *cloudp, U32 direction) -{ - if (direction >= 4) - { - // Only care about cardinal 4 directions. - return; - } - - mNeighbors[direction] = cloudp; - if (cloudp) - mNeighbors[direction]->mNeighbors[gDirOpposite[direction]] = this; -} - - -void LLCloudLayer::disconnectNeighbor(U32 direction) -{ - if (direction >= 4) - { - // Only care about cardinal 4 directions. - return; - } - - if (mNeighbors[direction]) - { - mNeighbors[direction]->mNeighbors[gDirOpposite[direction]] = NULL; - mNeighbors[direction] = NULL; - } -} - - -void LLCloudLayer::disconnectAllNeighbors() -{ - S32 i; - for (i = 0; i < 4; i++) - { - disconnectNeighbor(i); - } -} diff --git a/indra/newview/llcloud.h b/indra/newview/llcloud.h deleted file mode 100644 index 0435ba1ece..0000000000 --- a/indra/newview/llcloud.h +++ /dev/null @@ -1,199 +0,0 @@ -/** - * @file llcloud.h - * @brief Description of viewer LLCloudLayer class - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLCLOUD_H -#define LL_LLCLOUD_H - -// Some ideas on how clouds should work -// -// Each region has a cloud layer -// Each cloud layer has pre-allocated space for N clouds -// The LLSky class knows the max number of clouds to render M. -// All clouds use the same texture, but the tex-coords can take on 8 configurations -// (four rotations, front and back) -// -// The sky's part -// -------------- -// The sky knows that A clouds have been assigned to regions and there are B left over. -// Divide B by number of active regions to get C. -// Ask each region to add C more clouds and return total number D. -// Add up all the D's to get a new A. -// -// The cloud layer's part -// ---------------------- -// The cloud layer is a grid of possibility. Each grid's value represents the probablility -// (0.0 to 1.0) that a cloud placement query will succeed. -// -// The sky asks the region to add C more clouds. -// The cloud layer tries a total of E times to place clouds and returns total cloud count. -// -// Clouds move according to local wind velocity. -// If a cloud moves out of region then it's location is sent to neighbor region -// or it is allowed to drift and decay. -// -// The clouds in non-visible regions do not propagate every frame. -// Each frame one non-visible region is allowed to propagate it's clouds -// (might have to check to see if incoming cloud was already visible or not). -// -// - -#include "llmath.h" -//#include "vmath.h" -#include "v3math.h" -#include "v3dmath.h" -#include "v4math.h" -#include "v4color.h" -#include "llpointer.h" -#include "lldarray.h" - -#include "llframetimer.h" - -const U32 CLOUD_GRIDS_PER_EDGE = 16; - -const F32 CLOUD_PUFF_WIDTH = 64.f; -const F32 CLOUD_PUFF_HEIGHT = 48.f; - -class LLWind; -class LLVOClouds; -class LLViewerRegion; -class LLCloudLayer; -class LLBitPack; -class LLGroupHeader; - -const S32 CLOUD_GROUPS_PER_EDGE = 4; - -class LLCloudPuff -{ -public: - LLCloudPuff(); - - const LLVector3d &getPositionGlobal() const { return mPositionGlobal; } - friend class LLCloudGroup; - - void updatePuffs(const F32 dt); - void updatePuffOwnership(); - - F32 getAlpha() const { return mAlpha; } - U32 getLifeState() const { return mLifeState; } - void setLifeState(const U32 state) { mLifeState = state; } - BOOL isDead() const { return mAlpha <= 0.f; } - - - static S32 sPuffCount; -protected: - F32 mAlpha; - F32 mRate; - LLVector3d mPositionGlobal; - - BOOL mLifeState; -}; - -class LLCloudGroup -{ -public: - LLCloudGroup(); - - void cleanup(); - - void setCloudLayerp(LLCloudLayer *clp) { mCloudLayerp = clp; } - void setCenterRegion(const LLVector3 ¢er); - - void updatePuffs(const F32 dt); - void updatePuffOwnership(); - void updatePuffCount(); - - BOOL inGroup(const LLCloudPuff &puff) const; - - F32 getDensity() const { return mDensity; } - S32 getNumPuffs() const { return (S32) mCloudPuffs.size(); } - const LLCloudPuff &getPuff(const S32 i) { return mCloudPuffs[i]; } -protected: - LLCloudLayer *mCloudLayerp; - LLVector3 mCenterRegion; - F32 mDensity; - S32 mTargetPuffCount; - - std::vector<LLCloudPuff> mCloudPuffs; - LLPointer<LLVOClouds> mVOCloudsp; -}; - - -class LLCloudLayer -{ -public: - LLCloudLayer(); - ~LLCloudLayer(); - - void create(LLViewerRegion *regionp); - void destroy(); - - void reset(); // Clears all active cloud puffs - - - void updatePuffs(const F32 dt); - void updatePuffOwnership(); - void updatePuffCount(); - - LLCloudGroup *findCloudGroup(const LLCloudPuff &puff); - - void setRegion(LLViewerRegion *regionp); - LLViewerRegion* getRegion() const { return mRegionp; } - void setWindPointer(LLWind *windp); - void setOriginGlobal(const LLVector3d &origin_global) { mOriginGlobal = origin_global; } - void setWidth(F32 width); - - void setBrightness(F32 brightness); - void setSunColor(const LLColor4 &color); - - F32 getDensityRegion(const LLVector3 &pos_region); // "position" is in local coordinates - - void decompress(LLBitPack &bitpack, LLGroupHeader *group_header); - - LLCloudLayer* getNeighbor(const S32 n) const { return mNeighbors[n]; } - - void connectNeighbor(LLCloudLayer *cloudp, U32 direction); - void disconnectNeighbor(U32 direction); - void disconnectAllNeighbors(); - -public: - LLVector3d mOriginGlobal; - F32 mMetersPerEdge; - F32 mMetersPerGrid; - - - F32 mMaxAlpha; // The max cloud puff _render_ alpha - -protected: - LLCloudLayer *mNeighbors[4]; - LLWind *mWindp; - LLViewerRegion *mRegionp; - F32 *mDensityp; // the probability density grid - - LLCloudGroup mCloudGroups[CLOUD_GROUPS_PER_EDGE][CLOUD_GROUPS_PER_EDGE]; -}; - - -#endif diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp new file mode 100644 index 0000000000..347a467a8b --- /dev/null +++ b/indra/newview/lldaycyclemanager.cpp @@ -0,0 +1,230 @@ +/** + * @file lldaycyclemanager.cpp + * @brief Implementation for the LLDayCycleManager class. + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "lldaycyclemanager.h" + +#include "lldiriterator.h" + +void LLDayCycleManager::getPresetNames(preset_name_list_t& names) const +{ + names.clear(); + + for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) + { + names.push_back(it->first); + } +} + +void LLDayCycleManager::getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const +{ + user.clear(); + sys.clear(); + + for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) + { + const std::string& name = it->first; + + if (isSystemPreset(name)) + { + sys.push_back(name); + } + else + { + user.push_back(name); + } + } +} + +void LLDayCycleManager::getUserPresetNames(preset_name_list_t& user) const +{ + preset_name_list_t sys; // unused + getPresetNames(user, sys); +} + +bool LLDayCycleManager::getPreset(const std::string name, LLWLDayCycle& day_cycle) const +{ + dc_map_t::const_iterator it = mDayCycleMap.find(name); + if (it == mDayCycleMap.end()) + { + return false; + } + + day_cycle = it->second; + return true; +} + +bool LLDayCycleManager::getPreset(const std::string name, LLSD& day_cycle) const +{ + LLWLDayCycle dc; + if (!getPreset(name, dc)) + { + return false; + } + + day_cycle = dc.asLLSD(); + return true; +} + +bool LLDayCycleManager::presetExists(const std::string name) const +{ + LLWLDayCycle dummy; + return getPreset(name, dummy); +} + +bool LLDayCycleManager::isSystemPreset(const std::string& name) const +{ + return gDirUtilp->fileExists(getSysDir() + LLURI::escape(name) + ".xml"); +} + +bool LLDayCycleManager::savePreset(const std::string& name, const LLSD& data) +{ + // Save given preset. + LLWLDayCycle day; + day.loadDayCycle(data, LLEnvKey::SCOPE_LOCAL); + day.save(getUserDir() + LLURI::escape(name) + ".xml"); + + // Add it to our map. + addPreset(name, data); + mModifySignal(); + return true; +} + +bool LLDayCycleManager::deletePreset(const std::string& name) +{ + // Remove it from the map. + dc_map_t::iterator it = mDayCycleMap.find(name); + if (it == mDayCycleMap.end()) + { + LL_WARNS("Windlight") << "No day cycle named " << name << LL_ENDL; + return false; + } + mDayCycleMap.erase(it); + + // Remove from the filesystem. + std::string filename = LLURI::escape(name) + ".xml"; + if (gDirUtilp->fileExists(getUserDir() + filename)) + { + gDirUtilp->deleteFilesInDir(getUserDir(), filename); + } + + // Signal interested parties. + mModifySignal(); + return true; +} + +bool LLDayCycleManager::isSkyPresetReferenced(const std::string& preset_name) const +{ + // We're traversing local day cycles, they can only reference local skies. + LLWLParamKey key(preset_name, LLEnvKey::SCOPE_LOCAL); + + for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) + { + if (it->second.hasReferencesTo(key)) + { + return true; + } + } + + return false; +} + +boost::signals2::connection LLDayCycleManager::setModifyCallback(const modify_signal_t::slot_type& cb) +{ + return mModifySignal.connect(cb); +} + +// virtual +void LLDayCycleManager::initSingleton() +{ + LL_DEBUGS("Windlight") << "Loading all day cycles" << LL_ENDL; + loadAllPresets(); +} + +void LLDayCycleManager::loadAllPresets() +{ + mDayCycleMap.clear(); + + // First, load system (coming out of the box) day cycles. + loadPresets(getSysDir()); + + // Then load user presets. Note that user day cycles will modify any system ones already loaded. + loadPresets(getUserDir()); +} + +void LLDayCycleManager::loadPresets(const std::string& dir) +{ + LLDirIterator dir_iter(dir, "*.xml"); + + while (1) + { + std::string file; + if (!dir_iter.next(file)) break; // no more files + loadPreset(dir + file); + } +} + +bool LLDayCycleManager::loadPreset(const std::string& path) +{ + LLSD data = LLWLDayCycle::loadDayCycleFromPath(path); + if (data.isUndefined()) + { + llwarns << "Error loading day cycle from " << path << llendl; + return false; + } + + std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true)); + addPreset(name, data); + + return true; +} + +bool LLDayCycleManager::addPreset(const std::string& name, const LLSD& data) +{ + if (name.empty()) + { + llassert(name.empty()); + return false; + } + + LLWLDayCycle day; + day.loadDayCycle(data, LLEnvKey::SCOPE_LOCAL); + mDayCycleMap[name] = day; + return true; +} + +// static +std::string LLDayCycleManager::getSysDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", ""); +} + +// static +std::string LLDayCycleManager::getUserDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "windlight/days", ""); +} diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h new file mode 100644 index 0000000000..3d2144960d --- /dev/null +++ b/indra/newview/lldaycyclemanager.h @@ -0,0 +1,84 @@ +/** + * @file lldaycyclemanager.h + * @brief Implementation for the LLDayCycleManager class. + * + * $LicenseInfo:firstyear=2011&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_LLDAYCYCLEMANAGER_H +#define LL_LLDAYCYCLEMANAGER_H + +#include <map> +#include <string> + +#include "llwldaycycle.h" +#include "llwlparammanager.h" + +/** + * WindLight day cycles manager class + * + * Provides interface for accessing, loading and saving day cycles. + */ +class LLDayCycleManager : public LLSingleton<LLDayCycleManager> +{ + LOG_CLASS(LLDayCycleManager); + +public: + typedef std::list<std::string> preset_name_list_t; + + typedef std::map<std::string, LLWLDayCycle> dc_map_t; + typedef boost::signals2::signal<void()> modify_signal_t; + + void getPresetNames(preset_name_list_t& names) const; + void getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const; + void getUserPresetNames(preset_name_list_t& user) const; + + bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const; + bool getPreset(const std::string name, LLSD& day_cycle) const; + bool presetExists(const std::string name) const; + bool isSystemPreset(const std::string& name) const; + bool savePreset(const std::string& name, const LLSD& data); + bool deletePreset(const std::string& name); + + /// @return true if there is a day cycle that refers to the sky preset. + bool isSkyPresetReferenced(const std::string& preset_name) const; + + /// Emitted when a preset gets added or deleted. + boost::signals2::connection setModifyCallback(const modify_signal_t::slot_type& cb); + +private: + friend class LLSingleton<LLDayCycleManager>; + /*virtual*/ void initSingleton(); + + void loadAllPresets(); + void loadPresets(const std::string& dir); + bool loadPreset(const std::string& path); + bool addPreset(const std::string& name, const LLSD& data); + + static std::string getSysDir(); + static std::string getUserDir(); + + dc_map_t mDayCycleMap; + modify_signal_t mModifySignal; +}; + +#endif // LL_LLDAYCYCLEMANAGER_H diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index ad3710843c..debac9dcbf 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -387,7 +387,6 @@ void LLDrawable::makeActive() pcode == LLViewerObject::LL_VO_SURFACE_PATCH || pcode == LLViewerObject::LL_VO_PART_GROUP || pcode == LLViewerObject::LL_VO_HUD_PART_GROUP || - pcode == LLViewerObject::LL_VO_CLOUDS || pcode == LLViewerObject::LL_VO_GROUND || pcode == LLViewerObject::LL_VO_SKY) { @@ -1519,10 +1518,6 @@ BOOL LLDrawable::isAnimating() const { return TRUE; } - if (mVObjp->getPCode() == LLViewerObject::LL_VO_CLOUDS) - { - return TRUE; - } if (!isRoot() && !mVObjp->getAngularVelocity().isExactlyZero()) { diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index f5483d969d..fa7d6e2a40 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -35,7 +35,6 @@ #include "lldrawpoolalpha.h" #include "lldrawpoolavatar.h" #include "lldrawpoolbump.h" -#include "lldrawpoolclouds.h" #include "lldrawpoolground.h" #include "lldrawpoolsimple.h" #include "lldrawpoolsky.h" diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 8d46133912..ad7e3ad593 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -295,16 +295,24 @@ void LLDrawPoolAlpha::render(S32 pass) if (sShowDebugAlpha) { - if(gPipeline.canUseWindLightShaders()) + BOOL shaders = gPipeline.canUseVertexShaders(); + if(shaders) { - LLGLSLShader::bindNoShader(); + gObjectFullbrightNonIndexedProgram.bind(); + } + else + { + gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } - gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); glColor4f(1,0,0,1); LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f); gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ; renderAlphaHighlight(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + if(shaders) + { + gObjectFullbrightNonIndexedProgram.unbind(); + } } } @@ -359,7 +367,6 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) bool draw_glow_for_this_partition = mVertexShaderLevel > 0 && // no shaders = no glow. // All particle systems seem to come off the wire with texture entries which claim that they glow. This is probably a bug in the data. Suppress. group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_PARTICLE && - group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_CLOUD && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD_PARTICLE; LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[LLRenderPass::PASS_ALPHA]; diff --git a/indra/newview/lldrawpoolclouds.cpp b/indra/newview/lldrawpoolclouds.cpp deleted file mode 100644 index 5db1d8cfed..0000000000 --- a/indra/newview/lldrawpoolclouds.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @file lldrawpoolclouds.cpp - * @brief LLDrawPoolClouds class implementation - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "lldrawpoolclouds.h" - -#include "llface.h" -#include "llsky.h" -#include "llviewercamera.h" -#include "llvoclouds.h" -#include "pipeline.h" - -LLDrawPoolClouds::LLDrawPoolClouds() : - LLDrawPool(POOL_CLOUDS) -{ -} - -LLDrawPool *LLDrawPoolClouds::instancePool() -{ - return new LLDrawPoolClouds(); -} - -BOOL LLDrawPoolClouds::addFace(LLFace* face) -{ - llerrs << "WTF?" << llendl; - return FALSE; -} - -void LLDrawPoolClouds::enqueue(LLFace *facep) -{ - mDrawFace.push_back(facep); - facep->mDistance = (facep->mCenterAgent - gCamera->getOrigin()) * gCamera->getAtAxis(); -} - -void LLDrawPoolClouds::beginRenderPass(S32 pass) -{ - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); -} - -void LLDrawPoolClouds::prerender() -{ - mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT); -} - -void LLDrawPoolClouds::render(S32 pass) -{ - LLFastTimer ftm(LLFastTimer::FTM_RENDER_CLOUDS); - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) - { - return; - } - - if (mDrawFace.empty()) - { - return; - } - - LLGLSPipelineAlpha gls_pipeline_alpha; - LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); - glAlphaFunc(GL_GREATER,0.01f); - - gPipeline.enableLightsFullbright(LLColor4(1.f,1.f,1.f)); - - mDrawFace[0]->bindTexture(); - - std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater()); - - drawLoop(); -} - - diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 84eeace9c6..3daa0f8261 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -143,7 +143,7 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass ) void LLDrawPoolTerrain::endRenderPass( S32 pass ) { LLFastTimer t(FTM_RENDER_TERRAIN); - LLFacePool::endRenderPass(pass); + //LLFacePool::endRenderPass(pass); if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0) { sShader->unbind(); @@ -215,8 +215,10 @@ void LLDrawPoolTerrain::render(S32 pass) { //use fullbright shader for highlighting LLGLSLShader* old_shader = sShader; sShader->unbind(); - sShader = &gObjectFullbrightProgram; + sShader = &gObjectFullbrightNonIndexedProgram; sShader->bind(); + LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(-1.0f, -1.0f); renderOwnership(); sShader = old_shader; sShader->bind(); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index dc94924da4..31c14361b5 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -108,7 +108,7 @@ void LLDrawPoolWater::prerender() // got rid of modulation by light color since it got a little too // green at sunset and sl-57047 (underwater turns black at 8:00) - sWaterFogColor = LLWaterParamManager::instance()->getFogColor(); + sWaterFogColor = LLWaterParamManager::instance().getFogColor(); sWaterFogColor.mV[3] = 0; } @@ -527,7 +527,7 @@ void LLDrawPoolWater::shade() //bind normal map S32 bumpTex = shader->enableTexture(LLViewerShaderMgr::BUMP_MAP); - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); + LLWaterParamManager * param_mgr = &LLWaterParamManager::instance(); // change mWaterNormp if needed if (mWaterNormp->getID() != param_mgr->getNormalMapID()) diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 409b18d522..bf79c2100c 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -34,6 +34,8 @@ #include "llviewercamera.h" #include "llimage.h" #include "llwlparammanager.h" +#include "llviewershadermgr.h" +#include "llglslshader.h" #include "llsky.h" #include "llvowlsky.h" #include "llviewerregion.h" @@ -68,7 +70,7 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) : sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE); - LLWLParamManager::instance()->propagateParameters(); + LLWLParamManager::getInstance()->propagateParameters(); } LLDrawPoolWLSky::~LLDrawPoolWLSky() @@ -178,7 +180,7 @@ void LLDrawPoolWLSky::renderStars(void) const // clamping and allow the star_alpha param to brighten the stars. bool error; LLColor4 star_alpha(LLColor4::black); - star_alpha.mV[3] = LLWLParamManager::instance()->mCurParams.getFloat("star_brightness", error) / 2.f; + star_alpha.mV[3] = LLWLParamManager::getInstance()->mCurParams.getFloat("star_brightness", error) / 2.f; llassert_always(!error); gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex()); @@ -266,7 +268,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) } LLFastTimer ftm(FTM_RENDER_WL_SKY); - const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius(); + const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius(); LLGLSNoFog disableFog; LLGLDepthTest depth(GL_TRUE, GL_FALSE); @@ -313,7 +315,7 @@ void LLDrawPoolWLSky::render(S32 pass) } LLFastTimer ftm(FTM_RENDER_WL_SKY); - const F32 camHeightLocal = LLWLParamManager::instance()->getDomeOffset() * LLWLParamManager::instance()->getDomeRadius(); + const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius(); LLGLSNoFog disableFog; LLGLDepthTest depth(GL_TRUE, GL_FALSE); diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp new file mode 100644 index 0000000000..c2720eaf28 --- /dev/null +++ b/indra/newview/llenvmanager.cpp @@ -0,0 +1,684 @@ +/** + * @file llenvmanager.cpp + * @brief Implementation of classes managing WindLight and water settings. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llenvmanager.h" + +#include "llagent.h" +#include "lldaycyclemanager.h" +#include "llviewercontrol.h" // for gSavedSettings +#include "llviewerregion.h" +#include "llwaterparammanager.h" +#include "llwlhandlers.h" +#include "llwlparammanager.h" + +std::string LLEnvPrefs::getWaterPresetName() const +{ + if (mWaterPresetName.empty()) + { + llwarns << "Water preset name is empty" << llendl; + } + + return mWaterPresetName; +} + +std::string LLEnvPrefs::getSkyPresetName() const +{ + if (mSkyPresetName.empty()) + { + llwarns << "Sky preset name is empty" << llendl; + } + + return mSkyPresetName; +} + +std::string LLEnvPrefs::getDayCycleName() const +{ + if (mDayCycleName.empty()) + { + llwarns << "Day cycle name is empty" << llendl; + } + + return mDayCycleName; +} + +void LLEnvPrefs::setUseRegionSettings(bool val) +{ + mUseRegionSettings = val; +} + +void LLEnvPrefs::setUseWaterPreset(const std::string& name) +{ + mUseRegionSettings = false; + mWaterPresetName = name; +} + +void LLEnvPrefs::setUseSkyPreset(const std::string& name) +{ + mUseRegionSettings = false; + mUseDayCycle = false; + mSkyPresetName = name; +} + +void LLEnvPrefs::setUseDayCycle(const std::string& name) +{ + mUseRegionSettings = false; + mUseDayCycle = true; + mDayCycleName = name; +} + +//============================================================================= +LLEnvManagerNew::LLEnvManagerNew() +{ + mInterpNextChangeMessage = true; + + // Set default environment settings. + mUserPrefs.mUseRegionSettings = true; + mUserPrefs.mUseDayCycle = true; + mUserPrefs.mWaterPresetName = "Default"; + mUserPrefs.mSkyPresetName = "Default"; + mUserPrefs.mDayCycleName = "Default"; +} + +bool LLEnvManagerNew::getUseRegionSettings() const +{ + return mUserPrefs.getUseRegionSettings(); +} + +bool LLEnvManagerNew::getUseDayCycle() const +{ + return mUserPrefs.getUseDayCycle(); +} + +bool LLEnvManagerNew::getUseFixedSky() const +{ + return mUserPrefs.getUseFixedSky(); +} + +std::string LLEnvManagerNew::getWaterPresetName() const +{ + return mUserPrefs.getWaterPresetName(); +} + +std::string LLEnvManagerNew::getSkyPresetName() const +{ + return mUserPrefs.getSkyPresetName(); +} + +std::string LLEnvManagerNew::getDayCycleName() const +{ + return mUserPrefs.getDayCycleName(); +} + +const LLEnvironmentSettings& LLEnvManagerNew::getRegionSettings() const +{ + return !mNewRegionPrefs.isEmpty() ? mNewRegionPrefs : mCachedRegionPrefs; +} + +void LLEnvManagerNew::setRegionSettings(const LLEnvironmentSettings& new_settings) +{ + // Set region settings override that will be used locally + // until user either uploads the changes or goes to another region. + mNewRegionPrefs = new_settings; +} + +bool LLEnvManagerNew::usePrefs() +{ + LL_DEBUGS("Windlight") << "Displaying preferred environment" << LL_ENDL; + updateManagersFromPrefs(false); + return true; +} + +bool LLEnvManagerNew::useDefaults() +{ + bool rslt; + + rslt = useDefaultWater(); + rslt &= useDefaultSky(); + + return rslt; +} + +bool LLEnvManagerNew::useRegionSettings() +{ + bool rslt; + + rslt = useRegionSky(); + rslt &= useRegionWater(); + + return rslt; +} + +bool LLEnvManagerNew::useWaterPreset(const std::string& name) +{ + LL_DEBUGS("Windlight") << "Displaying water preset " << name << LL_ENDL; + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + bool rslt = water_mgr.getParamSet(name, water_mgr.mCurParams); + llassert(rslt == true); + return rslt; +} + +bool LLEnvManagerNew::useWaterParams(const LLSD& params) +{ + LL_DEBUGS("Windlight") << "Displaying water params" << LL_ENDL; + LLWaterParamManager::instance().mCurParams.setAll(params); + return true; +} + +bool LLEnvManagerNew::useSkyPreset(const std::string& name) +{ + LLWLParamManager& sky_mgr = LLWLParamManager::instance(); + LLWLParamSet 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()); + return true; +} + +bool LLEnvManagerNew::useSkyParams(const LLSD& params) +{ + LL_DEBUGS("Windlight") << "Displaying sky params" << LL_ENDL; + LLWLParamManager::instance().applySkyParams(params); + return true; +} + +bool LLEnvManagerNew::useDayCycle(const std::string& name, LLEnvKey::EScope scope) +{ + LLSD params; + + if (scope == LLEnvKey::SCOPE_REGION) + { + LL_DEBUGS("Windlight") << "Displaying region day cycle " << name << LL_ENDL; + params = getRegionSettings().getWLDayCycle(); + } + else + { + LL_DEBUGS("Windlight") << "Displaying local day cycle " << name << LL_ENDL; + + if (!LLDayCycleManager::instance().getPreset(name, params)) + { + llwarns << "No day cycle named " << name << llendl; + return false; + } + } + + bool rslt = LLWLParamManager::instance().applyDayCycleParams(params, scope); + llassert(rslt == true); + return rslt; +} + +bool LLEnvManagerNew::useDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time /* = 0.5*/) +{ + LL_DEBUGS("Windlight") << "Displaying day cycle params" << LL_ENDL; + return LLWLParamManager::instance().applyDayCycleParams(params, scope); +} + +void LLEnvManagerNew::setUseRegionSettings(bool val) +{ + mUserPrefs.setUseRegionSettings(val); + saveUserPrefs(); + updateManagersFromPrefs(false); +} + +void LLEnvManagerNew::setUseWaterPreset(const std::string& name) +{ + // *TODO: make sure the preset exists. + if (name.empty()) + { + llwarns << "Empty water preset name passed" << llendl; + return; + } + + mUserPrefs.setUseWaterPreset(name); + saveUserPrefs(); + updateManagersFromPrefs(false); +} + +void LLEnvManagerNew::setUseSkyPreset(const std::string& name) +{ + // *TODO: make sure the preset exists. + if (name.empty()) + { + llwarns << "Empty sky preset name passed" << llendl; + return; + } + + mUserPrefs.setUseSkyPreset(name); + saveUserPrefs(); + updateManagersFromPrefs(false); +} + +void LLEnvManagerNew::setUseDayCycle(const std::string& name) +{ + if (!LLDayCycleManager::instance().presetExists(name)) + { + llwarns << "Invalid day cycle name passed" << llendl; + return; + } + + mUserPrefs.setUseDayCycle(name); + saveUserPrefs(); + updateManagersFromPrefs(false); +} + +void LLEnvManagerNew::loadUserPrefs() +{ + // operate on members directly to avoid side effects + mUserPrefs.mWaterPresetName = gSavedSettings.getString("WaterPresetName"); + mUserPrefs.mSkyPresetName = gSavedSettings.getString("SkyPresetName"); + mUserPrefs.mDayCycleName = gSavedSettings.getString("DayCycleName"); + + mUserPrefs.mUseRegionSettings = gSavedSettings.getBOOL("UseEnvironmentFromRegion"); + mUserPrefs.mUseDayCycle = gSavedSettings.getBOOL("UseDayCycle"); +} + +void LLEnvManagerNew::saveUserPrefs() +{ + gSavedSettings.setString("WaterPresetName", getWaterPresetName()); + gSavedSettings.setString("SkyPresetName", getSkyPresetName()); + gSavedSettings.setString("DayCycleName", getDayCycleName()); + + gSavedSettings.setBOOL("UseEnvironmentFromRegion", getUseRegionSettings()); + gSavedSettings.setBOOL("UseDayCycle", getUseDayCycle()); + + mUsePrefsChangeSignal(); +} + +void LLEnvManagerNew::setUserPrefs( + const std::string& water_preset, + const std::string& sky_preset, + const std::string& day_cycle_preset, + bool use_fixed_sky, + bool use_region_settings) +{ + // operate on members directly to avoid side effects + mUserPrefs.mWaterPresetName = water_preset; + mUserPrefs.mSkyPresetName = sky_preset; + mUserPrefs.mDayCycleName = day_cycle_preset; + + mUserPrefs.mUseRegionSettings = use_region_settings; + mUserPrefs.mUseDayCycle = !use_fixed_sky; + + saveUserPrefs(); + updateManagersFromPrefs(false); +} + +void LLEnvManagerNew::dumpUserPrefs() +{ + LL_DEBUGS("Windlight") << "WaterPresetName: " << gSavedSettings.getString("WaterPresetName") << LL_ENDL; + LL_DEBUGS("Windlight") << "SkyPresetName: " << gSavedSettings.getString("SkyPresetName") << LL_ENDL; + LL_DEBUGS("Windlight") << "DayCycleName: " << gSavedSettings.getString("DayCycleName") << LL_ENDL; + + LL_DEBUGS("Windlight") << "UseEnvironmentFromRegion: " << gSavedSettings.getBOOL("UseEnvironmentFromRegion") << LL_ENDL; + LL_DEBUGS("Windlight") << "UseDayCycle: " << gSavedSettings.getBOOL("UseDayCycle") << LL_ENDL; +} + +void LLEnvManagerNew::dumpPresets() +{ + const LLEnvironmentSettings& region_settings = getRegionSettings(); + std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : "Unknown region"; + + // Dump water presets. + LL_DEBUGS("Windlight") << "Waters:" << LL_ENDL; + if (region_settings.getWaterParams().size() != 0) + { + LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL; + } + LLWaterParamManager::preset_name_list_t 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; + } + + // Dump sky presets. + LL_DEBUGS("Windlight") << "Skies:" << LL_ENDL; + LLWLParamManager::preset_key_list_t 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; + std::string item_title; + + if (it->scope == LLEnvKey::SCOPE_LOCAL) // local preset + { + item_title = preset_name; + } + else // region preset + { + item_title = preset_name + " (" + region_name + ")"; + } + LL_DEBUGS("Windlight") << " - " << item_title << LL_ENDL; + } + + // Dump day cycles. + LL_DEBUGS("Windlight") << "Days:" << LL_ENDL; + const LLSD& cur_region_dc = region_settings.getWLDayCycle(); + if (cur_region_dc.size() != 0) + { + LL_DEBUGS("Windlight") << " - " << region_name << LL_ENDL; + } + LLDayCycleManager::preset_name_list_t days; + LLDayCycleManager::instance().getPresetNames(days); + for (LLDayCycleManager::preset_name_list_t::const_iterator it = days.begin(); it != days.end(); ++it) + { + LL_DEBUGS("Windlight") << " - " << *it << LL_ENDL; + } +} + +void LLEnvManagerNew::requestRegionSettings() +{ + LLEnvironmentRequest::initiate(); +} + +bool LLEnvManagerNew::sendRegionSettings(const LLEnvironmentSettings& new_settings) +{ + LLSD metadata; + + metadata["regionID"] = gAgent.getRegion()->getRegionID(); + // add last received update ID to outbound message so simulator can handle concurrent updates + metadata["messageID"] = mLastReceivedID; + + return LLEnvironmentApply::initiateRequest(new_settings.makePacket(metadata)); +} + +boost::signals2::connection LLEnvManagerNew::setPreferencesChangeCallback(const prefs_change_signal_t::slot_type& cb) +{ + return mUsePrefsChangeSignal.connect(cb); +} + +boost::signals2::connection LLEnvManagerNew::setRegionSettingsChangeCallback(const region_settings_change_signal_t::slot_type& cb) +{ + return mRegionSettingsChangeSignal.connect(cb); +} + +boost::signals2::connection LLEnvManagerNew::setRegionChangeCallback(const region_change_signal_t::slot_type& cb) +{ + return mRegionChangeSignal.connect(cb); +} + +boost::signals2::connection LLEnvManagerNew::setRegionSettingsAppliedCallback(const region_settings_applied_signal_t::slot_type& cb) +{ + return mRegionSettingsAppliedSignal.connect(cb); +} + +// static +bool LLEnvManagerNew::canEditRegionSettings() +{ + LLViewerRegion* region = gAgent.getRegion(); + BOOL owner_or_god = gAgent.isGodlike() || (region && region->getOwner() == gAgent.getID()); + BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); + + LL_DEBUGS("Windlight") << "Can edit region settings: " << (bool) owner_or_god_or_manager << LL_ENDL; + return owner_or_god_or_manager; +} + +// static +const std::string LLEnvManagerNew::getScopeString(LLEnvKey::EScope scope) +{ + switch(scope) + { + case LLEnvKey::SCOPE_LOCAL: + return LLTrans::getString("LocalSettings"); + case LLEnvKey::SCOPE_REGION: + return LLTrans::getString("RegionSettings"); + default: + return " (?)"; + } +} + +void LLEnvManagerNew::onRegionCrossing() +{ + LL_DEBUGS("Windlight") << "Crossed region" << LL_ENDL; + onRegionChange(true); +} + +void LLEnvManagerNew::onTeleport() +{ + LL_DEBUGS("Windlight") << "Teleported" << LL_ENDL; + onRegionChange(false); +} + +void LLEnvManagerNew::onRegionSettingsResponse(const LLSD& content) +{ + // If the message was valid, grab the UUID from it and save it for next outbound update message. + mLastReceivedID = content[0]["messageID"].asUUID(); + + // Refresh cached region settings. + LL_DEBUGS("Windlight") << "Caching region environment settings: " << content << LL_ENDL; + F32 sun_hour = 0; // *TODO + LLEnvironmentSettings new_settings(content[1], content[2], content[3], sun_hour); + mCachedRegionPrefs = new_settings; + + // Load region sky presets. + LLWLParamManager::instance().refreshRegionPresets(); + + // If using server settings, update managers. + if (getUseRegionSettings()) + { + updateManagersFromPrefs(mInterpNextChangeMessage); + } + + // Let interested parties know about the region settings update. + mRegionSettingsChangeSignal(); + + // reset + mInterpNextChangeMessage = false; +} + +void LLEnvManagerNew::onRegionSettingsApplyResponse(bool ok) +{ + LL_DEBUGS("Windlight") << "Applying region settings " << (ok ? "succeeded" : "failed") << LL_ENDL; + + // Clear locally modified region settings because they have just been uploaded. + mNewRegionPrefs.clear(); + + mRegionSettingsAppliedSignal(ok); +} + +//-- private methods ---------------------------------------------------------- + +// virtual +void LLEnvManagerNew::initSingleton() +{ + LL_DEBUGS("Windlight") << "Initializing LLEnvManagerNew" << LL_ENDL; + + loadUserPrefs(); +} + +void LLEnvManagerNew::updateSkyFromPrefs() +{ + bool success = true; + + // Sync sky with user prefs. + if (getUseRegionSettings()) // apply region-wide settings + { + success = useRegionSky(); + } + else // apply user-specified settings + { + if (getUseDayCycle()) + { + success = useDayCycle(getDayCycleName(), LLEnvKey::SCOPE_LOCAL); + } + else + { + success = useSkyPreset(getSkyPresetName()); + } + } + + // If something went wrong, fall back to defaults. + if (!success) + { + // *TODO: fix user prefs + useDefaultSky(); + } +} + +void LLEnvManagerNew::updateWaterFromPrefs(bool interpolate) +{ + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + LLSD target_water_params; + + // Determine new water settings based on user prefs. + + { + // Fall back to default water. + LLWaterParamSet default_water; + water_mgr.getParamSet("Default", default_water); + target_water_params = default_water.getAll(); + } + + if (getUseRegionSettings()) + { + // *TODO: make sure whether region settings belong to the current region? + const LLSD& region_water_params = getRegionSettings().getWaterParams(); + if (region_water_params.size() != 0) // region has no water settings + { + LL_DEBUGS("Windlight") << "Applying region water" << LL_ENDL; + target_water_params = region_water_params; + } + else + { + LL_DEBUGS("Windlight") << "Applying default water" << LL_ENDL; + } + } + else + { + std::string water = getWaterPresetName(); + LL_DEBUGS("Windlight") << "Applying water preset [" << water << "]" << LL_ENDL; + LLWaterParamSet params; + if (!water_mgr.getParamSet(water, params)) + { + llwarns << "No water preset named " << water << ", falling back to defaults" << llendl; + water_mgr.getParamSet("Default", params); + + // *TODO: Fix user preferences accordingly. + } + target_water_params = params.getAll(); + } + + // Sync water with user prefs. + water_mgr.applyParams(target_water_params, interpolate); +} + +void LLEnvManagerNew::updateManagersFromPrefs(bool interpolate) +{ + // Apply water settings. + updateWaterFromPrefs(interpolate); + + // Apply sky settings. + updateSkyFromPrefs(); +} + +bool LLEnvManagerNew::useRegionSky() +{ + const LLEnvironmentSettings& region_settings = getRegionSettings(); + + // If region is set to defaults, + if (region_settings.getSkyMap().size() == 0) + { + // well... apply the default sky settings. + useDefaultSky(); + return true; + } + + // *TODO: Support fixed sky from region. + + // Otherwise apply region day cycle. + LL_DEBUGS("Windlight") << "Applying region sky" << LL_ENDL; + return useDayCycleParams( + region_settings.getWLDayCycle(), + LLEnvKey::SCOPE_REGION, + region_settings.getDayTime()); +} + +bool LLEnvManagerNew::useRegionWater() +{ + const LLEnvironmentSettings& region_settings = getRegionSettings(); + const LLSD& region_water = region_settings.getWaterParams(); + + // If region is set to defaults, + if (region_water.size() == 0) + { + // well... apply the default water settings. + return useDefaultWater(); + } + + // Otherwise apply region water. + LL_DEBUGS("Windlight") << "Applying region sky" << LL_ENDL; + return useWaterParams(region_water); +} + +bool LLEnvManagerNew::useDefaultSky() +{ + return useDayCycle("Default", LLEnvKey::SCOPE_LOCAL); +} + +bool LLEnvManagerNew::useDefaultWater() +{ + return useWaterPreset("Default"); +} + + +void LLEnvManagerNew::onRegionChange(bool interpolate) +{ + // Avoid duplicating region setting requests + // by checking whether the region is actually changing. + LLViewerRegion* regionp = gAgent.getRegion(); + LLUUID region_uuid = regionp ? regionp->getRegionID() : LLUUID::null; + if (region_uuid == mCurRegionUUID) + { + return; + } + + // Clear locally modified region settings. + mNewRegionPrefs.clear(); + + // *TODO: clear environment settings of the previous region? + + // Request environment settings of the new region. + LL_DEBUGS("Windlight") << "New viewer region: " << region_uuid << LL_ENDL; + mCurRegionUUID = region_uuid; + mInterpNextChangeMessage = interpolate; + requestRegionSettings(); + + // Let interested parties know agent region has been changed. + mRegionChangeSignal(); +} diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h new file mode 100644 index 0000000000..96af102c1a --- /dev/null +++ b/indra/newview/llenvmanager.h @@ -0,0 +1,283 @@ +/** + * @file llenvmanager.h + * @brief Declaration of classes managing WindLight and water settings. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLENVMANAGER_H +#define LL_LLENVMANAGER_H + +#include "llmemory.h" +#include "llsd.h" + +class LLWLParamManager; +class LLWaterParamManager; +class LLWLAnimator; + +// generic key +struct LLEnvKey +{ +public: + // Note: enum ordering is important; for example, a region-level floater (1) will see local and region (all values that are <=) + typedef enum e_scope + { + SCOPE_LOCAL, // 0 + SCOPE_REGION//, // 1 + // SCOPE_ESTATE, // 2 + // etc. + } EScope; +}; + +class LLEnvironmentSettings +{ +public: + LLEnvironmentSettings() : + mWLDayCycle(LLSD::emptyMap()), + mSkyMap(LLSD::emptyMap()), + mWaterParams(LLSD::emptyMap()), + mDayTime(0.f) + {} + LLEnvironmentSettings(const LLSD& dayCycle, const LLSD& skyMap, const LLSD& waterParams, F64 dayTime) : + mWLDayCycle(dayCycle), + mSkyMap(skyMap), + mWaterParams(waterParams), + mDayTime(dayTime) + {} + ~LLEnvironmentSettings() {} + + void saveParams(const LLSD& dayCycle, const LLSD& skyMap, const LLSD& waterParams, F64 dayTime) + { + mWLDayCycle = dayCycle; + mSkyMap = skyMap; + mWaterParams = waterParams; + mDayTime = dayTime; + } + + const LLSD& getWLDayCycle() const + { + return mWLDayCycle; + } + + const LLSD& getWaterParams() const + { + return mWaterParams; + } + + const LLSD& getSkyMap() const + { + return mSkyMap; + } + + F64 getDayTime() const + { + return mDayTime; + } + + bool isEmpty() const + { + return mWLDayCycle.size() == 0; + } + + void clear() + { + *this = LLEnvironmentSettings(); + } + + LLSD makePacket(const LLSD& metadata) const + { + LLSD full_packet = LLSD::emptyArray(); + + // 0: metadata + full_packet.append(metadata); + + // 1: day cycle + full_packet.append(mWLDayCycle); + + // 2: map of sky setting names to sky settings (as LLSD) + full_packet.append(mSkyMap); + + // 3: water params + full_packet.append(mWaterParams); + + return full_packet; + } + +private: + LLSD mWLDayCycle, mWaterParams, mSkyMap; + F64 mDayTime; +}; + +/** + * User environment preferences. + */ +class LLEnvPrefs +{ +public: + LLEnvPrefs() : mUseRegionSettings(true), mUseDayCycle(true) {} + + bool getUseRegionSettings() const { return mUseRegionSettings; } + bool getUseDayCycle() const { return mUseDayCycle; } + bool getUseFixedSky() const { return !getUseDayCycle(); } + + std::string getWaterPresetName() const; + std::string getSkyPresetName() const; + std::string getDayCycleName() const; + + void setUseRegionSettings(bool val); + void setUseWaterPreset(const std::string& name); + void setUseSkyPreset(const std::string& name); + void setUseDayCycle(const std::string& name); + + bool mUseRegionSettings; + bool mUseDayCycle; + std::string mWaterPresetName; + std::string mSkyPresetName; + std::string mDayCycleName; +}; + +/** + * Setting: + * 1. Use region settings. + * 2. Use my setting: <water preset> + <fixed_sky>|<day_cycle> + */ +class LLEnvManagerNew : public LLSingleton<LLEnvManagerNew> +{ + LOG_CLASS(LLEnvManagerNew); +public: + typedef boost::signals2::signal<void()> prefs_change_signal_t; + typedef boost::signals2::signal<void()> region_settings_change_signal_t; + typedef boost::signals2::signal<void()> region_change_signal_t; + typedef boost::signals2::signal<void(bool)> region_settings_applied_signal_t; + + LLEnvManagerNew(); + + // getters to access user env. preferences + bool getUseRegionSettings() const; + bool getUseDayCycle() const; + bool getUseFixedSky() const; + std::string getWaterPresetName() const; + std::string getSkyPresetName() const; + std::string getDayCycleName() const; + + /// @return cached env. settings of the current region. + const LLEnvironmentSettings& getRegionSettings() const; + + /** + * Set new region settings without uploading them to the region. + * + * The override will be reset when the changes are applied to the region (=uploaded) + * or user teleports to another region. + */ + void setRegionSettings(const LLEnvironmentSettings& new_settings); + + // Change environment w/o changing user preferences. + bool usePrefs(); + bool useDefaults(); + bool useRegionSettings(); + bool useWaterPreset(const std::string& name); + bool useWaterParams(const LLSD& params); + bool useSkyPreset(const std::string& name); + bool useSkyParams(const LLSD& params); + bool useDayCycle(const std::string& name, LLEnvKey::EScope scope); + bool useDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time = 0.5); + + // setters for user env. preferences + void setUseRegionSettings(bool val); + void setUseWaterPreset(const std::string& name); + void setUseSkyPreset(const std::string& name); + void setUseDayCycle(const std::string& name); + void setUserPrefs( + const std::string& water_preset, + const std::string& sky_preset, + const std::string& day_cycle_preset, + bool use_fixed_sky, + bool use_region_settings); + + // debugging methods + void dumpUserPrefs(); + void dumpPresets(); + + // Misc. + void requestRegionSettings(); + bool sendRegionSettings(const LLEnvironmentSettings& new_settings); + boost::signals2::connection setPreferencesChangeCallback(const prefs_change_signal_t::slot_type& cb); + boost::signals2::connection setRegionSettingsChangeCallback(const region_settings_change_signal_t::slot_type& cb); + boost::signals2::connection setRegionChangeCallback(const region_change_signal_t::slot_type& cb); + boost::signals2::connection setRegionSettingsAppliedCallback(const region_settings_applied_signal_t::slot_type& cb); + + static bool canEditRegionSettings(); /// @return true if we have access to editing region environment + static const std::string getScopeString(LLEnvKey::EScope scope); + + // Public callbacks. + void onRegionCrossing(); + void onTeleport(); + void onRegionSettingsResponse(const LLSD& content); + void onRegionSettingsApplyResponse(bool ok); + +private: + friend class LLSingleton<LLEnvManagerNew>; + /*virtual*/ void initSingleton(); + + void loadUserPrefs(); + void saveUserPrefs(); + + void updateSkyFromPrefs(); + void updateWaterFromPrefs(bool interpolate); + void updateManagersFromPrefs(bool interpolate); + + bool useRegionSky(); + bool useRegionWater(); + + bool useDefaultSky(); + bool useDefaultWater(); + + void onRegionChange(bool interpolate); + + /// Emitted when user environment preferences change. + prefs_change_signal_t mUsePrefsChangeSignal; + + /// Emitted when region environment settings update comes. + region_settings_change_signal_t mRegionSettingsChangeSignal; + + /// Emitted when agent region changes. Move to LLAgent? + region_change_signal_t mRegionChangeSignal; + + /// Emitted when agent region changes. Move to LLAgent? + region_settings_applied_signal_t mRegionSettingsAppliedSignal; + + LLEnvPrefs mUserPrefs; /// User environment preferences. + LLEnvironmentSettings mCachedRegionPrefs; /// Cached region environment settings. + LLEnvironmentSettings mNewRegionPrefs; /// Not-yet-uploaded modified region env. settings. + bool mInterpNextChangeMessage; /// Interpolate env. settings on next region change. + LLUUID mCurRegionUUID; /// To avoid duplicated region env. settings requests. + LLUUID mLastReceivedID; /// Id of last received region env. settings. +}; + +#endif // LL_LLENVMANAGER_H + diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index cd5e779c4d..a29ccf2b6d 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventoryitemslist.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp deleted file mode 100644 index 22816ee802..0000000000 --- a/indra/newview/llfloaterdaycycle.cpp +++ /dev/null @@ -1,531 +0,0 @@ -/** - * @file llfloaterdaycycle.cpp - * @brief LLFloaterDayCycle class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterdaycycle.h" - -#include "pipeline.h" -#include "llsky.h" - -#include "llsliderctrl.h" -#include "llmultislider.h" -#include "llmultisliderctrl.h" -#include "llspinctrl.h" -#include "llcheckboxctrl.h" -#include "lluictrlfactory.h" -#include "llviewercamera.h" -#include "llcombobox.h" -#include "lllineeditor.h" -#include "llwlanimator.h" - -#include "v4math.h" -#include "llviewerdisplay.h" -#include "llviewercontrol.h" -#include "llviewerwindow.h" - -#include "llwlparamset.h" -#include "llwlparammanager.h" -#include "llpostprocess.h" -#include "llfloaterwindlight.h" - - -std::map<std::string, LLWLSkyKey> LLFloaterDayCycle::sSliderToKey; -const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; - -LLFloaterDayCycle::LLFloaterDayCycle(const LLSD& key) -: LLFloater(key) -{ -} - -BOOL LLFloaterDayCycle::postBuild() -{ - // add the combo boxes - LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets"); - - if(keyCombo != NULL) - { - keyCombo->removeall(); - std::map<std::string, LLWLParamSet>::iterator mIt = - LLWLParamManager::instance()->mParamList.begin(); - for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) - { - keyCombo->add(std::string(mIt->first)); - } - - // set defaults on combo boxes - keyCombo->selectFirstItem(); - } - - // add the time slider - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); - - sldr->addSlider(); - - // load it up - initCallbacks(); - - syncMenu(); - syncSliderTrack(); - - return TRUE; -} - -LLFloaterDayCycle::~LLFloaterDayCycle() -{ -} - -void LLFloaterDayCycle::initCallbacks(void) -{ - // WL Day Cycle - getChild<LLUICtrl>("WLTimeSlider")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeSliderMoved, this, _1)); - getChild<LLUICtrl>("WLDayCycleKeys")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeMoved, this, _1)); - getChild<LLUICtrl>("WLCurKeyHour")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeChanged, this, _1)); - getChild<LLUICtrl>("WLCurKeyMin")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyTimeChanged, this, _1)); - getChild<LLUICtrl>("WLKeyPresets")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onKeyPresetChanged, this, _1)); - - getChild<LLUICtrl>("WLLengthOfDayHour")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); - getChild<LLUICtrl>("WLLengthOfDayMin")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); - getChild<LLUICtrl>("WLLengthOfDaySec")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onTimeRateChanged, this, _1)); - getChild<LLUICtrl>("WLUseLindenTime")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onUseLindenTime, this, _1)); - getChild<LLUICtrl>("WLAnimSky")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onRunAnimSky, this, _1)); - getChild<LLUICtrl>("WLStopAnimSky")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onStopAnimSky, this, _1)); - - getChild<LLUICtrl>("WLLoadDayCycle")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onLoadDayCycle, this, _1)); - getChild<LLUICtrl>("WLSaveDayCycle")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onSaveDayCycle, this, _1)); - - getChild<LLUICtrl>("WLAddKey")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onAddKey, this, _1)); - getChild<LLUICtrl>("WLDeleteKey")->setCommitCallback(boost::bind(&LLFloaterDayCycle::onDeleteKey, this, _1)); -} - -void LLFloaterDayCycle::syncMenu() -{ -// std::map<std::string, LLVector4> & currentParams = LLWLParamManager::instance()->mCurParams.mParamValues; - - // set time - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); - sldr->setCurSliderValue((F32)LLWLParamManager::instance()->mAnimator.getDayTime() * sHoursPerDay); - - LLSpinCtrl* secSpin = getChild<LLSpinCtrl>("WLLengthOfDaySec"); - LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLLengthOfDayHour"); - - F32 curRate; - F32 hours, min, sec; - - // get the current rate - curRate = LLWLParamManager::instance()->mDay.mDayRate; - hours = (F32)((int)(curRate / 60 / 60)); - curRate -= (hours * 60 * 60); - min = (F32)((int)(curRate / 60)); - curRate -= (min * 60); - sec = curRate; - - hourSpin->setValue(hours); - minSpin->setValue(min); - secSpin->setValue(sec); - - // turn off Use Estate Time button if it's already being used - if( LLWLParamManager::instance()->mAnimator.mUseLindenTime == true) - { - getChildView("WLUseLindenTime")->setEnabled(FALSE); - } - else - { - getChildView("WLUseLindenTime")->setEnabled(TRUE); - } -} - -void LLFloaterDayCycle::syncSliderTrack() -{ - // clear the slider - LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - - kSldr->clear(); - sSliderToKey.clear(); - - // add sliders - std::map<F32, std::string>::iterator mIt = - LLWLParamManager::instance()->mDay.mTimeMap.begin(); - for(; mIt != LLWLParamManager::instance()->mDay.mTimeMap.end(); mIt++) - { - addSliderKey(mIt->first * sHoursPerDay, mIt->second); - } -} - -void LLFloaterDayCycle::syncTrack() -{ - // if no keys, do nothing - if(sSliderToKey.size() == 0) - { - return; - } - - LLMultiSliderCtrl* sldr; - sldr = getChild<LLMultiSliderCtrl>( - "WLDayCycleKeys"); - llassert_always(sSliderToKey.size() == sldr->getValue().size()); - - LLMultiSliderCtrl* tSldr; - tSldr = getChild<LLMultiSliderCtrl>( - "WLTimeSlider"); - - // create a new animation track - LLWLParamManager::instance()->mDay.clearKeys(); - - // add the keys one by one - std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.begin(); - for(; mIt != sSliderToKey.end(); mIt++) - { - LLWLParamManager::instance()->mDay.addKey(mIt->second.time / sHoursPerDay, - mIt->second.presetName); - } - - // set the param manager's track to the new one - LLWLParamManager::instance()->resetAnimator( - tSldr->getCurSliderValue() / sHoursPerDay, false); - - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); -} - -void LLFloaterDayCycle::onRunAnimSky(LLUICtrl* ctrl) -{ - // if no keys, do nothing - if(sSliderToKey.size() == 0) - { - return; - } - - LLMultiSliderCtrl* sldr; - sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - llassert_always(sSliderToKey.size() == sldr->getValue().size()); - - LLMultiSliderCtrl* tSldr; - tSldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); - - // turn off linden time - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // set the param manager's track to the new one - LLWLParamManager::instance()->resetAnimator( - tSldr->getCurSliderValue() / sHoursPerDay, true); - - llassert_always(LLWLParamManager::instance()->mAnimator.mTimeTrack.size() == sldr->getValue().size()); -} - -void LLFloaterDayCycle::onStopAnimSky(LLUICtrl* ctrl) -{ - // if no keys, do nothing - if(sSliderToKey.size() == 0) { - return; - } - - // turn off animation and using linden time - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; -} - -void LLFloaterDayCycle::onUseLindenTime(LLUICtrl* ctrl) -{ - LLComboBox* box = getChild<LLComboBox>("WLPresetsCombo"); - box->selectByValue(""); - - LLWLParamManager::instance()->mAnimator.mIsRunning = true; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; -} - -void LLFloaterDayCycle::onLoadDayCycle(LLUICtrl* ctrl) -{ - LLWLParamManager::instance()->mDay.loadDayCycle("Default.xml"); - - // sync it all up - syncSliderTrack(); - syncMenu(); - - // set the param manager's track to the new one - LLMultiSliderCtrl* tSldr; - tSldr = getChild<LLMultiSliderCtrl>( - "WLTimeSlider"); - LLWLParamManager::instance()->resetAnimator( - tSldr->getCurSliderValue() / sHoursPerDay, false); - - // and draw it - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); -} - -void LLFloaterDayCycle::onSaveDayCycle(LLUICtrl* ctrl) -{ - LLWLParamManager::instance()->mDay.saveDayCycle("Default.xml"); -} - - -void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl) -{ - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( - "WLTimeSlider"); - - /// get the slider value - F32 val = sldr->getCurSliderValue() / sHoursPerDay; - - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime((F64)val); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); -} - -void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl) -{ - LLComboBox* comboBox = getChild<LLComboBox>("WLKeyPresets"); - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLCurKeyHour"); - LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLCurKeyMin"); - - if(sldr->getValue().size() == 0) { - return; - } - - // make sure we have a slider - const std::string& curSldr = sldr->getCurSlider(); - if(curSldr == "") { - return; - } - - F32 time = sldr->getCurSliderValue(); - - // check to see if a key exists - std::string presetName = sSliderToKey[curSldr].presetName; - sSliderToKey[curSldr].time = time; - - // if it exists, turn on check box - comboBox->selectByValue(presetName); - - // now set the spinners - F32 hour = (F32)((S32)time); - F32 min = (time - hour) * 60; - - // handle imprecision - if(min >= 59) { - min = 0; - hour += 1; - } - - hourSpin->set(hour); - minSpin->set(min); - - syncTrack(); - -} - -void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl) -{ - // if no keys, skipped - if(sSliderToKey.size() == 0) { - return; - } - - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( - "WLDayCycleKeys"); - LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>( - "WLCurKeyHour"); - LLSpinCtrl* minSpin = getChild<LLSpinCtrl>( - "WLCurKeyMin"); - - F32 hour = hourSpin->get(); - F32 min = minSpin->get(); - F32 val = hour + min / 60.0f; - - const std::string& curSldr = sldr->getCurSlider(); - sldr->setCurSliderValue(val, TRUE); - F32 time = sldr->getCurSliderValue() / sHoursPerDay; - - // now set the key's time in the sliderToKey map - std::string presetName = sSliderToKey[curSldr].presetName; - sSliderToKey[curSldr].time = time; - - syncTrack(); -} - -void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl) -{ - // get the time - LLComboBox* comboBox = getChild<LLComboBox>( - "WLKeyPresets"); - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>( - "WLDayCycleKeys"); - - // do nothing if no sliders - if(sldr->getValue().size() == 0) { - return; - } - - // change the map - std::string newPreset(comboBox->getSelectedValue().asString()); - const std::string& curSldr = sldr->getCurSlider(); - - // if null, don't use - if(curSldr == "") { - return; - } - - sSliderToKey[curSldr].presetName = newPreset; - - syncTrack(); -} - -void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl) -{ - // get the time - LLSpinCtrl* secSpin = getChild<LLSpinCtrl>( - "WLLengthOfDaySec"); - - LLSpinCtrl* minSpin = getChild<LLSpinCtrl>( - "WLLengthOfDayMin"); - - LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>( - "WLLengthOfDayHour"); - - F32 hour; - hour = (F32)hourSpin->getValue().asReal(); - F32 min; - min = (F32)minSpin->getValue().asReal(); - F32 sec; - sec = (F32)secSpin->getValue().asReal(); - - F32 time = 60.0f * 60.0f * hour + 60.0f * min + sec; - if(time <= 0) { - time = 1; - } - LLWLParamManager::instance()->mDay.mDayRate = time; - - syncTrack(); -} - -void LLFloaterDayCycle::onAddKey(LLUICtrl* ctrl) -{ - LLComboBox* comboBox = getChild<LLComboBox>( - "WLKeyPresets"); - LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>( - "WLDayCycleKeys"); - LLMultiSliderCtrl* tSldr = getChild<LLMultiSliderCtrl>( - "WLTimeSlider"); - - llassert_always(sSliderToKey.size() == kSldr->getValue().size()); - - // get the values - std::string newPreset(comboBox->getSelectedValue().asString()); - - // add the slider key - addSliderKey(tSldr->getCurSliderValue(), newPreset); - - syncTrack(); -} - -void LLFloaterDayCycle::addSliderKey(F32 time, const std::string & presetName) -{ - LLMultiSliderCtrl* kSldr = getChild<LLMultiSliderCtrl>( - "WLDayCycleKeys"); - - // make a slider - const std::string& sldrName = kSldr->addSlider(time); - if(sldrName == "") { - return; - } - - // set the key - LLWLSkyKey newKey; - newKey.presetName = presetName; - newKey.time = kSldr->getCurSliderValue(); - - llassert_always(sldrName != LLStringUtil::null); - - // add to map - sSliderToKey.insert(std::pair<std::string, LLWLSkyKey>(sldrName, newKey)); - - llassert_always(sSliderToKey.size() == kSldr->getValue().size()); - -} - -void LLFloaterDayCycle::deletePreset(std::string& presetName) -{ - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - - /// delete any reference - std::map<std::string, LLWLSkyKey>::iterator curr_preset, next_preset; - for(curr_preset = sSliderToKey.begin(); curr_preset != sSliderToKey.end(); curr_preset = next_preset) - { - next_preset = curr_preset; - ++next_preset; - if (curr_preset->second.presetName == presetName) - { - sldr->deleteSlider(curr_preset->first); - sSliderToKey.erase(curr_preset); - } - } -} - -void LLFloaterDayCycle::onDeleteKey(LLUICtrl* ctrl) -{ - if(sSliderToKey.size() == 0) { - return; - } - - LLComboBox* comboBox = getChild<LLComboBox>( - "WLKeyPresets"); - LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); - - // delete from map - const std::string& sldrName = sldr->getCurSlider(); - std::map<std::string, LLWLSkyKey>::iterator mIt = sSliderToKey.find(sldrName); - sSliderToKey.erase(mIt); - - sldr->deleteCurSlider(); - - if(sSliderToKey.size() == 0) { - return; - } - - const std::string& name = sldr->getCurSlider(); - comboBox->selectByValue(sSliderToKey[name].presetName); - F32 time = sSliderToKey[name].time; - - LLSpinCtrl* hourSpin = getChild<LLSpinCtrl>("WLCurKeyHour"); - LLSpinCtrl* minSpin = getChild<LLSpinCtrl>("WLCurKeyMin"); - - // now set the spinners - F32 hour = (F32)((S32)time); - F32 min = (time - hour) / 60; - hourSpin->set(hour); - minSpin->set(min); - - syncTrack(); - -} diff --git a/indra/newview/llfloaterdaycycle.h b/indra/newview/llfloaterdaycycle.h deleted file mode 100644 index 993ddb8f07..0000000000 --- a/indra/newview/llfloaterdaycycle.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @file llfloaterdaycycle.h - * @brief LLFloaterDayCycle class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLFLOATERDAYCYCLE_H -#define LL_LLFLOATERDAYCYCLE_H - -#include "llfloater.h" - -#include <vector> -#include "llwlparamset.h" -#include "llwlanimator.h" - -struct WLColorControl; -struct WLFloatControl; - -/// convenience class for holding keys mapped to sliders -struct LLWLSkyKey -{ -public: - std::string presetName; - F32 time; -}; - -/// Menu for all of windlight's functionality. -/// Menuing system for adjusting the atmospheric settings of the world. -class LLFloaterDayCycle : public LLFloater -{ -public: - - LLFloaterDayCycle(const LLSD& key); - virtual ~LLFloaterDayCycle(); - /*virtual*/ BOOL postBuild(); - - /// initialize all - void initCallbacks(void); - - /// on time slider moved - void onTimeSliderMoved(LLUICtrl* ctrl); - - /// what happens when you move the key frame - void onKeyTimeMoved(LLUICtrl* ctrl); - - /// what happens when you change the key frame's time - void onKeyTimeChanged(LLUICtrl* ctrl); - - /// if you change the combo box, change the frame - void onKeyPresetChanged(LLUICtrl* ctrl); - - /// run this when user says to run the sky animation - void onRunAnimSky(LLUICtrl* ctrl); - - /// run this when user says to stop the sky animation - void onStopAnimSky(LLUICtrl* ctrl); - - /// if you change the combo box, change the frame - void onTimeRateChanged(LLUICtrl* ctrl); - - /// add a new key on slider - void onAddKey(LLUICtrl* ctrl); - - /// delete any and all reference to a preset - void deletePreset(std::string& presetName); - - /// delete a key frame - void onDeleteKey(LLUICtrl* ctrl); - - /// button to load day - void onLoadDayCycle(LLUICtrl* ctrl); - - /// button to save day - void onSaveDayCycle(LLUICtrl* ctrl); - - /// toggle for Linden time - void onUseLindenTime(LLUICtrl* ctrl); - - /// sync up sliders with day cycle structure - void syncMenu(); - - // makes sure key slider has what's in day cycle - void syncSliderTrack(); - - /// makes sure day cycle data structure has what's in menu - void syncTrack(); - - /// add a slider to the track - void addSliderKey(F32 time, const std::string& presetName); - -private: - - // map of sliders to parameters - static std::map<std::string, LLWLSkyKey> sSliderToKey; - - static const F32 sHoursPerDay; -}; - - -#endif diff --git a/indra/newview/llfloaterdeleteenvpreset.cpp b/indra/newview/llfloaterdeleteenvpreset.cpp new file mode 100644 index 0000000000..4fefd2242a --- /dev/null +++ b/indra/newview/llfloaterdeleteenvpreset.cpp @@ -0,0 +1,285 @@ +/** + * @file llfloaterdeleteenvpreset.cpp + * @brief Floater to delete a water / sky / day cycle preset. + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterdeleteenvpreset.h" + +// libs +#include "llbutton.h" +#include "llcombobox.h" +#include "llnotificationsutil.h" + +// newview +#include "lldaycyclemanager.h" +#include "llwaterparammanager.h" + +static bool confirmation_callback(const LLSD& notification, const LLSD& response, boost::function<void()> cb) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + cb(); + } + return false; + +} + +LLFloaterDeleteEnvPreset::LLFloaterDeleteEnvPreset(const LLSD &key) +: LLFloater(key) +, mPresetCombo(NULL) +{ +} + +// virtual +BOOL LLFloaterDeleteEnvPreset::postBuild() +{ + mPresetCombo = getChild<LLComboBox>("preset_combo"); + mPresetCombo->setCommitCallback(boost::bind(&LLFloaterDeleteEnvPreset::postPopulate, this)); + + getChild<LLButton>("delete")->setCommitCallback(boost::bind(&LLFloaterDeleteEnvPreset::onBtnDelete, this)); + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterDeleteEnvPreset::onBtnCancel, this)); + + // Listen to user preferences change, in which case we need to rebuild the presets list + // to disable the [new] current preset. + LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterDeleteEnvPreset::populatePresetsList, this)); + + // Listen to presets addition/removal. + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterDeleteEnvPreset::populateDayCyclesList, this)); + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeleteEnvPreset::populateSkyPresetsList, this)); + LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeleteEnvPreset::populateWaterPresetsList, this)); + + return TRUE; +} + +// virtual +void LLFloaterDeleteEnvPreset::onOpen(const LLSD& key) +{ + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string combo_label = getString(std::string("label_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the combobox label. + getChild<LLUICtrl>("label")->setValue(combo_label); + + // Populate the combobox. + populatePresetsList(); +} + +void LLFloaterDeleteEnvPreset::onBtnDelete() +{ + std::string param = mKey.asString(); + std::string preset_name = mPresetCombo->getValue().asString(); + boost::function<void()> confirm_cb; + + if (param == "water") + { + // Don't allow deleting system presets. + if (LLWaterParamManager::instance().isSystemPreset(preset_name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + confirm_cb = boost::bind(&LLFloaterDeleteEnvPreset::onDeleteWaterPresetConfirmation, this); + } + else if (param == "sky") + { + // Don't allow deleting presets referenced by local day cycles. + if (LLDayCycleManager::instance().isSkyPresetReferenced(preset_name)) + { + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", getString("msg_sky_is_referenced"))); + return; + } + + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + + // Don't allow deleting system presets. + if (wl_mgr.isSystemPreset(preset_name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + confirm_cb = boost::bind(&LLFloaterDeleteEnvPreset::onDeleteSkyPresetConfirmation, this); + } + else if (param == "day_cycle") + { + LLDayCycleManager& day_mgr = LLDayCycleManager::instance(); + + // Don't allow deleting system presets. + if (day_mgr.isSystemPreset(preset_name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + confirm_cb = boost::bind(&LLFloaterDeleteEnvPreset::onDeleteDayCycleConfirmation, this); + } + else + { + llwarns << "Unrecognized key" << llendl; + } + + LLSD args; + args["MESSAGE"] = getString("msg_confirm_deletion"); + LLNotificationsUtil::add("GenericAlertYesCancel", args, LLSD(), + boost::bind(&confirmation_callback, _1, _2, confirm_cb)); +} + +void LLFloaterDeleteEnvPreset::onBtnCancel() +{ + closeFloater(); +} + +void LLFloaterDeleteEnvPreset::populatePresetsList() +{ + std::string param = mKey.asString(); + + if (param == "water") + { + populateWaterPresetsList(); + } + else if (param == "sky") + { + populateSkyPresetsList(); + } + else if (param == "day_cycle") + { + populateDayCyclesList(); + } + else + { + llwarns << "Unrecognized key" << llendl; + } +} + +void LLFloaterDeleteEnvPreset::populateWaterPresetsList() +{ + if (mKey.asString() != "water") return; + + mPresetCombo->removeall(); + + std::string cur_preset; + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + if (!env_mgr.getUseRegionSettings()) + { + cur_preset = env_mgr.getWaterPresetName(); + } + + LLWaterParamManager::preset_name_list_t presets; + LLWaterParamManager::instance().getUserPresetNames(presets); // list only user presets + for (LLWaterParamManager::preset_name_list_t::const_iterator it = presets.begin(); it != presets.end(); ++it) + { + std::string name = *it; + + bool enabled = (name != cur_preset); // don't allow deleting current preset + mPresetCombo->add(name, ADD_BOTTOM, enabled); + } + + postPopulate(); +} + +void LLFloaterDeleteEnvPreset::populateSkyPresetsList() +{ + if (mKey.asString() != "sky") return; + + mPresetCombo->removeall(); + + std::string cur_preset; + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + if (!env_mgr.getUseRegionSettings() && env_mgr.getUseFixedSky()) + { + cur_preset = env_mgr.getSkyPresetName(); + } + + LLWLParamManager::preset_name_list_t user_presets; + LLWLParamManager::instance().getUserPresetNames(user_presets); + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + const std::string& name = *it; + mPresetCombo->add(name, ADD_BOTTOM, /*enabled = */ name != cur_preset); + } + + postPopulate(); +} + +void LLFloaterDeleteEnvPreset::populateDayCyclesList() +{ + if (mKey.asString() != "day_cycle") return; + + mPresetCombo->removeall(); + + std::string cur_day; + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + if (!env_mgr.getUseRegionSettings() && env_mgr.getUseDayCycle()) + { + cur_day = env_mgr.getDayCycleName(); + } + + LLDayCycleManager& day_mgr = LLDayCycleManager::instance(); + LLDayCycleManager::preset_name_list_t user_days; + day_mgr.getUserPresetNames(user_days); // list only user presets + for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) + { + const std::string& name = *it; + mPresetCombo->add(name, ADD_BOTTOM, name != cur_day); + } + + postPopulate(); +} + +void LLFloaterDeleteEnvPreset::postPopulate() +{ + // Handle empty list and empty selection. + bool has_selection = mPresetCombo->getItemCount() > 1 && mPresetCombo->getSelectedValue().isDefined(); + + if (!has_selection) + { + mPresetCombo->setLabel(getString("combo_label")); + } + + getChild<LLButton>("delete")->setEnabled(has_selection); +} + +void LLFloaterDeleteEnvPreset::onDeleteDayCycleConfirmation() +{ + LLDayCycleManager::instance().deletePreset(mPresetCombo->getValue().asString()); +} + +void LLFloaterDeleteEnvPreset::onDeleteSkyPresetConfirmation() +{ + LLWLParamKey key(mPresetCombo->getValue().asString(), LLEnvKey::SCOPE_LOCAL); + LLWLParamManager::instance().removeParamSet(key, true); +} + +void LLFloaterDeleteEnvPreset::onDeleteWaterPresetConfirmation() +{ + LLWaterParamManager::instance().removeParamSet(mPresetCombo->getValue().asString(), true); +} diff --git a/indra/newview/llfloaterdeleteenvpreset.h b/indra/newview/llfloaterdeleteenvpreset.h new file mode 100644 index 0000000000..1211505273 --- /dev/null +++ b/indra/newview/llfloaterdeleteenvpreset.h @@ -0,0 +1,62 @@ +/** + * @file llfloaterdeleteenvpreset.h + * @brief Floater to delete a water / sky / day cycle preset. + * + * $LicenseInfo:firstyear=2011&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_LLFLOATERDELETEENVPRESET_H +#define LL_LLFLOATERDELETEENVPRESET_H + +#include "llfloater.h" + +class LLComboBox; + +class LLFloaterDeleteEnvPreset : public LLFloater +{ + LOG_CLASS(LLFloaterDeleteEnvPreset); + +public: + LLFloaterDeleteEnvPreset(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void onBtnDelete(); + void onBtnCancel(); + +private: + void populatePresetsList(); + void populateWaterPresetsList(); + void populateSkyPresetsList(); + void populateDayCyclesList(); + + void postPopulate(); + + void onDeleteDayCycleConfirmation(); + void onDeleteSkyPresetConfirmation(); + void onDeleteWaterPresetConfirmation(); + + LLComboBox* mPresetCombo; +}; + +#endif // LL_LLFLOATERDELETEENVPRESET_H diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp new file mode 100644 index 0000000000..b63677b258 --- /dev/null +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -0,0 +1,825 @@ +/** + * @file llfloatereditdaycycle.cpp + * @brief Floater to create or edit a day cycle + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditdaycycle.h" + +// libs +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llloadingindicator.h" +#include "llmultisliderctrl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llspinctrl.h" +#include "lltimectrl.h" + +// newview +#include "llagent.h" +#include "lldaycyclemanager.h" +#include "llenvmanager.h" +#include "llregioninfomodel.h" +#include "llviewerregion.h" +#include "llwlparammanager.h" + +const F32 LLFloaterEditDayCycle::sHoursPerDay = 24.0f; + +LLFloaterEditDayCycle::LLFloaterEditDayCycle(const LLSD &key) +: LLFloater(key) +, mDayCycleNameEditor(NULL) +, mDayCyclesCombo(NULL) +, mTimeSlider(NULL) +, mKeysSlider(NULL) +, mSkyPresetsCombo(NULL) +, mTimeCtrl(NULL) +, mMakeDefaultCheckBox(NULL) +, mSaveButton(NULL) +{ +} + +// virtual +BOOL LLFloaterEditDayCycle::postBuild() +{ + mDayCycleNameEditor = getChild<LLLineEditor>("day_cycle_name"); + mDayCyclesCombo = getChild<LLComboBox>("day_cycle_combo"); + + mTimeSlider = getChild<LLMultiSliderCtrl>("WLTimeSlider"); + mKeysSlider = getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + mSkyPresetsCombo = getChild<LLComboBox>("WLSkyPresets"); + mTimeCtrl = getChild<LLTimeCtrl>("time"); + mSaveButton = getChild<LLButton>("save"); + mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); + + initCallbacks(); + + // add the time slider + mTimeSlider->addSlider(); + + return TRUE; +} + +// virtual +void LLFloaterEditDayCycle::onOpen(const LLSD& key) +{ + bool new_day = isNewDay(); + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(!new_day); + + // Switch between the day cycle presets combobox and day cycle name input field. + mDayCyclesCombo->setVisible(!new_day); + mDayCycleNameEditor->setVisible(new_day); + + // TODO: Make sure only one instance of the floater exists? + + reset(); +} + +// virtual +void LLFloaterEditDayCycle::onClose(bool app_quitting) +{ + if (!app_quitting) // there's no point to change environment if we're quitting + { + LLEnvManagerNew::instance().usePrefs(); // revert changes made to current day cycle + } +} + +// virtual +void LLFloaterEditDayCycle::draw() +{ + syncTimeSlider(); + LLFloater::draw(); +} + +void LLFloaterEditDayCycle::initCallbacks(void) +{ + mDayCycleNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleNameEdited, this), NULL); + mDayCyclesCombo->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleSelected, this)); + mDayCyclesCombo->setTextEntryCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleNameEdited, this)); + mTimeSlider->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onTimeSliderMoved, this)); + mKeysSlider->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onKeyTimeMoved, this)); + mTimeCtrl->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onKeyTimeChanged, this)); + mSkyPresetsCombo->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onKeyPresetChanged, this)); + + getChild<LLButton>("WLAddKey")->setClickedCallback(boost::bind(&LLFloaterEditDayCycle::onAddKey, this)); + getChild<LLButton>("WLDeleteKey")->setClickedCallback(boost::bind(&LLFloaterEditDayCycle::onDeleteKey, this)); + + mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onBtnSave, this)); + mSaveButton->setRightMouseDownCallback(boost::bind(&LLFloaterEditDayCycle::dumpTrack, this)); + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onBtnCancel, this)); + + // Connect to env manager events. + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + env_mgr.setRegionSettingsChangeCallback(boost::bind(&LLFloaterEditDayCycle::onRegionSettingsChange, this)); + env_mgr.setRegionChangeCallback(boost::bind(&LLFloaterEditDayCycle::onRegionChange, this)); + env_mgr.setRegionSettingsAppliedCallback(boost::bind(&LLFloaterEditDayCycle::onRegionSettingsApplied, this, _1)); + + // Connect to day cycle manager events. + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEditDayCycle::onDayCycleListChange, this)); + + // Connect to sky preset list changes. + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEditDayCycle::onSkyPresetListChange, this)); + + // Connect to region info updates. + LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditDayCycle::onRegionInfoUpdate, this)); +} + +void LLFloaterEditDayCycle::syncTimeSlider() +{ + // set time + mTimeSlider->setCurSliderValue((F32)LLWLParamManager::getInstance()->mAnimator.getDayTime() * sHoursPerDay); +} + +void LLFloaterEditDayCycle::loadTrack() +{ + // clear the slider + mKeysSlider->clear(); + mSliderToKey.clear(); + + // add sliders + + lldebugs << "Adding " << LLWLParamManager::getInstance()->mDay.mTimeMap.size() << " keys to slider" << llendl; + + LLWLDayCycle& cur_dayp = LLWLParamManager::instance().mDay; + for (std::map<F32, LLWLParamKey>::iterator it = cur_dayp.mTimeMap.begin(); it != cur_dayp.mTimeMap.end(); ++it) + { + addSliderKey(it->first * sHoursPerDay, it->second); + } + + // set drop-down menu to match preset of currently-selected keyframe (one is automatically selected initially) + const std::string& cur_sldr = mKeysSlider->getCurSlider(); + if (strlen(cur_sldr.c_str()) > 0) // only do this if there is a curSldr, otherwise we put an invalid entry into the map + { + mSkyPresetsCombo->selectByValue(mSliderToKey[cur_sldr].keyframe.toStringVal()); + } + + syncTimeSlider(); +} + +void LLFloaterEditDayCycle::applyTrack() +{ + lldebugs << "Applying track (" << mSliderToKey.size() << ")" << llendl; + + // if no keys, do nothing + if (mSliderToKey.size() == 0) + { + lldebugs << "No keys, not syncing" << llendl; + return; + } + + llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); + + // create a new animation track + LLWLParamManager::getInstance()->mDay.clearKeyframes(); + + // add the keys one by one + for (std::map<std::string, SliderKey>::iterator it = mSliderToKey.begin(); + it != mSliderToKey.end(); ++it) + { + LLWLParamManager::getInstance()->mDay.addKeyframe(it->second.time / sHoursPerDay, + it->second.keyframe); + } + + // set the param manager's track to the new one + LLWLParamManager::getInstance()->resetAnimator( + mTimeSlider->getCurSliderValue() / sHoursPerDay, false); + + LLWLParamManager::getInstance()->mAnimator.update( + LLWLParamManager::getInstance()->mCurParams); +} + +void LLFloaterEditDayCycle::refreshSkyPresetsList() +{ + // Don't allow selecting region skies for a local day cycle, + // because thus we may end up with invalid day cycle. + bool include_region_skies = getSelectedDayCycle().scope == LLEnvKey::SCOPE_REGION; + + mSkyPresetsCombo->removeall(); + + LLWLParamManager::preset_name_list_t region_presets; + LLWLParamManager::preset_name_list_t user_presets, sys_presets; + LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); + + if (include_region_skies) + { + // Add region presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it) + { + std::string preset_name = *it; + std::string item_title = preset_name + " (" + getRegionName() + ")"; + mSkyPresetsCombo->add(preset_name, LLWLParamKey(*it, LLEnvKey::SCOPE_REGION).toStringVal()); + } + + if (!region_presets.empty()) + { + mSkyPresetsCombo->addSeparator(); + } + } + + // Add user presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mSkyPresetsCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + if (!user_presets.empty()) + { + mSkyPresetsCombo->addSeparator(); + } + + // Add system presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) + { + mSkyPresetsCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + // set defaults on combo boxes + mSkyPresetsCombo->selectFirstItem(); +} + +void LLFloaterEditDayCycle::refreshDayCyclesList() +{ + llassert(isNewDay() == false); + + mDayCyclesCombo->removeall(); + +#if 0 // Disable editing existing day cycle until the workflow is clear enough. + const LLSD& region_day = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle(); + if (region_day.size() > 0) + { + LLWLParamKey key(getRegionName(), LLEnvKey::SCOPE_REGION); + mDayCyclesCombo->add(key.name, key.toLLSD()); + mDayCyclesCombo->addSeparator(); + } +#endif + + LLDayCycleManager::preset_name_list_t user_days, sys_days; + LLDayCycleManager::instance().getPresetNames(user_days, sys_days); + + // Add user days. + for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) + { + mDayCyclesCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + + if (user_days.size() > 0) + { + mDayCyclesCombo->addSeparator(); + } + + // Add system days. + for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it) + { + mDayCyclesCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + + mDayCyclesCombo->setLabel(getString("combo_label")); +} + +void LLFloaterEditDayCycle::onTimeSliderMoved() +{ + /// get the slider value + F32 val = mTimeSlider->getCurSliderValue() / sHoursPerDay; + + // set the value, turn off animation + LLWLParamManager::getInstance()->mAnimator.setDayTime((F64)val); + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + // then call update once + LLWLParamManager::getInstance()->mAnimator.update( + LLWLParamManager::getInstance()->mCurParams); +} + +void LLFloaterEditDayCycle::onKeyTimeMoved() +{ + if (mKeysSlider->getValue().size() == 0) + { + return; + } + + // make sure we have a slider + const std::string& cur_sldr = mKeysSlider->getCurSlider(); + if (cur_sldr == "") + { + return; + } + + F32 time24 = mKeysSlider->getCurSliderValue(); + + // check to see if a key exists + LLWLParamKey key = mSliderToKey[cur_sldr].keyframe; + lldebugs << "Setting key time: " << time24 << LL_ENDL; + mSliderToKey[cur_sldr].time = time24; + + // if it exists, turn on check box + mSkyPresetsCombo->selectByValue(key.toStringVal()); + + mTimeCtrl->setTime24(time24); + + applyTrack(); +} + +void LLFloaterEditDayCycle::onKeyTimeChanged() +{ + // if no keys, skipped + if (mSliderToKey.size() == 0) + { + return; + } + + F32 time24 = mTimeCtrl->getTime24(); + + const std::string& cur_sldr = mKeysSlider->getCurSlider(); + mKeysSlider->setCurSliderValue(time24, TRUE); + F32 time = mKeysSlider->getCurSliderValue() / sHoursPerDay; + + // now set the key's time in the sliderToKey map + lldebugs << "Setting key time: " << time << LL_ENDL; + mSliderToKey[cur_sldr].time = time; + + applyTrack(); +} + +void LLFloaterEditDayCycle::onKeyPresetChanged() +{ + // do nothing if no sliders + if (mKeysSlider->getValue().size() == 0) + { + return; + } + + // change the map + + std::string stringVal = mSkyPresetsCombo->getSelectedValue().asString(); + LLWLParamKey new_key(stringVal); + llassert(!new_key.name.empty()); + const std::string& cur_sldr = mKeysSlider->getCurSlider(); + + // if null, don't use + if (cur_sldr == "") + { + return; + } + + mSliderToKey[cur_sldr].keyframe = new_key; + + // Apply changes to current day cycle. + applyTrack(); +} + +void LLFloaterEditDayCycle::onAddKey() +{ + llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); + + S32 max_sliders; + LLEnvKey::EScope scope = LLEnvKey::SCOPE_LOCAL; // *TODO: editing region day cycle + switch (scope) + { + case LLEnvKey::SCOPE_LOCAL: + max_sliders = 20; // *HACK this should be LLWLPacketScrubber::MAX_LOCAL_KEY_FRAMES; + break; + case LLEnvKey::SCOPE_REGION: + max_sliders = 12; // *HACK this should be LLWLPacketScrubber::MAX_REGION_KEY_FRAMES; + break; + default: + max_sliders = (S32) mKeysSlider->getMaxValue(); + break; + } + + if ((S32)mSliderToKey.size() >= max_sliders) + { + LLSD args; + args["SCOPE"] = LLEnvManagerNew::getScopeString(scope); + args["MAX"] = max_sliders; + LLNotificationsUtil::add("DayCycleTooManyKeyframes", args, LLSD(), LLNotificationFunctorRegistry::instance().DONOTHING); + return; + } + + // add the slider key + std::string key_val = mSkyPresetsCombo->getSelectedValue().asString(); + LLWLParamKey sky_params(key_val); + llassert(!sky_params.name.empty()); + + F32 time = mTimeSlider->getCurSliderValue(); + addSliderKey(time, sky_params); + + // apply the change to current day cycles + applyTrack(); +} + +void LLFloaterEditDayCycle::addSliderKey(F32 time, LLWLParamKey keyframe) +{ + // make a slider + const std::string& sldr_name = mKeysSlider->addSlider(time); + if (sldr_name.empty()) + { + return; + } + + // set the key + SliderKey newKey(keyframe, mKeysSlider->getCurSliderValue()); + + llassert_always(sldr_name != LLStringUtil::null); + + // add to map + mSliderToKey.insert(std::pair<std::string, SliderKey>(sldr_name, newKey)); + + llassert_always(mSliderToKey.size() == mKeysSlider->getValue().size()); +} + +LLWLParamKey LLFloaterEditDayCycle::getSelectedDayCycle() +{ + LLWLParamKey dc_key; + + if (mDayCycleNameEditor->getVisible()) + { + dc_key.name = mDayCycleNameEditor->getText(); + dc_key.scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + LLSD combo_val = mDayCyclesCombo->getValue(); + + if (!combo_val.isArray()) // manually typed text + { + dc_key.name = combo_val.asString(); + dc_key.scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + dc_key.fromLLSD(combo_val); + } + } + + return dc_key; +} + +bool LLFloaterEditDayCycle::isNewDay() const +{ + return mKey.asString() == "new"; +} + +void LLFloaterEditDayCycle::dumpTrack() +{ + LL_DEBUGS("Windlight") << "Dumping day cycle" << LL_ENDL; + + LLWLDayCycle& cur_dayp = LLWLParamManager::instance().mDay; + for (std::map<F32, LLWLParamKey>::iterator it = cur_dayp.mTimeMap.begin(); it != cur_dayp.mTimeMap.end(); ++it) + { + F32 time = it->first * 24.0f; + S32 h = (S32) time; + S32 m = (S32) ((time - h) * 60.0f); + LL_DEBUGS("Windlight") << llformat("(%.3f) %02d:%02d", time, h, m) << " => " << it->second.name << LL_ENDL; + } +} + +void LLFloaterEditDayCycle::enableEditing(bool enable) +{ + mSkyPresetsCombo->setEnabled(enable); + mTimeCtrl->setEnabled(enable); + getChild<LLPanel>("day_cycle_slider_panel")->setCtrlsEnabled(enable); + mSaveButton->setEnabled(enable); + mMakeDefaultCheckBox->setEnabled(enable); +} + +void LLFloaterEditDayCycle::reset() +{ + // clear the slider + mKeysSlider->clear(); + mSliderToKey.clear(); + + refreshSkyPresetsList(); + + if (isNewDay()) + { + mDayCycleNameEditor->setValue(LLSD()); + F32 time = 0.5f * sHoursPerDay; + mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name + mTimeSlider->setCurSliderValue(time); + + addSliderKey(time, LLWLParamKey("Default", LLEnvKey::SCOPE_LOCAL)); + onKeyTimeMoved(); // update the time control and sky sky combo + + applyTrack(); + } + else + { + refreshDayCyclesList(); + + // Disable controls until a day cycle to edit is selected. + enableEditing(false); + } +} + +void LLFloaterEditDayCycle::saveRegionDayCycle() +{ + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + LLWLDayCycle& cur_dayp = LLWLParamManager::instance().mDay; // the day cycle being edited + + // Get current day cycle and the sky preset it references. + LLSD day_cycle = cur_dayp.asLLSD(); + LLSD sky_map; + cur_dayp.getSkyMap(sky_map); + + // Apply it to the region. + LLEnvironmentSettings new_region_settings; + new_region_settings.saveParams(day_cycle, sky_map, env_mgr.getRegionSettings().getWaterParams(), 0.0f); + +#if 1 + LLEnvManagerNew::instance().setRegionSettings(new_region_settings); +#else // Temporary disabled ability to upload new region settings from the Day Cycle Editor. + if (!LLEnvManagerNew::instance().sendRegionSettings(new_region_settings)) + { + llwarns << "Error applying region environment settings" << llendl; + return; + } + + setApplyProgress(true); +#endif +} + +void LLFloaterEditDayCycle::setApplyProgress(bool started) +{ + LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("progress_indicator"); + + indicator->setVisible(started); + + if (started) + { + indicator->start(); + } + else + { + indicator->stop(); + } +} + +bool LLFloaterEditDayCycle::getApplyProgress() const +{ + return getChild<LLLoadingIndicator>("progress_indicator")->getVisible(); +} + +void LLFloaterEditDayCycle::onDeleteKey() +{ + if (mSliderToKey.size() == 0) + { + return; + } + else if (mSliderToKey.size() == 1) + { + LLNotifications::instance().add("EnvCannotDeleteLastDayCycleKey", LLSD(), LLSD()); + return; + } + + // delete from map + const std::string& sldr_name = mKeysSlider->getCurSlider(); + std::map<std::string, SliderKey>::iterator mIt = mSliderToKey.find(sldr_name); + mSliderToKey.erase(mIt); + + mKeysSlider->deleteCurSlider(); + + if (mSliderToKey.size() == 0) + { + return; + } + + const std::string& name = mKeysSlider->getCurSlider(); + mSkyPresetsCombo->selectByValue(mSliderToKey[name].keyframe.toStringVal()); + F32 time24 = mSliderToKey[name].time; + + mTimeCtrl->setTime24(time24); + + applyTrack(); +} + +void LLFloaterEditDayCycle::onRegionSettingsChange() +{ + LL_DEBUGS("Windlight") << "Region settings changed" << LL_ENDL; + + if (getApplyProgress()) // our region settings have being applied + { + setApplyProgress(false); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << "Changed environment preference to region settings" << llendl; + LLEnvManagerNew::instance().setUseRegionSettings(true); + } + + closeFloater(); + } +} + +void LLFloaterEditDayCycle::onRegionChange() +{ + LL_DEBUGS("Windlight") << "Region changed" << LL_ENDL; + + // If we're editing the region day cycle + if (getSelectedDayCycle().scope == LLEnvKey::SCOPE_REGION) + { + reset(); // undoes all unsaved changes + } +} + +void LLFloaterEditDayCycle::onRegionSettingsApplied(bool success) +{ + LL_DEBUGS("Windlight") << "Region settings applied: " << success << LL_ENDL; + + if (!success) + { + // stop progress indicator + setApplyProgress(false); + } +} + +void LLFloaterEditDayCycle::onRegionInfoUpdate() +{ + LL_DEBUGS("Windlight") << "Region info updated" << LL_ENDL; + bool can_edit = true; + + // If we've selected the region day cycle for editing. + if (getSelectedDayCycle().scope == LLEnvKey::SCOPE_REGION) + { + // check whether we have the access + can_edit = LLEnvManagerNew::canEditRegionSettings(); + } + + enableEditing(can_edit); +} + +void LLFloaterEditDayCycle::onDayCycleNameEdited() +{ + // Disable saving a day cycle having empty name. + LLWLParamKey key = getSelectedDayCycle(); + mSaveButton->setEnabled(!key.name.empty()); +} + +void LLFloaterEditDayCycle::onDayCycleSelected() +{ + LLSD day_data; + LLWLParamKey dc_key = getSelectedDayCycle(); + bool can_edit = true; + + if (dc_key.scope == LLEnvKey::SCOPE_LOCAL) + { + if (!LLDayCycleManager::instance().getPreset(dc_key.name, day_data)) + { + llwarns << "No day cycle named " << dc_key.name << llendl; + return; + } + } + else + { + day_data = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle(); + if (day_data.size() == 0) + { + llwarns << "Empty region day cycle" << llendl; + llassert(day_data.size() > 0); + return; + } + + can_edit = LLEnvManagerNew::canEditRegionSettings(); + } + + // We may need to add or remove region skies from the list. + refreshSkyPresetsList(); + + F32 slider_time = mTimeSlider->getCurSliderValue() / sHoursPerDay; + LLWLParamManager::instance().applyDayCycleParams(day_data, dc_key.scope, slider_time); + loadTrack(); + + enableEditing(can_edit); +} + +void LLFloaterEditDayCycle::onBtnSave() +{ + LLDayCycleManager& day_mgr = LLDayCycleManager::instance(); + LLWLParamKey selected_day = getSelectedDayCycle(); + + if (selected_day.scope == LLEnvKey::SCOPE_REGION) + { + saveRegionDayCycle(); + closeFloater(); + return; + } + + std::string name = selected_day.name; + if (name.empty()) + { + // *TODO: show an alert + llwarns << "Empty day cycle name" << llendl; + return; + } + + // Don't allow overwriting system presets. + if (day_mgr.isSystemPreset(name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + // Save, ask for confirmation for overwriting an existing preset. + if (day_mgr.presetExists(name)) + { + LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterEditDayCycle::onSaveAnswer, this, _1, _2)); + } + else + { + // new preset, hence no confirmation needed + onSaveConfirmed(); + } +} + +void LLFloaterEditDayCycle::onBtnCancel() +{ + closeFloater(); +} + +bool LLFloaterEditDayCycle::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // If they choose save, do it. Otherwise, don't do anything + if (option == 0) + { + onSaveConfirmed(); + } + + return false; +} + +void LLFloaterEditDayCycle::onSaveConfirmed() +{ + std::string name = getSelectedDayCycle().name; + + // Save preset. + LLSD data = LLWLParamManager::instance().mDay.asLLSD(); + LL_DEBUGS("Windlight") << "Saving day cycle " << name << ": " << data << LL_ENDL; + LLDayCycleManager::instance().savePreset(name, data); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << name << " is now the new preferred day cycle" << llendl; + LLEnvManagerNew::instance().setUseDayCycle(name); + } + + closeFloater(); +} + +void LLFloaterEditDayCycle::onDayCycleListChange() +{ + if (!isNewDay()) + { + refreshDayCyclesList(); + } +} + +void LLFloaterEditDayCycle::onSkyPresetListChange() +{ + refreshSkyPresetsList(); + + // Refresh sliders from the currently visible day cycle. + loadTrack(); +} + +// static +std::string LLFloaterEditDayCycle::getRegionName() +{ + return gAgent.getRegion() ? gAgent.getRegion()->getName() : LLTrans::getString("Unknown"); +} diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h new file mode 100644 index 0000000000..e6e4fe39c1 --- /dev/null +++ b/indra/newview/llfloatereditdaycycle.h @@ -0,0 +1,137 @@ +/** + * @file llfloatereditdaycycle.h + * @brief Floater to create or edit a day cycle + * + * $LicenseInfo:firstyear=2011&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_LLFLOATEREDITDAYCYCLE_H +#define LL_LLFLOATEREDITDAYCYCLE_H + +#include "llfloater.h" + +#include "llwlparammanager.h" // for LLWLParamKey + +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; +class LLMultiSliderCtrl; +class LLTimeCtrl; + +/** + * Floater for creating or editing a day cycle. + */ +class LLFloaterEditDayCycle : public LLFloater +{ + LOG_CLASS(LLFloaterEditDayCycle); + +public: + LLFloaterEditDayCycle(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + +private: + + /// sync the time slider with day cycle structure + void syncTimeSlider(); + + // makes sure key slider has what's in day cycle + void loadTrack(); + + /// makes sure day cycle data structure has what's in menu + void applyTrack(); + + /// refresh the sky presets combobox + void refreshSkyPresetsList(); + + /// refresh the day cycle combobox + void refreshDayCyclesList(); + + /// add a slider to the track + void addSliderKey(F32 time, LLWLParamKey keyframe); + + void initCallbacks(); + LLWLParamKey getSelectedDayCycle(); + bool isNewDay() const; + void dumpTrack(); + void enableEditing(bool enable); + void reset(); + void saveRegionDayCycle(); + + void setApplyProgress(bool started); + bool getApplyProgress() const; + + void onTimeSliderMoved(); /// time slider moved + void onKeyTimeMoved(); /// a key frame moved + void onKeyTimeChanged(); /// a key frame's time changed + void onKeyPresetChanged(); /// sky preset selected + void onAddKey(); /// new key added on slider + void onDeleteKey(); /// a key frame deleted + + void onRegionSettingsChange(); + void onRegionChange(); + void onRegionSettingsApplied(bool success); + void onRegionInfoUpdate(); + + void onDayCycleNameEdited(); + void onDayCycleSelected(); + void onBtnSave(); + void onBtnCancel(); + + bool onSaveAnswer(const LLSD& notification, const LLSD& response); + void onSaveConfirmed(); + + void onDayCycleListChange(); + void onSkyPresetListChange(); + + static std::string getRegionName(); + + /// convenience class for holding keyframes mapped to sliders + struct SliderKey + { + public: + SliderKey(LLWLParamKey kf, F32 t) : keyframe(kf), time(t) {} + SliderKey() : keyframe(), time(0.f) {} // Don't use this default constructor + + LLWLParamKey keyframe; + F32 time; + }; + + static const F32 sHoursPerDay; + + LLLineEditor* mDayCycleNameEditor; + LLComboBox* mDayCyclesCombo; + LLMultiSliderCtrl* mTimeSlider; + LLMultiSliderCtrl* mKeysSlider; + LLComboBox* mSkyPresetsCombo; + LLTimeCtrl* mTimeCtrl; + LLCheckBoxCtrl* mMakeDefaultCheckBox; + LLButton* mSaveButton; + + // map of sliders to parameters + std::map<std::string, SliderKey> mSliderToKey; +}; + +#endif // LL_LLFLOATEREDITDAYCYCLE_H diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp new file mode 100644 index 0000000000..abee7b5dc9 --- /dev/null +++ b/indra/newview/llfloatereditsky.cpp @@ -0,0 +1,923 @@ +/** + * @file llfloatereditsky.cpp + * @brief Floater to create or edit a sky preset + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditsky.h" + +// libs +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llmultisliderctrl.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llsliderctrl.h" +#include "lltabcontainer.h" +#include "lltimectrl.h" + +// newview +#include "llagent.h" +#include "llcolorswatch.h" +#include "llregioninfomodel.h" +#include "llviewerregion.h" + +static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; +static const F32 WL_BLUE_HORIZON_DENSITY_SCALE = 2.0f; +static const F32 WL_CLOUD_SLIDER_SCALE = 1.0f; + +static F32 sun_pos_to_time24(F32 sun_pos) +{ + return fmodf(sun_pos * 24.0f + 6, 24.0f); +} + +static F32 time24_to_sun_pos(F32 time24) +{ + F32 sun_pos = fmodf((time24 - 6) / 24.0f, 1.0f); + if (sun_pos < 0) ++sun_pos; + return sun_pos; +} + +LLFloaterEditSky::LLFloaterEditSky(const LLSD &key) +: LLFloater(key) +, mSkyPresetNameEditor(NULL) +, mSkyPresetCombo(NULL) +, mMakeDefaultCheckBox(NULL) +, mSaveButton(NULL) +{ +} + +// virtual +BOOL LLFloaterEditSky::postBuild() +{ + mSkyPresetNameEditor = getChild<LLLineEditor>("sky_preset_name"); + mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo"); + mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); + mSaveButton = getChild<LLButton>("save"); + + initCallbacks(); + + // Create the sun position scrubber on the slider. + getChild<LLMultiSliderCtrl>("WLSunPos")->addSlider(12.f); + + return TRUE; +} + +// virtual +void LLFloaterEditSky::onOpen(const LLSD& key) +{ + bool new_preset = isNewPreset(); + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(!new_preset); + + // Switch between the sky presets combobox and preset name input field. + mSkyPresetCombo->setVisible(!new_preset); + mSkyPresetNameEditor->setVisible(new_preset); + + reset(); +} + +// virtual +void LLFloaterEditSky::onClose(bool app_quitting) +{ + if (!app_quitting) // there's no point to change environment if we're quitting + { + LLEnvManagerNew::instance().usePrefs(); // revert changes made to current environment + } +} + +// virtual +void LLFloaterEditSky::draw() +{ + syncControls(); + LLFloater::draw(); +} + +void LLFloaterEditSky::initCallbacks(void) +{ + // *TODO: warn user if a region environment update comes while we're editing a region sky preset. + + mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), NULL); + mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditSky::onSkyPresetSelected, this)); + mSkyPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this)); + + mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnSave, this)); + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); + + LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLFloaterEditSky::onRegionSettingsChange, this)); + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); + + // Connect to region info updates. + LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this)); + + //------------------------------------------------------------------------- + + LLWLParamManager& param_mgr = LLWLParamManager::instance(); + + // blue horizon + getChild<LLUICtrl>("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mBlueHorizon)); + + // haze density, horizon, mult, and altitude + getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, ¶m_mgr.mHazeDensity)); + getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, ¶m_mgr.mHazeHorizon)); + getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mDensityMult)); + getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mMaxAlt)); + + // blue density + getChild<LLUICtrl>("WLBlueDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mBlueDensity)); + + // Lighting + + // sunlight + getChild<LLUICtrl>("WLSunlight")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mSunlight)); + + // glow + getChild<LLUICtrl>("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowRMoved, this, _1, ¶m_mgr.mGlow)); + getChild<LLUICtrl>("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowBMoved, this, _1, ¶m_mgr.mGlow)); + + // ambient + getChild<LLUICtrl>("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mAmbient)); + + // time of day + getChild<LLUICtrl>("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, ¶m_mgr.mLightnorm)); // multi-slider + getChild<LLTimeCtrl>("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this)); // time ctrl + getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, ¶m_mgr.mLightnorm)); + + // Clouds + + // Cloud Color + getChild<LLUICtrl>("WLCloudColor")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mCloudColor)); + + // Cloud + getChild<LLUICtrl>("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, ¶m_mgr.mCloudMain)); + getChild<LLUICtrl>("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, ¶m_mgr.mCloudMain)); + getChild<LLUICtrl>("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, ¶m_mgr.mCloudMain)); + + // Cloud Detail + getChild<LLUICtrl>("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, ¶m_mgr.mCloudDetail)); + getChild<LLUICtrl>("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, ¶m_mgr.mCloudDetail)); + getChild<LLUICtrl>("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, ¶m_mgr.mCloudDetail)); + + // Cloud extras + getChild<LLUICtrl>("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mCloudCoverage)); + getChild<LLUICtrl>("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mCloudScale)); + getChild<LLUICtrl>("WLCloudLockX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXToggled, this, _1)); + getChild<LLUICtrl>("WLCloudLockY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYToggled, this, _1)); + getChild<LLUICtrl>("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXMoved, this, _1)); + getChild<LLUICtrl>("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYMoved, this, _1)); + getChild<LLUICtrl>("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mDistanceMult)); + + // Dome + getChild<LLUICtrl>("WLGamma")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, ¶m_mgr.mWLGamma)); + getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1)); +} + +//================================================================================================= + +void LLFloaterEditSky::syncControls() +{ + bool err; + + LLWLParamManager * param_mgr = LLWLParamManager::getInstance(); + + LLWLParamSet& cur_params = param_mgr->mCurParams; + + // blue horizon + param_mgr->mBlueHorizon = cur_params.getVector(param_mgr->mBlueHorizon.mName, err); + setColorSwatch("WLBlueHorizon", param_mgr->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE); + + // haze density, horizon, mult, and altitude + param_mgr->mHazeDensity = cur_params.getVector(param_mgr->mHazeDensity.mName, err); + childSetValue("WLHazeDensity", param_mgr->mHazeDensity.r); + param_mgr->mHazeHorizon = cur_params.getVector(param_mgr->mHazeHorizon.mName, err); + childSetValue("WLHazeHorizon", param_mgr->mHazeHorizon.r); + param_mgr->mDensityMult = cur_params.getVector(param_mgr->mDensityMult.mName, err); + childSetValue("WLDensityMult", param_mgr->mDensityMult.x * + param_mgr->mDensityMult.mult); + param_mgr->mMaxAlt = cur_params.getVector(param_mgr->mMaxAlt.mName, err); + childSetValue("WLMaxAltitude", param_mgr->mMaxAlt.x); + + // blue density + param_mgr->mBlueDensity = cur_params.getVector(param_mgr->mBlueDensity.mName, err); + setColorSwatch("WLBlueDensity", param_mgr->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE); + + // Lighting + + // sunlight + param_mgr->mSunlight = cur_params.getVector(param_mgr->mSunlight.mName, err); + setColorSwatch("WLSunlight", param_mgr->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE); + + // glow + param_mgr->mGlow = cur_params.getVector(param_mgr->mGlow.mName, err); + childSetValue("WLGlowR", 2 - param_mgr->mGlow.r / 20.0f); + childSetValue("WLGlowB", -param_mgr->mGlow.b / 5.0f); + + // ambient + param_mgr->mAmbient = cur_params.getVector(param_mgr->mAmbient.mName, err); + setColorSwatch("WLAmbient", param_mgr->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE); + + F32 time24 = sun_pos_to_time24(param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); + getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE); + getChild<LLTimeCtrl>("WLDayTime")->setTime24(time24); + childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); + + // Clouds + + // Cloud Color + param_mgr->mCloudColor = cur_params.getVector(param_mgr->mCloudColor.mName, err); + setColorSwatch("WLCloudColor", param_mgr->mCloudColor, WL_CLOUD_SLIDER_SCALE); + + // Cloud + param_mgr->mCloudMain = cur_params.getVector(param_mgr->mCloudMain.mName, err); + childSetValue("WLCloudX", param_mgr->mCloudMain.r); + childSetValue("WLCloudY", param_mgr->mCloudMain.g); + childSetValue("WLCloudDensity", param_mgr->mCloudMain.b); + + // Cloud Detail + param_mgr->mCloudDetail = cur_params.getVector(param_mgr->mCloudDetail.mName, err); + childSetValue("WLCloudDetailX", param_mgr->mCloudDetail.r); + childSetValue("WLCloudDetailY", param_mgr->mCloudDetail.g); + childSetValue("WLCloudDetailDensity", param_mgr->mCloudDetail.b); + + // Cloud extras + param_mgr->mCloudCoverage = cur_params.getVector(param_mgr->mCloudCoverage.mName, err); + param_mgr->mCloudScale = cur_params.getVector(param_mgr->mCloudScale.mName, err); + childSetValue("WLCloudCoverage", param_mgr->mCloudCoverage.x); + childSetValue("WLCloudScale", param_mgr->mCloudScale.x); + + // cloud scrolling + bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX(); + bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); + childSetValue("WLCloudLockX", lockX); + childSetValue("WLCloudLockY", lockY); + + // disable if locked, enable if not + if (lockX) + { + childDisable("WLCloudScrollX"); + } + else + { + childEnable("WLCloudScrollX"); + } + if (lockY) + { + childDisable("WLCloudScrollY"); + } + else + { + childEnable("WLCloudScrollY"); + } + + // *HACK cloud scrolling is off my an additive of 10 + childSetValue("WLCloudScrollX", param_mgr->mCurParams.getCloudScrollX() - 10.0f); + childSetValue("WLCloudScrollY", param_mgr->mCurParams.getCloudScrollY() - 10.0f); + + param_mgr->mDistanceMult = cur_params.getVector(param_mgr->mDistanceMult.mName, err); + childSetValue("WLDistanceMult", param_mgr->mDistanceMult.x); + + // Tweak extras + + param_mgr->mWLGamma = cur_params.getVector(param_mgr->mWLGamma.mName, err); + childSetValue("WLGamma", param_mgr->mWLGamma.x); + + childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); +} + +void LLFloaterEditSky::setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k) +{ + // Set the value, dividing it by <k> first. + LLVector4 color_vec = from_ctrl; + getChild<LLColorSwatchCtrl>(name)->set(LLColor4(color_vec / k)); +} + +// color control callbacks +void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); + LLVector4 color_vec(swatch->get().mV); + + // Set intensity to maximum of the RGB values. + color_vec.mV[3] = llmax(color_vec.mV[0], llmax(color_vec.mV[1], color_vec.mV[2])); + + // Multiply RGB values by the appropriate factor. + F32 k = WL_CLOUD_SLIDER_SCALE; + if (color_ctrl->isSunOrAmbientColor) + { + k = WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->isBlueHorizonOrDensity) + { + k = WL_BLUE_HORIZON_DENSITY_SCALE; + } + + color_vec *= k; // intensity isn't affected by the multiplication + + // Apply the new RGBI value. + *color_ctrl = color_vec; + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + LLWLParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditSky::onColorControlRMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + color_ctrl->r = sldr_ctrl->getValueF32(); + if (color_ctrl->isSunOrAmbientColor) + { + color_ctrl->r *= WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->isBlueHorizonOrDensity) + { + color_ctrl->r *= WL_BLUE_HORIZON_DENSITY_SCALE; + } + + // move i if it's the max + if (color_ctrl->r >= color_ctrl->g && color_ctrl->r >= color_ctrl->b && color_ctrl->hasSliderName) + { + color_ctrl->i = color_ctrl->r; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + if (color_ctrl->isSunOrAmbientColor) + { + childSetValue(name, color_ctrl->r / WL_SUN_AMBIENT_SLIDER_SCALE); + } + else if (color_ctrl->isBlueHorizonOrDensity) + { + childSetValue(name, color_ctrl->r / WL_BLUE_HORIZON_DENSITY_SCALE); + } + else + { + childSetValue(name, color_ctrl->r); + } + } + + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + + LLWLParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditSky::onColorControlGMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + color_ctrl->g = sldr_ctrl->getValueF32(); + if (color_ctrl->isSunOrAmbientColor) + { + color_ctrl->g *= WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->isBlueHorizonOrDensity) + { + color_ctrl->g *= WL_BLUE_HORIZON_DENSITY_SCALE; + } + + // move i if it's the max + if (color_ctrl->g >= color_ctrl->r && color_ctrl->g >= color_ctrl->b && color_ctrl->hasSliderName) + { + color_ctrl->i = color_ctrl->g; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + if (color_ctrl->isSunOrAmbientColor) + { + childSetValue(name, color_ctrl->g / WL_SUN_AMBIENT_SLIDER_SCALE); + } + else if (color_ctrl->isBlueHorizonOrDensity) + { + childSetValue(name, color_ctrl->g / WL_BLUE_HORIZON_DENSITY_SCALE); + } + else + { + childSetValue(name, color_ctrl->g); + } + } + + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + + LLWLParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditSky::onColorControlBMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + color_ctrl->b = sldr_ctrl->getValueF32(); + if (color_ctrl->isSunOrAmbientColor) + { + color_ctrl->b *= WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->isBlueHorizonOrDensity) + { + color_ctrl->b *= WL_BLUE_HORIZON_DENSITY_SCALE; + } + + // move i if it's the max + if (color_ctrl->b >= color_ctrl->r && color_ctrl->b >= color_ctrl->g && color_ctrl->hasSliderName) + { + color_ctrl->i = color_ctrl->b; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + if (color_ctrl->isSunOrAmbientColor) + { + childSetValue(name, color_ctrl->b / WL_SUN_AMBIENT_SLIDER_SCALE); + } + else if (color_ctrl->isBlueHorizonOrDensity) + { + childSetValue(name, color_ctrl->b / WL_BLUE_HORIZON_DENSITY_SCALE); + } + else + { + childSetValue(name, color_ctrl->b); + } + } + + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + + LLWLParamManager::getInstance()->propagateParameters(); +} + +/// GLOW SPECIFIC CODE +void LLFloaterEditSky::onGlowRMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + // scaled by 20 + color_ctrl->r = (2 - sldr_ctrl->getValueF32()) * 20; + + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + LLWLParamManager::getInstance()->propagateParameters(); +} + +/// \NOTE that we want NEGATIVE (-) B +void LLFloaterEditSky::onGlowBMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big + color_ctrl->b = -sldr_ctrl->getValueF32() * 5; + + color_ctrl->update(LLWLParamManager::getInstance()->mCurParams); + LLWLParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditSky::onFloatControlMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + WLFloatControl * floatControl = static_cast<WLFloatControl *>(userdata); + + floatControl->x = sldr_ctrl->getValueF32() / floatControl->mult; + + floatControl->update(LLWLParamManager::getInstance()->mCurParams); + LLWLParamManager::getInstance()->propagateParameters(); +} + + +// Lighting callbacks + +// time of day +void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLMultiSliderCtrl* sun_msldr = getChild<LLMultiSliderCtrl>("WLSunPos"); + LLSliderCtrl* east_sldr = getChild<LLSliderCtrl>("WLEastAngle"); + LLTimeCtrl* time_ctrl = getChild<LLTimeCtrl>("WLDayTime"); + WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); + + F32 time24 = sun_msldr->getCurSliderValue(); + time_ctrl->setTime24(time24); // sync the time ctrl with the new sun position + + // get the two angles + LLWLParamManager * param_mgr = LLWLParamManager::getInstance(); + + param_mgr->mCurParams.setSunAngle(F_TWO_PI * time24_to_sun_pos(time24)); + param_mgr->mCurParams.setEastAngle(F_TWO_PI * east_sldr->getValueF32()); + + // set the sun vector + color_ctrl->r = -sin(param_mgr->mCurParams.getEastAngle()) * + cos(param_mgr->mCurParams.getSunAngle()); + color_ctrl->g = sin(param_mgr->mCurParams.getSunAngle()); + color_ctrl->b = cos(param_mgr->mCurParams.getEastAngle()) * + cos(param_mgr->mCurParams.getSunAngle()); + color_ctrl->i = 1.f; + + color_ctrl->update(param_mgr->mCurParams); + param_mgr->propagateParameters(); +} + +void LLFloaterEditSky::onTimeChanged() +{ + F32 time24 = getChild<LLTimeCtrl>("WLDayTime")->getTime24(); + getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE); + onSunMoved(getChild<LLUICtrl>("WLSunPos"), &LLWLParamManager::instance().mLightnorm); +} + +void LLFloaterEditSky::onStarAlphaMoved(LLUICtrl* ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + LLWLParamManager::getInstance()->mCurParams.setStarBrightness(sldr_ctrl->getValueF32()); +} + +// Clouds +void LLFloaterEditSky::onCloudScrollXMoved(LLUICtrl* ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + // *HACK all cloud scrolling is off by an additive of 10. + LLWLParamManager::getInstance()->mCurParams.setCloudScrollX(sldr_ctrl->getValueF32() + 10.0f); +} + +void LLFloaterEditSky::onCloudScrollYMoved(LLUICtrl* ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + // *HACK all cloud scrolling is off by an additive of 10. + LLWLParamManager::getInstance()->mCurParams.setCloudScrollY(sldr_ctrl->getValueF32() + 10.0f); +} + +void LLFloaterEditSky::onCloudScrollXToggled(LLUICtrl* ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLCheckBoxCtrl* cb_ctrl = static_cast<LLCheckBoxCtrl*>(ctrl); + + bool lock = cb_ctrl->get(); + LLWLParamManager::getInstance()->mCurParams.setEnableCloudScrollX(!lock); + + LLSliderCtrl* sldr = getChild<LLSliderCtrl>("WLCloudScrollX"); + + if (cb_ctrl->get()) + { + sldr->setEnabled(false); + } + else + { + sldr->setEnabled(true); + } + +} + +void LLFloaterEditSky::onCloudScrollYToggled(LLUICtrl* ctrl) +{ + LLWLParamManager::getInstance()->mAnimator.deactivate(); + + LLCheckBoxCtrl* cb_ctrl = static_cast<LLCheckBoxCtrl*>(ctrl); + bool lock = cb_ctrl->get(); + LLWLParamManager::getInstance()->mCurParams.setEnableCloudScrollY(!lock); + + LLSliderCtrl* sldr = getChild<LLSliderCtrl>("WLCloudScrollY"); + + if (cb_ctrl->get()) + { + sldr->setEnabled(false); + } + else + { + sldr->setEnabled(true); + } +} + +//================================================================================================= + +void LLFloaterEditSky::reset() +{ + if (isNewPreset()) + { + mSkyPresetNameEditor->setValue(LLSD()); + mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name + } + else + { + refreshSkyPresetsList(); + + // Disable controls until a sky preset to edit is selected. + enableEditing(false); + } +} + +bool LLFloaterEditSky::isNewPreset() const +{ + return mKey.asString() == "new"; +} + +void LLFloaterEditSky::refreshSkyPresetsList() +{ + mSkyPresetCombo->removeall(); + + LLWLParamManager::preset_name_list_t region_presets, user_presets, sys_presets; + LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); + +#if 0 // Disable editing region skies until the workflow is clear enough. + // Add region presets. + std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : LLTrans::getString("Unknown"); + for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it) + { + std::string item_title = *it + " (" + region_name + ")"; + mSkyPresetCombo->add(item_title, LLWLParamKey(*it, LLEnvKey::SCOPE_REGION).toLLSD()); + } + if (region_presets.size() > 0) + { + mSkyPresetCombo->addSeparator(); + } +#endif + + // Add user presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + if (user_presets.size() > 0) + { + mSkyPresetCombo->addSeparator(); + } + + // Add system presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) + { + mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + + mSkyPresetCombo->setLabel(getString("combo_label")); +} + +void LLFloaterEditSky::enableEditing(bool enable) +{ + // Enable/disable the tab and their contents. + LLTabContainer* tab_container = getChild<LLTabContainer>("WindLight Tabs"); + tab_container->setEnabled(enable); + for (S32 i = 0; i < tab_container->getTabCount(); ++i) + { + tab_container->enableTabButton(i, enable); + tab_container->getPanelByIndex(i)->setCtrlsEnabled(enable); + } + + // Enable/disable saving. + mSaveButton->setEnabled(enable); + mMakeDefaultCheckBox->setEnabled(enable); +} + +void LLFloaterEditSky::saveRegionSky() +{ + LLWLParamKey key(getSelectedSkyPreset()); + llassert(key.scope == LLEnvKey::SCOPE_REGION); + + LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << llendl; + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + wl_mgr.mCurParams.mName = key.name; + wl_mgr.setParamSet(key, wl_mgr.mCurParams); + + // *TODO: save to cached region settings. + LL_WARNS("Windlight") << "Saving region sky is not fully implemented yet" << LL_ENDL; +} + +LLWLParamKey LLFloaterEditSky::getSelectedSkyPreset() +{ + LLWLParamKey key; + + if (mSkyPresetNameEditor->getVisible()) + { + key.name = mSkyPresetNameEditor->getText(); + key.scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + LLSD combo_val = mSkyPresetCombo->getValue(); + + if (!combo_val.isArray()) // manually typed text + { + key.name = combo_val.asString(); + key.scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + key.fromLLSD(combo_val); + } + } + + return key; +} + +void LLFloaterEditSky::onSkyPresetNameEdited() +{ + // Disable saving a sky preset having empty name. + LLWLParamKey key = getSelectedSkyPreset(); + mSaveButton->setEnabled(!key.name.empty()); +} + +void LLFloaterEditSky::onSkyPresetSelected() +{ + LLWLParamKey key = getSelectedSkyPreset(); + LLWLParamSet sky_params; + + if (!LLWLParamManager::instance().getParamSet(key, sky_params)) + { + // Manually entered string? + LL_WARNS("Windlight") << "No sky preset named " << key.toString() << LL_ENDL; + return; + } + + LLEnvManagerNew::instance().useSkyParams(sky_params.getAll()); + //syncControls(); + + bool can_edit = (key.scope == LLEnvKey::SCOPE_LOCAL || LLEnvManagerNew::canEditRegionSettings()); + enableEditing(can_edit); + + mMakeDefaultCheckBox->setEnabled(key.scope == LLEnvKey::SCOPE_LOCAL); +} + +bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // If they choose save, do it. Otherwise, don't do anything + if (option == 0) + { + onSaveConfirmed(); + } + + return false; +} + +void LLFloaterEditSky::onSaveConfirmed() +{ + // Save current params to the selected preset. + LLWLParamKey key(getSelectedSkyPreset()); + + LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL; + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + if (wl_mgr.hasParamSet(key)) + { + wl_mgr.setParamSet(key, wl_mgr.mCurParams); + } + else + { + wl_mgr.addParamSet(key, wl_mgr.mCurParams); + } + + wl_mgr.savePreset(key); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << llendl; + LLEnvManagerNew::instance().setUseSkyPreset(key.name); + } + + closeFloater(); +} + +void LLFloaterEditSky::onBtnSave() +{ + LLWLParamKey selected_sky = getSelectedSkyPreset(); + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + + if (selected_sky.scope == LLEnvKey::SCOPE_REGION) + { + saveRegionSky(); + closeFloater(); + return; + } + + std::string name = selected_sky.name; + if (name.empty()) + { + // *TODO: show an alert + llwarns << "Empty sky preset name" << llendl; + return; + } + + // Don't allow overwriting system presets. + if (wl_mgr.isSystemPreset(name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + // Save, ask for confirmation for overwriting an existing preset. + if (wl_mgr.hasParamSet(selected_sky)) + { + LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterEditSky::onSaveAnswer, this, _1, _2)); + } + else + { + // new preset, hence no confirmation needed + onSaveConfirmed(); + } +} + +void LLFloaterEditSky::onBtnCancel() +{ + closeFloater(); +} + +void LLFloaterEditSky::onSkyPresetListChange() +{ + LLWLParamKey key = getSelectedSkyPreset(); // preset being edited + if (!LLWLParamManager::instance().hasParamSet(key)) + { + // Preset we've been editing doesn't exist anymore. Close the floater. + closeFloater(false); + } + else + { + // A new preset has been added. + // Refresh the presets list, though it may not make sense as the floater is about to be closed. + refreshSkyPresetsList(); + } +} + +void LLFloaterEditSky::onRegionSettingsChange() +{ + // If creating a new sky, don't bother. + if (isNewPreset()) + { + return; + } + + if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) // if editing a region sky + { + // reset the floater to its initial state + reset(); + + // *TODO: Notify user? + } + else // editing a local sky + { + refreshSkyPresetsList(); + } +} + +void LLFloaterEditSky::onRegionInfoUpdate() +{ + bool can_edit = true; + + // If we've selected a region sky preset for editing. + if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) + { + // check whether we have the access + can_edit = LLEnvManagerNew::canEditRegionSettings(); + } + + enableEditing(can_edit); +} diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h new file mode 100644 index 0000000000..a06c4fc5fa --- /dev/null +++ b/indra/newview/llfloatereditsky.h @@ -0,0 +1,113 @@ +/** + * @file llfloatereditsky.h + * @brief Floater to create or edit a sky preset + * + * $LicenseInfo:firstyear=2011&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_LLFLOATEREDITSKY_H +#define LL_LLFLOATEREDITSKY_H + +#include "llfloater.h" +#include "llwlparammanager.h" + +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; + +/** + * Floater for creating or editing a sky preset. + */ +class LLFloaterEditSky : public LLFloater +{ + LOG_CLASS(LLFloaterEditSky); + +public: + LLFloaterEditSky(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + +private: + void initCallbacks(void); + + //-- WL stuff begins ------------------------------------------------------ + + void syncControls(); /// sync up sliders with parameters + + void setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k); + + // general purpose callbacks for dealing with color controllers + void onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl); + void onColorControlRMoved(LLUICtrl* ctrl, void* userdata); + void onColorControlGMoved(LLUICtrl* ctrl, void* userdata); + void onColorControlBMoved(LLUICtrl* ctrl, void* userdata); + void onFloatControlMoved(LLUICtrl* ctrl, void* userdata); + + // lighting callbacks for glow + void onGlowRMoved(LLUICtrl* ctrl, void* userdata); + void onGlowBMoved(LLUICtrl* ctrl, void* userdata); + + // lighting callbacks for sun + void onSunMoved(LLUICtrl* ctrl, void* userdata); + void onTimeChanged(); + + // for handling when the star slider is moved to adjust the alpha + void onStarAlphaMoved(LLUICtrl* ctrl); + + // handle cloud scrolling + void onCloudScrollXMoved(LLUICtrl* ctrl); + void onCloudScrollYMoved(LLUICtrl* ctrl); + void onCloudScrollXToggled(LLUICtrl* ctrl); + void onCloudScrollYToggled(LLUICtrl* ctrl); + + //-- WL stuff ends -------------------------------------------------------- + + void reset(); /// reset the floater to its initial state + bool isNewPreset() const; + void refreshSkyPresetsList(); + void enableEditing(bool enable); + void saveRegionSky(); + LLWLParamKey getSelectedSkyPreset(); + + void onSkyPresetNameEdited(); + void onSkyPresetSelected(); + bool onSaveAnswer(const LLSD& notification, const LLSD& response); + void onSaveConfirmed(); + + void onBtnSave(); + void onBtnCancel(); + + void onSkyPresetListChange(); + void onRegionSettingsChange(); + void onRegionInfoUpdate(); + + LLLineEditor* mSkyPresetNameEditor; + LLComboBox* mSkyPresetCombo; + LLCheckBoxCtrl* mMakeDefaultCheckBox; + LLButton* mSaveButton; +}; + +#endif // LL_LLFLOATEREDITSKY_H diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp new file mode 100644 index 0000000000..64cfc4054f --- /dev/null +++ b/indra/newview/llfloatereditwater.cpp @@ -0,0 +1,772 @@ +/** + * @file llfloatereditwater.cpp + * @brief Floater to create or edit a water preset + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditwater.h" + +// libs +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcolorswatch.h" +#include "llcombobox.h" +//#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llsliderctrl.h" +#include "lltexturectrl.h" + +// newview +#include "llagent.h" +#include "llregioninfomodel.h" +#include "llviewerregion.h" +#include "llwaterparammanager.h" + +#undef max // Fixes a Windows compiler error + +LLFloaterEditWater::LLFloaterEditWater(const LLSD &key) +: LLFloater(key) +, mWaterPresetNameEditor(NULL) +, mWaterPresetCombo(NULL) +, mMakeDefaultCheckBox(NULL) +, mSaveButton(NULL) +{ +} + +// virtual +BOOL LLFloaterEditWater::postBuild() +{ + mWaterPresetNameEditor = getChild<LLLineEditor>("water_preset_name"); + mWaterPresetCombo = getChild<LLComboBox>("water_preset_combo"); + mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); + mSaveButton = getChild<LLButton>("save"); + + initCallbacks(); + refreshWaterPresetsList(); + syncControls(); + + return TRUE; +} + +// virtual +void LLFloaterEditWater::onOpen(const LLSD& key) +{ + bool new_preset = isNewPreset(); + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(!new_preset); + + // Switch between the water presets combobox and preset name input field. + mWaterPresetCombo->setVisible(!new_preset); + mWaterPresetNameEditor->setVisible(new_preset); + + reset(); +} + +// virtual +void LLFloaterEditWater::onClose(bool app_quitting) +{ + if (!app_quitting) // there's no point to change environment if we're quitting + { + LLEnvManagerNew::instance().usePrefs(); // revert changes made to current environment + } +} + +// virtual +void LLFloaterEditWater::draw() +{ + syncControls(); + LLFloater::draw(); +} + +void LLFloaterEditWater::initCallbacks(void) +{ + mWaterPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this), NULL); + mWaterPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditWater::onWaterPresetSelected, this)); + mWaterPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditWater::onWaterPresetNameEdited, this)); + + mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnSave, this)); + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnCancel, this)); + + LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLFloaterEditWater::onRegionSettingsChange, this)); + LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this)); + + // Connect to region info updates. + LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditWater::onRegionInfoUpdate, this)); + + //------------------------------------------------------------------------- + + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + + getChild<LLUICtrl>("WaterFogColor")->setCommitCallback(boost::bind(&LLFloaterEditWater::onWaterFogColorMoved, this, _1, &water_mgr.mFogColor)); + //getChild<LLUICtrl>("WaterGlow")->setCommitCallback(boost::bind(&LLFloaterEditWater::onColorControlAMoved, this, _1, &water_mgr.mFogColor)); + + // fog density + getChild<LLUICtrl>("WaterFogDensity")->setCommitCallback(boost::bind(&LLFloaterEditWater::onExpFloatControlMoved, this, _1, &water_mgr.mFogDensity)); + getChild<LLUICtrl>("WaterUnderWaterFogMod")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mUnderWaterFogMod)); + + // blue density + getChild<LLUICtrl>("WaterNormalScaleX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlXMoved, this, _1, &water_mgr.mNormalScale)); + getChild<LLUICtrl>("WaterNormalScaleY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlYMoved, this, _1, &water_mgr.mNormalScale)); + getChild<LLUICtrl>("WaterNormalScaleZ")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector3ControlZMoved, this, _1, &water_mgr.mNormalScale)); + + // fresnel + getChild<LLUICtrl>("WaterFresnelScale")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mFresnelScale)); + getChild<LLUICtrl>("WaterFresnelOffset")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mFresnelOffset)); + + // scale above/below + getChild<LLUICtrl>("WaterScaleAbove")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mScaleAbove)); + getChild<LLUICtrl>("WaterScaleBelow")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mScaleBelow)); + + // blur mult + getChild<LLUICtrl>("WaterBlurMult")->setCommitCallback(boost::bind(&LLFloaterEditWater::onFloatControlMoved, this, _1, &water_mgr.mBlurMultiplier)); + + // wave direction + getChild<LLUICtrl>("WaterWave1DirX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlXMoved, this, _1, &water_mgr.mWave1Dir)); + getChild<LLUICtrl>("WaterWave1DirY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlYMoved, this, _1, &water_mgr.mWave1Dir)); + getChild<LLUICtrl>("WaterWave2DirX")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlXMoved, this, _1, &water_mgr.mWave2Dir)); + getChild<LLUICtrl>("WaterWave2DirY")->setCommitCallback(boost::bind(&LLFloaterEditWater::onVector2ControlYMoved, this, _1, &water_mgr.mWave2Dir)); + + LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("WaterNormalMap"); + texture_ctrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); + texture_ctrl->setCommitCallback(boost::bind(&LLFloaterEditWater::onNormalMapPicked, this, _1)); +} + +//============================================================================= + +void LLFloaterEditWater::syncControls() +{ + // *TODO: Eliminate slow getChild() calls. + + bool err; + + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + + LLWaterParamSet& current_params = water_mgr.mCurParams; + + // blue horizon + water_mgr.mFogColor = current_params.getVector4(water_mgr.mFogColor.mName, err); + + LLColor4 col = water_mgr.getFogColor(); + //getChild<LLUICtrl>("WaterGlow")->setValue(col.mV[3]); + col.mV[3] = 1.0f; + getChild<LLColorSwatchCtrl>("WaterFogColor")->set(col); + + // fog and wavelets + water_mgr.mFogDensity.mExp = + log(current_params.getFloat(water_mgr.mFogDensity.mName, err)) / + log(water_mgr.mFogDensity.mBase); + water_mgr.setDensitySliderValue(water_mgr.mFogDensity.mExp); + getChild<LLUICtrl>("WaterFogDensity")->setValue(water_mgr.mFogDensity.mExp); + + water_mgr.mUnderWaterFogMod.mX = + current_params.getFloat(water_mgr.mUnderWaterFogMod.mName, err); + getChild<LLUICtrl>("WaterUnderWaterFogMod")->setValue(water_mgr.mUnderWaterFogMod.mX); + + water_mgr.mNormalScale = current_params.getVector3(water_mgr.mNormalScale.mName, err); + getChild<LLUICtrl>("WaterNormalScaleX")->setValue(water_mgr.mNormalScale.mX); + getChild<LLUICtrl>("WaterNormalScaleY")->setValue(water_mgr.mNormalScale.mY); + getChild<LLUICtrl>("WaterNormalScaleZ")->setValue(water_mgr.mNormalScale.mZ); + + // Fresnel + water_mgr.mFresnelScale.mX = current_params.getFloat(water_mgr.mFresnelScale.mName, err); + getChild<LLUICtrl>("WaterFresnelScale")->setValue(water_mgr.mFresnelScale.mX); + water_mgr.mFresnelOffset.mX = current_params.getFloat(water_mgr.mFresnelOffset.mName, err); + getChild<LLUICtrl>("WaterFresnelOffset")->setValue(water_mgr.mFresnelOffset.mX); + + // Scale Above/Below + water_mgr.mScaleAbove.mX = current_params.getFloat(water_mgr.mScaleAbove.mName, err); + getChild<LLUICtrl>("WaterScaleAbove")->setValue(water_mgr.mScaleAbove.mX); + water_mgr.mScaleBelow.mX = current_params.getFloat(water_mgr.mScaleBelow.mName, err); + getChild<LLUICtrl>("WaterScaleBelow")->setValue(water_mgr.mScaleBelow.mX); + + // blur mult + water_mgr.mBlurMultiplier.mX = current_params.getFloat(water_mgr.mBlurMultiplier.mName, err); + getChild<LLUICtrl>("WaterBlurMult")->setValue(water_mgr.mBlurMultiplier.mX); + + // wave directions + water_mgr.mWave1Dir = current_params.getVector2(water_mgr.mWave1Dir.mName, err); + getChild<LLUICtrl>("WaterWave1DirX")->setValue(water_mgr.mWave1Dir.mX); + getChild<LLUICtrl>("WaterWave1DirY")->setValue(water_mgr.mWave1Dir.mY); + + water_mgr.mWave2Dir = current_params.getVector2(water_mgr.mWave2Dir.mName, err); + getChild<LLUICtrl>("WaterWave2DirX")->setValue(water_mgr.mWave2Dir.mX); + getChild<LLUICtrl>("WaterWave2DirY")->setValue(water_mgr.mWave2Dir.mY); + + LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); + textCtrl->setImageAssetID(water_mgr.getNormalMapID()); +} + +// color control callbacks +void LLFloaterEditWater::onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + color_ctrl->mR = sldr_ctrl->getValueF32(); + + // move i if it's the max + if (color_ctrl->mR >= color_ctrl->mG + && color_ctrl->mR >= color_ctrl->mB + && color_ctrl->mHasSliderName) + { + color_ctrl->mI = color_ctrl->mR; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + getChild<LLUICtrl>(name)->setValue(color_ctrl->mR); + } + + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + color_ctrl->mG = sldr_ctrl->getValueF32(); + + // move i if it's the max + if (color_ctrl->mG >= color_ctrl->mR + && color_ctrl->mG >= color_ctrl->mB + && color_ctrl->mHasSliderName) + { + color_ctrl->mI = color_ctrl->mG; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + getChild<LLUICtrl>(name)->setValue(color_ctrl->mG); + + } + + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + color_ctrl->mB = sldr_ctrl->getValueF32(); + + // move i if it's the max + if (color_ctrl->mB >= color_ctrl->mR + && color_ctrl->mB >= color_ctrl->mG + && color_ctrl->mHasSliderName) + { + color_ctrl->mI = color_ctrl->mB; + std::string name = color_ctrl->mSliderName; + name.append("I"); + + getChild<LLUICtrl>(name)->setValue(color_ctrl->mB); + } + + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + color_ctrl->mA = sldr_ctrl->getValueF32(); + + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + + +void LLFloaterEditWater::onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + color_ctrl->mI = sldr_ctrl->getValueF32(); + + // only for sliders where we pass a name + if (color_ctrl->mHasSliderName) + { + // set it to the top + F32 maxVal = std::max(std::max(color_ctrl->mR, color_ctrl->mG), color_ctrl->mB); + F32 iVal; + + iVal = color_ctrl->mI; + + // get the names of the other sliders + std::string rName = color_ctrl->mSliderName; + rName.append("R"); + std::string gName = color_ctrl->mSliderName; + gName.append("G"); + std::string bName = color_ctrl->mSliderName; + bName.append("B"); + + // handle if at 0 + if (iVal == 0) + { + color_ctrl->mR = 0; + color_ctrl->mG = 0; + color_ctrl->mB = 0; + + // if all at the start + // set them all to the intensity + } + else if (maxVal == 0) + { + color_ctrl->mR = iVal; + color_ctrl->mG = iVal; + color_ctrl->mB = iVal; + } + else + { + // add delta amounts to each + F32 delta = (iVal - maxVal) / maxVal; + color_ctrl->mR *= (1.0f + delta); + color_ctrl->mG *= (1.0f + delta); + color_ctrl->mB *= (1.0f + delta); + } + + // set the sliders to the new vals + getChild<LLUICtrl>(rName)->setValue(color_ctrl->mR); + getChild<LLUICtrl>(gName)->setValue(color_ctrl->mG); + getChild<LLUICtrl>(bName)->setValue(color_ctrl->mB); + } + + // now update the current parameters and send them to shaders + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); +} + +// vector control callbacks +void LLFloaterEditWater::onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + vector_ctrl->mX = sldr_ctrl->getValueF32(); + + vector_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +// vector control callbacks +void LLFloaterEditWater::onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + vector_ctrl->mY = sldr_ctrl->getValueF32(); + + vector_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +// vector control callbacks +void LLFloaterEditWater::onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + vector_ctrl->mZ = sldr_ctrl->getValueF32(); + + vector_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + + +// vector control callbacks +void LLFloaterEditWater::onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + vector_ctrl->mX = sldr_ctrl->getValueF32(); + + vector_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +// vector control callbacks +void LLFloaterEditWater::onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + vector_ctrl->mY = sldr_ctrl->getValueF32(); + + vector_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + floatControl->mX = sldr_ctrl->getValueF32() / floatControl->mMult; + + floatControl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) +{ + LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); + + F32 val = sldr_ctrl->getValueF32(); + expFloatControl->mExp = val; + LLWaterParamManager::getInstance()->setDensitySliderValue(val); + + expFloatControl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl) +{ + LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); + *color_ctrl = swatch->get(); + + color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams); + LLWaterParamManager::getInstance()->propagateParameters(); +} + +void LLFloaterEditWater::onNormalMapPicked(LLUICtrl* ctrl) +{ + LLTextureCtrl* textCtrl = static_cast<LLTextureCtrl*>(ctrl); + LLUUID textID = textCtrl->getImageAssetID(); + LLWaterParamManager::getInstance()->setNormalMapID(textID); +} + +//============================================================================= + +void LLFloaterEditWater::reset() +{ + if (isNewPreset()) + { + mWaterPresetNameEditor->setValue(LLSD()); + mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name + } + else + { + refreshWaterPresetsList(); + + // Disable controls until a water preset to edit is selected. + enableEditing(false); + } +} + +bool LLFloaterEditWater::isNewPreset() const +{ + return mKey.asString() == "new"; +} + +void LLFloaterEditWater::refreshWaterPresetsList() +{ + mWaterPresetCombo->removeall(); + +#if 0 // *TODO: enable when we have a clear workflow to edit existing region environment + // If the region already has water params, add them to the list. + const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings(); + if (region_settings.getWaterParams().size() != 0) + { + const std::string& region_name = gAgent.getRegion()->getName(); + mWaterPresetCombo->add(region_name, LLSD().with(0, region_name).with(1, LLEnvKey::SCOPE_REGION)); + mWaterPresetCombo->addSeparator(); + } +#endif + + std::list<std::string> user_presets, system_presets; + LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + + // Add local user presets first. + for (std::list<std::string>::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + const std::string& name = *it; + mWaterPresetCombo->add(name, LLSD().with(0, name).with(1, LLEnvKey::SCOPE_LOCAL)); // [<name>, <scope>] + } + + if (user_presets.size() > 0) + { + mWaterPresetCombo->addSeparator(); + } + + // Add local system presets. + for (std::list<std::string>::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) + { + const std::string& name = *it; + mWaterPresetCombo->add(name, LLSD().with(0, name).with(1, LLEnvKey::SCOPE_LOCAL)); // [<name>, <scope>] + } + + mWaterPresetCombo->setLabel(getString("combo_label")); +} + +void LLFloaterEditWater::enableEditing(bool enable) +{ + // Enable/disable water controls. + getChild<LLPanel>("panel_water_preset")->setCtrlsEnabled(enable); + + // Enable/disable saving. + mSaveButton->setEnabled(enable); + mMakeDefaultCheckBox->setEnabled(enable); +} + +void LLFloaterEditWater::saveRegionWater() +{ + llassert(getCurrentScope() == LLEnvKey::SCOPE_REGION); // make sure we're editing region water + + LL_DEBUGS("Windlight") << "Saving region water preset" << llendl; + + //LLWaterParamSet region_water = water_mgr.mCurParams; + + // *TODO: save to cached region settings. + LL_WARNS("Windlight") << "Saving region water is not fully implemented yet" << LL_ENDL; +} + +std::string LLFloaterEditWater::getCurrentPresetName() const +{ + std::string name; + LLEnvKey::EScope scope; + getSelectedPreset(name, scope); + return name; +} + +LLEnvKey::EScope LLFloaterEditWater::getCurrentScope() const +{ + std::string name; + LLEnvKey::EScope scope; + getSelectedPreset(name, scope); + return scope; +} + +void LLFloaterEditWater::getSelectedPreset(std::string& name, LLEnvKey::EScope& scope) const +{ + if (mWaterPresetNameEditor->getVisible()) + { + name = mWaterPresetNameEditor->getText(); + scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + LLSD combo_val = mWaterPresetCombo->getValue(); + + if (!combo_val.isArray()) // manually typed text + { + name = combo_val.asString(); + scope = LLEnvKey::SCOPE_LOCAL; + } + else + { + name = combo_val[0].asString(); + scope = (LLEnvKey::EScope) combo_val[1].asInteger(); + } + } +} + +void LLFloaterEditWater::onWaterPresetNameEdited() +{ + // Disable saving a water preset having empty name. + mSaveButton->setEnabled(!getCurrentPresetName().empty()); +} + +void LLFloaterEditWater::onWaterPresetSelected() +{ + LLWaterParamSet water_params; + std::string name; + LLEnvKey::EScope scope; + + getSelectedPreset(name, scope); + + // Display selected preset. + if (scope == LLEnvKey::SCOPE_REGION) + { + water_params.setAll(LLEnvManagerNew::instance().getRegionSettings().getWaterParams()); + } + else // local preset selected + { + if (!LLWaterParamManager::instance().getParamSet(name, water_params)) + { + // Manually entered string? + LL_WARNS("Windlight") << "No water preset named " << name << LL_ENDL; + return; + } + } + + LLEnvManagerNew::instance().useWaterParams(water_params.getAll()); + + bool can_edit = (scope == LLEnvKey::SCOPE_LOCAL || LLEnvManagerNew::canEditRegionSettings()); + enableEditing(can_edit); + + mMakeDefaultCheckBox->setEnabled(scope == LLEnvKey::SCOPE_LOCAL); +} + +bool LLFloaterEditWater::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // If they choose save, do it. Otherwise, don't do anything + if (option == 0) + { + onSaveConfirmed(); + } + + return false; +} + +void LLFloaterEditWater::onSaveConfirmed() +{ + // Save currently displayed water params to the selected preset. + std::string name = getCurrentPresetName(); + + LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL; + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + if (water_mgr.hasParamSet(name)) + { + water_mgr.setParamSet(name, water_mgr.mCurParams); + } + else + { + water_mgr.addParamSet(name, water_mgr.mCurParams); + } + + water_mgr.savePreset(name); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << name << " is now the new preferred water preset" << llendl; + LLEnvManagerNew::instance().setUseWaterPreset(name); + } + + closeFloater(); +} + +void LLFloaterEditWater::onBtnSave() +{ + LLEnvKey::EScope scope; + std::string name; + getSelectedPreset(name, scope); + + if (scope == LLEnvKey::SCOPE_REGION) + { + saveRegionWater(); + closeFloater(); + return; + } + + if (name.empty()) + { + // *TODO: show an alert + llwarns << "Empty water preset name" << llendl; + return; + } + + // Don't allow overwriting system presets. + LLWaterParamManager& water_mgr = LLWaterParamManager::instance(); + if (water_mgr.isSystemPreset(name)) + { + LLNotificationsUtil::add("WLNoEditDefault"); + return; + } + + // Save, ask for confirmation for overwriting an existing preset. + if (water_mgr.hasParamSet(name)) + { + LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterEditWater::onSaveAnswer, this, _1, _2)); + } + else + { + // new preset, hence no confirmation needed + onSaveConfirmed(); + } +} + +void LLFloaterEditWater::onBtnCancel() +{ + closeFloater(); +} + +void LLFloaterEditWater::onWaterPresetListChange() +{ + std::string name; + LLEnvKey::EScope scope; + getSelectedPreset(name, scope); // preset being edited + + if (scope == LLEnvKey::SCOPE_LOCAL && !LLWaterParamManager::instance().hasParamSet(name)) + { + // Preset we've been editing doesn't exist anymore. Close the floater. + closeFloater(false); + } + else + { + // A new preset has been added. + // Refresh the presets list, though it may not make sense as the floater is about to be closed. + refreshWaterPresetsList(); + } +} + +void LLFloaterEditWater::onRegionSettingsChange() +{ + // If creating a new preset, don't bother. + if (isNewPreset()) + { + return; + } + + if (getCurrentScope() == LLEnvKey::SCOPE_REGION) // if editing region water + { + // reset the floater to its initial state + reset(); + + // *TODO: Notify user? + } + else // editing a local preset + { + refreshWaterPresetsList(); + } +} + +void LLFloaterEditWater::onRegionInfoUpdate() +{ + bool can_edit = true; + + // If we've selected the region water for editing. + if (getCurrentScope() == LLEnvKey::SCOPE_REGION) + { + // check whether we have the access + can_edit = LLEnvManagerNew::canEditRegionSettings(); + } + + enableEditing(can_edit); +} diff --git a/indra/newview/llfloaterwater.h b/indra/newview/llfloatereditwater.h index e3db91e80d..2211bca59f 100644 --- a/indra/newview/llfloaterwater.h +++ b/indra/newview/llfloatereditwater.h @@ -1,10 +1,10 @@ /** - * @file llfloaterwindlight.h - * @brief LLFloaterWater class definition + * @file llfloatereditwater.h + * @brief Floater to create or edit a water preset * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * 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 @@ -24,17 +24,16 @@ * $/LicenseInfo$ */ -/* - * Menu for adjusting the atmospheric settings of the world - */ - -#ifndef LL_LLFLOATER_WATER_H -#define LL_LLFLOATER_WATER_H +#ifndef LL_LLFLOATEREDITWATER_H +#define LL_LLFLOATEREDITWATER_H #include "llfloater.h" +#include "llenvmanager.h" // for LLEnvKey -#include <vector> -#include "llwlparamset.h" +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; struct WaterVector2Control; struct WaterVector3Control; @@ -42,66 +41,75 @@ struct WaterColorControl; struct WaterFloatControl; struct WaterExpFloatControl; -/// Menuing system for all of windlight's functionality -class LLFloaterWater : public LLFloater +class LLFloaterEditWater : public LLFloater { + LOG_CLASS(LLFloaterEditWater); + public: + LLFloaterEditWater(const LLSD &key); - LLFloaterWater(const LLSD& key); - virtual ~LLFloaterWater(); /*virtual*/ BOOL postBuild(); - /// initialize all + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + +private: void initCallbacks(void); - bool newPromptCallback(const LLSD& notification, const LLSD& response); + //-- WL stuff begins ------------------------------------------------------ - /// general purpose callbacks for dealing with color controllers - void onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - void onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - void onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - void onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - void onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); + void syncControls(); /// sync up sliders with parameters - void onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); - void onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); - void onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl); + // general purpose callbacks for dealing with color controllers + void onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); + void onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); + void onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); + void onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); + void onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); + + void onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl); + void onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl); + void onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vector_ctrl); + + void onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl); + void onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vector_ctrl); - void onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl); - void onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl); - void onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl); void onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl); - void onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* colorControl); - - /// handle if they choose a new normal map - void onNormalMapPicked(LLUICtrl* ctrl); + void onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl); - /// when user hits the load preset button - void onNewPreset(); + void onNormalMapPicked(LLUICtrl* ctrl); /// handle if they choose a new normal map - /// when user hits the save preset button - void onSavePreset(); + //-- WL stuff ends -------------------------------------------------------- - /// prompts a user when overwriting a preset - bool saveAlertCallback(const LLSD& notification, const LLSD& response); + void reset(); + bool isNewPreset() const; + void refreshWaterPresetsList(); + void enableEditing(bool enable); + void saveRegionWater(); - /// when user hits the save preset button - void onDeletePreset(); + std::string getCurrentPresetName() const; + LLEnvKey::EScope getCurrentScope() const; + void getSelectedPreset(std::string& name, LLEnvKey::EScope& scope) const; - /// prompts a user when overwriting a preset - bool deleteAlertCallback(const LLSD& notification, const LLSD& response); + void onWaterPresetNameEdited(); + void onWaterPresetSelected(); + bool onSaveAnswer(const LLSD& notification, const LLSD& response); + void onSaveConfirmed(); - /// what to do when you change the preset name - void onChangePresetName(LLUICtrl* ctrl); + void onBtnSave(); + void onBtnCancel(); - /// sync up sliders with parameters - void syncMenu(); + void onWaterPresetListChange(); + void onRegionSettingsChange(); + void onRegionInfoUpdate(); -private: - static std::set<std::string> sDefaultPresets; + LLLineEditor* mWaterPresetNameEditor; + LLComboBox* mWaterPresetCombo; + LLCheckBoxCtrl* mMakeDefaultCheckBox; + LLButton* mSaveButton; }; - -#endif +#endif // LL_LLFLOATEREDITWATER_H diff --git a/indra/newview/llfloaterenvironmentsettings.cpp b/indra/newview/llfloaterenvironmentsettings.cpp new file mode 100644 index 0000000000..4dbc8cdee0 --- /dev/null +++ b/indra/newview/llfloaterenvironmentsettings.cpp @@ -0,0 +1,282 @@ +/** + * @file llfloaterenvironmentsettings.cpp + * @brief LLFloaterEnvironmentSettings class definition + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterenvironmentsettings.h" + +#include "llcombobox.h" +#include "llradiogroup.h" + +#include "lldaycyclemanager.h" +#include "llenvmanager.h" +#include "llwaterparammanager.h" +#include "llwlparamset.h" +#include "llwlparammanager.h" + +LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key) +: LLFloater(key) + ,mRegionSettingsRadioGroup(NULL) + ,mDayCycleSettingsRadioGroup(NULL) + ,mWaterPresetCombo(NULL) + ,mSkyPresetCombo(NULL) + ,mDayCyclePresetCombo(NULL) +{ +} + +// virtual +BOOL LLFloaterEnvironmentSettings::postBuild() +{ + mRegionSettingsRadioGroup = getChild<LLRadioGroup>("region_settings_radio_group"); + mRegionSettingsRadioGroup->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSwitchRegionSettings, this)); + + mDayCycleSettingsRadioGroup = getChild<LLRadioGroup>("sky_dayc_settings_radio_group"); + mDayCycleSettingsRadioGroup->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSwitchDayCycle, this)); + + mWaterPresetCombo = getChild<LLComboBox>("water_settings_preset_combo"); + mWaterPresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectWaterPreset, this)); + + mSkyPresetCombo = getChild<LLComboBox>("sky_settings_preset_combo"); + mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectSkyPreset, this)); + + mDayCyclePresetCombo = getChild<LLComboBox>("dayc_settings_preset_combo"); + mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLFloaterEnvironmentSettings::onSelectDayCyclePreset, this)); + + childSetCommitCallback("ok_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnOK, this), NULL); + getChild<LLUICtrl>("ok_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); + childSetCommitCallback("cancel_btn", boost::bind(&LLFloaterEnvironmentSettings::onBtnCancel, this), NULL); + getChild<LLUICtrl>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); + + setCloseCallback(boost::bind(&LLFloaterEnvironmentSettings::cancel, this)); + + LLEnvManagerNew::instance().setPreferencesChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::refresh, this)); + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLFloaterEnvironmentSettings::populateDayCyclePresetsList, this)); + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateSkyPresetsList, this)); + LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterEnvironmentSettings::populateWaterPresetsList, this)); + + return TRUE; +} + +// virtual +void LLFloaterEnvironmentSettings::onOpen(const LLSD& key) +{ + refresh(); +} + +void LLFloaterEnvironmentSettings::onSwitchRegionSettings() +{ + getChild<LLView>("user_environment_settings")->setEnabled(mRegionSettingsRadioGroup->getSelectedIndex() != 0); + + apply(); +} + +void LLFloaterEnvironmentSettings::onSwitchDayCycle() +{ + bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + + mSkyPresetCombo->setEnabled(is_fixed_sky); + mDayCyclePresetCombo->setEnabled(!is_fixed_sky); + + apply(); +} + +void LLFloaterEnvironmentSettings::onSelectWaterPreset() +{ + apply(); +} + +void LLFloaterEnvironmentSettings::onSelectSkyPreset() +{ + apply(); +} + +void LLFloaterEnvironmentSettings::onSelectDayCyclePreset() +{ + apply(); +} + +void LLFloaterEnvironmentSettings::onBtnOK() +{ + // Save and apply new user preferences. + bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + std::string water_preset = mWaterPresetCombo->getValue().asString(); + std::string sky_preset = mSkyPresetCombo->getValue().asString(); + std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); + + LLEnvManagerNew::instance().setUserPrefs( + water_preset, + sky_preset, + day_cycle, + use_fixed_sky, + use_region_settings); + + // *TODO: This triggers applying user preferences again, which is suboptimal. + closeFloater(); +} + +void LLFloaterEnvironmentSettings::onBtnCancel() +{ + closeFloater(); +} + +void LLFloaterEnvironmentSettings::refresh() +{ + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + + bool use_region_settings = env_mgr.getUseRegionSettings(); + bool use_fixed_sky = env_mgr.getUseFixedSky(); + + // Set up radio buttons according to user preferences. + mRegionSettingsRadioGroup->setSelectedIndex(use_region_settings ? 0 : 1); + mDayCycleSettingsRadioGroup->setSelectedIndex(use_fixed_sky ? 0 : 1); + + // Populate the combo boxes with appropriate lists of available presets. + populateWaterPresetsList(); + populateSkyPresetsList(); + populateDayCyclePresetsList(); + + // Enable/disable other controls based on user preferences. + getChild<LLView>("user_environment_settings")->setEnabled(!use_region_settings); + mSkyPresetCombo->setEnabled(use_fixed_sky); + mDayCyclePresetCombo->setEnabled(!use_fixed_sky); + + // Select the current presets in combo boxes. + mWaterPresetCombo->selectByValue(env_mgr.getWaterPresetName()); + mSkyPresetCombo->selectByValue(env_mgr.getSkyPresetName()); + mDayCyclePresetCombo->selectByValue(env_mgr.getDayCycleName()); +} + +void LLFloaterEnvironmentSettings::apply() +{ + // Update environment with the user choice. + bool use_region_settings = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + std::string water_preset = mWaterPresetCombo->getValue().asString(); + std::string sky_preset = mSkyPresetCombo->getValue().asString(); + std::string day_cycle = mDayCyclePresetCombo->getValue().asString(); + + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + if (use_region_settings) + { + env_mgr.useRegionSettings(); + } + else + { + if (use_fixed_sky) + { + env_mgr.useSkyPreset(sky_preset); + } + else + { + env_mgr.useDayCycle(day_cycle, LLEnvKey::SCOPE_LOCAL); + } + + env_mgr.useWaterPreset(water_preset); + } +} + +void LLFloaterEnvironmentSettings::cancel() +{ + // Revert environment to user preferences. + LLEnvManagerNew::instance().usePrefs(); +} + +void LLFloaterEnvironmentSettings::populateWaterPresetsList() +{ + mWaterPresetCombo->removeall(); + + std::list<std::string> user_presets, system_presets; + LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + + // Add user presets first. + for (std::list<std::string>::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mWaterPresetCombo->add(*it); + } + + if (user_presets.size() > 0) + { + mWaterPresetCombo->addSeparator(); + } + + // Add system presets. + for (std::list<std::string>::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) + { + mWaterPresetCombo->add(*it); + } +} + +void LLFloaterEnvironmentSettings::populateSkyPresetsList() +{ + mSkyPresetCombo->removeall(); + + LLWLParamManager::preset_name_list_t region_presets; // unused as we don't list region presets here + LLWLParamManager::preset_name_list_t user_presets, sys_presets; + LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); + + // Add user presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mSkyPresetCombo->add(*it); + } + + if (!user_presets.empty()) + { + mSkyPresetCombo->addSeparator(); + } + + // Add system presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) + { + mSkyPresetCombo->add(*it); + } +} + +void LLFloaterEnvironmentSettings::populateDayCyclePresetsList() +{ + mDayCyclePresetCombo->removeall(); + + LLDayCycleManager::preset_name_list_t user_days, sys_days; + LLDayCycleManager::instance().getPresetNames(user_days, sys_days); + + // Add user days. + for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) + { + mDayCyclePresetCombo->add(*it); + } + + if (user_days.size() > 0) + { + mDayCyclePresetCombo->addSeparator(); + } + + // Add system days. + for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it) + { + mDayCyclePresetCombo->add(*it); + } +} diff --git a/indra/newview/llfloaterenvironmentsettings.h b/indra/newview/llfloaterenvironmentsettings.h new file mode 100644 index 0000000000..0ab458a0f6 --- /dev/null +++ b/indra/newview/llfloaterenvironmentsettings.h @@ -0,0 +1,71 @@ +/** + * @file llfloaterenvironmentsettings.h + * @brief LLFloaterEnvironmentSettings class definition + * + * $LicenseInfo:firstyear=2011&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_LLFLOATERENVIRONMENTSETTINGS_H +#define LL_LLFLOATERENVIRONMENTSETTINGS_H + +#include "llfloater.h" + +class LLComboBox; +class LLRadioGroup; + +class LLFloaterEnvironmentSettings : public LLFloater +{ + LOG_CLASS(LLFloaterEnvironmentSettings); + +public: + LLFloaterEnvironmentSettings(const LLSD &key); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + +private: + void onSwitchRegionSettings(); + void onSwitchDayCycle(); + + void onSelectWaterPreset(); + void onSelectSkyPreset(); + void onSelectDayCyclePreset(); + + void onBtnOK(); + void onBtnCancel(); + + void refresh(); /// update controls with user prefs + void apply(); + void cancel(); + + void populateWaterPresetsList(); + void populateSkyPresetsList(); + void populateDayCyclePresetsList(); + + LLRadioGroup* mRegionSettingsRadioGroup; + LLRadioGroup* mDayCycleSettingsRadioGroup; + + LLComboBox* mWaterPresetCombo; + LLComboBox* mSkyPresetCombo; + LLComboBox* mDayCyclePresetCombo; +}; + +#endif // LL_LLFLOATERENVIRONMENTSETTINGS_H diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp deleted file mode 100644 index fcaef1f34b..0000000000 --- a/indra/newview/llfloaterenvsettings.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @file llfloaterenvsettings.cpp - * @brief LLFloaterEnvSettings class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterenvsettings.h" - -#include "llfloaterreg.h" -#include "llfloaterwindlight.h" -#include "llfloaterwater.h" -#include "lluictrlfactory.h" -#include "llsliderctrl.h" -#include "llcombobox.h" -#include "llcolorswatch.h" -#include "llwlanimator.h" - -#include "llwlparamset.h" -#include "llwlparammanager.h" -#include "llwaterparammanager.h" -#include "llmath.h" -#include "llviewerwindow.h" - -#include "pipeline.h" - -#include <sstream> - -LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD& key) - : LLFloater(key) -{ -} -// virtual -LLFloaterEnvSettings::~LLFloaterEnvSettings() -{ -} -// virtual -BOOL LLFloaterEnvSettings::postBuild() -{ - // load it up - initCallbacks(); - syncMenu(); - return TRUE; -} - -void LLFloaterEnvSettings::initCallbacks(void) -{ - // our three sliders - getChild<LLUICtrl>("EnvTimeSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeDayTime, this, _1)); - getChild<LLUICtrl>("EnvCloudSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeCloudCoverage, this, _1)); - getChild<LLUICtrl>("EnvWaterFogSlider")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterFogDensity, this, _1, &LLWaterParamManager::instance()->mFogDensity)); - - // color picker - getChild<LLUICtrl>("EnvWaterColor")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onChangeWaterColor, this, _1, &LLWaterParamManager::instance()->mFogColor)); - - // WL Top - getChild<LLUICtrl>("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedSky, this)); - getChild<LLUICtrl>("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onOpenAdvancedWater, this)); - getChild<LLUICtrl>("EnvUseEstateTimeButton")->setCommitCallback(boost::bind(&LLFloaterEnvSettings::onUseEstateTime, this)); -} - -// menu maintenance functions - -void LLFloaterEnvSettings::syncMenu() -{ - LLSliderCtrl* sldr; - sldr = getChild<LLSliderCtrl>("EnvTimeSlider"); - - // sync the clock - F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); - std::string timeStr = timeToString(val); - - LLTextBox* textBox; - textBox = getChild<LLTextBox>("EnvTimeText"); - - textBox->setValue(timeStr); - - // sync time slider which starts at 6 AM - val -= 0.25; - if(val < 0) - { - val++; - } - sldr->setValue(val); - - // sync cloud coverage - bool err; - getChild<LLUICtrl>("EnvCloudSlider")->setValue(LLWLParamManager::instance()->mCurParams.getFloat("cloud_shadow", err)); - - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - // sync water params - LLColor4 col = param_mgr->getFogColor(); - LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor"); - col.mV[3] = 1.0f; - colCtrl->set(col); - - getChild<LLUICtrl>("EnvWaterFogSlider")->setValue(param_mgr->mFogDensity.mExp); - param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); - - // turn off Use Estate Time button if it's already being used - if(LLWLParamManager::instance()->mAnimator.mUseLindenTime) - { - getChildView("EnvUseEstateTimeButton")->setEnabled(FALSE); - } else { - getChildView("EnvUseEstateTimeButton")->setEnabled(TRUE); - } - - if(!gPipeline.canUseVertexShaders()) - { - getChildView("EnvWaterColor")->setEnabled(FALSE); - getChildView("EnvWaterColorText")->setEnabled(FALSE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(FALSE); - } - else - { - getChildView("EnvWaterColor")->setEnabled(TRUE); - getChildView("EnvWaterColorText")->setEnabled(TRUE); - //getChildView("EnvAdvancedWaterButton")->setEnabled(TRUE); - } - - // only allow access to these if they are using windlight - if(!gPipeline.canUseWindLightShaders()) - { - - getChildView("EnvCloudSlider")->setEnabled(FALSE); - getChildView("EnvCloudText")->setEnabled(FALSE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(FALSE); - } - else - { - getChildView("EnvCloudSlider")->setEnabled(TRUE); - getChildView("EnvCloudText")->setEnabled(TRUE); - //getChildView("EnvAdvancedSkyButton")->setEnabled(TRUE); - } -} - -void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl) -{ - LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl); - - // deactivate animator - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - F32 val = sldr->getValueF32() + 0.25f; - if(val > 1.0) - { - val--; - } - - LLWLParamManager::instance()->mAnimator.setDayTime((F64)val); - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); -} - -void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl) -{ - LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl); - - // deactivate animator - //LLWLParamManager::instance()->mAnimator.mIsRunning = false; - //LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - F32 val = sldr->getValueF32(); - LLWLParamManager::instance()->mCurParams.set("cloud_shadow", val); -} - -void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) -{ - LLSliderCtrl* sldr; - sldr = getChild<LLSliderCtrl>("EnvWaterFogSlider"); - - F32 val = sldr->getValueF32(); - expFloatControl->mExp = val; - LLWaterParamManager::instance()->setDensitySliderValue(val); - - expFloatControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); - *colorControl = swatch->get(); - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} - - -void LLFloaterEnvSettings::onOpenAdvancedSky() -{ - LLFloaterReg::showInstance("env_windlight"); -} - -void LLFloaterEnvSettings::onOpenAdvancedWater() -{ - LLFloaterReg::showInstance("env_water"); -} - - -void LLFloaterEnvSettings::onUseEstateTime() -{ - LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight"); - if(wl) - { - LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo"); - box->selectByValue(""); - } - - LLWLParamManager::instance()->mAnimator.mIsRunning = true; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; -} - -std::string LLFloaterEnvSettings::timeToString(F32 curTime) -{ - S32 hours; - S32 min; - - // get hours and minutes - hours = (S32) (24.0 * curTime); - curTime -= ((F32) hours / 24.0f); - min = llround(24.0f * 60.0f * curTime); - - // handle case where it's 60 - if(min == 60) - { - hours++; - min = 0; - } - - std::string newTime = getString("timeStr"); - struct tm * timeT; - time_t secT = time(0); - timeT = gmtime (&secT); - - timeT->tm_hour = hours; - timeT->tm_min = min; - secT = mktime (timeT); - secT -= LLStringOps::getLocalTimeOffset (); - - LLSD substitution; - substitution["datetime"] = (S32) secT; - - LLStringUtil::format (newTime, substitution); - return newTime; -} diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h deleted file mode 100644 index a6280cfb97..0000000000 --- a/indra/newview/llfloaterenvsettings.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file llfloaterskysettings.h - * @brief LLFloaterEnvSettings class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -/* - * Simple menu for adjusting the atmospheric settings of the world - */ - -#ifndef LL_LLFLOATERENVSETTINGS_H -#define LL_LLFLOATERENVSETTINGS_H - -#include "llfloater.h" - -struct WaterColorControl; -struct WaterExpFloatControl; - -/// Menuing system for all of windlight's functionality -class LLFloaterEnvSettings : public LLFloater -{ -public: - - LLFloaterEnvSettings(const LLSD& key); - /*virtual*/ ~LLFloaterEnvSettings(); - /*virtual*/ BOOL postBuild(); - /// initialize all the callbacks for the menu - void initCallbacks(void); - - /// handle if time of day is changed - void onChangeDayTime(LLUICtrl* ctrl); - - /// handle if cloud coverage is changed - void onChangeCloudCoverage(LLUICtrl* ctrl); - - /// handle change in water fog density - void onChangeWaterFogDensity(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl); - - /// handle change in water fog color - void onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl); - - /// open the advanced sky settings menu - void onOpenAdvancedSky(); - - /// open the advanced water settings menu - void onOpenAdvancedWater(); - - /// sync time with the server - void onUseEstateTime(); - - //// menu management - - /// sync up sliders with parameters - void syncMenu(); - - /// convert the present time to a digital clock time - std::string timeToString(F32 curTime); - -private: -}; - - -#endif diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index 627defd006..3012638d44 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -71,9 +71,18 @@ void LLFloaterHelpBrowser::buildURLHistory() } } +void LLFloaterHelpBrowser::onOpen(const LLSD& key) +{ + gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); +} + //virtual void LLFloaterHelpBrowser::onClose(bool app_quitting) { + if (!app_quitting) + { + gSavedSettings.setBOOL("HelpFloaterOpen", FALSE); + } // really really destroy the help browser when it's closed, it'll be recreated. destroy(); // really destroy this dialog on closure, it's relatively heavyweight. } diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index 2731c81b9c..afe0f4df69 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -42,6 +42,7 @@ class LLFloaterHelpBrowser : /*virtual*/ BOOL postBuild(); /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key); // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 0d0c1f594d..9b7593ce61 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1818,6 +1818,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mClearBtn(NULL), mMatureCtrl(NULL), mPushRestrictionCtrl(NULL), + mSeeAvatarsCtrl(NULL), mParcel(parcel) { } @@ -1860,6 +1861,9 @@ BOOL LLPanelLandOptions::postBuild() mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck"); childSetCommitCallback("PushRestrictCheck", onCommitAny, this); + mSeeAvatarsCtrl = getChild<LLCheckBoxCtrl>( "SeeAvatarsCheck"); + childSetCommitCallback("SeeAvatarsCheck", onCommitAny, this); + mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck"); childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); @@ -1952,7 +1956,7 @@ void LLPanelLandOptions::refresh() mCheckEditLand ->set(FALSE); mCheckEditLand ->setEnabled(FALSE); - + mCheckSafe ->set(FALSE); mCheckSafe ->setEnabled(FALSE); @@ -1968,6 +1972,9 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->set(FALSE); mPushRestrictionCtrl->setEnabled(FALSE); + mSeeAvatarsCtrl->set(TRUE); + mSeeAvatarsCtrl->setEnabled(FALSE); + mLandingTypeCombo->setCurrentByIndex(0); mLandingTypeCombo->setEnabled(FALSE); @@ -2001,7 +2008,7 @@ void LLPanelLandOptions::refresh() BOOL can_change_terraform = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_EDIT); mCheckEditLand ->set( parcel->getAllowTerraform() ); mCheckEditLand ->setEnabled( can_change_terraform ); - + mCheckSafe ->set( !parcel->getAllowDamage() ); mCheckSafe ->setEnabled( can_change_options ); @@ -2027,6 +2034,10 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->setEnabled(can_change_options); } + mSeeAvatarsCtrl->set(parcel->getSeeAVs()); + mSeeAvatarsCtrl->setLabel(getString("see_avs_text")); + mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); + BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType()); @@ -2231,6 +2242,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL allow_publish = FALSE; BOOL mature_publish = self->mMatureCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get(); + BOOL see_avs = self->mSeeAvatarsCtrl->get(); BOOL show_directory = self->mCheckShowDirectory->get(); // we have to get the index from a lookup, not from the position in the dropdown! S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue()); @@ -2264,6 +2276,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setCategory((LLParcel::ECategory)category_index); parcel->setLandingType((LLParcel::ELandingType)landing_type_index); parcel->setSnapshotID(snapshot_id); + parcel->setSeeAVs(see_avs); // Send current parcel data upstream to server LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 8a70fa24d8..6fceca1acd 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -348,6 +348,7 @@ private: LLCheckBoxCtrl *mMatureCtrl; LLCheckBoxCtrl *mPushRestrictionCtrl; + LLCheckBoxCtrl *mSeeAvatarsCtrl; LLSafeHandle<LLParcelSelection>& mParcel; }; diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 58cf8dfd7e..80a9b8f781 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -103,6 +103,9 @@ #include "llanimationstates.h" #include "glod/glod.h" + +const S32 SLM_SUPPORTED_VERSION = 2; + //static S32 LLFloaterModelPreview::sUploadAmount = 10; LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL; @@ -404,14 +407,11 @@ BOOL LLFloaterModelPreview::postBuild() childSetTextArg("status", "[STATUS]", getString("status_idle")); - //childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); childSetAction("ok_btn", onUpload, this); childDisable("ok_btn"); childSetAction("reset_btn", onReset, this); - childSetAction("clear_materials", onClearMaterials, this); - childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this); childSetCommitCallback("upload_skin", onUploadSkinCommit, this); @@ -779,15 +779,6 @@ void LLFloaterModelPreview::draw() childSetVisible("decompose_cancel", false); } - U32 resource_cost = mModelPreview->mResourceCost*10; - - if (childGetValue("upload_textures").asBoolean()) - { - resource_cost += mModelPreview->mTextureSet.size()*10; - } - - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d", resource_cost)); - if (mModelPreview) { gGL.color3f(1.f, 1.f, 1.f); @@ -1945,8 +1936,11 @@ bool LLModelLoader::doLoadModel() mesh_scale *= transformation; transformation = mesh_scale; - std::vector<LLImportMaterial> materials; - materials.resize(model->getNumVolumeFaces()); + std::map<std::string, LLImportMaterial> materials; + for (U32 i = 0; i < model->mMaterialList.size(); ++i) + { + materials[model->mMaterialList[i]] = LLImportMaterial(); + } mScene[transformation].push_back(LLModelInstance(model, model->mLabel, transformation, materials)); stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform); } @@ -2008,6 +2002,11 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) //build model list for each LoD model_list model[LLModel::NUM_LODS]; + if (data["version"].asInteger() != SLM_SUPPORTED_VERSION) + { //unsupported version + return false; + } + LLSD& mesh = data["mesh"]; LLVolumeParams volume_params; @@ -2325,14 +2324,17 @@ void LLModelLoader::loadTextures() { for(U32 i = 0 ; i < iter->second.size(); i++) { - for(U32 j = 0 ; j < iter->second[i].mMaterial.size() ; j++) + for(std::map<std::string, LLImportMaterial>::iterator j = iter->second[i].mMaterial.begin(); + j != iter->second[i].mMaterial.end(); ++j) { - if(!iter->second[i].mMaterial[j].mDiffuseMapFilename.empty()) + LLImportMaterial& material = j->second; + + if(!material.mDiffuseMapFilename.empty()) { - iter->second[i].mMaterial[j].mDiffuseMap = - LLViewerTextureManager::getFetchedTextureFromUrl("file://" + iter->second[i].mMaterial[j].mDiffuseMapFilename, TRUE, LLViewerTexture::BOOST_PREVIEW); - iter->second[i].mMaterial[j].mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, mPreview, NULL, FALSE); - iter->second[i].mMaterial[j].mDiffuseMap->forceToSaveRawImage(0, F32_MAX); + material.mDiffuseMap = + LLViewerTextureManager::getFetchedTextureFromUrl("file://" + material.mDiffuseMapFilename, TRUE, LLViewerTexture::BOOST_PREVIEW); + material.mDiffuseMap->setLoadedCallback(LLModelPreview::textureLoadedCallback, 0, TRUE, FALSE, mPreview, NULL, FALSE); + material.mDiffuseMap->forceToSaveRawImage(0, F32_MAX); mNumOfFetchingTextures++ ; } } @@ -2632,7 +2634,7 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement ) { LLMatrix4 transformation = mTransform; - std::vector<LLImportMaterial> materials = getMaterials(model, instance_geo); + std::map<std::string, LLImportMaterial> materials = getMaterials(model, instance_geo); // adjust the transformation to compensate for mesh normalization LLVector3 mesh_scale_vector; @@ -2688,9 +2690,9 @@ void LLModelLoader::processElement( daeElement* element, bool& badElement ) } } -std::vector<LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo) +std::map<std::string, LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo) { - std::vector<LLImportMaterial> materials; + std::map<std::string, LLImportMaterial> materials; for (int i = 0; i < model->mMaterialList.size(); i++) { LLImportMaterial import_material; @@ -2737,7 +2739,8 @@ std::vector<LLImportMaterial> LLModelLoader::getMaterials(LLModel* model, domIns } } - materials.push_back(import_material); + import_material.mBinding = model->mMaterialList[i]; + materials[model->mMaterialList[i]] = import_material; } return materials; @@ -2999,7 +3002,6 @@ U32 LLModelPreview::calcResourceCost() //ok_btn should not have been changed unless something was wrong with joint list } - U32 cost = 0; std::set<LLModel*> accounted; U32 num_points = 0; U32 num_hulls = 0; @@ -3047,8 +3049,7 @@ U32 LLModelPreview::calcResourceCost() mFMP->childGetValue("upload_skin").asBoolean(), mFMP->childGetValue("upload_joints").asBoolean(), TRUE); - cost += gMeshRepo.calcResourceCost(ret); - + num_hulls += decomp.mHull.size(); for (U32 i = 0; i < decomp.mHull.size(); ++i) { @@ -3080,7 +3081,7 @@ U32 LLModelPreview::calcResourceCost() updateStatusMessages(); - return cost; + return (U32) streaming_cost; } void LLFloaterModelPreview::setDetails(F32 x, F32 y, F32 z, F32 streaming_cost, F32 physics_cost) @@ -3122,6 +3123,19 @@ void LLModelPreview::rebuildUploadData() mFMP->childEnable("ok_btn"); } + //reorder materials to match mBaseModel + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { + if (mBaseModel.size() == mModel[i].size()) + { + for (U32 j = 0; j < mBaseModel.size(); ++j) + { + mModel[i][j]->matchMaterialOrder(mBaseModel[j]); + llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList); + } + } + } + for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter) { //for each transform in scene LLMatrix4 mat = iter->first; @@ -3220,6 +3234,8 @@ void LLModelPreview::saveUploadData(const std::string& filename, bool save_skinw LLSD data; + data["version"] = SLM_SUPPORTED_VERSION; + S32 mesh_id = 0; //build list of unique models and initialize local id @@ -3595,43 +3611,6 @@ void LLModelPreview::generateNormals() updateStatusMessages(); } -void LLModelPreview::clearMaterials() -{ - for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter) - { //for each transform in current scene - for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter) - { //for each instance with that transform - LLModelInstance& source_instance = *model_iter; - LLModel* source = source_instance.mModel; - - for (S32 i = 0; i < source->getNumVolumeFaces(); ++i) - { //for each face in instance - LLImportMaterial& source_material = source_instance.mMaterial[i]; - - //clear material info - source_material.mDiffuseColor = LLColor4(1,1,1,1); - source_material.mDiffuseMap = NULL; - source_material.mDiffuseMapFilename.clear(); - source_material.mDiffuseMapLabel.clear(); - source_material.mFullbright = false; - } - } - } - - mVertexBuffer[mPreviewLOD].clear(); - - if (mPreviewLOD == LLModel::LOD_HIGH) - { - mBaseScene = mScene[mPreviewLOD]; - mBaseModel = mModel[mPreviewLOD]; - clearGLODGroup(); - mVertexBuffer[5].clear(); - } - - mResourceCost = calcResourceCost(); - refresh(); -} - void LLModelPreview::genLODs(S32 which_lod, U32 decimation, bool enforce_tri_limit) { if (mBaseModel.empty()) @@ -4901,6 +4880,19 @@ BOOL LLModelPreview::render() } } + //make sure material lists all match + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { + if (mBaseModel.size() == mModel[i].size()) + { + for (U32 j = 0; j < mBaseModel.size(); ++j) + { + mModel[i][j]->matchMaterialOrder(mBaseModel[j]); + llassert(mModel[i][j]->mMaterialList == mBaseModel[j]->mMaterialList); + } + } + } + if (regen) { genBuffers(mPreviewLOD, skin_weight); @@ -4932,13 +4924,18 @@ BOOL LLModelPreview::render() if (textures) { - glColor4fv(instance.mMaterial[i].mDiffuseColor.mV); - if (i < instance.mMaterial.size() && instance.mMaterial[i].mDiffuseMap.notNull()) + const std::string& binding = instance.mModel->mMaterialList[i]; + const LLImportMaterial& material = instance.mMaterial[binding]; + + llassert(binding == model->mMaterialList[i]); + + glColor4fv(material.mDiffuseColor.mV); + if (material.mDiffuseMap.notNull()) { - if (instance.mMaterial[i].mDiffuseMap->getDiscardLevel() > -1) + if (material.mDiffuseMap->getDiscardLevel() > -1) { - gGL.getTexUnit(0)->bind(instance.mMaterial[i].mDiffuseMap, true); - mTextureSet.insert(instance.mMaterial[i].mDiffuseMap.get()); + gGL.getTexUnit(0)->bind(material.mDiffuseMap, true); + mTextureSet.insert(material.mDiffuseMap.get()); } } } @@ -5238,8 +5235,10 @@ BOOL LLModelPreview::render() position[j] = v; } + const std::string& binding = instance.mModel->mMaterialList[i]; + const LLImportMaterial& material = instance.mMaterial[binding]; buffer->setBuffer(type_mask & buffer->getTypeMask()); - glColor4fv(instance.mMaterial[i].mDiffuseColor.mV); + glColor4fv(material.mDiffuseColor.mV); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); buffer->draw(LLRender::TRIANGLES, buffer->getNumIndices(), 0); glColor3f(0.4f, 0.4f, 0.4f); @@ -5388,25 +5387,12 @@ void LLFloaterModelPreview::onUpload(void* user_data) //static -void LLFloaterModelPreview::onClearMaterials(void* user_data) -{ - LLFloaterModelPreview* mp = (LLFloaterModelPreview*) user_data; - mp->mModelPreview->clearMaterials(); -} - -//static void LLFloaterModelPreview::refresh(LLUICtrl* ctrl, void* user_data) { sInstance->toggleCalculateButton(true); sInstance->mModelPreview->mDirty = true; } -void LLFloaterModelPreview::updateResourceCost() -{ - U32 cost = mModelPreview->mResourceCost; - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",cost)); -} - //static void LLModelPreview::textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata ) { @@ -5482,18 +5468,34 @@ void LLFloaterModelPreview::toggleCalculateButton(bool visible) { std::string tbd = getString("tbd"); childSetTextArg("weights", "[EQ]", tbd); + childSetTextArg("weights", "[ST]", tbd); + childSetTextArg("weights", "[SIM]", tbd); childSetTextArg("weights", "[PH]", tbd); - childSetTextArg("weights", "[FEE]", tbd); + childSetTextArg("upload_fee", "[FEE]", tbd); + childSetTextArg("price_breakdown", "[STREAMING]", tbd); + childSetTextArg("price_breakdown", "[PHYSICS]", tbd); + childSetTextArg("price_breakdown", "[INSTANCES]", tbd); + childSetTextArg("price_breakdown", "[TEXTURES]", tbd); + childSetTextArg("price_breakdown", "[MODEL]", tbd); } } -void LLFloaterModelPreview::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) +void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { mUploadModelUrl = upload_url; - childSetTextArg("weights", "[EQ]", llformat("%d", mModelPreview->mResourceCost)); - childSetTextArg("weights", "[PH]", llformat("%.3f", physics)); - childSetTextArg("weights", "[FEE]", llformat("%d", fee)); + childSetTextArg("weights", "[EQ]", llformat("%0.3f", result["resource_cost"].asReal())); + childSetTextArg("weights", "[ST]", llformat("%0.3f", result["model_streaming_cost"].asReal())); + childSetTextArg("weights", "[SIM]", llformat("%0.3f", result["simulation_cost"].asReal())); + childSetTextArg("weights", "[PH]", llformat("%0.3f", result["physics_cost"].asReal())); + childSetTextArg("upload_fee", "[FEE]", llformat("%d", result["upload_price"].asInteger())); + childSetTextArg("price_breakdown", "[STREAMING]", llformat("%d", result["upload_price_breakdown"]["mesh_streaming"].asInteger())); + childSetTextArg("price_breakdown", "[PHYSICS]", llformat("%d", result["upload_price_breakdown"]["mesh_physics"].asInteger())); + childSetTextArg("price_breakdown", "[INSTANCES]", llformat("%d", result["upload_price_breakdown"]["mesh_instance"].asInteger())); + childSetTextArg("price_breakdown", "[TEXTURES]", llformat("%d", result["upload_price_breakdown"]["texture"].asInteger())); + childSetTextArg("price_breakdown", "[MODEL]", llformat("%d", result["upload_price_breakdown"]["model"].asInteger())); childSetVisible("weights", true); + childSetVisible("upload_fee", true); + childSetVisible("price_breakdown", true); mUploadBtn->setEnabled(mHasUploadPerm && !mUploadModelUrl.empty()); } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 56098c6250..29a61d6ed3 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -109,7 +109,7 @@ public: void loadTextures() ; //called in the main thread. void processElement(daeElement* element, bool& badElement); - std::vector<LLImportMaterial> getMaterials(LLModel* model, domInstance_geometry* instance_geo); + std::map<std::string, LLImportMaterial> getMaterials(LLModel* model, domInstance_geometry* instance_geo); LLImportMaterial profileToMaterial(domProfile_COMMON* material); std::string getElementLabel(daeElement *element); LLColor4 getDaeColor(daeElement* element); @@ -182,12 +182,8 @@ public: static void onUpload(void* data); - static void onClearMaterials(void* data); - static void refresh(LLUICtrl* ctrl, void* data); - void updateResourceCost(); - void loadModel(S32 lod); void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false); @@ -204,7 +200,7 @@ public: // called when error occurs during permissions request /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); - /*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url); + /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); @@ -330,7 +326,6 @@ public: void loadModelCallback(S32 lod); void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false); void generateNormals(); - void clearMaterials(); U32 calcResourceCost(); void rebuildUploadData(); void saveUploadData(bool save_skinweights, bool save_joint_poisitions); diff --git a/indra/newview/llfloatermodeluploadbase.h b/indra/newview/llfloatermodeluploadbase.h index 6d1282dbd6..a52bc28687 100644 --- a/indra/newview/llfloatermodeluploadbase.h +++ b/indra/newview/llfloatermodeluploadbase.h @@ -41,7 +41,7 @@ public: virtual void onPermissionsReceived(const LLSD& result) = 0; - virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0; + virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; diff --git a/indra/newview/llfloatermodelwizard.cpp b/indra/newview/llfloatermodelwizard.cpp index 7efcdb6145..b517b78e5a 100644 --- a/indra/newview/llfloatermodelwizard.cpp +++ b/indra/newview/llfloatermodelwizard.cpp @@ -488,7 +488,7 @@ void LLFloaterModelWizard::setPermissonsErrorStatus(U32 status, const std::strin } /*virtual*/ -void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) +void LLFloaterModelWizard::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { swap_controls(mCalculateWeightsBtn, mCalculatingWeightsBtn, true); @@ -498,6 +498,7 @@ void LLFloaterModelWizard::onModelPhysicsFeeReceived(F64 physics, S32 fee, std:: mUploadModelUrl = upload_url; + S32 fee = result["upload_price"].asInteger(); childSetTextArg("review_fee", "[FEE]", llformat("%d", fee)); childSetTextArg("charged_fee", "[FEE]", llformat("%d", fee)); diff --git a/indra/newview/llfloatermodelwizard.h b/indra/newview/llfloatermodelwizard.h index ea60cf5db8..db9b605777 100644 --- a/indra/newview/llfloatermodelwizard.h +++ b/indra/newview/llfloatermodelwizard.h @@ -76,7 +76,7 @@ public: // called when error occurs during permissions request /*virtual*/ void setPermissonsErrorStatus(U32 status, const std::string& reason); - /*virtual*/ void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url); + /*virtual*/ void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url); /*virtual*/ void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 6b3e3088d5..07c0878877 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -40,6 +40,10 @@ #include "llxfermanager.h" #include "indra_constants.h" #include "message.h" +#include "llloadingindicator.h" +#include "llradiogroup.h" +#include "llsd.h" +#include "llsdserialize.h" #include "llagent.h" #include "llappviewer.h" @@ -48,6 +52,8 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llcombobox.h" +#include "lldaycyclemanager.h" +#include "llenvmanager.h" #include "llfilepicker.h" #include "llfloatergodtools.h" // for send_sim_wide_deletes() #include "llfloatertopobjects.h" // added to fix SL-32336 @@ -55,12 +61,12 @@ #include "llfloaterreg.h" #include "llfloaterregiondebugconsole.h" #include "llfloatertelehub.h" -#include "llfloaterwindlight.h" #include "llinventorymodel.h" #include "lllineeditor.h" #include "llnamelistctrl.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llregioninfomodel.h" #include "llscrolllistitem.h" #include "llsliderctrl.h" #include "llslurl.h" @@ -80,6 +86,7 @@ #include "llviewertexteditor.h" #include "llviewerwindow.h" #include "llvlcomposition.h" +#include "llwaterparammanager.h" #include "lltrans.h" #include "llagentui.h" #include "llmeshrepository.h" @@ -87,6 +94,8 @@ const S32 TERRAIN_TEXTURE_COUNT = 4; const S32 CORNER_COUNT = 4; +#define TMP_DISABLE_WLES // STORM-1180 + ///---------------------------------------------------------------------------- /// Local class declaration ///---------------------------------------------------------------------------- @@ -190,24 +199,24 @@ LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) BOOL LLFloaterRegionInfo::postBuild() { mTab = getChild<LLTabContainer>("region_panels"); + mTab->setCommitCallback(boost::bind(&LLFloaterRegionInfo::onTabSelected, this, _2)); // contruct the panels LLPanelRegionInfo* panel; - panel = new LLPanelRegionGeneralInfo; + panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); - panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel)); - - panel->buildFromFile("panel_region_general.xml"); + panel->buildFromFile("panel_region_estate.xml"); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); - panel = new LLPanelRegionDebugInfo; + panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); - panel->buildFromFile("panel_region_debug.xml"); + panel->buildFromFile("panel_region_covenant.xml"); mTab->addTabPanel(panel); - panel = new LLPanelRegionTextureInfo; + panel = new LLPanelRegionGeneralInfo; mInfoPanels.push_back(panel); - panel->buildFromFile("panel_region_texture.xml"); + panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel)); + panel->buildFromFile("panel_region_general.xml"); mTab->addTabPanel(panel); panel = new LLPanelRegionTerrainInfo; @@ -215,20 +224,23 @@ BOOL LLFloaterRegionInfo::postBuild() panel->buildFromFile("panel_region_terrain.xml"); mTab->addTabPanel(panel); - panel = new LLPanelEstateInfo; + panel = new LLPanelEnvironmentInfo; mInfoPanels.push_back(panel); - panel->buildFromFile("panel_region_estate.xml"); + panel->buildFromFile("panel_region_environment.xml"); mTab->addTabPanel(panel); - panel = new LLPanelEstateCovenant; + panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); - panel->buildFromFile("panel_region_covenant.xml"); + panel->buildFromFile("panel_region_debug.xml"); mTab->addTabPanel(panel); gMessageSystem->setHandlerFunc( "EstateOwnerMessage", &processEstateOwnerRequest); + // Request region info when agent region changes. + LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionInfo::requestRegionInfo, this)); + return TRUE; } @@ -305,6 +317,8 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) // static void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) { + LL_DEBUGS("Windlight") << "Processing region info" << LL_ENDL; + LLPanel* panel; LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl; @@ -312,12 +326,20 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) { return; } + + // We need to re-request environment setting here, + // otherwise after we apply (send) updated region settings we won't get them back, + // so our environment won't be updated. + LLEnvManagerNew::instance().requestRegionSettings(); LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); LLViewerRegion* region = gAgent.getRegion(); BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); + // *TODO: Replace parcing msg with accessing the region info model. + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + // extract message std::string sim_name; std::string sim_type = LLTrans::getString("land_type_unknown"); @@ -389,15 +411,10 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel = tab->getChild<LLPanel>("Terrain"); panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name)); - panel->getChild<LLUICtrl>("water_height_spin")->setValue(LLSD(water_height)); - panel->getChild<LLUICtrl>("terrain_raise_spin")->setValue(LLSD(terrain_raise_limit)); - panel->getChild<LLUICtrl>("terrain_lower_spin")->setValue(LLSD(terrain_lower_limit)); - panel->getChild<LLUICtrl>("use_estate_sun_check")->setValue(LLSD(use_estate_sun)); - - panel->getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); - panel->getChildView("fixed_sun_check")->setEnabled(allow_modify && !use_estate_sun); - panel->getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(sun_hour)); - panel->getChildView("sun_hour_slider")->setEnabled(allow_modify && !use_estate_sun); + panel->getChild<LLUICtrl>("water_height_spin")->setValue(region_info.mWaterHeight); + panel->getChild<LLUICtrl>("terrain_raise_spin")->setValue(region_info.mTerrainRaiseLimit); + panel->getChild<LLUICtrl>("terrain_lower_spin")->setValue(region_info.mTerrainLowerLimit); + panel->setCtrlsEnabled(allow_modify); floater->refreshFromRegion( gAgent.getRegion() ); @@ -423,6 +440,29 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() return panel; } +// static +LLPanelRegionTerrainInfo* LLFloaterRegionInfo::getPanelRegionTerrain() +{ + LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); + if (!floater) + { + llassert(floater); + return NULL; + } + + LLTabContainer* tab_container = floater->getChild<LLTabContainer>("region_panels"); + LLPanelRegionTerrainInfo* panel = + dynamic_cast<LLPanelRegionTerrainInfo*>(tab_container->getChild<LLPanel>("Terrain")); + llassert(panel); + return panel; +} + +void LLFloaterRegionInfo::onTabSelected(const LLSD& param) +{ + LLPanel* active_panel = getChild<LLPanel>(param.asString()); + active_panel->onOpen(LLSD()); +} + void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) { if (!region) @@ -503,8 +543,13 @@ void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data) // virtual BOOL LLPanelRegionInfo::postBuild() { - getChild<LLUICtrl>("apply_btn")->setCommitCallback(boost::bind(&LLPanelRegionInfo::onBtnSet, this)); - getChildView("apply_btn")->setEnabled(FALSE); + // If the panel has an Apply button, set a callback for it. + LLUICtrl* apply_btn = findChild<LLUICtrl>("apply_btn"); + if (apply_btn) + { + apply_btn->setCommitCallback(boost::bind(&LLPanelRegionInfo::onBtnSet, this)); + } + refresh(); return TRUE; } @@ -556,12 +601,14 @@ void LLPanelRegionInfo::sendEstateOwnerMessage( void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable) { - getChildView(btn_name)->setEnabled(enable); + LLView* button = findChildView(btn_name); + if (button) button->setEnabled(enable); } void LLPanelRegionInfo::disableButton(const std::string& btn_name) { - getChildView(btn_name)->setEnabled(FALSE); + LLView* button = findChildView(btn_name); + if (button) button->setEnabled(FALSE); } void LLPanelRegionInfo::initCtrl(const std::string& name) @@ -1052,131 +1099,7 @@ void LLPanelRegionDebugInfo::onClickCancelRestart(void* data) } -///////////////////////////////////////////////////////////////////////////// -// LLPanelRegionTextureInfo -// -LLPanelRegionTextureInfo::LLPanelRegionTextureInfo() : LLPanelRegionInfo() -{ - // nothing. -} - -bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) -{ - BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); - setCtrlsEnabled(allow_modify); - getChildView("apply_btn")->setEnabled(FALSE); - - if (region) - { - getChild<LLUICtrl>("region_text")->setValue(LLSD(region->getName())); - } - else - { - getChild<LLUICtrl>("region_text")->setValue(LLSD("")); - } - - if (!region) return LLPanelRegionInfo::refreshFromRegion(region); - - LLVLComposition* compp = region->getComposition(); - LLTextureCtrl* texture_ctrl; - std::string buffer; - for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) - { - buffer = llformat("texture_detail_%d", i); - texture_ctrl = getChild<LLTextureCtrl>(buffer); - if(texture_ctrl) - { - lldebugs << "Detail Texture " << i << ": " - << compp->getDetailTextureID(i) << llendl; - LLUUID tmp_id(compp->getDetailTextureID(i)); - texture_ctrl->setImageAssetID(tmp_id); - } - } - - for(S32 i = 0; i < CORNER_COUNT; ++i) - { - buffer = llformat("height_start_spin_%d", i); - getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getStartHeight(i))); - buffer = llformat("height_range_spin_%d", i); - getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getHeightRange(i))); - } - - // Call the parent for common book-keeping - return LLPanelRegionInfo::refreshFromRegion(region); -} - - -BOOL LLPanelRegionTextureInfo::postBuild() -{ - LLPanelRegionInfo::postBuild(); - std::string buffer; - for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) - { - buffer = llformat("texture_detail_%d", i); - initCtrl(buffer); - } - - for(S32 i = 0; i < CORNER_COUNT; ++i) - { - buffer = llformat("height_start_spin_%d", i); - initCtrl(buffer); - buffer = llformat("height_range_spin_%d", i); - initCtrl(buffer); - } - -// LLButton* btn = ("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); -// btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT); -// addChild(btn); - - return LLPanelRegionInfo::postBuild(); -} - -BOOL LLPanelRegionTextureInfo::sendUpdate() -{ - llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; - - // Make sure user hasn't chosen wacky textures. - if (!validateTextureSizes()) - { - return FALSE; - } - - LLTextureCtrl* texture_ctrl; - std::string buffer; - std::string id_str; - LLMessageSystem* msg = gMessageSystem; - strings_t strings; - - LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - - for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) - { - buffer = llformat("texture_detail_%d", i); - texture_ctrl = getChild<LLTextureCtrl>(buffer); - if(texture_ctrl) - { - LLUUID tmp_id(texture_ctrl->getImageAssetID()); - tmp_id.toString(id_str); - buffer = llformat("%d %s", i, id_str.c_str()); - strings.push_back(buffer); - } - } - sendEstateOwnerMessage(msg, "texturedetail", invoice, strings); - strings.clear(); - for(S32 i = 0; i < CORNER_COUNT; ++i) - { - buffer = llformat("height_start_spin_%d", i); - std::string buffer2 = llformat("height_range_spin_%d", i); - std::string buffer3 = llformat("%d %f %f", i, (F32)getChild<LLUICtrl>(buffer)->getValue().asReal(), (F32)getChild<LLUICtrl>(buffer2)->getValue().asReal()); - strings.push_back(buffer3); - } - sendEstateOwnerMessage(msg, "textureheights", invoice, strings); - strings.clear(); - sendEstateOwnerMessage(msg, "texturecommit", invoice, strings); - return TRUE; -} - -BOOL LLPanelRegionTextureInfo::validateTextureSizes() +BOOL LLPanelRegionTerrainInfo::validateTextureSizes() { for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) { @@ -1219,49 +1142,86 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes() return TRUE; } - -// static -void LLPanelRegionTextureInfo::onClickDump(void* data) -{ - llinfos << "LLPanelRegionTextureInfo::onClickDump()" << llendl; -} - - ///////////////////////////////////////////////////////////////////////////// // LLPanelRegionTerrainInfo ///////////////////////////////////////////////////////////////////////////// +// Initialize statics + BOOL LLPanelRegionTerrainInfo::postBuild() { LLPanelRegionInfo::postBuild(); - + initCtrl("water_height_spin"); initCtrl("terrain_raise_spin"); initCtrl("terrain_lower_spin"); - initCtrl("fixed_sun_check"); - getChild<LLUICtrl>("fixed_sun_check")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeFixedSun, this)); - getChild<LLUICtrl>("use_estate_sun_check")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeUseEstateTime, this)); - getChild<LLUICtrl>("sun_hour_slider")->setCommitCallback(boost::bind(&LLPanelRegionTerrainInfo::onChangeSunHour, this)); + std::string buffer; + for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) + { + buffer = llformat("texture_detail_%d", i); + initCtrl(buffer); + } + + for(S32 i = 0; i < CORNER_COUNT; ++i) + { + buffer = llformat("height_start_spin_%d", i); + initCtrl(buffer); + buffer = llformat("height_range_spin_%d", i); + initCtrl(buffer); + } childSetAction("download_raw_btn", onClickDownloadRaw, this); childSetAction("upload_raw_btn", onClickUploadRaw, this); childSetAction("bake_terrain_btn", onClickBakeTerrain, this); - return TRUE; + return LLPanelRegionInfo::postBuild(); } // virtual bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) { - llinfos << "LLPanelRegionTerrainInfo::refreshFromRegion" << llendl; - BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); setCtrlsEnabled(owner_or_god_or_manager); + getChildView("apply_btn")->setEnabled(FALSE); + if (region) + { + getChild<LLUICtrl>("region_text")->setValue(LLSD(region->getName())); + + LLVLComposition* compp = region->getComposition(); + LLTextureCtrl* texture_ctrl; + std::string buffer; + for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) + { + buffer = llformat("texture_detail_%d", i); + texture_ctrl = getChild<LLTextureCtrl>(buffer); + if(texture_ctrl) + { + lldebugs << "Detail Texture " << i << ": " + << compp->getDetailTextureID(i) << llendl; + LLUUID tmp_id(compp->getDetailTextureID(i)); + texture_ctrl->setImageAssetID(tmp_id); + } + } + + for(S32 i = 0; i < CORNER_COUNT; ++i) + { + buffer = llformat("height_start_spin_%d", i); + getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getStartHeight(i))); + buffer = llformat("height_range_spin_%d", i); + getChild<LLUICtrl>(buffer)->setValue(LLSD(compp->getHeightRange(i))); + } + } + else + { + lldebugs << "no region set" << llendl; + getChild<LLUICtrl>("region_text")->setValue(LLSD("")); + } + getChildView("download_raw_btn")->setEnabled(owner_or_god); getChildView("upload_raw_btn")->setEnabled(owner_or_god); getChildView("bake_terrain_btn")->setEnabled(owner_or_god); @@ -1269,6 +1229,7 @@ bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) return LLPanelRegionInfo::refreshFromRegion(region); } + // virtual BOOL LLPanelRegionTerrainInfo::sendUpdate() { @@ -1277,76 +1238,62 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() strings_t strings; LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); - buffer = llformat("%f", (F32)getChild<LLUICtrl>("water_height_spin")->getValue().asReal()); - strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal()); - strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal()); - strings.push_back(buffer); - buffer = llformat("%s", (getChild<LLUICtrl>("use_estate_sun_check")->getValue().asBoolean() ? "Y" : "N")); - strings.push_back(buffer); - buffer = llformat("%s", (getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean() ? "Y" : "N")); - strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild<LLUICtrl>("sun_hour_slider")->getValue().asReal() ); - strings.push_back(buffer); - - // Grab estate information in case the user decided to set the - // region back to estate time. JC - LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return true; - - LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); - if (!tab) return true; + // update the model + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + region_info.mWaterHeight = (F32) getChild<LLUICtrl>("water_height_spin")->getValue().asReal(); + region_info.mTerrainRaiseLimit = (F32) getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal(); + region_info.mTerrainLowerLimit = (F32) getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal(); - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); - if (!panel) return true; + // and sync the region with it + region_info.sendRegionTerrain(invoice); + + // ======================================= + // Assemble and send texturedetail message - BOOL estate_global_time = panel->getGlobalTime(); - BOOL estate_fixed_sun = panel->getFixedSun(); - F32 estate_sun_hour; - if (estate_global_time) + // Make sure user hasn't chosen wacky textures. + if (!validateTextureSizes()) { - estate_sun_hour = 0.f; + return FALSE; } - else + + LLTextureCtrl* texture_ctrl; + std::string id_str; + LLMessageSystem* msg = gMessageSystem; + + for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) { - estate_sun_hour = panel->getSunHour(); + buffer = llformat("texture_detail_%d", i); + texture_ctrl = getChild<LLTextureCtrl>(buffer); + if(texture_ctrl) + { + LLUUID tmp_id(texture_ctrl->getImageAssetID()); + tmp_id.toString(id_str); + buffer = llformat("%d %s", i, id_str.c_str()); + strings.push_back(buffer); + } } + sendEstateOwnerMessage(msg, "texturedetail", invoice, strings); + strings.clear(); - buffer = llformat("%s", (estate_global_time ? "Y" : "N") ); - strings.push_back(buffer); - buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") ); - strings.push_back(buffer); - buffer = llformat("%f", estate_sun_hour); - strings.push_back(buffer); - - sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); - return TRUE; -} + // ======================================== + // Assemble and send textureheights message -void LLPanelRegionTerrainInfo::onChangeUseEstateTime() -{ - BOOL use_estate_sun = getChild<LLUICtrl>("use_estate_sun_check")->getValue().asBoolean(); - getChildView("fixed_sun_check")->setEnabled(!use_estate_sun); - getChildView("sun_hour_slider")->setEnabled(!use_estate_sun); - if (use_estate_sun) + for(S32 i = 0; i < CORNER_COUNT; ++i) { - getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD(FALSE)); - getChild<LLUICtrl>("sun_hour_slider")->setValue(LLSD(0.f)); + buffer = llformat("height_start_spin_%d", i); + std::string buffer2 = llformat("height_range_spin_%d", i); + std::string buffer3 = llformat("%d %f %f", i, (F32)getChild<LLUICtrl>(buffer)->getValue().asReal(), (F32)getChild<LLUICtrl>(buffer2)->getValue().asReal()); + strings.push_back(buffer3); } - getChildView("apply_btn")->setEnabled(TRUE); -} + sendEstateOwnerMessage(msg, "textureheights", invoice, strings); + strings.clear(); -void LLPanelRegionTerrainInfo::onChangeFixedSun() -{ - // Just enable the apply button. We let the sun-hour slider be enabled - // for both fixed-sun and non-fixed-sun. JC - getChildView("apply_btn")->setEnabled(TRUE); -} + // ======================================== + // Send texturecommit message -void LLPanelRegionTerrainInfo::onChangeSunHour() -{ - getChildView("apply_btn")->setEnabled(TRUE); + sendEstateOwnerMessage(msg, "texturecommit", invoice, strings); + + return TRUE; } // static @@ -1406,6 +1353,7 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con strings.push_back("bake"); LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); + return false; } @@ -1439,6 +1387,7 @@ void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) estate_dispatch_initialized = true; } +#ifndef TMP_DISABLE_WLES // Disables the sun-hour slider and the use fixed time check if the use global time is check void LLPanelEstateInfo::onChangeUseGlobalTime() { @@ -1457,23 +1406,13 @@ void LLPanelEstateInfo::onChangeFixedSun() getChild<LLUICtrl>("use_global_time_check")->setValue(LLSD(FALSE)); enableButton("apply_btn"); } - +#endif // TMP_DISABLE_WLES //--------------------------------------------------------------------------- // Add/Remove estate access button callbacks //--------------------------------------------------------------------------- -void LLPanelEstateInfo::onClickEditSky() -{ - LLFloaterReg::showInstance("env_windlight"); -} - -void LLPanelEstateInfo::onClickEditDayCycle() -{ - LLFloaterReg::showInstance("env_day_cycle"); -} - void LLPanelEstateInfo::onClickAddAllowedAgent() { LLCtrlListInterface *list = childGetListInterface("allowed_avatar_name_list"); @@ -2030,7 +1969,6 @@ void LLPanelEstateInfo::updateControls(LLViewerRegion* region) BOOL manager = (region && region->isEstateManager()); setCtrlsEnabled(god || owner || manager); - getChildView("apply_btn")->setEnabled(FALSE); getChildView("add_allowed_avatar_btn")->setEnabled(god || owner || manager); getChildView("remove_allowed_avatar_btn")->setEnabled(god || owner || manager); getChildView("add_allowed_group_btn")->setEnabled(god || owner || manager); @@ -2088,10 +2026,6 @@ void LLPanelEstateInfo::updateChild(LLUICtrl* child_ctrl) { // do nothing } - else if (checkSunHourSlider(child_ctrl)) - { - // do nothing - } } bool LLPanelEstateInfo::estateUpdate(LLMessageSystem* msg) @@ -2105,18 +2039,11 @@ BOOL LLPanelEstateInfo::postBuild() { // set up the callbacks for the generic controls initCtrl("externally_visible_check"); - initCtrl("use_global_time_check"); - initCtrl("fixed_sun_check"); initCtrl("allow_direct_teleport"); initCtrl("limit_payment"); initCtrl("limit_age_verified"); initCtrl("voice_chat_check"); - // set up the use global time checkbox - getChild<LLUICtrl>("use_global_time_check")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeUseGlobalTime, this)); - getChild<LLUICtrl>("fixed_sun_check")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeFixedSun, this)); - getChild<LLUICtrl>("sun_hour_slider")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); - getChild<LLUICtrl>("allowed_avatar_name_list")->setCommitCallback(boost::bind(&LLPanelEstateInfo::onChangeChildCtrl, this, _1)); LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); if (avatar_name_list) @@ -2163,9 +2090,6 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("message_estate_btn", boost::bind(&LLPanelEstateInfo::onClickMessageEstate, this)); childSetAction("kick_user_from_estate_btn", boost::bind(&LLPanelEstateInfo::onClickKickUser, this)); - childSetAction("WLEditSky", boost::bind(&LLPanelEstateInfo::onClickEditSky, this)); - childSetAction("WLEditDayCycle", boost::bind(&LLPanelEstateInfo::onClickEditDayCycle, this)); - return LLPanelRegionInfo::postBuild(); } @@ -2304,7 +2228,6 @@ bool LLPanelEstateInfo::commitEstateInfoCaps() body["is_externally_visible"] = getChild<LLUICtrl>("externally_visible_check")->getValue().asBoolean(); body["allow_direct_teleport"] = getChild<LLUICtrl>("allow_direct_teleport")->getValue().asBoolean(); - body["is_sun_fixed" ] = getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean(); body["deny_anonymous" ] = getChild<LLUICtrl>("limit_payment")->getValue().asBoolean(); body["deny_age_unverified" ] = getChild<LLUICtrl>("limit_age_verified")->getValue().asBoolean(); body["allow_voice_chat" ] = getChild<LLUICtrl>("voice_chat_check")->getValue().asBoolean(); @@ -2369,7 +2292,6 @@ void LLPanelEstateInfo::commitEstateInfoDataserver() void LLPanelEstateInfo::setEstateFlags(U32 flags) { getChild<LLUICtrl>("externally_visible_check")->setValue(LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); - getChild<LLUICtrl>("fixed_sun_check")->setValue(LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); getChild<LLUICtrl>("voice_chat_check")->setValue( LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE)); getChild<LLUICtrl>("allow_direct_teleport")->setValue(LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); @@ -2398,11 +2320,6 @@ U32 LLPanelEstateInfo::computeEstateFlags() flags |= REGION_FLAGS_ALLOW_DIRECT_TELEPORT; } - if (getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean()) - { - flags |= REGION_FLAGS_SUN_FIXED; - } - if (getChild<LLUICtrl>("limit_payment")->getValue().asBoolean()) { flags |= REGION_FLAGS_DENY_ANONYMOUS; @@ -2566,17 +2483,6 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name) return (btn_name != ""); } -BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl) -{ - BOOL found_child_ctrl = FALSE; - if (child_ctrl->getName() == "sun_hour_slider") - { - enableButton("apply_btn"); - found_child_ctrl = TRUE; - } - return found_child_ctrl; -} - // static void LLPanelEstateInfo::onClickMessageEstate(void* userdata) { @@ -2978,6 +2884,8 @@ bool LLDispatchEstateUpdateInfo::operator()( const LLUUID& invoice, const sparam_t& strings) { + lldebugs << "Received estate update" << llendl; + LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (!panel) return true; @@ -3004,10 +2912,12 @@ bool LLDispatchEstateUpdateInfo::operator()( F32 sun_hour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; if(sun_hour == 0 && (flags & REGION_FLAGS_SUN_FIXED ? FALSE : TRUE)) { + lldebugs << "Estate uses global time" << llendl; panel->setGlobalTime(TRUE); } else { + lldebugs << "Estate sun hour: " << sun_hour << llendl; panel->setGlobalTime(FALSE); panel->setSunHour(sun_hour); } @@ -3198,3 +3108,582 @@ bool LLDispatchSetEstateAccess::operator()( return true; } + +LLPanelEnvironmentInfo::LLPanelEnvironmentInfo() +: mEnableEditing(false), + mRegionSettingsRadioGroup(NULL), + mDayCycleSettingsRadioGroup(NULL), + mWaterPresetCombo(NULL), + mSkyPresetCombo(NULL), + mDayCyclePresetCombo(NULL) +{ +} + +// virtual +BOOL LLPanelEnvironmentInfo::postBuild() +{ + mRegionSettingsRadioGroup = getChild<LLRadioGroup>("region_settings_radio_group"); + mRegionSettingsRadioGroup->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSwitchRegionSettings, this)); + + mDayCycleSettingsRadioGroup = getChild<LLRadioGroup>("sky_dayc_settings_radio_group"); + mDayCycleSettingsRadioGroup->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSwitchDayCycle, this)); + + mWaterPresetCombo = getChild<LLComboBox>("water_settings_preset_combo"); + mWaterPresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectWaterPreset, this)); + + mSkyPresetCombo = getChild<LLComboBox>("sky_settings_preset_combo"); + mSkyPresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectSkyPreset, this)); + + mDayCyclePresetCombo = getChild<LLComboBox>("dayc_settings_preset_combo"); + mDayCyclePresetCombo->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSelectDayCycle, this)); + + childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL); + getChild<LLButton>("apply_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpUserPrefs, LLEnvManagerNew::getInstance())); + childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL); + getChild<LLButton>("cancel_btn")->setRightMouseDownCallback(boost::bind(&LLEnvManagerNew::dumpPresets, LLEnvManagerNew::getInstance())); + + LLEnvManagerNew::instance().setRegionSettingsChangeCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingschange, this)); + LLEnvManagerNew::instance().setRegionSettingsAppliedCallback(boost::bind(&LLPanelEnvironmentInfo::onRegionSettingsApplied, this, _1)); + + LLDayCycleManager::instance().setModifyCallback(boost::bind(&LLPanelEnvironmentInfo::populateDayCyclesList, this)); + LLWLParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateSkyPresetsList, this)); + LLWaterParamManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelEnvironmentInfo::populateWaterPresetsList, this)); + + return TRUE; +} + +// virtual +void LLPanelEnvironmentInfo::onOpen(const LLSD& key) +{ + LL_DEBUGS("Windlight") << "Panel opened, refreshing" << LL_ENDL; + refresh(); +} + +// virtual +void LLPanelEnvironmentInfo::handleVisibilityChange(BOOL new_visibility) +{ + // If hiding (user switched to another tab or closed the floater), + // display user's preferred environment. + if (!new_visibility) + { + LLEnvManagerNew::instance().usePrefs(); + } +} + +// virtual +bool LLPanelEnvironmentInfo::refreshFromRegion(LLViewerRegion* region) +{ + LL_DEBUGS("Windlight") << "Region updated, enabling/disabling controls" << LL_ENDL; + BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID())); + BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager()); + + // Don't refresh from region settings to avoid flicker after applying new region settings. + mEnableEditing = owner_or_god_or_manager; + setControlsEnabled(mEnableEditing); + + return LLPanelRegionInfo::refreshFromRegion(region); +} + +void LLPanelEnvironmentInfo::refresh() +{ + populateWaterPresetsList(); + populateSkyPresetsList(); + populateDayCyclesList(); + + // Init radio groups. + const LLEnvironmentSettings& settings = LLEnvManagerNew::instance().getRegionSettings(); + const LLSD& dc = settings.getWLDayCycle(); + LLSD::Real first_frame_time = dc.size() > 0 ? dc[0][0].asReal() : 0.0f; + const bool use_fixed_sky = dc.size() == 1 && first_frame_time < 0; + mRegionSettingsRadioGroup->setSelectedIndex(settings.getSkyMap().size() == 0 ? 0 : 1); + mDayCycleSettingsRadioGroup->setSelectedIndex(use_fixed_sky ? 0 : 1); + + setControlsEnabled(mEnableEditing); + + setDirty(false); +} + +void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled) +{ + mRegionSettingsRadioGroup->setEnabled(enabled); + mDayCycleSettingsRadioGroup->setEnabled(enabled); + + mWaterPresetCombo->setEnabled(enabled); + mSkyPresetCombo->setEnabled(enabled); + mDayCyclePresetCombo->setEnabled(enabled); + + getChildView("apply_btn")->setEnabled(enabled); + getChildView("cancel_btn")->setEnabled(enabled); + + if (enabled) + { + // Enable/disable some controls based on currently selected radio buttons. + bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + getChild<LLView>("user_environment_settings")->setEnabled(!use_defaults); + + bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + mSkyPresetCombo->setEnabled(is_fixed_sky); + mDayCyclePresetCombo->setEnabled(!is_fixed_sky); + } +} + +void LLPanelEnvironmentInfo::setApplyProgress(bool started) +{ + LLLoadingIndicator* indicator = getChild<LLLoadingIndicator>("progress_indicator"); + + indicator->setVisible(started); + + if (started) + { + indicator->start(); + } + else + { + indicator->stop(); + } +} + +void LLPanelEnvironmentInfo::setDirty(bool dirty) +{ + getChildView("apply_btn")->setEnabled(dirty); + getChildView("cancel_btn")->setEnabled(dirty); +} + +void LLPanelEnvironmentInfo::sendRegionSunUpdate(F32 sun_angle) +{ + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + bool region_use_fixed_sky = sun_angle >= 0.f; + + // Set sun hour. + if (region_use_fixed_sky) + { + LLWLParamSet param_set; + LLSD params; + std::string unused; + if (!getSelectedSkyParams(params, unused)) + { + return; + } + param_set.setAll(params); + + // convert value range from 0..2pi to 6..30 + region_info.mSunHour = fmodf((sun_angle / F_TWO_PI) * 24.f, 24.f) + 6.f; + } + + region_info.setUseFixedSun(region_use_fixed_sky); + region_info.mUseEstateSun = !region_use_fixed_sky; + + region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice()); +} + +void LLPanelEnvironmentInfo::populateWaterPresetsList() +{ + mWaterPresetCombo->removeall(); + + // If the region already has water params, add them to the list. + const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings(); + if (region_settings.getWaterParams().size() != 0) + { + const std::string& region_name = gAgent.getRegion()->getName(); + mWaterPresetCombo->add(region_name, LLWLParamKey(region_name, LLEnvKey::SCOPE_REGION).toLLSD()); + mWaterPresetCombo->addSeparator(); + } + + std::list<std::string> user_presets, system_presets; + LLWaterParamManager::instance().getPresetNames(user_presets, system_presets); + + // Add local user presets first. + for (std::list<std::string>::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + + if (user_presets.size() > 0) + { + mWaterPresetCombo->addSeparator(); + } + + // Add local system presets. + for (std::list<std::string>::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it) + { + mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD()); + } + + // There's no way to select current preset because its name is not stored on server. +} + +void LLPanelEnvironmentInfo::populateSkyPresetsList() +{ + mSkyPresetCombo->removeall(); + + LLWLParamManager::preset_name_list_t region_presets; + LLWLParamManager::preset_name_list_t user_presets, sys_presets; + LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets); + + // Add region presets. + std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : LLTrans::getString("Unknown"); + for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it) + { + std::string preset_name = *it; + std::string item_title = preset_name + " (" + region_name + ")"; + mSkyPresetCombo->add(item_title, LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal()); + } + + if (!region_presets.empty()) + { + mSkyPresetCombo->addSeparator(); + } + + // Add user presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it) + { + mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + if (!user_presets.empty()) + { + mSkyPresetCombo->addSeparator(); + } + + // Add system presets. + for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it) + { + mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + // Select current preset. + LLSD sky_map = LLEnvManagerNew::instance().getRegionSettings().getSkyMap(); + if (sky_map.size() == 1) // if the region is set to fixed sky + { + std::string preset_name = sky_map.beginMap()->first; + mSkyPresetCombo->selectByValue(LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal()); + } +} + +void LLPanelEnvironmentInfo::populateDayCyclesList() +{ + mDayCyclePresetCombo->removeall(); + + // If the region already has env. settings, add its day cycle to the list. + const LLSD& cur_region_dc = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle(); + if (cur_region_dc.size() != 0) + { + LLViewerRegion* region = gAgent.getRegion(); + llassert(region != NULL); + + LLWLParamKey key(region->getName(), LLEnvKey::SCOPE_REGION); + mDayCyclePresetCombo->add(region->getName(), key.toStringVal()); + mDayCyclePresetCombo->addSeparator(); + } + + // Add local user day cycles. + LLDayCycleManager::preset_name_list_t user_days, sys_days; + LLDayCycleManager::instance().getPresetNames(user_days, sys_days); + for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it) + { + mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + if (user_days.size() > 0) + { + mDayCyclePresetCombo->addSeparator(); + } + + // Add local system day cycles. + for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it) + { + mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal()); + } + + // Current day cycle is already selected. +} + +bool LLPanelEnvironmentInfo::getSelectedWaterParams(LLSD& water_params) +{ + LLWLParamKey water_key(mWaterPresetCombo->getSelectedValue()); + + if (water_key.scope == LLEnvKey::SCOPE_REGION) + { + water_params = LLEnvManagerNew::instance().getRegionSettings().getWaterParams(); + } + else + { + LLWaterParamSet param_set; + if (!LLWaterParamManager::instance().getParamSet(water_key.name, param_set)) + { + llwarns << "Error getting water preset: " << water_key.name << llendl; + return false; + } + + water_params = param_set.getAll(); + } + + return true; +} + +bool LLPanelEnvironmentInfo::getSelectedSkyParams(LLSD& sky_params, std::string& preset_name) +{ + std::string preset_key(mSkyPresetCombo->getValue().asString()); + LLWLParamKey preset(preset_key); + + // Get the preset sky params. + LLWLParamSet param_set; + if (!LLWLParamManager::instance().getParamSet(preset, param_set)) + { + llwarns << "Error getting sky params: " << preset.toLLSD() << llendl; + return false; + } + + sky_params = param_set.getAll(); + preset_name = preset.name; + return true; +} + +bool LLPanelEnvironmentInfo::getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sky_map, short& scope) +{ + std::string preset_key(mDayCyclePresetCombo->getValue().asString()); + LLWLParamKey dc(preset_key); + LL_DEBUGS("Windlight") << "Use day cycle: " << dc.toLLSD() << LL_ENDL; + + if (dc.scope == LLEnvKey::SCOPE_REGION) // current region day cycle + { + const LLEnvironmentSettings& cur_region_settings = LLEnvManagerNew::instance().getRegionSettings(); + day_cycle = cur_region_settings.getWLDayCycle(); + sky_map = cur_region_settings.getSkyMap(); + } + else // a local day cycle + { + if (!LLDayCycleManager::instance().getPreset(dc.name, day_cycle)) + { + llwarns << "Error getting day cycle " << dc.name << llendl; + return false; + } + + // Create sky map from the day cycle. + { + LLWLDayCycle tmp_day; + tmp_day.loadDayCycle(day_cycle, dc.scope); + tmp_day.getSkyMap(sky_map); + } + } + + scope = dc.scope; + + return true; +} +void LLPanelEnvironmentInfo::onSwitchRegionSettings() +{ + bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + getChild<LLView>("user_environment_settings")->setEnabled(!use_defaults); + + if (use_defaults) + { + LLEnvManagerNew::instance().useDefaults(); + } + else + { + onSelectWaterPreset(); + onSwitchDayCycle(); + } + + setDirty(true); +} + +void LLPanelEnvironmentInfo::onSwitchDayCycle() +{ + bool is_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + + mSkyPresetCombo->setEnabled(is_fixed_sky); + mDayCyclePresetCombo->setEnabled(!is_fixed_sky); + + if (is_fixed_sky) + { + onSelectSkyPreset(); + } + else + { + onSelectDayCycle(); + } + + setDirty(true); +} + +void LLPanelEnvironmentInfo::onSelectWaterPreset() +{ + LLSD water_params; + + if (getSelectedWaterParams(water_params)) + { + LLEnvManagerNew::instance().useWaterParams(water_params); + } + + setDirty(true); +} + +void LLPanelEnvironmentInfo::onSelectSkyPreset() +{ + LLSD params; + std::string dummy; + + if (getSelectedSkyParams(params, dummy)) + { + LLEnvManagerNew::instance().useSkyParams(params); + } + + setDirty(true); +} + +void LLPanelEnvironmentInfo::onSelectDayCycle() +{ + LLSD day_cycle; + LLSD sky_map; // unused + short scope; + + if (getSelectedDayCycleParams(day_cycle, sky_map, scope)) + { + LLEnvManagerNew::instance().useDayCycleParams(day_cycle, (LLEnvKey::EScope) scope); + } + + setDirty(true); +} + +void LLPanelEnvironmentInfo::onBtnApply() +{ + const bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0; + const bool use_fixed_sky = mDayCycleSettingsRadioGroup->getSelectedIndex() == 0; + + LLSD day_cycle; + LLSD sky_map; + LLSD water_params; + F32 sun_angle = -1.f; // invalid value meaning no fixed sky + + if (use_defaults) + { + // settings will be empty + LL_DEBUGS("Windlight") << "Defaults" << LL_ENDL; + } + else // use custom region settings + { + if (use_fixed_sky) + { + LL_DEBUGS("Windlight") << "Use fixed sky" << LL_ENDL; + + // Get selected sky params. + LLSD params; + std::string preset_name; + if (!getSelectedSkyParams(params, preset_name)) + { + return; + } + + // Create a day cycle consisting of a single sky preset. + LLSD key(LLSD::emptyArray()); + key.append(-1.0f); // indicate that user preference is actually fixed sky, not a day cycle + key.append(preset_name); + day_cycle.append(key); + + // Create a sky map consisting of only the sky preset. + std::map<LLWLParamKey, LLWLParamSet> refs; + LLWLParamSet param_set; + param_set.setAll(params); + refs[LLWLParamKey(preset_name, LLEnvKey::SCOPE_LOCAL)] = param_set; // scope doesn't matter here + sky_map = LLWLParamManager::createSkyMap(refs); + + // Remember the sun angle to set fixed region sun hour below. + sun_angle = param_set.getSunAngle(); + } + else // use day cycle + { + LL_DEBUGS("Windlight") << "Use day cycle" << LL_ENDL; + + short scope; // unused + if (!getSelectedDayCycleParams(day_cycle, sky_map, scope)) + { + return; + } + + // If it's a special single-preset day cycle meaning using a fixed sky, + // reset the frame time to a non-negative value, + // so that the region setting is displayed in the floater as + // a day cycle, not a preset. (STORM-1289) + if (day_cycle.size() == 1 && day_cycle[0][0].asReal() < 0.0f) + { + LL_DEBUGS("Windlight") << "Fixing negative time" << LL_ENDL; + day_cycle[0][0] = 0.0f; + } + + // If the day cycle contains exactly one preset (i.e it's effectively a fixed sky), + // remember the preset's sun angle to set fixed region sun hour below. + if (sky_map.size() == 1) + { + LLWLParamSet param_set; + llassert(sky_map.isMap()); + param_set.setAll(sky_map.beginMap()->second); + sun_angle = param_set.getSunAngle(); + } + } + + // Get water params. + if (!getSelectedWaterParams(water_params)) + { + // *TODO: show a notification? + return; + } + } + + // Send settings apply request. + LLEnvironmentSettings new_region_settings; + new_region_settings.saveParams(day_cycle, sky_map, water_params, 0.0f); + if (!LLEnvManagerNew::instance().sendRegionSettings(new_region_settings)) + { + llwarns << "Error applying region environment settings" << llendl; + return; + } + + // Set the region sun phase/flags according to the chosen new preferences. + sendRegionSunUpdate(sun_angle); + + // Start spinning the progress indicator. + setApplyProgress(true); +} + +void LLPanelEnvironmentInfo::onBtnCancel() +{ + // Reload last saved region settings. + refresh(); + + // Apply them. + LLEnvManagerNew& env_mgr = LLEnvManagerNew::instance(); + const LLEnvironmentSettings& cur_settings = env_mgr.getRegionSettings(); + const LLSD& region_day_cycle = cur_settings.getWLDayCycle(); + const LLSD& region_water = cur_settings.getWaterParams(); + env_mgr.useWaterParams(region_water); + env_mgr.useDayCycleParams(region_day_cycle, LLEnvKey::SCOPE_REGION); +} + +void LLPanelEnvironmentInfo::onRegionSettingschange() +{ + LL_DEBUGS("Windlight") << "Region settings changed, refreshing" << LL_ENDL; + refresh(); + + // Stop applying progress indicator (it may be running if it's us who initiated settings update). + setApplyProgress(false); +} + +void LLPanelEnvironmentInfo::onRegionSettingsApplied(bool ok) +{ + LL_DEBUGS("Windlight") << "Applying region settings finished, stopping indicator" << LL_ENDL; + // If applying new settings has failed, stop the indicator right away. + // Otherwise it will be stopped when we receive the updated settings from server. + if (!ok) + { + setApplyProgress(false); + + // We need to re-request environment setting here, + // otherwise our subsequent attempts to change region settings will fail with the following error: + // "Unable to update environment settings because the last update your viewer saw was not the same + // as the last update sent from the simulator. Try sending your update again, and if this + // does not work, try leaving and returning to the region." + LLEnvManagerNew::instance().requestRegionSettings(); + } +} diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 2b87c27fcf..4809937324 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -46,6 +46,7 @@ class LLInventoryItem; class LLCheckBoxCtrl; class LLComboBox; class LLNameListCtrl; +class LLRadioGroup; class LLSliderCtrl; class LLSpinCtrl; class LLTextBox; @@ -53,11 +54,17 @@ class LLVFS; class LLPanelRegionGeneralInfo; class LLPanelRegionDebugInfo; -class LLPanelRegionTextureInfo; class LLPanelRegionTerrainInfo; class LLPanelEstateInfo; class LLPanelEstateCovenant; +class LLEventTimer; +class LLEnvironmentSettings; +class LLWLParamManager; +class LLWaterParamManager; +class LLWLParamSet; +class LLWaterParamSet; + class LLFloaterRegionInfo : public LLFloater { friend class LLFloaterReg; @@ -79,6 +86,7 @@ public: static LLPanelEstateInfo* getPanelEstate(); static LLPanelEstateCovenant* getPanelCovenant(); + static LLPanelRegionTerrainInfo* getPanelRegionTerrain(); // from LLPanel virtual void refresh(); @@ -96,6 +104,7 @@ private: boost::signals2::connection mConsoleReplySignalConnection;; protected: + void onTabSelected(const LLSD& param); void refreshFromRegion(LLViewerRegion* region); // member data @@ -208,44 +217,25 @@ private: ///////////////////////////////////////////////////////////////////////////// -class LLPanelRegionTextureInfo : public LLPanelRegionInfo +class LLPanelRegionTerrainInfo : public LLPanelRegionInfo { + LOG_CLASS(LLPanelRegionTerrainInfo); + public: - LLPanelRegionTextureInfo(); - ~LLPanelRegionTextureInfo() {} - - virtual bool refreshFromRegion(LLViewerRegion* region); - - // LLPanel && LLView - virtual BOOL postBuild(); + LLPanelRegionTerrainInfo() : LLPanelRegionInfo() {} + ~LLPanelRegionTerrainInfo() {} -protected: - virtual BOOL sendUpdate(); + virtual BOOL postBuild(); // LLPanel - static void onClickDump(void* data); - BOOL validateTextureSizes(); -}; + virtual bool refreshFromRegion(LLViewerRegion* region); // refresh local settings from region update from simulator + void setEnvControls(bool available); // Whether environment settings are available for this region -///////////////////////////////////////////////////////////////////////////// + BOOL validateTextureSizes(); -class LLPanelRegionTerrainInfo : public LLPanelRegionInfo -{ -public: - LLPanelRegionTerrainInfo() - : LLPanelRegionInfo() {} - ~LLPanelRegionTerrainInfo() {} - // LLPanel - virtual BOOL postBuild(); + //static void onChangeAnything(LLUICtrl* ctrl, void* userData); // callback for any change, to enable commit button - virtual bool refreshFromRegion(LLViewerRegion* region); - -protected: virtual BOOL sendUpdate(); - void onChangeUseEstateTime(); - void onChangeFixedSun(); - void onChangeSunHour(); - static void onClickDownloadRaw(void*); static void onClickUploadRaw(void*); static void onClickBakeTerrain(void*); @@ -319,10 +309,10 @@ public: BOOL getGlobalTime(); void setGlobalTime(bool b); - BOOL getFixedSun(); + BOOL getFixedSun(); // *TODO: deprecated - F32 getSunHour(); - void setSunHour(F32 sun_hour); + F32 getSunHour(); // *TODO: deprecated + void setSunHour(F32 sun_hour); // *TODO: deprecated const std::string getEstateName() const; void setEstateName(const std::string& name); @@ -337,7 +327,6 @@ public: // If visible from mainland, allowed agent and allowed groups // are ignored, so must disable UI. void setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban); - protected: virtual BOOL sendUpdate(); // confirmation dialog callback @@ -417,4 +406,62 @@ protected: EAssetStatus mAssetStatus; }; +///////////////////////////////////////////////////////////////////////////// + +class LLPanelEnvironmentInfo : public LLPanelRegionInfo +{ + LOG_CLASS(LLPanelEnvironmentInfo); + +public: + LLPanelEnvironmentInfo(); + + // LLPanel + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + // LLView + /*virtual*/ void handleVisibilityChange(BOOL new_visibility); + + // LLPanelRegionInfo + /*virtual*/ bool refreshFromRegion(LLViewerRegion* region); + +private: + void refresh(); + void setControlsEnabled(bool enabled); + void setApplyProgress(bool started); + void setDirty(bool dirty); + + void sendRegionSunUpdate(F32 sun_angle); + + void populateWaterPresetsList(); + void populateSkyPresetsList(); + void populateDayCyclesList(); + + bool getSelectedWaterParams(LLSD& water_params); + bool getSelectedSkyParams(LLSD& sky_params, std::string& preset_name); + bool getSelectedDayCycleParams(LLSD& day_cycle, LLSD& sky_map, short& scope); + + void onSwitchRegionSettings(); + void onSwitchDayCycle(); + + void onSelectWaterPreset(); + void onSelectSkyPreset(); + void onSelectDayCycle(); + + void onBtnApply(); + void onBtnCancel(); + + void onRegionSettingschange(); + void onRegionSettingsApplied(bool ok); + + bool mEnableEditing; + + LLRadioGroup* mRegionSettingsRadioGroup; + LLRadioGroup* mDayCycleSettingsRadioGroup; + + LLComboBox* mWaterPresetCombo; + LLComboBox* mSkyPresetCombo; + LLComboBox* mDayCyclePresetCombo; +}; + #endif diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp deleted file mode 100644 index be4b144f41..0000000000 --- a/indra/newview/llfloaterwater.cpp +++ /dev/null @@ -1,625 +0,0 @@ -/** - * @file llfloaterwater.cpp - * @brief LLFloaterWater class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterwater.h" - -#include "pipeline.h" -#include "llsky.h" - -#include "llfloaterreg.h" -#include "llsliderctrl.h" -#include "llspinctrl.h" -#include "llcolorswatch.h" -#include "llcheckboxctrl.h" -#include "lltexturectrl.h" -#include "lluictrlfactory.h" -#include "llviewercamera.h" -#include "llcombobox.h" -#include "lllineeditor.h" -#include "llnotificationsutil.h" -#include "llfloaterdaycycle.h" -#include "llboost.h" -#include "llmultisliderctrl.h" - -#include "v4math.h" -#include "llviewerdisplay.h" -#include "llviewercontrol.h" -#include "llviewerwindow.h" -#include "llsavedsettingsglue.h" - -#include "llwaterparamset.h" -#include "llwaterparammanager.h" -#include "llpostprocess.h" - -#undef max - -std::set<std::string> LLFloaterWater::sDefaultPresets; - -LLFloaterWater::LLFloaterWater(const LLSD& key) - : LLFloater(key) -{ -} - -LLFloaterWater::~LLFloaterWater() -{ -} -BOOL LLFloaterWater::postBuild() -{ - - std::string def_water = getString("WLDefaultWaterNames"); - - // no editing or deleting of the blank string - sDefaultPresets.insert(""); - boost_tokenizer tokens(def_water, boost::char_separator<char>(":")); - for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) - { - std::string tok(*token_iter); - sDefaultPresets.insert(tok); - } - - // add the combo boxes - LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); - - if(comboBox != NULL) { - - std::map<std::string, LLWaterParamSet>::iterator mIt = - LLWaterParamManager::instance()->mParamList.begin(); - for(; mIt != LLWaterParamManager::instance()->mParamList.end(); mIt++) - { - comboBox->add(mIt->first); - } - - // set defaults on combo boxes - comboBox->selectByValue(LLSD("Default")); - } - // load it up - initCallbacks(); - syncMenu(); - return TRUE; -} -void LLFloaterWater::initCallbacks(void) { - - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - - getChild<LLUICtrl>("WaterFogColor")->setCommitCallback(boost::bind(&LLFloaterWater::onWaterFogColorMoved, this, _1, ¶m_mgr->mFogColor)); - - // - getChild<LLUICtrl>("WaterGlow")->setCommitCallback(boost::bind(&LLFloaterWater::onColorControlAMoved, this, _1, ¶m_mgr->mFogColor)); - - // fog density - getChild<LLUICtrl>("WaterFogDensity")->setCommitCallback(boost::bind(&LLFloaterWater::onExpFloatControlMoved, this, _1, ¶m_mgr->mFogDensity)); - getChild<LLUICtrl>("WaterUnderWaterFogMod")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mUnderWaterFogMod)); - - // blue density - getChild<LLUICtrl>("WaterNormalScaleX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlXMoved, this, _1, ¶m_mgr->mNormalScale)); - getChild<LLUICtrl>("WaterNormalScaleY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlYMoved, this, _1, ¶m_mgr->mNormalScale)); - getChild<LLUICtrl>("WaterNormalScaleZ")->setCommitCallback(boost::bind(&LLFloaterWater::onVector3ControlZMoved, this, _1, ¶m_mgr->mNormalScale)); - - // fresnel - getChild<LLUICtrl>("WaterFresnelScale")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mFresnelScale)); - getChild<LLUICtrl>("WaterFresnelOffset")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mFresnelOffset)); - - // scale above/below - getChild<LLUICtrl>("WaterScaleAbove")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mScaleAbove)); - getChild<LLUICtrl>("WaterScaleBelow")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mScaleBelow)); - - // blur mult - getChild<LLUICtrl>("WaterBlurMult")->setCommitCallback(boost::bind(&LLFloaterWater::onFloatControlMoved, this, _1, ¶m_mgr->mBlurMultiplier)); - - // Load/save -// getChild<LLUICtrl>("WaterLoadPreset")->setCommitCallback(boost::bind(&LLFloaterWater::onLoadPreset, this)); - getChild<LLUICtrl>("WaterNewPreset")->setCommitCallback(boost::bind(&LLFloaterWater::onNewPreset, this)); - getChild<LLUICtrl>("WaterSavePreset")->setCommitCallback(boost::bind(&LLFloaterWater::onSavePreset, this)); - getChild<LLUICtrl>("WaterDeletePreset")->setCommitCallback(boost::bind(&LLFloaterWater::onDeletePreset, this)); - - // wave direction - getChild<LLUICtrl>("WaterWave1DirX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlXMoved, this, _1, ¶m_mgr->mWave1Dir)); - getChild<LLUICtrl>("WaterWave1DirY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlYMoved, this, _1, ¶m_mgr->mWave1Dir)); - getChild<LLUICtrl>("WaterWave2DirX")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlXMoved, this, _1, ¶m_mgr->mWave2Dir)); - getChild<LLUICtrl>("WaterWave2DirY")->setCommitCallback(boost::bind(&LLFloaterWater::onVector2ControlYMoved, this, _1, ¶m_mgr->mWave2Dir)); - - getChild<LLUICtrl>("WaterPresetsCombo")->setCommitCallback(boost::bind(&LLFloaterWater::onChangePresetName, this, _1)); - - LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); - textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); - getChild<LLUICtrl>("WaterNormalMap")->setCommitCallback(boost::bind(&LLFloaterWater::onNormalMapPicked, this, _1)); -} - -bool LLFloaterWater::newPromptCallback(const LLSD& notification, const LLSD& response) -{ - std::string text = response["message"].asString(); - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if(text == "") - { - return false; - } - - if(option == 0) { - LLComboBox* comboBox = getChild<LLComboBox>( "WaterPresetsCombo"); - - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - - // add the current parameters to the list - // see if it's there first - std::map<std::string, LLWaterParamSet>::iterator mIt = - param_mgr->mParamList.find(text); - - // if not there, add a new one - if(mIt == param_mgr->mParamList.end()) - { - param_mgr->addParamSet(text, param_mgr->mCurParams); - comboBox->add(text); - comboBox->sortByName(); - - comboBox->setSelectedByValue(text, true); - - param_mgr->savePreset(text); - - // otherwise, send a message to the user - } - else - { - LLNotificationsUtil::add("ExistsWaterPresetAlert"); - } - } - return false; -} - -void LLFloaterWater::syncMenu() -{ - bool err; - - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - - LLWaterParamSet & current_params = param_mgr->mCurParams; - - // blue horizon - param_mgr->mFogColor = current_params.getVector4(param_mgr->mFogColor.mName, err); - - LLColor4 col = param_mgr->getFogColor(); - getChild<LLUICtrl>("WaterGlow")->setValue(col.mV[3]); - col.mV[3] = 1.0f; - LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("WaterFogColor"); - - colCtrl->set(col); - - // fog and wavelets - param_mgr->mFogDensity.mExp = - log(current_params.getFloat(param_mgr->mFogDensity.mName, err)) / - log(param_mgr->mFogDensity.mBase); - param_mgr->setDensitySliderValue(param_mgr->mFogDensity.mExp); - getChild<LLUICtrl>("WaterFogDensity")->setValue(param_mgr->mFogDensity.mExp); - - param_mgr->mUnderWaterFogMod.mX = - current_params.getFloat(param_mgr->mUnderWaterFogMod.mName, err); - getChild<LLUICtrl>("WaterUnderWaterFogMod")->setValue(param_mgr->mUnderWaterFogMod.mX); - - param_mgr->mNormalScale = current_params.getVector3(param_mgr->mNormalScale.mName, err); - getChild<LLUICtrl>("WaterNormalScaleX")->setValue(param_mgr->mNormalScale.mX); - getChild<LLUICtrl>("WaterNormalScaleY")->setValue(param_mgr->mNormalScale.mY); - getChild<LLUICtrl>("WaterNormalScaleZ")->setValue(param_mgr->mNormalScale.mZ); - - // Fresnel - param_mgr->mFresnelScale.mX = current_params.getFloat(param_mgr->mFresnelScale.mName, err); - getChild<LLUICtrl>("WaterFresnelScale")->setValue(param_mgr->mFresnelScale.mX); - param_mgr->mFresnelOffset.mX = current_params.getFloat(param_mgr->mFresnelOffset.mName, err); - getChild<LLUICtrl>("WaterFresnelOffset")->setValue(param_mgr->mFresnelOffset.mX); - - // Scale Above/Below - param_mgr->mScaleAbove.mX = current_params.getFloat(param_mgr->mScaleAbove.mName, err); - getChild<LLUICtrl>("WaterScaleAbove")->setValue(param_mgr->mScaleAbove.mX); - param_mgr->mScaleBelow.mX = current_params.getFloat(param_mgr->mScaleBelow.mName, err); - getChild<LLUICtrl>("WaterScaleBelow")->setValue(param_mgr->mScaleBelow.mX); - - // blur mult - param_mgr->mBlurMultiplier.mX = current_params.getFloat(param_mgr->mBlurMultiplier.mName, err); - getChild<LLUICtrl>("WaterBlurMult")->setValue(param_mgr->mBlurMultiplier.mX); - - // wave directions - param_mgr->mWave1Dir = current_params.getVector2(param_mgr->mWave1Dir.mName, err); - getChild<LLUICtrl>("WaterWave1DirX")->setValue(param_mgr->mWave1Dir.mX); - getChild<LLUICtrl>("WaterWave1DirY")->setValue(param_mgr->mWave1Dir.mY); - - param_mgr->mWave2Dir = current_params.getVector2(param_mgr->mWave2Dir.mName, err); - getChild<LLUICtrl>("WaterWave2DirX")->setValue(param_mgr->mWave2Dir.mX); - getChild<LLUICtrl>("WaterWave2DirY")->setValue(param_mgr->mWave2Dir.mY); - - LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); - textCtrl->setImageAssetID(param_mgr->getNormalMapID()); -} - - -// vector control callbacks -void LLFloaterWater::onVector3ControlXMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - vectorControl->mX = sldrCtrl->getValueF32(); - - vectorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -// vector control callbacks -void LLFloaterWater::onVector3ControlYMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - vectorControl->mY = sldrCtrl->getValueF32(); - - vectorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -// vector control callbacks -void LLFloaterWater::onVector3ControlZMoved(LLUICtrl* ctrl, WaterVector3Control* vectorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - vectorControl->mZ = sldrCtrl->getValueF32(); - - vectorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - - -// vector control callbacks -void LLFloaterWater::onVector2ControlXMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - vectorControl->mX = sldrCtrl->getValueF32(); - - vectorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -// vector control callbacks -void LLFloaterWater::onVector2ControlYMoved(LLUICtrl* ctrl, WaterVector2Control* vectorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - vectorControl->mY = sldrCtrl->getValueF32(); - - vectorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -// color control callbacks -void LLFloaterWater::onColorControlRMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->mR = sldrCtrl->getValueF32(); - - // move i if it's the max - if(colorControl->mR >= colorControl->mG - && colorControl->mR >= colorControl->mB - && colorControl->mHasSliderName) - { - colorControl->mI = colorControl->mR; - std::string name = colorControl->mSliderName; - name.append("I"); - - getChild<LLUICtrl>(name)->setValue(colorControl->mR); - } - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onColorControlGMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->mG = sldrCtrl->getValueF32(); - - // move i if it's the max - if(colorControl->mG >= colorControl->mR - && colorControl->mG >= colorControl->mB - && colorControl->mHasSliderName) - { - colorControl->mI = colorControl->mG; - std::string name = colorControl->mSliderName; - name.append("I"); - - getChild<LLUICtrl>(name)->setValue(colorControl->mG); - - } - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onColorControlBMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->mB = sldrCtrl->getValueF32(); - - // move i if it's the max - if(colorControl->mB >= colorControl->mR - && colorControl->mB >= colorControl->mG - && colorControl->mHasSliderName) - { - colorControl->mI = colorControl->mB; - std::string name = colorControl->mSliderName; - name.append("I"); - - getChild<LLUICtrl>(name)->setValue(colorControl->mB); - } - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onColorControlAMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->mA = sldrCtrl->getValueF32(); - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - - LLWaterParamManager::instance()->propagateParameters(); -} - - -void LLFloaterWater::onColorControlIMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->mI = sldrCtrl->getValueF32(); - - // only for sliders where we pass a name - if(colorControl->mHasSliderName) - { - // set it to the top - F32 maxVal = std::max(std::max(colorControl->mR, colorControl->mG), colorControl->mB); - F32 iVal; - - iVal = colorControl->mI; - - // get the names of the other sliders - std::string rName = colorControl->mSliderName; - rName.append("R"); - std::string gName = colorControl->mSliderName; - gName.append("G"); - std::string bName = colorControl->mSliderName; - bName.append("B"); - - // handle if at 0 - if(iVal == 0) - { - colorControl->mR = 0; - colorControl->mG = 0; - colorControl->mB = 0; - - // if all at the start - // set them all to the intensity - } - else if (maxVal == 0) - { - colorControl->mR = iVal; - colorControl->mG = iVal; - colorControl->mB = iVal; - } - else - { - // add delta amounts to each - F32 delta = (iVal - maxVal) / maxVal; - colorControl->mR *= (1.0f + delta); - colorControl->mG *= (1.0f + delta); - colorControl->mB *= (1.0f + delta); - } - - // set the sliders to the new vals - getChild<LLUICtrl>(rName)->setValue(colorControl->mR); - getChild<LLUICtrl>(gName)->setValue(colorControl->mG); - getChild<LLUICtrl>(bName)->setValue(colorControl->mB); - } - - // now update the current parameters and send them to shaders - colorControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onExpFloatControlMoved(LLUICtrl* ctrl, WaterExpFloatControl* expFloatControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - F32 val = sldrCtrl->getValueF32(); - expFloatControl->mExp = val; - LLWaterParamManager::instance()->setDensitySliderValue(val); - - expFloatControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onFloatControlMoved(LLUICtrl* ctrl, WaterFloatControl* floatControl) -{ - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - floatControl->mX = sldrCtrl->getValueF32() / floatControl->mMult; - - floatControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} -void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* colorControl) -{ - LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl); - *colorControl = swatch->get(); - - colorControl->update(LLWaterParamManager::instance()->mCurParams); - LLWaterParamManager::instance()->propagateParameters(); -} - -void LLFloaterWater::onNormalMapPicked(LLUICtrl* ctrl) -{ - LLTextureCtrl* textCtrl = static_cast<LLTextureCtrl*>(ctrl); - LLUUID textID = textCtrl->getImageAssetID(); - LLWaterParamManager::instance()->setNormalMapID(textID); -} - -void LLFloaterWater::onNewPreset() -{ - LLNotificationsUtil::add("NewWaterPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWater::newPromptCallback, this, _1, _2)); -} - -void LLFloaterWater::onSavePreset() -{ - // get the name - LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); - - // don't save the empty name - if(comboBox->getSelectedItemLabel() == "") - { - return; - } - - LLWaterParamManager::instance()->mCurParams.mName = - comboBox->getSelectedItemLabel(); - - // check to see if it's a default and shouldn't be overwritten - std::set<std::string>::iterator sIt = sDefaultPresets.find( - comboBox->getSelectedItemLabel()); - if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("WaterEditPresets")) - { - LLNotificationsUtil::add("WLNoEditDefault"); - return; - } - - LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWater::saveAlertCallback, this, _1, _2)); -} - -bool LLFloaterWater::saveAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - // if they choose save, do it. Otherwise, don't do anything - if(option == 0) - { - LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); - - param_mgr->setParamSet( - param_mgr->mCurParams.mName, - param_mgr->mCurParams); - - // comment this back in to save to file - param_mgr->savePreset(param_mgr->mCurParams.mName); - } - return false; -} - -void LLFloaterWater::onDeletePreset() -{ - LLComboBox* combo_box = getChild<LLComboBox>("WaterPresetsCombo"); - - if(combo_box->getSelectedValue().asString() == "") - { - return; - } - - LLSD args; - args["SKY"] = combo_box->getSelectedValue().asString(); - LLNotificationsUtil::add("WLDeletePresetAlert", args, LLSD(), boost::bind(&LLFloaterWater::deleteAlertCallback, this, _1, _2)); -} - -bool LLFloaterWater::deleteAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - // if they choose delete, do it. Otherwise, don't do anything - if(option == 0) - { - LLComboBox* combo_box = getChild<LLComboBox>("WaterPresetsCombo"); - LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); - LLComboBox* key_combo = NULL; - - if (day_cycle) - { - key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); - } - - std::string name = combo_box->getSelectedValue().asString(); - - // check to see if it's a default and shouldn't be deleted - std::set<std::string>::iterator sIt = sDefaultPresets.find(name); - if(sIt != sDefaultPresets.end()) - { - LLNotificationsUtil::add("WaterNoEditDefault"); - return false; - } - - LLWaterParamManager::instance()->removeParamSet(name, true); - - // remove and choose another - S32 new_index = combo_box->getCurrentIndex(); - - combo_box->remove(name); - - if(key_combo != NULL) - { - key_combo->remove(name); - - // remove from slider, as well - day_cycle->deletePreset(name); - } - - // pick the previously selected index after delete - if(new_index > 0) - { - new_index--; - } - - if(combo_box->getItemCount() > 0) - { - combo_box->setCurrentByIndex(new_index); - } - } - return false; -} - - -void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl) -{ - std::string data = ctrl->getValue().asString(); - if(!data.empty()) - { - LLWaterParamManager::instance()->loadPreset(data); - syncMenu(); - } -} - diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 058567492b..43eecbf048 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -99,7 +99,7 @@ void LLFloaterWebContent::initializeURLHistory() } //static -void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid ) +void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid, bool show_chrome, const LLRect& preferred_media_size) { lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; @@ -155,6 +155,20 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar // tell the browser instance to load the specified URL browser->open_media(url, target); LLViewerMedia::proxyWindowOpened(target, uuid); + + browser->getChild<LLLayoutPanel>("status_bar")->setVisible(show_chrome); + browser->getChild<LLLayoutPanel>("nav_controls")->setVisible(show_chrome); + + if (!show_chrome) + { + browser->setResizeLimits(100, 100); + } + + if (!preferred_media_size.isEmpty()) + { + //ignore x, y for now + browser->geometryChanged(browser->getRect().mLeft, browser->getRect().mBottom, preferred_media_size.getWidth(), preferred_media_size.getHeight()); + } } } @@ -210,7 +224,7 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) lldebugs << "geometry change: " << geom << llendl; - handleReshape(geom,false); + setShape(geom); } void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index ecc7e970d8..56b6ef12c8 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -46,7 +46,7 @@ public: void initializeURLHistory(); - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); + static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null, bool show_chrome = true, const LLRect& preferred_media_size = LLRect() ); static void closeRequest(const std::string &uuid); static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp deleted file mode 100644 index ae98b2cf99..0000000000 --- a/indra/newview/llfloaterwindlight.cpp +++ /dev/null @@ -1,875 +0,0 @@ -/** - * @file llfloaterwindlight.cpp - * @brief LLFloaterWindLight class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterwindlight.h" - -#include "pipeline.h" -#include "llsky.h" - -#include "llfloaterreg.h" -#include "llsliderctrl.h" -#include "llmultislider.h" -#include "llmultisliderctrl.h" -#include "llnotificationsutil.h" -#include "llspinctrl.h" -#include "llcheckboxctrl.h" -#include "lluictrlfactory.h" -#include "llviewercamera.h" -#include "llcombobox.h" -#include "lllineeditor.h" -#include "llfloaterdaycycle.h" -#include "llboost.h" - -#include "v4math.h" -#include "llviewerdisplay.h" -#include "llviewercontrol.h" -#include "llviewerwindow.h" -#include "llsavedsettingsglue.h" - -#include "llwlparamset.h" -#include "llwlparammanager.h" -#include "llpostprocess.h" -#include "lltabcontainer.h" - - -#undef max - -std::set<std::string> LLFloaterWindLight::sDefaultPresets; - -static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; - -LLFloaterWindLight::LLFloaterWindLight(const LLSD& key) - : LLFloater(key) -{ -} - -LLFloaterWindLight::~LLFloaterWindLight() -{ -} - -BOOL LLFloaterWindLight::postBuild() -{ - // add the list of presets - std::string def_days = getString("WLDefaultSkyNames"); - - // no editing or deleting of the blank string - sDefaultPresets.insert(""); - boost_tokenizer tokens(def_days, boost::char_separator<char>(":")); - for (boost_tokenizer::iterator token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) - { - std::string tok(*token_iter); - sDefaultPresets.insert(tok); - } - - // add the combo boxes - LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); - - if(comboBox != NULL) { - - std::map<std::string, LLWLParamSet>::iterator mIt = - LLWLParamManager::instance()->mParamList.begin(); - for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) - { - comboBox->add(mIt->first); - } - - // entry for when we're in estate time - comboBox->add(LLStringUtil::null); - - // set defaults on combo boxes - comboBox->selectByValue(LLSD("Default")); - } - // load it up - initCallbacks(); - - syncMenu(); - - return TRUE; -} -void LLFloaterWindLight::initCallbacks(void) { - - LLWLParamManager * param_mgr = LLWLParamManager::instance(); - - // blue horizon - getChild<LLUICtrl>("WLBlueHorizonR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mBlueHorizon)); - getChild<LLUICtrl>("WLBlueHorizonG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mBlueHorizon)); - getChild<LLUICtrl>("WLBlueHorizonB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mBlueHorizon)); - getChild<LLUICtrl>("WLBlueHorizonI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mBlueHorizon)); - - // haze density, horizon, mult, and altitude - getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mHazeDensity)); - getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mHazeHorizon)); - getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mDensityMult)); - getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mMaxAlt)); - - // blue density - getChild<LLUICtrl>("WLBlueDensityR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mBlueDensity)); - getChild<LLUICtrl>("WLBlueDensityG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mBlueDensity)); - getChild<LLUICtrl>("WLBlueDensityB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mBlueDensity)); - getChild<LLUICtrl>("WLBlueDensityI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mBlueDensity)); - - // Lighting - - // sunlight - getChild<LLUICtrl>("WLSunlightR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mSunlight)); - getChild<LLUICtrl>("WLSunlightG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mSunlight)); - getChild<LLUICtrl>("WLSunlightB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mSunlight)); - getChild<LLUICtrl>("WLSunlightI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mSunlight)); - - // glow - getChild<LLUICtrl>("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onGlowRMoved, this, _1, ¶m_mgr->mGlow)); - getChild<LLUICtrl>("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onGlowBMoved, this, _1, ¶m_mgr->mGlow)); - - // ambient - getChild<LLUICtrl>("WLAmbientR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mAmbient)); - getChild<LLUICtrl>("WLAmbientG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mAmbient)); - getChild<LLUICtrl>("WLAmbientB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mAmbient)); - getChild<LLUICtrl>("WLAmbientI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mAmbient)); - - // time of day - getChild<LLUICtrl>("WLSunAngle")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSunMoved, this, _1, ¶m_mgr->mLightnorm)); - getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSunMoved, this, _1, ¶m_mgr->mLightnorm)); - - // Clouds - - // Cloud Color - getChild<LLUICtrl>("WLCloudColorR")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudColor)); - getChild<LLUICtrl>("WLCloudColorG")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudColor)); - getChild<LLUICtrl>("WLCloudColorB")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudColor)); - getChild<LLUICtrl>("WLCloudColorI")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlIMoved, this, _1, ¶m_mgr->mCloudColor)); - - // Cloud - getChild<LLUICtrl>("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudMain)); - getChild<LLUICtrl>("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudMain)); - getChild<LLUICtrl>("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudMain)); - - // Cloud Detail - getChild<LLUICtrl>("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlRMoved, this, _1, ¶m_mgr->mCloudDetail)); - getChild<LLUICtrl>("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlGMoved, this, _1, ¶m_mgr->mCloudDetail)); - getChild<LLUICtrl>("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterWindLight::onColorControlBMoved, this, _1, ¶m_mgr->mCloudDetail)); - - // Cloud extras - getChild<LLUICtrl>("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mCloudCoverage)); - getChild<LLUICtrl>("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mCloudScale)); - getChild<LLUICtrl>("WLCloudLockX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollXToggled, this, _1)); - getChild<LLUICtrl>("WLCloudLockY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollYToggled, this, _1)); - getChild<LLUICtrl>("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollXMoved, this, _1)); - getChild<LLUICtrl>("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterWindLight::onCloudScrollYMoved, this, _1)); - getChild<LLUICtrl>("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mDistanceMult)); - getChild<LLUICtrl>("DrawClassicClouds")->setCommitCallback(boost::bind(LLSavedSettingsGlue::setBOOL, _1, "SkyUseClassicClouds")); - - // WL Top - getChild<LLUICtrl>("WLDayCycleMenuButton")->setCommitCallback(boost::bind(&LLFloaterWindLight::onOpenDayCycle, this)); - // Load/save - LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); - - //childSetAction("WLLoadPreset", onLoadPreset, comboBox); - getChild<LLUICtrl>("WLNewPreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onNewPreset, this)); - getChild<LLUICtrl>("WLSavePreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onSavePreset, this)); - getChild<LLUICtrl>("WLDeletePreset")->setCommitCallback(boost::bind(&LLFloaterWindLight::onDeletePreset, this)); - - comboBox->setCommitCallback(boost::bind(&LLFloaterWindLight::onChangePresetName, this, _1)); - - - // Dome - getChild<LLUICtrl>("WLGamma")->setCommitCallback(boost::bind(&LLFloaterWindLight::onFloatControlMoved, this, _1, ¶m_mgr->mWLGamma)); - getChild<LLUICtrl>("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterWindLight::onStarAlphaMoved, this, _1)); -} - -bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) -{ - std::string text = response["message"].asString(); - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if(text == "") - { - return false; - } - - if(option == 0) { - LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); - - LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); - LLComboBox* keyCombo = NULL; - if(day_cycle) - { - keyCombo = day_cycle->getChild<LLComboBox>("WLKeyPresets"); - } - - // add the current parameters to the list - // see if it's there first - std::map<std::string, LLWLParamSet>::iterator mIt = - LLWLParamManager::instance()->mParamList.find(text); - - // if not there, add a new one - if(mIt == LLWLParamManager::instance()->mParamList.end()) - { - LLWLParamManager::instance()->addParamSet(text, - LLWLParamManager::instance()->mCurParams); - comboBox->add(text); - comboBox->sortByName(); - - // add a blank to the bottom - comboBox->selectFirstItem(); - if(comboBox->getSimple() == "") - { - comboBox->remove(0); - } - comboBox->add(LLStringUtil::null); - - comboBox->setSelectedByValue(text, true); - if(keyCombo) - { - keyCombo->add(text); - keyCombo->sortByName(); - } - LLWLParamManager::instance()->savePreset(text); - - // otherwise, send a message to the user - } - else - { - LLNotificationsUtil::add("ExistsSkyPresetAlert"); - } - } - return false; -} - -void LLFloaterWindLight::syncMenu() -{ - bool err; - - LLWLParamManager * param_mgr = LLWLParamManager::instance(); - - LLWLParamSet& currentParams = param_mgr->mCurParams; - //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues; - - // blue horizon - param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); - getChild<LLUICtrl>("WLBlueHorizonR")->setValue(param_mgr->mBlueHorizon.r / 2.0); - getChild<LLUICtrl>("WLBlueHorizonG")->setValue(param_mgr->mBlueHorizon.g / 2.0); - getChild<LLUICtrl>("WLBlueHorizonB")->setValue(param_mgr->mBlueHorizon.b / 2.0); - getChild<LLUICtrl>("WLBlueHorizonI")->setValue( - std::max(param_mgr->mBlueHorizon.r / 2.0, - std::max(param_mgr->mBlueHorizon.g / 2.0, - param_mgr->mBlueHorizon.b / 2.0))); - - // haze density, horizon, mult, and altitude - param_mgr->mHazeDensity = currentParams.getVector(param_mgr->mHazeDensity.mName, err); - getChild<LLUICtrl>("WLHazeDensity")->setValue(param_mgr->mHazeDensity.r); - param_mgr->mHazeHorizon = currentParams.getVector(param_mgr->mHazeHorizon.mName, err); - getChild<LLUICtrl>("WLHazeHorizon")->setValue(param_mgr->mHazeHorizon.r); - param_mgr->mDensityMult = currentParams.getVector(param_mgr->mDensityMult.mName, err); - getChild<LLUICtrl>("WLDensityMult")->setValue(param_mgr->mDensityMult.x * - param_mgr->mDensityMult.mult); - param_mgr->mMaxAlt = currentParams.getVector(param_mgr->mMaxAlt.mName, err); - getChild<LLUICtrl>("WLMaxAltitude")->setValue(param_mgr->mMaxAlt.x); - - // blue density - param_mgr->mBlueDensity = currentParams.getVector(param_mgr->mBlueDensity.mName, err); - getChild<LLUICtrl>("WLBlueDensityR")->setValue(param_mgr->mBlueDensity.r / 2.0); - getChild<LLUICtrl>("WLBlueDensityG")->setValue(param_mgr->mBlueDensity.g / 2.0); - getChild<LLUICtrl>("WLBlueDensityB")->setValue(param_mgr->mBlueDensity.b / 2.0); - getChild<LLUICtrl>("WLBlueDensityI")->setValue( - std::max(param_mgr->mBlueDensity.r / 2.0, - std::max(param_mgr->mBlueDensity.g / 2.0, param_mgr->mBlueDensity.b / 2.0))); - - // Lighting - - // sunlight - param_mgr->mSunlight = currentParams.getVector(param_mgr->mSunlight.mName, err); - getChild<LLUICtrl>("WLSunlightR")->setValue(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLSunlightG")->setValue(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLSunlightB")->setValue(param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLSunlightI")->setValue( - std::max(param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE, - std::max(param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE))); - - // glow - param_mgr->mGlow = currentParams.getVector(param_mgr->mGlow.mName, err); - getChild<LLUICtrl>("WLGlowR")->setValue(2 - param_mgr->mGlow.r / 20.0f); - getChild<LLUICtrl>("WLGlowB")->setValue(-param_mgr->mGlow.b / 5.0f); - - // ambient - param_mgr->mAmbient = currentParams.getVector(param_mgr->mAmbient.mName, err); - getChild<LLUICtrl>("WLAmbientR")->setValue(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLAmbientG")->setValue(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLAmbientB")->setValue(param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE); - getChild<LLUICtrl>("WLAmbientI")->setValue( - std::max(param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE, - std::max(param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE, param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE))); - - getChild<LLUICtrl>("WLSunAngle")->setValue(param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI); - getChild<LLUICtrl>("WLEastAngle")->setValue(param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); - - // Clouds - - // Cloud Color - param_mgr->mCloudColor = currentParams.getVector(param_mgr->mCloudColor.mName, err); - getChild<LLUICtrl>("WLCloudColorR")->setValue(param_mgr->mCloudColor.r); - getChild<LLUICtrl>("WLCloudColorG")->setValue(param_mgr->mCloudColor.g); - getChild<LLUICtrl>("WLCloudColorB")->setValue(param_mgr->mCloudColor.b); - getChild<LLUICtrl>("WLCloudColorI")->setValue( - std::max(param_mgr->mCloudColor.r, - std::max(param_mgr->mCloudColor.g, param_mgr->mCloudColor.b))); - - // Cloud - param_mgr->mCloudMain = currentParams.getVector(param_mgr->mCloudMain.mName, err); - getChild<LLUICtrl>("WLCloudX")->setValue(param_mgr->mCloudMain.r); - getChild<LLUICtrl>("WLCloudY")->setValue(param_mgr->mCloudMain.g); - getChild<LLUICtrl>("WLCloudDensity")->setValue(param_mgr->mCloudMain.b); - - // Cloud Detail - param_mgr->mCloudDetail = currentParams.getVector(param_mgr->mCloudDetail.mName, err); - getChild<LLUICtrl>("WLCloudDetailX")->setValue(param_mgr->mCloudDetail.r); - getChild<LLUICtrl>("WLCloudDetailY")->setValue(param_mgr->mCloudDetail.g); - getChild<LLUICtrl>("WLCloudDetailDensity")->setValue(param_mgr->mCloudDetail.b); - - // Cloud extras - param_mgr->mCloudCoverage = currentParams.getVector(param_mgr->mCloudCoverage.mName, err); - param_mgr->mCloudScale = currentParams.getVector(param_mgr->mCloudScale.mName, err); - getChild<LLUICtrl>("WLCloudCoverage")->setValue(param_mgr->mCloudCoverage.x); - getChild<LLUICtrl>("WLCloudScale")->setValue(param_mgr->mCloudScale.x); - - // cloud scrolling - bool lockX = !param_mgr->mCurParams.getEnableCloudScrollX(); - bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); - getChild<LLUICtrl>("WLCloudLockX")->setValue(lockX); - getChild<LLUICtrl>("WLCloudLockY")->setValue(lockY); - getChild<LLUICtrl>("DrawClassicClouds")->setValue(gSavedSettings.getBOOL("SkyUseClassicClouds")); - - // disable if locked, enable if not - if(lockX) - { - getChildView("WLCloudScrollX")->setEnabled(FALSE); - } else { - getChildView("WLCloudScrollX")->setEnabled(TRUE); - } - if(lockY) - { - getChildView("WLCloudScrollY")->setEnabled(FALSE); - } else { - getChildView("WLCloudScrollY")->setEnabled(TRUE); - } - - // *HACK cloud scrolling is off my an additive of 10 - getChild<LLUICtrl>("WLCloudScrollX")->setValue(param_mgr->mCurParams.getCloudScrollX() - 10.0f); - getChild<LLUICtrl>("WLCloudScrollY")->setValue(param_mgr->mCurParams.getCloudScrollY() - 10.0f); - - param_mgr->mDistanceMult = currentParams.getVector(param_mgr->mDistanceMult.mName, err); - getChild<LLUICtrl>("WLDistanceMult")->setValue(param_mgr->mDistanceMult.x); - - // Tweak extras - - param_mgr->mWLGamma = currentParams.getVector(param_mgr->mWLGamma.mName, err); - getChild<LLUICtrl>("WLGamma")->setValue(param_mgr->mWLGamma.x); - - getChild<LLUICtrl>("WLStarAlpha")->setValue(param_mgr->mCurParams.getStarBrightness()); - - LLTabContainer* tab = getChild<LLTabContainer>("WindLight Tabs"); - LLPanel* panel = getChild<LLPanel>("Scattering"); - - tab->enableTabButton(tab->getIndexForPanel(panel), gSavedSettings.getBOOL("RenderDeferredGI")); -} - - -// color control callbacks -void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->r = sldrCtrl->getValueF32(); - if(colorControl->isSunOrAmbientColor) { - colorControl->r *= 3; - } - if(colorControl->isBlueHorizonOrDensity) { - colorControl->r *= 2; - } - - // move i if it's the max - if(colorControl->r >= colorControl->g && colorControl->r >= colorControl->b - && colorControl->hasSliderName) { - colorControl->i = colorControl->r; - std::string name = colorControl->mSliderName; - name.append("I"); - - if(colorControl->isSunOrAmbientColor) { - getChild<LLUICtrl>(name)->setValue(colorControl->r / 3); - } else if(colorControl->isBlueHorizonOrDensity) { - getChild<LLUICtrl>(name)->setValue(colorControl->r / 2); - } else { - getChild<LLUICtrl>(name)->setValue(colorControl->r); - } - } - - colorControl->update(LLWLParamManager::instance()->mCurParams); - - LLWLParamManager::instance()->propagateParameters(); -} - -void LLFloaterWindLight::onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->g = sldrCtrl->getValueF32(); - if(colorControl->isSunOrAmbientColor) { - colorControl->g *= 3; - } - if(colorControl->isBlueHorizonOrDensity) { - colorControl->g *= 2; - } - - // move i if it's the max - if(colorControl->g >= colorControl->r && colorControl->g >= colorControl->b - && colorControl->hasSliderName) { - colorControl->i = colorControl->g; - std::string name = colorControl->mSliderName; - name.append("I"); - - if(colorControl->isSunOrAmbientColor) { - getChild<LLUICtrl>(name)->setValue(colorControl->g / 3); - } else if(colorControl->isBlueHorizonOrDensity) { - getChild<LLUICtrl>(name)->setValue(colorControl->g / 2); - } else { - getChild<LLUICtrl>(name)->setValue(colorControl->g); - } - } - - colorControl->update(LLWLParamManager::instance()->mCurParams); - - LLWLParamManager::instance()->propagateParameters(); -} - -void LLFloaterWindLight::onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->b = sldrCtrl->getValueF32(); - if(colorControl->isSunOrAmbientColor) { - colorControl->b *= 3; - } - if(colorControl->isBlueHorizonOrDensity) { - colorControl->b *= 2; - } - - // move i if it's the max - if(colorControl->b >= colorControl->r && colorControl->b >= colorControl->g - && colorControl->hasSliderName) { - colorControl->i = colorControl->b; - std::string name = colorControl->mSliderName; - name.append("I"); - - if(colorControl->isSunOrAmbientColor) { - getChild<LLUICtrl>(name)->setValue(colorControl->b / 3); - } else if(colorControl->isBlueHorizonOrDensity) { - getChild<LLUICtrl>(name)->setValue(colorControl->b / 2); - } else { - getChild<LLUICtrl>(name)->setValue(colorControl->b); - } - } - - colorControl->update(LLWLParamManager::instance()->mCurParams); - - LLWLParamManager::instance()->propagateParameters(); -} - -void LLFloaterWindLight::onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - colorControl->i = sldrCtrl->getValueF32(); - - // only for sliders where we pass a name - if(colorControl->hasSliderName) { - - // set it to the top - F32 maxVal = std::max(std::max(colorControl->r, colorControl->g), colorControl->b); - F32 iVal; - - if(colorControl->isSunOrAmbientColor) - { - iVal = colorControl->i * 3; - } - else if(colorControl->isBlueHorizonOrDensity) - { - iVal = colorControl->i * 2; - } - else - { - iVal = colorControl->i; - } - - // get the names of the other sliders - std::string rName = colorControl->mSliderName; - rName.append("R"); - std::string gName = colorControl->mSliderName; - gName.append("G"); - std::string bName = colorControl->mSliderName; - bName.append("B"); - - // handle if at 0 - if(iVal == 0) { - colorControl->r = 0; - colorControl->g = 0; - colorControl->b = 0; - - // if all at the start - // set them all to the intensity - } else if (maxVal == 0) { - colorControl->r = iVal; - colorControl->g = iVal; - colorControl->b = iVal; - - } else { - - // add delta amounts to each - F32 delta = (iVal - maxVal) / maxVal; - colorControl->r *= (1.0f + delta); - colorControl->g *= (1.0f + delta); - colorControl->b *= (1.0f + delta); - } - - // divide sun color vals by three - if(colorControl->isSunOrAmbientColor) - { - getChild<LLUICtrl>(rName)->setValue(colorControl->r/3); - getChild<LLUICtrl>(gName)->setValue(colorControl->g/3); - getChild<LLUICtrl>(bName)->setValue(colorControl->b/3); - - } - else if(colorControl->isBlueHorizonOrDensity) - { - getChild<LLUICtrl>(rName)->setValue(colorControl->r/2); - getChild<LLUICtrl>(gName)->setValue(colorControl->g/2); - getChild<LLUICtrl>(bName)->setValue(colorControl->b/2); - - } - else - { - // set the sliders to the new vals - getChild<LLUICtrl>(rName)->setValue(colorControl->r); - getChild<LLUICtrl>(gName)->setValue(colorControl->g); - getChild<LLUICtrl>(bName)->setValue(colorControl->b); - } - } - - // now update the current parameters and send them to shaders - colorControl->update(LLWLParamManager::instance()->mCurParams); - LLWLParamManager::instance()->propagateParameters(); -} - -/// GLOW SPECIFIC CODE -void LLFloaterWindLight::onGlowRMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - // scaled by 20 - colorControl->r = (2 - sldrCtrl->getValueF32()) * 20; - - colorControl->update(LLWLParamManager::instance()->mCurParams); - LLWLParamManager::instance()->propagateParameters(); -} - -/// \NOTE that we want NEGATIVE (-) B -void LLFloaterWindLight::onGlowBMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big - colorControl->b = -sldrCtrl->getValueF32() * 5; - - colorControl->update(LLWLParamManager::instance()->mCurParams); - LLWLParamManager::instance()->propagateParameters(); -} - -void LLFloaterWindLight::onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* floatControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - floatControl->x = sldrCtrl->getValueF32() / floatControl->mult; - - floatControl->update(LLWLParamManager::instance()->mCurParams); - LLWLParamManager::instance()->propagateParameters(); -} - -// Lighting callbacks - -// time of day -void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, WLColorControl* colorControl) -{ - deactivateAnimator(); - - LLSliderCtrl* sunSldr = getChild<LLSliderCtrl>("WLSunAngle"); - LLSliderCtrl* eastSldr = getChild<LLSliderCtrl>("WLEastAngle"); - - // get the two angles - LLWLParamManager * param_mgr = LLWLParamManager::instance(); - - param_mgr->mCurParams.setSunAngle(F_TWO_PI * sunSldr->getValueF32()); - param_mgr->mCurParams.setEastAngle(F_TWO_PI * eastSldr->getValueF32()); - - // set the sun vector - colorControl->r = -sin(param_mgr->mCurParams.getEastAngle()) * - cos(param_mgr->mCurParams.getSunAngle()); - colorControl->g = sin(param_mgr->mCurParams.getSunAngle()); - colorControl->b = cos(param_mgr->mCurParams.getEastAngle()) * - cos(param_mgr->mCurParams.getSunAngle()); - colorControl->i = 1.f; - - colorControl->update(param_mgr->mCurParams); - param_mgr->propagateParameters(); -} - -void LLFloaterWindLight::onStarAlphaMoved(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - LLWLParamManager::instance()->mCurParams.setStarBrightness(sldrCtrl->getValueF32()); -} - -void LLFloaterWindLight::onNewPreset() -{ - LLNotificationsUtil::add("NewSkyPreset", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::newPromptCallback, this, _1, _2)); -} - -void LLFloaterWindLight::onSavePreset() -{ - // get the name - LLComboBox* comboBox = getChild<LLComboBox>( - "WLPresetsCombo"); - - // don't save the empty name - if(comboBox->getSelectedItemLabel() == "") - { - return; - } - - // check to see if it's a default and shouldn't be overwritten - std::set<std::string>::iterator sIt = sDefaultPresets.find( - comboBox->getSelectedItemLabel()); - if(sIt != sDefaultPresets.end() && !gSavedSettings.getBOOL("SkyEditPresets")) - { - LLNotificationsUtil::add("WLNoEditDefault"); - return; - } - - LLWLParamManager::instance()->mCurParams.mName = - comboBox->getSelectedItemLabel(); - - LLNotificationsUtil::add("WLSavePresetAlert", LLSD(), LLSD(), boost::bind(&LLFloaterWindLight::saveAlertCallback, this, _1, _2)); -} - -bool LLFloaterWindLight::saveAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - // if they choose save, do it. Otherwise, don't do anything - if(option == 0) - { - LLWLParamManager * param_mgr = LLWLParamManager::instance(); - - param_mgr->setParamSet(param_mgr->mCurParams.mName, param_mgr->mCurParams); - - // comment this back in to save to file - param_mgr->savePreset(param_mgr->mCurParams.mName); - } - return false; -} - -void LLFloaterWindLight::onDeletePreset() -{ - LLComboBox* combo_box = getChild<LLComboBox>( - "WLPresetsCombo"); - - if(combo_box->getSelectedValue().asString() == "") - { - return; - } - - LLSD args; - args["SKY"] = combo_box->getSelectedValue().asString(); - LLNotificationsUtil::add("WLDeletePresetAlert", args, LLSD(), - boost::bind(&LLFloaterWindLight::deleteAlertCallback, this, _1, _2)); -} - -bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // if they choose delete, do it. Otherwise, don't do anything - if(option == 0) - { - LLComboBox* combo_box = getChild<LLComboBox>("WLPresetsCombo"); - LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); - LLComboBox* key_combo = NULL; - - if (day_cycle) - { - key_combo = day_cycle->getChild<LLComboBox>("WLKeyPresets"); - } - - std::string name(combo_box->getSelectedValue().asString()); - - // check to see if it's a default and shouldn't be deleted - std::set<std::string>::iterator sIt = sDefaultPresets.find(name); - if(sIt != sDefaultPresets.end()) - { - LLNotificationsUtil::add("WLNoEditDefault"); - return false; - } - - LLWLParamManager::instance()->removeParamSet(name, true); - - // remove and choose another - S32 new_index = combo_box->getCurrentIndex(); - - combo_box->remove(name); - if(key_combo != NULL) - { - key_combo->remove(name); - - // remove from slider, as well - day_cycle->deletePreset(name); - } - - // pick the previously selected index after delete - if(new_index > 0) - { - new_index--; - } - - if(combo_box->getItemCount() > 0) - { - combo_box->setCurrentByIndex(new_index); - } - } - return false; -} - - -void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - std::string data = ctrl->getValue().asString(); - if(!data.empty()) - { - LLWLParamManager::instance()->loadPreset( data); - syncMenu(); - } -} - -void LLFloaterWindLight::onOpenDayCycle() -{ - LLFloaterReg::showInstance("env_day_cycle"); -} - -// Clouds -void LLFloaterWindLight::onCloudScrollXMoved(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - // *HACK all cloud scrolling is off by an additive of 10. - LLWLParamManager::instance()->mCurParams.setCloudScrollX(sldrCtrl->getValueF32() + 10.0f); -} - -void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl); - - // *HACK all cloud scrolling is off by an additive of 10. - LLWLParamManager::instance()->mCurParams.setCloudScrollY(sldrCtrl->getValueF32() + 10.0f); -} - -void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); - - bool lock = cbCtrl->get(); - LLWLParamManager::instance()->mCurParams.setEnableCloudScrollX(!lock); - - LLSliderCtrl* sldr = getChild<LLSliderCtrl>( - "WLCloudScrollX"); - - if(cbCtrl->get()) - { - sldr->setEnabled(false); - } - else - { - sldr->setEnabled(true); - } - -} - -void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl) -{ - deactivateAnimator(); - - LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl); - bool lock = cbCtrl->get(); - LLWLParamManager::instance()->mCurParams.setEnableCloudScrollY(!lock); - - LLSliderCtrl* sldr = getChild<LLSliderCtrl>( - "WLCloudScrollY"); - - if(cbCtrl->get()) - { - sldr->setEnabled(false); - } - else - { - sldr->setEnabled(true); - } -} - -void LLFloaterWindLight::deactivateAnimator() -{ - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; -} diff --git a/indra/newview/llfloaterwindlight.h b/indra/newview/llfloaterwindlight.h deleted file mode 100644 index b43edc2c11..0000000000 --- a/indra/newview/llfloaterwindlight.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @file llfloaterwindlight.h - * @brief LLFloaterWindLight class definition - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -/* - * Menu for adjusting the atmospheric settings of the world - */ - -#ifndef LL_LLFLOATERWINDLIGHT_H -#define LL_LLFLOATERWINDLIGHT_H - -#include "llfloater.h" - -#include <vector> -#include "llwlparamset.h" - -struct WLColorControl; -struct WLFloatControl; - - -/// Menuing system for all of windlight's functionality -class LLFloaterWindLight : public LLFloater -{ -public: - - LLFloaterWindLight(const LLSD& key); - virtual ~LLFloaterWindLight(); - /*virtual*/ BOOL postBuild(); - /// initialize all - void initCallbacks(void); - - bool newPromptCallback(const LLSD& notification, const LLSD& response); - - /// general purpose callbacks for dealing with color controllers - void onColorControlRMoved(LLUICtrl* ctrl, WLColorControl* userData); - void onColorControlGMoved(LLUICtrl* ctrl, WLColorControl* userData); - void onColorControlBMoved(LLUICtrl* ctrl, WLColorControl* userData); - void onColorControlIMoved(LLUICtrl* ctrl, WLColorControl* userData); - void onFloatControlMoved(LLUICtrl* ctrl, WLFloatControl* userData); - - /// lighting callbacks for glow - void onGlowRMoved(LLUICtrl* ctrl, WLColorControl* userData); - //static void onGlowGMoved(LLUICtrl* ctrl, void* userData); - void onGlowBMoved(LLUICtrl* ctrl, WLColorControl* userData); - - /// lighting callbacks for sun - void onSunMoved(LLUICtrl* ctrl, WLColorControl* userData); - - /// for handling when the star slider is moved to adjust the alpha - void onStarAlphaMoved(LLUICtrl* ctrl); - - /// when user hits the load preset button - void onNewPreset(); - - /// when user hits the save preset button - void onSavePreset(); - - /// prompts a user when overwriting a preset - bool saveAlertCallback(const LLSD& notification, const LLSD& response); - - /// when user hits the save preset button - void onDeletePreset(); - - /// prompts a user when overwriting a preset - bool deleteAlertCallback(const LLSD& notification, const LLSD& response); - - /// what to do when you change the preset name - void onChangePresetName(LLUICtrl* ctrl); - - /// when user hits the save preset button - void onOpenDayCycle(); - - /// handle cloud scrolling - void onCloudScrollXMoved(LLUICtrl* ctrl); - void onCloudScrollYMoved(LLUICtrl* ctrl); - void onCloudScrollXToggled(LLUICtrl* ctrl); - void onCloudScrollYToggled(LLUICtrl* ctrl); - - /// sync up sliders with parameters - void syncMenu(); - - /// turn off animated skies - static void deactivateAnimator(); - -private: - static std::set<std::string> sDefaultPresets; -}; - - -#endif diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index b3910982d1..eb3c7ee469 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -1070,7 +1070,7 @@ void LLFloaterWorldMap::onComboTextEntry() // Reset the tracking whenever we start typing into any of the search fields, // so that hitting <enter> does an auto-complete versus teleporting us to the // previously selected landmark/friend. - LLTracker::clearFocus(); + LLTracker::stopTracking(NULL); } void LLFloaterWorldMap::onSearchTextEntry( ) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..e90b6c1c3d 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -167,13 +167,23 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- /// Class LLFolderView ///---------------------------------------------------------------------------- +LLFolderView::Params::Params() +: task_id("task_id"), + title("title"), + use_label_suffix("use_label_suffix"), + allow_multiselect("allow_multiselect", true), + show_load_status("show_load_status", true), + use_ellipses("use_ellipses", false) +{ +} + // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), mScrollContainer( NULL ), mPopupMenuHandle(), - mAllowMultiSelect(TRUE), + mAllowMultiSelect(p.allow_multiselect), mShowFolderHierarchy(FALSE), mSourceID(p.task_id), mRenameItem( NULL ), @@ -194,10 +204,14 @@ LLFolderView::LLFolderView(const Params& p) mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), mParentPanel(p.parent_panel), - mUseEllipses(false), + mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL) { + mRoot = this; + + mShowLoadStatus = p.show_load_status(); + LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); setRect( rect ); @@ -263,6 +277,7 @@ LLFolderView::LLFolderView(const Params& p) menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); mPopupMenuHandle = menu->getHandle(); + mListener->openItem(); } // Destroys the object @@ -308,15 +323,10 @@ void LLFolderView::setSortOrder(U32 order) if (order != mSortOrder) { LLFastTimer t(FTM_SORT); + mSortOrder = order; - for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) - { - folders_t::iterator fit = iter++; - (*fit)->sortBy(order); - } - + sortBy(order); arrangeAll(); } } @@ -342,7 +352,7 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder) { recursiveIncrementNumDescendantsSelected(folder->numSelected()); } - folder->setShowLoadStatus(true); + folder->setShowLoadStatus(mShowLoadStatus); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); @@ -424,11 +434,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } - // Need to call arrange regardless of visibility, since children's visibility - // might need to be changed too (e.g. even though a folder is invisible, its - // children also need to be set invisible for state-tracking purposes, e.g. - // llfolderviewitem::filter). - // if (folderp->getVisible()) + if (folderp->getVisible()) { S32 child_height = 0; S32 child_width = 0; @@ -764,7 +770,7 @@ void LLFolderView::sanitizeSelection() } // Don't allow invisible items (such as root folders) to be selected. - if (item->getHidden()) + if (item == getRoot()) { items_to_remove.push_back(item); } @@ -787,7 +793,7 @@ void LLFolderView::sanitizeSelection() parent_folder; parent_folder = parent_folder->getParentFolder()) { - if (parent_folder->potentiallyVisible() && !parent_folder->getHidden()) + if (parent_folder->potentiallyVisible()) { // give initial selection to first ancestor folder that potentially passes the filter if (!new_selection) @@ -806,13 +812,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } + new_selection = NULL; } if (new_selection) @@ -931,14 +931,15 @@ void LLFolderView::draw() if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = LLTrans::getString("Searching"); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { - LLStringUtil::format_map_t args; - args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); - mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + if (getFilter()) + { + LLStringUtil::format_map_t args; + args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); + mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); + } } mStatusTextBox->setValue(mStatusText); mStatusTextBox->setVisible( TRUE ); @@ -962,7 +963,9 @@ void LLFolderView::draw() } - LLFolderViewFolder::draw(); + // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, + // and arrow for the root folder + LLView::draw(); mDragAndDropThisFrame = FALSE; } @@ -1642,11 +1645,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - // Don't change selectin to hidden folder. See EXT-5328. - if (!parent_folder->getHidden()) - { - setSelection(parent_folder, FALSE, TRUE); - } + setSelection(parent_folder, FALSE, TRUE); } else { @@ -1911,7 +1910,14 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // by the folder which is the hierarchy root. if (!handled && !hasVisibleChildren()) { - handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + if (mFolders.empty()) + { + handled = handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } + else + { + handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } } if (handled) @@ -1927,8 +1933,11 @@ void LLFolderView::deleteAllChildren() closeRenamer(); LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle<LLView>(); - mRenamer = NULL; + mScrollContainer = NULL; mRenameItem = NULL; + mRenamer = NULL; + mStatusTextBox = NULL; + clearSelection(); LLView::deleteAllChildren(); } @@ -2031,7 +2040,7 @@ void LLFolderView::removeItemID(const LLUUID& id) LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2048,7 +2057,7 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2173,7 +2182,7 @@ void LLFolderView::doIdle() // filter to determine visiblity before arranging filterFromRoot(); - // automatically show matching items, and select first one + // automatically show matching items, and select first one if we had a selection // do this every frame until user puts keyboard focus into the inventory window // signaling the end of the automatic update // only do this when mNeedsFilter is set, meaning filtered items have @@ -2183,7 +2192,7 @@ void LLFolderView::doIdle() LLFastTimer t3(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); - if ((!selected_itemp || !selected_itemp->getFiltered()) && !mAutoSelectOverride) + if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride) { // select first filtered item LLSelectFirstFilteredItem filter; @@ -2496,11 +2505,6 @@ BOOL LLFolderView::isFilterModified() return mFilter->isNotDefault(); } -BOOL LLFolderView::getAllowMultiSelect() -{ - return mAllowMultiSelect; -} - void delete_selected_item(void* user_data) { if(user_data) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 1464a058d8..0b92548fd0 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -59,22 +59,6 @@ class LLUICtrl; class LLTextBox; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFolderViewFunctor -// -// Simple abstract base class for applying a functor to folders and -// items in a folder view hierarchy. This is suboptimal for algorithms -// that only work folders or only work on items, but I'll worry about -// that later when it's determined to be too slow. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFolderViewFunctor -{ -public: - virtual ~LLFolderViewFunctor() {} - virtual void doFolder(LLFolderViewFolder* folder) = 0; - virtual void doItem(LLFolderViewItem* item) = 0; -}; - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFolderView // // Th LLFolderView represents the root level folder view object. It @@ -89,7 +73,12 @@ public: Mandatory<LLPanel*> parent_panel; Optional<LLUUID> task_id; Optional<std::string> title; - Optional<bool> use_label_suffix; + Optional<bool> use_label_suffix, + allow_multiselect, + show_load_status, + use_ellipses; + + Params(); }; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -102,7 +91,6 @@ public: // and resort the items if necessary. void setSortOrder(U32 order); void setFilterPermMask(PermissionMask filter_perm_mask); - void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t; void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); } @@ -117,7 +105,6 @@ public: //LLInventoryFilter::EFolderShow getShowFolderState(); U32 getSortOrder() const; BOOL isFilterModified(); - BOOL getAllowMultiSelect(); // Close all folders in the view void closeAllFolders(); @@ -238,7 +225,6 @@ public: void setShowSingleSelection(BOOL show); BOOL getShowSingleSelection() { return mShowSingleSelection; } F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); } - void setUseEllipses(bool use_ellipses) { mUseEllipses = use_ellipses; } bool getUseEllipses() { return mUseEllipses; } void addItemID(const LLUUID& id, LLFolderViewItem* itemp); diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index e9d1ad3a9e..6e4f55fb2f 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -30,8 +30,10 @@ // viewer includes #include "llfolderview.h" // Items depend extensively on LLFolderViews #include "llfoldervieweventlistener.h" +#include "llviewerfoldertype.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" +#include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" #include "llpanel.h" #include "llviewercontrol.h" // gSavedSettings @@ -130,10 +132,14 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mIconOpen(p.icon_open), mIconOverlay(p.icon_overlay), mListener(p.listener), - mHidden(false), mShowLoadStatus(false) { +} + +BOOL LLFolderViewItem::postBuild() +{ refresh(); + return TRUE; } // Destroys the object @@ -195,7 +201,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children) LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children ); // Skip over items that are invisible or are hidden from the UI. - while(itemp && (!itemp->getVisible() || itemp->getHidden())) + while(itemp && !itemp->getVisible()) { LLFolderViewItem* next_itemp = itemp->mParentFolder->getPreviousFromChild( itemp, include_children ); if (itemp == next_itemp) @@ -351,7 +357,10 @@ void LLFolderViewItem::arrangeAndSet(BOOL set_selection, BOOL take_keyboard_focus) { LLFolderView* root = getRoot(); + if (getParentFolder()) + { getParentFolder()->requestArrange(); + } if(set_selection) { setSelectionFromRoot(this, TRUE, take_keyboard_focus); @@ -442,23 +451,20 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) S32 LLFolderViewItem::getItemHeight() { - if (getHidden()) return 0; - return mItemHeight; } void LLFolderViewItem::filter( LLInventoryFilter& filter) { const BOOL previous_passed_filter = mPassedFilter; - const BOOL passed_filter = mListener && filter.check(this); + const BOOL passed_filter = filter.check(this); // If our visibility will change as a result of this filter, then // we need to be rearranged in our parent folder if (mParentFolder) { - if (getVisible() != passed_filter) - mParentFolder->requestArrange(); - if (passed_filter != previous_passed_filter) + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) mParentFolder->requestArrange(); } @@ -863,11 +869,6 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderViewItem::draw() { - if (getHidden()) - { - return; - } - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); @@ -891,8 +892,8 @@ void LLFolderViewItem::draw() // Draw open folder arrow // const bool up_to_date = mListener && mListener->isUpToDate(); - const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) || // we fetched our children and some of them have passed the filter... - (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) + const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) // we fetched our children and some of them have passed the filter... + || (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) if (possibly_has_children) { LLUIImage* arrow_image = default_params.folder_arrow_image; @@ -1054,8 +1055,11 @@ void LLFolderViewItem::draw() { root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); } - if ((mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) || - (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && root_is_loading && (mShowLoadStatus || mHidden))) + if ((mIsLoading + && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) + || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() + && root_is_loading + && mShowLoadStatus)) { std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) "; font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, @@ -1119,7 +1123,8 @@ LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): mLastCalculatedWidth(0), mCompletedFilterGeneration(-1), mMostFilteredDescendantGeneration(-1), - mNeedsSort(false) + mNeedsSort(false), + mPassedFolderFilter(FALSE) { } @@ -1131,6 +1136,17 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() } +void LLFolderViewFolder::setFilteredFolder(bool filtered, S32 filter_generation) +{ + mPassedFolderFilter = filtered; + mLastFilterGeneration = filter_generation; +} + +bool LLFolderViewFolder::getFilteredFolder(S32 filter_generation) +{ + return mPassedFolderFilter && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); +} + // addToFolder() returns TRUE if it succeeds. FALSE otherwise BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) { @@ -1157,8 +1173,6 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) mHasVisibleChildren = hasFilteredDescendants(filter_generation); - LLInventoryFilter::EFolderShow show_folder_state = getRoot()->getFilter()->getShowFolderState(); - // calculate height as a single item (without any children), and reshapes rectangle to match LLFolderViewItem::arrange( width, height, filter_generation ); @@ -1190,8 +1204,10 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } else { - folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? - (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + folderp->setVisible( folderp->getListener() + && (folderp->getFiltered(filter_generation) + || (folderp->getFilteredFolder(filter_generation) + && folderp->hasFilteredDescendants(filter_generation)))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) @@ -1311,7 +1327,9 @@ void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recur mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation); mCompletedFilterGeneration = generation; // only aggregate up if we are a lower (older) value - if (recurse_up && mParentFolder && generation < mParentFolder->getCompletedFilterGeneration()) + if (recurse_up + && mParentFolder + && generation < mParentFolder->getCompletedFilterGeneration()) { mParentFolder->setCompletedFilterGeneration(generation, TRUE); } @@ -1336,21 +1354,19 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) // filter folder itself if (getLastFilterGeneration() < filter_generation) { - if (getLastFilterGeneration() >= must_pass_generation && // folder has been compared to a valid precursor filter - !mPassedFilter) // and did not pass the filter + if (getLastFilterGeneration() >= must_pass_generation // folder has been compared to a valid precursor filter + && !mPassedFilter) // and did not pass the filter { // go ahead and flag this folder as done mLastFilterGeneration = filter_generation; } - else + else // filter self only on first pass through { - // filter self only on first pass through + // filter against folder rules + filterFolder(filter); + // and then item rules LLFolderViewItem::filter( filter ); } - if (mHidden) - { - setOpen(); - } } if (getRoot()->getDebugFilters()) @@ -1377,7 +1393,10 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } // when applying a filter, matching folders get their contents downloaded first - if (filter.isNotDefault() && getFiltered(filter.getMinRequiredGeneration()) && (mListener && !gInventory.isCategoryComplete(mListener->getUUID()))) + if (filter.isNotDefault() + && getFiltered(filter.getMinRequiredGeneration()) + && (mListener + && !gInventory.isCategoryComplete(mListener->getUUID()))) { LLInventoryModelBackgroundFetch::instance().start(mListener->getUUID()); } @@ -1403,6 +1422,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if (folder->getFiltered() || folder->hasFilteredDescendants(filter.getMinRequiredGeneration())) { mMostFilteredDescendantGeneration = filter_generation; + requestArrange(); } // just skip it, it has already been filtered continue; @@ -1415,6 +1435,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if (folder->getFiltered() || folder->hasFilteredDescendants(filter_generation)) { mMostFilteredDescendantGeneration = filter_generation; + requestArrange(); if (getRoot()->needsAutoSelect() && autoopen_folders) { folder->setOpenArrangeRecursively(TRUE); @@ -1436,6 +1457,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if (item->getFiltered()) { mMostFilteredDescendantGeneration = filter_generation; + requestArrange(); } continue; } @@ -1454,6 +1476,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if (item->getFiltered(filter.getMinRequiredGeneration())) { mMostFilteredDescendantGeneration = filter_generation; + requestArrange(); } } @@ -1467,6 +1490,31 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } } +void LLFolderViewFolder::filterFolder(LLInventoryFilter& filter) +{ + const BOOL previous_passed_filter = mPassedFolderFilter; + const BOOL passed_filter = filter.checkFolder(this); + + // If our visibility will change as a result of this filter, then + // we need to be rearranged in our parent folder + if (mParentFolder) + { + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) + { + mParentFolder->requestArrange(); + } + } + + setFilteredFolder(passed_filter, filter.getCurrentGeneration()); + filter.decrementFilterCount(); + + if (getRoot()->getDebugFilters()) + { + mStatusText = llformat("%d", mLastFilterGeneration); + } +} + void LLFolderViewFolder::setFiltered(BOOL filtered, S32 filter_generation) { // if this folder is now filtered, but wasn't before @@ -1488,6 +1536,23 @@ void LLFolderViewFolder::dirtyFilter() LLFolderViewItem::dirtyFilter(); } +BOOL LLFolderViewFolder::getFiltered() +{ + return getFilteredFolder(getRoot()->getFilter()->getMinRequiredGeneration()) + && LLFolderViewItem::getFiltered(); +} + +BOOL LLFolderViewFolder::getFiltered(S32 filter_generation) +{ + return getFilteredFolder(filter_generation) && LLFolderViewItem::getFiltered(filter_generation); +} + +BOOL LLFolderViewFolder::hasFilteredDescendants(S32 filter_generation) +{ + return mMostFilteredDescendantGeneration >= filter_generation; +} + + BOOL LLFolderViewFolder::hasFilteredDescendants() { return mMostFilteredDescendantGeneration >= getRoot()->getFilter()->getCurrentGeneration(); @@ -1743,7 +1808,7 @@ void LLFolderViewFolder::destroyView() folderp->destroyView(); // removes entry from mFolders } - deleteAllChildren(); + //deleteAllChildren(); if (mParentFolder) { @@ -1843,8 +1908,12 @@ void LLFolderViewFolder::sortBy(U32 order) (*fit)->sortBy(order); } - mFolders.sort(mSortFunction); - mItems.sort(mSortFunction); + // Don't sort the topmost folders (My Inventory and Library) + if (mListener->getUUID().notNull()) + { + mFolders.sort(mSortFunction); + mItems.sort(mSortFunction); + } if (order & LLInventoryFilter::SO_DATE) { @@ -1981,6 +2050,13 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) item->dirtyFilter(); requestArrange(); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && parentp->mSortFunction.isByDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } @@ -2000,6 +2076,13 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) // rearrange all descendants too, as our indentation level might have changed folder->requestArrange(TRUE); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && !parentp->mSortFunction.isByDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } @@ -2059,7 +2142,9 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r (*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */ } } - if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) + if (mParentFolder + && (recurse == RECURSE_UP + || recurse == RECURSE_UP_DOWN)) { mParentFolder->setOpenArrangeRecursively(openitem, RECURSE_UP); } @@ -2301,13 +2386,16 @@ void LLFolderViewFolder::draw() bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); - if(!up_to_date && mListener && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) + if(!up_to_date + && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) { possibly_has_children = true; } - BOOL loading = ( mIsOpen && possibly_has_children && !up_to_date ); + BOOL loading = (mIsOpen + && possibly_has_children + && !up_to_date ); if ( loading && !mIsLoading ) { @@ -2330,6 +2418,41 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { + // folders have no creation date try to create one from an item somewhere in our folder hierarchy + if (!mCreationDate) + { + for (items_t::const_iterator iit = mItems.begin(); + iit != mItems.end(); ++iit) + { + LLFolderViewItem* itemp = (*iit); + + const time_t item_creation_date = itemp->getCreationDate(); + + if (item_creation_date) + { + mCreationDate = item_creation_date; + break; + } + } + + if (!mCreationDate) + { + for (folders_t::const_iterator fit = mFolders.begin(); + fit != mFolders.end(); ++fit) + { + LLFolderViewFolder* folderp = (*fit); + + const time_t folder_creation_date = folderp->getCreationDate(); + + if (folder_creation_date) + { + mCreationDate = folder_creation_date; + break; + } + } + } + } + return llmax<time_t>(mCreationDate, mSubtreeCreationDate); } @@ -2573,7 +2696,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde { // ignore sort order for landmarks in the Favorites folder. // they should be always sorted as in Favorites bar. See EXT-719 - if (a->getSortGroup() == SG_ITEM && b->getSortGroup() == SG_ITEM + if (a->getSortGroup() == SG_ITEM + && b->getSortGroup() == SG_ITEM && a->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK && b->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK) { diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index fc941510ab..e2f94a2b63 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -66,6 +66,7 @@ public: // Returns true if order has changed bool updateSort(U32 order); U32 getSort() { return mSortOrder; } + bool isByDate() { return mByDate; } bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b); private: @@ -94,7 +95,7 @@ public: Optional<LLUIImage*> icon_open; // used for folders Optional<LLUIImage*> icon_overlay; // for links Optional<LLFolderView*> root; - Optional<LLFolderViewEventListener*> listener; + Mandatory<LLFolderViewEventListener*> listener; Optional<LLUIImage*> folder_arrow_image; Optional<S32> folder_indentation; // pixels @@ -135,7 +136,7 @@ protected: std::string mSearchableLabel; S32 mLabelWidth; bool mLabelWidthDirty; - time_t mCreationDate; + mutable time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsCurSelection; @@ -157,7 +158,6 @@ protected: BOOL mDragAndDropTarget; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; - bool mHidden; bool mShowLoadStatus; // helper function to change the selection from the root. @@ -167,13 +167,15 @@ protected: void extendSelectionFromRoot(LLFolderViewItem* selection); // this is an internal method used for adding items to folders. A - // no-op at this leve, but reimplemented in derived classes. + // no-op at this level, but reimplemented in derived classes. virtual BOOL addItem(LLFolderViewItem*) { return FALSE; } virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; } static LLFontGL* getLabelFontForStyle(U8 style); public: + BOOL postBuild(); + // This function clears the currently selected item, and records // the specified selected item appropriately for display and use // in the UI. If open is TRUE, then folders are opened up along @@ -202,11 +204,6 @@ public: virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); virtual S32 getItemHeight(); - // Hide the folder from the UI, such as if you want to hide the root - // folder in an inventory panel. - void setHidden(bool hidden) { mHidden = hidden; } - bool getHidden() const { return mHidden; } - // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); @@ -366,6 +363,9 @@ public: UNKNOWN, TRASH, NOT_TRASH } ETrash; + typedef std::list<LLFolderViewItem*> items_t; + typedef std::list<LLFolderViewFolder*> folders_t; + private: S32 mNumDescendantsSelected; @@ -374,8 +374,6 @@ public: // Accessed needed by LLFolderViewItem S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); } protected: - typedef std::list<LLFolderViewItem*> items_t; - typedef std::list<LLFolderViewFolder*> folders_t; items_t mItems; folders_t mFolders; LLInventorySort mSortFunction; @@ -392,6 +390,8 @@ protected: S32 mCompletedFilterGeneration; S32 mMostFilteredDescendantGeneration; bool mNeedsSort; + bool mPassedFolderFilter; + public: typedef enum e_recurse_type { @@ -425,13 +425,21 @@ public: virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } - BOOL hasFilteredDescendants(S32 filter_generation) { return mMostFilteredDescendantGeneration >= filter_generation; } + BOOL hasFilteredDescendants(S32 filter_generation); BOOL hasFilteredDescendants(); // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); virtual void setFiltered(BOOL filtered, S32 filter_generation); + virtual BOOL getFiltered(); + virtual BOOL getFiltered(S32 filter_generation); + virtual void dirtyFilter(); + + // folder-specific filtering (filter status propagates top down instead of bottom up) + void filterFolder(LLInventoryFilter& filter); + void setFilteredFolder(bool filtered, S32 filter_generation); + bool getFilteredFolder(S32 filter_generation); // Passes selection information on to children and record // selection information if necessary. @@ -537,6 +545,10 @@ public: time_t getCreationDate() const; bool isTrash() const; S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; } + + folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); } + folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); } + folders_t::size_type getFoldersCount() const { return mFolders.size(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 86c8a1a9b5..75d4c4e80d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,6 +40,7 @@ #include "llfloateropenobject.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llfriendcard.h" #include "llgesturemgr.h" #include "llgiveinventory.h" @@ -571,8 +572,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - // Don't allow items to be pasted directly into the COF. - if (!isCOFFolder()) + // Don't allow items to be pasted directly into the COF or the inbox + if (!isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Paste")); } @@ -781,6 +782,18 @@ 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::isItemPermissive() const { return FALSE; @@ -1786,6 +1799,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { + if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + { + set_dad_inbox_object(inv_cat->getUUID()); + } // Reparent the folder and restamp children if it's moving // into trash. @@ -2525,6 +2542,7 @@ void LLFolderBridge::folderOptionsMenu() { mItems.push_back(std::string("Add To Outfit")); } + mItems.push_back(std::string("Replace Outfit")); } if (is_ensemble) @@ -2614,15 +2632,17 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // Not sure what the right thing is to do here. if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { - // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. - if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) - 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")); - + if (!isInboxFolder()) // don't allow creation in inbox + { + // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. + if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) + 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")); + } #if SUPPORT_ENSEMBLES // Changing folder types is an unfinished unsupported feature // and can lead to unexpected behavior if enabled. @@ -3161,6 +3181,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // (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, (LLViewerInventoryItem*)inv_item, diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 1e849c8812..15629c0c75 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -139,6 +139,7 @@ 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 virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, @@ -584,6 +585,9 @@ protected: }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Recent Inventory Panel related classes +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Overridden version of the Inventory-Folder-View-Bridge for Folders class LLRecentItemsFolderBridge : public LLFolderBridge diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index dee15a1efd..d6278a5fda 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -107,6 +107,32 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) return passed; } +bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) +{ + // we're showing all folders, overriding filter + if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + { + return true; + } + + const LLFolderViewEventListener* listener = folder->getListener(); + const LLUUID folder_id = listener->getUUID(); + + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) + { + // Can only filter categories for items in your inventory + // (e.g. versus in-world object contents). + const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); + if (!cat) + return false; + LLFolderType::EType cat_type = cat->getPreferredType(); + if (cat_type != LLFolderType::FT_NONE && (1LL << cat_type & mFilterOps.mFilterCategoryTypes) == U64(0)) + return false; + } + + return true; +} + BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const { const LLFolderViewEventListener* listener = item->getListener(); @@ -137,30 +163,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } - - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_CATEGORY - // Pass if this item is a category of the filter type, or - // if its parent is a category of the filter type. - if (filterTypes & FILTERTYPE_CATEGORY) - { - // Can only filter categories for items in your inventory - // (e.g. versus in-world object contents). - if (!object) return FALSE; - - LLUUID cat_id = object_id; - if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) - { - cat_id = object->getParentUUID(); - } - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); - if (!cat) - return FALSE; - if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) - return FALSE; - } - - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -172,7 +174,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con return FALSE; } - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_DATE // Pass if this item is within the date range. @@ -293,15 +294,15 @@ BOOL LLInventoryFilter::isModifiedAndClear() return ret; } -void LLInventoryFilter::setFilterObjectTypes(U64 types) +void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) { - if (mFilterOps.mFilterObjectTypes != types) + if (current_types != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterObjectTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterObjectTypes & types); + bool fewer_bits_set = (current_types & ~types) != 0; + bool more_bits_set = (~current_types & types) != 0; - mFilterOps.mFilterObjectTypes = types; + current_types = types; if (more_bits_set && fewer_bits_set) { // neither less or more restrive, both simultaneously @@ -318,62 +319,23 @@ void LLInventoryFilter::setFilterObjectTypes(U64 types) setModified(FILTER_MORE_RESTRICTIVE); } } +} + +void LLInventoryFilter::setFilterObjectTypes(U64 types) +{ + updateFilterTypes(types, mFilterOps.mFilterObjectTypes); mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; } void LLInventoryFilter::setFilterCategoryTypes(U64 types) { - if (mFilterOps.mFilterCategoryTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterCategoryTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterCategoryTypes & types); - - mFilterOps.mFilterCategoryTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } - mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; + updateFilterTypes(types, mFilterOps.mFilterCategoryTypes); + mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY; } void LLInventoryFilter::setFilterWearableTypes(U64 types) { - if (mFilterOps.mFilterWearableTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterWearableTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterWearableTypes & types); - - mFilterOps.mFilterWearableTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } + updateFilterTypes(types, mFilterOps.mFilterWearableTypes); mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE; } @@ -898,11 +860,16 @@ void LLInventoryFilter::fromLLSD(LLSD& data) } } -U32 LLInventoryFilter::getFilterObjectTypes() const +U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; } +U64 LLInventoryFilter::getFilterCategoryTypes() const +{ + return mFilterOps.mFilterCategoryTypes; +} + BOOL LLInventoryFilter::hasFilterString() const { return mFilterSubString.size() > 0; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 39e6f797a2..f9460822f7 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -31,6 +31,7 @@ #include "llpermissionsflags.h" class LLFolderViewItem; +class LLFolderViewFolder; class LLInventoryFilter { @@ -81,11 +82,13 @@ public: // + Parameters // +-------------------------------------------------------------------+ void setFilterObjectTypes(U64 types); - U32 getFilterObjectTypes() const; + U64 getFilterObjectTypes() const; + U64 getFilterCategoryTypes() const; BOOL isFilterObjectTypesWith(LLInventoryType::EType t) const; void setFilterCategoryTypes(U64 types); void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); + void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -110,6 +113,7 @@ public: // + Execution And Results // +-------------------------------------------------------------------+ BOOL check(const LLFolderViewItem* item); + bool checkFolder(const LLFolderViewFolder* folder); BOOL checkAgainstFilterType(const LLFolderViewItem* item) const; BOOL checkAgainstPermissions(const LLFolderViewItem* item) const; BOOL checkAgainstFilterLinks(const LLFolderViewItem* item) const; diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index cfe1747fd4..2016b92666 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -28,9 +28,9 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H -#include "llinventorytype.h" -#include "llfolderview.h" -#include "llfolderviewitem.h" +#include "llinventorymodel.h" +#include "llinventory.h" +#include "llwearabletype.h" /******************************************************************************** ** ** @@ -417,6 +417,24 @@ public: /** Inventory Collector Functions ** ** *******************************************************************************/ +class LLFolderViewItem; +class LLFolderViewFolder; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFolderViewFunctor +// +// Simple abstract base class for applying a functor to folders and +// items in a folder view hierarchy. This is suboptimal for algorithms +// that only work folders or only work on items, but I'll worry about +// that later when it's determined to be too slow. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFolderViewFunctor +{ +public: + virtual ~LLFolderViewFunctor() {} + virtual void doFolder(LLFolderViewFolder* folder) = 0; + virtual void doItem(LLFolderViewItem* item) = 0; +}; class LLInventoryState { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 318beafe65..21d5de9a5b 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2589,7 +2589,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) LLInventoryState::sWearNewClothing = FALSE; } - if (tid == LLInventoryState::sWearNewClothingTransactionID) + if (tid.notNull() && tid == LLInventoryState::sWearNewClothingTransactionID) { count = wearable_ids.size(); for (i = 0; i < count; ++i) diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 7b1ff102e7..afaf660cb7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -31,7 +31,9 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llinventorypanel.h" +#include "llinventorymodel.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "llviewerwindow.h" diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 6bf19e346d..ceba4a0191 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -601,6 +601,34 @@ void LLInventoryAddedObserver::changed(U32 mask) } } +void LLInventoryCategoryAddedObserver::changed(U32 mask) +{ + if (!(mask & LLInventoryObserver::ADD)) + { + return; + } + + const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs(); + + for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*cit); + + if (cat) + { + mAddedCategories.push_back(cat); + } + } + + if (!mAddedCategories.empty()) + { + done(); + + mAddedCategories.clear(); + } +} + + LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransactionID& transaction_id) : mTransactionID(transaction_id) { diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 2d9021961e..aa1eae84d7 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -219,6 +219,28 @@ protected: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCategoryAddedObserver +// +// Base class for doing something when a new category is created in the +// inventory. +// It does not watch for a certain UUID, rather it acts when anything is added +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryCategoryAddedObserver : public LLInventoryObserver +{ +public: + + typedef std::vector<LLViewerInventoryCategory*> cat_vec_t; + + LLInventoryCategoryAddedObserver() : mAddedCategories() {} + /*virtual*/ void changed(U32 mask); + +protected: + virtual void done() = 0; + + cat_vec_t mAddedCategories; +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryTransactionObserver // // Base class for doing something when an inventory transaction completes. diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..702e8d5a1f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llavataractions.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" @@ -42,7 +43,6 @@ #include "llinventorymodelbackgroundfetch.h" #include "llsidepanelinventory.h" #include "llsidetray.h" -#include "llscrollcontainer.h" #include "llviewerattachmenu.h" #include "llviewerfoldertype.h" #include "llvoavatarself.h" @@ -131,9 +131,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mInventory(p.inventory), mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), + mShowLoadStatus(p.show_load_status), mViewsInitialized(false), - mStartFolderString(p.start_folder), - mBuildDefaultHierarchy(true), mInvFVBridgeBuilder(NULL) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -146,11 +145,88 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2)); mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars)); + +} + +void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + + std::string start_folder_name(params.start_folder()); + + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name); + + LLUUID root_id; + + if ("LIBRARY" == params.start_folder()) + { + root_id = gInventory.getLibraryRootFolderID(); + } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_INBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Received Items") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_OUTBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Merchant Outbox") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- end temporary HACK + else + { + root_id = (preferred_type != LLFolderType::FT_NONE) + ? gInventory.findCategoryUUIDForType(preferred_type, false, false) + : LLUUID::null; + } - if (mStartFolderString != "") + if ((root_id == LLUUID::null) && !start_folder_name.empty()) { - mBuildDefaultHierarchy = false; + llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; + root_id = LLUUID::generateNewID(); } + + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -159,22 +235,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves - // Create root folder - { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.use_label_suffix = params.use_label_suffix; - mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); - } + buildFolderView(params); mCommitCallbackRegistrar.popScope(); @@ -184,13 +245,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { LLRect scroller_view_rect = getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(p); + LLScrollContainer::Params scroller_params(params.scroll()); + scroller_params.rect(scroller_view_rect); + mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroller_params); addChild(mScroller); mScroller->addChild(mFolderRoot); mFolderRoot->setScrollContainer(mScroller); @@ -206,7 +263,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // Build view of inventory if we need default full hierarchy and inventory ready, // otherwise wait for idle callback. - if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) + if (mInventory->isInventoryUsable() && !mViewsInitialized) { initializeViews(); } @@ -222,6 +279,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); + // hide inbox + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); + // Initialize base class params. LLPanel::initFromParams(params); } @@ -264,6 +324,15 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } +const LLInventoryFilter* LLInventoryPanel::getFilter() const +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) @@ -272,6 +341,17 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter()->setFilterCategoryTypes(types); } +U32 LLInventoryPanel::getFilterObjectTypes() const +{ + return mFolderRoot->getFilterObjectTypes(); +} + +U32 LLInventoryPanel::getFilterPermMask() const +{ + return mFolderRoot->getFilterPermissions(); +} + + void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { getFilter()->setFilterPermissions(filter_perm_mask); @@ -287,6 +367,12 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter()->setFilterSubString(string); } +const std::string LLInventoryPanel::getFilterSubString() +{ + return mFolderRoot->getFilterSubString(); +} + + void LLInventoryPanel::setSortOrder(U32 order) { getFilter()->setSortOrder(order); @@ -298,6 +384,12 @@ void LLInventoryPanel::setSortOrder(U32 order) } } +U32 LLInventoryPanel::getSortOrder() const +{ + return mFolderRoot->getSortOrder(); +} + + void LLInventoryPanel::setSinceLogoff(BOOL sl) { getFilter()->setDateRangeLastLogoff(sl); @@ -379,7 +471,8 @@ void LLInventoryPanel::modelChanged(U32 mask) { view_item->destroyView(); } - buildNewViews(item_id); + view_item = buildNewViews(item_id); + view_folder = dynamic_cast<LLFolderViewFolder *>(view_item); } ////////////////////////////// @@ -432,11 +525,10 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // STRUCTURE Operation // This item already exists in both memory and UI. It was probably reparented. - if (model_item && view_item) + else if (model_item && view_item) { - // Don't process the item if it's hanging from the root, since its - // model_item's parent will be NULL. - if (view_item->getRoot() != view_item->getParent()) + // Don't process the item if it is the root + if (view_item->getRoot() != view_item) { LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); // Item has been moved. @@ -461,7 +553,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // REMOVE Operation // This item has been removed from memory, but its associated UI element still exists. - if (!model_item && view_item) + else if (!model_item && view_item) { // Remove the item's UI. view_item->destroyView(); @@ -470,6 +562,12 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +LLFolderView* LLInventoryPanel::getRootFolder() +{ + return mFolderRoot; +} + + // static void LLInventoryPanel::onIdle(void *userdata) { @@ -488,23 +586,16 @@ void LLInventoryPanel::onIdle(void *userdata) } } +const LLUUID& LLInventoryPanel::getRootFolderID() const +{ + return mFolderRoot->getListener()->getUUID(); +} + void LLInventoryPanel::initializeViews() { if (!gInventory.isInventoryUsable()) return; - // Determine the root folder in case specified, and - // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - - if ("LIBRARY" == mStartFolderString) - { - mStartFolderID = gInventory.getLibraryRootFolderID(); - } - else - { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - } - rebuildViewsFor(mStartFolderID); + rebuildViewsFor(getRootFolderID()); mViewsInitialized = true; @@ -529,132 +620,155 @@ void LLInventoryPanel::initializeViews() } } -void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) +LLFolderViewItem* LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && id.notNull()) + if (old_view) { old_view->destroyView(); } - buildNewViews(id); + return buildNewViews(id); } -void LLInventoryPanel::buildNewViews(const LLUUID& id) +LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) { - LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS); - LLFolderViewItem* itemp = NULL; - LLInventoryObject* objectp = gInventory.getObject(id); - if (objectp) + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + + LLFolderView::Params p; + + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = bridge; + p.use_label_suffix = useLabelSuffix; + p.allow_multiselect = mAllowMultiSelect; + p.show_load_status = mShowLoadStatus; + + return LLUICtrlFactory::create<LLFolderView>(p); +} + +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items { - const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); - if (id == mStartFolderID) - { - parent_folder = mFolderRoot; - } - else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID))) - { - // This item exists outside the inventory's hierarchy, so don't add it. - return; - } - - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << llendl; - return; - } - - if ((objectp->getType() == LLAssetType::AT_CATEGORY) && - (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) - { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - mFolderRoot, - objectp->getUUID()); - if (new_listener) - { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); - itemp = folderp; - - // Hide the root folder, so we can show the contents of a folder flat - // but still have the parent folder present for listener-related operations. - if (id == mStartFolderID) - { - folderp->setHidden(TRUE); - } - const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp); - if (cat && getIsHiddenFolderType(cat->getPreferredType())) - { - folderp->setHidden(TRUE); - } - } - } - else - { - // Build new view for item. - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - mFolderRoot, - item->getUUID(), - item->getFlags()); - - if (new_listener) - { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create<LLFolderViewItem> (params); - } - } + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; - if (itemp) - { - itemp->addToFolder(parent_folder, mFolderRoot); + return LLUICtrlFactory::create<LLFolderViewFolder>(params); +} - // Don't add children of hidden folders unless this is the panel's root folder. - if (itemp->getHidden() && (id != mStartFolderID)) - { - return; - } +LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) +{ + LLFolderViewItem::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.creation_date = bridge->getCreationDate(); + params.root = mFolderRoot; + params.listener = bridge; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLFolderViewItem>(params); +} + +LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) +{ + LLInventoryObject const* objectp = gInventory.getObject(id); + LLUUID root_id = mFolderRoot->getListener()->getUUID(); + LLFolderViewFolder* parent_folder = NULL; + LLFolderViewItem* itemp = NULL; + + if (id == root_id) + { + parent_folder = mFolderRoot; + } + else if (objectp) + { + const LLUUID &parent_id = objectp->getParentUUID(); + parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); + + if (parent_folder) + { + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; + return NULL; + } + + if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) + { + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + mFolderRoot, + objectp->getUUID()); + if (new_listener) + { + LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + itemp = folderp; + } + } + else + { + // Build new view for item. + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + mFolderRoot, + item->getUUID(), + item->getFlags()); + + if (new_listener) + { + itemp = createFolderViewItem(new_listener); + } + } + + if (itemp) + { + itemp->addToFolder(parent_folder, mFolderRoot); + } } } // If this is a folder, add the children of the folder and recursively add any // child folders. - if ((id == mStartFolderID) || - (objectp && objectp->getType() == LLAssetType::AT_CATEGORY)) + if (id.isNull() + || (objectp + && objectp->getType() == LLAssetType::AT_CATEGORY)) { LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; @@ -671,7 +785,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } } - if(items) + if(items && parent_folder) { for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); item_iter != items->end(); @@ -683,28 +797,25 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } mInventory->unlockDirectDescendentArrays(id); } + + return itemp; } // bit of a hack to make sure the inventory is open. void LLInventoryPanel::openStartFolderOrMyInventory() { - if (mStartFolderString != "") + // Find My Inventory folder and open it up by name + for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) { - mFolderRoot->openFolder(mStartFolderString); - } - else - { - // Find My Inventory folder and open it up by name - for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) + LLFolderViewFolder *fchild = dynamic_cast<LLFolderViewFolder*>(child); + if (fchild + && fchild->getListener() + && fchild->getListener()->getUUID() == gInventory.getRootFolderID()) { - LLFolderViewFolder *fchild = dynamic_cast<LLFolderViewFolder*>(child); - if (fchild && fchild->getListener() && - (fchild->getListener()->getUUID() == gInventory.getRootFolderID())) - { - const std::string& child_name = child->getName(); - mFolderRoot->openFolder(child_name); - break; - } + const std::string& child_name = child->getName(); + mFolderRoot->openFolder(child_name); + mFolderRoot->clearSelection(); // No need to keep it selected though! + break; } } } @@ -723,6 +834,12 @@ void LLInventoryPanel::openSelected() bridge->openItem(); } +void LLInventoryPanel::unSelectAll() +{ + mFolderRoot->setSelection(NULL, FALSE, FALSE); +} + + BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) { BOOL handled = LLView::handleHover(x, y, mask); @@ -802,7 +919,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc mFolderRoot->setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const LLFolderView::signal_t::slot_type& cb) +void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb) { if (mFolderRoot) { @@ -1067,15 +1184,12 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) { - if (!getIsHiddenFolderType(folder_type)) - { - mHiddenFolderTypes.push_back(folder_type); - } + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << folder_type)); } BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const { - return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end()); + return !(getFilter()->getFilterCategoryTypes() & (1ULL << folder_type)); } @@ -1092,6 +1206,13 @@ public: struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params> {}; + void initFromParams(const Params& p) + { + LLInventoryPanel::initFromParams(p); + // turn on inbox for recent items + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); + } + protected: LLInventoryRecentItemsPanel (const Params&); friend class LLUICtrlFactory; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 9da9f7d8ba..a4287a438e 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -33,11 +33,13 @@ #include "llfloater.h" #include "llinventory.h" #include "llinventoryfilter.h" -#include "llfolderview.h" #include "llinventorymodel.h" +#include "llscrollcontainer.h" #include "lluictrlfactory.h" #include <set> +class LLFolderView; +class LLFolderViewFolder; class LLFolderViewItem; class LLInventoryFilter; class LLInventoryModel; @@ -46,7 +48,6 @@ class LLInventoryFVBridgeBuilder; class LLMenuBarGL; class LLCheckBoxCtrl; class LLSpinCtrl; -class LLScrollContainer; class LLTextBox; class LLIconCtrl; class LLSaveFolderState; @@ -83,6 +84,8 @@ public: Optional<Filter> filter; Optional<std::string> start_folder; Optional<bool> use_label_suffix; + Optional<bool> show_load_status; + Optional<LLScrollContainer::Params> scroll; Params() : sort_order_setting("sort_order_setting"), @@ -91,7 +94,9 @@ public: show_item_link_overlays("show_item_link_overlays", false), filter("filter"), start_folder("start_folder"), - use_label_suffix("use_label_suffix", true) + use_label_suffix("use_label_suffix", true), + show_load_status("show_load_status"), + scroll("scroll") {} }; @@ -123,16 +128,17 @@ public: // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); - void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); + void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); void clearSelection(); LLInventoryFilter* getFilter(); + const LLInventoryFilter* getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); - U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); } + U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); - U32 getFilterPermMask() const { return mFolderRoot->getFilterPermissions(); } + U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); - const std::string getFilterSubString() { return mFolderRoot->getFilterSubString(); } + const std::string getFilterSubString(); void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); BOOL getSinceLogoff(); @@ -140,10 +146,9 @@ public: void setShowFolderState(LLInventoryFilter::EFolderShow show); LLInventoryFilter::EFolderShow getShowFolderState(); - void setAllowMultiSelect(BOOL allow) { mFolderRoot->setAllowMultiSelect(allow); } // This method is called when something has changed about the inventory. void modelChanged(U32 mask); - LLFolderView* getRootFolder() { return mFolderRoot; } + LLFolderView* getRootFolder(); LLScrollContainer* getScrollableContainer() { return mScroller; } void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); @@ -158,7 +163,7 @@ public: static void dumpSelectionInformation(void* user_data); void openSelected(); - void unSelectAll() { mFolderRoot->setSelection(NULL, FALSE, FALSE); } + void unSelectAll(); static void onIdle(void* user_data); @@ -175,6 +180,7 @@ protected: LLInvPanelComplObserver* mCompletionObserver; BOOL mAllowMultiSelect; BOOL mShowItemLinkOverlays; // Shows link graphic over inventory item icons + BOOL mShowLoadStatus; LLFolderView* mFolderRoot; LLScrollContainer* mScroller; @@ -198,7 +204,7 @@ public: static const std::string INHERIT_SORT_ORDER; void setSortOrder(U32 order); - U32 getSortOrder() const { return mFolderRoot->getSortOrder(); } + U32 getSortOrder() const; private: std::string mSortOrderSetting; @@ -207,29 +213,27 @@ private: //-------------------------------------------------------------------- public: void addHideFolderType(LLFolderType::EType folder_type); -protected: - BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; -private: - std::vector<LLFolderType::EType> mHiddenFolderTypes; - //-------------------------------------------------------------------- - // Initialization routines for building up the UI ("views") - //-------------------------------------------------------------------- public: BOOL getIsViewsInitialized() const { return mViewsInitialized; } - const LLUUID& getStartFolderID() const { return mStartFolderID; } - const std::string& getStartFolderString() { return mStartFolderString; } + const LLUUID& getRootFolderID() const; protected: // Builds the UI. Call this once the inventory is usable. void initializeViews(); - void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. - virtual void buildNewViews(const LLUUID& id); + LLFolderViewItem* rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. + + virtual void buildFolderView(const LLInventoryPanel::Params& params); + LLFolderViewItem* buildNewViews(const LLUUID& id); + BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; + + virtual LLFolderView* createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix); + virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() BOOL mViewsInitialized; // Views have been generated // UUID of category from which hierarchy should be built. Set with the // "start_folder" xml property. Default is LLUUID::null that means total Inventory hierarchy. - std::string mStartFolderString; LLUUID mStartFolderID; }; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5c65dcec34..1c8f6b6c98 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -190,6 +190,7 @@ LLLocationInputCtrl::Params::Params() scripts_icon("scripts_icon"), damage_icon("damage_icon"), damage_text("damage_text"), + see_avatars_icon("see_avatars_icon"), maturity_help_topic("maturity_help_topic") { } @@ -342,6 +343,13 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mDamageText = LLUICtrlFactory::create<LLTextBox>(damage_text); addChild(mDamageText); + LLIconCtrl::Params see_avatars_icon = p.see_avatars_icon; + see_avatars_icon.tool_tip = LLTrans::getString("LocationCtrlSeeAVsTooltip"); + see_avatars_icon.mouse_opaque = true; + mParcelIcon[SEE_AVATARS_ICON] = LLUICtrlFactory::create<LLIconCtrl>(see_avatars_icon); + mParcelIcon[SEE_AVATARS_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, SEE_AVATARS_ICON)); + addChild(mParcelIcon[SEE_AVATARS_ICON]); + // Register callbacks and load the location field context menu (NB: the order matters). LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Navbar.Action", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Navbar.EnableMenuItem", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemEnabled, this, _2)); @@ -810,6 +818,7 @@ void LLLocationInputCtrl::refreshParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool see_avs = current_parcel->getSeeAVs(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -819,6 +828,7 @@ void LLLocationInputCtrl::refreshParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[SEE_AVATARS_ICON]->setVisible( !see_avs ); // Padding goes to left of both landmark star and for sale btn x -= mAddLandmarkHPad; @@ -1175,6 +1185,9 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case SEE_AVATARS_ICON: + LLNotificationsUtil::add("SeeAvatars"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 6368bf5cf2..ed47ba73e3 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -77,7 +77,8 @@ public: push_icon, build_icon, scripts_icon, - damage_icon; + damage_icon, + see_avatars_icon; Optional<LLTextBox::Params> damage_text; Params(); }; @@ -109,12 +110,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + SEE_AVATARS_ICON, // 6 + ICON_COUNT // 7 total }; friend class LLUICtrlFactory; diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index b3ad9efeb2..03ccabc994 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -38,6 +38,7 @@ #include "llviewermedia.h" #include "llviewertexture.h" #include "llviewerwindow.h" +#include "lldebugmessagebox.h" #include "llweb.h" #include "llrender.h" #include "llpluginclassmedia.h" @@ -708,6 +709,8 @@ LLPluginClassMedia* LLMediaCtrl::getMediaPlugin() // void LLMediaCtrl::draw() { + F32 alpha = getDrawContext().mAlpha; + if ( gRestoreGL == 1 ) { LLRect r = getRect(); @@ -746,21 +749,11 @@ void LLMediaCtrl::draw() } } -// if(mHidingInitialLoad) -// { -// // If we're hiding loading, don't draw at all. -// draw_media = false; -// } - bool background_visible = isBackgroundVisible(); bool background_opaque = isBackgroundOpaque(); if(draw_media) { - // alpha off for this - LLGLSUIDefault gls_ui; - LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - gGL.pushUIMatrix(); { if (mIgnoreUIScale) @@ -775,7 +768,8 @@ void LLMediaCtrl::draw() // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); - gGL.color4fv( LLColor4::white.mV ); + LLColor4 media_color = LLColor4::white % alpha; + gGL.color4fv( media_color.mV ); F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); @@ -827,7 +821,6 @@ void LLMediaCtrl::draw() } // draw the browser - gGL.setSceneBlendType(LLRender::BT_REPLACE); gGL.begin( LLRender::QUADS ); if (! media_plugin->getTextureCoordsOpenGL()) { @@ -860,7 +853,6 @@ void LLMediaCtrl::draw() gGL.vertex2i( x_offset + width, y_offset ); } gGL.end(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); } gGL.popUIMatrix(); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index a06422a177..a1f8f64627 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -36,7 +36,6 @@ #include "llbufferstream.h" #include "llcurl.h" #include "lldatapacker.h" -#include "llfasttimer.h" #include "llfloatermodelpreview.h" #include "llfloaterperms.h" #include "lleconomy.h" @@ -72,9 +71,6 @@ #include <queue> -LLFastTimer::DeclareTimer FTM_MESH_UPDATE("Mesh Update"); -LLFastTimer::DeclareTimer FTM_LOAD_MESH("Load Mesh"); - LLMeshRepository gMeshRepo; const U32 MAX_MESH_REQUESTS_PER_SECOND = 100; @@ -373,10 +369,8 @@ public: if (observer) { - S32 fee = cc["upload_price"].asInteger(); - F64 phys = cc["data"]["physics_cost"].asReal(); - - observer->onModelPhysicsFeeReceived(phys, fee, mThread->mWholeModelUploadURL); + cc["data"]["upload_price"] = cc["upload_price"]; + observer->onModelPhysicsFeeReceived(cc["data"], mThread->mWholeModelUploadURL); } } else @@ -668,7 +662,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) } U32 header_size = mMeshHeaderSize[mesh_id]; - + if (header_size > 0) { S32 version = mMeshHeader[mesh_id]["version"].asInteger(); @@ -688,7 +682,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -761,7 +755,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -834,7 +828,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -891,9 +885,9 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params) S32 size = file.getSize(); if (size > 0) - { - U8 buffer[1024]; - S32 bytes = llmin(size, 1024); + { //NOTE -- if the header size is ever more than 4KB, this will break + U8 buffer[4096]; + S32 bytes = llmin(size, 4096); LLMeshRepository::sCacheBytesRead += bytes; file.read(buffer, bytes); if (headerReceived(mesh_params, buffer, bytes)) @@ -915,6 +909,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params) retval = true; //grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits //within the first 4KB + //NOTE -- this will break of headers ever exceed 4KB LLMeshRepository::sHTTPRequestCount++; mCurlRequest->getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params)); } @@ -951,7 +946,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -1037,14 +1032,11 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat } { - U32 cost = gMeshRepo.calcResourceCost(header); - LLUUID mesh_id = mesh_params.getSculptID(); mHeaderMutex->lock(); mMeshHeaderSize[mesh_id] = header_size; mMeshHeader[mesh_id] = header; - mMeshResourceCost[mesh_id] = cost; mHeaderMutex->unlock(); //check for pending requests @@ -1410,12 +1402,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures) for (S32 face_num = 0; face_num < data.mBaseModel->getNumVolumeFaces(); face_num++) { - if(face_num >= instance.mMaterial.size()) - { - break ; - } - - LLImportMaterial& material = instance.mMaterial[face_num]; + LLImportMaterial& material = instance.mMaterial[data.mBaseModel->mMaterialList[face_num]]; LLSD face_entry = LLSD::emptyMap(); LLViewerFetchedTexture *texture = material.mDiffuseMap.get(); @@ -1541,6 +1528,8 @@ void LLMeshUploadThread::doWholeModelUpload() do { mCurlRequest->process(); + //sleep for 10ms to prevent eating a whole core + apr_sleep(10000); } while (mCurlRequest->getQueued() > 0); } @@ -1571,6 +1560,8 @@ void LLMeshUploadThread::requestWholeModelFee() do { mCurlRequest->process(); + //sleep for 10ms to prevent eating a whole core + apr_sleep(10000); } while (mCurlRequest->getQueued() > 0); delete mCurlRequest; @@ -1580,9 +1571,6 @@ void LLMeshUploadThread::requestWholeModelFee() mFinished = true; } -static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_LOADED("Notify Loaded"); -static LLFastTimer::DeclareTimer FTM_NOTIFY_MESH_UNAVAILABLE("Notify Unavailable"); - void LLMeshRepoThread::notifyLoadedMeshes() { while (!mLoadedQ.empty()) @@ -1681,19 +1669,6 @@ S32 LLMeshRepository::getActualMeshLOD(LLSD& header, S32 lod) return -1; } -U32 LLMeshRepoThread::getResourceCost(const LLUUID& mesh_id) -{ - LLMutexLock lock(mHeaderMutex); - - std::map<LLUUID, U32>::iterator iter = mMeshResourceCost.find(mesh_id); - if (iter != mMeshResourceCost.end()) - { - return iter->second; - } - - return 0; -} - void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header) { mThread->mMeshHeader[data.mUUID] = header; @@ -2028,11 +2003,6 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, S32 remaining = bytes-file.tell(); - if (remaining < 0 || remaining > 4096) - { - llerrs << "Bad padding of mesh asset cache entry." << llendl; - } - if (remaining > 0) { file.write(block, remaining); @@ -2146,8 +2116,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para return detail; } - LLFastTimer t(FTM_LOAD_MESH); - { LLMutexLock lock(mMeshMutex); //add volume to list of loading meshes @@ -2223,11 +2191,6 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para return detail; } -static LLFastTimer::DeclareTimer FTM_START_MESH_THREAD("Start Thread"); -static LLFastTimer::DeclareTimer FTM_LOAD_MESH_LOD("Load LOD"); -static LLFastTimer::DeclareTimer FTM_MESH_LOCK1("Lock 1"); -static LLFastTimer::DeclareTimer FTM_MESH_LOCK2("Lock 2"); - void LLMeshRepository::notifyLoadedMeshes() { //called from main thread @@ -2293,18 +2256,9 @@ void LLMeshRepository::notifyLoadedMeshes() } } - LLFastTimer t(FTM_MESH_UPDATE); - - { - LLFastTimer t(FTM_MESH_LOCK1); - mMeshMutex->lock(); - } - - { - LLFastTimer t(FTM_MESH_LOCK2); - mThread->mMutex->lock(); - } - + mMeshMutex->lock(); + mThread->mMutex->lock(); + //popup queued error messages from background threads while (!mUploadErrorQ.empty()) { @@ -2356,7 +2310,6 @@ void LLMeshRepository::notifyLoadedMeshes() while (!mPendingRequests.empty() && push_count > 0) { - LLFastTimer t(FTM_LOAD_MESH_LOD); LLMeshRepoThread::LODRequest& request = mPendingRequests.front(); mThread->loadMeshLOD(request.mMeshParams, request.mLOD); mPendingRequests.erase(mPendingRequests.begin()); @@ -2506,25 +2459,6 @@ S32 LLMeshRepository::getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lo return mThread->getActualMeshLOD(mesh_params, lod); } -U32 LLMeshRepository::calcResourceCost(LLSD& header) -{ - U32 bytes = 0; - - for (U32 i = 0; i < 4; i++) - { - bytes += header[header_lod[i]]["size"].asInteger(); - } - - bytes += header["skin"]["size"].asInteger(); - - return bytes/4096 + 1; -} - -U32 LLMeshRepository::getResourceCost(const LLUUID& mesh_id) -{ - return mThread->getResourceCost(mesh_id); -} - const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj) { if (mesh_id.notNull()) @@ -2757,6 +2691,11 @@ bool LLImportMaterial::operator<(const LLImportMaterial &rhs) const return mDiffuseColor < rhs.mDiffuseColor; } + if (mBinding != rhs.mBinding) + { + return mBinding < rhs.mBinding; + } + return mFullbright < rhs.mFullbright; } @@ -3391,7 +3330,8 @@ LLModelInstance::LLModelInstance(LLSD& data) for (U32 i = 0; i < data["material"].size(); ++i) { - mMaterial.push_back(LLImportMaterial(data["material"][i])); + LLImportMaterial mat(data["material"][i]); + mMaterial[mat.mBinding] = mat; } } @@ -3404,9 +3344,10 @@ LLSD LLModelInstance::asLLSD() ret["label"] = mLabel; ret["transform"] = mTransform.getValue(); - for (U32 i = 0; i < mMaterial.size(); ++i) + U32 i = 0; + for (std::map<std::string, LLImportMaterial>::iterator iter = mMaterial.begin(); iter != mMaterial.end(); ++iter) { - ret["material"][i] = mMaterial[i].asLLSD(); + ret["material"][i++] = iter->second.asLLSD(); } return ret; @@ -3418,6 +3359,7 @@ LLImportMaterial::LLImportMaterial(LLSD& data) mDiffuseMapLabel = data["diffuse"]["label"].asString(); mDiffuseColor.setValue(data["diffuse"]["color"]); mFullbright = data["fullbright"].asBoolean(); + mBinding = data["binding"].asString(); } @@ -3429,7 +3371,8 @@ LLSD LLImportMaterial::asLLSD() ret["diffuse"]["label"] = mDiffuseMapLabel; ret["diffuse"]["color"] = mDiffuseColor.getValue(); ret["fullbright"] = mFullbright; - + ret["binding"] = mBinding; + return ret; } diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 74a08a998f..a15650463e 100755 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -92,6 +92,7 @@ public: LLPointer<LLViewerFetchedTexture> mDiffuseMap; std::string mDiffuseMapFilename; std::string mDiffuseMapLabel; + std::string mBinding; LLColor4 mDiffuseColor; bool mFullbright; @@ -120,9 +121,9 @@ public: S32 mLocalMeshID; LLMatrix4 mTransform; - std::vector<LLImportMaterial> mMaterial; + std::map<std::string, LLImportMaterial> mMaterial; - LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, std::vector<LLImportMaterial>& materials) + LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, std::map<std::string, LLImportMaterial>& materials) : mModel(model), mLabel(label), mTransform(transform), mMaterial(materials) { mLocalMeshID = -1; @@ -230,8 +231,7 @@ public: mesh_header_map mMeshHeader; std::map<LLUUID, U32> mMeshHeaderSize; - std::map<LLUUID, U32> mMeshResourceCost; - + class HeaderRequest { public: @@ -334,8 +334,7 @@ public: void notifyLoadedMeshes(); S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); - U32 getResourceCost(const LLUUID& mesh_params); - + void loadMeshSkinInfo(const LLUUID& mesh_id); void loadMeshDecomposition(const LLUUID& mesh_id); void loadMeshPhysicsShape(const LLUUID& mesh_id); @@ -465,8 +464,6 @@ public: S32 getActualMeshLOD(const LLVolumeParams& mesh_params, S32 lod); static S32 getActualMeshLOD(LLSD& header, S32 lod); - U32 calcResourceCost(LLSD& header); - U32 getResourceCost(const LLUUID& mesh_params); const LLMeshSkinInfo* getSkinInfo(const LLUUID& mesh_id, LLVOVolume* requesting_obj); LLModel::Decomposition* getDecomposition(const LLUUID& mesh_id); void fetchPhysicsShape(const LLUUID& mesh_id); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 6435126fc0..10887aa53a 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -364,8 +364,8 @@ LLOutfitsList::~LLOutfitsList() if (gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); - delete mCategoriesObserver; } + delete mCategoriesObserver; } BOOL LLOutfitsList::postBuild() diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index 9910a3a2ac..8fa8867c69 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" //virtual bool LLPanelAppearanceTab::canTakeOffSelected() diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 0cc5dcda82..e370f2f622 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -71,7 +71,7 @@ void LLPanelChatControlPanel::onChange(EStatusType status, const std::string &ch void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { - updateButtons(new_state >= LLVoiceChannel::STATE_CALL_STARTED); + updateButtons(new_state); } void LLPanelChatControlPanel::updateCallButton() @@ -96,11 +96,15 @@ void LLPanelChatControlPanel::updateCallButton() getChildView("call_btn")->setEnabled(enable_connect); } -void LLPanelChatControlPanel::updateButtons(bool is_call_started) +void LLPanelChatControlPanel::updateButtons(LLVoiceChannel::EState state) { + bool is_call_started = state >= LLVoiceChannel::STATE_CALL_STARTED; getChildView("end_call_btn_panel")->setVisible( is_call_started); - getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); + getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started && findChild<LLView>("voice_ctrls_btn_panel")); getChildView("call_btn_panel")->setVisible( ! is_call_started); + + getChildView("volume_ctrl_panel")->setVisible(state == LLVoiceChannel::STATE_CONNECTED); + updateCallButton(); } @@ -135,7 +139,7 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id) mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); //call (either p2p, group or ad-hoc) can be already in started state - updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); + updateButtons(voice_channel->getState()); } } @@ -156,6 +160,13 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); + + childSetAction("mute_btn", boost::bind(&LLPanelIMControlPanel::onClickMuteVolume, this)); + childSetAction("block_btn", boost::bind(&LLPanelIMControlPanel::onClickBlock, this)); + childSetAction("unblock_btn", boost::bind(&LLPanelIMControlPanel::onClickUnblock, this)); + + getChild<LLUICtrl>("volume_slider")->setCommitCallback(boost::bind(&LLPanelIMControlPanel::onVolumeChange, this, _2)); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); @@ -163,6 +174,79 @@ BOOL LLPanelIMControlPanel::postBuild() return LLPanelChatControlPanel::postBuild(); } +void LLPanelIMControlPanel::draw() +{ + bool is_muted = LLMuteList::getInstance()->isMuted(mAvatarID); + + getChild<LLUICtrl>("block_btn_panel")->setVisible(!is_muted); + getChild<LLUICtrl>("unblock_btn_panel")->setVisible(is_muted); + + if (getChildView("volume_ctrl_panel")->getVisible()) + { + + bool is_muted_voice = LLMuteList::getInstance()->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn"); + mute_btn->setValue( is_muted_voice ); + + LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider"); + volume_slider->setEnabled( !is_muted_voice ); + + F32 volume; + + if (is_muted_voice) + { + // it's clearer to display their volume as zero + volume = 0.f; + } + else + { + // actual volume + volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID); + } + volume_slider->setValue( (F64)volume ); + } + + LLPanelChatControlPanel::draw(); +} + +void LLPanelIMControlPanel::onClickMuteVolume() +{ + // By convention, we only display and toggle voice mutes, not all mutes + LLMuteList* mute_list = LLMuteList::getInstance(); + bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + if (!is_muted) + { + mute_list->add(mute, LLMute::flagVoiceChat); + } + else + { + mute_list->remove(mute, LLMute::flagVoiceChat); + } +} + +void LLPanelIMControlPanel::onClickBlock() +{ + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->add(mute); +} + +void LLPanelIMControlPanel::onClickUnblock() +{ + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->remove(mute); +} + +void LLPanelIMControlPanel::onVolumeChange(const LLSD& data) +{ + F32 volume = (F32)data.asReal(); + LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume); +} + void LLPanelIMControlPanel::onTeleportButtonClicked() { LLAvatarActions::offerTeleport(mAvatarID); @@ -262,6 +346,9 @@ void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& ful std::string avatar_name = full_name; getChild<LLTextBox>("avatar_name")->setValue(avatar_name); getChild<LLTextBox>("avatar_name")->setToolTip(avatar_name); + + bool is_linden = LLStringUtil::endsWith(full_name, " Linden"); + getChild<LLUICtrl>("mute_btn")->setEnabled( !is_linden); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 3bbe24ecb9..bba847b5d4 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -54,7 +54,7 @@ public: virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); - void updateButtons(bool is_call_started); + void updateButtons(LLVoiceChannel::EState state); // Enables/disables call button depending on voice availability void updateCallButton(); @@ -94,6 +94,12 @@ private: void onPayButtonClicked(); void onFocusReceived(); + void onClickMuteVolume(); + void onClickBlock(); + void onClickUnblock(); + /*virtual*/ void draw(); + void onVolumeChange(const LLSD& data); + LLUUID mAvatarID; }; diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index f9730d9b71..e7bdc51b4a 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -91,6 +91,12 @@ BOOL LLPanelLandAudio::postBuild() mMusicURLEdit = getChild<LLLineEditor>("music_url"); childSetCommitCallback("music_url", onCommitAny, this); + mCheckAVSoundAny = getChild<LLCheckBoxCtrl>("all av sound check"); + childSetCommitCallback("all av sound check", onCommitAny, this); + + mCheckAVSoundGroup = getChild<LLCheckBoxCtrl>("group av sound check"); + childSetCommitCallback("group av sound check", onCommitAny, this); + return TRUE; } @@ -144,6 +150,13 @@ void LLPanelLandAudio::refresh() mMusicURLEdit->setText(parcel->getMusicURL()); mMusicURLEdit->setEnabled( can_change_media ); + + BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData(); + mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds()); + mCheckAVSoundAny->setEnabled(can_change_av_sounds); + + mCheckAVSoundGroup->set(parcel->getAllowGroupAVSounds() || parcel->getAllowAnyAVSounds()); // On if "Everyone" is on + mCheckAVSoundGroup->setEnabled(can_change_av_sounds && !parcel->getAllowAnyAVSounds()); // Enabled if "Everyone" is off } } // static @@ -164,6 +177,13 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) BOOL voice_enabled = self->mCheckParcelEnableVoice->get(); BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get(); + BOOL any_av_sound = self->mCheckAVSoundAny->get(); + BOOL group_av_sound = TRUE; // If set to "Everyone" then group is checked as well + if (!any_av_sound) + { // If "Everyone" is off, use the value from the checkbox + group_av_sound = self->mCheckAVSoundGroup->get(); + } + // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(music_url); @@ -172,6 +192,8 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); parcel->setMusicURL(music_url); + parcel->setAllowAnyAVSounds(any_av_sound); + parcel->setAllowGroupAVSounds(group_av_sound); // Send current parcel data upstream to server LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index 4b0953bdc1..32a45100f4 100644 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -52,6 +52,8 @@ private: LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLLineEditor* mMusicURLEdit; LLCheckBoxCtrl* mMusicUrlCheck; + LLCheckBoxCtrl* mCheckAVSoundAny; + LLCheckBoxCtrl* mCheckAVSoundGroup; LLSafeHandle<LLParcelSelection>& mParcel; }; diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index c2729fa19b..a9cc247d1b 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -46,6 +46,7 @@ #include "llfolderviewitem.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventorypanel.h" +#include "llinventoryfunctions.h" #include "lllandmarkactions.h" #include "llmenubutton.h" #include "llplacesinventorybridge.h" @@ -529,7 +530,7 @@ void LLLandmarksPanel::setParcelID(const LLUUID& parcel_id) // virtual void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason) { - llerrs<< "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; + llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; } @@ -645,7 +646,7 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesI // Start background fetch, mostly for My Inventory and Library if (expanded) { - const LLUUID &cat_id = inventory_list->getStartFolderID(); + const LLUUID &cat_id = inventory_list->getRootFolderID(); // Just because the category itself has been fetched, doesn't mean its child folders have. /* if (!gInventory.isCategoryComplete(cat_id)) @@ -1414,7 +1415,7 @@ static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::strin static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list) { - LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getStartFolderID()); + LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getRootFolderID()); if (category) { return category->getDescendentCount() > 0; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bc4998dd0c..1920cc2940 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1,6 +1,6 @@ /** - * @file llsidepanelmaininventory.cpp - * @brief Implementation of llsidepanelmaininventory. + * @file llpanelmaininventory.cpp + * @brief Implementation of llpanelmaininventory. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -95,8 +95,8 @@ private: /// LLPanelMainInventory ///---------------------------------------------------------------------------- -LLPanelMainInventory::LLPanelMainInventory() - : LLPanel(), +LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) + : LLPanel(p), mActivePanel(NULL), mSavedFolderState(NULL), mFilterText(""), @@ -193,6 +193,9 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost); + // Trigger callback for focus received so we can deselect items in inbox/outbox + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); + return TRUE; } @@ -572,6 +575,27 @@ void LLPanelMainInventory::updateItemcountText() getChild<LLUICtrl>("ItemcountText")->setValue(text); } +void LLPanelMainInventory::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + + sidepanel_inventory->updateVerbs(); +} + void LLPanelMainInventory::setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 2b2ee1c0c9..899931aa89 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -57,7 +57,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver public: friend class LLFloaterInventoryFinder; - LLPanelMainInventory(); + LLPanelMainInventory(const LLPanel::Params& p = getDefaultParams()); ~LLPanelMainInventory(); BOOL postBuild(); @@ -114,6 +114,8 @@ protected: bool isSaveTextureEnabled(const LLSD& userdata); void updateItemcountText(); + void onFocusReceived(); + private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp new file mode 100644 index 0000000000..af74f8f261 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -0,0 +1,248 @@ +/**
+ * @file llpanelmarketplaceinbox.cpp
+ * @brief Panel for marketplace inbox
+ *
+* $LicenseInfo:firstyear=2011&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, 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$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpanelmarketplaceinbox.h"
+
+#include "llappviewer.h"
+#include "llbutton.h"
+#include "llinventorypanel.h"
+#include "llfolderview.h"
+#include "llsidepanelinventory.h"
+
+
+#define SUPPORTING_FRESH_ITEM_COUNT 0
+
+
+static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox");
+
+const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams()
+{
+ return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>();
+}
+
+// protected
+LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)
+ : LLPanel(p)
+ , mInventoryPanel(NULL)
+{
+}
+
+LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()
+{
+}
+
+// virtual
+BOOL LLPanelMarketplaceInbox::postBuild()
+{
+ LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this));
+
+ LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this));
+
+ return TRUE;
+}
+
+void LLPanelMarketplaceInbox::onSelectionChange()
+{
+ LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory"));
+
+ sidepanel_inventory->updateVerbs();
+}
+
+
+void LLPanelMarketplaceInbox::handleLoginComplete()
+{
+ // Set us up as the class to drive the badge value for the sidebar_inventory button
+ LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this);
+}
+
+void LLPanelMarketplaceInbox::setupInventoryPanel()
+{
+ LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder");
+ LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent();
+
+ mInventoryPanel =
+ LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml",
+ inbox_inventory_parent,
+ LLInventoryPanel::child_registry_t::instance());
+
+ // Reshape the inventory to the proper size
+ LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect();
+ mInventoryPanel->setShape(inventory_placeholder_rect);
+
+ // Set the sort order newest to oldest, and a selection change callback
+ mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE);
+ mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this));
+
+ // Set up the note to display when the inbox is empty
+ mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems");
+
+ // Hide the placeholder text
+ inbox_inventory_placeholder->setVisible(FALSE);
+}
+
+void LLPanelMarketplaceInbox::onFocusReceived()
+{
+ LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory");
+
+ if (sidepanel_inventory)
+ {
+ LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel();
+
+ if (inv_panel)
+ {
+ inv_panel->clearSelection();
+ }
+
+ LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox");
+
+ if (outbox_panel)
+ {
+ outbox_panel->clearSelection();
+ }
+
+ sidepanel_inventory->updateVerbs();
+ }
+}
+
+BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg)
+{
+ *accept = ACCEPT_NO;
+ return TRUE;
+}
+
+U32 LLPanelMarketplaceInbox::getFreshItemCount() const
+{
+#if SUPPORTING_FRESH_ITEM_COUNT
+
+ //
+ // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably
+ // will return "2" for the Inventory and LIBRARY top-levels when that happens.
+ //
+
+ U32 fresh_item_count = 0;
+
+ if (mInventoryPanel)
+ {
+ const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+
+ if (inbox_folder)
+ {
+ LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin();
+ LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd();
+
+ for (; folders_it != folders_end; ++folders_it)
+ {
+ const LLFolderViewFolder * folder = *folders_it;
+
+ // TODO: Replace this check with new "fresh" flag
+ if (folder->getCreationDate() > 1500)
+ {
+ fresh_item_count++;
+ }
+ }
+ }
+ }
+
+ return fresh_item_count;
+#else
+ return getTotalItemCount();
+#endif
+}
+
+U32 LLPanelMarketplaceInbox::getTotalItemCount() const
+{
+ U32 item_count = 0;
+
+ if (mInventoryPanel)
+ {
+ const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder();
+
+ if (inbox_folder)
+ {
+ item_count += inbox_folder->getFoldersCount();
+ }
+ }
+
+ return item_count;
+}
+
+std::string LLPanelMarketplaceInbox::getBadgeString() const
+{
+ std::string item_count_str("");
+
+ // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel
+ if (getParent()->getVisible() &&
+ (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")))
+ {
+ U32 item_count = getFreshItemCount();
+
+ if (item_count)
+ {
+ item_count_str = llformat("%d", item_count);
+ }
+ }
+
+ return item_count_str;
+}
+
+void LLPanelMarketplaceInbox::draw()
+{
+ U32 item_count = getTotalItemCount();
+
+ LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count");
+
+ if (item_count > 0)
+ {
+ std::string item_count_str = llformat("%d", item_count);
+
+ LLStringUtil::format_map_t args;
+ args["[NUM]"] = item_count_str;
+ getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args));
+
+#if SUPPORTING_FRESH_ITEM_COUNT
+ // set green text to fresh item count
+ U32 fresh_item_count = getFreshItemCount();
+ fresh_new_count_view->setVisible((fresh_item_count > 0));
+
+ if (fresh_item_count > 0)
+ {
+ getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count));
+ }
+#else
+ fresh_new_count_view->setVisible(FALSE);
+#endif
+ }
+ else
+ {
+ getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg"));
+
+ fresh_new_count_view->setVisible(FALSE);
+ }
+
+ LLPanel::draw();
+}
diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h new file mode 100644 index 0000000000..4ecea29304 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -0,0 +1,78 @@ +/** + * @file llpanelmarketplaceinbox.h + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLPANELMARKETPLACEINBOX_H +#define LL_LLPANELMARKETPLACEINBOX_H + +#include "llpanel.h" +#include "llsidetray.h" + +class LLInventoryPanel; + +class LLPanelMarketplaceInbox : public LLPanel, public LLSideTrayTabBadgeDriver +{ +public: + + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params() {} + }; + + LOG_CLASS(LLPanelMarketplaceInbox); + + // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 + static const LLPanelMarketplaceInbox::Params& getDefaultParams(); + + LLPanelMarketplaceInbox(const Params& p = getDefaultParams()); + ~LLPanelMarketplaceInbox(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + + /*virtual*/ void draw(); + + void setupInventoryPanel(); + + U32 getFreshItemCount() const; + U32 getTotalItemCount() const; + + std::string getBadgeString() const; + +private: + void handleLoginComplete(); + + void onSelectionChange(); + + void onFocusReceived(); + +private: + LLInventoryPanel* mInventoryPanel; +}; + + +#endif //LL_LLPANELMARKETPLACEINBOX_H + diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp new file mode 100644 index 0000000000..b644f0e5cb --- /dev/null +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -0,0 +1,167 @@ +/** + * @file llpanelmarketplaceinboxinventory.cpp + * @brief LLInboxInventoryPanel class definition + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceinboxinventory.h" + +#include "llfolderview.h" +#include "llfoldervieweventlistener.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llpanellandmarks.h" +#include "llplacesinventorybridge.h" +#include "llviewerfoldertype.h" + + +// +// statics +// + +static LLDefaultChildRegistry::Register<LLInboxInventoryPanel> r1("inbox_inventory_panel"); +static LLDefaultChildRegistry::Register<LLInboxFolderViewFolder> r2("inbox_folder_view_folder"); + + +// +// LLInboxInventoryPanel Implementation +// + +LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params& p) + : LLInventoryPanel(p) +{ +} + +LLInboxInventoryPanel::~LLInboxInventoryPanel() +{ +} + +// virtual +void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + + LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + if (root_id.isNull()) + { + std::string start_folder_name(params.start_folder()); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == start_folder_name) + { + root_id = cat->getUUID(); + break; + } + } + } + + if (root_id == LLUUID::null) + { + llwarns << "No category found that matches inbox inventory panel start_folder: " << start_folder_name << llendl; + } + } + // leslie -- end temporary HACK + + if (root_id == LLUUID::null) + { + llwarns << "Inbox inventory panel has no root folder!" << llendl; + root_id = LLUUID::generateNewID(); + } + + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); +} + +LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLInboxFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLInboxFolderViewFolder>(params); +} + + +// +// LLInboxFolderViewFolder Implementation +// + +LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) + : LLFolderViewFolder(p) + , LLBadgeOwner(getHandle()) + , mFresh(false) +{ + initBadgeParams(p.new_badge()); +} + +LLInboxFolderViewFolder::~LLInboxFolderViewFolder() +{ +} + +// virtual +void LLInboxFolderViewFolder::draw() +{ + if (!badgeHasParent()) + { + addBadgeToParentPanel(); + } + + setBadgeVisibility(mFresh); + + LLFolderViewFolder::draw(); +} + + +// eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h new file mode 100644 index 0000000000..8f198c41c1 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -0,0 +1,77 @@ +/** + * @file llpanelmarketplaceinboxinventory.h + * @brief LLInboxInventoryPanel class declaration + * + * $LicenseInfo:firstyear=2009&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_INBOXINVENTORYPANEL_H +#define LL_INBOXINVENTORYPANEL_H + + +#include "llbadgeowner.h" +#include "llinventorypanel.h" +#include "llfolderviewitem.h" + +class LLInboxInventoryPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params> + { + Params() {} + }; + + LLInboxInventoryPanel(const Params& p); + ~LLInboxInventoryPanel(); + + // virtual + void buildFolderView(const LLInventoryPanel::Params& params); + + // virtual + class LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); +}; + + +class LLInboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner +{ +public: + struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params> + { + Optional<LLBadge::Params> new_badge; + + Params() + : new_badge("new_badge") + { + } + }; + + LLInboxFolderViewFolder(const Params& p); + ~LLInboxFolderViewFolder(); + + void draw(); + +protected: + bool mFresh; +}; + + +#endif //LL_INBOXINVENTORYPANEL_H diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp new file mode 100644 index 0000000000..74d0de3b30 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -0,0 +1,209 @@ +/** + * @file llpanelmarketplaceoutbox.cpp + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceoutbox.h" + +#include "llappviewer.h" +#include "llbutton.h" +#include "llcoros.h" +#include "lleventcoro.h" +#include "llinventorypanel.h" +#include "llloadingindicator.h" +#include "llpanelmarketplaceinbox.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h" +#include "lltimer.h" + + +static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox"); + +const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>(); +} + +// protected +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p) + : LLPanel(p) + , mInventoryPanel(NULL) + , mSyncButton(NULL) + , mSyncIndicator(NULL) + , mSyncInProgress(false) +{ +} + +LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceOutbox::postBuild() +{ + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceOutbox::handleLoginComplete, this)); + + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); + + return TRUE; +} + +void LLPanelMarketplaceOutbox::handleLoginComplete() +{ + mSyncButton = getChild<LLButton>("outbox_sync_btn"); + mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); + mSyncButton->setEnabled(!isOutboxEmpty()); + + mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator"); +} + +void LLPanelMarketplaceOutbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + + sidepanel_inventory->updateVerbs(); + } +} + +void LLPanelMarketplaceOutbox::onSelectionChange() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->updateVerbs(); +} + +void LLPanelMarketplaceOutbox::setupInventoryPanel() +{ + LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder"); + LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent(); + + mInventoryPanel = + LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_outbox_inventory.xml", + outbox_inventory_parent, + LLInventoryPanel::child_registry_t::instance()); + + // Reshape the inventory to the proper size + LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect(); + mInventoryPanel->setShape(inventory_placeholder_rect); + + // Set the sort order newest to oldest, and a selection change callback + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this)); + + // Set up the note to display when the outbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems"); + + // Hide the placeholder text + outbox_inventory_placeholder->setVisible(FALSE); +} + +bool LLPanelMarketplaceOutbox::isOutboxEmpty() const +{ + // TODO: Check for contents of outbox + + return false; +} + +bool LLPanelMarketplaceOutbox::isSyncInProgress() const +{ + return mSyncInProgress; +} + + +std::string gTimeDelayDebugFunc = ""; + +void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) +{ + waitForEventOn(self, "mainloop"); + + LLTimer delayTimer; + delayTimer.reset(); + delayTimer.setTimerExpirySec(5.0f); + + while (!delayTimer.hasExpired()) + { + waitForEventOn(self, "mainloop"); + } + + outboxPanel->onSyncComplete(); + + gTimeDelayDebugFunc = ""; +} + +void LLPanelMarketplaceOutbox::onSyncButtonClicked() +{ + // TODO: Actually trigger sync to marketplace + + mSyncInProgress = true; + updateSyncButtonStatus(); + + // Set a timer (for testing only) + + gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this)); +} + +void LLPanelMarketplaceOutbox::onSyncComplete() +{ + mSyncInProgress = false; + + updateSyncButtonStatus(); +} + +void LLPanelMarketplaceOutbox::updateSyncButtonStatus() +{ + if (isSyncInProgress()) + { + mSyncButton->setVisible(false); + + mSyncIndicator->setVisible(true); + mSyncIndicator->reset(); + mSyncIndicator->start(); + } + else + { + mSyncIndicator->stop(); + mSyncIndicator->setVisible(false); + + mSyncButton->setVisible(true); + mSyncButton->setEnabled(!isOutboxEmpty()); + } +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h new file mode 100644 index 0000000000..1b502127ef --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -0,0 +1,82 @@ +/** + * @file llpanelmarketplaceoutbox.h + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLPANELMARKETPLACEOUTBOX_H +#define LL_LLPANELMARKETPLACEOUTBOX_H + +#include "llpanel.h" + + +class LLButton; +class LLInventoryPanel; +class LLLoadingIndicator; + + +class LLPanelMarketplaceOutbox : public LLPanel +{ +public: + + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params() {} + }; + + LOG_CLASS(LLPanelMarketplaceOutbox); + + // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 + static const LLPanelMarketplaceOutbox::Params& getDefaultParams(); + + LLPanelMarketplaceOutbox(const Params& p = getDefaultParams()); + ~LLPanelMarketplaceOutbox(); + + /*virtual*/ BOOL postBuild(); + + void setupInventoryPanel(); + + bool isOutboxEmpty() const; + bool isSyncInProgress() const; + + void onSyncComplete(); + +protected: + void onSyncButtonClicked(); + void updateSyncButtonStatus(); + + void handleLoginComplete(); + void onFocusReceived(); + void onSelectionChange(); + +private: + LLInventoryPanel * mInventoryPanel; + + LLButton * mSyncButton; + LLLoadingIndicator * mSyncIndicator; + bool mSyncInProgress; +}; + + +#endif //LL_LLPANELMARKETPLACEOUTBOX_H + diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index bfe6cab52f..e3b61f695a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -44,6 +44,7 @@ #include "llcallbacklist.h" #include "llbuycurrencyhtml.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfilter.h" @@ -58,8 +59,10 @@ #include "llselectmgr.h" #include "llsidetray.h" #include "llstatusbar.h" +#include "lltooldraganddrop.h" #include "lltrans.h" #include "llviewerassettype.h" +#include "llviewerinventory.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" @@ -761,7 +764,7 @@ void LLTaskCategoryBridge::openItem() BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { //llinfos << "LLTaskInvFVBridge::startDrag()" << llendl; - if(mPanel) + if(mPanel && mUUID.notNull()) { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) @@ -1349,79 +1352,81 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* LLTaskInvFVBridge* new_bridge = NULL; const LLInventoryItem* item = dynamic_cast<LLInventoryItem*>(object); const U32 itemflags = ( NULL == item ? 0 : item->getFlags() ); - LLAssetType::EType type = object->getType(); + LLAssetType::EType type = object ? object->getType() : LLAssetType::AT_CATEGORY; + LLUUID object_id = object ? object->getUUID() : LLUUID::null; + std::string object_name = object ? object->getName() : std::string(); switch(type) { case LLAssetType::AT_TEXTURE: new_bridge = new LLTaskTextureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SOUND: new_bridge = new LLTaskSoundBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LANDMARK: new_bridge = new LLTaskLandmarkBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CALLINGCARD: new_bridge = new LLTaskCallingCardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SCRIPT: // OLD SCRIPTS DEPRECATED - JC llwarns << "Old script" << llendl; //new_bridge = new LLTaskOldScriptBridge(panel, - // object->getUUID(), - // object->getName()); + // object_id, + // object_name); break; case LLAssetType::AT_OBJECT: new_bridge = new LLTaskObjectBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_NOTECARD: new_bridge = new LLTaskNotecardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_ANIMATION: new_bridge = new LLTaskAnimationBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_GESTURE: new_bridge = new LLTaskGestureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: new_bridge = new LLTaskWearableBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_CATEGORY: new_bridge = new LLTaskCategoryBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LSL_TEXT: new_bridge = new LLTaskLSLBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_MESH: new_bridge = new LLTaskMeshBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; default: llinfos << "Unhandled inventory type (llassetstorage.h): " @@ -1521,6 +1526,7 @@ void LLPanelObjectInventory::reset() p.task_id = getTaskUUID(); p.parent_panel = this; p.tool_tip= LLTrans::getString("PanelContentsTooltip"); + p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL); mFolders = LLUICtrlFactory::create<LLFolderView>(p); // this ensures that we never say "searching..." or "no items found" mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 62f582c343..35e2e96bab 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -36,7 +36,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" -#include "llfolderviewitem.h" +#include "llfolderview.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 68ecb0165c..1e9ce58237 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -70,6 +70,8 @@ static std::string icon_scripts; static std::string icon_scripts_no; static std::string icon_damage; static std::string icon_damage_no; +static std::string icon_see_avs_on; +static std::string icon_see_avs_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), @@ -114,6 +116,8 @@ BOOL LLPanelPlaceProfile::postBuild() mScriptsText = getChild<LLTextBox>("scripts_value"); mDamageIcon = getChild<LLIconCtrl>("damage_icon"); mDamageText = getChild<LLTextBox>("damage_value"); + mSeeAVsIcon = getChild<LLIconCtrl>("see_avatars_icon"); + mSeeAVsText = getChild<LLTextBox>("see_avatars_value"); mRegionNameText = getChild<LLTextBox>("region_name"); mRegionTypeText = getChild<LLTextBox>("region_type"); @@ -153,6 +157,8 @@ BOOL LLPanelPlaceProfile::postBuild() icon_scripts_no = getString("icon_ScriptsNo"); icon_damage = getString("icon_Damage"); icon_damage_no = getString("icon_DamageNo"); + icon_see_avs_on = getString("icon_SeeAVs_On"); + icon_see_avs_off = getString("icon_SeeAVs_Off"); return TRUE; } @@ -182,6 +188,8 @@ void LLPanelPlaceProfile::resetLocation() mScriptsText->setText(loading); mDamageIcon->setValue(loading); mDamageText->setText(loading); + mSeeAVsIcon->setValue(loading); + mSeeAVsText->setText(loading); mRegionNameText->setValue(loading); mRegionTypeText->setValue(loading); @@ -414,6 +422,17 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mDamageText->setText(off); } + if (parcel->getSeeAVs()) + { + mSeeAVsIcon->setValue(icon_see_avs_on); + mSeeAVsText->setText(on); + } + else + { + mSeeAVsIcon->setValue(icon_see_avs_off); + mSeeAVsText->setText(off); + } + mRegionNameText->setText(region->getName()); mRegionTypeText->setText(region->getSimProductName()); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index f28b3b3832..a33fc12ce4 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -91,6 +91,8 @@ private: LLTextBox* mScriptsText; LLIconCtrl* mDamageIcon; LLTextBox* mDamageText; + LLIconCtrl* mSeeAVsIcon; + LLTextBox* mSeeAVsText; LLTextBox* mRegionNameText; LLTextBox* mRegionTypeText; diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 30949f8f02..7087541fc8 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -102,6 +102,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON] = getChild<LLIconCtrl>("build_icon"); mParcelIcon[SCRIPTS_ICON] = getChild<LLIconCtrl>("scripts_icon"); mParcelIcon[DAMAGE_ICON] = getChild<LLIconCtrl>("damage_icon"); + mParcelIcon[SEE_AVATARS_ICON] = getChild<LLIconCtrl>("see_avatars_icon"); mParcelIcon[VOICE_ICON]->setToolTip(LLTrans::getString("LocationCtrlVoiceTooltip")); mParcelIcon[FLY_ICON]->setToolTip(LLTrans::getString("LocationCtrlFlyTooltip")); @@ -109,6 +110,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setToolTip(LLTrans::getString("LocationCtrlBuildTooltip")); mParcelIcon[SCRIPTS_ICON]->setToolTip(LLTrans::getString("LocationCtrlScriptsTooltip")); mParcelIcon[DAMAGE_ICON]->setToolTip(LLTrans::getString("LocationCtrlDamageTooltip")); + mParcelIcon[SEE_AVATARS_ICON]->setToolTip(LLTrans::getString("LocationCtrlSeeAVsTooltip")); mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON)); mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON)); @@ -116,6 +118,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON)); mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON)); + mParcelIcon[SEE_AVATARS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SEE_AVATARS_ICON)); mDamageText->setText(LLStringExplicit("100%")); } @@ -295,6 +298,7 @@ void LLPanelTopInfoBar::updateParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool see_avs = current_parcel->getSeeAVs(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -304,6 +308,7 @@ void LLPanelTopInfoBar::updateParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[SEE_AVATARS_ICON]->setVisible( !see_avs ); layoutParcelIcons(); } @@ -409,6 +414,9 @@ void LLPanelTopInfoBar::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case SEE_AVATARS_ICON: + LLNotificationsUtil::add("SeeAvatars"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index db922ef424..583e91d15e 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -65,12 +65,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + SEE_AVATARS_ICON, // 6 + ICON_COUNT // 7 total }; /** diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 911a9e5dda..0645fd8a54 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -174,8 +174,8 @@ LLPanelWearing::~LLPanelWearing() if (gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); - delete mCategoriesObserver; } + delete mCategoriesObserver; } BOOL LLPanelWearing::postBuild() diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 29e262199e..f7823f4fe8 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llinventoryfunctions.h" #include "llpanellandmarks.h" #include "llplacesinventorybridge.h" +#include "llviewerfoldertype.h" static LLDefaultChildRegistry::Register<LLPlacesInventoryPanel> r("places_inventory_panel"); @@ -56,72 +57,44 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel() delete mSavedFolderState; } -BOOL LLPlacesInventoryPanel::postBuild() +void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { - LLInventoryPanel::postBuild(); + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); - // clear Contents(); - { - mFolderRoot->destroyView(); - mFolderRoot->getParent()->removeChild(mFolderRoot); - mFolderRoot->die(); - - if( mScroller ) - { - removeChild( mScroller ); - mScroller->die(); - mScroller = NULL; - } - mFolderRoot = NULL; - } - - - mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves + LLUUID root_id; - // create root folder + if ("LIBRARY" == params.start_folder()) { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLPlacesFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); + root_id = gInventory.getLibraryRootFolderID(); } - - mCommitCallbackRegistrar.popScope(); - - mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); - - // scroller + else { - LLRect scroller_view_rect = getRect(); - scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(p); + root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); } - addChild(mScroller); - mScroller->addChild(mFolderRoot); - - mFolderRoot->setScrollContainer(mScroller); - mFolderRoot->addChild(mFolderRoot->mStatusTextBox); - - // cut subitems - mFolderRoot->setUseEllipses(true); - - return TRUE; + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLPlacesFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.parent_panel = this; + p.allow_multiselect = mAllowMultiSelect; + p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller + mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p); } + // save current folder open state void LLPlacesInventoryPanel::saveFolderState() { diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 6641871a0b..f647e7f970 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -46,7 +46,7 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void buildFolderView(const LLInventoryPanel::Params& params); void saveFolderState(); void restoreFolderState(); diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 9f5c55bad1..f47928b131 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -42,6 +42,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" +#include "llkeyboard.h" #include "llmultigesture.h" #include "llnotificationsutil.h" #include "llradiogroup.h" diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 31fde5d58a..028891a90e 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -55,23 +55,18 @@ LLProgressView* LLProgressView::sInstance = NULL; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; -const F32 FADE_IN_TIME = 1.f; - -const std::string ANIMATION_FILENAME = "Login Sequence "; -const std::string ANIMATION_SUFFIX = ".jpg"; -const F32 TOTAL_LOGIN_TIME = 10.f; // seconds, wild guess at time from GL context to actual world view -S32 gLastStartAnimationFrame = 0; // human-style indexing, first image = 1 -const S32 ANIMATION_FRAMES = 1; //13; +const F32 FADE_TO_WORLD_TIME = 1.0f; static LLRegisterPanelClassWrapper<LLProgressView> r("progress_view"); - // XUI: Translate LLProgressView::LLProgressView() : LLPanel(), mPercentDone( 0.f ), + mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), - mUpdateEvents("LLProgressView") + mUpdateEvents("LLProgressView"), + mFadeToWorldTimer() { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -80,9 +75,14 @@ BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); + // media control that is used to play intro video + mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); + mMediaCtrl->setVisible( false ); // hidden initially + mMediaCtrl->addObserver( this ); // watch events + mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); - mFadeTimer.stop(); + mFadeToWorldTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -125,24 +125,43 @@ BOOL LLProgressView::handleKeyHere(KEY key, MASK mask) return TRUE; } +void LLProgressView::revealIntroPanel() +{ + // if user hasn't yet seen intro video + std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL"); + if ( intro_url.length() > 0 && + gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) + { + // navigate to intro URL and reveal widget + mMediaCtrl->navigateTo( intro_url ); + mMediaCtrl->setVisible( TRUE ); + + // flag as having seen the new user post login intro + gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); + } + else + { + // start the timer that will control the fade through to the world view + mFadeToWorldTimer.start(); + } +} + void LLProgressView::setVisible(BOOL visible) { // hiding progress view if (getVisible() && !visible) { - mFadeTimer.start(); + LLPanel::setVisible(FALSE); } // showing progress view - else if (visible && (!getVisible() || mFadeTimer.getStarted())) + else if (visible && (!getVisible() || mFadeToWorldTimer.getStarted())) { setFocus(TRUE); - mFadeTimer.stop(); - mProgressTimer.start(); + mFadeToWorldTimer.stop(); LLPanel::setVisible(TRUE); } } - void LLProgressView::draw() { static LLTimer timer; @@ -153,7 +172,7 @@ void LLProgressView::draw() { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f); + gGL.color4f(1.f, 1.f, 1.f, 1.f); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -180,16 +199,36 @@ void LLProgressView::draw() } glPopMatrix(); - // Handle fade-in animation - if (mFadeTimer.getStarted()) + // handle fade out to world view when we're asked to + if (mFadeToWorldTimer.getStarted()) { + // draw fading panel + F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); + LLViewDrawContext context(alpha); LLPanel::draw(); - if (mFadeTimer.getElapsedTimeF32() > FADE_IN_TIME) + + // faded out completely - remove panel and reveal world + if (mFadeToWorldTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) { + mFadeToWorldTimer.stop(); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); + + // turn off panel that hosts intro so we see the world LLPanel::setVisible(FALSE); - mFadeTimer.stop(); + + // stop observing events since we no longer care + mMediaCtrl->remObserver( this ); + + // hide the intro + mMediaCtrl->setVisible( false ); + + // navigate away from intro page to something innocuous since 'unload' is broken right now + //mMediaCtrl->navigateTo( "about:blank" ); + + // FIXME: this causes a crash that i haven't been able to fix + mMediaCtrl->unloadMediaSource(); gStartTexture = NULL; } @@ -307,3 +346,12 @@ bool LLProgressView::onAlertModal(const LLSD& notify) } return false; } + +void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if( event == MEDIA_EVENT_CLOSE_REQUEST ) + { + // the intro web content calls javascript::window.close() when it's done + mFadeToWorldTimer.start(); + } +} diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index be1744f08a..73dd478e98 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -28,6 +28,7 @@ #define LL_LLPROGRESSVIEW_H #include "llpanel.h" +#include "llmediactrl.h" #include "llframetimer.h" #include "llevents.h" @@ -35,7 +36,10 @@ class LLImageRaw; class LLButton; class LLProgressBar; -class LLProgressView : public LLPanel +class LLProgressView : + public LLPanel, + public LLViewerMediaObserver + { public: LLProgressView(); @@ -49,25 +53,35 @@ public: /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void setVisible(BOOL visible); + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void setText(const std::string& text); void setPercent(const F32 percent); // Set it to NULL when you want to eliminate the message. void setMessage(const std::string& msg); + // turns on (under certain circumstances) the into video after login + void revealIntroPanel(); + void setCancelButtonVisible(BOOL b, const std::string& label); static void onCancelButtonClicked( void* ); static void onClickMessage(void*); bool onAlertModal(const LLSD& sd); + // note - this is not just hiding the intro panel - it also hides the parent panel + // and is used when the intro is finished and we want to show the world + void removeIntroPanel(); + protected: LLProgressBar* mProgressBar; + LLMediaCtrl* mMediaCtrl; F32 mPercentDone; std::string mMessage; LLButton* mCancelBtn; - LLFrameTimer mFadeTimer; - LLFrameTimer mProgressTimer; + LLFrameTimer mFadeToWorldTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp new file mode 100644 index 0000000000..6238f183c1 --- /dev/null +++ b/indra/newview/llregioninfomodel.cpp @@ -0,0 +1,216 @@ +/** + * @file llregioninfomodel.cpp + * @brief Region info model + * + * $LicenseInfo:firstyear=2011&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$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llregioninfomodel.h" + +// libs +#include "message.h" +#include "llregionflags.h" + +// viewer +#include "llagent.h" +#include "llviewerregion.h" + +void LLRegionInfoModel::reset() +{ + mSimAccess = 0; + mAgentLimit = 0; + + mRegionFlags = 0; + mEstateID = 0; + mParentEstateID = 0; + + mPricePerMeter = 0; + mRedirectGridX = 0; + mRedirectGridY = 0; + + mBillableFactor = 0.0f; + mObjectBonusFactor = 0.0f; + mWaterHeight = 0.0f; + mTerrainRaiseLimit = 0.0f; + mTerrainLowerLimit = 0.0f; + mSunHour = 0.0f; + + mUseEstateSun = false; + + mSimType.clear(); + mSimName.clear(); +} + +LLRegionInfoModel::LLRegionInfoModel() +{ + reset(); +} + +boost::signals2::connection LLRegionInfoModel::setUpdateCallback(const update_signal_t::slot_type& cb) +{ + return mUpdateSignal.connect(cb); +} + +void LLRegionInfoModel::sendRegionTerrain(const LLUUID& invoice) const +{ + std::string buffer; + std::vector<std::string> strings; + + // ========================================== + // Assemble and send setregionterrain message + // "setregionterrain" + // strings[0] = float water height + // strings[1] = float terrain raise + // strings[2] = float terrain lower + // strings[3] = 'Y' use estate time + // strings[4] = 'Y' fixed sun + // strings[5] = float sun_hour + // strings[6] = from estate, 'Y' use global time + // strings[7] = from estate, 'Y' fixed sun + // strings[8] = from estate, float sun_hour + + // *NOTE: this resets estate sun info. + BOOL estate_global_time = true; + BOOL estate_fixed_sun = false; + F32 estate_sun_hour = 0.f; + + buffer = llformat("%f", mWaterHeight); + strings.push_back(buffer); + buffer = llformat("%f", mTerrainRaiseLimit); + strings.push_back(buffer); + buffer = llformat("%f", mTerrainLowerLimit); + strings.push_back(buffer); + buffer = llformat("%s", (mUseEstateSun ? "Y" : "N")); + strings.push_back(buffer); + buffer = llformat("%s", (getUseFixedSun() ? "Y" : "N")); + strings.push_back(buffer); + buffer = llformat("%f", mSunHour); + strings.push_back(buffer); + buffer = llformat("%s", (estate_global_time ? "Y" : "N") ); + strings.push_back(buffer); + buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") ); + strings.push_back(buffer); + buffer = llformat("%f", estate_sun_hour); + strings.push_back(buffer); + + sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); +} + +bool LLRegionInfoModel::getUseFixedSun() const +{ + return mRegionFlags & REGION_FLAGS_SUN_FIXED; +} + +void LLRegionInfoModel::setUseFixedSun(bool fixed) +{ + if (fixed) + { + mRegionFlags |= REGION_FLAGS_SUN_FIXED; + } + else + { + mRegionFlags &= ~REGION_FLAGS_SUN_FIXED; + } +} + +void LLRegionInfoModel::update(LLMessageSystem* msg) +{ + reset(); + + msg->getStringFast(_PREHASH_RegionInfo, _PREHASH_SimName, mSimName); + msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_EstateID, mEstateID); + msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_ParentEstateID, mParentEstateID); + msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, mRegionFlags); + msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_SimAccess, mSimAccess); + msg->getU8Fast(_PREHASH_RegionInfo, _PREHASH_MaxAgents, mAgentLimit); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_ObjectBonusFactor, mObjectBonusFactor); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_BillableFactor, mBillableFactor); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, mWaterHeight); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, mTerrainRaiseLimit); + msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, mTerrainLowerLimit); + msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_PricePerMeter, mPricePerMeter); + msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridX, mRedirectGridX); + msg->getS32Fast(_PREHASH_RegionInfo, _PREHASH_RedirectGridY, mRedirectGridY); + + msg->getBOOL(_PREHASH_RegionInfo, _PREHASH_UseEstateSun, mUseEstateSun); + + // actually the "last set" sun hour, not the current sun hour. JC + msg->getF32(_PREHASH_RegionInfo, _PREHASH_SunHour, mSunHour); + + // the only reasonable way to decide if we actually have any data is to + // check to see if any of these fields have nonzero sizes + if (msg->getSize(_PREHASH_RegionInfo2, _PREHASH_ProductSKU) > 0 || + msg->getSize(_PREHASH_RegionInfo2, "ProductName") > 0) + { + msg->getString(_PREHASH_RegionInfo2, "ProductName", mSimType); + } + + // Let interested parties know that region info has been updated. + mUpdateSignal(); +} + +// static +void LLRegionInfoModel::sendEstateOwnerMessage( + LLMessageSystem* msg, + const std::string& request, + const LLUUID& invoice, + const std::vector<std::string>& strings) +{ + LLViewerRegion* cur_region = gAgent.getRegion(); + + if (!cur_region) + { + llwarns << "Agent region not set" << llendl; + return; + } + + llinfos << "Sending estate request '" << request << "'" << llendl; + msg->newMessage("EstateOwnerMessage"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used + msg->nextBlock("MethodData"); + msg->addString("Method", request); + msg->addUUID("Invoice", invoice); + + if (strings.empty()) + { + msg->nextBlock("ParamList"); + msg->addString("Parameter", NULL); + } + else + { + std::vector<std::string>::const_iterator it = strings.begin(); + std::vector<std::string>::const_iterator end = strings.end(); + for (unsigned i = 0; it != end; ++it, ++i) + { + lldebugs << "- [" << i << "] " << (*it) << llendl; + msg->nextBlock("ParamList"); + msg->addString("Parameter", *it); + } + } + + msg->sendReliable(cur_region->getHost()); +} diff --git a/indra/newview/llregioninfomodel.h b/indra/newview/llregioninfomodel.h new file mode 100644 index 0000000000..89efd82767 --- /dev/null +++ b/indra/newview/llregioninfomodel.h @@ -0,0 +1,99 @@ +/** + * @file llregioninfomodel.h + * @brief Region info model + * + * $LicenseInfo:firstyear=2011&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_LLREGIONINFOMODEL_H +#define LL_LLREGIONINFOMODEL_H + +class LLMessageSystem; + +#include "llsingleton.h" + +/** + * Contains region info, notifies interested parties of its changes. + */ +class LLRegionInfoModel : public LLSingleton<LLRegionInfoModel> +{ + LOG_CLASS(LLRegionInfoModel); + +public: + typedef boost::signals2::signal<void()> update_signal_t; + boost::signals2::connection setUpdateCallback(const update_signal_t::slot_type& cb); + + void sendRegionTerrain(const LLUUID& invoice) const; /// upload region terrain data + + bool getUseFixedSun() const; + + void setUseFixedSun(bool fixed); + + // *TODO: Add getters and make the data private. + U8 mSimAccess; + U8 mAgentLimit; + + U32 mRegionFlags; + U32 mEstateID; + U32 mParentEstateID; + + S32 mPricePerMeter; + S32 mRedirectGridX; + S32 mRedirectGridY; + + F32 mBillableFactor; + F32 mObjectBonusFactor; + F32 mWaterHeight; + F32 mTerrainRaiseLimit; + F32 mTerrainLowerLimit; + F32 mSunHour; // 6..30 + + BOOL mUseEstateSun; + + std::string mSimName; + std::string mSimType; + +protected: + friend class LLSingleton<LLRegionInfoModel>; + friend class LLViewerRegion; + + LLRegionInfoModel(); + + /** + * Refresh model with data from the incoming server message. + */ + void update(LLMessageSystem* msg); + +private: + void reset(); + + // *FIXME: Duplicated code from LLPanelRegionInfo + static void sendEstateOwnerMessage( + LLMessageSystem* msg, + const std::string& request, + const LLUUID& invoice, + const std::vector<std::string>& strings); + + update_signal_t mUpdateSignal; +}; + +#endif // LL_LLREGIONINFOMODEL_H diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 16729f045a..28ec11d1c7 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -32,6 +32,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llfolderview.h" #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 31ea542743..65655f82cd 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -29,33 +29,147 @@ #include "llagent.h" #include "llappearancemgr.h" +#include "llappviewer.h" #include "llavataractions.h" #include "llbutton.h" +#include "lldate.h" #include "llfirstuse.h" +#include "llfoldertype.h" +#include "llhttpclient.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llinventorymodelbackgroundfetch.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" +#include "lllayoutstack.h" #include "lloutfitobserver.h" #include "llpanelmaininventory.h" +#include "llpanelmarketplaceinbox.h" +#include "llpanelmarketplaceoutbox.h" +#include "llselectmgr.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" +#include "llstring.h" #include "lltabcontainer.h" -#include "llselectmgr.h" +#include "llviewermedia.h" #include "llweb.h" static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); -LLSidepanelInventory::LLSidepanelInventory() - : LLPanel(), - mItemPanel(NULL), - mPanelMainInventory(NULL) +// +// Constants +// + +static const char * const INBOX_EXPAND_TIME_SETTING = "LastInventoryInboxExpand"; + +static const char * const INBOX_BUTTON_NAME = "inbox_btn"; +static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; + +static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; +static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; +static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; + +static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; +static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; + +static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; + +static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; +static const char * const MARKETPLACE_OUTBOX_PANEL = "marketplace_outbox"; + +// +// Helpers +// + +class LLInboxOutboxAddedObserver : public LLInventoryCategoryAddedObserver { +public: + LLInboxOutboxAddedObserver(LLSidepanelInventory * sidepanelInventory) + : LLInventoryCategoryAddedObserver() + , mSidepanelInventory(sidepanelInventory) + { + } + + void done() + { + for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) + { + LLViewerInventoryCategory* added_category = *it; + + LLFolderType::EType added_category_type = added_category->getPreferredType(); + + switch (added_category_type) + { + case LLFolderType::FT_INBOX: + mSidepanelInventory->observeInboxModifications(added_category->getUUID()); + break; + case LLFolderType::FT_OUTBOX: + mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); + break; + case LLFolderType::FT_NONE: + // HACK until sim update to properly create folder with system type + if (added_category->getName() == "Received Items") + { + mSidepanelInventory->observeInboxModifications(added_category->getUUID()); + } + else if (added_category->getName() == "Merchant Outbox") + { + mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); + } + default: + break; + } + } + } + +private: + LLSidepanelInventory * mSidepanelInventory; +}; +// +// Implementation +// + +LLSidepanelInventory::LLSidepanelInventory() + : LLPanel() + , mItemPanel(NULL) + , mPanelMainInventory(NULL) + , mInboxEnabled(false) + , mOutboxEnabled(false) + , mCategoriesObserver(NULL) + , mInboxOutboxAddedObserver(NULL) +{ //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLSidepanelInventory::~LLSidepanelInventory() { + if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) + { + gInventory.removeObserver(mCategoriesObserver); + } + delete mCategoriesObserver; + + if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver)) + { + gInventory.removeObserver(mInboxOutboxAddedObserver); + } + delete mInboxOutboxAddedObserver; +} + +void handleInventoryDisplayInboxChanged() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); +} + +void handleInventoryDisplayOutboxChanged() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox")); } BOOL LLSidepanelInventory::postBuild() @@ -85,7 +199,7 @@ BOOL LLSidepanelInventory::postBuild() mOverflowBtn = mInventoryPanel->getChild<LLButton>("overflow_btn"); mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); - mPanelMainInventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs"); tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this)); @@ -103,7 +217,7 @@ BOOL LLSidepanelInventory::postBuild() // UI elements from item panel { - mItemPanel = findChild<LLSidepanelItemInfo>("sidepanel__item_panel"); + mItemPanel = getChild<LLSidepanelItemInfo>("sidepanel__item_panel"); LLButton* back_btn = mItemPanel->getChild<LLButton>("back_btn"); back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); @@ -119,13 +233,263 @@ BOOL LLSidepanelInventory::postBuild() } } + // Marketplace inbox/outbox setup + { + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + + // Disable user_resize on main inventory panel by default + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(OUTBOX_LAYOUT_PANEL_NAME, false); + + // Collapse both inbox and outbox panels + stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true); + stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true); + + // Set up button states and callbacks + LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); + LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME); + + inbox_button->setToggleState(false); + outbox_button->setToggleState(false); + + inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + // Set the inbox and outbox visible based on debug settings (final setting comes from http request below) + enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); + enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox")); + + // Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); + } + + gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); + gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged)); + return TRUE; } +void LLSidepanelInventory::handleLoginComplete() +{ + // + // Track inbox and outbox folder changes + // + + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + // Set up observer to listen for creation of inbox and outbox if at least one of them doesn't exist + if (inbox_id.isNull() || outbox_id.isNull()) + { + observeInboxOutboxCreation(); + } + + // Set up observer for inbox changes, if we have an inbox already + if (!inbox_id.isNull()) + { + observeInboxModifications(inbox_id); + + // Enable the display of the inbox if it exists + enableInbox(true); + } + + // Set up observer for outbox changes, if we have an outbox already + if (!outbox_id.isNull()) + { + observeOutboxModifications(outbox_id); + + // Enable the display of the outbox if it exists + //enableOutbox(true); + // leslie NOTE: Disabling outbox until we support it officially. + } +} + +void LLSidepanelInventory::observeInboxOutboxCreation() +{ + // + // Set up observer to track inbox and outbox folder creation + // + + if (mInboxOutboxAddedObserver == NULL) + { + mInboxOutboxAddedObserver = new LLInboxOutboxAddedObserver(this); + + gInventory.addObserver(mInboxOutboxAddedObserver); + } +} + +void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) +{ + // + // Track inbox and outbox folder changes + // + + if (inboxID.isNull()) + { + llwarns << "Attempting to track modifications to non-existant inbox" << llendl; + return; + } + + if (mCategoriesObserver == NULL) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + } + + mCategoriesObserver->addCategory(inboxID, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inboxID)); + + // + // Trigger a load for the entire contents of the Inbox + // + + LLInventoryModelBackgroundFetch::instance().start(inboxID); + + // + // Set up the inbox inventory view + // + + LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + inbox->setupInventoryPanel(); +} + + +void LLSidepanelInventory::observeOutboxModifications(const LLUUID& outboxID) +{ + // + // Track outbox folder changes + // + + if (outboxID.isNull()) + { + llwarns << "Attempting to track modifications to non-existant outbox" << llendl; + return; + } + + if (mCategoriesObserver == NULL) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + } + + mCategoriesObserver->addCategory(outboxID, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outboxID)); + + // + // Set up the outbox inventory view + // + + LLPanelMarketplaceOutbox * outbox = getChild<LLPanelMarketplaceOutbox>(MARKETPLACE_OUTBOX_PANEL); + outbox->setupInventoryPanel(); +} + +void LLSidepanelInventory::enableInbox(bool enabled) +{ + mInboxEnabled = enabled; + getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); +} + +void LLSidepanelInventory::enableOutbox(bool enabled) +{ + mOutboxEnabled = enabled; + getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); +} + +void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) +{ + // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting + LLInventoryModelBackgroundFetch::instance().start(inbox_id); + + // Expand the inbox since we have fresh items + LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + if (inbox && (inbox->getFreshItemCount() > 0)) + { + getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } +} + +void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) +{ + // Perhaps use this to track outbox changes? +} + +bool manageInboxOutboxPanels(LLLayoutStack * stack, + LLButton * pressedButton, LLLayoutPanel * pressedPanel, + LLButton * otherButton, LLLayoutPanel * otherPanel) +{ + bool expand = pressedButton->getToggleState(); + bool otherExpanded = otherButton->getToggleState(); + + // + // NOTE: Ideally we could have two panel sizes stored for a collapsed and expanded minimum size. + // For now, leave this code disabled because it creates some bad artifacts when expanding + // and collapsing the inbox/outbox. + // + //S32 smallMinSize = (expand ? pressedPanel->getMinDim() : otherPanel->getMinDim()); + //S32 pressedMinSize = (expand ? 2 * smallMinSize : smallMinSize); + //otherPanel->setMinDim(smallMinSize); + //pressedPanel->setMinDim(pressedMinSize); + + if (expand && otherExpanded) + { + // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size + pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight()); + + stack->collapsePanel(otherPanel, true); + otherButton->setToggleState(false); + } + + stack->collapsePanel(pressedPanel, !expand); + + // Enable user_resize on main inventory panel only when a marketplace box is expanded + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); + + return expand; +} + +void LLSidepanelInventory::onToggleInboxBtn() +{ + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLButton* pressedButton = getChild<LLButton>(INBOX_BUTTON_NAME); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); + LLButton* otherButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); + + bool inboxExpanded = manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + + if (inboxExpanded) + { + // Save current time as a setting for future new-ness tests + gSavedSettings.setString(INBOX_EXPAND_TIME_SETTING, LLDate::now().asString()); + } +} + +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLButton* pressedButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); + LLButton* otherButton = getChild<LLButton>(INBOX_BUTTON_NAME); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); + + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); +} + void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); + // Expand the inbox if we have fresh items + LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + if (inbox && (inbox->getFreshItemCount() > 0)) + { + getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } + if(key.size() == 0) return; @@ -171,26 +535,29 @@ void LLSidepanelInventory::onShopButtonClicked() void LLSidepanelInventory::performActionOnSelection(const std::string &action) { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return; + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + } + + if (!current_item) + { + return; + } } + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); - return; - } - // Get selected items set. - const std::set<LLUUID> selected_uuids_set = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); + const std::set<LLUUID> selected_uuids_set = LLAvatarActions::getInventorySelectedUUIDs(); if (selected_uuids_set.empty()) return; // nothing selected // Convert the set to a vector. @@ -329,31 +696,28 @@ bool LLSidepanelInventory::canShare() LLPanelMainInventory* panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + + // Avoid flicker in the Recent tab while inventory is being loaded. + if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty()) + && (panel_main_inventory && !panel_main_inventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) ) { - llwarns << "Failed to get the main inventory panel" << llendl; return false; } - LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel(); - // Avoid flicker in the Recent tab while inventory is being loaded. - if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; - - return LLAvatarActions::canShareSelectedItems(active_panel); + return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false) + || (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) ); } + bool LLSidepanelInventory::canWearSelected() { - LLPanelMainInventory* panel_main_inventory = - mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); + std::set<LLUUID> selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + + if (selected_uuids.empty()) return false; - } - std::set<LLUUID> selected_uuids = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); for (std::set<LLUUID>::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); ++it) @@ -366,11 +730,20 @@ bool LLSidepanelInventory::canWearSelected() LLInventoryItem *LLSidepanelInventory::getSelectedItem() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return NULL; + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + } + + if (!current_item) + { + return NULL; + } } const LLUUID &item_id = current_item->getListener()->getUUID(); LLInventoryItem *item = gInventory.getItem(item_id); @@ -379,9 +752,20 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() U32 LLSidepanelInventory::getSelectedCount() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + int count = 0; + + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); - return selection_list.size(); + count += selection_list.size(); + + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + selection_list = inbox->getRootFolder()->getSelectionList(); + count += selection_list.size(); + } + + return count; } LLInventoryPanel *LLSidepanelInventory::getActivePanel() diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 32c98bc034..9117e3bf27 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -30,6 +30,8 @@ #include "llpanel.h" class LLFolderViewItem; +class LLInboxOutboxAddedObserver; +class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; class LLPanelMainInventory; @@ -42,6 +44,14 @@ public: LLSidepanelInventory(); virtual ~LLSidepanelInventory(); +private: + void handleLoginComplete(); + +public: + void observeInboxOutboxCreation(); + void observeInboxModifications(const LLUUID& inboxID); + void observeOutboxModifications(const LLUUID& outboxID); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -56,6 +66,17 @@ public: // checks can share selected item(s) bool canShare(); + void onToggleInboxBtn(); + void onToggleOutboxBtn(); + + void enableInbox(bool enabled); + void enableOutbox(bool enabled); + + bool isInboxEnabled() const { return mInboxEnabled; } + bool isOutboxEnabled() const { return mOutboxEnabled; } + + void updateVerbs(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -63,10 +84,12 @@ protected: void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); // "wear", "teleport", etc. void performActionOnSelection(const std::string &action); - void updateVerbs(); bool canWearSelected(); // check whether selected items can be worn + void onInboxChanged(const LLUUID& inbox_id); + void onOutboxChanged(const LLUUID& outbox_id); + // // UI Elements // @@ -85,6 +108,7 @@ protected: void onTeleportButtonClicked(); void onOverflowButtonClicked(); void onBackButtonClicked(); + private: LLButton* mInfoBtn; LLButton* mShareBtn; @@ -94,6 +118,11 @@ private: LLButton* mOverflowBtn; LLButton* mShopBtn; + bool mInboxEnabled; + bool mOutboxEnabled; + + LLInventoryCategoriesObserver* mCategoriesObserver; + LLInboxOutboxAddedObserver* mInboxOutboxAddedObserver; }; #endif //LL_LLSIDEPANELINVENTORY_H diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 37b10b592f..2918bb388a 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -46,8 +46,8 @@ ///---------------------------------------------------------------------------- // Default constructor -LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel() - : LLPanel(), +LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel(const LLPanel::Params& p) + : LLPanel(p), mIsDirty(TRUE), mIsEditing(FALSE), mCancelBtn(NULL), diff --git a/indra/newview/llsidepanelinventorysubpanel.h b/indra/newview/llsidepanelinventorysubpanel.h index b2de7d3b0b..b5cf3aaf17 100644 --- a/indra/newview/llsidepanelinventorysubpanel.h +++ b/indra/newview/llsidepanelinventorysubpanel.h @@ -40,7 +40,7 @@ class LLInventoryItem; class LLSidepanelInventorySubpanel : public LLPanel { public: - LLSidepanelInventorySubpanel(); + LLSidepanelInventorySubpanel(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelInventorySubpanel(); /*virtual*/ void setVisible(BOOL visible); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index fbd2f7ca83..1ce05da849 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -130,9 +130,10 @@ void LLObjectInventoryObserver::inventoryChanged(LLViewerObject* object, static LLRegisterPanelClassWrapper<LLSidepanelItemInfo> t_item_info("sidepanel_item_info"); // Default constructor -LLSidepanelItemInfo::LLSidepanelItemInfo() - : mItemID(LLUUID::null) - , mObjectInventoryObserver(NULL) +LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) + : LLSidepanelInventorySubpanel(p) + , mItemID(LLUUID::null) + , mObjectInventoryObserver(NULL) { mPropertiesObserver = new LLItemPropertiesObserver(this); } diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 25be145f64..12aaca923e 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -44,7 +44,7 @@ class LLPermissions; class LLSidepanelItemInfo : public LLSidepanelInventorySubpanel { public: - LLSidepanelItemInfo(); + LLSidepanelItemInfo(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelItemInfo(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 631b244785..651897a217 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -30,6 +30,7 @@ #include "llagentcamera.h" #include "llappviewer.h" +#include "llbadge.h" #include "llbottomtray.h" #include "llfloaterreg.h" #include "llfirstuse.h" @@ -40,6 +41,7 @@ #include "llfocusmgr.h" #include "llrootview.h" #include "llnavigationbar.h" +#include "llpanelmarketplaceinbox.h" #include "llaccordionctrltab.h" @@ -113,11 +115,14 @@ public: Optional<std::string> image_selected; Optional<std::string> tab_title; Optional<std::string> description; + Optional<LLBadge::Params> badge; + Params() : image("image"), image_selected("image_selected"), tab_title("tab_title","no title"), - description("description","no description") + description("description","no description"), + badge("badge") {}; }; protected: @@ -140,7 +145,6 @@ public: static LLSideTrayTab* createInstance (); const std::string& getDescription () const { return mDescription;} - const std::string& getTabTitle() const { return mTabTitle;} void onOpen (const LLSD& key); @@ -150,7 +154,10 @@ public: BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - LLPanel *getPanel(); + LLPanel* getPanel(); + + LLButton* createButton(bool allowTearOff, LLUICtrl::commit_callback_t callback); + private: std::string mTabTitle; std::string mImage; @@ -158,6 +165,9 @@ private: std::string mDescription; LLView* mMainPanel; + + bool mHasBadge; + LLBadge::Params mBadgeParams; }; LLSideTrayTab::LLSideTrayTab(const Params& p) @@ -166,8 +176,10 @@ LLSideTrayTab::LLSideTrayTab(const Params& p) mImage(p.image), mImageSelected(p.image_selected), mDescription(p.description), - mMainPanel(NULL) + mMainPanel(NULL), + mBadgeParams(p.badge) { + mHasBadge = p.badge.isProvided(); } LLSideTrayTab::~LLSideTrayTab() @@ -182,8 +194,6 @@ bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) //return res; } - - //virtual BOOL LLSideTrayTab::postBuild() { @@ -196,7 +206,7 @@ BOOL LLSideTrayTab::postBuild() getChild<LLButton>("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, false)); getChild<LLButton>("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, true)); - return true; + return LLPanel::postBuild(); } static const S32 splitter_margin = 1; @@ -523,18 +533,36 @@ public: return FALSE; } + void setBadgeDriver(LLSideTrayTabBadgeDriver* driver) + { + mBadgeDriver = driver; + } + protected: LLSideTrayButton(const LLButton::Params& p) - : LLButton(p) - , mDragLastScreenX(0) - , mDragLastScreenY(0) + : LLButton(p) + , mDragLastScreenX(0) + , mDragLastScreenY(0) + , mBadgeDriver(NULL) {} friend class LLUICtrlFactory; + void draw() + { + if (mBadgeDriver) + { + setBadgeLabel(mBadgeDriver->getBadgeString()); + } + + LLButton::draw(); + } + private: S32 mDragLastScreenX; S32 mDragLastScreenY; + + LLSideTrayTabBadgeDriver* mBadgeDriver; }; ////////////////////////////////////////////////////////////////////////////// @@ -615,11 +643,31 @@ BOOL LLSideTray::postBuild() return true; } +void LLSideTray::setTabButtonBadgeDriver(std::string tabName, LLSideTrayTabBadgeDriver* driver) +{ + mTabButtonBadgeDrivers[tabName] = driver; +} + void LLSideTray::handleLoginComplete() { //reset tab to "home" tab if it was changesd during login process selectTabByName("sidebar_home"); + for (badge_map_t::iterator it = mTabButtonBadgeDrivers.begin(); it != mTabButtonBadgeDrivers.end(); ++it) + { + LLButton* button = mTabButtons[it->first]; + LLSideTrayButton* side_button = dynamic_cast<LLSideTrayButton*>(button); + + if (side_button) + { + side_button->setBadgeDriver(it->second); + } + else + { + llwarns << "Unable to find button " << it->first << " to set the badge driver. " << llendl; + } + } + detachTabs(); } @@ -766,51 +814,6 @@ bool LLSideTray::selectTabByName(const std::string& name, bool keep_prev_visible return true; } -LLButton* LLSideTray::createButton (const std::string& name,const std::string& image,const std::string& tooltip, - LLUICtrl::commit_callback_t callback) -{ - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - LLButton::Params bparams; - - LLRect rect; - rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); - - bparams.name(name); - bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); - bparams.rect (rect); - bparams.tab_stop(false); - bparams.image_unselected(sidetray_params.tab_btn_image_normal); - bparams.image_selected(sidetray_params.tab_btn_image_selected); - bparams.image_disabled(sidetray_params.tab_btn_image_normal); - bparams.image_disabled_selected(sidetray_params.tab_btn_image_selected); - - LLButton* button; - if (name == "sidebar_openclose") - { - // "Open/Close" button shouldn't allow "tear off" - // hence it is created as LLButton instance. - button = LLUICtrlFactory::create<LLButton>(bparams); - } - else - { - button = LLUICtrlFactory::create<LLSideTrayButton>(bparams); - } - - button->setClickedCallback(callback); - - button->setToolTip(tooltip); - - if(image.length()) - { - button->setImageOverlay(image); - } - - mButtonsPanel->addChildInBack(button); - - return button; -} - bool LLSideTray::addChild(LLView* view, S32 tab_group) { LLSideTrayTab* tab_panel = dynamic_cast<LLSideTrayTab*>(view); @@ -938,7 +941,56 @@ bool LLSideTray::addTab(LLSideTrayTab* tab) return true; } -void LLSideTray::createButtons () +LLButton* LLSideTrayTab::createButton(bool allowTearOff, LLUICtrl::commit_callback_t callback) +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); + + LLRect rect; + rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); + + LLButton::Params bparams; + + // Append "_button" to the side tray tab name + std::string button_name = getName() + "_button"; + bparams.name(button_name); + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); + bparams.rect (rect); + bparams.tab_stop(false); + bparams.image_unselected(sidetray_params.tab_btn_image_normal); + bparams.image_selected(sidetray_params.tab_btn_image_selected); + bparams.image_disabled(sidetray_params.tab_btn_image_normal); + bparams.image_disabled_selected(sidetray_params.tab_btn_image_selected); + + if (mHasBadge) + { + bparams.badge = mBadgeParams; + } + + LLButton* button; + if (allowTearOff) + { + button = LLUICtrlFactory::create<LLSideTrayButton>(bparams); + } + else + { + // "Open/Close" button shouldn't allow "tear off" + // hence it is created as LLButton instance. + button = LLUICtrlFactory::create<LLButton>(bparams); + } + + button->setClickedCallback(callback); + + button->setToolTip(mTabTitle); + + if(mImage.length()) + { + button->setImageOverlay(mImage); + } + + return button; +} + +void LLSideTray::createButtons() { //create buttons for tabs child_vector_const_iter_t child_it = mTabs.begin(); @@ -951,17 +1003,22 @@ void LLSideTray::createButtons () // The "OpenClose" button will open/close the whole panel if (name == "sidebar_openclose") { - mCollapseButton = createButton(name,sidebar_tab->mImage,sidebar_tab->getTabTitle(), - boost::bind(&LLSideTray::onToggleCollapse, this)); + mCollapseButton = sidebar_tab->createButton(false, boost::bind(&LLSideTray::onToggleCollapse, this)); + + mButtonsPanel->addChildInBack(mCollapseButton); + LLHints::registerHintTarget("side_panel_btn", mCollapseButton->getHandle()); } else { - LLButton* button = createButton(name,sidebar_tab->mImage,sidebar_tab->getTabTitle(), - boost::bind(&LLSideTray::onTabButtonClick, this, name)); + LLButton* button = sidebar_tab->createButton(true, boost::bind(&LLSideTray::onTabButtonClick, this, name)); + + mButtonsPanel->addChildInBack(button); + mTabButtons[name] = button; } } + LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle()); } diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 24882411f4..17158329dc 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -33,6 +33,13 @@ class LLAccordionCtrl; class LLSideTrayTab; +// Define an interface for side tab button badge values +class LLSideTrayTabBadgeDriver +{ +public: + virtual std::string getBadgeString() const = 0; +}; + // Deal with LLSideTrayTab being opaque. Generic do-nothing cast... template <class T> T tab_cast(LLSideTrayTab* tab) { return tab; } @@ -166,6 +173,8 @@ public: bool getCollapsed() { return mCollapsed; } + void setTabButtonBadgeDriver(std::string tabName, LLSideTrayTabBadgeDriver* driver); + public: virtual ~LLSideTray(){}; @@ -204,8 +213,6 @@ protected: void createButtons (); - LLButton* createButton (const std::string& name,const std::string& image,const std::string& tooltip, - LLUICtrl::commit_callback_t callback); void arrange (); void detachTabs (); void reflectCollapseChange(); @@ -234,6 +241,8 @@ private: LLPanel* mButtonsPanel; typedef std::map<std::string,LLButton*> button_map_t; button_map_t mTabButtons; + typedef std::map<std::string,LLSideTrayTabBadgeDriver*> badge_map_t; + badge_map_t mTabButtonBadgeDrivers; child_vector_t mTabs; child_vector_t mDetachedTabs; tab_order_vector_t mOriginalTabOrder; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index a5b91729e8..f99afa923b 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2785,7 +2785,7 @@ void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) gGL.color4f(0,1,1,1); break; case LLViewerObject::LL_VO_CLOUDS: - gGL.color4f(0.5f,0.5f,0.5f,1.0f); + // no longer used break; case LLViewerObject::LL_VO_PART_GROUP: case LLViewerObject::LL_VO_HUD_PART_GROUP: diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index db8a0c2992..54d5d36f6e 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -664,13 +664,6 @@ public: LLGrassPartition(); }; -//spatial partition for clouds (implemented in LLVOClouds.cpp) -class LLCloudPartition : public LLParticlePartition -{ -public: - LLCloudPartition(); -}; - //class for wrangling geometry out of volumes (implemented in LLVOVolume.cpp) class LLVolumeGeometryManager: public LLGeometryManager { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 86b09473ab..4dfcb85295 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -76,6 +76,7 @@ #include "lluserrelations.h" #include "llversioninfo.h" #include "llviewercontrol.h" +#include "llviewerhelp.h" #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address #include "llwindow.h" @@ -163,7 +164,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llvoavatarself.h" -#include "llvoclouds.h" #include "llweb.h" #include "llworld.h" #include "llworldmapmessage.h" @@ -1171,8 +1171,6 @@ bool idle_startup() // init the shader managers LLPostProcess::initClass(); - LLWLParamManager::initClass(); - LLWaterParamManager::initClass(); LLViewerObject::initVOClasses(); @@ -1692,11 +1690,22 @@ bool idle_startup() gViewerThrottle.setMaxBandwidth(FAST_RATE_BPS / 1024.f); } + if (gSavedSettings.getBOOL("ShowHelpOnFirstLogin")) + { + gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); + } + // Set the show start location to true, now that the user has logged // on with this install. gSavedSettings.setBOOL("ShowStartLocation", TRUE); } + if (gSavedSettings.getBOOL("HelpFloaterOpen")) + { + // show default topic + LLViewerHelp::instance().showTopic(""); + } + // We're successfully logged in. gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE); @@ -1953,7 +1962,8 @@ bool idle_startup() gViewerWindow->getWindow()->resetBusyCount(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL; - gViewerWindow->setShowProgress(FALSE); + gViewerWindow->revealIntroPanel(); + //gViewerWindow->setShowProgress(FALSE); // reveal intro video now handles this gViewerWindow->setProgressCancelButtonVisible(FALSE); // We're not away from keyboard, even though login might have taken @@ -3150,11 +3160,6 @@ bool process_login_success_response() gMoonTextureID = id; } - id = global_textures["cloud_texture_id"]; - if(id.notNull()) - { - gCloudTextureID = id; - } } // Set the location of the snapshot sharing config endpoint diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1023a4339b..de22f2ae6b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -420,7 +420,6 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryPanel->setAllowMultiSelect(FALSE); // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. @@ -1093,7 +1092,7 @@ public: BOOL LLTextureCtrl::handleHover(S32 x, S32 y, MASK mask) { - getWindow()->setCursor(UI_CURSOR_HAND); + getWindow()->setCursor(mBorder->parentPointInView(x,y) ? UI_CURSOR_HAND : UI_CURSOR_ARROW); return TRUE; } @@ -1102,7 +1101,7 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleMouseDown( x, y , mask ); - if( !handled ) + if (!handled && mBorder->parentPointInView(x, y)) { showPicker(FALSE); //grab textures first... diff --git a/indra/newview/lluploadfloaterobservers.h b/indra/newview/lluploadfloaterobservers.h index c912c9755a..79aad282d7 100644 --- a/indra/newview/lluploadfloaterobservers.h +++ b/indra/newview/lluploadfloaterobservers.h @@ -53,7 +53,7 @@ public: LLWholeModelFeeObserver() { mWholeModelFeeObserverHandle.bind(this); } virtual ~LLWholeModelFeeObserver() {} - virtual void onModelPhysicsFeeReceived(F64 physics, S32 fee, std::string upload_url) = 0; + virtual void onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) = 0; virtual void setModelPhysicsFeeErrorStatus(U32 status, const std::string& reason) = 0; LLHandle<LLWholeModelFeeObserver> getWholeModelFeeObserverHandle() const { return mWholeModelFeeObserverHandle; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index f725f0fe86..911fc8e1ed 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -178,8 +178,8 @@ void display_update_camera() gViewerWindow->setup3DRender(); // update all the sky/atmospheric/water settings - LLWLParamManager::instance()->update(LLViewerCamera::getInstance()); - LLWaterParamManager::instance()->update(LLViewerCamera::getInstance()); + LLWLParamManager::getInstance()->update(LLViewerCamera::getInstance()); + LLWaterParamManager::getInstance()->update(LLViewerCamera::getInstance()); // Update land visibility too LLWorld::getInstance()->setLandFarClip(final_far); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index f3b22eab40..26f05337a4 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -48,11 +48,14 @@ #include "llfloaterbulkpermission.h" #include "llfloaterbump.h" #include "llfloatercamera.h" -#include "llfloaterdaycycle.h" +#include "llfloaterdeleteenvpreset.h" #include "llfloaterdisplayname.h" +#include "llfloatereditdaycycle.h" +#include "llfloatereditsky.h" +#include "llfloatereditwater.h" +#include "llfloaterenvironmentsettings.h" #include "llfloaterevent.h" #include "llfloatersearch.h" -#include "llfloaterenvsettings.h" #include "llfloaterfonttest.h" #include "llfloatergesture.h" #include "llfloatergodtools.h" @@ -101,9 +104,7 @@ #include "llfloatertopobjects.h" #include "llfloateruipreview.h" #include "llfloatervoiceeffect.h" -#include "llfloaterwater.h" #include "llfloaterwhitelistentry.h" -#include "llfloaterwindlight.h" #include "llfloaterwindowsize.h" #include "llfloaterworldmap.h" #include "llimfloatercontainer.h" @@ -179,11 +180,12 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>); - LLFloaterReg::add("env_day_cycle", "floater_day_cycle_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDayCycle>); LLFloaterReg::add("env_post_process", "floater_post_process.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPostProcess>); - LLFloaterReg::add("env_settings", "floater_env_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvSettings>); - LLFloaterReg::add("env_water", "floater_water.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWater>); - LLFloaterReg::add("env_windlight", "floater_windlight_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWindLight>); + LLFloaterReg::add("env_settings", "floater_environment_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEnvironmentSettings>); + LLFloaterReg::add("env_delete_preset", "floater_delete_env_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeleteEnvPreset>); + LLFloaterReg::add("env_edit_sky", "floater_edit_sky_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditSky>); + LLFloaterReg::add("env_edit_water", "floater_edit_water_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditWater>); + LLFloaterReg::add("env_edit_day_cycle", "floater_edit_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditDayCycle>); LLFloaterReg::add("event", "floater_event.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEvent>); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 42f780a8a3..9101222393 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -128,8 +128,10 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE)); addEntry(LLFolderType::FT_MESH, new ViewerFolderEntry("Meshes", "Inv_SysOpen", "Inv_SysClosed", FALSE)); - addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + + addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE)); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, "default")); diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 9fe8c142b9..3a3d4f3881 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -101,8 +101,9 @@ void LLViewerHelp::showTopic(const std::string &topic) // work out the URL for this topic and display it showHelp(); + std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic ); - setRawURL( helpURL ); + setRawURL(helpURL); } std::string LLViewerHelp::defaultTopic() @@ -148,18 +149,7 @@ std::string LLViewerHelp::getTopicFromFocus() // static void LLViewerHelp::showHelp() { - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - if (helpbrowser) - { - BOOL visible = TRUE; - BOOL take_focus = TRUE; - helpbrowser->setVisible(visible); - helpbrowser->setFrontmost(take_focus); - } - else - { - llwarns << "Eep, help_browser floater not found" << llendl; - } + LLFloaterReg::showInstance("help_browser"); } // static diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9e58acdcd3..22666cec0d 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1269,7 +1269,7 @@ void menu_create_inventory_item(LLFolderView* root, LLFolderBridge *bridge, cons { std::string type_name = userdata.asString(); - if (("category" == type_name) || ("current" == type_name) || ("outfit" == type_name) || ("my_otfts" == type_name)) + if (("inbox" == type_name) || ("outbox" == type_name) || ("category" == type_name) || ("current" == type_name) || ("outfit" == type_name) || ("my_otfts" == type_name)) { LLFolderType::EType preferred_type = LLFolderType::lookup(type_name); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1e53274cd6..1be58eae45 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -64,8 +64,10 @@ #include "llappviewer.h" #include "lllogininstance.h" //#include "llfirstuse.h" +#include "llviewernetwork.h" #include "llwindow.h" + #include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. @@ -1360,6 +1362,34 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom } +class LLInventoryUserStatusResponder : public LLHTTPClient::Responder +{ +public: + LLInventoryUserStatusResponder() + : LLCurl::Responder() + { + } + + void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + // Complete success + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else if (status == 401) + { + // API is available for use but OpenID authorization failed + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else + { + // API in unavailable + llinfos << "Marketplace API is unavailable -- Inbox may be disabled, status = " << status << ", reason = " << reason << llendl; + } + } +}; + ///////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::setOpenIDCookie() @@ -1406,6 +1436,25 @@ void LLViewerMedia::setOpenIDCookie() LLHTTPClient::get(profile_url, new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); + + std::string url = "https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; + + headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = sOpenIDCookie; + headers["User-Agent"] = getCurrentUserAgent(); + + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), headers); } } @@ -2349,15 +2398,13 @@ void LLViewerMediaImpl::updateJavascriptObject() if ( mMediaSource ) { // flag to expose this information to internal browser or not. - bool expose_javascript_object = gSavedSettings.getBOOL("BrowserEnableJSObject"); - mMediaSource->jsExposeObjectEvent( expose_javascript_object ); + bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject"); + mMediaSource->jsEnableObject( enable ); - // indicate if the values we have are valid (currently do this blanket-fashion for - // everything depending on whether you are logged in or not - this may require a - // more granular approach once variables are added that ARE valid before login + // these values are only menaingful after login so don't set them before bool logged_in = LLLoginInstance::getInstance()->authSuccess(); - mMediaSource->jsValuesValidEvent( logged_in ); - + if ( logged_in ) + { // current location within a region LLVector3 agent_pos = gAgent.getPositionAgent(); double x = agent_pos.mV[ VX ]; @@ -2386,6 +2433,7 @@ void LLViewerMediaImpl::updateJavascriptObject() region_name = region->getName(); }; mMediaSource->jsAgentRegionEvent( region_name ); + } // language code the viewer is set to mMediaSource->jsAgentLanguageEvent( LLUI::getLanguage() ); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4bf5454905..f38dd12f68 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -45,6 +45,7 @@ #include "llcompilequeue.h" #include "llconsole.h" #include "lldebugview.h" +#include "llenvmanager.h" #include "llfilepicker.h" #include "llfirstuse.h" #include "llfloaterbuy.h" @@ -108,6 +109,7 @@ #include "lltrans.h" #include "lleconomy.h" #include "lltoolgrab.h" +#include "llwindow.h" #include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; @@ -7585,74 +7587,85 @@ class LLWorldEnvSettings : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string tod = userdata.asString(); - LLVector3 sun_direction; if (tod == "editor") { - // if not there or is hidden, show it LLFloaterReg::toggleInstance("env_settings"); return true; } - + if (tod == "sunrise") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.25); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Sunrise"); } else if (tod == "noon") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.567); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Midday"); } else if (tod == "sunset") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.75); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Sunset"); } else if (tod == "midnight") { - // set the value, turn off animation - LLWLParamManager::instance()->mAnimator.setDayTime(0.0); - LLWLParamManager::instance()->mAnimator.mIsRunning = false; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; - - // then call update once - LLWLParamManager::instance()->mAnimator.update( - LLWLParamManager::instance()->mCurParams); + LLEnvManagerNew::instance().setUseSkyPreset("Midnight"); } else { - LLWLParamManager::instance()->mAnimator.mIsRunning = true; - LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; + LLEnvManagerNew::instance().setUseDayCycle(LLEnvManagerNew::instance().getDayCycleName()); } + return true; } }; -/// Water Menu callbacks -class LLWorldWaterSettings : public view_listener_t -{ +class LLWorldEnvPreset : public view_listener_t +{ bool handleEvent(const LLSD& userdata) { - LLFloaterReg::toggleInstance("env_water"); + std::string item = userdata.asString(); + + if (item == "new_water") + { + LLFloaterReg::showInstance("env_edit_water", "new"); + } + else if (item == "edit_water") + { + LLFloaterReg::showInstance("env_edit_water", "edit"); + } + else if (item == "delete_water") + { + LLFloaterReg::showInstance("env_delete_preset", "water"); + } + else if (item == "new_sky") + { + LLFloaterReg::showInstance("env_edit_sky", "new"); + } + else if (item == "edit_sky") + { + LLFloaterReg::showInstance("env_edit_sky", "edit"); + } + else if (item == "delete_sky") + { + LLFloaterReg::showInstance("env_delete_preset", "sky"); + } + else if (item == "new_day_cycle") + { + LLFloaterReg::showInstance("env_edit_day_cycle", "new"); + } + else if (item == "edit_day_cycle") + { + LLFloaterReg::showInstance("env_edit_day_cycle", "edit"); + } + else if (item == "delete_day_cycle") + { + LLFloaterReg::showInstance("env_delete_preset", "day_cycle"); + } + else + { + llwarns << "Unknown item selected" << llendl; + } + return true; } }; @@ -7667,16 +7680,6 @@ class LLWorldPostProcess : public view_listener_t } }; -/// Day Cycle callbacks -class LLWorldDayCycle : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterReg::showInstance("env_day_cycle"); - return true; - } -}; - class LLWorldToggleMovementControls : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -7905,9 +7908,8 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); - view_listener_t::addMenu(new LLWorldWaterSettings(), "World.WaterSettings"); + view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); - view_listener_t::addMenu(new LLWorldDayCycle(), "World.DayCycle"); view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); view_listener_t::addMenu(new LLWorldToggleCameraControls(), "World.Toggle.CameraControls"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 729f69ec3f..44b3a85f25 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -37,6 +37,7 @@ #include "lleconomy.h" #include "lleventtimer.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llfollowcamparams.h" #include "llinventorydefines.h" #include "lllslconstants.h" @@ -87,6 +88,7 @@ #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" +#include "llviewerinventory.h" #include "llviewerjoystick.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" @@ -694,7 +696,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) return false; } -static void highlight_inventory_items_in_panel(const std::vector<LLUUID>& items, LLInventoryPanel *inventory_panel) +static void highlight_inventory_objects_in_panel(const std::vector<LLUUID>& items, LLInventoryPanel *inventory_panel) { if (NULL == inventory_panel) return; @@ -708,7 +710,7 @@ static void highlight_inventory_items_in_panel(const std::vector<LLUUID>& items, continue; } - LLInventoryItem* item = gInventory.getItem(item_id); + LLInventoryObject* item = gInventory.getObject(item_id); llassert(item); if (!item) { continue; @@ -787,7 +789,6 @@ class LLViewerInventoryMoveFromWorldObserver : public LLInventoryAddItemByAssetO public: LLViewerInventoryMoveFromWorldObserver() : LLInventoryAddItemByAssetObserver() - , mActivePanel(NULL) { } @@ -798,13 +799,16 @@ private: /*virtual */void onAssetAdded(const LLUUID& asset_id) { // Store active Inventory panel. - mActivePanel = LLInventoryPanel::getActiveInventoryPanel(); + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } // Store selected items (without destination folder) mSelectedItems.clear(); - if (mActivePanel) + if (LLInventoryPanel::getActiveInventoryPanel()) { - mSelectedItems = mActivePanel->getRootFolder()->getSelectionList(); + mSelectedItems = LLInventoryPanel::getActiveInventoryPanel()->getRootFolder()->getSelectionList(); } mSelectedItems.erase(mMoveIntoFolderID); } @@ -815,12 +819,14 @@ private: */ void done() { + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); + // if selection is not changed since watch started lets hightlight new items. - if (mActivePanel && !isSelectionChanged()) + if (active_panel && !isSelectionChanged()) { LL_DEBUGS("Inventory_Move") << "Selecting new items..." << LL_ENDL; - mActivePanel->clearSelection(); - highlight_inventory_items_in_panel(mAddedItems, mActivePanel); + active_panel->clearSelection(); + highlight_inventory_objects_in_panel(mAddedItems, active_panel); } } @@ -828,16 +834,16 @@ private: * Returns true if selected inventory items were changed since moved inventory items were started to watch. */ bool isSelectionChanged() - { - const LLInventoryPanel * const current_active_panel = LLInventoryPanel::getActiveInventoryPanel(); + { + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); - if (NULL == mActivePanel || current_active_panel != mActivePanel) + if (NULL == active_panel) { return true; } // get selected items (without destination folder) - selected_items_t selected_items = mActivePanel->getRootFolder()->getSelectionList(); + selected_items_t selected_items = active_panel->getRootFolder()->getSelectionList(); selected_items.erase(mMoveIntoFolderID); // compare stored & current sets of selected items @@ -851,7 +857,7 @@ private: return different_items.size() > 0; } - LLInventoryPanel *mActivePanel; + LLHandle<LLPanel> mActivePanel; typedef std::set<LLUUID> selected_items_t; selected_items_t mSelectedItems; @@ -880,6 +886,75 @@ void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder gInventoryMoveObserver->watchAsset(inv_item->getAssetUUID()); } + +/** + * Class to observe moving of items and to select them in inventory. + * + * Used currently for dragging from inbox to regular inventory folders + */ + +class LLViewerInventoryMoveObserver : public LLInventoryObserver +{ +public: + + LLViewerInventoryMoveObserver(const LLUUID& object_id) + : LLInventoryObserver() + , mObjectID(object_id) + { + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } + } + + virtual ~LLViewerInventoryMoveObserver() {} + virtual void changed(U32 mask); + +private: + LLUUID mObjectID; + LLHandle<LLPanel> mActivePanel; + +}; + +void LLViewerInventoryMoveObserver::changed(U32 mask) +{ + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); + + if (NULL == active_panel) + { + gInventory.removeObserver(this); + return; + } + + if((mask & (LLInventoryObserver::STRUCTURE)) != 0) + { + const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + + std::set<LLUUID>::const_iterator id_it = changed_items.begin(); + std::set<LLUUID>::const_iterator id_end = changed_items.end(); + for (;id_it != id_end; ++id_it) + { + if ((*id_it) == mObjectID) + { + active_panel->clearSelection(); + std::vector<LLUUID> items; + items.push_back(mObjectID); + highlight_inventory_objects_in_panel(items, active_panel); + active_panel->getRootFolder()->scrollToShowSelection(); + + gInventory.removeObserver(this); + break; + } + } + } +} + +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 @@ -4271,8 +4346,8 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec); - //LL_DEBUGS("Messaging") << "time_synch() - " << sun_direction << ", " << sun_ang_velocity - // << ", " << phase << LL_ENDL; + LL_DEBUGS("Windlight Sync") << "time_synch() - " << sun_direction << ", " << sun_ang_velocity + << ", " << phase << LL_ENDL; gSky.setSunPhase(phase); gSky.setSunTargetDirection(sun_direction, sun_ang_velocity); @@ -4330,7 +4405,7 @@ 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")) { @@ -6505,7 +6580,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLUUID owner_id; if (gMessageSystem->getNumberOfBlocks("OwnerData") > 0) { - msg->getUUID("OwnerData", "OwnerID", owner_id); + msg->getUUID("OwnerData", "OwnerID", owner_id); } if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b4a9b8e677..9d09d9c01a 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -203,6 +203,8 @@ 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); + class LLOfferInfo : public LLNotificationResponderInterface { diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index fdf1e4a89b..bbe929b7f7 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -81,7 +81,6 @@ #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatar.h" #include "llvoavatarself.h" -#include "llvoclouds.h" #include "llvograss.h" #include "llvoground.h" #include "llvolume.h" @@ -167,8 +166,6 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco // llwarns << "Creating new tree!" << llendl; // res = new LLVOTree(id, pcode, regionp); break; res = NULL; break; - case LL_VO_CLOUDS: - res = new LLVOClouds(id, pcode, regionp); break; case LL_VO_SURFACE_PATCH: res = new LLVOSurfacePatch(id, pcode, regionp); break; case LL_VO_SKY: diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index f75a3d996d..1828a64917 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -556,7 +556,7 @@ public: // typedef enum e_vo_types { - LL_VO_CLOUDS = LL_PCODE_APP | 0x20, + LL_VO_CLOUDS = LL_PCODE_APP | 0x20, // no longer used LL_VO_SURFACE_PATCH = LL_PCODE_APP | 0x30, LL_VO_WL_SKY = LL_PCODE_APP | 0x40, LL_VO_SQUARE_TORUS = LL_PCODE_APP | 0x50, diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index c772ea32d0..f418a6137a 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -957,8 +957,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) iter != idle_list.end(); iter++) { objectp = *iter; - if (objectp->getPCode() == LLViewerObject::LL_VO_CLOUDS || - objectp->isAvatar()) + if (objectp->isAvatar()) { objectp->idleUpdate(agent, world, frame_time); } diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index faa86d43dd..252183b6d7 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -33,6 +33,8 @@ // in viewer. // It is used to precompile headers for improved build speed. +#include <boost/coroutine/coroutine.hpp> + #include "linden_common.h" // Work around stupid Microsoft STL warning @@ -118,8 +120,8 @@ // Library includes from llvfs #include "lldir.h" - -// Library includes from llmessage project +
+// Library includes from llmessage project
#include "llcachename.h" #endif diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 3569035c0d..8bb38e3e46 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -54,6 +54,7 @@ #include "llfloaterreporter.h" #include "llfloaterregioninfo.h" #include "llhttpnode.h" +#include "llregioninfomodel.h" #include "llsdutil.h" #include "llstartup.h" #include "lltrans.h" @@ -64,7 +65,6 @@ #include "llvlmanager.h" #include "llvlcomposition.h" #include "llvocache.h" -#include "llvoclouds.h" #include "llworld.h" #include "llspatialpartition.h" #include "stringize.h" @@ -315,7 +315,6 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER mImpl->mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE mImpl->mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE - mImpl->mObjectPartition.push_back(new LLCloudPartition()); //PARTITION_CLOUD mImpl->mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS mImpl->mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE @@ -350,7 +349,6 @@ LLViewerRegion::~LLViewerRegion() // Can't do this on destruction, because the neighbor pointers might be invalid. // This should be reference counted... disconnectAllNeighbors(); - mCloudLayer.destroy(); LLViewerPartSim::getInstance()->cleanupRegion(this); gObjectList.killObjects(this); @@ -486,7 +484,6 @@ void LLViewerRegion::setOriginGlobal(const LLVector3d &origin_global) updateRenderMatrix(); mImpl->mLandp->setOriginGlobal(origin_global); mWind.setOriginGlobal(origin_global); - mCloudLayer.setOriginGlobal(origin_global); calculateCenterGlobal(); } @@ -647,6 +644,8 @@ std::string LLViewerRegion::accessToShortString(U8 sim_access) void LLViewerRegion::processRegionInfo(LLMessageSystem* msg, void**) { // send it to 'observers' + // *TODO: switch the floaters to using LLRegionInfoModel + LLRegionInfoModel::instance().update(msg); LLFloaterGodTools::processRegionInfo(msg); LLFloaterRegionInfo::processRegionInfo(msg); LLFloaterReporter::processRegionInfo(msg); @@ -709,14 +708,12 @@ void LLViewerRegion::forceUpdate() void LLViewerRegion::connectNeighbor(LLViewerRegion *neighborp, U32 direction) { mImpl->mLandp->connectNeighbor(neighborp->mImpl->mLandp, direction); - mCloudLayer.connectNeighbor(&(neighborp->mCloudLayer), direction); } void LLViewerRegion::disconnectAllNeighbors() { mImpl->mLandp->disconnectAllNeighbors(); - mCloudLayer.disconnectAllNeighbors(); } LLVLComposition * LLViewerRegion::getComposition() const @@ -1504,6 +1501,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("DispatchRegionInfo"); capabilityNames.append("EstateChangeInfo"); capabilityNames.append("EventQueueGet"); + capabilityNames.append("EnvironmentSettings"); capabilityNames.append("ObjectMedia"); capabilityNames.append("ObjectMediaNavigate"); @@ -1661,6 +1659,21 @@ bool LLViewerRegion::capabilitiesReceived() const void LLViewerRegion::setCapabilitiesReceived(bool received) { mCapabilitiesReceived = received; + + // Tell interested parties that we've received capabilities, + // so that they can safely use getCapability(). + if (received) + { + mCapabilitiesReceivedSignal(getRegionID()); + + // This is a single-shot signal. Forget callbacks to save resources. + mCapabilitiesReceivedSignal.disconnect_all_slots(); + } +} + +boost::signals2::connection LLViewerRegion::setCapabilitiesReceivedCallback(const caps_received_signal_t::slot_type& cb) +{ + return mCapabilitiesReceivedSignal.connect(cb); } void LLViewerRegion::logActiveCapabilities() const diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 68662c99bd..00252b8897 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -30,10 +30,10 @@ // A ViewerRegion is a class that contains a bunch of objects and surfaces // that are in to a particular region. #include <string> +#include <boost/signals2.hpp> #include "lldarray.h" #include "llwind.h" -#include "llcloud.h" #include "llstat.h" #include "v3dmath.h" #include "llstring.h" @@ -81,7 +81,6 @@ public: PARTITION_WATER, PARTITION_TREE, PARTITION_PARTICLE, - PARTITION_CLOUD, PARTITION_GRASS, PARTITION_VOLUME, PARTITION_BRIDGE, @@ -90,6 +89,8 @@ public: NUM_PARTITIONS } eObjectPartitions; + typedef boost::signals2::signal<void(const LLUUID& region_id)> caps_received_signal_t; + LLViewerRegion(const U64 &handle, const LLHost &host, const U32 surface_grid_width, @@ -237,6 +238,7 @@ public: // has region received its final (not seed) capability list? bool capabilitiesReceived() const; void setCapabilitiesReceived(bool received); + boost::signals2::connection setCapabilitiesReceivedCallback(const caps_received_signal_t::slot_type& cb); static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; @@ -340,7 +342,6 @@ protected: public: LLWind mWind; - LLCloudLayer mCloudLayer; LLViewerParcelOverlay *mParcelOverlay; LLStat mBitStat; @@ -408,6 +409,7 @@ private: bool mAlive; // can become false if circuit disconnects bool mCapabilitiesReceived; + caps_received_signal_t mCapabilitiesReceivedSignal; BOOL mReleaseNotesRequested; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 592923ee07..e473901609 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2189,6 +2189,16 @@ std::string LLViewerShaderMgr::getShaderDirPrefix(void) void LLViewerShaderMgr::updateShaderUniforms(LLGLSLShader * shader) { - LLWLParamManager::instance()->updateShaderUniforms(shader); - LLWaterParamManager::instance()->updateShaderUniforms(shader); + LLWLParamManager::getInstance()->updateShaderUniforms(shader); + LLWaterParamManager::getInstance()->updateShaderUniforms(shader); +} + +LLViewerShaderMgr::shader_iter LLViewerShaderMgr::beginShaders() const +{ + return mShaderList.begin(); +} + +LLViewerShaderMgr::shader_iter LLViewerShaderMgr::endShaders() const +{ + return mShaderList.end(); } diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 6ecba65470..efef9ec5b2 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -241,20 +241,12 @@ public: base_iter_t mIter; }; - shader_iter beginShaders() const - { - return mShaderList.begin(); - } - - shader_iter endShaders() const - { - return mShaderList.end(); - } - + shader_iter beginShaders() const; + shader_iter endShaders() const; - /* virtual */ std::string getShaderDirPrefix(void); // Virtual + /* virtual */ std::string getShaderDirPrefix(void); - /* virtual */ void updateShaderUniforms(LLGLSLShader * shader); // Virtual + /* virtual */ void updateShaderUniforms(LLGLSLShader * shader); private: diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4e5ebb690f..678daec5b7 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -726,19 +726,6 @@ public: } } - if (gSavedSettings.getBOOL("DebugShowUploadCost")) - { - addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost)); - ypos += y_inc/2; - addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost)); - ypos += y_inc/2; - addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost)); - ypos += y_inc/2; - addText(xpos, ypos, "Upload Cost: "); - - ypos += y_inc; - } - //temporary hack to give feedback on mesh upload progress if (!gMeshRepo.mUploads.empty()) { @@ -1977,7 +1964,10 @@ void LLViewerWindow::shutdownViews() // destroy the nav bar, not currently part of gViewerWindow // *TODO: Make LLNavigationBar part of gViewerWindow + if (LLNavigationBar::instanceExists()) + { delete LLNavigationBar::getInstance(); + } // destroy menus after instantiating navbar above, as it needs // access to gMenuHolder @@ -4516,6 +4506,14 @@ void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } +void LLViewerWindow::revealIntroPanel() +{ + if (mProgressView) + { + mProgressView->revealIntroPanel(); + } +} + void LLViewerWindow::setShowProgress(const BOOL show) { if (mProgressView) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index df6928aa1d..ff49ed1f62 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -271,6 +271,7 @@ public: void setProgressMessage(const std::string& msg); void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; + void revealIntroPanel(); void updateObjectUnderCursor(); diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 25f2687fe2..d8de979f56 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -94,7 +94,7 @@ void LLVLManager::unpackData(const S32 num_packets) } else if (CLOUD_LAYER_CODE == datap->mType) { - datap->mRegionp->mCloudLayer.decompress(bit_pack, &goph); + } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 27f3a26f83..5c977492d8 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7273,9 +7273,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl; LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID()); mRuthTimer.reset(); - } - else - { + } + else + { llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl; // we don't really care. } diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp deleted file mode 100644 index 478708cd78..0000000000 --- a/indra/newview/llvoclouds.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/** - * @file llvoclouds.cpp - * @brief Implementation of LLVOClouds class which is a derivation fo LLViewerObject - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llvoclouds.h" - -#include "lldrawpoolalpha.h" - -#include "llviewercontrol.h" - -#include "llagent.h" // to get camera position -#include "lldrawable.h" -#include "llface.h" -#include "llprimitive.h" -#include "llsky.h" -#include "llviewercamera.h" -#include "llviewertexturelist.h" -#include "llviewerobjectlist.h" -#include "llviewerregion.h" -#include "llvosky.h" -#include "llworld.h" -#include "pipeline.h" -#include "llspatialpartition.h" - -LLUUID gCloudTextureID = IMG_CLOUD_POOF; - - -LLVOClouds::LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLAlphaObject(id, LL_VO_CLOUDS, regionp) -{ - mCloudGroupp = NULL; - mbCanSelect = FALSE; - setNumTEs(1); - LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(gCloudTextureID); - image->setBoostLevel(LLViewerTexture::BOOST_CLOUDS); - setTEImage(0, image); -} - - -LLVOClouds::~LLVOClouds() -{ -} - - -BOOL LLVOClouds::isActive() const -{ - return TRUE; -} - -BOOL LLVOClouds::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) -{ - static LLFastTimer::DeclareTimer ftm("Idle Clouds"); - LLFastTimer t(ftm); - - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) - { - return TRUE; - } - - // Set dirty flag (so renderer will rebuild primitive) - if (mDrawable) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); - } - - return TRUE; -} - - -void LLVOClouds::setPixelAreaAndAngle(LLAgent &agent) -{ - mAppAngle = 50; - mPixelArea = 1500*100; -} - -void LLVOClouds::updateTextures() -{ - getTEImage(0)->addTextureStats(mPixelArea); -} - -LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline) -{ - pipeline->allocDrawable(this); - mDrawable->setLit(FALSE); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_CLOUDS); - - return mDrawable; -} - -static LLFastTimer::DeclareTimer FTM_UPDATE_CLOUDS("Update Clouds"); - -BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) -{ - LLFastTimer ftm(FTM_UPDATE_CLOUDS); - if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) - { - return TRUE; - } - - if (drawable->isVisible()) - { - dirtySpatialGroup(TRUE); - } - - LLFace *facep; - - S32 num_faces = mCloudGroupp->getNumPuffs(); - - if (num_faces > drawable->getNumFaces()) - { - drawable->setNumFacesFast(num_faces, NULL, getTEImage(0)); - } - - mDepth = (getPositionAgent()-LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis(); - - S32 face_indx = 0; - for ( ; face_indx < num_faces; face_indx++) - { - facep = drawable->getFace(face_indx); - if (!facep) - { - llwarns << "No facep for index " << face_indx << llendl; - continue; - } - - facep->setSize(4, 6); - - facep->setTEOffset(face_indx); - facep->setTexture(getTEImage(0)); - const LLCloudPuff &puff = mCloudGroupp->getPuff(face_indx); - const LLVector3 puff_pos_agent = gAgent.getPosAgentFromGlobal(puff.getPositionGlobal()); - facep->mCenterLocal = puff_pos_agent; - /// Update cloud color based on sun color. - LLColor4 float_color(LLColor3(gSky.getSunDiffuseColor() + gSky.getSunAmbientColor()),puff.getAlpha()); - facep->setFaceColor(float_color); - } - for ( ; face_indx < drawable->getNumFaces(); face_indx++) - { - facep = drawable->getFace(face_indx); - if (!facep) - { - llwarns << "No facep for index " << face_indx << llendl; - continue; - } - - facep->setTEOffset(face_indx); - facep->setSize(0,0); - } - - drawable->movePartition(); - - return TRUE; -} - -F32 LLVOClouds::getPartSize(S32 idx) -{ - return (CLOUD_PUFF_HEIGHT+CLOUD_PUFF_WIDTH)*0.5f; -} - -void LLVOClouds::getGeometry(S32 te, - LLStrider<LLVector3>& verticesp, - LLStrider<LLVector3>& normalsp, - LLStrider<LLVector2>& texcoordsp, - LLStrider<LLColor4U>& colorsp, - LLStrider<U16>& indicesp) -{ - - if (te >= mCloudGroupp->getNumPuffs()) - { - return; - } - - LLDrawable* drawable = mDrawable; - LLFace *facep = drawable->getFace(te); - - if (!facep->hasGeometry()) - { - return; - } - - LLVector3 normal(0.f,0.f,-1.f); - - const LLCloudPuff &puff = mCloudGroupp->getPuff(te); - S32 index_offset = facep->getGeomIndex(); - LLColor4 float_color(LLColor3(gSky.getSunDiffuseColor() + gSky.getSunAmbientColor()),puff.getAlpha()); - LLColor4U color; - color.setVec(float_color); - facep->setFaceColor(float_color); - - - LLVector3 up; - LLVector3 right; - LLVector3 at; - - const LLVector3& puff_pos_agent = facep->mCenterLocal; - LLVector2 uvs[4]; - - uvs[0].setVec(0.f, 1.f); - uvs[1].setVec(0.f, 0.f); - uvs[2].setVec(1.f, 1.f); - uvs[3].setVec(1.f, 0.f); - - LLVector3 vtx[4]; - - at = LLViewerCamera::getInstance()->getAtAxis(); - right = at % LLVector3(0.f, 0.f, 1.f); - right.normVec(); - up = right % at; - up.normVec(); - right *= 0.5f*CLOUD_PUFF_WIDTH; - up *= 0.5f*CLOUD_PUFF_HEIGHT;; - - *colorsp++ = color; - *colorsp++ = color; - *colorsp++ = color; - *colorsp++ = color; - - vtx[0] = puff_pos_agent - right + up; - vtx[1] = puff_pos_agent - right - up; - vtx[2] = puff_pos_agent + right + up; - vtx[3] = puff_pos_agent + right - up; - - verticesp->mV[3] = 0.f; - *verticesp++ = vtx[0]; - verticesp->mV[3] = 0.f; - *verticesp++ = vtx[1]; - verticesp->mV[3] = 0.f; - *verticesp++ = vtx[2]; - verticesp->mV[3] = 0.f; - *verticesp++ = vtx[3]; - - *texcoordsp++ = uvs[0]; - *texcoordsp++ = uvs[1]; - *texcoordsp++ = uvs[2]; - *texcoordsp++ = uvs[3]; - - *normalsp++ = normal; - *normalsp++ = normal; - *normalsp++ = normal; - *normalsp++ = normal; - - *indicesp++ = index_offset + 0; - *indicesp++ = index_offset + 1; - *indicesp++ = index_offset + 2; - - *indicesp++ = index_offset + 1; - *indicesp++ = index_offset + 3; - *indicesp++ = index_offset + 2; -} - -U32 LLVOClouds::getPartitionType() const -{ - return LLViewerRegion::PARTITION_CLOUD; -} - -// virtual -void LLVOClouds::updateDrawable(BOOL force_damped) -{ - // Force an immediate rebuild on any update - if (mDrawable.notNull()) - { - mDrawable->updateXform(TRUE); - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); - } - clearChanged(SHIFTED); -} - -LLCloudPartition::LLCloudPartition() -{ - mDrawableType = LLPipeline::RENDER_TYPE_CLOUDS; - mPartitionType = LLViewerRegion::PARTITION_CLOUD; -} - diff --git a/indra/newview/llvoclouds.h b/indra/newview/llvoclouds.h deleted file mode 100644 index 430923a108..0000000000 --- a/indra/newview/llvoclouds.h +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @file llvoclouds.h - * @brief Description of LLVOClouds class - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, 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_LLVOCLOUDS_H -#define LL_LLVOCLOUDS_H - -#include "llviewerobject.h" -#include "lltable.h" -#include "v4coloru.h" - -class LLViewerTexture; -class LLViewerCloudGroup; - -class LLCloudGroup; - - -class LLVOClouds : public LLAlphaObject -{ -public: - LLVOClouds(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp ); - - // Initialize data that's only inited once per class. - static void initClass(); - - void updateDrawable(BOOL force_damped); - - /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); - /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - /*virtual*/ void getGeometry(S32 te, - LLStrider<LLVector3>& verticesp, - LLStrider<LLVector3>& normalsp, - LLStrider<LLVector2>& texcoordsp, - LLStrider<LLColor4U>& colorsp, - LLStrider<U16>& indicesp); - - /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - F32 getPartSize(S32 idx); - - /*virtual*/ void updateTextures(); - /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area - - void updateFaceSize(S32 idx) { } - BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); - - virtual U32 getPartitionType() const; - - void setCloudGroup(LLCloudGroup *cgp) { mCloudGroupp = cgp; } -protected: - virtual ~LLVOClouds(); - - LLCloudGroup *mCloudGroupp; -}; - -extern LLUUID gCloudTextureID; - -#endif // LL_VO_CLOUDS_H diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 800af26b69..66ba6249d3 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -370,7 +370,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) mAtmHeight = ATM_HEIGHT; mEarthCenter = LLVector3(mCameraPosAgent.mV[0], mCameraPosAgent.mV[1], -EARTH_RADIUS); - mSunDefaultPosition = LLVector3(LLWLParamManager::instance()->mCurParams.getVector("lightnorm", error)); + mSunDefaultPosition = LLVector3(LLWLParamManager::getInstance()->mCurParams.getVector("lightnorm", error)); if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition")) { initSunDirection(mSunDefaultPosition, LLVector3(0, 0, 0)); @@ -646,24 +646,24 @@ void LLVOSky::initAtmospherics(void) bool error; // uniform parameters for convenience - dome_radius = LLWLParamManager::instance()->getDomeRadius(); - dome_offset_ratio = LLWLParamManager::instance()->getDomeOffset(); - sunlight_color = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("sunlight_color", error)); - ambient = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("ambient", error)); - //lightnorm = LLWLParamManager::instance()->mCurParams.getVector("lightnorm", error); - gamma = LLWLParamManager::instance()->mCurParams.getVector("gamma", error)[0]; - blue_density = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("blue_density", error)); - blue_horizon = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("blue_horizon", error)); - haze_density = LLWLParamManager::instance()->mCurParams.getVector("haze_density", error)[0]; - haze_horizon = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("haze_horizon", error)); - density_multiplier = LLWLParamManager::instance()->mCurParams.getVector("density_multiplier", error)[0]; - max_y = LLWLParamManager::instance()->mCurParams.getVector("max_y", error)[0]; - glow = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("glow", error)); - cloud_shadow = LLWLParamManager::instance()->mCurParams.getVector("cloud_shadow", error)[0]; - cloud_color = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("cloud_color", error)); - cloud_scale = LLWLParamManager::instance()->mCurParams.getVector("cloud_scale", error)[0]; - cloud_pos_density1 = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("cloud_pos_density1", error)); - cloud_pos_density2 = LLColor3(LLWLParamManager::instance()->mCurParams.getVector("cloud_pos_density2", error)); + dome_radius = LLWLParamManager::getInstance()->getDomeRadius(); + dome_offset_ratio = LLWLParamManager::getInstance()->getDomeOffset(); + sunlight_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("sunlight_color", error)); + ambient = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("ambient", error)); + //lightnorm = LLWLParamManager::getInstance()->mCurParams.getVector("lightnorm", error); + gamma = LLWLParamManager::getInstance()->mCurParams.getVector("gamma", error)[0]; + blue_density = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_density", error)); + blue_horizon = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("blue_horizon", error)); + haze_density = LLWLParamManager::getInstance()->mCurParams.getVector("haze_density", error)[0]; + haze_horizon = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("haze_horizon", error)); + density_multiplier = LLWLParamManager::getInstance()->mCurParams.getVector("density_multiplier", error)[0]; + max_y = LLWLParamManager::getInstance()->mCurParams.getVector("max_y", error)[0]; + glow = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("glow", error)); + cloud_shadow = LLWLParamManager::getInstance()->mCurParams.getVector("cloud_shadow", error)[0]; + cloud_color = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_color", error)); + cloud_scale = LLWLParamManager::getInstance()->mCurParams.getVector("cloud_scale", error)[0]; + cloud_pos_density1 = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_pos_density1", error)); + cloud_pos_density2 = LLColor3(LLWLParamManager::getInstance()->mCurParams.getVector("cloud_pos_density2", error)); // light norm is different. We need the sun's direction, not the light direction // which could be from the moon. And we need to clamp it @@ -1033,7 +1033,7 @@ void LLVOSky::calcAtmospherics(void) // Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio // between sunlight and point lights in windlight to normalize point lights. F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f); - LLWLParamManager::instance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); + LLWLParamManager::getInstance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp); mSunDiffuse = vary_SunlightColor; mSunAmbient = vary_AmbientColor; @@ -2129,7 +2129,7 @@ void LLVOSky::updateFog(const F32 distance) F32 depth = water_height - camera_height; // get the water param manager variables - float water_fog_density = LLWaterParamManager::instance()->getFogDensity(); + float water_fog_density = LLWaterParamManager::getInstance()->getFogDensity(); LLColor4 water_fog_color = LLDrawPoolWater::sWaterFogColor.mV; // adjust the color based on depth. We're doing linear approximations diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 51664cb31d..7b1c725483 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -568,7 +568,7 @@ void LLVOWLSky::buildFanBuffer(LLStrider<LLVector3> & vertices, LLStrider<LLVector2> & texCoords, LLStrider<U16> & indices) { - const F32 RADIUS = LLWLParamManager::instance()->getDomeRadius(); + const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius(); U32 i, num_slices; F32 phi0, theta, x0, y0, z0; @@ -629,7 +629,7 @@ void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack, LLStrider<LLVector2> & texCoords, LLStrider<U16> & indices) { - const F32 RADIUS = LLWLParamManager::instance()->getDomeRadius(); + const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius(); U32 i, j, num_slices, num_stacks; F32 phi0, theta, x0, y0, z0; diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 67bb965f99..1a98d4c6c2 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -54,12 +54,9 @@ #include "llwlparammanager.h" #include "llwaterparamset.h" -#include "llfloaterwater.h" #include "curl/curl.h" -LLWaterParamManager * LLWaterParamManager::sInstance = NULL; - LLWaterParamManager::LLWaterParamManager() : mFogColor(22.f/255.f, 43.f/255.f, 54.f/255.f, 0.0f, 0.0f, "waterFogColor", "WaterFogColor"), mFogDensity(4, "waterFogDensity", 2), @@ -73,8 +70,6 @@ LLWaterParamManager::LLWaterParamManager() : mWave1Dir(.5f, .5f, "wave1Dir"), mWave2Dir(.5f, .5f, "wave2Dir"), mDensitySliderValue(1.0f), - mPrevFogDensity(16.0f), // 2^4 - mPrevFogColor(22.f/255.f, 43.f/255.f, 54.f/255.f, 0.0f), mWaterFogKS(1.0f) { } @@ -83,131 +78,73 @@ LLWaterParamManager::~LLWaterParamManager() { } -void LLWaterParamManager::loadAllPresets(const std::string& file_name) +void LLWaterParamManager::loadAllPresets() { - std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", "")); - LL_DEBUGS2("AppInit", "Shaders") << "Loading Default water settings from " << path_name << LL_ENDL; - - bool found = true; - LLDirIterator app_settings_iter(path_name, "*.xml"); - while(found) - { - std::string name; - found = app_settings_iter.next(name); - if(found) - { - - name=name.erase(name.length()-4); + // First, load system (coming out of the box) water presets. + loadPresetsFromDir(getSysDir()); - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; - - LL_DEBUGS2("AppInit", "Shaders") << "name: " << name << LL_ENDL; - loadPreset(unescaped_name,FALSE); - } - } + // Then load user presets. Note that user day presets will modify any system ones already loaded. + loadPresetsFromDir(getUserDir()); +} - // And repeat for user presets, note the user presets will modify any system presets already loaded +void LLWaterParamManager::loadPresetsFromDir(const std::string& dir) +{ + LL_INFOS2("AppInit", "Shaders") << "Loading water presets from " << dir << LL_ENDL; - std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); - LL_DEBUGS2("AppInit", "Shaders") << "Loading User water settings from " << path_name2 << LL_ENDL; - - found = true; - LLDirIterator user_settings_iter(path_name2, "*.xml"); - while(found) + LLDirIterator dir_iter(dir, "*.xml"); + while (1) { - std::string name; - found = user_settings_iter.next(name); - if(found) + std::string file; + if (!dir_iter.next(file)) { - name=name.erase(name.length()-4); - - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; + break; // no more files + } - LL_DEBUGS2("AppInit", "Shaders") << "name: " << name << LL_ENDL; - loadPreset(unescaped_name,FALSE); + std::string path = dir + file; + if (!loadPreset(path)) + { + llwarns << "Error loading water preset from " << path << llendl; } } - } -void LLWaterParamManager::loadPreset(const std::string & name,bool propagate) +bool LLWaterParamManager::loadPreset(const std::string& path) { - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_filename(curl_str); - curl_free(curl_str); - curl_str = NULL; - - escaped_filename += ".xml"; + llifstream xml_file; + std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true)); - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", escaped_filename)); - LL_DEBUGS2("AppInit", "Shaders") << "Loading water settings from " << pathName << LL_ENDL; - - llifstream presetsXML; - presetsXML.open(pathName.c_str()); - - // That failed, try loading from the users area instead. - if(!presetsXML) + xml_file.open(path.c_str()); + if (!xml_file) { - pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", escaped_filename); - LL_DEBUGS2("AppInit", "Shaders") << "Loading User water setting from " << pathName << LL_ENDL; - presetsXML.clear(); - presetsXML.open(pathName.c_str()); + return false; } - if (presetsXML) - { - LLSD paramsData(LLSD::emptyMap()); + LL_DEBUGS2("AppInit", "Shaders") << "Loading water " << name << LL_ENDL; - LLPointer<LLSDParser> parser = new LLSDXMLParser(); + LLSD params_data; + LLPointer<LLSDParser> parser = new LLSDXMLParser(); + parser->parse(xml_file, params_data, LLSDSerialize::SIZE_UNLIMITED); + xml_file.close(); - parser->parse(presetsXML, paramsData, LLSDSerialize::SIZE_UNLIMITED); - - std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); - if(mIt == mParamList.end()) - { - addParamSet(name, paramsData); - } - else - { - setParamSet(name, paramsData); - } - presetsXML.close(); - } - else + if (hasParamSet(name)) { - llwarns << "Can't find " << name << llendl; - return; + setParamSet(name, params_data); } - - if(propagate) + else { - getParamSet(name, mCurParams); - propagateParameters(); + addParamSet(name, params_data); } -} + + return true; +} void LLWaterParamManager::savePreset(const std::string & name) { - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_filename(curl_str); - curl_free(curl_str); - curl_str = NULL; - - escaped_filename += ".xml"; + llassert(!name.empty()); // make an empty llsd LLSD paramsData(LLSD::emptyMap()); - std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", escaped_filename)); + std::string pathName(getUserDir() + LLURI::escape(name) + ".xml"); // fill it with LLSD windlight params paramsData = mParamList[name].getAll(); @@ -221,7 +158,6 @@ void LLWaterParamManager::savePreset(const std::string & name) propagateParameters(); } - void LLWaterParamManager::propagateParameters(void) { // bind the variables only if we're using shaders @@ -251,7 +187,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) { if (shader->mShaderGroup == LLGLSLShader::SG_WATER) { - shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::instance()->getRotatedLightDir().mV); + shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV); shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV); shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); @@ -261,36 +197,33 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) } } -static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); - -void LLWaterParamManager::update(LLViewerCamera * cam) +void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate) { - LLFastTimer ftm(FTM_UPDATE_WLPARAM); - - // update the shaders and the menu - propagateParameters(); - - // If water fog color has been changed, save it. - if (mPrevFogColor != mFogColor) + if (params.size() == 0) { - gSavedSettings.setColor4("WaterFogColor", mFogColor); - mPrevFogColor = mFogColor; + llwarns << "Undefined water params" << llendl; + return; } - // If water fog density has been changed, save it. - if (mPrevFogDensity != mFogDensity) + if (interpolate) { - gSavedSettings.setF32("WaterFogDensity", mFogDensity); - mPrevFogDensity = mFogDensity; + LLWLParamManager::getInstance()->mAnimator.startInterpolation(params); } - - // sync menus if they exist - LLFloaterWater* waterfloater = LLFloaterReg::findTypedInstance<LLFloaterWater>("env_water"); - if(waterfloater) + else { - waterfloater->syncMenu(); + mCurParams.setAll(params); } +} +static LLFastTimer::DeclareTimer FTM_UPDATE_WATERPARAM("Update Water Params"); + +void LLWaterParamManager::update(LLViewerCamera * cam) +{ + LLFastTimer ftm(FTM_UPDATE_WATERPARAM); + + // update the shaders and the menu + propagateParameters(); + // only do this if we're dealing with shaders if(gPipeline.canUseVertexShaders()) { @@ -339,26 +272,14 @@ void LLWaterParamManager::update(LLViewerCamera * cam) } } -// static -void LLWaterParamManager::initClass(void) -{ - instance(); -} - -// static -void LLWaterParamManager::cleanupClass(void) -{ - delete sInstance; - sInstance = NULL; -} - bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet& param) { // add a new one if not one there already - std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); + preset_map_t::iterator mIt = mParamList.find(name); if(mIt == mParamList.end()) { mParamList[name] = param; + mPresetListChangeSignal(); return true; } @@ -367,23 +288,15 @@ bool LLWaterParamManager::addParamSet(const std::string& name, LLWaterParamSet& BOOL LLWaterParamManager::addParamSet(const std::string& name, LLSD const & param) { - // add a new one if not one there already - std::map<std::string, LLWaterParamSet>::const_iterator finder = mParamList.find(name); - if(finder == mParamList.end()) - { - mParamList[name].setAll(param); - return TRUE; - } - else - { - return FALSE; - } + LLWaterParamSet param_set; + param_set.setAll(param); + return addParamSet(name, param_set); } bool LLWaterParamManager::getParamSet(const std::string& name, LLWaterParamSet& param) { // find it and set it - std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); + preset_map_t::iterator mIt = mParamList.find(name); if(mIt != mParamList.end()) { param = mParamList[name]; @@ -394,6 +307,12 @@ bool LLWaterParamManager::getParamSet(const std::string& name, LLWaterParamSet& return false; } +bool LLWaterParamManager::hasParamSet(const std::string& name) +{ + LLWaterParamSet dummy; + return getParamSet(name, dummy); +} + bool LLWaterParamManager::setParamSet(const std::string& name, LLWaterParamSet& param) { mParamList[name] = param; @@ -417,29 +336,74 @@ bool LLWaterParamManager::setParamSet(const std::string& name, const LLSD & para bool LLWaterParamManager::removeParamSet(const std::string& name, bool delete_from_disk) { // remove from param list - std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name); - if(mIt != mParamList.end()) + preset_map_t::iterator it = mParamList.find(name); + if (it == mParamList.end()) { - mParamList.erase(mIt); + LL_WARNS("WindLight") << "No water preset named " << name << LL_ENDL; + return false; } - if(delete_from_disk) - { + mParamList.erase(it); - std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); - - // use full curl escaped name - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; - - gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml"); + // remove from file system if requested + if (delete_from_disk) + { + if (gDirUtilp->deleteFilesInDir(getUserDir(), LLURI::escape(name) + ".xml") < 1) + { + LL_WARNS("WindLight") << "Error removing water preset " << name << " from disk" << LL_ENDL; + } } + // signal interested parties + mPresetListChangeSignal(); return true; } +bool LLWaterParamManager::isSystemPreset(const std::string& preset_name) const +{ + // *TODO: file system access is excessive here. + return gDirUtilp->fileExists(getSysDir() + LLURI::escape(preset_name) + ".xml"); +} + +void LLWaterParamManager::getPresetNames(preset_name_list_t& presets) const +{ + presets.clear(); + + for (preset_map_t::const_iterator it = mParamList.begin(); it != mParamList.end(); ++it) + { + presets.push_back(it->first); + } +} + +void LLWaterParamManager::getPresetNames(preset_name_list_t& user_presets, preset_name_list_t& system_presets) const +{ + user_presets.clear(); + system_presets.clear(); + + for (preset_map_t::const_iterator it = mParamList.begin(); it != mParamList.end(); ++it) + { + if (isSystemPreset(it->first)) + { + system_presets.push_back(it->first); + } + else + { + user_presets.push_back(it->first); + } + } +} + +void LLWaterParamManager::getUserPresetNames(preset_name_list_t& user_presets) const +{ + preset_name_list_t dummy; + getPresetNames(user_presets, dummy); +} + +boost::signals2::connection LLWaterParamManager::setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb) +{ + return mPresetListChangeSignal.connect(cb); +} + F32 LLWaterParamManager::getFogDensity(void) { bool err; @@ -458,34 +422,22 @@ F32 LLWaterParamManager::getFogDensity(void) return fogDensity; } -// static -LLWaterParamManager * LLWaterParamManager::instance() +// virtual static +void LLWaterParamManager::initSingleton() { - if(NULL == sInstance) - { - sInstance = new LLWaterParamManager(); - - sInstance->loadAllPresets(LLStringUtil::null); - - sInstance->getParamSet("Default", sInstance->mCurParams); - sInstance->initOverrides(); - } + LL_DEBUGS("Windlight") << "Initializing water" << LL_ENDL; + loadAllPresets(); + LLEnvManagerNew::instance().usePrefs(); +} - return sInstance; +// static +std::string LLWaterParamManager::getSysDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", ""); } -void LLWaterParamManager::initOverrides() +// static +std::string LLWaterParamManager::getUserDir() { - // Override fog color from the current preset with the saved setting. - LLColor4 fog_color_override = gSavedSettings.getColor4("WaterFogColor"); - mFogColor = fog_color_override; - mPrevFogColor = fog_color_override; - mCurParams.set("waterFogColor", fog_color_override); - - // Do the same with fog density. - F32 fog_density = gSavedSettings.getF32("WaterFogDensity"); - mPrevFogDensity = fog_density; - mFogDensity = fog_density; - mCurParams.set("waterFogDensity", fog_density); - setDensitySliderValue(mFogDensity.mExp); + return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "windlight/water", ""); } diff --git a/indra/newview/llwaterparammanager.h b/indra/newview/llwaterparammanager.h index f465034c39..dc7d41be2a 100644 --- a/indra/newview/llwaterparammanager.h +++ b/indra/newview/llwaterparammanager.h @@ -27,7 +27,7 @@ #ifndef LL_WATER_PARAMMANAGER_H #define LL_WATER_PARAMMANAGER_H -#include <vector> +#include <list> #include <map> #include "llwaterparamset.h" #include "llviewercamera.h" @@ -212,19 +212,13 @@ struct WaterExpFloatControl /// WindLight parameter manager class - what controls all the wind light shaders -class LLWaterParamManager +class LLWaterParamManager : public LLSingleton<LLWaterParamManager> { + LOG_CLASS(LLWaterParamManager); public: - - LLWaterParamManager(); - ~LLWaterParamManager(); - - /// load a preset file - void loadAllPresets(const std::string & fileName); - - /// load an individual preset into the sky - - void loadPreset(const std::string & name,bool propagate=true); + typedef std::list<std::string> preset_name_list_t; + typedef std::map<std::string, LLWaterParamSet> preset_map_t; + typedef boost::signals2::signal<void()> preset_list_signal_t; /// save the parameter presets to file void savePreset(const std::string & name); @@ -232,18 +226,15 @@ public: /// send the parameters to the shaders void propagateParameters(void); + // display specified water + void applyParams(const LLSD& params, bool interpolate); + /// update information for the shader void update(LLViewerCamera * cam); /// Update shader uniforms that have changed. void updateShaderUniforms(LLGLSLShader * shader); - /// Perform global initialization for this class. - static void initClass(void); - - // Cleanup of global data that's only inited once per class. - static void cleanupClass(); - /// add a param to the list bool addParamSet(const std::string& name, LLWaterParamSet& param); @@ -253,6 +244,9 @@ public: /// get a param from the list bool getParamSet(const std::string& name, LLWaterParamSet& param); + /// check whether the preset is in the list + bool hasParamSet(const std::string& name); + /// set the param in the list with a new param bool setParamSet(const std::string& name, LLWaterParamSet& param); @@ -263,6 +257,24 @@ public: /// returns true if successful bool removeParamSet(const std::string& name, bool delete_from_disk); + /// @return true if the preset comes out of the box + bool isSystemPreset(const std::string& preset_name) const; + + /// @return all named water presets. + const preset_map_t& getPresets() const { return mParamList; } + + /// @return user and system preset names as a single list + void getPresetNames(preset_name_list_t& presets) const; + + /// @return user and system preset names separately + void getPresetNames(preset_name_list_t& user_presets, preset_name_list_t& system_presets) const; + + /// @return list of user presets names + void getUserPresetNames(preset_name_list_t& user_presets) const; + + /// Emitted when a preset gets added or deleted. + boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); + /// set the normap map we want for water bool setNormalMapID(const LLUUID& img); @@ -281,12 +293,6 @@ public: F32 getFogDensity(void); LLColor4 getFogColor(void); - // singleton pattern implementation - static LLWaterParamManager * instance(); - -private: - void initOverrides(); - public: LLWaterParamSet mCurParams; @@ -308,20 +314,28 @@ public: WaterFloatControl mScaleBelow; WaterFloatControl mBlurMultiplier; - // list of all the parameters, listed by name - std::map<std::string, LLWaterParamSet> mParamList; - F32 mDensitySliderValue; private: + friend class LLSingleton<LLWaterParamManager>; + /*virtual*/ void initSingleton(); + LLWaterParamManager(); + ~LLWaterParamManager(); + + void loadAllPresets(); + void loadPresetsFromDir(const std::string& dir); + bool loadPreset(const std::string& path); + + static std::string getSysDir(); + static std::string getUserDir(); + LLVector4 mWaterPlane; F32 mWaterFogKS; - LLColor4 mPrevFogColor; - F32 mPrevFogDensity; + // list of all the parameters, listed by name + preset_map_t mParamList; - // our parameter manager singleton instance - static LLWaterParamManager * sInstance; + preset_list_signal_t mPresetListChangeSignal; }; inline void LLWaterParamManager::setDensitySliderValue(F32 val) diff --git a/indra/newview/llwaterparamset.cpp b/indra/newview/llwaterparamset.cpp index 9457d631be..39d366b023 100644 --- a/indra/newview/llwaterparamset.cpp +++ b/indra/newview/llwaterparamset.cpp @@ -29,7 +29,6 @@ #include "llwaterparamset.h" #include "llsd.h" -#include "llfloaterwater.h" #include "llwaterparammanager.h" #include "lluictrlfactory.h" #include "llsliderctrl.h" @@ -224,3 +223,46 @@ F32 LLWaterParamSet::getFloat(const std::string& paramName, bool& error) return 0; } +// Added for interpolation effect in DEV-33645 +// Based on LLWLParamSet::mix, but written by Jacob without an intimate knowledge of how WindLight works. +// The function definition existed in the header but was never implemented. If you think there is something +// wrong with this, you're probably right. Ask Jacob, Q, or a member of the original WindLight team. +void LLWaterParamSet::mix(LLWaterParamSet& src, LLWaterParamSet& dest, F32 weight) +{ + // Setup + LLSD srcVal, destVal; // LLSD holders for get/set calls, reusable + + // Iterate through values + for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter) + { + // If param exists in both src and dest, set the holder variables, otherwise skip + if(src.mParamValues.has(iter->first) && dest.mParamValues.has(iter->first)) + { + srcVal = src.mParamValues[iter->first]; + destVal = dest.mParamValues[iter->first]; + } + else + { + continue; + } + + if(iter->second.isReal()) // If it's a real, interpolate directly + { + iter->second = srcVal.asReal() + ((destVal.asReal() - srcVal.asReal()) * weight); + } + else if(iter->second.isArray() && iter->second[0].isReal() // If it's an array of reals, loop through the reals and interpolate on those + && iter->second.size() == srcVal.size() && iter->second.size() == destVal.size()) + { + // Actually do interpolation: old value + (difference in values * factor) + for(int i=0; i < iter->second.size(); ++i) + { + // iter->second[i] = (1.f-weight)*(F32)srcVal[i].asReal() + weight*(F32)destVal[i].asReal(); // old way of doing it -- equivalent but one more operation + iter->second[i] = srcVal[i].asReal() + ((destVal[i].asReal() - srcVal[i].asReal()) * weight); + } + } + else // Else, skip + { + continue; + } + } +} diff --git a/indra/newview/llwaterparamset.h b/indra/newview/llwaterparamset.h index 9957d5371b..b28585af59 100644 --- a/indra/newview/llwaterparamset.h +++ b/indra/newview/llwaterparamset.h @@ -34,7 +34,6 @@ #include "v4color.h" #include "llviewershadermgr.h" -class LLFloaterWater; class LLWaterParamSet; /// A class representing a set of parameter values for the Water shaders. diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp index a94a2e41aa..e568638cf6 100644 --- a/indra/newview/llwlanimator.cpp +++ b/indra/newview/llwlanimator.cpp @@ -30,20 +30,31 @@ #include "llsky.h" #include "pipeline.h" #include "llwlparammanager.h" +#include "llwaterparammanager.h" -LLWLAnimator::LLWLAnimator() : mStartTime(0), mDayRate(1), mDayTime(0), - mIsRunning(FALSE), mUseLindenTime(false) +extern LLControlGroup gSavedSettings; + +F64 LLWLAnimator::INTERP_TOTAL_SECONDS = 3.f; + +LLWLAnimator::LLWLAnimator() : mStartTime(0.f), mDayRate(1.f), mDayTime(0.f), + mIsRunning(FALSE), mIsInterpolating(FALSE), mTimeType(TIME_LINDEN), + mInterpStartTime(), mInterpEndTime() { - mDayTime = 0; + mInterpBeginWL = new LLWLParamSet(); + mInterpBeginWater = new LLWaterParamSet(); + mInterpEndWater = new LLWaterParamSet(); } void LLWLAnimator::update(LLWLParamSet& curParams) { + //llassert(mUseLindenTime != mUseLocalTime); + F64 curTime; curTime = getDayTime(); // don't do anything if empty - if(mTimeTrack.size() == 0) { + if(mTimeTrack.size() == 0) + { return; } @@ -53,13 +64,15 @@ void LLWLAnimator::update(LLWLParamSet& curParams) mSecondIt++; // grab the two tween iterators - while(mSecondIt != mTimeTrack.end() && curTime > mSecondIt->first) { + while(mSecondIt != mTimeTrack.end() && curTime > mSecondIt->first) + { mFirstIt++; mSecondIt++; } // scroll it around when you get to the end - if(mSecondIt == mTimeTrack.end() || mFirstIt->first > curTime) { + if(mSecondIt == mTimeTrack.end() || mFirstIt->first > curTime) + { mSecondIt = mTimeTrack.begin(); mFirstIt = mTimeTrack.end(); mFirstIt--; @@ -67,70 +80,111 @@ void LLWLAnimator::update(LLWLParamSet& curParams) F32 weight = 0; - if(mFirstIt->first < mSecondIt->first) { + if(mFirstIt->first < mSecondIt->first) + { // get the delta time and the proper weight weight = F32 (curTime - mFirstIt->first) / (mSecondIt->first - mFirstIt->first); // handle the ends - } else if(mFirstIt->first > mSecondIt->first) { + } + else if(mFirstIt->first > mSecondIt->first) + { // right edge of time line - if(curTime >= mFirstIt->first) { + if(curTime >= mFirstIt->first) + { weight = F32 (curTime - mFirstIt->first) / ((1 + mSecondIt->first) - mFirstIt->first); - // left edge of time line - } else { + } + else + { weight = F32 ((1 + curTime) - mFirstIt->first) / ((1 + mSecondIt->first) - mFirstIt->first); } - // handle same as whatever the last one is - } else { + } + else + { weight = 1; } + if(mIsInterpolating) + { + // *TODO_JACOB: this is kind of laggy. Not sure why. The part that lags is the curParams.mix call, and none of the other mixes. It works, though. + clock_t current = clock(); + if(current >= mInterpEndTime) + { + mIsInterpolating = false; + return; + } + + // determine moving target for final interpolation value + // *TODO: this will not work with lazy loading of sky presets. + LLWLParamSet buf = LLWLParamSet(); + buf.setAll(LLWLParamManager::getInstance()->mParamList[mFirstIt->second].getAll()); // just give it some values, otherwise it has no params to begin with (see comment in constructor) + buf.mix(LLWLParamManager::getInstance()->mParamList[mFirstIt->second], LLWLParamManager::getInstance()->mParamList[mSecondIt->second], weight); // mix to determine moving target for interpolation finish (as below) + + // mix from previous value to moving target + weight = (current - mInterpStartTime) / (INTERP_TOTAL_SECONDS * CLOCKS_PER_SEC); + curParams.mix(*mInterpBeginWL, buf, weight); + + // mix water + LLWaterParamManager::getInstance()->mCurParams.mix(*mInterpBeginWater, *mInterpEndWater, weight); + } + else + { // do the interpolation and set the parameters - curParams.mix(LLWLParamManager::instance()->mParamList[mFirstIt->second], - LLWLParamManager::instance()->mParamList[mSecondIt->second], weight); + // *TODO: this will not work with lazy loading of sky presets. + curParams.mix(LLWLParamManager::getInstance()->mParamList[mFirstIt->second], LLWLParamManager::getInstance()->mParamList[mSecondIt->second], weight); + } } F64 LLWLAnimator::getDayTime() { - if(!mIsRunning) { + if(!mIsRunning) + { return mDayTime; } - - if(mUseLindenTime) { - + else if(mTimeType == TIME_LINDEN) + { F32 phase = gSky.getSunPhase() / F_PI; // we're not solving the non-linear equation that determines sun phase // we're just linearly interpolating between the major points if (phase <= 5.0 / 4.0) { mDayTime = (1.0 / 3.0) * phase + (1.0 / 3.0); - } else { + } + else + { mDayTime = phase - (1.0 / 2.0); } - if(mDayTime > 1) { + if(mDayTime > 1) + { mDayTime--; } return mDayTime; } + else if(mTimeType == TIME_LOCAL) + { + return getLocalTime(); + } // get the time; mDayTime = (LLTimer::getElapsedSeconds() - mStartTime) / mDayRate; // clamp it - if(mDayTime < 0) { + if(mDayTime < 0) + { mDayTime = 0; } - while(mDayTime > 1) { + while(mDayTime > 1) + { mDayTime--; } @@ -144,15 +198,18 @@ void LLWLAnimator::setDayTime(F64 dayTime) mDayTime = dayTime; // clamp it - if(mDayTime < 0) { + if(mDayTime < 0) + { mDayTime = 0; - } else if(mDayTime > 1) { + } + else if(mDayTime > 1) + { mDayTime = 1; } } -void LLWLAnimator::setTrack(std::map<F32, std::string>& curTrack, +void LLWLAnimator::setTrack(std::map<F32, LLWLParamKey>& curTrack, F32 dayRate, F64 dayTime, bool run) { mTimeTrack = curTrack; @@ -161,3 +218,96 @@ void LLWLAnimator::setTrack(std::map<F32, std::string>& curTrack, mIsRunning = run; } + +void LLWLAnimator::startInterpolation(const LLSD& targetWater) +{ + mInterpBeginWL->setAll(LLWLParamManager::getInstance()->mCurParams.getAll()); + mInterpBeginWater->setAll(LLWaterParamManager::getInstance()->mCurParams.getAll()); + + mInterpStartTime = clock(); + mInterpEndTime = mInterpStartTime + clock_t(INTERP_TOTAL_SECONDS) * CLOCKS_PER_SEC; + + // Don't set any ending WL -- this is continuously calculated as the animator updates since it's a moving target + mInterpEndWater->setAll(targetWater); + + mIsInterpolating = true; +} + +std::string LLWLAnimator::timeToString(F32 curTime) +{ + S32 hours; + S32 min; + bool isPM = false; + + // get hours and minutes + hours = (S32) (24.0 * curTime); + curTime -= ((F32) hours / 24.0f); + min = llround(24.0f * 60.0f * curTime); + + // handle case where it's 60 + if(min == 60) + { + hours++; + min = 0; + } + + // set for PM + if(hours >= 12 && hours < 24) + { + isPM = true; + } + + // convert to non-military notation + if(hours >= 24) + { + hours = 12; + } + else if(hours > 12) + { + hours -= 12; + } + else if(hours == 0) + { + hours = 12; + } + + // make the string + std::stringstream newTime; + newTime << hours << ":"; + + // double 0 + if(min < 10) + { + newTime << 0; + } + + // finish it + newTime << min << " "; + if(isPM) + { + newTime << "PM"; + } + else + { + newTime << "AM"; + } + + return newTime.str(); +} + +F64 LLWLAnimator::getLocalTime() +{ + char buffer[9]; + time_t rawtime; + struct tm* timeinfo; + + time(&rawtime); + timeinfo = localtime(&rawtime); + strftime(buffer, 9, "%H:%M:%S", timeinfo); + std::string timeStr(buffer); + + F64 tod = ((F64)atoi(timeStr.substr(0,2).c_str())) / 24.f + + ((F64)atoi(timeStr.substr(3,2).c_str())) / 1440.f + + ((F64)atoi(timeStr.substr(6,2).c_str())) / 86400.f; + return tod; +} diff --git a/indra/newview/llwlanimator.h b/indra/newview/llwlanimator.h index 5677290213..5223b45343 100644 --- a/indra/newview/llwlanimator.h +++ b/indra/newview/llwlanimator.h @@ -28,28 +28,39 @@ #define LL_WL_ANIMATOR_H #include "llwlparamset.h" +#include "llwaterparamset.h" #include <string> #include <map> +struct LLWLParamKey; + class LLWLAnimator { public: + typedef enum e_time + { + TIME_LINDEN, + TIME_LOCAL, + TIME_CUSTOM + } ETime; + F64 mStartTime; F32 mDayRate; F64 mDayTime; // track to play - std::map<F32, std::string> mTimeTrack; - std::map<F32, std::string>::iterator mFirstIt, mSecondIt; - - // params to use - //std::map<std::string, LLWLParamSet> mParamList; - - bool mIsRunning; - bool mUseLindenTime; + std::map<F32, LLWLParamKey> mTimeTrack; + std::map<F32, LLWLParamKey>::iterator mFirstIt, mSecondIt; // simple constructor LLWLAnimator(); + ~LLWLAnimator() + { + delete mInterpBeginWL; + delete mInterpBeginWater; + delete mInterpEndWater; + } + // update the parameters void update(LLWLParamSet& curParams); @@ -63,9 +74,66 @@ public: void setDayTime(F64 dayTime); // set an animation track - void setTrack(std::map<F32, std::string>& track, + void setTrack(std::map<F32, LLWLParamKey>& track, F32 dayRate, F64 dayTime = 0, bool run = true); + void deactivate() + { + mIsRunning = false; + } + + void activate(ETime time) + { + mIsRunning = true; + mTimeType = time; + } + + void startInterpolation(const LLSD& targetWater); + + bool getIsRunning() + { + return mIsRunning; + } + + bool getUseCustomTime() + { + return mTimeType == TIME_CUSTOM; + } + + bool getUseLocalTime() + { + return mTimeType == TIME_LOCAL; + } + + bool getUseLindenTime() + { + return mTimeType == TIME_LINDEN; + } + + void setTimeType(ETime time) + { + mTimeType = time; + } + + ETime getTimeType() + { + return mTimeType; + } + + /// convert the present time to a digital clock time + static std::string timeToString(F32 curTime); + + /// get local time between 0 and 1 + static F64 getLocalTime(); + +private: + ETime mTimeType; + bool mIsRunning, mIsInterpolating; + LLWLParamSet *mInterpBeginWL; + LLWaterParamSet *mInterpBeginWater, *mInterpEndWater; + clock_t mInterpStartTime, mInterpEndTime; + + static F64 INTERP_TOTAL_SECONDS; }; #endif // LL_WL_ANIMATOR_H diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp index 85b3d62a49..4c0cb7c0f4 100644 --- a/indra/newview/llwldaycycle.cpp +++ b/indra/newview/llwldaycycle.cpp @@ -27,12 +27,11 @@ #include "llviewerprecompiledheaders.h" #include "llwldaycycle.h" - -#include "llnotificationsutil.h" #include "llsdserialize.h" -#include "llxmlnode.h" - #include "llwlparammanager.h" +#include "llnotifications.h" + +#include "llviewerwindow.h" #include <map> @@ -45,85 +44,160 @@ LLWLDayCycle::~LLWLDayCycle() { } -void LLWLDayCycle::loadDayCycle(const std::string & fileName) +void LLWLDayCycle::loadDayCycle(const LLSD& day_data, LLWLParamKey::EScope scope) { - // clear the first few things + lldebugs << "Loading day cycle (day_data.size() = " << day_data.size() << ", scope = " << scope << ")" << llendl; mTimeMap.clear(); - // now load the file - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, - "windlight/days", fileName)); - llinfos << "Loading DayCycle settings from " << pathName << llendl; - - llifstream day_cycle_xml(pathName); - if (day_cycle_xml.is_open()) + // add each key frame + for(S32 i = 0; i < day_data.size(); ++i) { - // load and parse it - LLSD day_data(LLSD::emptyArray()); - LLPointer<LLSDParser> parser = new LLSDXMLParser(); - parser->parse(day_cycle_xml, day_data, LLSDSerialize::SIZE_UNLIMITED); - - // add each key - for(S32 i = 0; i < day_data.size(); ++i) + // make sure it's a two array + if(day_data[i].size() != 2) + { + continue; + } + + // check each param key exists in param manager + bool success; + LLWLParamSet pset; + LLWLParamKey frame = LLWLParamKey(day_data[i][1].asString(), scope); + success = + LLWLParamManager::getInstance()->getParamSet(frame, pset); + if(!success) { - // make sure it's a two array - if(day_data[i].size() != 2) + // *HACK: If loading region day cycle, try local sky presets as well. + // Local presets may be referenced by a region day cycle after + // it has been edited but the changes have not been uploaded. + if (scope == LLEnvKey::SCOPE_REGION) { - continue; + frame.scope = LLEnvKey::SCOPE_LOCAL; + success = LLWLParamManager::getInstance()->getParamSet(frame, pset); } - - // check each param name exists in param manager - bool success; - LLWLParamSet pset; - success = LLWLParamManager::instance()->getParamSet(day_data[i][1].asString(), pset); - if(!success) + + if (!success) { // alert the user LLSD args; args["SKY"] = day_data[i][1].asString(); - LLNotificationsUtil::add("WLMissingSky", args); + LLNotifications::instance().add("WLMissingSky", args, LLSD()); continue; } - - // then add the key - addKey((F32)day_data[i][0].asReal(), day_data[i][1].asString()); } + + // then add the keyframe + addKeyframe((F32)day_data[i][0].asReal(), frame); + } +} + +void LLWLDayCycle::loadDayCycleFromFile(const std::string & fileName) +{ + loadDayCycle(loadCycleDataFromFile(fileName), LLWLParamKey::SCOPE_LOCAL); +} +/*static*/ LLSD LLWLDayCycle::loadCycleDataFromFile(const std::string & fileName) +{ + // *FIX: Cannot load user day cycles. + std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, + "windlight/days", fileName)); + + return loadDayCycleFromPath(pathName); +} + +// static +LLSD LLWLDayCycle::loadDayCycleFromPath(const std::string& file_path) +{ + LL_INFOS("Windlight") << "Loading DayCycle settings from " << file_path << LL_ENDL; + + llifstream day_cycle_xml(file_path); + if (day_cycle_xml.is_open()) + { + // load and parse it + LLSD day_data(LLSD::emptyArray()); + LLPointer<LLSDParser> parser = new LLSDXMLParser(); + parser->parse(day_cycle_xml, day_data, LLSDSerialize::SIZE_UNLIMITED); day_cycle_xml.close(); + return day_data; + } + else + { + return LLSD(); } } void LLWLDayCycle::saveDayCycle(const std::string & fileName) { - LLSD day_data(LLSD::emptyArray()); - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", fileName)); //llinfos << "Saving WindLight settings to " << pathName << llendl; - for(std::map<F32, std::string>::const_iterator mIt = mTimeMap.begin(); - mIt != mTimeMap.end(); - ++mIt) + save(pathName); +} + +void LLWLDayCycle::save(const std::string& file_path) +{ + LLSD day_data = asLLSD(); + + llofstream day_cycle_xml(file_path); + LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); + formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY); + day_cycle_xml.close(); +} + +LLSD LLWLDayCycle::asLLSD() +{ + LLSD day_data(LLSD::emptyArray()); + for(std::map<F32, LLWLParamKey>::const_iterator mIt = mTimeMap.begin(); mIt != mTimeMap.end(); ++mIt) { LLSD key(LLSD::emptyArray()); key.append(mIt->first); - key.append(mIt->second); + key.append(mIt->second.name); day_data.append(key); } - llofstream day_cycle_xml(pathName); - LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); - formatter->format(day_data, day_cycle_xml, LLSDFormatter::OPTIONS_PRETTY); - day_cycle_xml.close(); + lldebugs << "Dumping day cycle (" << mTimeMap.size() << ") to LLSD: " << day_data << llendl; + return day_data; } +bool LLWLDayCycle::getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const +{ + bool result = true; + 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])) + { + llwarns << "Cannot find sky [" << key.name << "] referenced by a day cycle" << llendl; + result = false; + } + } + + return result; +} -void LLWLDayCycle::clearKeys() +bool LLWLDayCycle::getSkyMap(LLSD& sky_map) const { + std::map<LLWLParamKey, LLWLParamSet> refs; + + if (!getSkyRefs(refs)) + { + return false; + } + + sky_map = LLWLParamManager::createSkyMap(refs); + return true; +} + +void LLWLDayCycle::clearKeyframes() +{ + lldebugs << "Clearing key frames" << llendl; mTimeMap.clear(); } -bool LLWLDayCycle::addKey(F32 newTime, const std::string & paramName) +bool LLWLDayCycle::addKeyframe(F32 newTime, LLWLParamKey frame) { // no adding negative time if(newTime < 0) @@ -134,48 +208,58 @@ bool LLWLDayCycle::addKey(F32 newTime, const std::string & paramName) // if time not being used, add it and return true if(mTimeMap.find(newTime) == mTimeMap.end()) { - mTimeMap.insert(std::pair<F32, std::string>(newTime, paramName)); + mTimeMap.insert(std::pair<F32, LLWLParamKey>(newTime, frame)); + lldebugs << "Adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << llendl; return true; } // otherwise, don't add, and return error + llwarns << "Error adding key frame (" << newTime << ", " << frame.toLLSD() << ")" << llendl; return false; } -bool LLWLDayCycle::changeKeyTime(F32 oldTime, F32 newTime) +bool LLWLDayCycle::changeKeyframeTime(F32 oldTime, F32 newTime) { + lldebugs << "Changing key frame time (" << oldTime << " => " << newTime << ")" << llendl; + // just remove and add back - std::string name = mTimeMap[oldTime]; + LLWLParamKey frame = mTimeMap[oldTime]; - bool stat = removeKey(oldTime); + bool stat = removeKeyframe(oldTime); if(stat == false) { + lldebugs << "Failed to change key frame time (" << oldTime << " => " << newTime << ")" << llendl; return stat; } - return addKey(newTime, name); + return addKeyframe(newTime, frame); } -bool LLWLDayCycle::changeKeyParam(F32 time, const std::string & name) +bool LLWLDayCycle::changeKeyframeParam(F32 time, LLWLParamKey key) { + lldebugs << "Changing key frame param (" << time << ", " << key.toLLSD() << ")" << llendl; + // just remove and add back // make sure param exists LLWLParamSet tmp; - bool stat = LLWLParamManager::instance()->getParamSet(name, tmp); + bool stat = LLWLParamManager::getInstance()->getParamSet(key, tmp); if(stat == false) { + lldebugs << "Failed to change key frame param (" << time << ", " << key.toLLSD() << ")" << llendl; return stat; } - mTimeMap[time] = name; + mTimeMap[time] = key; return true; } -bool LLWLDayCycle::removeKey(F32 time) +bool LLWLDayCycle::removeKeyframe(F32 time) { + lldebugs << "Removing key frame (" << time << ")" << llendl; + // look for the time. If there, erase it - std::map<F32, std::string>::iterator mIt = mTimeMap.find(time); + std::map<F32, LLWLParamKey>::iterator mIt = mTimeMap.find(time); if(mIt != mTimeMap.end()) { mTimeMap.erase(mIt); @@ -185,15 +269,15 @@ bool LLWLDayCycle::removeKey(F32 time) return false; } -bool LLWLDayCycle::getKey(const std::string & name, F32& key) +bool LLWLDayCycle::getKeytime(LLWLParamKey frame, F32& key_time) const { - // scroll through till we find the - std::map<F32, std::string>::iterator mIt = mTimeMap.begin(); + // scroll through till we find the correct value in the map + std::map<F32, LLWLParamKey>::const_iterator mIt = mTimeMap.begin(); for(; mIt != mTimeMap.end(); ++mIt) { - if(name == mIt->second) + if(frame == mIt->second) { - key = mIt->first; + key_time = mIt->first; return true; } } @@ -204,26 +288,52 @@ bool LLWLDayCycle::getKey(const std::string & name, F32& key) bool LLWLDayCycle::getKeyedParam(F32 time, LLWLParamSet& param) { // just scroll on through till you find it - std::map<F32, std::string>::iterator mIt = mTimeMap.find(time); - if(mIt != mTimeMap.end()) + std::map<F32, LLWLParamKey>::iterator mIt = mTimeMap.find(time); + if(mIt != mTimeMap.end()) { - return LLWLParamManager::instance()->getParamSet(mIt->second, param); + return LLWLParamManager::getInstance()->getParamSet(mIt->second, param); } // return error if not found + lldebugs << "Key " << time << " not found" << llendl; return false; } bool LLWLDayCycle::getKeyedParamName(F32 time, std::string & name) { // just scroll on through till you find it - std::map<F32, std::string>::iterator mIt = mTimeMap.find(time); + std::map<F32, LLWLParamKey>::iterator mIt = mTimeMap.find(time); if(mIt != mTimeMap.end()) { - name = mTimeMap[time]; + name = mTimeMap[time].name; return true; } // return error if not found + lldebugs << "Key " << time << " not found" << llendl; return false; } + +bool LLWLDayCycle::hasReferencesTo(const LLWLParamKey& keyframe) const +{ + F32 dummy; + return getKeytime(keyframe, dummy); +} + +void LLWLDayCycle::removeReferencesTo(const LLWLParamKey& keyframe) +{ + lldebugs << "Removing references to key frame " << keyframe.toLLSD() << llendl; + F32 keytime; + bool might_exist; + do + { + // look for it + might_exist = getKeytime(keyframe, keytime); + if(!might_exist) + { + return; + } + might_exist = removeKeyframe(keytime); + + } while(might_exist); // might be another one +} diff --git a/indra/newview/llwldaycycle.h b/indra/newview/llwldaycycle.h index 5cbf72191d..c8585564ed 100644 --- a/indra/newview/llwldaycycle.h +++ b/indra/newview/llwldaycycle.h @@ -34,13 +34,16 @@ class LLWLDayCycle; #include <string> #include "llwlparamset.h" #include "llwlanimator.h" +struct LLWLParamKey; +#include "llenvmanager.h" // for LLEnvKey::EScope class LLWLDayCycle { + LOG_CLASS(LLWLDayCycle); public: // lists what param sets are used when during the day - std::map<F32, std::string> mTimeMap; + std::map<F32, LLWLParamKey> mTimeMap; // how long is my day F32 mDayRate; @@ -54,35 +57,56 @@ public: ~LLWLDayCycle(); /// load a day cycle - void loadDayCycle(const std::string & fileName); + void loadDayCycle(const LLSD& llsd, LLEnvKey::EScope scope); /// load a day cycle + void loadDayCycleFromFile(const std::string & fileName); + + /// save a day cycle void saveDayCycle(const std::string & fileName); - /// clear keys - void clearKeys(); + /// save a day cycle + void save(const std::string& file_path); + + /// load the LLSD data from a file (returns the undefined LLSD if not found) + static LLSD loadCycleDataFromFile(const std::string & fileName); + + /// load the LLSD data from a file specified by full path + static LLSD loadDayCycleFromPath(const std::string& file_path); + + /// get the LLSD data for this day cycle + LLSD asLLSD(); + + // get skies referenced by this day cycle + bool getSkyRefs(std::map<LLWLParamKey, LLWLParamSet>& refs) const; + + // get referenced skies as LLSD + bool getSkyMap(LLSD& sky_map) const; + + /// clear keyframes + void clearKeyframes(); /// Getters and Setters /// add a new key frame to the day cycle /// returns true if successful /// no negative time - bool addKey(F32 newTime, const std::string & paramName); + bool addKeyframe(F32 newTime, LLWLParamKey key); - /// adjust a key's placement in the day cycle + /// adjust a keyframe's placement in the day cycle /// returns true if successful - bool changeKeyTime(F32 oldTime, F32 newTime); + bool changeKeyframeTime(F32 oldTime, F32 newTime); - /// adjust a key's parameter used + /// adjust a keyframe's parameter used /// returns true if successful - bool changeKeyParam(F32 time, const std::string & paramName); + bool changeKeyframeParam(F32 time, LLWLParamKey key); - /// remove a key from the day cycle + /// remove a key frame from the day cycle /// returns true if successful - bool removeKey(F32 time); + bool removeKeyframe(F32 time); /// get the first key time for a parameter /// returns false if not there - bool getKey(const std::string & name, F32& key); + bool getKeytime(LLWLParamKey keyFrame, F32& keyTime) const; /// get the param set at a given time /// returns true if found one @@ -92,6 +116,12 @@ public: /// returns true if it found one bool getKeyedParamName(F32 time, std::string & name); + /// @return true if there are references to the given sky + bool hasReferencesTo(const LLWLParamKey& keyframe) const; + + /// removes all references to the sky (paramkey) + /// does nothing if the sky doesn't exist in the day + void removeReferencesTo(const LLWLParamKey& keyframe); }; diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp new file mode 100644 index 0000000000..b5f53232cc --- /dev/null +++ b/indra/newview/llwlhandlers.cpp @@ -0,0 +1,203 @@ +/** + * @file llwlhandlers.cpp + * @brief Various classes which handle Windlight-related messaging + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llwlhandlers.h" + +#include "llagent.h" +#include "llviewerregion.h" +#include "llenvmanager.h" +#include "llnotificationsutil.h" + +/**** + * LLEnvironmentRequest + ****/ +// static +bool LLEnvironmentRequest::initiate() +{ + LLViewerRegion* cur_region = gAgent.getRegion(); + + if (!cur_region) + { + LL_WARNS("WindlightCaps") << "Viewer region not set yet, skipping env. settings request" << LL_ENDL; + return false; + } + + if (!cur_region->capabilitiesReceived()) + { + LL_INFOS("WindlightCaps") << "Deferring windlight settings request until we've got region caps" << LL_ENDL; + cur_region->setCapabilitiesReceivedCallback(boost::bind(&LLEnvironmentRequest::onRegionCapsReceived, _1)); + return false; + } + + return doRequest(); +} + +// static +void LLEnvironmentRequest::onRegionCapsReceived(const LLUUID& region_id) +{ + if (region_id != gAgent.getRegion()->getRegionID()) + { + LL_INFOS("WindlightCaps") << "Got caps for a non-current region" << LL_ENDL; + return; + } + + LL_DEBUGS("WindlightCaps") << "Received region capabilities" << LL_ENDL; + doRequest(); +} + +// static +bool LLEnvironmentRequest::doRequest() +{ + std::string url = gAgent.getRegion()->getCapability("EnvironmentSettings"); + if (url.empty()) + { + LL_INFOS("WindlightCaps") << "Skipping windlight setting request - we don't have this capability" << LL_ENDL; + // region is apparently not capable of this; don't respond at all + return false; + } + + LL_INFOS("WindlightCaps") << "Requesting region windlight settings via " << url << LL_ENDL; + LLHTTPClient::get(url, new LLEnvironmentRequestResponder()); + return true; +} + +/**** + * LLEnvironmentRequestResponder + ****/ +int LLEnvironmentRequestResponder::sCount = 0; // init to 0 + +LLEnvironmentRequestResponder::LLEnvironmentRequestResponder() +{ + mID = ++sCount; +} +/*virtual*/ void LLEnvironmentRequestResponder::result(const LLSD& unvalidated_content) +{ + LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL; + + if (mID != sCount) + { + LL_INFOS("WindlightCaps") << "Got superseded by another responder; ignoring..." << LL_ENDL; + return; + } + + if (unvalidated_content[0]["regionID"].asUUID() != gAgent.getRegion()->getRegionID()) + { + LL_WARNS("WindlightCaps") << "Not in the region from where this data was received (wanting " + << gAgent.getRegion()->getRegionID() << " but got " << unvalidated_content[0]["regionID"].asUUID() + << ") - ignoring..." << LL_ENDL; + return; + } + + LLEnvManagerNew::getInstance()->onRegionSettingsResponse(unvalidated_content); +} +/*virtual*/ void LLEnvironmentRequestResponder::error(U32 status, const std::string& reason) +{ + LL_INFOS("WindlightCaps") << "Got an error, not using region windlight..." << LL_ENDL; + LLEnvManagerNew::getInstance()->onRegionSettingsResponse(LLSD()); +} + +/**** + * LLEnvironmentApply + ****/ + +clock_t LLEnvironmentApply::UPDATE_WAIT_SECONDS = clock_t(3.f); +clock_t LLEnvironmentApply::sLastUpdate = clock_t(0.f); + +// static +bool LLEnvironmentApply::initiateRequest(const LLSD& content) +{ + clock_t current = clock(); + + // Make sure we don't update too frequently. + if (current < sLastUpdate + (UPDATE_WAIT_SECONDS * CLOCKS_PER_SEC)) + { + LLSD args(LLSD::emptyMap()); + args["WAIT"] = (F64)UPDATE_WAIT_SECONDS; + LLNotificationsUtil::add("EnvUpdateRate", args); + return false; + } + + sLastUpdate = current; + + // Send update request. + std::string url = gAgent.getRegion()->getCapability("EnvironmentSettings"); + if (url.empty()) + { + LL_WARNS("WindlightCaps") << "Applying windlight settings not supported" << LL_ENDL; + return false; + } + + LL_INFOS("WindlightCaps") << "Sending windlight settings to " << url << LL_ENDL; + LL_DEBUGS("WindlightCaps") << "content: " << content << LL_ENDL; + LLHTTPClient::post(url, content, new LLEnvironmentApplyResponder()); + return true; +} + +/**** + * LLEnvironmentApplyResponder + ****/ +/*virtual*/ void LLEnvironmentApplyResponder::result(const LLSD& content) +{ + if (content["regionID"].asUUID() != gAgent.getRegion()->getRegionID()) + { + LL_WARNS("WindlightCaps") << "No longer in the region where data was sent (currently " + << gAgent.getRegion()->getRegionID() << ", reply is from " << content["regionID"].asUUID() + << "); ignoring..." << LL_ENDL; + return; + } + else if (content["success"].asBoolean()) + { + LL_DEBUGS("WindlightCaps") << "Success in applying windlight settings to region " << content["regionID"].asUUID() << LL_ENDL; + LLEnvManagerNew::instance().onRegionSettingsApplyResponse(true); + } + else + { + 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(); + LLNotificationsUtil::add("WLRegionApplyFail", args); + LLEnvManagerNew::instance().onRegionSettingsApplyResponse(false); + } +} +/*virtual*/ void LLEnvironmentApplyResponder::error(U32 status, const std::string& reason) +{ + std::stringstream msg; + msg << reason << " (Code " << status << ")"; + + LL_WARNS("WindlightCaps") << "Couldn't apply windlight settings to region! Reason: " << msg << LL_ENDL; + + LLSD args(LLSD::emptyMap()); + args["FAIL_REASON"] = msg.str(); + LLNotificationsUtil::add("WLRegionApplyFail", args); +} diff --git a/indra/newview/llwlhandlers.h b/indra/newview/llwlhandlers.h new file mode 100644 index 0000000000..213bc7c7ce --- /dev/null +++ b/indra/newview/llwlhandlers.h @@ -0,0 +1,106 @@ +/** + * @file llwlhandlers.h + * @brief Headers for classes in llwlhandlers.cpp + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("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 + * + * 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 + * + * 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. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLWLHANDLERS_H +#define LL_LLWLHANDLERS_H + +#include "llviewerprecompiledheaders.h" +#include "llhttpclient.h" + +class LLEnvironmentRequest +{ + LOG_CLASS(LLEnvironmentRequest); +public: + /// @return true if request was successfully sent + static bool initiate(); + +private: + static void onRegionCapsReceived(const LLUUID& region_id); + static bool doRequest(); +}; + +class LLEnvironmentRequestResponder: public LLHTTPClient::Responder +{ + LOG_CLASS(LLEnvironmentRequestResponder); +public: + virtual void result(const LLSD& content); + virtual void error(U32 status, const std::string& reason); + +private: + friend class LLEnvironmentRequest; + + LLEnvironmentRequestResponder(); + static int sCount; + int mID; +}; + +class LLEnvironmentApply +{ + LOG_CLASS(LLEnvironmentApply); +public: + /// @return true if request was successfully sent + static bool initiateRequest(const LLSD& content); + +private: + static clock_t sLastUpdate; + static clock_t UPDATE_WAIT_SECONDS; +}; + +class LLEnvironmentApplyResponder: public LLHTTPClient::Responder +{ + LOG_CLASS(LLEnvironmentApplyResponder); +public: + /* + * Expecting reply from sim in form of: + * { + * regionID : uuid, + * messageID: uuid, + * success : true + * } + * or + * { + * regionID : uuid, + * success : false, + * fail_reason : string + * } + */ + virtual void result(const LLSD& content); + + virtual void error(U32 status, const std::string& reason); // non-200 errors only + +private: + friend class LLEnvironmentApply; + + LLEnvironmentApplyResponder() {} +}; + +#endif // LL_LLWLHANDLERS_H diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 848efcbb49..55608a059f 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -37,23 +37,29 @@ #include "llspinctrl.h" #include "llcheckboxctrl.h" #include "lluictrlfactory.h" +#include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" #include "llsdserialize.h" #include "v4math.h" +#include "llviewerdisplay.h" #include "llviewercontrol.h" +#include "llviewerwindow.h" +#include "lldrawpoolwater.h" +#include "llagent.h" +#include "llviewerregion.h" +#include "lldaycyclemanager.h" +#include "llenvmanager.h" #include "llwlparamset.h" #include "llpostprocess.h" -#include "llfloaterwindlight.h" -#include "llfloaterdaycycle.h" -#include "llfloaterenvsettings.h" -#include "curl/curl.h" +#include "llviewershadermgr.h" +#include "llglslshader.h" -LLWLParamManager * LLWLParamManager::sInstance = NULL; -static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); +#include "curl/curl.h" +#include "llstreamtools.h" LLWLParamManager::LLWLParamManager() : @@ -96,161 +102,237 @@ LLWLParamManager::~LLWLParamManager() { } -void LLWLParamManager::loadPresets(const std::string& file_name) +void LLWLParamManager::clearParamSetsOfScope(LLWLParamKey::EScope scope) { - std::string path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", "")); - LL_DEBUGS2("AppInit", "Shaders") << "Loading Default WindLight settings from " << path_name << LL_ENDL; - - bool found = true; - LLDirIterator app_settings_iter(path_name, "*.xml"); - while(found) + if (LLWLParamKey::SCOPE_LOCAL == scope) { - std::string name; - found = app_settings_iter.next(name); - if(found) - { - - name=name.erase(name.length()-4); - - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; + LL_WARNS("Windlight") << "Tried to clear windlight sky presets from local system! This shouldn't be called..." << LL_ENDL; + return; + } - LL_DEBUGS2("AppInit", "Shaders") << "name: " << name << LL_ENDL; - loadPreset(unescaped_name,FALSE); + std::set<LLWLParamKey> to_remove; + for(std::map<LLWLParamKey, LLWLParamSet>::iterator iter = mParamList.begin(); iter != mParamList.end(); ++iter) + { + if(iter->first.scope == scope) + { + to_remove.insert(iter->first); } } - // And repeat for user presets, note the user presets will modify any system presets already loaded + for(std::set<LLWLParamKey>::iterator iter = to_remove.begin(); iter != to_remove.end(); ++iter) + { + mParamList.erase(*iter); + } +} - std::string path_name2(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); - LL_DEBUGS2("AppInit", "Shaders") << "Loading User WindLight settings from " << path_name2 << LL_ENDL; - - found = true; - LLDirIterator user_settings_iter(path_name2, "*.xml"); - while(found) +// returns all skies referenced by the day cycle, with their final names +// side effect: applies changes to all internal structures! +std::map<LLWLParamKey, LLWLParamSet> LLWLParamManager::finalizeFromDayCycle(LLWLParamKey::EScope scope) +{ + lldebugs << "mDay before finalizing:" << llendl; { - std::string name; - found = user_settings_iter.next(name); - if(found) + for (std::map<F32, LLWLParamKey>::iterator iter = mDay.mTimeMap.begin(); iter != mDay.mTimeMap.end(); ++iter) { - name=name.erase(name.length()-4); + LLWLParamKey& key = iter->second; + lldebugs << iter->first << "->" << key.name << llendl; + } + } + + std::map<LLWLParamKey, LLWLParamSet> final_references; - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_unescape(name.c_str(), name.size()); - std::string unescaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; + // Move all referenced to desired scope, renaming if necessary + // First, save skies referenced + std::map<LLWLParamKey, LLWLParamSet> current_references; // all skies referenced by the day cycle, with their current names + // guard against skies with same name and different scopes + std::set<std::string> inserted_names; + std::map<std::string, unsigned int> conflicted_names; // integer later used as a count, for uniquely renaming conflicts - LL_DEBUGS2("AppInit", "Shaders") << "name: " << name << LL_ENDL; - loadPreset(unescaped_name,FALSE); + LLWLDayCycle& cycle = mDay; + for(std::map<F32, LLWLParamKey>::iterator iter = cycle.mTimeMap.begin(); + iter != cycle.mTimeMap.end(); + ++iter) + { + LLWLParamKey& key = iter->second; + std::string desired_name = key.name; + replace_newlines_with_whitespace(desired_name); // already shouldn't have newlines, but just in case + if(inserted_names.find(desired_name) == inserted_names.end()) + { + inserted_names.insert(desired_name); } + else + { + // make exist in map + conflicted_names[desired_name] = 0; + } + current_references[key] = mParamList[key]; } -} + // forget all old skies in target scope, and rebuild, renaming as needed + clearParamSetsOfScope(scope); + for(std::map<LLWLParamKey, LLWLParamSet>::iterator iter = current_references.begin(); iter != current_references.end(); ++iter) + { + const LLWLParamKey& old_key = iter->first; -void LLWLParamManager::savePresets(const std::string & fileName) -{ - //Nobody currently calls me, but if they did, then its reasonable to write the data out to the user's folder - //and not over the RO system wide version. + std::string desired_name(old_key.name); + replace_newlines_with_whitespace(desired_name); - LLSD paramsData(LLSD::emptyMap()); - - std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName)); + LLWLParamKey new_key(desired_name, scope); // name will be replaced later if necessary - for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin(); - mIt != mParamList.end(); - ++mIt) - { - paramsData[mIt->first] = mIt->second.getAll(); - } + // if this sky is one with a non-unique name, rename via appending a number + // an existing preset of the target scope gets to keep its name + if (scope != old_key.scope && conflicted_names.find(desired_name) != conflicted_names.end()) + { + std::string& new_name = new_key.name; - llofstream presetsXML(pathName); + do + { + // if this executes more than once, this is an absurdly pathological case + // (e.g. "x" repeated twice, but "x 1" already exists, so need to use "x 2") + std::stringstream temp; + temp << desired_name << " " << (++conflicted_names[desired_name]); + new_name = temp.str(); + } while (inserted_names.find(new_name) != inserted_names.end()); - LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); + // yay, found one that works + inserted_names.insert(new_name); // track names we consume here; shouldn't be necessary due to ++int? but just in case - formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY); + // *TODO factor out below into a rename()? - presetsXML.close(); -} + LL_INFOS("Windlight") << "Renamed " << old_key.name << " (scope" << old_key.scope << ") to " + << new_key.name << " (scope " << new_key.scope << ")" << LL_ENDL; -void LLWLParamManager::loadPreset(const std::string & name,bool propagate) -{ - - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_filename(curl_str); - curl_free(curl_str); - curl_str = NULL; + // update name in sky + iter->second.mName = new_name; - escaped_filename += ".xml"; + // update keys in day cycle + for(std::map<F32, LLWLParamKey>::iterator frame = cycle.mTimeMap.begin(); frame != cycle.mTimeMap.end(); ++frame) + { + if (frame->second == old_key) + { + frame->second = new_key; + } + } - std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename)); - LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL; + // add to master sky map + mParamList[new_key] = iter->second; + } - llifstream presetsXML; - presetsXML.open(pathName.c_str()); + final_references[new_key] = iter->second; + } - // That failed, try loading from the users area instead. - if(!presetsXML) + lldebugs << "mDay after finalizing:" << llendl; { - pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename); - LL_DEBUGS2("AppInit", "Shaders") << "Loading User WindLight sky setting from " << pathName << LL_ENDL; - presetsXML.clear(); - presetsXML.open(pathName.c_str()); + for (std::map<F32, LLWLParamKey>::iterator iter = mDay.mTimeMap.begin(); iter != mDay.mTimeMap.end(); ++iter) + { + LLWLParamKey& key = iter->second; + lldebugs << iter->first << "->" << key.name << llendl; + } } - if (presetsXML) + return final_references; +} + +// static +LLSD LLWLParamManager::createSkyMap(std::map<LLWLParamKey, LLWLParamSet> refs) +{ + LLSD skies = LLSD::emptyMap(); + for(std::map<LLWLParamKey, LLWLParamSet>::iterator iter = refs.begin(); iter != refs.end(); ++iter) { - LLSD paramsData(LLSD::emptyMap()); + skies.insert(iter->first.name, iter->second.getAll()); + } + return skies; +} - LLPointer<LLSDParser> parser = new LLSDXMLParser(); +void LLWLParamManager::addAllSkies(const LLWLParamKey::EScope scope, const LLSD& sky_presets) +{ + for(LLSD::map_const_iterator iter = sky_presets.beginMap(); iter != sky_presets.endMap(); ++iter) + { + LLWLParamSet set; + set.setAll(iter->second); + mParamList[LLWLParamKey(iter->first, scope)] = set; + } +} - parser->parse(presetsXML, paramsData, LLSDSerialize::SIZE_UNLIMITED); +void LLWLParamManager::refreshRegionPresets() +{ + // Remove all region sky presets because they may belong to a previously visited region. + clearParamSetsOfScope(LLEnvKey::SCOPE_REGION); + + // Add all sky presets belonging to the current region. + addAllSkies(LLEnvKey::SCOPE_REGION, LLEnvManagerNew::instance().getRegionSettings().getSkyMap()); +} + +void LLWLParamManager::loadAllPresets() +{ + // First, load system (coming out of the box) sky presets. + loadPresetsFromDir(getSysDir()); - std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); - if(mIt == mParamList.end()) + // Then load user presets. Note that user day presets will modify any system ones already loaded. + loadPresetsFromDir(getUserDir()); +} + +void LLWLParamManager::loadPresetsFromDir(const std::string& dir) +{ + LL_INFOS2("AppInit", "Shaders") << "Loading sky presets from " << dir << LL_ENDL; + + LLDirIterator dir_iter(dir, "*.xml"); + while (1) + { + std::string file; + if (!dir_iter.next(file)) { - addParamSet(name, paramsData); + break; // no more files } - else + + std::string path = dir + file; + if (!loadPreset(path)) { - setParamSet(name, paramsData); + llwarns << "Error loading sky preset from " << path << llendl; } - presetsXML.close(); - } - else + } +} + +bool LLWLParamManager::loadPreset(const std::string& path) +{ + llifstream xml_file; + std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true)); + + xml_file.open(path.c_str()); + if (!xml_file) { - llwarns << "Can't find " << name << llendl; - return; + return false; } - - if(propagate) + LL_DEBUGS2("AppInit", "Shaders") << "Loading sky " << name << LL_ENDL; + + LLSD params_data; + LLPointer<LLSDParser> parser = new LLSDXMLParser(); + parser->parse(xml_file, params_data, LLSDSerialize::SIZE_UNLIMITED); + xml_file.close(); + + LLWLParamKey key(name, LLEnvKey::SCOPE_LOCAL); + if (hasParamSet(key)) { - getParamSet(name, mCurParams); - propagateParameters(); + setParamSet(key, params_data); + } + else + { + addParamSet(key, params_data); } -} -void LLWLParamManager::savePreset(const std::string & name) -{ - // bugfix for SL-46920: preventing filenames that break stuff. - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_filename(curl_str); - curl_free(curl_str); - curl_str = NULL; + return true; +} - escaped_filename += ".xml"; +void LLWLParamManager::savePreset(LLWLParamKey key) +{ + llassert(key.scope == LLEnvKey::SCOPE_LOCAL && !key.name.empty()); // make an empty llsd LLSD paramsData(LLSD::emptyMap()); - std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename)); + std::string pathName(getUserDir() + escapeString(key.name) + ".xml"); // fill it with LLSD windlight params - paramsData = mParamList[name].getAll(); + paramsData = mParamList[key].getAll(); // write to file llofstream presetsXML(pathName); @@ -283,6 +365,8 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) } +static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); + void LLWLParamManager::propagateParameters(void) { LLFastTimer ftm(FTM_UPDATE_WLPARAM); @@ -362,7 +446,7 @@ void LLWLParamManager::update(LLViewerCamera * cam) mCurParams.updateCloudScrolling(); // update only if running - if(mAnimator.mIsRunning) + if(mAnimator.getIsRunning()) { mAnimator.update(mCurParams); } @@ -370,31 +454,16 @@ void LLWLParamManager::update(LLViewerCamera * cam) // update the shaders and the menu propagateParameters(); - // sync menus if they exist - LLFloaterWindLight* wlfloater = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight"); - if (wlfloater) - { - wlfloater->syncMenu(); - } - LLFloaterDayCycle* dlfloater = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); - if (dlfloater) - { - dlfloater->syncMenu(); - } - LLFloaterEnvSettings* envfloater = LLFloaterReg::findTypedInstance<LLFloaterEnvSettings>("env_settings"); - if (envfloater) - { - envfloater->syncMenu(); - } - F32 camYaw = cam->getYaw(); + stop_glerror(); + // *TODO: potential optimization - this block may only need to be // executed some of the time. For example for water shaders only. { F32 camYawDelta = mSunDeltaYaw * DEG_TO_RAD; - LLVector3 lightNorm3(mLightDir); + LLVector3 lightNorm3(mLightDir); lightNorm3 *= LLQuaternion(-(camYaw + camYawDelta), LLVector3(0.f, 1.f, 0.f)); mRotatedLightDir = LLVector4(lightNorm3, 0.f); @@ -412,17 +481,18 @@ void LLWLParamManager::update(LLViewerCamera * cam) } } -// static -void LLWLParamManager::initClass(void) +bool LLWLParamManager::applyDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time) { - instance(); + mDay.loadDayCycle(params, scope); + resetAnimator(time, true); // set to specified time and start animator + return true; } -// static -void LLWLParamManager::cleanupClass() +bool LLWLParamManager::applySkyParams(const LLSD& params) { - delete sInstance; - sInstance = NULL; + mAnimator.deactivate(); + mCurParams.setAll(params); + return true; } void LLWLParamManager::resetAnimator(F32 curTime, bool run) @@ -432,133 +502,227 @@ void LLWLParamManager::resetAnimator(F32 curTime, bool run) return; } -bool LLWLParamManager::addParamSet(const std::string& name, LLWLParamSet& param) + +bool LLWLParamManager::addParamSet(const LLWLParamKey& key, LLWLParamSet& param) { // add a new one if not one there already - std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); + std::map<LLWLParamKey, LLWLParamSet>::iterator mIt = mParamList.find(key); if(mIt == mParamList.end()) { - mParamList[name] = param; + llassert(!key.name.empty()); + // *TODO: validate params + mParamList[key] = param; + mPresetListChangeSignal(); return true; } return false; } -BOOL LLWLParamManager::addParamSet(const std::string& name, LLSD const & param) +BOOL LLWLParamManager::addParamSet(const LLWLParamKey& key, LLSD const & param) { - // add a new one if not one there already - std::map<std::string, LLWLParamSet>::const_iterator finder = mParamList.find(name); - if(finder == mParamList.end()) - { - mParamList[name].setAll(param); - return TRUE; - } - else - { - return FALSE; - } + LLWLParamSet param_set; + param_set.setAll(param); + return addParamSet(key, param_set); } -bool LLWLParamManager::getParamSet(const std::string& name, LLWLParamSet& param) +bool LLWLParamManager::getParamSet(const LLWLParamKey& key, LLWLParamSet& param) { // find it and set it - std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); + std::map<LLWLParamKey, LLWLParamSet>::iterator mIt = mParamList.find(key); if(mIt != mParamList.end()) { - param = mParamList[name]; - param.mName = name; + param = mParamList[key]; + param.mName = key.name; return true; } return false; } -bool LLWLParamManager::setParamSet(const std::string& name, LLWLParamSet& param) +bool LLWLParamManager::hasParamSet(const LLWLParamKey& key) { - mParamList[name] = param; + LLWLParamSet dummy; + return getParamSet(key, dummy); +} + +bool LLWLParamManager::setParamSet(const LLWLParamKey& key, LLWLParamSet& param) +{ + llassert(!key.name.empty()); + // *TODO: validate params + mParamList[key] = param; return true; } -bool LLWLParamManager::setParamSet(const std::string& name, const LLSD & param) +bool LLWLParamManager::setParamSet(const LLWLParamKey& key, const LLSD & param) { + llassert(!key.name.empty()); + // *TODO: validate params + // quick, non robust (we won't be working with files, but assets) check + // this might not actually be true anymore.... if(!param.isMap()) { return false; } - mParamList[name].setAll(param); - - return true; + LLWLParamSet param_set; + param_set.setAll(param); + return setParamSet(key, param_set); } -bool LLWLParamManager::removeParamSet(const std::string& name, bool delete_from_disk) +void LLWLParamManager::removeParamSet(const LLWLParamKey& key, bool delete_from_disk) { + // *NOTE: Removing a sky preset invalidates day cycles that refer to it. + + if (key.scope == LLEnvKey::SCOPE_REGION) + { + llwarns << "Removing region skies not supported" << llendl; + llassert(key.scope == LLEnvKey::SCOPE_LOCAL); + return; + } + // remove from param list - std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name); - if(mIt != mParamList.end()) + std::map<LLWLParamKey, LLWLParamSet>::iterator it = mParamList.find(key); + if (it == mParamList.end()) { - mParamList.erase(mIt); + LL_WARNS("WindLight") << "No sky preset named " << key.name << LL_ENDL; + return; } - F32 key; + mParamList.erase(it); + mDay.removeReferencesTo(key); - // remove all references - bool stat = true; - do + // remove from file system if requested + if (delete_from_disk) { - // get it - stat = mDay.getKey(name, key); - if(stat == false) + std::string path_name(getUserDir()); + std::string escaped_name = escapeString(key.name); + + if(gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml") < 1) { - break; + LL_WARNS("WindLight") << "Error removing sky preset " << key.name << " from disk" << LL_ENDL; } + } - // and remove - stat = mDay.removeKey(key); + // signal interested parties + mPresetListChangeSignal(); +} - } while(stat == true); - - if(delete_from_disk) +bool LLWLParamManager::isSystemPreset(const std::string& preset_name) const +{ + // *TODO: file system access is excessive here. + return gDirUtilp->fileExists(getSysDir() + escapeString(preset_name) + ".xml"); +} + +void LLWLParamManager::getPresetNames(preset_name_list_t& region, preset_name_list_t& user, preset_name_list_t& sys) const +{ + region.clear(); + user.clear(); + sys.clear(); + + for (std::map<LLWLParamKey, LLWLParamSet>::const_iterator it = mParamList.begin(); it != mParamList.end(); it++) { - std::string path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); - - // use full curl escaped name - char * curl_str = curl_escape(name.c_str(), name.size()); - std::string escaped_name(curl_str); - curl_free(curl_str); - curl_str = NULL; - - gDirUtilp->deleteFilesInDir(path_name, escaped_name + ".xml"); - } + const LLWLParamKey& key = it->first; + const std::string& name = key.name; - return true; + if (key.scope == LLEnvKey::SCOPE_REGION) + { + region.push_back(name); + } + else + { + if (isSystemPreset(name)) + { + sys.push_back(name); + } + else + { + user.push_back(name); + } + } + } } +void LLWLParamManager::getUserPresetNames(preset_name_list_t& user) const +{ + preset_name_list_t region, sys; // unused + getPresetNames(region, user, sys); +} -// static -LLWLParamManager * LLWLParamManager::instance() +void LLWLParamManager::getPresetKeys(preset_key_list_t& keys) const { - if(NULL == sInstance) + keys.clear(); + + for (std::map<LLWLParamKey, LLWLParamSet>::const_iterator it = mParamList.begin(); it != mParamList.end(); it++) { - sInstance = new LLWLParamManager(); + keys.push_back(it->first); + } +} + +boost::signals2::connection LLWLParamManager::setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb) +{ + return mPresetListChangeSignal.connect(cb); +} - sInstance->loadPresets(LLStringUtil::null); +// virtual static +void LLWLParamManager::initSingleton() +{ + LL_DEBUGS("Windlight") << "Initializing sky" << LL_ENDL; + + loadAllPresets(); - // load the day - sInstance->mDay.loadDayCycle(std::string("Default.xml")); + // load the day + std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName(); + if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay)) + { + // Fall back to default. + llwarns << "No day cycle named " << preferred_day << ", falling back to defaults" << llendl; + mDay.loadDayCycleFromFile("Default.xml"); - // *HACK - sets cloud scrolling to what we want... fix this better in the future - sInstance->getParamSet("Default", sInstance->mCurParams); + // *TODO: Fix user preferences accordingly. + } - // set it to noon - sInstance->resetAnimator(0.5, true); + // *HACK - sets cloud scrolling to what we want... fix this better in the future + std::string sky = LLEnvManagerNew::instance().getSkyPresetName(); + if (!getParamSet(LLWLParamKey(sky, LLWLParamKey::SCOPE_LOCAL), mCurParams)) + { + llwarns << "No sky preset named " << sky << ", falling back to defaults" << llendl; + getParamSet(LLWLParamKey("Default", LLWLParamKey::SCOPE_LOCAL), mCurParams); - // but use linden time sets it to what the estate is - sInstance->mAnimator.mUseLindenTime = true; + // *TODO: Fix user preferences accordingly. } - return sInstance; + // set it to noon + resetAnimator(0.5, LLEnvManagerNew::instance().getUseDayCycle()); + + // but use linden time sets it to what the estate is + mAnimator.setTimeType(LLWLAnimator::TIME_LINDEN); + + LLEnvManagerNew::instance().usePrefs(); +} + +// static +std::string LLWLParamManager::getSysDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", ""); +} + +// static +std::string LLWLParamManager::getUserDir() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "windlight/skies", ""); +} + +// static +std::string LLWLParamManager::escapeString(const std::string& str) +{ + // Don't use LLURI::escape() because it doesn't encode '-' characters + // which may break handling of some system presets like "A-12AM". + char* curl_str = curl_escape(str.c_str(), str.size()); + std::string escaped_str(curl_str); + curl_free(curl_str); + + return escaped_str; } diff --git a/indra/newview/llwlparammanager.h b/indra/newview/llwlparammanager.h index 8c6329e769..bc984b9126 100644 --- a/indra/newview/llwlparammanager.h +++ b/indra/newview/llwlparammanager.h @@ -27,12 +27,14 @@ #ifndef LL_WLPARAMMANAGER_H #define LL_WLPARAMMANAGER_H -#include <vector> +#include <list> #include <map> +#include "llenvmanager.h" #include "llwlparamset.h" #include "llwlanimator.h" #include "llwldaycycle.h" #include "llviewercamera.h" +#include "lltrans.h" class LLGLSLShader; @@ -72,7 +74,7 @@ struct WLColorControl { r = val.mV[0]; g = val.mV[1]; b = val.mV[2]; - i = val.mV[3]; + i = val.mV[3]; return *this; } @@ -115,25 +117,112 @@ struct WLFloatControl { } }; -/// WindLight parameter manager class - what controls all the wind light shaders -class LLWLParamManager +struct LLWLParamKey : LLEnvKey { public: + // scope and source of a param set (WL sky preset) + std::string name; + EScope scope; - LLWLParamManager(); - ~LLWLParamManager(); + // for conversion from LLSD + static const int NAME_IDX = 0; + static const int SCOPE_IDX = 1; + + inline LLWLParamKey(const std::string& n, EScope s) + : name(n), scope(s) + { + } + + inline LLWLParamKey(LLSD llsd) + : name(llsd[NAME_IDX].asString()), scope(EScope(llsd[SCOPE_IDX].asInteger())) + { + } + + inline LLWLParamKey() // NOT really valid, just so std::maps can return a default of some sort + : name(""), scope(SCOPE_LOCAL) + { + } + + inline LLWLParamKey(std::string& stringVal) + { + size_t len = stringVal.length(); + if (len > 0) + { + name = stringVal.substr(0, len - 1); + scope = (EScope) atoi(stringVal.substr(len - 1, len).c_str()); + } + } + + inline std::string toStringVal() const + { + std::stringstream str; + str << name << scope; + return str.str(); + } + + inline LLSD toLLSD() const + { + LLSD llsd = LLSD::emptyArray(); + llsd.append(LLSD(name)); + llsd.append(LLSD(scope)); + return llsd; + } + + inline void fromLLSD(const LLSD& llsd) + { + name = llsd[NAME_IDX].asString(); + scope = EScope(llsd[SCOPE_IDX].asInteger()); + } + + inline bool operator <(const LLWLParamKey other) const + { + if (name < other.name) + { + return true; + } + else if (name > other.name) + { + return false; + } + else + { + return scope < other.scope; + } + } + + inline bool operator ==(const LLWLParamKey other) const + { + return (name == other.name) && (scope == other.scope); + } - /// load a preset file - void loadPresets(const std::string & fileName); + inline std::string toString() const + { + switch (scope) + { + case SCOPE_LOCAL: + return name + std::string(" (") + LLTrans::getString("Local") + std::string(")"); + break; + case SCOPE_REGION: + return name + std::string(" (") + LLTrans::getString("Region") + std::string(")"); + break; + default: + return name + " (?)"; + } + } +}; - /// save the preset file - void savePresets(const std::string & fileName); +/// WindLight parameter manager class - what controls all the wind light shaders +class LLWLParamManager : public LLSingleton<LLWLParamManager> +{ + LOG_CLASS(LLWLParamManager); - /// load an individual preset into the sky - void loadPreset(const std::string & name,bool propogate=true); +public: + typedef std::list<std::string> preset_name_list_t; + typedef std::list<LLWLParamKey> preset_key_list_t; + typedef boost::signals2::signal<void()> preset_list_signal_t; /// save the parameter presets to file - void savePreset(const std::string & name); + void savePreset(const LLWLParamKey key); /// Set shader uniforms dirty, so they'll update automatically. void propagateParameters(void); @@ -147,6 +236,12 @@ public: /// update information camera dependent parameters void update(LLViewerCamera * cam); + /// apply specified day cycle, setting time to noon by default + bool applyDayCycleParams(const LLSD& params, LLEnvKey::EScope scope, F32 time = 0.5); + + /// apply specified fixed sky params + bool applySkyParams(const LLSD& params); + // get where the light is pointing inline LLVector4 getLightDir(void) const; @@ -161,36 +256,62 @@ public: /// get the radius of the dome inline F32 getDomeRadius(void) const; - - /// Perform global initialization for this class. - static void initClass(void); - - // Cleanup of global data that's only inited once per class. - static void cleanupClass(); - /// add a param to the list - bool addParamSet(const std::string& name, LLWLParamSet& param); + /// add a param set (preset) to the list + bool addParamSet(const LLWLParamKey& key, LLWLParamSet& param); - /// add a param to the list - BOOL addParamSet(const std::string& name, LLSD const & param); + /// add a param set (preset) to the list + BOOL addParamSet(const LLWLParamKey& key, LLSD const & param); - /// get a param from the list - bool getParamSet(const std::string& name, LLWLParamSet& param); + /// get a param set (preset) from the list + bool getParamSet(const LLWLParamKey& key, LLWLParamSet& param); + + /// check whether the preset is in the list + bool hasParamSet(const LLWLParamKey& key); /// set the param in the list with a new param - bool setParamSet(const std::string& name, LLWLParamSet& param); + bool setParamSet(const LLWLParamKey& key, LLWLParamSet& param); /// set the param in the list with a new param - bool setParamSet(const std::string& name, LLSD const & param); + bool setParamSet(const LLWLParamKey& key, LLSD const & param); /// gets rid of a parameter and any references to it - /// returns true if successful - bool removeParamSet(const std::string& name, bool delete_from_disk); + /// ignores "delete_from_disk" if the scope is not local + void removeParamSet(const LLWLParamKey& key, bool delete_from_disk); - // singleton pattern implementation - static LLWLParamManager * instance(); + /// clear parameter mapping of a given scope + void clearParamSetsOfScope(LLEnvKey::EScope scope); -public: + /// @return true if the preset comes out of the box + bool isSystemPreset(const std::string& preset_name) const; + + /// @return user and system preset names as a single list + void getPresetNames(preset_name_list_t& region, preset_name_list_t& user, preset_name_list_t& sys) const; + + /// @return user preset names + void getUserPresetNames(preset_name_list_t& user) const; + + /// @return keys of all known presets + void getPresetKeys(preset_key_list_t& keys) const; + + /// Emitted when a preset gets added or deleted. + boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); + + /// add all skies in LLSD using the given scope + void addAllSkies(LLEnvKey::EScope scope, const LLSD& preset_map); + + /// refresh region-scope presets + void refreshRegionPresets(); + + // returns all skies referenced by the current day cycle (in mDay), with their final names + // side effect: applies changes to all internal structures! (trashes all unreferenced skies in scope, keys in day cycle rescoped to scope, etc.) + std::map<LLWLParamKey, LLWLParamSet> finalizeFromDayCycle(LLWLParamKey::EScope scope); + + // returns all skies in map (intended to be called with output from a finalize) + static LLSD createSkyMap(std::map<LLWLParamKey, LLWLParamSet> map); + + /// escape string in a way different from LLURI::escape() + static std::string escapeString(const std::string& str); // helper variables LLWLAnimator mAnimator; @@ -243,14 +364,27 @@ public: F32 mDomeOffset; F32 mDomeRadius; - // list of all the parameters, listed by name - std::map<std::string, LLWLParamSet> mParamList; - - + private: - // our parameter manager singleton instance - static LLWLParamManager * sInstance; + friend class LLWLAnimator; + + void loadAllPresets(); + void loadPresetsFromDir(const std::string& dir); + bool loadPreset(const std::string& path); + + static std::string getSysDir(); + static std::string getUserDir(); + + friend class LLSingleton<LLWLParamManager>; + /*virtual*/ void initSingleton(); + LLWLParamManager(); + ~LLWLParamManager(); + + // list of all the parameters, listed by name + std::map<LLWLParamKey, LLWLParamSet> mParamList; + + preset_list_signal_t mPresetListChangeSignal; }; inline F32 LLWLParamManager::getDomeOffset(void) const diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index cf06766d73..02d914a812 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -29,8 +29,8 @@ #include "llwlparamset.h" #include "llwlanimator.h" -#include "llfloaterwindlight.h" #include "llwlparammanager.h" +#include "llglslshader.h" #include "lluictrlfactory.h" #include "llsliderctrl.h" @@ -94,7 +94,7 @@ void LLWLParamSet::update(LLGLSLShader * shader) const shader->uniform4fv(param, 1, val.mV); } - else + else // param is the uniform name { LLVector4 val; @@ -119,7 +119,6 @@ void LLWLParamSet::update(LLGLSLShader * shader) const val.mV[0] = i->second.asBoolean(); } - shader->uniform4fv(param, 1, val.mV); } } @@ -260,7 +259,6 @@ void LLWLParamSet::setEastAngle(float val) void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) { // set up the iterators - LLSD::map_iterator cIt = mParamValues.beginMap(); // keep cloud positions and coverage the same /// TODO masking will do this later @@ -273,55 +271,39 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) LLSD srcVal; LLSD destVal; - // do the interpolation for all the ones saved as vectors - // skip the weird ones - for(; cIt != mParamValues.endMap(); cIt++) { + // Iterate through values + for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter) + { - // check params to make sure they're actually there - if(src.mParamValues.has(cIt->first)) + // If param exists in both src and dest, set the holder variables, otherwise skip + if(src.mParamValues.has(iter->first) && dest.mParamValues.has(iter->first)) { - srcVal = src.mParamValues[cIt->first]; + srcVal = src.mParamValues[iter->first]; + destVal = dest.mParamValues[iter->first]; } else { continue; } - if(dest.mParamValues.has(cIt->first)) + if(iter->second.isReal()) // If it's a real, interpolate directly { - destVal = dest.mParamValues[cIt->first]; + iter->second = srcVal.asReal() + ((destVal.asReal() - srcVal.asReal()) * weight); } - else - { - continue; - } - - // skip if not a vector - if(!cIt->second.isArray()) - { - continue; - } - - // only Real vectors allowed - if(!cIt->second[0].isReal()) + else if(iter->second.isArray() && iter->second[0].isReal() // If it's an array of reals, loop through the reals and interpolate on those + && iter->second.size() == srcVal.size() && iter->second.size() == destVal.size()) { - continue; + // Actually do interpolation: old value + (difference in values * factor) + for(int i=0; i < iter->second.size(); ++i) + { + // iter->second[i] = (1.f-weight)*(F32)srcVal[i].asReal() + weight*(F32)destVal[i].asReal(); // old way of doing it -- equivalent but one more operation + iter->second[i] = srcVal[i].asReal() + ((destVal[i].asReal() - srcVal[i].asReal()) * weight); + } } - - // make sure all the same size - if( cIt->second.size() != srcVal.size() || - cIt->second.size() != destVal.size()) + else // Else, skip { continue; - } - - // more error checking might be necessary; - - for(int i=0; i < cIt->second.size(); ++i) - { - cIt->second[i] = (1.0f - weight) * (F32) srcVal[i].asReal() + - weight * (F32) destVal[i].asReal(); - } + } } // now mix the extra parameters diff --git a/indra/newview/llwlparamset.h b/indra/newview/llwlparamset.h index 487e2bf922..3c44ed3bb8 100644 --- a/indra/newview/llwlparamset.h +++ b/indra/newview/llwlparamset.h @@ -32,10 +32,9 @@ #include "v4math.h" #include "v4color.h" -#include "llviewershadermgr.h" -class LLFloaterWindLight; class LLWLParamSet; +class LLGLSLShader; /// A class representing a set of parameter values for the WindLight shaders. class LLWLParamSet { diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index ec24b02934..4a6ec7fdbb 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -61,6 +61,7 @@ #include <map> #include <cstring> + // // Globals // @@ -91,8 +92,7 @@ LLWorld::LLWorld() : mLastPacketsIn(0), mLastPacketsOut(0), mLastPacketsLost(0), - mSpaceTimeUSec(0), - mClassicCloudsEnabled(TRUE) + mSpaceTimeUSec(0) { for (S32 i = 0; i < 8; i++) { @@ -183,10 +183,6 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) llerrs << "Unable to create new region!" << llendl; } - regionp->mCloudLayer.create(regionp); - regionp->mCloudLayer.setWidth((F32)mWidth); - regionp->mCloudLayer.setWindPointer(®ionp->mWind); - mRegionList.push_back(regionp); mActiveRegionList.push_back(regionp); mCulledRegionList.push_back(regionp); @@ -661,92 +657,6 @@ void LLWorld::updateParticles() LLViewerPartSim::getInstance()->updateSimulation(); } -void LLWorld::updateClouds(const F32 dt) -{ - static LLFastTimer::DeclareTimer ftm("World Clouds"); - LLFastTimer t(ftm); - - if ( gSavedSettings.getBOOL("FreezeTime") ) - { - // don't move clouds in snapshot mode - return; - } - - if ( - mClassicCloudsEnabled != - gSavedSettings.getBOOL("SkyUseClassicClouds") ) - { - // The classic cloud toggle has been flipped - // gotta update all of the cloud layers - mClassicCloudsEnabled = - gSavedSettings.getBOOL("SkyUseClassicClouds"); - - if ( !mClassicCloudsEnabled && mActiveRegionList.size() ) - { - // We've transitioned to having classic clouds disabled - // reset all cloud layers. - for ( - region_list_t::iterator iter = mActiveRegionList.begin(); - iter != mActiveRegionList.end(); - ++iter) - { - LLViewerRegion* regionp = *iter; - regionp->mCloudLayer.reset(); - } - - return; - } - } - else if ( !mClassicCloudsEnabled ) return; - - if (mActiveRegionList.size()) - { - for (region_list_t::iterator iter = mActiveRegionList.begin(); - iter != mActiveRegionList.end(); ++iter) - { - LLViewerRegion* regionp = *iter; - regionp->mCloudLayer.updatePuffs(dt); - } - - // Reshuffle who owns which puffs - for (region_list_t::iterator iter = mActiveRegionList.begin(); - iter != mActiveRegionList.end(); ++iter) - { - LLViewerRegion* regionp = *iter; - regionp->mCloudLayer.updatePuffOwnership(); - } - - // Add new puffs - for (region_list_t::iterator iter = mActiveRegionList.begin(); - iter != mActiveRegionList.end(); ++iter) - { - LLViewerRegion* regionp = *iter; - regionp->mCloudLayer.updatePuffCount(); - } - } -} - -LLCloudGroup* LLWorld::findCloudGroup(const LLCloudPuff &puff) -{ - if (mActiveRegionList.size()) - { - // Update all the cloud puff positions, and timer based stuff - // such as death decay - for (region_list_t::iterator iter = mActiveRegionList.begin(); - iter != mActiveRegionList.end(); ++iter) - { - LLViewerRegion* regionp = *iter; - LLCloudGroup *groupp = regionp->mCloudLayer.findCloudGroup(puff); - if (groupp) - { - return groupp; - } - } - } - return NULL; -} - - void LLWorld::renderPropertyLines() { S32 region_count = 0; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e74bf2a620..2d61a049f7 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -4134,63 +4134,6 @@ void LLPipeline::renderDebug() } } - if (gSavedSettings.getBOOL("DebugShowUploadCost")) - { - std::set<LLUUID> textures; - std::set<LLUUID> sculpts; - std::set<LLUUID> meshes; - - BOOL selected = TRUE; - if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) - { - selected = FALSE; - } - - for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter) - { - LLSpatialGroup* group = *iter; - LLSpatialGroup::OctreeNode* node = group->mOctreeNode; - for (LLSpatialGroup::OctreeNode::element_iter elem = node->getData().begin(); elem != node->getData().end(); ++elem) - { - LLDrawable* drawable = *elem; - LLVOVolume* volume = drawable->getVOVolume(); - if (volume && volume->isSelected() == selected) - { - for (U32 i = 0; i < volume->getNumTEs(); ++i) - { - LLTextureEntry* te = volume->getTE(i); - textures.insert(te->getID()); - } - - if (volume->isSculpted()) - { - LLUUID sculpt_id = volume->getVolume()->getParams().getSculptID(); - if (volume->isMesh()) - { - meshes.insert(sculpt_id); - } - else - { - sculpts.insert(sculpt_id); - } - } - } - } - } - - gPipeline.mDebugTextureUploadCost = textures.size() * 10; - gPipeline.mDebugSculptUploadCost = sculpts.size()*10; - - U32 mesh_cost = 0; - - for (std::set<LLUUID>::iterator iter = meshes.begin(); iter != meshes.end(); ++iter) - { - mesh_cost += gMeshRepo.getResourceCost(*iter)*10; - } - - gPipeline.mDebugMeshUploadCost = mesh_cost; - } - if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)) { LLVertexBuffer::unbind(); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 973df6998a..76965ad14b 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -133,6 +133,15 @@ name="AvatarListItemIconVoiceLeftColor" reference="AvatarListItemIconOfflineColor" /> <color + name="BadgeImageColor" + value="0.44 0.69 0.56 1.0" /> + <color + name="BadgeBorderColor" + value="0.9 0.9 0.9 1.0" /> + <color + name="BadgeLabelColor" + reference="White" /> + <color name="ButtonBorderColor" reference="Unused?" /> <color @@ -500,22 +509,22 @@ reference="DkGray2" /> <color name="MultiSliderDisabledThumbColor" - reference="Unused?" /> + reference="Black" /> <color name="MultiSliderThumbCenterColor" - reference="Unused?" /> + reference="White" /> <color name="MultiSliderThumbCenterSelectedColor" - reference="Unused?" /> + reference="Green" /> <color name="MultiSliderThumbOutlineColor" reference="Unused?" /> <color name="MultiSliderTrackColor" - reference="Unused?" /> + reference="LtGray" /> <color name="MultiSliderTriangleColor" - reference="Unused?" /> + reference="Yellow" /> <!-- <color name="NameTagBackground" @@ -760,7 +769,7 @@ <color name="MenuBarProjectBgColor" reference="MdBlue" /> - + <color name="MeshImportTableNormalColor" value="1 1 1 1"/> diff --git a/indra/newview/skins/default/textures/icons/Inv_Gift.png b/indra/newview/skins/default/textures/icons/Inv_Gift.png Binary files differnew file mode 100644 index 0000000000..5afe85d72d --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_Gift.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png b/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png Binary files differnew file mode 100644 index 0000000000..be58114aa1 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Off.png b/indra/newview/skins/default/textures/icons/OutboxPush_Off.png Binary files differnew file mode 100644 index 0000000000..e6b9480ab1 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Off.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On.png b/indra/newview/skins/default/textures/icons/OutboxPush_On.png Binary files differnew file mode 100644 index 0000000000..ffda2e92d4 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_On.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png Binary files differnew file mode 100644 index 0000000000..6b5911014f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png b/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png Binary files differnew file mode 100644 index 0000000000..0e60b417b0 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_Over.png Binary files differnew file mode 100644 index 0000000000..9c26b92e73 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Over.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Press.png b/indra/newview/skins/default/textures/icons/OutboxPush_Press.png Binary files differnew file mode 100644 index 0000000000..3b5d462975 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Press.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png Binary files differnew file mode 100644 index 0000000000..f85be047b0 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png Binary files differnew file mode 100644 index 0000000000..cd4e482216 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png Binary files differnew file mode 100644 index 0000000000..d212a871ce --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png Binary files differnew file mode 100644 index 0000000000..e5b6023e36 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png Binary files differnew file mode 100644 index 0000000000..e1911a092f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png Binary files differnew file mode 100644 index 0000000000..9e59f7843a --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png Binary files differnew file mode 100644 index 0000000000..51e8bff646 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png Binary files differnew file mode 100644 index 0000000000..300e2e69e1 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png Binary files differnew file mode 100644 index 0000000000..32fb236381 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png Binary files differnew file mode 100644 index 0000000000..827f343b1e --- /dev/null +++ b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png Binary files differnew file mode 100644 index 0000000000..956e02b14d --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Dark.png diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png Binary files differnew file mode 100644 index 0000000000..434caeda8b --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOff_Light.png diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png Binary files differnew file mode 100644 index 0000000000..064687ed0f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Dark.png diff --git a/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png Binary files differnew file mode 100644 index 0000000000..5465650d0c --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Parcel_SeeAVsOn_Light.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Disabled.png b/indra/newview/skins/default/textures/icons/Sync_Disabled.png Binary files differnew file mode 100644 index 0000000000..ca2e8def97 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Disabled.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Enabled.png b/indra/newview/skins/default/textures/icons/Sync_Enabled.png Binary files differnew file mode 100644 index 0000000000..bc236c8b98 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Enabled.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_1.png b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png Binary files differnew file mode 100644 index 0000000000..624e556376 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_2.png b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png Binary files differnew file mode 100644 index 0000000000..5769803b3f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_3.png b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png Binary files differnew file mode 100644 index 0000000000..92d4bfb020 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_4.png b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png Binary files differnew file mode 100644 index 0000000000..6d43eb3a9f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_5.png b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png Binary files differnew file mode 100644 index 0000000000..766d063c99 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_6.png b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png Binary files differnew file mode 100644 index 0000000000..dfe7f68b72 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index cc7cce99c9..799cd907dc 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,4 +1,4 @@ -<!-- +<!-- This file contains metadata about how to load, display, and scale textures for rendering in the UI. Images do *NOT* have to appear in this file in order to use them as textures in the UI...simply refer to them by filename (relative to textures directory). @@ -72,8 +72,11 @@ with the same filename but different name <texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> <texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> + <texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="Blank" file_name="Blank.png" preload="false" /> - + <texture name="BreadCrumbBtn_Left_Disabled" file_name="widgets/BreadCrumbBtn_Left_Disabled.png" preload="false"/> <texture name="BreadCrumbBtn_Left_Off" file_name="widgets/BreadCrumbBtn_Left_Off.png" preload="false"/> <texture name="BreadCrumbBtn_Left_Over" file_name="widgets/BreadCrumbBtn_Left_Over.png" preload="false"/> @@ -88,7 +91,6 @@ with the same filename but different name <texture name="BreadCrumbBtn_Right_Off" file_name="widgets/BreadCrumbBtn_Right_Off.png" preload="false"/> <texture name="BreadCrumbBtn_Right_Over" file_name="widgets/BreadCrumbBtn_Right_Over.png" preload="false"/> <texture name="BreadCrumbBtn_Right_Press" file_name="widgets/BreadCrumbBtn_Right_Press.png" preload="false"/> - <texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="0" scale.top="1" scale.right="0" scale.bottom="0" /> <texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> @@ -266,6 +268,8 @@ with the same filename but different name <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" /> + <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> + <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> <texture name="Microphone_On" file_name="icons/Microphone_On.png" preload="false" /> @@ -349,6 +353,23 @@ with the same filename but different name <texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="false" /> <texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="false" /> + <texture name="OutboxPush_Disabled" file_name="icons/OutboxPush_Disabled.png" preload="true" /> + <texture name="OutboxPush_Off" file_name="icons/OutboxPush_Off.png" preload="true" /> + <texture name="OutboxPush_On" file_name="icons/OutboxPush_On.png" preload="true" /> + <texture name="OutboxPush_On_Over" file_name="icons/OutboxPush_On_Over.png" preload="true" /> + <texture name="OutboxPush_Over" file_name="icons/OutboxPush_Over.png" preload="true" /> + <texture name="OutboxPush_Press" file_name="icons/OutboxPush_Press.png" preload="true" /> + <texture name="OutboxPush_Progress_1" file_name="icons/OutboxPush_Progress_1.png" preload="true" /> + <texture name="OutboxPush_Progress_2" file_name="icons/OutboxPush_Progress_2.png" preload="true" /> + <texture name="OutboxPush_Progress_3" file_name="icons/OutboxPush_Progress_3.png" preload="true" /> + <texture name="OutboxPush_Progress_4" file_name="icons/OutboxPush_Progress_4.png" preload="true" /> + <texture name="OutboxPush_Progress_5" file_name="icons/OutboxPush_Progress_5.png" preload="true" /> + <texture name="OutboxPush_Progress_6" file_name="icons/OutboxPush_Progress_6.png" preload="true" /> + <texture name="OutboxPush_Selected" file_name="icons/OutboxPush_Selected.png" preload="true" /> + <texture name="OutboxPush_Selected_Disabled" file_name="icons/OutboxPush_Selected_Disabled.png" preload="true" /> + <texture name="OutboxPush_Selected_Over" file_name="icons/OutboxPush_Selected_Over.png" preload="true" /> + <texture name="OutboxPush_Selected_Press" file_name="icons/OutboxPush_Selected_Press.png" preload="true" /> + <texture name="PanOrbit_Off" file_name="bottomtray/PanOrbit_Off.png" preload="false" /> <texture name="Parcel_Exp_Color" file_name="icons/Parcel_Exp_Color.png" preload="false" /> @@ -369,6 +390,10 @@ with the same filename but different name <texture name="Parcel_ScriptsNo_Dark" file_name="icons/Parcel_ScriptsNo_Dark.png" preload="false" /> <texture name="Parcel_Voice_Dark" file_name="icons/Parcel_Voice_Dark.png" preload="false" /> <texture name="Parcel_VoiceNo_Dark" file_name="icons/Parcel_VoiceNo_Dark.png" preload="false" /> + <texture name="Parcel_SeeAVsOff_Dark" file_name="icons/Parcel_SeeAVsOff_Dark.png" preload="false" /> + <texture name="Parcel_SeeAVsOn_Dark" file_name="icons/Parcel_SeeAVsOn_Dark.png" preload="false" /> + <texture name="Parcel_SeeAVsOff_Light" file_name="icons/Parcel_SeeAVsOff_Light.png" preload="false" /> + <texture name="Parcel_SeeAVsOn_Light" file_name="icons/Parcel_SeeAVsOn_Light.png" preload="false" /> <texture name="Parcel_BuildNo_Light" file_name="icons/Parcel_BuildNo_Light.png" preload="false" /> <texture name="Parcel_FlyNo_Light" file_name="icons/Parcel_FlyNo_Light.png" preload="false" /> @@ -496,6 +521,15 @@ with the same filename but different name <texture name="StopReload_Off" file_name="icons/StopReload_Off.png" preload="false" /> <texture name="StopReload_Over" file_name="icons/StopReload_Over.png" preload="false" /> + <texture name="Sync_Disabled" file_name="icons/Sync_Disabled.png" preload="true" /> + <texture name="Sync_Enabled" file_name="icons/Sync_Enabled.png" preload="true" /> + <texture name="Sync_Progress_1" file_name="icons/Sync_Progress_1.png" preload="true" /> + <texture name="Sync_Progress_2" file_name="icons/Sync_Progress_2.png" preload="true" /> + <texture name="Sync_Progress_3" file_name="icons/Sync_Progress_3.png" preload="true" /> + <texture name="Sync_Progress_4" file_name="icons/Sync_Progress_4.png" preload="true" /> + <texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" /> + <texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" /> + <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> <texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" /> <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" /> @@ -649,6 +683,7 @@ with the same filename but different name <texture name="inv_folder_mesh.tga"/> <texture name="inv_item_mesh.tga"/> + <texture name="lag_status_critical.tga" /> <texture name="lag_status_good.tga" /> <texture name="lag_status_warning.tga" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background.png b/indra/newview/skins/default/textures/widgets/Badge_Background.png Binary files differnew file mode 100644 index 0000000000..5089c30312 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/Badge_Background.png diff --git a/indra/newview/skins/default/textures/widgets/Badge_Border.png b/indra/newview/skins/default/textures/widgets/Badge_Border.png Binary files differnew file mode 100644 index 0000000000..4b086a63fb --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/Badge_Border.png diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png Binary files differnew file mode 100644 index 0000000000..e603c44384 --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png Binary files differnew file mode 100644 index 0000000000..fbc164123f --- /dev/null +++ b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png diff --git a/indra/newview/skins/default/xui/da/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/da/floater_day_cycle_options.xml deleted file mode 100644 index ffae3d788f..0000000000 --- a/indra/newview/skins/default/xui/da/floater_day_cycle_options.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="DAG CYKLUS OPSÆTNING"> - <tab_container name="Day Cycle Tabs"> - <panel label="Dag cyklus" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <multi_slider label="" name="WLTimeSlider"/> - <multi_slider label="" name="WLDayCycleKeys"/> - <text name="WL12am"> - 00:00 - </text> - <text name="WL3am"> - 03:00 - </text> - <text name="WL6am"> - 06:00 - </text> - <text name="WL9amHash"> - 09:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 00:00 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Tilføj key" label_selected="Tilføj key" name="WLAddKey"/> - <button label="Slet key" label_selected="Slet key" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Key-frame indstillinger: - </text> - <text name="WLCurKeyTimeText"> - Key tid: - </text> - <spinner label="Timer" name="WLCurKeyHour"/> - <spinner label="Min." name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Key fast indstilling: - </text> - <combo_box label="Faste" name="WLKeyPresets"/> - <text name="DayCycleText"> - Snap: - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Cycluslængde: - </text> - <spinner label="Timer" name="WLLengthOfDayHour"/> - <spinner label="Min." name="WLLengthOfDayMin"/> - <spinner label="Sek." name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Vis : - </text> - <button label="Afspil" label_selected="Afspil" name="WLAnimSky"/> - <button label="Stop!" label_selected="Stop" name="WLStopAnimSky"/> - <button label="Benyt estate tid" label_selected="Gå til estate tid" name="WLUseLindenTime"/> - <button label="Gem test-dag" label_selected="Gem test-dag" name="WLSaveDayCycle"/> - <button label="Hent test-dag" label_selected="Hent test-dag" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/da/floater_env_settings.xml b/indra/newview/skins/default/xui/da/floater_env_settings.xml deleted file mode 100644 index a6fbc05734..0000000000 --- a/indra/newview/skins/default/xui/da/floater_env_settings.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="REDIGERING AF OMGIVELSER"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Tid på -dagen - </text> - <text name="EnvTimeText2"> - 00:00 - </text> - <slider label="" name="EnvTimeSlider"/> - <text name="EnvCloudText"> - Skydække - </text> - <slider label="" name="EnvCloudSlider"/> - <text name="EnvWaterColorText"> - Farve på -vand - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Klik for at åbne farvevælger"/> - <text name="EnvWaterFogText"> - Tåge på -vand - </text> - <slider label="" name="EnvWaterFogSlider"/> - <button label="Benyt tid fra estate" name="EnvUseEstateTimeButton"/> - <button label="Avanceret himmel" name="EnvAdvancedSkyButton"/> - <button label="Avanceret vand" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/da/floater_water.xml b/indra/newview/skins/default/xui/da/floater_water.xml deleted file mode 100644 index aedd1b442c..0000000000 --- a/indra/newview/skins/default/xui/da/floater_water.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="AVANCERET OPSÆTNING AF VAND"> - <text name="KeyFramePresetsText"> - Vand opsætninger: - </text> - <button label="Ny" label_selected="Ny" name="WaterNewPreset"/> - <button label="Gem" label_selected="Gem" name="WaterSavePreset"/> - <button label="Slet" label_selected="Slet" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="INDSTILLINGER" name="Settings"> - <text name="BHText"> - Vandtåge farve - </text> - <button label="?" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Klik for at åbne farvevælger"/> - <text name="WaterFogDensText"> - Tåge tæthedskarakteristik - </text> - <button label="?" name="WaterFogDensityHelp"/> - <slider label="" name="WaterFogDensity"/> - <text name="WaterUnderWaterFogModText"> - Tilretning undervandståge - </text> - <button label="?" name="WaterUnderWaterFogModHelp"/> - <slider label="" name="WaterUnderWaterFogMod"/> - <text name="BDensText"> - Lille bølge reflektionsskala - </text> - <button label="?" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <slider label="" name="WaterNormalScaleX"/> - <slider label="" name="WaterNormalScaleY"/> - <slider label="" name="WaterNormalScaleZ"/> - <text name="HDText"> - Spredningsskala - </text> - <button label="?" name="WaterFresnelScaleHelp"/> - <slider label="" name="WaterFresnelScale"/> - <text name="FresnelOffsetText"> - Spredning offset - </text> - <button label="?" name="WaterFresnelOffsetHelp"/> - <slider label="" name="WaterFresnelOffset"/> - <text name="DensMultText"> - Lysbrydning fra oven - </text> - <button label="?" name="WaterScaleAboveHelp"/> - <slider label="" name="WaterScaleAbove"/> - <text name="WaterScaleBelowText"> - Lysbrydning fra neden - </text> - <button label="?" name="WaterScaleBelowHelp"/> - <slider label="" name="WaterScaleBelow"/> - <text name="MaxAltText"> - Udviskning - </text> - <button label="?" name="WaterBlurMultiplierHelp"/> - <slider label="" name="WaterBlurMult"/> - </panel> - <panel label="BILLEDE" name="Waves"> - <text name="BHText"> - Retning for store bølger - </text> - <button label="?" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <slider label="" name="WaterWave1DirX"/> - <slider label="" name="WaterWave1DirY"/> - <text name="BHText2"> - Retning for små bølger - </text> - <button label="?" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <slider label="" name="WaterWave2DirX"/> - <slider label="" name="WaterWave2DirY"/> - <text name="BHText3"> - Tekstur map - </text> - <button label="?" name="WaterNormalMapHelp"/> - <texture_picker label="" name="WaterNormalMap"/> - </panel> - </tab_container> - <string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </string> -</floater> diff --git a/indra/newview/skins/default/xui/da/floater_windlight_options.xml b/indra/newview/skins/default/xui/da/floater_windlight_options.xml deleted file mode 100644 index 56f94b24e9..0000000000 --- a/indra/newview/skins/default/xui/da/floater_windlight_options.xml +++ /dev/null @@ -1,228 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater name="WindLight floater" title="AVANCERET OPSÆTNING FOR HIMMEL"> - <text name="KeyFramePresetsText"> - Faste indstillinger: - </text> - <button label="Ny" label_selected="Ny" name="WLNewPreset" /> - <button label="Gem" label_selected="Gem" name="WLSavePreset" /> - <button label="Slet" label_selected="Slet" name="WLDeletePreset" /> - <button label="Dags cyklus" label_selected="Dags cyklus" name="WLDayCycleMenuButton" /> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSFÆRE" name="Atmosphere"> - <text name="BHText"> - Blå - horisont - </text> - <button label="?" name="WLBlueHorizonHelp" /> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <slider label="" name="WLBlueHorizonR" /> - <slider label="" name="WLBlueHorizonG" /> - <slider label="" name="WLBlueHorizonB" /> - <slider label="" name="WLBlueHorizonI" /> - <text name="BDensText"> - Dis - horisont - </text> - <button label="?" name="WLHazeHorizonHelp" /> - <slider label="" name="WLHazeHorizon" /> - <text name="BDensText2"> - Blå - tæthed - </text> - <button label="?" name="WLBlueDensityHelp" /> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <slider label="" name="WLBlueDensityR" /> - <slider label="" name="WLBlueDensityG" /> - <slider label="" name="WLBlueDensityB" /> - <slider label="" name="WLBlueDensityI" /> - <text name="HDText"> - Dis - intensitet - </text> - <button label="?" name="WLHazeDensityHelp" /> - <slider label="" name="WLHazeDensity" /> - <text name="DensMultText"> - Densitet faktor - </text> - <button label="?" name="WLDensityMultHelp" /> - <slider label="" name="WLDensityMult" /> - <text name="WLDistanceMultText"> - Distance faktor - </text> - <button label="?" name="WLDistanceMultHelp" /> - <slider label="" name="WLDistanceMult" /> - <text name="MaxAltText"> - Maximum højde - </text> - <button label="?" name="WLMaxAltitudeHelp" /> - <slider label="" name="WLMaxAltitude" /> - </panel> - <panel label="LYS" name="Lighting"> - <text name="SLCText"> - Sol/Måne farve - </text> - <button label="?" name="WLSunlightColorHelp" /> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <slider label="" name="WLSunlightR" /> - <slider label="" name="WLSunlightG" /> - <slider label="" name="WLSunlightB" /> - <slider label="" name="WLSunlightI" /> - <text name="TODText"> - Sol/Måne position - </text> - <button label="?" name="WLTimeOfDayHelp" /> - <slider label="" name="WLSunAngle" /> - <text name="WLAmbientText"> - Omgivende - </text> - <button label="?" name="WLAmbientHelp" /> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <slider label="" name="WLAmbientR" /> - <slider label="" name="WLAmbientG" /> - <slider label="" name="WLAmbientB" /> - <slider label="" name="WLAmbientI" /> - <text name="WLEastAngleText"> - Øst vinkel - </text> - <button label="?" name="WLEastAngleHelp" /> - <slider label="" name="WLEastAngle" /> - <text name="SunGlowText"> - Sol glød - </text> - <button label="?" name="WLSunGlowHelp" /> - <slider label="Fokus " name="WLGlowB" /> - <slider label="Størr. " name="WLGlowR" /> - <text name="SceneGammaText"> - Lysintensitet (gamma) - </text> - <button label="?" name="WLSceneGammaHelp" /> - <slider label="" name="WLGamma" /> - <text name="WLStarText"> - Stjerne intensitet - </text> - <button label="?" name="WLStarBrightnessHelp" /> - <slider label="" name="WLStarAlpha" /> - </panel> - <panel label="SKYER" name="Clouds"> - <text name="WLCloudColorText"> - Farve på skyer - </text> - <button label="?" name="WLCloudColorHelp" /> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <slider label="" name="WLCloudColorR" /> - <slider label="" name="WLCloudColorG" /> - <slider label="" name="WLCloudColorB" /> - <slider label="" name="WLCloudColorI" /> - <text name="WLCloudColorText2"> - Skyer XY/Tæthed - </text> - <button label="?" name="WLCloudDensityHelp" /> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - T - </text> - <slider label="" name="WLCloudX" /> - <slider label="" name="WLCloudY" /> - <slider label="" name="WLCloudDensity" /> - <text name="WLCloudCoverageText"> - Skydække - </text> - <button label="?" name="WLCloudCoverageHelp" /> - <slider label="" name="WLCloudCoverage" /> - <text name="WLCloudScaleText"> - Skystørrelse - </text> - <button label="?" name="WLCloudScaleHelp" /> - <slider label="" name="WLCloudScale" /> - <text name="WLCloudDetailText"> - Sky detaljer(XY/tæthed) - </text> - <button label="?" name="WLCloudDetailHelp" /> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - T - </text> - <slider label="" name="WLCloudDetailX" /> - <slider label="" name="WLCloudDetailY" /> - <slider label="" name="WLCloudDetailDensity" /> - <text name="WLCloudScrollXText"> - Sky drift X - </text> - <button label="?" name="WLCloudScrollXHelp" /> - <check_box label="Lås" name="WLCloudLockX" /> - <slider label="" name="WLCloudScrollX" /> - <text name="WLCloudScrollYText"> - Sky drift Y - </text> - <button label="?" name="WLCloudScrollYHelp" /> - <check_box label="Lås" name="WLCloudLockY" /> - <slider label="" name="WLCloudScrollY" /> - <check_box label="Benyt simple skyer" name="DrawClassicClouds" /> - <button label="?" name="WLClassicCloudsHelp" /> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/da/panel_edit_pick.xml b/indra/newview/skins/default/xui/da/panel_edit_pick.xml index fd287b1a0a..3036f30240 100644 --- a/indra/newview/skins/default/xui/da/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/da/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Gem valgte" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Annullér" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/de/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/de/floater_day_cycle_options.xml deleted file mode 100644 index 8599737106..0000000000 --- a/indra/newview/skins/default/xui/de/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="TAGESZYKLUS-EDITOR"> - <tab_container name="Day Cycle Tabs"> - <panel label="Tageszyklus" name="Day Cycle"> - <button label=" ?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 24:00 - </text> - <text name="WL3am"> - 03:00 - </text> - <text name="WL6am"> - 06:00 - </text> - <text name="WL9amHash"> - 09:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 24:00 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Key hinzu" label_selected="Key hinzu" name="WLAddKey"/> - <button label="Key löschen" label_selected="Key löschen" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Keyframe-Einstellungen: - </text> - <text name="WLCurKeyTimeText"> - Key-Zeit: - </text> - <spinner label="Std." name="WLCurKeyHour"/> - <spinner label="Min." name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Key-Voreinstellung: - </text> - <combo_box label="Voreinstellung" name="WLKeyPresets"/> - <text name="DayCycleText"> - Einrasten: - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Zykluslänge: - </text> - <spinner label="Std." name="WLLengthOfDayHour"/> - <spinner label="Min." name="WLLengthOfDayMin"/> - <spinner label="Sek." name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Vorschau: - </text> - <button label="Start" label_selected="Start" name="WLAnimSky"/> - <button label="Stopp" label_selected="Stopp" name="WLStopAnimSky"/> - <button label="Grundbesitzzeit verw" label_selected="Zur Grundbesitzzeit" name="WLUseLindenTime"/> - <button label="Testtag speichern" label_selected="Testtag speichern" name="WLSaveDayCycle"/> - <button label="Testtag laden" label_selected="Testtag laden" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/de/floater_env_settings.xml b/indra/newview/skins/default/xui/de/floater_env_settings.xml deleted file mode 100644 index 0c78909108..0000000000 --- a/indra/newview/skins/default/xui/de/floater_env_settings.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="UMWELT-EDITOR"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Tageszeit - </text> - <text name="EnvTimeText2"> - 12:00 - </text> - <text name="EnvCloudText"> - Wolkendecke - </text> - <text name="EnvWaterColorText"> - Wasserfarbe - </text> - <color_swatch name="EnvWaterColor" tool_tip="Klicken Sie hier, um die Farbauswahl zu öffnen"/> - <text name="EnvWaterFogText"> - Wasser- -trübung - </text> - <button label="Grundbesitzzeit verw." name="EnvUseEstateTimeButton"/> - <button label="Himmel (erweitert)" name="EnvAdvancedSkyButton"/> - <button label="Wasser (erweitert)" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/de/floater_water.xml b/indra/newview/skins/default/xui/de/floater_water.xml deleted file mode 100644 index bb0dd9c75d..0000000000 --- a/indra/newview/skins/default/xui/de/floater_water.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="ERWEITERTER WASSER-EDITOR"> - <floater.string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </floater.string> - <text name="KeyFramePresetsText" width="110"> - Voreinstellungen: - </text> - <combo_box left_delta="110" name="WaterPresetsCombo"/> - <button label="Neu" label_selected="Neu" name="WaterNewPreset"/> - <button label="Speichern" label_selected="Speichern" name="WaterSavePreset"/> - <button label="Löschen" label_selected="Löschen" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="EINSTELLUNGEN" name="Settings"> - <text name="BHText"> - Wassertrübungsfarbe - </text> - <color_swatch name="WaterFogColor" tool_tip="Klicken Sie hier, um die Farbauswahl zu öffnen"/> - <text name="WaterFogDensText"> - Wassertrübungsdichte - </text> - <text name="WaterUnderWaterFogModText"> - Wassertrübungs-Modifikator - </text> - <slider bottom_delta="-34" name="WaterUnderWaterFogMod"/> - <text name="BDensText"> - Reflexionswellengröße - </text> - <slider label="1" name="WaterNormalScaleX"/> - <slider label="2" name="WaterNormalScaleY"/> - <slider label="3" name="WaterNormalScaleZ"/> - <text name="HDText"> - Fresnel-Skalierung - </text> - <text name="FresnelOffsetText"> - Fresnel-Versatz - </text> - <text name="DensMultText"> - Brechungsstärke oben - </text> - <text name="WaterScaleBelowText"> - Brechungsstärke unten - </text> - <text name="MaxAltText"> - Mischungsmultiplikator - </text> - </panel> - <panel label="BILD" name="Waves"> - <text name="BHText"> - Richtung große Welle - </text> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Richtung kleine Welle - </text> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Normal-Map - </text> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/de/floater_windlight_options.xml b/indra/newview/skins/default/xui/de/floater_windlight_options.xml deleted file mode 100644 index 5b59336f9d..0000000000 --- a/indra/newview/skins/default/xui/de/floater_windlight_options.xml +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="ERWEITERTER HIMMEL-EDITOR"> - <text name="KeyFramePresetsText"> - Voreinstellungen: - </text> - <button label="Neu" label_selected="Neu" name="WLNewPreset"/> - <button label="Speichern" label_selected="Speichern" name="WLSavePreset"/> - <button label="Löschen" label_selected="Löschen" name="WLDeletePreset"/> - <button label="Tageszyklus-Editor" label_selected="Tageszyklus-Editor" name="WLDayCycleMenuButton"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSPHÄRE" name="Atmosphere"> - <text name="BHText"> - Horizontfarbe - </text> - <button label=" ?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Horizonttrübung - </text> - <button label=" ?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Farbintensität - </text> - <button label=" ?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Trübungsintensität - </text> - <button label=" ?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Dichtemultiplikator - </text> - <button label=" ?" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Entfernungsmultiplikator - </text> - <button label=" ?" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Max. Höhe - </text> - <button label=" ?" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="LICHT" name="Lighting"> - <text name="SLCText"> - Sonne/Mond-Farbe - </text> - <button label=" ?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Sonne/Mond-Stand - </text> - <button label=" ?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Umgebung - </text> - <button label=" ?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Ostausrichtung - </text> - <button label=" ?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Sonnenleuchtkraft - </text> - <button label=" ?" name="WLSunGlowHelp"/> - <slider label="Fokus " name="WLGlowB"/> - <slider label="Größe " name="WLGlowR"/> - <text name="SceneGammaText"> - Gamma in Szene - </text> - <button label=" ?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Sternenleuchtkraft - </text> - <button label=" ?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="WOLKEN" name="Clouds"> - <text name="WLCloudColorText"> - Wolkenfarbe - </text> - <button label=" ?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Wolken-XY/Dichte - </text> - <button label=" ?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Wolkendichte - </text> - <button label=" ?" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Wolkenskalierung - </text> - <button label=" ?" name="WLCloudScaleHelp"/> - <text name="WLCloudDetailText"> - Wolkendetails (XY/Dichte) - </text> - <button label=" ?" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Wolkenbewegung X - </text> - <button label=" ?" name="WLCloudScrollXHelp"/> - <check_box label="Fest" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Wolkenbewegung Y - </text> - <button label=" ?" name="WLCloudScrollYHelp"/> - <check_box label="Fest" name="WLCloudLockY"/> - <check_box label="Klassische Wolken" name="DrawClassicClouds"/> - <button label=" ?" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/de/panel_edit_pick.xml b/indra/newview/skins/default/xui/de/panel_edit_pick.xml index 3c56df763d..aafffc7ae3 100644 --- a/indra/newview/skins/default/xui/de/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/de/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Auswahl speichern" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Abbrechen" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index ecd2b119c9..07cb4c12f5 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1205,6 +1205,10 @@ Only large parcels can be listed in search. name="push_restrict_region_text"> No Pushing (Region Override) </panel.string> + <panel.string + name="see_avs_text"> + See and chat with residents on this parcel + </panel.string> <text type="string" length="1" @@ -1314,7 +1318,7 @@ Only large parcels can be listed in search. name="check group scripts" top_delta="0" width="70" /> - <text + <text type="string" text_color="white" length="1" @@ -1515,10 +1519,32 @@ Only large parcels can be listed in search. type="string" length="1" follows="left|top" + text_color="white" + height="16" + layout="topleft" + left="230" + top="174" + name="allow_label5" + width="278"> + Allow Residents on other parcels to: + </text> + <check_box height="16" + label="See Avatars" + follows="top" layout="topleft" - left="220" - top="180" + left="230" + name="SeeAvatarsCheck" + tool_tip="Allows residents on other parcels to see and chat with residents on this parcel, and you to see and chat with them." + width="120" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="230" + top="230" text_color="white" name="landing_point" word_wrap="true" @@ -1532,7 +1558,7 @@ Only large parcels can be listed in search. label_selected="Set" layout="topleft" name="Set" - right="-68" + left="230" tool_tip="Sets the landing point where visitors arrive. Sets to your avatar's location inside this parcel." width="50" /> <button @@ -1544,7 +1570,6 @@ Only large parcels can be listed in search. left_pad="5" name="Clear" tool_tip="Clear the landing point" - right="-10" width="55" /> <text type="string" @@ -1553,7 +1578,7 @@ Only large parcels can be listed in search. follows="left|top" height="16" layout="topleft" - left="220" + left="230" top_pad="10" name="Teleport Routing: " width="200"> @@ -1846,6 +1871,34 @@ Only large parcels can be listed in search. name="check sound local" left_pad="0" width="292" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="Avatar Sounds:" + top_pad="10" + width="100"> + Avatar Sounds: + </text> + <check_box + height="16" + label="Everyone" + layout="topleft" + left_pad="0" + name="all av sound check" + top_delta="0" + width="130" /> + <check_box + height="16" + label="Group" + layout="topleft" + left_pad="0" + name="group av sound check" + top_delta="0" + width="70" /> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml deleted file mode 100644 index 65e2462ef8..0000000000 --- a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml +++ /dev/null @@ -1,558 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - height="275" - layout="topleft" - name="Day Cycle Floater" - help_topic="day_cycle_floater" - save_rect="true" - title="DAY CYCLE EDITOR" - width="658"> - <tab_container - follows="left|top" - height="255" - layout="topleft" - left="0" - name="Day Cycle Tabs" - tab_position="top" - top="20" - width="656"> - <panel - border="true" - follows="left|top|right|bottom" - height="255" - label="Day Cycle" - layout="topleft" - left="1" - mouse_opaque="false" - name="Day Cycle" - top="0" - width="654"> - <multi_slider - can_edit_text="true" - control_name="WLTimeSlider" - decimal_digits="0" - draw_track="false" - follows="bottom" - height="10" - increment="0.0833333" - initial_value="0" - layout="topleft" - left="20" - max_sliders="20" - max_val="24" - name="WLTimeSlider" - show_text="false" - top="25" - use_triangle="true" - width="525" /> - <multi_slider - can_edit_text="true" - control_name="WLDayCycleKeys" - decimal_digits="0" - follows="bottom" - height="10" - increment="0.0833333" - initial_value="0" - layout="topleft" - left_delta="0" - max_sliders="20" - max_val="24" - name="WLDayCycleKeys" - show_text="false" - top_pad="15" - width="525" /> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left="8" - name="WL12am" - top="74" - width="55"> - 12am - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL3am" - top_delta="0" - width="55"> - 3am - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL6am" - top_delta="0" - width="55"> - 6am - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL9amHash" - top_delta="0" - width="55"> - 9am - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL12pmHash" - top_delta="0" - width="55"> - 12pm - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL3pm" - top_delta="0" - width="55"> - 3pm - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL6pm" - top_delta="0" - width="55"> - 6pm - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL9pm" - top_delta="0" - width="55"> - 9pm - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - height="16" - layout="topleft" - left_pad="10" - name="WL12am2" - top_delta="0" - width="55"> - 12am - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="14" - layout="topleft" - left="20" - name="WL12amHash" - top="54" - width="6"> - | - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="11" - layout="topleft" - left_pad="59" - name="WL3amHash" - top_delta="3" - width="6"> - I - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="14" - layout="topleft" - left_pad="59" - name="WL6amHash" - top_delta="-3" - width="6"> - | - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="11" - layout="topleft" - left_pad="59" - name="WL9amHash2" - top_delta="3" - width="6"> - I - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="14" - layout="topleft" - left_pad="59" - name="WL12pmHash2" - top_delta="-3" - width="6"> - | - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="11" - layout="topleft" - left_pad="59" - name="WL3pmHash" - top_delta="3" - width="6"> - I - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="14" - layout="topleft" - left_pad="59" - name="WL6pmHash" - top_delta="-3" - width="6"> - | - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="11" - layout="topleft" - left_pad="59" - name="WL9pmHash" - top_delta="3" - width="6"> - I - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="14" - layout="topleft" - left_pad="59" - name="WL12amHash2" - top_delta="-3" - width="6"> - | - </text> - <button - height="20" - label="Add Key" - label_selected="Add Key" - layout="topleft" - left="555" - name="WLAddKey" - top="30" - width="96" /> - <button - height="20" - label="Delete Key" - label_selected="Delete Key" - layout="topleft" - left_delta="0" - name="WLDeleteKey" - top_pad="5" - width="96" /> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="20" - name="WLCurKeyFrameText" - top="104" - width="235"> - Key Frame Settings: - </text> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="30" - name="WLCurKeyTimeText" - top="124" - width="105"> - Key Time: - </text> - <spinner - control_name="WLCurKeyHour" - decimal_digits="0" - follows="left|top" - height="16" - increment="1" - initial_value="0" - label="Hour" - label_width="35" - layout="topleft" - left_delta="20" - max_val="100" - name="WLCurKeyHour" - top_pad="4" - width="74" /> - <spinner - control_name="WLCurKeyMin" - decimal_digits="0" - follows="left|top" - height="16" - increment="5" - initial_value="0" - label="Min" - label_width="45" - layout="topleft" - left_pad="5" - max_val="55" - name="WLCurKeyMin" - top_delta="0" - width="85" /> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="30" - name="WLCurKeyTimeText2" - top="169" - width="185"> - Key Preset: - </text> - <combo_box - height="18" - label="Preset" - layout="topleft" - left_delta="0" - name="WLKeyPresets" - top_pad="7" - width="205" /> - <view_border - bevel_style="none" - follows="top|left" - height="115" - layout="topleft" - left="12" - top="101" - width="240" /> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_pad="15" - name="DayCycleText" - top="114" - width="120"> - Snap: - </text> - <combo_box - enabled="false" - height="18" - label="5 min" - layout="topleft" - left_delta="0" - name="WLSnapOptions" - top_pad="7" - width="70" /> - <text - type="string" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="0" - name="DayCycleText2" - top_pad="17" - width="120"> - Length of Cycle: - </text> - <spinner - control_name="WLLengthOfDayHour" - decimal_digits="0" - follows="left|top" - height="16" - increment="1" - initial_value="0" - label="Hour" - label_width="33" - layout="topleft" - left_delta="-3" - max_val="100" - name="WLLengthOfDayHour" - top_pad="4" - width="74" /> - <spinner - control_name="WLLengthOfDayMin" - decimal_digits="0" - follows="left|top" - height="16" - increment="1" - initial_value="0" - label="Min" - label_width="25" - layout="topleft" - left_pad="2" - max_val="59" - name="WLLengthOfDayMin" - top_delta="0" - width="65" /> - <spinner - control_name="WLLengthOfDaySec" - decimal_digits="0" - follows="left|top" - height="16" - increment="1" - initial_value="24" - label="Sec" - label_width="25" - layout="topleft" - left_pad="2" - max_val="59" - name="WLLengthOfDaySec" - top_delta="0" - width="65"/> - <text - type="string" - halign="right" - length="1" - border_visible="true" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-23" - name="DayCycleText3" - top="114" - width="85"> - Preview : - </text> - <button - height="20" - label="Play" - label_selected="Play" - layout="topleft" - left="480" - name="WLAnimSky" - top_pad="5" - width="83" /> - <button - height="20" - label="Stop!" - label_selected="Stop" - layout="topleft" - left_pad="4" - name="WLStopAnimSky" - top_delta="0" - width="83" /> - <button - height="20" - label="Use Estate Time" - label_selected="Go to Estate Time" - layout="topleft" - left="480" - name="WLUseLindenTime" - top_pad="9" - width="170" /> - <button - height="20" - label="Save Test Day" - label_selected="Save Test Day" - layout="topleft" - left_delta="0" - name="WLSaveDayCycle" - top_pad="9" - width="170" /> - <button - height="20" - label="Load Test Day" - label_selected="Load Test Day" - layout="topleft" - left_delta="0" - name="WLLoadDayCycle" - top_pad="3" - width="170" /> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_delete_env_preset.xml b/indra/newview/skins/default/xui/en/floater_delete_env_preset.xml new file mode 100644 index 0000000000..b5de4166f6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_delete_env_preset.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<floater + legacy_header_height="18" + height="130" + help_topic="" + layout="topleft" + name="Delete Env Preset" + save_rect="true" + title="DELETE ENV PRESET" + width="550"> + + <string name="title_water">Delete Water Preset</string> + <string name="title_sky">Delete Sky Preset</string> + <string name="title_day_cycle">Delete Day Cycle</string> + + <string name="label_water">Preset:</string> + <string name="label_sky">Preset:</string> + <string name="label_day_cycle">Day cycle:</string> + + <string name="msg_confirm_deletion">Are you sure you want to delete the selected preset?</string> + <string name="msg_sky_is_referenced">Cannot remove a preset that is referenced by some day cycle(s).</string> + + <string name="combo_label">-Select a preset-</string> + + <text + follows="top|left|right" + font="SansSerif" + height="10" + layout="topleft" + left="50" + name="label" + top="60" + width="60"> + Preset: + </text> + <combo_box + follows="top|left" + layout="topleft" + left_pad="10" + name="preset_combo" + top_delta="-5" + width="200"/> + <button + follows="bottom|right" + height="23" + label="Delete" + layout="topleft" + left_pad="15" + name="delete" + width="70"/> + <button + follows="bottom|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="5" + name="cancel" + width="70"/> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml new file mode 100644 index 0000000000..d9a3ad0c4b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml @@ -0,0 +1,485 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="381" + layout="topleft" + name="Edit Day cycle" + help_topic="day_presets" + save_rect="true" + title="Edit Day Cycle" + width="705"> + + <string name="title_new">Create a New Day Cycle</string> + <string name="title_edit">Edit Day Cycle</string> + <string name="hint_new">Name your day cycle, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your day cycle, adjust the controls below and click "Save".</string> + <string name="combo_label">-Select a preset-</string> + + <text + follows="top|left|right" + height="10" + layout="topleft" + left="10" + name="hint" + top="25" + width="685" /> + <text + follows="top|left|right" + font="SansSerif" + height="10" + layout="topleft" + left="10" + name="label" + top_pad="25" + width="120"> + Preset Name: + </text> + <combo_box + allow_text_entry="true" + follows="top|left" + layout="topleft" + left_pad="10" + max_chars="100" + name="day_cycle_combo" + top_delta="-5" + width="200" /> + <line_editor + height="20" + left_delta="0" + name="day_cycle_name" + top_delta="0" + visible="true" + width="200" /> + <text + follows="top|left|right" + height="95" + layout="topleft" + left_pad="10" + name="note" + top_delta="0" + width="345" + wrap="true"> + Note: if you change the name of your preset, you will be creating a new preset and the existing preset will not be changed. + </text> + <!--======== Controls panel ========--> + <text + follows="left|top|right" + height="10" + layout="topleft" + left="10" + name="hint_item1" + top="100" + width="300"> + - Click on a tab to edit the specific sky settings and time. + </text> + <text + follows="left|top|right" + height="10" + layout="topleft" + name="hint_item2" + top_pad="10" + width="300"> + - Click and drag the tabs to set the transition times. + </text> + <text + follows="left|top|right" + height="10" + layout="topleft" + name="hint_item3" + top_pad="10" + width="300"> + - Use the scrubber to preview your day cycle. + </text> + <panel + follows="top|left" + height="100" + name="day_cycle_slider_panel" + layout="topleft" + left_delta="25" + top_pad="15" + width="660"> + <multi_slider + can_edit_text="true" + control_name="WLTimeSlider" + decimal_digits="0" + draw_track="false" + follows="bottom" + height="10" + increment="0.0833333" + initial_value="0" + layout="topleft" + left="20" + max_sliders="20" + max_val="24" + name="WLTimeSlider" + show_text="false" + top_pad="0" + use_triangle="true" + width="525" /> + <multi_slider + can_edit_text="true" + control_name="WLDayCycleKeys" + decimal_digits="0" + follows="bottom" + height="10" + increment="0.0833333" + initial_value="0" + layout="topleft" + left_delta="0" + max_sliders="20" + max_val="24" + name="WLDayCycleKeys" + show_text="false" + top_pad="15" + width="525" /> + <button + height="20" + label="Add Key" + label_selected="Add Key" + layout="topleft" + left_pad="20" + name="WLAddKey" + top_delta="-18" + width="96" /> + <button + height="20" + label="Delete Key" + label_selected="Delete Key" + layout="topleft" + name="WLDeleteKey" + top_pad="5" + width="96" /> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left="8" + name="WL12am" + top="74" + width="55"> + 12am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL3am" + top_delta="0" + width="55"> + 3am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL6am" + top_delta="0" + width="55"> + 6am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL9amHash" + top_delta="0" + width="55"> + 9am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL12pmHash" + top_delta="0" + width="55"> + 12pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL3pm" + top_delta="0" + width="55"> + 3pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL6pm" + top_delta="0" + width="55"> + 6pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL9pm" + top_delta="0" + width="55"> + 9pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="10" + name="WL12am2" + top_delta="0" + width="55"> + 12am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left="20" + name="WL12amHash" + top="54" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="59" + name="WL3amHash" + top_delta="3" + width="6"> + I + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="59" + name="WL6amHash" + top_delta="-3" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="59" + name="WL9amHash2" + top_delta="3" + width="6"> + I + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="59" + name="WL12pmHash2" + top_delta="-3" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="59" + name="WL3pmHash" + top_delta="3" + width="6"> + I + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="59" + name="WL6pmHash" + top_delta="-3" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="11" + layout="topleft" + left_pad="59" + name="WL9pmHash" + top_delta="3" + width="6"> + I + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="59" + name="WL12amHash2" + top_delta="-3" + width="6"> + | + </text> + </panel> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="192" + name="WLCurKeyPresetText" + top_pad="10" + width="80"> + Sky Setting: + </text> + <combo_box + height="18" + label="Preset" + layout="topleft" + left_pad="5" + name="WLSkyPresets" + width="205" /> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-40" + name="WLCurKeyTimeText" + top_pad="15" + width="35"> + Time: + </text> + <time + follows="left|top" + height="16" + label_width="0" + layout="topleft" + left_pad="3" + name="time" + top_delta="-1" + value="6:00 AM" + width="75"/> + <view_border + bevel_style="none" + follows="top|left" + height="0" + layout="topleft" + left="10" + name="horiz_separator" + top_pad="20" + width="685"/> + <loading_indicator + height="23" + layout="topleft" + left="25" + name="progress_indicator" + top="350" + visible="false" + width="23" /> + <check_box + follows="top|left" + height="10" + label="Make this my new day cycle" + layout="topleft" + left="310" + name="make_default_cb" + top_delta="13" + width="230"/> + <button + follows="bottom|right" + height="23" + label="Save" + layout="topleft" + left_pad="0" + name="save" + top_delta="-13" + width="70"/> + <button + follows="bottom|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="15" + name="cancel" + top_delta="0" + width="70"/> + </floater> diff --git a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml new file mode 100644 index 0000000000..56233d91ee --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml @@ -0,0 +1,953 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="375" + layout="topleft" + name="Edit Sky Preset" + help_topic="sky_preset" + save_rect="true" + title="Edit Sky Preset" + width="840"> + + <string name="title_new">Create a New Sky Preset</string> + <string name="title_edit">Edit Sky Preset</string> + <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your sky preset, adjust the controls and click "Save".</string> + <string name="combo_label">-Select a preset-</string> + + <text + follows="top|left|right" + height="10" + layout="topleft" + left="30" + name="hint" + top="25" + width="700"> + To edit your preset, adjust the controls then click "Save" + </text> + <text + follows="top|left|right" + font="SansSerif" + height="10" + layout="topleft" + left="30" + name="label" + top_pad="25" + width="120"> + Preset Name: + </text> + <combo_box + allow_text_entry="true" + follows="top|left" + layout="topleft" + left_pad="10" + max_chars="100" + name="sky_preset_combo" + top_delta="-5" + width="200"/> + <line_editor + height="20" + left_delta="0" + name="sky_preset_name" + top_delta="0" + width="200" /> + <text + follows="top|left|right" + height="40" + layout="topleft" + left_pad="10" + name="note" + top_delta="0" + width="405" + wrap="true"> + Note: if you change the name of your preset, you will be creating a new preset and the existing preset will not be changed. + </text> + <!--======== Controls panel ========--> + <view_border + bevel_style="none" + follows="top|left" + height="203" + layout="topleft" + left="25" + name="panel_water_preset" + top="122" + visible="true" + width="790"/> + <tab_container + follows="left|top" + height="225" + halign="center" + layout="topleft" + left="22" + name="WindLight Tabs" + tab_position="top" + top="101" + width="794"> + <panel + border="true" + bevel_style="none" + follows="left|top|right|bottom" + height="196" + label="ATMOSPHERE" + layout="topleft" + left="1" + help_topic="sky_preset_atmosphere" + mouse_opaque="false" + name="Atmosphere" + top="60" + width="698"> + + <!--======== Tab Panel I. I conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="40" + name="BHText" + top="25" + width="200"> + Blue Horizon + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="0" + name="WLBlueHorizon" + top_pad="6" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + top_pad="20" + name="BDensText" + width="200"> + Haze Horizon + </text> + <slider + control_name="WLHazeHorizon" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.25" + layout="topleft" + left_delta="0" + top_pad="6" + name="WLHazeHorizon" + width="200" /> + + <!--======== Tab Panel I. II conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="55" + name="BDensText2" + top="25" + width="200"> + Blue Density + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="0" + name="WLBlueDensity" + top_pad="6" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="HDText" + top_pad="20" + width="200"> + Haze Density + </text> + <slider + control_name="WLHazeDensity" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="0" + max_val="4" + name="WLHazeDensity" + top_pad="6" + width="200" /> + + <!--======== Tab Panel I. III conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="55" + name="DensMultText" + top="25" + width="200"> + Density Multiplier + </text> + <slider + control_name="WLDensityMult" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.1" + layout="topleft" + left_delta="15" + max_val="0.9" + name="WLDensityMult" + top_pad="6" + width="200" /> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="WLDistanceMultText" + top_pad="20" + width="200"> + Distance Multiplier + </text> + <slider + control_name="WLDistancMult" + decimal_digits="1" + follows="left|top" + height="10" + initial_value="1.0" + layout="topleft" + left_delta="15" + max_val="100" + name="WLDistanceMult" + top_pad="6" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="MaxAltText" + top_pad="20" + width="200"> + Max Altitude + </text> + <slider + control_name="WLMaxAltitude" + decimal_digits="0" + follows="left|top" + height="10" + increment="1" + initial_value="500" + layout="topleft" + left_delta="15" + max_val="4000" + name="WLMaxAltitude" + top_pad="6" + width="200" /> + </panel> + <panel + border="true" + bevel_style="none" + follows="left|top|right|bottom" + height="196" + label="LIGHTING" + layout="topleft" + left_delta="0" + help_topic="sky_preset_lighting" + name="Lighting" + top_delta="4" + width="698"> + + <!--======== Tab Panel II. I conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="20" + name="SLCText" + top="25" + width="150"> + Sun/Moon Color + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="10" + name="WLSunlight" + top_pad="6" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-10" + name="WLAmbientText" + top_pad="20" + width="150"> + Ambient + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="10" + name="WLAmbient" + top_pad="6" + width="60" /> + + <!--======== Tab Panel II. II conlumn of controls ========--> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="100" + name="SunGlowText" + top="25" + width="200"> + Sun Glow + </text> + <slider + control_name="WLGlowB" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.1" + label="Focus " + layout="topleft" + left_delta="10" + max_val="0.5" + name="WLGlowB" + top_pad="6" + width="200" /> + <slider + control_name="WLGlowR" + decimal_digits="2" + follows="top|left" + height="10" + increment="0.01" + initial_value="0.25" + label="Size " + layout="topleft" + left_delta="0" + max_val="1.99" + min_val="1" + name="WLGlowR" + top_pad="6" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-10" + name="WLStarText" + top_pad="20" + width="200"> + Star Brightness + </text> + <slider + control_name="WLStarAlpha" + decimal_digits="2" + follows="top|left" + height="10" + increment="0.01" + initial_value="0" + layout="topleft" + left_delta="10" + max_val="2" + name="WLStarAlpha" + top_pad="6" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-10" + name="SceneGammaText" + top_pad="20" + width="200"> + Scene Gamma + </text> + <slider + control_name="WLGamma" + decimal_digits="2" + follows="top|left" + height="10" + increment="0.01" + initial_value="2.0" + layout="topleft" + left_delta="10" + max_val="10" + name="WLGamma" + top_pad="6" + width="200" /> + + <!--======== Tab Panel II. III conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="60" + name="TODText" + top="25" + width="200"> + Sun/Moon Position + </text> + <multi_slider + can_edit_text="true" + control_name="WLSunPos" + decimal_digits="0" + follows="bottom" + height="10" + increment="0.0833333" + initial_value="0" + layout="topleft" + left_delta="0" + max_sliders="1" + max_val="24" + name="WLSunPos" + show_text="false" + top_pad="0" + width="300" /> + + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_delta="2" + name="WL12amHash" + top_pad="6" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="66" + name="WL6amHash" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL12pmHash2" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL6pmHash" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL12amHash2" + top_delta="0" + width="6"> + | + </text> + + + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="-300" + name="WL12am" + top="74" + width="55"> + 12am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="20" + name="WL6am" + top_delta="0" + width="55"> + 6am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="15" + name="WL12pmHash" + top_delta="0" + width="55"> + 12pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="18" + name="WL6pm" + top_delta="0" + width="55"> + 6pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="15" + name="WL12am2" + top_delta="0" + width="55"> + 12am + </text> + + <time + follows="left|top" + height="16" + label_width="0" + layout="topleft" + left_delta="-175" + name="WLDayTime" + top_pad="15" + value="6:00 AM" + width="75"/> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-106" + name="WLEastAngleText" + top_pad="24" + width="200"> + East Angle + </text> + <slider + control_name="WLEastAngle" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.0" + layout="topleft" + left_delta="10" + name="WLEastAngle" + top_pad="6" + width="200" /> + + </panel> + <panel + border="true" + bevel_style="none" + follows="left|top|right|bottom" + height="196" + label="CLOUDS" + layout="topleft" + left_delta="0" + mouse_opaque="false" + help_topic="sky_preset_clouds" + name="Clouds" + top_delta="4" + width="698"> + + <!--======== Tab Panel III. I conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left="40" + name="WLCloudColorText" + top="25" + width="200"> + Cloud Color + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="0" + name="WLCloudColor" + top_pad="6" + width="60" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="0" + name="WLCloudColorText2" + top_pad="20" + width="200"> + Cloud XY/Density + </text> + <slider + control_name="WLCloudX" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + label="X" + layout="topleft" + left_delta="0" + top_pad="6" + name="WLCloudX" + width="200" /> + <slider + control_name="WLCloudY" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + label="Y" + layout="topleft" + left_delta="0" + top_pad="6" + name="WLCloudY" + width="200" /> + <slider + control_name="WLCloudDensity" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="1.0" + label="D" + layout="topleft" + left_delta="0" + name="WLCloudDensity" + top_pad="6" + width="200" /> + + <!--======== Tab Panel III. II conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="55" + name="WLCloudCoverageText" + top="15" + width="200"> + Cloud Coverage + </text> + <slider + control_name="WLCloudCoverage" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_delta="15" + name="WLCloudCoverage" + top_pad="6" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="WLCloudScaleText" + top_pad="20" + width="200"> + Cloud Scale + </text> + <slider + control_name="WLCloudScale" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="1.0" + layout="topleft" + left_delta="15" + min_val="0.01" + name="WLCloudScale" + top_pad="6" + width="200" /> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-13" + name="WLCloudDetailText" + top_pad="20" + width="200"> + Cloud Detail (XY/Density) + </text> + <slider + control_name="WLCloudDetailX" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + label="X" + layout="topleft" + left_delta="0" + top_pad="6" + name="WLCloudDetailX" + width="200" /> + <slider + control_name="WLCloudDetailY" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + label="Y" + layout="topleft" + left_delta="0" + name="WLCloudDetailY" + top_pad="6" + width="200" /> + <slider + control_name="WLCloudDetailDensity" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="1.0" + label="D" + layout="topleft" + left_delta="0" + name="WLCloudDetailDensity" + top_pad="6" + width="200" /> + + <!--======== Tab Panel III. III conlumn of controls ========--> + + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_pad="55" + name="WLCloudScrollXText" + top="15" + width="150"> + Cloud Scroll X + </text> + <check_box + control_name="WLCloudLockX" + follows="left|top" + height="16" + label="Lock" + layout="topleft" + left_delta="150" + name="WLCloudLockX" + top_delta="0" + width="200" /> + <slider + control_name="WLCloudScrollX" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_delta="-135" + max_val="10" + min_val="-10" + name="WLCloudScrollX" + top_pad="6" + width="200" /> + <text + type="string" + length="1" + follows="left|top" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="WLCloudScrollYText" + top_pad="20" + width="150"> + Cloud Scroll Y + </text> + <check_box + control_name="WLCloudLockY" + follows="left|top" + height="16" + label="Lock" + layout="topleft" + left_delta="150" + name="WLCloudLockY" + width="200" /> + <slider + control_name="WLCloudScrollY" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.5" + layout="topleft" + left_delta="-135" + max_val="10" + min_val="-10" + name="WLCloudScrollY" + top_pad="6" + width="200" /> + </panel> + </tab_container> +<!--======== End of Controls panel ========--> + + <check_box + follows="top|left" + height="10" + label="Make this preset my new sky setting" + layout="topleft" + left="380" + name="make_default_cb" + top_pad="30" + width="280"/> + <button + follows="bottom|right" + height="23" + label="Save" + layout="topleft" + left_pad="0" + name="save" + width="70"/> + <button + follows="bottom|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="15" + name="cancel" + width="70"/> + </floater> diff --git a/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml new file mode 100644 index 0000000000..905983e7fa --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml @@ -0,0 +1,448 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="375" + layout="topleft" + name="Edit Water Preset" + help_topic="water_preset" + save_rect="true" + title="Edit Water Preset" + width="725"> + + <string name="title_new">Create a New Water Preset</string> + <string name="title_edit">Edit a Water Preset</string> + <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your water preset, adjust the controls and click "Save".</string> + <string name="combo_label">-Select a preset-</string> + + <text + follows="top|left|right" + height="10" + layout="topleft" + left="30" + name="hint" + top="25" + width="680"> + To edit your preset, adjust the controls then click "Save" + </text> + + <text + follows="top|left|right" + font="SansSerif" + height="10" + layout="topleft" + left="30" + name="label" + top_pad="25" + width="120"> + Preset Name: + </text> + + <combo_box + allow_text_entry="true" + follows="top|left" + layout="topleft" + left_pad="10" + max_chars="100" + name="water_preset_combo" + top_delta="-5" + width="200"/> + + <line_editor + height="20" + left_delta="0" + name="water_preset_name" + top_delta="0" + width="200" /> + + <text + follows="top|left|right" + height="40" + layout="topleft" + left_pad="10" + name="note" + top_delta="0" + width="340" + wrap="true"> + Note: if you change the name of your preset, you will be creating a new preset and the existing preset will not be changed. + </text> + + <!--======== Controls panel ========--> + <panel + border="false" + bevel_style="none" + follows="top|left" + height="230" + layout="topleft" + left="10" + name="panel_water_preset" + top="100" + width="700"> + +<!--======== I conlumn of controls ========--> + <text + follows="left|top|right" + height="10" + font="SansSerif" + layout="topleft" + left="10" + name="water_color_label" + top="5" + width="215"> + Water Fog Color + </text> + <color_swatch + can_apply_immediately="true" + follows="left|top" + height="37" + label_height="0" + layout="topleft" + left_delta="15" + name="WaterFogColor" + top_pad="8" + width="60" /> + + + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + top_pad="10" + name="water_fog_density_label" + width="215"> + Fog Density Exponent + </text> + <slider + decimal_digits="1" + follows="left|top" + height="10" + initial_value="0" + layout="topleft" + left_delta="15" + max_val="10" + name="WaterFogDensity" + top_pad="10" + width="200"/> + + + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + top_pad="15" + name="underwater_fog_modifier_label" + width="215"> + Underwater Fog Modifier + </text> + <slider + decimal_digits="1" + follows="left|top" + height="10" + initial_value="0" + layout="topleft" + left_delta="15" + max_val="10" + name="WaterUnderWaterFogMod" + top_pad="10" + width="200"/> + + + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + name="BHText" + top_pad="15" + width="215"> + Big Wave Direction + </text> + <slider + control_name="WaterWave1DirX" + decimal_digits="2" + follows="left|top" + increment="0.01" + initial_value="0.7" + label="X" + layout="topleft" + max_val="4" + min_val="-4" + name="WaterWave1DirX" + top_pad="10" + width="216"/> + <slider + control_name="WaterWave1DirY" + decimal_digits="2" + follows="left|top" + increment="0.01" + initial_value="0.7" + label="Y" + layout="topleft" + max_val="4" + min_val="-4" + name="WaterWave1DirY" + top_pad="5" + width="216"/> + +<!--======== II conlumn of controls ========--> + + <text + follows="left|top|right" + font="SansSerif" + height="10" + layout="topleft" + left_pad="20" + name="BDensText" + top="5" + width="215"> + Reflection Wavelet Scale + </text> + <slider + control_name="WaterNormalScaleX" + decimal_digits="1" + follows="left|top" + initial_value="0.7" + layout="topleft" + left_delta="15" + max_val="10" + name="WaterNormalScaleX" + top_pad="10" + width="200"/> + <slider + control_name="WaterNormalScaleY" + decimal_digits="1" + follows="left|top" + initial_value="0.7" + layout="topleft" + max_val="10" + name="WaterNormalScaleY" + top_pad="6" + width="200"/> + <slider + control_name="WaterNormalScaleZ" + decimal_digits="1" + follows="left|top" + initial_value="0.7" + layout="topleft" + max_val="10" + name="WaterNormalScaleZ" + top_pad="6" + width="200"/> + + + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + name="HDText" + top_pad="16" + width="215"> + Fresnel Scale + </text> + <slider + control_name="WaterFresnelScale" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="15" + name="WaterFresnelScale" + top_pad="10" + width="200"/> + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + name="FresnelOffsetText" + top_pad="15" + width="215"> + Fresnel Offset + </text> + <slider + control_name="WaterFresnelOffset" + decimal_digits="2" + follows="left" + increment="0.01" + initial_value="0.7" + layout="topleft" + left_delta="15" + name="WaterFresnelOffset" + top_pad="10" + width="200"/> + + + <text + follows="left|top|right" + font="SansSerif" + layout="topleft" + left_delta="-15" + name="BHText2" + top_pad="15" + width="215"> + Little Wave Direction + </text> + <slider + control_name="WaterWave2DirX" + decimal_digits="2" + follows="left|top" + increment="0.01" + initial_value="0.7" + label="X" + layout="topleft" + max_val="4" + min_val="-4" + name="WaterWave2DirX" + top_pad="10" + width="216" /> + <slider + control_name="WaterWave2DirY" + decimal_digits="2" + follows="left|top" + increment="0.01" + initial_value="0.7" + label="Y" + layout="topleft" + max_val="4" + min_val="-4" + name="WaterWave2DirY" + top_pad="6" + width="216" /> + +<!--======== III conlumn of contorls ========--> + + <text + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_pad="20" + name="DensMultText" + top="5" + width="215"> + Refract Scale Above + </text> + <slider + control_name="WaterScaleAbove" + decimal_digits="2" + follows="left|top" + increment="0.01" + initial_value="0.1" + layout="topleft" + left_delta="15" + name="WaterScaleAbove" + top_pad="5" + width="200" /> + + <text + type="string" + length="1" + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="WaterScaleBelowText" + top_pad="15" + width="215"> + Refract Scale Below + </text> + <slider + control_name="WaterScaleBelow" + decimal_digits="2" + follows="left|top" + height="10" + increment="0.01" + initial_value="0" + layout="topleft" + left_delta="15" + name="WaterScaleBelow" + top_pad="5" + width="200"/> + + <text + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="MaxAltText" + top_pad="15" + width="215"> + Blur Multiplier + </text> + <slider + control_name="WaterBlurMult" + follows="left|top" + height="10" + increment="0.001" + initial_value="0" + layout="topleft" + left_delta="15" + max_val="0.16" + name="WaterBlurMult" + top_pad="5" + width="200"/> + + <text + follows="left|top|right" + font="SansSerif" + height="16" + layout="topleft" + left_delta="-15" + name="BHText3" + top_pad="15" + width="215"> + Normal Map + </text> + <texture_picker + height="80" + layout="topleft" + left_delta="15" + name="WaterNormalMap" + top_pad="5" + width="100" /> + </panel> +<!--======== End of Controls panel ========--> + + <view_border + bevel_style="none" + follows="top|left" + height="0" + layout="topleft" + left="10" + name="horiz_separator" + top_pad="5" + width="700"/> + <check_box + follows="top|left" + height="10" + label="Make this preset my new water setting" + layout="topleft" + left="275" + name="make_default_cb" + top_pad="20" + width="280"/> + <button + follows="bottom|right" + height="23" + label="Save" + layout="topleft" + left_pad="0" + name="save" + width="70"/> + <button + follows="bottom|right" + height="23" + label="Cancel" + layout="topleft" + left_pad="15" + name="cancel" + width="70"/> + + </floater> diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml deleted file mode 100644 index 8df5e232d9..0000000000 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ /dev/null @@ -1,164 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - height="150" - layout="topleft" - name="Environment Editor Floater" - help_topic="environment_editor_floater" - save_rect="true" - title="ENVIRONMENT EDITOR" - width="600"> - <floater.string - name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="EnvTimeText" - top="32" - width="140"> - Time of Day - </text> - <text - type="string" - length="1" - follows="left|top|right" - height="16" - layout="topleft" - left="15" - name="EnvTimeText2" - top="62" - width="140"> - 12:00 PM - </text> - <icon - height="25" - image_name="icon_diurnal.tga" - layout="topleft" - left="85" - name="EnvDayCycle" - top="30" - use_draw_context_alpha="false" - width="200" /> - <slider - control_name="EnvTimeSlider" - decimal_digits="2" - follows="left" - height="10" - increment="0.0069444" - initial_value="0.7" - layout="topleft" - left_delta="0" - max_val="0.99" - name="EnvTimeSlider" - show_text="false" - top_pad="10" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="EnvCloudText" - top="86" - width="140"> - Cloud Cover - </text> - <slider - control_name="EnvCloudSlider" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="75" - name="EnvCloudSlider" - top_delta="4" - width="210" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="310" - name="EnvWaterColorText" - top="39" - width="140"> - Water Color - </text> - <color_swatch - can_apply_immediately="true" - color="0.5 0.5 0.5 1" - follows="left|top" - height="50" - layout="topleft" - left="390" - name="EnvWaterColor" - tool_tip="Click to open color picker" - top="30" - width="40" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="310" - name="EnvWaterFogText" - top="86" - width="140"> - Water Fog - </text> - <slider - control_name="EnvWaterFogSlider" - decimal_digits="2" - follows="left" - height="10" - initial_value="0" - layout="topleft" - left_delta="75" - max_val="10" - name="EnvWaterFogSlider" - top_delta="4" - width="210" /> - <button - follows="left|top" - height="23" - label="Use Estate Time" - layout="topleft" - left="10" - name="EnvUseEstateTimeButton" - top="120" - width="137" /> - <button - follows="left|top" - height="23" - label="Advanced Sky" - layout="topleft" - left_pad="3" - name="EnvAdvancedSkyButton" - top_delta="0" - width="137" /> - <button - follows="left|top" - height="23" - label="Advanced Water" - layout="topleft" - left_pad="3" - name="EnvAdvancedWaterButton" - top_delta="0" - width="137" /> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_environment_settings.xml b/indra/newview/skins/default/xui/en/floater_environment_settings.xml new file mode 100644 index 0000000000..1b1cafaca6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_environment_settings.xml @@ -0,0 +1,162 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="328" + layout="topleft" + name="Environment Editor Floater" + help_topic="environment_editor_floater" + save_rect="true" + title="ENVIRONMENT SETTINGS" + width="540"> + + <text + follows="top|left|right" + height="15" + layout="topleft" + left="20" + name="note" + top="25" + width="510" + wrap="true"> + Use the options below to customize the environment settings for your viewer. + </text> + + <view_border + bevel_style="none" + follows="top|left" + height="237" + layout="topleft" + left="20" + name="border" + top_pad="8" + width="500"/> + <radio_group + follows="top|left" + height="45" + layout="topleft" + left_delta="10" + name="region_settings_radio_group" + top_delta="20" + width="200"> + <radio_item + label="Use region settings" + layout="topleft" + name="use_region_settings"/> + <radio_item + label="Customize my environment" + layout="topleft" + name="use_my_settings" + top_pad="20"/> + </radio_group> + + <panel + height="170" + layout="topleft" + left="50" + name="user_environment_settings" + top_pad="0" + width="470"> + + <text + follows="top|left|right" + font="SansSerifItalic" + height="15" + layout="topleft" + left_delta="0" + name="note" + top_pad="0" + width="470" + wrap="true"> + Note: your custom settings will not be visible to other users. + </text> + + <!-- Water Setting --> + <text + name="water_settings_title" + follows="top|left" + height="16" + layout="topleft" + left="50" + top="40" + width="200"> + Water Setting + </text> + <combo_box + follows="top|left" + left_pad="2" + name="water_settings_preset_combo" + top_delta="-5" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + + + <!-- Sky/Day Cycle Settings --> + <text + name="sky_dayc_settings_title" + follows="top|left" + height="16" + layout="topleft" + left="50" + top_pad="20" + width="100"> + Sky / Day Cycle + </text> + <radio_group + layout="topleft" + left_delta="50" + name="sky_dayc_settings_radio_group" + top_pad="10" + height="50" + width="150"> + <radio_item + layout="topleft" + label="Fixed sky" + name="my_sky_settings"/> + <radio_item + layout="topleft" + label="Day cycle" + name="my_dayc_settings" + top_pad="25"/> + </radio_group> + <combo_box + follows="top|left" + left_pad="2" + name="sky_settings_preset_combo" + top_delta="-7" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + <combo_box + follows="top|left" + name="dayc_settings_preset_combo" + top_delta="36" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + </panel> + + <button + follows="left|top" + height="23" + label="OK" + layout="topleft" + right="-130" + name="ok_btn" + top_pad="10" + width="100" /> + <button + follows="left|top" + height="23" + label="Cancel" + layout="topleft" + left_pad="10" + name="cancel_btn" + width="100" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index 02e50ee584..de6d586f72 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -2,6 +2,8 @@ <floater legacy_header_height="18" can_resize="true" + left="10000" + bottom="10000" height="600" layout="topleft" min_height="150" diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml index 43729d7c9f..5a1f920398 100644 --- a/indra/newview/skins/default/xui/en/floater_media_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -5,7 +5,7 @@ height="440" layout="topleft" min_height="140" - min_width="467" + min_width="0" name="floater_about" help_topic="floater_about" save_rect="true" diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index 7f15de7236..060ddec1f4 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -74,27 +74,85 @@ follows="all"/> <text - follows="top|left" font="SansSerif" + bottom_delta="15" left_delta="0" name="warning_title" text_color="Yellow" - top_pad="10" visible="false"> WARNING: </text> <text - follows="top|left" text_color="White" - height="50" + height="40" + width="290" + top_delta="15" left_delta="0" name="warning_message" parse_urls="true" - top_pad="5" wrap="true" visible="false"> - You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get certifed for mesh model uploads. - </text> + You will not be able to complete the final upload of this model to the Second Life servers. [secondlife:///app/floater/learn_more Find out how] to get enabled for mesh model uploads.</text> + + <text + height="65" + top_delta="45" + left_delta="0" + name="weights_text" + width="80" + word_wrap="true" + > +Streaming: +Physics: +Simulation: + +Prim equivs: + </text> + + <text + height="65" + top_delta="0" + left_delta="80" + name="weights" + width="70" + word_wrap="true" + > +[ST] +[PH] +[SIM] + +[EQ] + </text> + + <text + height="65" + top_delta="0" + left_delta="70" + name="price_breakdown_text" + width="80" + word_wrap="true" + > +Streaming: +Physics: +Instances: +Textures: +Model: + </text> + + <text + height="65" + top_delta="0" + left_delta="80" + name="price_breakdown" + width="65" + word_wrap="true" + > +L$ [STREAMING] +L$ [PHYSICS] +L$ [INSTANCES] +L$ [TEXTURES] +L$ [MODEL] + </text> <tab_container follows="right|top|bottom" @@ -407,12 +465,14 @@ <text height="16" - left="310" - name="weights" + left_delta="5" + bottom_delta="30" + name="upload_fee" width="300" + follows="bottom|right" word_wrap="true" - top_pad="7"> - Prim equivs: [EQ] Physics: [PH] Upload fee: [FEE] L$ + > + Upload fee: L$ [FEE] </text> <button bottom="540" left="10" follows="bottom|left" height="20" label="Set to defaults" diff --git a/indra/newview/skins/default/xui/en/floater_region_info.xml b/indra/newview/skins/default/xui/en/floater_region_info.xml index 32fb6f97e7..3b58cd08f6 100644 --- a/indra/newview/skins/default/xui/en/floater_region_info.xml +++ b/indra/newview/skins/default/xui/en/floater_region_info.xml @@ -16,5 +16,5 @@ name="region_panels" right="-1" tab_position="top" - top="20" /> + top="20"/> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml deleted file mode 100644 index 3a44ba3763..0000000000 --- a/indra/newview/skins/default/xui/en/floater_water.xml +++ /dev/null @@ -1,503 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - height="240" - layout="topleft" - name="Water Floater" - help_topic="water_floater" - save_rect="true" - title="ADVANCED WATER EDITOR" - width="700"> - <floater.string - name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </floater.string> - <text - type="string" - length="1" - follows="left|top|right" - height="16" - layout="topleft" - left="10" - name="KeyFramePresetsText" - top="34" - font="SansSerif" - width="85"> - Water Presets: - </text> - <combo_box - height="23" - layout="topleft" - left_delta="95" - name="WaterPresetsCombo" - top_delta="-4" - width="150" /> - <button - height="23" - label="New" - label_selected="New" - layout="topleft" - left_pad="3" - name="WaterNewPreset" - top_delta="0" - width="70" /> - <button - height="23" - label="Save" - label_selected="Save" - layout="topleft" - left_pad="3" - name="WaterSavePreset" - top_delta="0" - width="70" /> - <button - height="23" - label="Delete" - label_selected="Delete" - layout="topleft" - left_pad="3" - name="WaterDeletePreset" - top_delta="0" - width="70" /> - <tab_container - border="false" - follows="left|top" - height="180" - halign="center" - layout="topleft" - left="0" - name="Water Tabs" - tab_position="top" - top="60" - width="700"> - <panel - border="true" - follows="all" - height="180" - label="SETTINGS" - layout="topleft" - left="0" - mouse_opaque="false" - help_topic="water_settings_tab" - name="Settings" - top="0" - width="698"> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="BHText" - top="4" - width="200"> - Water Fog Color - </text> - <color_swatch - can_apply_immediately="true" - color="0.5 0.5 0.5 1" - follows="left|top" - height="50" - layout="topleft" - left="40" - name="WaterFogColor" - tool_tip="Click to open color picker" - top="30" - width="40" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="WaterFogDensText" - top="84" - width="200"> - Fog Density Exponent - </text> - <slider - control_name="WaterFogDensity" - decimal_digits="1" - follows="left" - height="10" - initial_value="16" - layout="topleft" - left="24" - max_val="10" - name="WaterFogDensity" - top="124" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-14" - name="WaterUnderWaterFogModText" - top="124" - width="200"> - Underwater Fog Modifier - </text> - <slider - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="16" - layout="topleft" - left="24" - max_val="2" - name="WaterUnderWaterFogMod" - top="164" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="245" - name="BDensText" - top="4" - width="200"> - Reflection Wavelet Scale - </text> - <slider - control_name="WaterNormalScaleX" - decimal_digits="1" - follows="left" - height="15" - initial_value="0.7" - label="1" - layout="topleft" - max_val="10" - name="WaterNormalScaleX" - top_pad="24" - width="200" /> - <slider - control_name="WaterNormalScaleY" - decimal_digits="1" - follows="left" - height="15" - initial_value="0.7" - label="2" - layout="topleft" - max_val="10" - name="WaterNormalScaleY" - top_pad="4" - width="200" /> - <slider - control_name="WaterNormalScaleZ" - decimal_digits="1" - follows="left" - height="15" - initial_value="0.7" - label="3" - layout="topleft" - max_val="10" - name="WaterNormalScaleZ" - top_pad="4" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - name="HDText" - top="84" - width="200"> - Fresnel Scale - </text> - <slider - control_name="WaterFresnelScale" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - name="WaterFresnelScale" - top="124" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - name="FresnelOffsetText" - top="124" - width="200"> - Fresnel Offset - </text> - <slider - control_name="WaterFresnelOffset" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - name="WaterFresnelOffset" - top="164" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="480" - name="DensMultText" - top="4" - width="200"> - Refract Scale Above - </text> - <slider - control_name="WaterScaleAbove" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.1" - layout="topleft" - left="494" - name="WaterScaleAbove" - top="44" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-14" - name="WaterScaleBelowText" - top="44" - width="200"> - Refract Scale Below - </text> - <slider - control_name="WaterScaleBelow" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0" - layout="topleft" - left="494" - name="WaterScaleBelow" - top="84" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-14" - name="MaxAltText" - top="84" - width="200"> - Blur Multiplier - </text> - <slider - control_name="WaterBlurMult" - follows="left" - height="10" - increment="0.001" - initial_value="0" - layout="topleft" - left="494" - max_val="0.16" - name="WaterBlurMult" - top="124" - width="200" /> - </panel> - <panel - border="true" - follows="all" - height="180" - label="IMAGE" - layout="topleft" - left="0" - mouse_opaque="false" - help_topic="water_waves_tab" - name="Waves" - top="0" - width="698"> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="BHText" - top="4" - width="200"> - Big Wave Direction - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="10" - name="WaterWave1DirXText" - top_pad="5" - width="10"> - X - </text> - <slider - control_name="WaterWave1DirX" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left="24" - max_val="4" - min_val="-4" - name="WaterWave1DirX" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="WaterWave1DirYText" - top_pad="-15" - width="10"> - Y - </text> - <slider - control_name="WaterWave1DirY" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - max_val="4" - min_val="-4" - name="WaterWave1DirY" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="BHText2" - top_pad="-10" - width="355"> - Little Wave Direction - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="10" - left_delta="0" - name="WaterWave2DirXText" - top_pad="5" - width="10"> - X - </text> - <slider - control_name="WaterWave2DirX" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left="24" - max_val="4" - min_val="-4" - name="WaterWave2DirX" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="WaterWave2DirYText" - top_pad="-15" - width="10"> - Y - </text> - <slider - control_name="WaterWave2DirY" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - max_val="4" - min_val="-4" - name="WaterWave2DirY" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="240" - name="BHText3" - top="4" - width="200"> - Normal Map - </text> - <texture_picker - height="143" - layout="topleft" - left="250" - name="WaterNormalMap" - top="22" - width="128" /> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index e04a72cbc0..69e6057556 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -18,6 +18,7 @@ follows="left|right|top|bottom" layout="topleft" left="5" + animate="false" name="stack1" orientation="vertical" top="20" @@ -156,14 +157,20 @@ name="external_controls" top_delta="0" user_resize="false" + auto_resize="true" width="585"> <web_browser - bottom="-22" + bottom="-2" follows="all" layout="topleft" left="0" name="webbrowser" top="0"/> + </layout_panel> + <layout_panel name="status_bar" + height="23" + auto_resize="false" + user_resize="false"> <text type="string" length="200" @@ -174,7 +181,7 @@ name="statusbartext" parse_urls="false" text_color="0.4 0.4 0.4 1" - top_pad="5" + top_pad="3" width="495"/> <progress_bar color_bar="0.3 1.0 0.3 1" diff --git a/indra/newview/skins/default/xui/en/floater_windlight_options.xml b/indra/newview/skins/default/xui/en/floater_windlight_options.xml deleted file mode 100644 index 7923dd87fa..0000000000 --- a/indra/newview/skins/default/xui/en/floater_windlight_options.xml +++ /dev/null @@ -1,1288 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater - legacy_header_height="18" - height="256" - layout="topleft" - name="WindLight floater" - help_topic="windlight_floater" - save_rect="true" - title="ADVANCED SKY EDITOR" - width="700"> - <floater.string - name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </floater.string> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="KeyFramePresetsText" - top="34" - width="135"> - Sky Presets: - </text> - <combo_box - height="23" - layout="topleft" - left_delta="135" - name="WLPresetsCombo" - top_delta="-4" - width="150" /> - <button - height="23" - label="New" - label_selected="New" - layout="topleft" - left_pad="3" - name="WLNewPreset" - width="70" /> - <button - height="23" - label="Save" - label_selected="Save" - layout="topleft" - left_pad="3" - name="WLSavePreset" - width="70" /> - <button - height="23" - label="Delete" - label_selected="Delete" - layout="topleft" - left_pad="3" - name="WLDeletePreset" - width="70" /> - <button - height="23" - label="Day Cycle Editor" - label_selected="Day Cycle Editor" - layout="topleft" - right="-10" - name="WLDayCycleMenuButton" - top_pad="-23" - width="120" /> - <tab_container - follows="left|top" - height="196" - halign="center" - layout="topleft" - left="0" - name="WindLight Tabs" - tab_position="top" - top="60" - width="700"> - <panel - border="true" - follows="left|top|right|bottom" - height="196" - label="ATMOSPHERE" - layout="topleft" - left="1" - mouse_opaque="false" - help_topic="windlight_atmosphere_tab" - name="Atmosphere" - top="60" - width="698"> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="BHText" - top="4" - width="355"> - Blue Horizon - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="10" - name="BHText2" - top_pad="5" - width="10"> - R - </text> - <slider - control_name="WLBlueHorizonR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLBlueHorizonR" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="10" - top_pad="-15" - name="BHText3" - width="10"> - G - </text> - <slider - control_name="WLBlueHorizonG" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLBlueHorizonG" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - name="BHText4" - left="10" - top_pad="-15" - width="10"> - B - </text> - <slider - control_name="WLBlueHorizonB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - name="WLBlueHorizonB" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - name="BHText5" - left="10" - top_pad="-15" - width="10"> - I - </text> - <slider - control_name="WLBlueHorizonI" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - name="WLBlueHorizonI" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - top_pad="-10" - name="BDensText" - width="355"> - Haze Horizon - </text> - <slider - control_name="WLHazeHorizon" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.25" - layout="topleft" - left="23" - top_delta="0" - top_pad="27" - name="WLHazeHorizon" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="245" - name="BDensText2" - top="4" - width="355"> - Blue Density - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="245" - name="BHText6" - top_pad="5" - width="10"> - R - </text> - <slider - control_name="WLBlueDensityR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLBlueDensityR" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="245" - name="BHText7" - top_pad="-15" - width="10"> - G - </text> - <slider - control_name="WLBlueDensityG" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLBlueDensityG" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="245" - name="BHText8" - top_pad="-15" - width="10"> - B - </text> - <slider - control_name="WLBlueDensityB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLBlueDensityB" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left="245" - name="BHText9" - top_pad="-15" - width="10"> - I - </text> - <slider - control_name="WLBlueDensityI" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1" - layout="topleft" - left_delta="0" - name="WLBlueDensityI" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="245" - name="HDText" - top_pad="-10" - width="355"> - Haze Density - </text> - <slider - control_name="WLHazeDensity" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left="258" - max_val="4" - name="WLHazeDensity" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="480" - name="DensMultText" - top="4" - width="355"> - Density Multiplier - </text> - <slider - control_name="WLDensityMult" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.1" - layout="topleft" - left_delta="13" - max_val="0.9" - name="WLDensityMult" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="WLDistanceMultText" - top_pad="-10" - width="355"> - Distance Multiplier - </text> - <slider - control_name="WLDistancMult" - decimal_digits="1" - follows="left" - height="10" - initial_value="1.0" - layout="topleft" - left_delta="13" - max_val="100" - name="WLDistanceMult" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="MaxAltText" - top_pad="-15" - width="355"> - Max Altitude - </text> - <slider - control_name="WLMaxAltitude" - decimal_digits="0" - follows="left" - height="10" - increment="1" - initial_value="500" - layout="topleft" - left_delta="13" - max_val="4000" - name="WLMaxAltitude" - top_pad="27" - width="200" /> - </panel> - <panel - border="true" - follows="left|top|right|bottom" - height="196" - label="LIGHTING" - layout="topleft" - left_delta="0" - help_topic="windlight_lighting_tab" - name="Lighting" - top_delta="4" - width="698"> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="SLCText" - top="4" - width="355"> - Sun/Moon Color - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="0" - name="BHText" - top_pad="5" - width="10"> - R - </text> - <slider - control_name="WLSunlightR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLSunlightR" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText2" - top_pad="-15" - width="10"> - G - </text> - <slider - control_name="WLSunlightG" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLSunlightG" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText3" - top_pad="-15" - width="10"> - B - </text> - <slider - control_name="WLSunlightB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLSunlightB" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText4" - top_pad="-15" - width="10"> - I - </text> - <slider - control_name="WLSunlightI" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - left_delta="0" - name="WLSunlightI" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="TODText" - top_pad="-10" - width="355"> - Sun/Moon Position - </text> - <icon - height="20" - image_name="icon_diurnal.tga" - layout="topleft" - left_delta="14" - top_pad="10" - name="SkyDayCycle" - use_draw_context_alpha="false" - width="148" /> - <slider - control_name="WLSunAngle" - follows="left" - height="10" - increment="0.001" - initial_value="0.7" - layout="topleft" - left_delta="-8" - name="WLSunAngle" - top_pad="20" - width="207" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="245" - name="WLAmbientText" - top="4" - width="355"> - Ambient - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="0" - name="BHText5" - top_pad="5" - width="10"> - R - </text> - <slider - control_name="WLAmbientR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLAmbientR" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText6" - top_pad="-15" - width="10"> - G - </text> - <slider - control_name="WLAmbientG" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLAmbientG" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText7" - top_pad="-15" - width="10"> - B - </text> - <slider - control_name="WLAmbientB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLAmbientB" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText8" - top_pad="-15" - width="10"> - I - </text> - <slider - control_name="WLAmbientI" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1" - layout="topleft" - left_delta="0" - name="WLAmbientI" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="WLEastAngleText" - top_pad="-10" - width="355"> - East Angle - </text> - <slider - control_name="WLEastAngle" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.0" - layout="topleft" - left_delta="13" - name="WLEastAngle" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="480" - name="SunGlowText" - top="4" - width="355"> - Sun Glow - </text> - <slider - control_name="WLGlowB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.1" - label="Focus " - layout="topleft" - left_delta="0" - max_val="0.5" - name="WLGlowB" - top_pad="27" - width="200" /> - <slider - control_name="WLGlowR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.25" - label="Size " - layout="topleft" - left_delta="0" - max_val="1.99" - min_val="1" - name="WLGlowR" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="0" - name="SceneGammaText" - top_pad="-10" - width="200"> - Scene Gamma - </text> - <slider - control_name="WLGamma" - decimal_digits="2" - follows="bottom" - height="10" - increment="0.01" - initial_value="2.0" - layout="topleft" - left_delta="0" - max_val="10" - name="WLGamma" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="0" - name="WLStarText" - top_pad="-10" - width="355"> - Star Brightness - </text> - <slider - control_name="WLStarAlpha" - decimal_digits="2" - follows="bottom" - height="10" - increment="0.01" - initial_value="0" - layout="topleft" - left_delta="0" - max_val="2" - name="WLStarAlpha" - top_pad="27" - width="200" /> - </panel> - <panel - border="true" - follows="left|top|right|bottom" - height="196" - label="CLOUDS" - layout="topleft" - left_delta="0" - mouse_opaque="false" - help_topic="windlight_clouds_tab" - name="Clouds" - top_delta="4" - width="698"> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="10" - name="WLCloudColorText" - top="4" - width="355"> - Cloud Color - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="0" - name="BHText" - top_pad="5" - width="10"> - R - </text> - <slider - control_name="WLCloudColorR" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLCloudColorR" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText2" - top_pad="-15" - width="10"> - G - </text> - <slider - control_name="WLCloudColorG" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLCloudColorG" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText3" - top_pad="-15" - width="10"> - B - </text> - <slider - control_name="WLCloudColorB" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.7" - layout="topleft" - left_delta="0" - name="WLCloudColorB" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText4" - top_pad="-15" - width="10"> - I - </text> - <slider - control_name="WLCloudColorI" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - left_delta="0" - name="WLCloudColorI" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="WLCloudColorText2" - top_pad="-10" - width="355"> - Cloud XY/Density - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="0" - name="BHText5" - top_pad="5" - width="10"> - X - </text> - <slider - control_name="WLCloudX" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLCloudX" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText6" - top_pad="-15" - width="10"> - Y - </text> - <slider - control_name="WLCloudY" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left_pad="3" - top_pad="6" - name="WLCloudY" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText7" - top_pad="-15" - width="10"> - D - </text> - <slider - control_name="WLCloudDensity" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - left_delta="0" - name="WLCloudDensity" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="245" - name="WLCloudCoverageText" - top="4" - width="355"> - Cloud Coverage - </text> - <slider - control_name="WLCloudCoverage" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left_delta="13" - name="WLCloudCoverage" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="WLCloudScaleText" - top_pad="-10" - width="355"> - Cloud Scale - </text> - <slider - control_name="WLCloudScale" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - left_delta="13" - min_val="0.01" - name="WLCloudScale" - top_pad="27" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-13" - name="WLCloudDetailText" - top_pad="-10" - width="355"> - Cloud Detail (XY/Density) - </text> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="0" - name="BHText8" - top_pad="8" - width="10"> - X - </text> - <slider - control_name="WLCloudDetailX" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left_pad="3" - top_pad="8" - name="WLCloudDetailX" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText9" - top_pad="-15" - width="10"> - Y - </text> - <slider - control_name="WLCloudDetailY" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left_delta="0" - name="WLCloudDetailY" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - halign="center" - height="16" - layout="topleft" - left_delta="-13" - name="BHText10" - top_pad="-15" - width="10"> - D - </text> - <slider - control_name="WLCloudDetailDensity" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="1.0" - layout="topleft" - left_delta="0" - name="WLCloudDetailDensity" - left_pad="3" - top_pad="6" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left="480" - name="WLCloudScrollXText" - top="4" - width="355"> - Cloud Scroll X - </text> - <check_box - control_name="WLCloudLockX" - follows="left" - height="16" - label="Lock" - layout="topleft" - left="625" - name="WLCloudLockX" - width="200" /> - <slider - control_name="WLCloudScrollX" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left="494" - max_val="10" - min_val="-10" - name="WLCloudScrollX" - top="45" - width="200" /> - <text - type="string" - length="1" - follows="left|top|right" - font="SansSerif" - height="16" - layout="topleft" - left_delta="-14" - name="WLCloudScrollYText" - top_delta="-1" - width="355"> - Cloud Scroll Y - </text> - <check_box - control_name="WLCloudLockY" - follows="left" - height="16" - label="Lock" - layout="topleft" - left="625" - name="WLCloudLockY" - width="200" /> - <slider - control_name="WLCloudScrollY" - decimal_digits="2" - follows="left" - height="10" - increment="0.01" - initial_value="0.5" - layout="topleft" - left="494" - max_val="10" - min_val="-10" - name="WLCloudScrollY" - top="85" - width="200" /> - <check_box - control_name="DrawClassicClouds" - follows="left" - height="16" - label="Draw Classic Clouds" - layout="topleft" - left="480" - name="DrawClassicClouds" - top="104" - width="200" /> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 3af056baa9..0f42000ae7 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -42,7 +42,7 @@ <menu_item_call.on_enable function="File.EnableUpload" /> </menu_item_call> - <menu_item_call + <menu_item_call label="Model..." layout="topleft" name="Upload Model"> @@ -251,4 +251,4 @@ parameter="eyes" /> </menu_item_call> </menu> -</menu> +</menu>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index a0d0c8625e..499cf47b6c 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -480,7 +480,7 @@ <menu_item_separator/> - <menu + <menu create_jump_keys="true" label="Sun" name="Environment Settings" @@ -515,24 +515,105 @@ function="World.EnvSettings" parameter="midnight" /> </menu_item_call> - <menu_item_call - label="Estate Time" - name="Revert to Region Default"> - <menu_item_call.on_click - function="World.EnvSettings" - parameter="default" /> - </menu_item_call> - - <menu_item_separator/> - - <menu_item_call - label="Environment Editor" - name="Environment Editor"> - <menu_item_call.on_click - function="World.EnvSettings" - parameter="editor" /> - </menu_item_call> </menu> + + + <menu + create_jump_keys="true" + label="Enviroment Editor" + name="Enviroment Editor" + tear_off="true"> + + <menu_item_call + label="Enviroment Settings..." + name="Enviroment Settings"> + <menu_item_call.on_click + function="World.EnvSettings" + parameter="editor"/> + </menu_item_call> + + <menu_item_separator/> + + <menu + name="Water Presets" + label="Water Presets"> + <menu_item_call + label="New preset..." + name="new_water_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="new_water"/> + </menu_item_call> + <menu_item_call + label="Edit preset..." + name="edit_water_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="edit_water"/> + </menu_item_call> + <menu_item_call + label="Delete preset..." + name="delete_water_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="delete_water"/> + </menu_item_call> + </menu> + + <menu + name="Sky Presets" + label="Sky Presets"> + <menu_item_call + label="New preset..." + name="new_sky_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="new_sky"/> + </menu_item_call> + <menu_item_call + label="Edit preset..." + name="edit_sky_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="edit_sky"/> + </menu_item_call> + <menu_item_call + label="Delete preset..." + name="delete_sky_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="delete_sky"/> + </menu_item_call> + </menu> + + <menu + name="Day Presets" + label="Day Presets"> + <menu_item_call + label="New preset..." + name="new_day_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="new_day_cycle"/> + </menu_item_call> + <menu_item_call + label="Edit preset..." + name="edit_day_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="edit_day_cycle"/> + </menu_item_call> + <menu_item_call + label="Delete preset..." + name="delete_day_preset"> + <menu_item_call.on_click + function="World.EnvPreset" + parameter="delete_day_cycle"/> + </menu_item_call> + </menu> + </menu> + + </menu> <menu create_jump_keys="true" @@ -993,19 +1074,7 @@ <menu_item_call.on_visible function="File.VisibleUploadModel"/> </menu_item_call> - <menu_item_call - label="Model Wizard..." - layout="topleft" - name="Upload Model Wizard"> - <menu_item_call.on_click - function="Floater.Show" - parameter="upload_model_wizard" /> - <menu_item_call.on_enable - function="File.EnableUploadModel" /> - <menu_item_call.on_visible - function="File.VisibleUploadModel"/> - </menu_item_call> - <menu_item_call + <menu_item_call label="Bulk (L$[COST] per file)..." layout="topleft" name="Bulk Upload"> @@ -2009,10 +2078,7 @@ label="Show Upload Cost" layout="topleft" name="Show Upload Cost"> - <menu_item_check.on_check - function="CheckControl" - parameter="DebugShowUploadCost" /> - <menu_item_check.on_click + <menu_item_check.on_click function="ToggleControl" parameter="DebugShowUploadCost" /> </menu_item_check> @@ -2850,6 +2916,18 @@ function="Floater.Toggle" parameter="region_debug_console" /> </menu_item_check> + <menu_item_check + label="Region Debug Console" + name="Region Debug Console" + shortcut="control|shift|`" + use_mac_ctrl="true"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="region_debug_console" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="region_debug_console" /> + </menu_item_check> <menu_item_separator /> <menu_item_check diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 97d84a16c6..6e2596a49e 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4854,18 +4854,6 @@ Do you wish to overwrite the saved preset? <notification icon="alertmodal.tga" - name="WLDeletePresetAlert" - type="alertmodal"> -Do you wish to delete [SKY]? - <tag>confirm</tag> - <usetemplate - name="okcancelbuttons" - notext="No" - yestext="Yes"/> - </notification> - - <notification - icon="alertmodal.tga" name="WLNoEditDefault" type="alertmodal"> You cannot edit or delete a default preset. @@ -4882,81 +4870,53 @@ This day cycle file references a missing sky file: [SKY]. <notification icon="alertmodal.tga" - name="PPSaveEffectAlert" + name="WLRegionApplyFail" type="alertmodal"> -PostProcess Effect exists. Do you still wish overwrite it? - <usetemplate - name="okcancelbuttons" - notext="No" - yestext="Yes"/> - </notification> - - <notification - icon="alert.tga" - name="NewSkyPreset" - type="alert"> -Give me a name for the new sky. - <tag>confirm</tag> - <form name="form"> - <input name="message" type="text"> -New Preset - </input> - <button - default="true" - index="0" - name="OK" - text="OK"/> - <button - index="1" - name="Cancel" - text="Cancel"/> - </form> +Sorry, the settings couldn't be applied to the region. Leaving the region and then returning may help rectify the problem. The reason given was: [FAIL_REASON] </notification> <notification + functor="GenericAcknowledge" icon="alertmodal.tga" - name="ExistsSkyPresetAlert" + name="EnvCannotDeleteLastDayCycleKey" type="alertmodal"> -Preset already exists! - <tag>fail</tag> +Unable to delete the last key in this day cycle because you cannot have an empty day cycle. You should modify the last remaining key instead of attempting to delete it and then to create a new one. + <usetemplate + name="okbutton" + yestext="OK"/> </notification> <notification - icon="alert.tga" - name="NewWaterPreset" - type="alert"> -Give me a name for the new water preset. - <tag>confirm</tag> - <form name="form"> - <input name="message" type="text"> -New Preset - </input> - <button - default="true" - index="0" - name="OK" - text="OK"/> - <button - index="1" - name="Cancel" - text="Cancel"/> - </form> + functor="GenericAcknowledge" + icon="alertmodal.tga" + name="DayCycleTooManyKeyframes" + type="alertmodal"> +You cannot add any more keyframes to this day cycle. The maximum number of keyframes for day cycles of [SCOPE] scope is [MAX]. + <usetemplate + name="okbutton" + yestext="OK"/> </notification> <notification + functor="GenericAcknowledge" icon="alertmodal.tga" - name="ExistsWaterPresetAlert" + name="EnvUpdateRate" type="alertmodal"> -Preset already exists! - <tag>fail</tag> + You may only update region environmental settings every [WAIT] seconds. Wait at least that long and then try again. + <usetemplate + name="okbutton" + yestext="OK"/> </notification> <notification icon="alertmodal.tga" - name="WaterNoEditDefault" + name="PPSaveEffectAlert" type="alertmodal"> -You cannot edit or delete a default preset. - <tag>fail</tag> +PostProcess Effect exists. Do you still wish overwrite it? + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> </notification> <notification @@ -5668,6 +5628,15 @@ This area has building disabled. You can't build or rez objects here. <notification icon="notify.tga" + name="SeeAvatars" + persist="true" + type="notify" + unique="true"> +This parcel hides avatars and text chat from another parcel. You can't see other residents outside the parcel, and those outside are not able to see you. Regular text chat on channel 0 is also blocked. + </notification> + + <notification + icon="notify.tga" name="ScriptsStopped" persist="true" type="notify"> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index 82dfb445da..2ec2e03e8c 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -220,7 +220,7 @@ height="23" layout="topleft" left_pad="4" - name="layout_panel1" + name="layout_panel2" user_resize="false" auto_resize="true" width="146"> diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml new file mode 100644 index 0000000000..d06190ec54 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_inventory_panel + name="inventory_inbox" + start_folder="Received Items" + follows="all" layout="topleft" + top="0" left="0" height="165" width="308" + top_pad="0" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + show_item_link_overlays="true" + > + <scroll reserve_scroll_corner="false" /> +</inbox_inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml new file mode 100644 index 0000000000..af32056428 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + name="inventory_outbox" + start_folder="Outbox" + follows="all" layout="topleft" + top="0" left="0" height="165" width="308" + top_pad="0" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + show_item_link_overlays="true" + > + <scroll reserve_scroll_corner="false" /> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 774a9e8bbf..e280115bda 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -153,6 +153,14 @@ name="icon_DamageNo" translate="false" value="Parcel_DamageNo_Dark" /> + <string + name="icon_SeeAVs_Off" + translate="false" + value="Parcel_SeeAVsOff_Dark" /> + <string + name="icon_SeeAVs_On" + translate="false" + value="Parcel_SeeAVsOn_Dark" /> <button follows="top|left" height="24" @@ -354,7 +362,7 @@ title="Parcel"> <panel follows="all" - height="175" + height="200" layout="topleft" left="0" name="parcel_characteristics_panel" @@ -543,6 +551,31 @@ top_delta="0" value="Off" width="60" /> + <icon + follows="top|left" + height="18" + image_name="Parcel_SeeAVsOff_Dark" + layout="topleft" + left="10" + name="see_avatars_icon" + top_pad="7" + width="22" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="8" + name="see_avatars_label" + value="See Avatars:" + width="90" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="0" + name="see_avatars_value" + value="Off" + width="60" /> <button follows="bottom|right" height="23" diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 2868d91cc7..4535c56339 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -132,4 +132,12 @@ name="cancel_btn" top="700" width="90" /> + <web_browser + follows="all" + layout="topleft" + left="0" + name="login_media_panel" + width="1024" + height="768" + top="0"/> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml new file mode 100644 index 0000000000..aa38c49fae --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> + +<panel + border="true" + follows="top|left" + height="300" + label="Environment" + layout="topleft" + help_topic="panel_region_environment_tab" + name="panel_env_info" + width="530"> + <text + name="water_settings_title" + follows="top|left" + height="30" + layout="topleft" + left="50" + top_pad="20" + width="430" + wrap="true"> + Select the Water and Sky/Day Cycle Settings you would like all visitors to your region to see. More info + </text> + <view_border + bevel_style="none" + follows="top|left" + height="237" + layout="topleft" + left="50" + name="border" + top="60" + width="430"/> + <radio_group + follows="top|left" + height="45" + layout="topleft" + left_delta="10" + name="region_settings_radio_group" + top_delta="20" + width="200"> + <radio_item + label="Use Second Life default" + layout="topleft" + name="use_sl_default_settings"/> + <radio_item + label="Use the following settings" + layout="topleft" + name="use_my_settings" + top_pad="20"/> + </radio_group> + <panel + follows="top|left" + height="150" + layout="topleft" + left="50" + name="user_environment_settings" + top_pad="20" + width="430"> + <text + name="water_settings_title" + follows="top|left" + height="16" + layout="topleft" + left="50" + top_pad="0" + width="160"> + Water Setting + </text> + <combo_box + follows="top|left" + left_pad="2" + name="water_settings_preset_combo" + top_delta="-7" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + <text + name="sky_dayc_settings_title" + follows="top|left" + height="16" + layout="topleft" + left="50" + top_pad="30" + width="100"> + Sky / Day Cycle + </text> + <radio_group + layout="topleft" + left_delta="50" + name="sky_dayc_settings_radio_group" + top_pad="10" + height="50" + width="110"> + <radio_item + layout="topleft" + label="Fixed sky" + name="my_sky_settings"/> + <radio_item + layout="topleft" + label="Day cycle" + name="my_dayc_settings" + top_pad="25"/> + </radio_group> + <combo_box + follows="top|left" + left_pad="2" + name="sky_settings_preset_combo" + top_delta="-7" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + <combo_box + follows="top|left" + name="dayc_settings_preset_combo" + top_delta="36" + width="200"> + <combo_box.item + label="-Select a preset-" + name="item0"/> + </combo_box> + </panel> + <button + follows="left|top" + height="23" + label="Apply" + layout="topleft" + right="-160" + name="apply_btn" + top_pad="10" + width="100" /> + <button + follows="left|top" + height="23" + label="Cancel" + layout="topleft" + left_pad="10" + name="cancel_btn" + width="100" /> + <loading_indicator + height="23" + left="50" + name="progress_indicator" + top_delta="0" + visible="false" + width="23" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_estate.xml b/indra/newview/skins/default/xui/en/panel_region_estate.xml index 1307d807e2..6b28639a77 100644 --- a/indra/newview/skins/default/xui/en/panel_region_estate.xml +++ b/indra/newview/skins/default/xui/en/panel_region_estate.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - border="false" + border="true" follows="top|left" height="510" help_topic="panel_region_estate_tab" @@ -20,7 +20,7 @@ name="estate_help_text" top="14" word_wrap="true" - width="300"> + > Changes to settings on this tab will affect all regions in the estate. </text> <text @@ -30,9 +30,10 @@ font="SansSerif" height="20" layout="topleft" - left_delta="0" + right="160" name="estate_text" top_pad="2" + halign="right" width="140"> Estate: </text> @@ -43,9 +44,9 @@ font="SansSerif" height="20" layout="topleft" - left_delta="0" + top_delta="0" name="estate_name" - top_delta="16" + left_pad="6" width="150"> (unknown) </text> @@ -56,9 +57,10 @@ font="SansSerif" height="20" layout="topleft" - left_delta="0" + right="160" name="owner_text" - top_pad="2" + top_pad="6" + halign="right" width="150"> Estate owner: </text> @@ -69,75 +71,68 @@ font="SansSerif" height="20" layout="topleft" - left_delta="0" + top_delta="0" name="estate_owner" - top_delta="16" + left_pad="6" use_ellipses="true" width="290"> (unknown) </text> + <view_border - bevel_style="in" + bevel_style="none" follows="top|left" - height="270" + height="95" layout="topleft" - left_delta="-4" + left="10" top_pad="5" - width="300" /> + width="470" /> + <check_box height="20" - label="Use Global Time" + label="Allow Public Access" layout="topleft" - left="12" - name="use_global_time_check" - top="132" + left="20" + name="externally_visible_check" + top_delta="5" width="200" /> + <check_box height="20" - label="Fixed Sun" - layout="topleft" - left="12" - name="fixed_sun_check" - top="152" - width="100" /> - <icon - height="20" - image_name="icon_day_cycle.tga" + label="Allow Voice Chat" layout="topleft" - left="47" - name="daycycle" - top="177" - width="165" /> - <slider - follows="left|top" - height="20" - increment="0.001" - label="Phase" - layout="topleft" - left="12" - max_val="30" - min_val="6" - name="sun_hour_slider" - show_text="false" - top="202" + left="280" + name="voice_chat_check" + top_delta="0" width="200" /> <check_box height="20" - label="Allow Public Access" + label="Allow Direct Teleport" layout="topleft" left_delta="0" - name="externally_visible_check" - top_pad="6" - width="200" /> + name="allow_direct_teleport" + top_pad="4" + width="80" /> + <button + enabled="false" + follows="left|top" + height="23" + label="Apply" + layout="topleft" + name="apply_btn" + top_pad="15" + left_delta="0" + width="97" /> + <text type="string" length="1" follows="top|left" height="16" layout="topleft" - left="32" + left="20" name="Only Allow" - top="250" + top_delta="-30" width="278"> Restrict Access to accounts verified by: </text> @@ -161,50 +156,6 @@ tool_tip="Ban Residents who have not verified their age. See the [SUPPORT_SITE] for more information." top_pad="2" width="278" /> - <check_box - height="20" - label="Allow Voice Chat" - layout="topleft" - left="12" - name="voice_chat_check" - top="304" - width="200" /> - <check_box - height="20" - label="Allow Direct Teleport" - layout="topleft" - left="12" - name="allow_direct_teleport" - top_pad="4" - width="80" /> - <button - enabled="false" - follows="left|top" - height="23" - label="Apply" - layout="topleft" - name="apply_btn" - top_pad="10" - left="110" - width="97" /> - <button - follows="left|top" - height="23" - label="Send Message To Estate..." - layout="topleft" - left="45" - name="message_estate_btn" - top_pad="20" - width="220" /> - <button - follows="left|top" - height="23" - label="Kick Resident from Estate..." - layout="topleft" - left="45" - name="kick_user_from_estate_btn" - top_pad="5" - width="220" /> <text type="string" @@ -214,16 +165,31 @@ height="20" layout="topleft" name="estate_manager_label" - right="520" + top_pad="30" + left="10" width="200"> Estate Managers: </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="280" + name="allow_resident_label" + top_delta="0" + width="200"> + Allowed Residents: + </text> + + <!-- Estate Managers box --> <view_border bevel_style="none" follows="top|left" height="71" layout="topleft" - right="520" + left="10" top_pad="-5" width="200" /> <name_list @@ -235,43 +201,15 @@ name="estate_manager_name_list" top_delta="0" width="200" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_estate_manager_btn" - right="520" - top_pad="5" - width="97" /> - <button - follows="left|top" - height="23" - label="Add..." - layout="topleft" - left_delta="-103" - name="add_estate_manager_btn" - top_delta="0" - width="97" /> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_delta="0" - name="allow_resident_label" - top_pad="10" - width="200"> - Allowed Residents: - </text> + + <!-- Allowed Residents box --> <view_border bevel_style="none" follows="top|left" height="71" layout="topleft" - right="520" - top_pad="-5" + left="280" + top_delta="0" width="200" /> <name_list follows="left|top" @@ -282,42 +220,78 @@ name="allowed_avatar_name_list" top_delta="0" width="200" /> + + <!-- Estate Managers buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_estate_manager_btn" + top_pad="6" + width="97" /> <button follows="left|top" height="23" label="Remove..." layout="topleft" - name="remove_allowed_avatar_btn" - right="520" - top_pad="5" + name="remove_estate_manager_btn" + left_pad="6" width="97" /> + + <!-- Allowed Residents buttons --> <button follows="left|top" height="23" + left="280" label="Add..." layout="topleft" - left_delta="-103" name="add_allowed_avatar_btn" top_delta="0" width="97" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_allowed_avatar_btn" + left_pad="6" + top_delta="0" + width="97" /> + <text type="string" length="1" follows="left|top" height="20" layout="topleft" - left_delta="0" + left="10" name="allow_group_label" top_pad="10" width="200"> Allowed Groups: </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="280" + name="ban_resident_label" + top_delta="0" + width="200"> + Banned Residents: + </text> + + <!-- Allowed Groups box --> <view_border bevel_style="none" follows="top|left" height="71" layout="topleft" - right="520" + left="10" top_pad="-5" width="200" /> <name_list @@ -329,43 +303,15 @@ name="allowed_group_name_list" top_delta="0" width="200" /> - <button - follows="left|top" - height="23" - label="Remove..." - layout="topleft" - name="remove_allowed_group_btn" - right="520" - top_pad="5" - width="97" /> - <button - follows="left|top" - height="23" - label="Add..." - layout="topleft" - left_delta="-103" - name="add_allowed_group_btn" - top_delta="0" - width="97" /> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_delta="0" - name="ban_resident_label" - top_pad="10" - width="200"> - Banned Residents: - </text> + + <!-- Banned Residents box --> <view_border bevel_style="none" follows="top|left" height="71" layout="topleft" - right="520" - top_pad="-5" + left="280" + top_delta="0" width="200" /> <name_list follows="left|top" @@ -376,22 +322,64 @@ name="banned_avatar_name_list" top_delta="0" width="200" /> + + <!-- Allowed Groups buttons --> + <button + follows="left|top" + height="23" + label="Add..." + layout="topleft" + left="10" + name="add_allowed_group_btn" + top_pad="6" + width="97" /> <button follows="left|top" height="23" label="Remove..." layout="topleft" - name="remove_banned_avatar_btn" - right="520" - top_pad="5" + name="remove_allowed_group_btn" + left_pad="6" + top_delta="0" width="97" /> + + <!-- Banned Residents buttons --> <button follows="left|top" height="23" label="Add..." layout="topleft" - left_delta="-103" + left="280" name="add_banned_avatar_btn" top_delta="0" width="97" /> + <button + follows="left|top" + height="23" + label="Remove..." + layout="topleft" + name="remove_banned_avatar_btn" + top_delta="0" + left_pad="6" + width="97" /> + + <button + follows="left|top" + height="23" + label="Send Message To Estate..." + layout="topleft" + left="10" + name="message_estate_btn" + top_pad="20" + width="220" /> + <button + follows="left|top" + height="23" + label="Kick Resident from Estate..." + layout="topleft" + left="280" + name="kick_user_from_estate_btn" + top_delta="0" + width="220" /> + </panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml index 5093c52129..bbb8b40594 100644 --- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml +++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml @@ -2,7 +2,7 @@ <panel border="true" follows="top|left" - height="320" + height="460" help_topic="panel_region_terrain_tab" label="Terrain" layout="topleft" @@ -50,10 +50,10 @@ label="Terrain Raise Limit" label_width="120" layout="topleft" - left="15" + left="240" max_val="100" name="terrain_raise_spin" - top="60" + top="40" width="180" /> <spinner follows="left|top" @@ -62,95 +62,336 @@ label="Terrain Lower Limit" label_width="120" layout="topleft" - left="15" + left="240" max_val="0" min_val="-100" name="terrain_lower_spin" - top="80" + top="60" width="180" /> - <check_box + <view_border + bevel_style="none" + follows="top|left" + height="60" + layout="topleft" + left="8" + top="30" + width="460" /> + <text + type="string" + length="1" + follows="left|top" height="20" - label="Use Estate Sun" layout="topleft" - left="250" - name="use_estate_sun_check" - top="35" + left="10" + name="detail_texture_text" + top="110" + width="300"> + Terrain Textures (requires 512x512, 24 bit .tga files) + </text> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_delta="0" + name="texture_detail_0" + top_delta="20" width="100" /> - <check_box - height="20" - label="Fixed Sun" + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_pad="10" + name="texture_detail_1" + top_delta="0" + width="100" /> + <texture_picker + follows="left|top" + height="100" + layout="topleft" + left_pad="10" + name="texture_detail_2" + top_delta="0" + width="100" /> + <texture_picker + follows="left|top" + height="100" layout="topleft" - left="250" - name="fixed_sun_check" - top="55" + left_pad="10" + name="texture_detail_3" + top_delta="0" width="100" /> - <icon + <text + type="string" + length="1" + follows="left|top" height="20" - image_name="icon_day_cycle.tga" layout="topleft" - left="285" - name="daycycle" - top="80" - width="165" /> - <slider + left="10" + name="height_text_lbl" + top_delta="90" + width="65"> + 1 (Low) + </text> + <text + type="string" + length="1" follows="left|top" height="20" - increment="0.001" - label="Phase" layout="topleft" - left="250" - max_val="30" - min_val="6" - name="sun_hour_slider" - show_text="false" - top="105" - width="200" /> - <button - enabled="false" + left_pad="45" + name="height_text_lbl2" + top_delta="0" + width="100"> + 2 + </text> + <text + type="string" + length="1" follows="left|top" height="20" - label="Apply" layout="topleft" - left="350" - name="apply_btn" - top="135" - width="90" /> - <view_border - bevel_style="none" - follows="top|left" - height="130" + left_pad="10" + name="height_text_lbl3" + top_delta="0" + width="100"> + 3 + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" layout="topleft" - left="8" - top="30" - width="460" /> + left_pad="10" + name="height_text_lbl4" + top_delta="0" + width="100"> + 4 (High) + </text> + <text + type="string" + length="1" + follows="left|top" + height="20" + layout="topleft" + left="10" + name="height_text_lbl5" + top_delta="30" + width="300"> + Texture Elevation Ranges + </text> + <text + follows="left|top" + height="20" + layout="topleft" + left="10" + name="height_text_lbl10" + top_delta="30" + width="200" + word_wrap="true"> + These values represent the blend range for the textures above. + </text> + <text + follows="left|top" + height="20" + layout="topleft" + left_delta="0" + name="height_text_lbl11" + top_delta="32" + width="200" + word_wrap="true"> + Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4. + </text> + <text + follows="left|top" + height="20" + layout="topleft" + left="270" + name="height_text_lbl6" + top="250" + width="100"> + Northwest + </text> + <text + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl7" + top_delta="0" + width="100"> + Northeast + </text> +<!-- northwest low--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left="230" + max_val="500" + min_val="-500" + name="height_start_spin_1" + top_delta="15" + width="100" /> +<!-- northeast low--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_start_spin_3" + top_delta="0" + width="100" /> +<!-- northwest high--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left="230" + max_val="500" + min_val="-500" + name="height_range_spin_1" + top_delta="20" + width="100" /> +<!-- northeast high--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_range_spin_3" + top_delta="0" + width="100" /> + <text + follows="left|top" + height="20" + layout="topleft" + left="270" + name="height_text_lbl8" + top_pad="10" + width="100"> + Southwest + </text> + <text + follows="left|top" + height="20" + layout="topleft" + left_pad="10" + name="height_text_lbl9" + top_delta="0" + width="100"> + Southeast + </text> +<!-- southwest low--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left="230" + max_val="500" + min_val="-500" + name="height_start_spin_0" + top_delta="15" + width="100" /> +<!-- southeast low--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="Low" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_start_spin_2" + top_delta="0" + width="100" /> +<!--southwest high--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left="230" + max_val="500" + min_val="-500" + name="height_range_spin_0" + top_delta="20" + width="100" /> +<!-- southeast high--> + <spinner + follows="left|top" + height="20" + increment="0.5" + label="High" + label_width="37" + layout="topleft" + left_pad="10" + max_val="500" + min_val="-500" + name="height_range_spin_2" + top_delta="0" + width="100" /> +<!-- Terrain Download/Upload/Bake buttons --> <button follows="left|top" height="20" label="Download RAW terrain..." layout="topleft" - left_delta="2" + left="10" name="download_raw_btn" tool_tip="Available only to estate owners, not managers" - top_pad="60" - width="170" /> + top="390" + width="160" /> <button follows="left|top" height="20" label="Upload RAW terrain..." layout="topleft" - left="10" + left_pad="10" + top_delta="0" name="upload_raw_btn" tool_tip="Available only to estate owners, not managers" - top="243" - width="170" /> + width="160" /> <button follows="left|top" height="20" label="Bake Terrain" layout="topleft" - left="10" + left_pad="10" name="bake_terrain_btn" tool_tip="Set current terrain as mid-point for raise/lower limits" - top="283" + width="100" /> + <button + enabled="true" + follows="left|top" + height="20" + label="Apply" + layout="topleft" + left_delta="0" + name="apply_btn" + top="430" width="100" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_region_texture.xml b/indra/newview/skins/default/xui/en/panel_region_texture.xml deleted file mode 100644 index 5d910ea659..0000000000 --- a/indra/newview/skins/default/xui/en/panel_region_texture.xml +++ /dev/null @@ -1,327 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel - border="true" - follows="top|left" - height="320" - help_topic="panel_region_texture_tab" - label="Ground Textures" - layout="topleft" - left="0" - name="Textures" - top="320" - width="480"> - <text - type="string" - length="1" - follows="left|top" - font="SansSerif" - height="20" - layout="topleft" - left="10" - name="region_text_lbl" - top="10" - width="100"> - Region: - </text> - <text - type="string" - length="1" - follows="left|top" - font="SansSerif" - height="20" - layout="topleft" - left_delta="50" - name="region_text" - top_delta="0" - width="400"> - unknown - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="10" - name="detail_texture_text" - top="36" - width="300"> - Terrain Textures (requires 512x512, 24 bit .tga files) - </text> - <texture_picker - follows="left|top" - height="100" - layout="topleft" - left_delta="0" - name="texture_detail_0" - top_delta="20" - width="100" /> - <texture_picker - follows="left|top" - height="100" - layout="topleft" - left_pad="10" - name="texture_detail_1" - top_delta="0" - width="100" /> - <texture_picker - follows="left|top" - height="100" - layout="topleft" - left_pad="10" - name="texture_detail_2" - top_delta="0" - width="100" /> - <texture_picker - follows="left|top" - height="100" - layout="topleft" - left_pad="10" - name="texture_detail_3" - top_delta="0" - width="100" /> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="10" - name="height_text_lbl" - top="146" - width="65"> - 1 (Low) - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_pad="45" - name="height_text_lbl2" - top_delta="0" - width="100"> - 2 - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_pad="10" - name="height_text_lbl3" - top_delta="0" - width="100"> - 3 - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left_pad="10" - name="height_text_lbl4" - top_delta="0" - width="100"> - 4 (High) - </text> - <text - type="string" - length="1" - follows="left|top" - height="20" - layout="topleft" - left="10" - name="height_text_lbl5" - top="170" - width="300"> - Texture Elevation Ranges - </text> - <text - follows="left|top" - height="20" - layout="topleft" - left="51" - name="height_text_lbl6" - top="185" - width="100"> - Northwest - </text> - <text - follows="left|top" - height="20" - layout="topleft" - left_pad="10" - name="height_text_lbl7" - top_delta="0" - width="100"> - Northeast - </text> -<!-- northwest low--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="Low" - label_width="37" - layout="topleft" - left="10" - max_val="500" - min_val="-500" - name="height_start_spin_1" - top_delta="15" - width="100" /> -<!-- northeast low--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="Low" - label_width="37" - layout="topleft" - left_pad="10" - max_val="500" - min_val="-500" - name="height_start_spin_3" - top_delta="0" - width="100" /> -<!-- northwest high--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="High" - label_width="37" - layout="topleft" - left="10" - max_val="500" - min_val="-500" - name="height_range_spin_1" - top_delta="20" - width="100" /> -<!-- northeast high--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="High" - label_width="37" - layout="topleft" - left_pad="10" - max_val="500" - min_val="-500" - name="height_range_spin_3" - top_delta="0" - width="100" /> - <text - follows="left|top" - height="20" - layout="topleft" - left="51" - name="height_text_lbl8" - top_pad="10" - width="100"> - Southwest - </text> - <text - follows="left|top" - height="20" - layout="topleft" - left_pad="10" - name="height_text_lbl9" - top_delta="0" - width="100"> - Southeast - </text> -<!-- southwest low--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="Low" - label_width="37" - layout="topleft" - left="10" - max_val="500" - min_val="-500" - name="height_start_spin_0" - top_delta="15" - width="100" /> -<!-- southeast low--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="Low" - label_width="37" - layout="topleft" - left_pad="10" - max_val="500" - min_val="-500" - name="height_start_spin_2" - top_delta="0" - width="100" /> -<!--southwest high--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="High" - label_width="37" - layout="topleft" - left="10" - max_val="500" - min_val="-500" - name="height_range_spin_0" - top_delta="20" - width="100" /> -<!-- southeast high--> - <spinner - follows="left|top" - height="20" - increment="0.5" - label="High" - label_width="37" - layout="topleft" - left_pad="10" - max_val="500" - min_val="-500" - name="height_range_spin_2" - top_delta="0" - width="100" /> - <text - follows="left|top" - height="20" - layout="topleft" - left="10" - name="height_text_lbl10" - top_delta="30" - width="400" - word_wrap="true"> - These values represent the blend range for the textures above. - </text> - <text - follows="left|top" - height="20" - layout="topleft" - left_delta="0" - name="height_text_lbl11" - top_delta="32" - width="400" - word_wrap="true"> - Measured in meters, the LOW value is the MAXIMUM height of Texture #1, and the HIGH value is the MINIMUM height of Texture #4. - </text> - <button - enabled="false" - follows="left|bottom" - height="20" - label="Apply" - layout="topleft" - left="350" - name="apply_btn" - top="290" - width="100" /> -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 6ef93406ec..0f330a7b98 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -142,6 +142,7 @@ mouse_opaque="false" background_visible="true" > + <badge location="top_left" location_percent_vcenter="50" location_percent_hcenter="95" /> <panel class="sidepanel_inventory" name="sidepanel_inventory" diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml index 30d3064e14..79f29777ce 100644 --- a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml @@ -88,6 +88,16 @@ visible="false" width="14" /> + <icon + follows="right|top" + height="13" + image_name="Parcel_SeeAVsOff_Light" + left="2" + name="see_avatars_icon" + top="3" + visible="false" + width="14" + /> <text follows="right|top" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 8997c1a6d7..79a0ec7c72 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -9,7 +9,7 @@ min_width="240" name="objects panel" width="333"> - <panel + <panel follows="all" layout="topleft" left="0" @@ -19,24 +19,226 @@ height="570" visible="true" width="330"> - <panel - class="panel_main_inventory" - filename="panel_main_inventory.xml" - follows="all" - layout="topleft" - left="0" - name="panel_main_inventory" - top="0" - label="" - height="545" - width="330" /> + <layout_stack + follows="left|right|top|bottom" + layout="topleft" + left="0" + top="0" + orientation="vertical" + name="inventory_layout_stack" + height="535" + width="330"> + <layout_panel + name="main_inventory_layout_panel" + min_dim="150" + width="330" + follows="bottom|left|right" + user_resize="false" + height="480"> + <panel + class="panel_main_inventory" + filename="panel_main_inventory.xml" + follows="all" + layout="topleft" + left="0" + name="panel_main_inventory" + top="0" + label="" + height="480" + width="330" /> + </layout_panel> + <layout_panel + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + name="inbox_layout_panel" + visible="false" + min_dim="35" + max_dim="200" + expanded_min_dim="90" + height="200"> + <panel + follows="all" + layout="topleft" + left="0" + name="marketplace_inbox" + class="panel_marketplace_inbox" + top="0" + label="" + height="200" + width="330"> + <string name="InboxLabelWithArg">Received Items ([NUM])</string> + <string name="InboxLabelNoArg">Received Items</string> + <button + label="Received Items" + name="inbox_btn" + height="35" + width="308" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + halign="left" + handle_right_mouse="false" + follows="top|left|right" + is_toggle="true" + tab_stop="false" + pad_left="35" + top="0" + left="10" /> + <text + type="string" + length="1" + follows="right|top" + layout="topleft" + height="13" + top="10" + right="-20" + name="inbox_fresh_new_count" + font="SansSerifMedium" + halign="right" + text_color="EmphasisColor" + top_pad="0" + width="300"> + [NUM] New + </text> + <panel + follows="all" + left="10" + bottom="200" + width="308" + top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" + tool_tip="Drag and drop items to your inventory to manage and use them" + > + <text + name="inbox_inventory_placeholder" + type="string" + follows="all" + layout="topleft" + top="0" + left="0" + width="308" + height="165" + wrap="true" + halign="center"> + Purchases from the marketplace will be delivered here. + </text> + </panel> + </panel> + </layout_panel> + <layout_panel + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + name="outbox_layout_panel" + visible="false" + min_dim="35" + max_dim="200" + expanded_min_dim="90" + height="200"> + <panel + follows="all" + layout="topleft" + left="10" + name="marketplace_outbox" + class="panel_marketplace_outbox" + top="0" + label="" + height="200" + width="310"> + <button + label="Merchant Outbox" + is_toggle="true" + handle_right_mouse="false" + name="outbox_btn" + follows="top|left|right" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + height="35" + tab_stop="false" + width="308" + halign="left" + pad_left="35" + top="0" + left="0" /> + <button + image_unselected="OutboxPush_Off" + image_selected="OutboxPush_Selected" + image_hover_selected="OutboxPush_Selected_Over" + image_hover_unselected="OutboxPush_Over" + image_disabled_selected="OutboxPush_Selected_Disabled" + image_disabled="OutboxPush_Disabled" + image_pressed="OutboxPush_Press" + image_pressed_selected="OutboxPush_Selected_Press" + label="" + tool_tip="Push to my Marketplace Storefront" + is_toggle="false" + name="outbox_sync_btn" + follows="top|right" + tab_stop="false" + halign="center" + top="6" + left="-50" + height="23" + width="32" + enabled="false" /> + <loading_indicator + follows="top|right" + name="outbox_sync_indicator" + top="6" + left="-50" + height="23" + width="32" + images_per_sec="1.15" + tab_stop="false" + visible="false"> + <images> + <image name="OutboxPush_Progress_1"/> + <image name="OutboxPush_Progress_2"/> + <image name="OutboxPush_Progress_3"/> + <image name="OutboxPush_Progress_4"/> + <image name="OutboxPush_Progress_5"/> + <image name="OutboxPush_Progress_6"/> + </images> + </loading_indicator> + <panel + follows="all" + left="10" + bottom="200" + width="308" + top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" + tool_tip="Drag and drop items here to prepare them for sale on your storefront" + > + <text + name="outbox_inventory_placeholder" + type="string" + follows="all" + layout="topleft" + top="0" + left="0" + width="308" + height="165" + wrap="true" + halign="center"> + Set up your merchant account to use this feature. + </text> + </panel> + </panel> + </layout_panel> + </layout_stack> <panel follows="bottom|left|right" - height="25" + height="30" layout="topleft" name="button_panel" left="9" - top_pad="-2" + top_pad="7" width="308"> <layout_stack follows="bottom|left|right" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 143a989d32..2e2ef6ee19 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1759,10 +1759,10 @@ integer llGetParcelMaxPrims(vector pos, integer sim_wide) Returns the maximum number of prims allowed on the parcel at pos </string> <string name="LSLTipText_llGetParcelDetails" translate="false"> -list llGetParcelDetails(vector pos, list params) -Returns the parcel details specified in params for the parcel at pos. -Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA - </string> + list llGetParcelDetails(vector pos, list params) + Returns the parcel details specified in params for the parcel at pos. + Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _SEE_AVATARS + </string> <string name="LSLTipText_llSetLinkPrimitiveParams" translate="false"> llSetLinkPrimitiveParams(integer linknumber, list rules) Sets primitive parameters for linknumber based on rules @@ -2021,6 +2021,8 @@ Returns a string with the requested data about the region <string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string> <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> <string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string> + <string name="InventoryInboxNoItems">Items purchased through the marketplace will be delivered here.</string> + <string name="InventoryOutboxNoItems">Drag items here in preparation for listing on your marketplace storefront.</string> <!-- use value="" because they have preceding spaces --> <string name="no_transfer" value=" (no transfer)" /> <string name="no_modify" value=" (no modify)" /> @@ -2355,6 +2357,10 @@ Returns a string with the requested data about the region <string name="GroupOwned">Group Owned</string> <string name="Public">Public</string> + <!-- Environment settings --> + <string name="LocalSettings">Local Settings</string> + <string name="RegionSettings">Region Settings</string> + <!-- panel classified --> <string name="ClassifiedClicksTxt">Clicks: [TELEPORT] teleport, [MAP] map, [PROFILE] profile</string> <string name="ClassifiedUpdateAfterPublish">(will update after publish)</string> @@ -3136,6 +3142,7 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="LocationCtrlAdultIconTooltip">Adult Region</string> <string name="LocationCtrlModerateIconTooltip">Moderate Region</string> <string name="LocationCtrlGeneralIconTooltip">General Region</string> + <string name="LocationCtrlSeeAVsTooltip">Avatars visible and chat allowed outside of this parcel</string> <!-- Strings used by the (currently Linux) auto-updater app --> <string name="UpdaterWindowTitle"> diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml new file mode 100644 index 0000000000..f77c4b7178 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- Additional attributes: + --> +<badge border_image="Badge_Border" + border_color="BadgeBorderColor" + font="SansSerifSmall" + image="Badge_Background" + image_color="BadgeImageColor" + label_color="BadgeLabelColor" + location="top_left" + location_percent_hcenter="85" + location_percent_vcenter="85" + padding_horiz="7" + padding_vert="4" + requests_front="true" + > +</badge> diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 16241ed84e..302014eb24 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -25,5 +25,6 @@ pad_bottom="3" height="23" scale_image="true" + handle_right_mouse="true" use_draw_context_alpha="true"> </button> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml new file mode 100644 index 0000000000..2c987b158d --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_folder_view_folder + folder_arrow_image="Folder_Arrow" + folder_indentation="8" + item_height="20" + item_top_pad="4" + selection_image="Rounded_Square" + > + <new_badge label="New" location="right" location_percent_hcenter="70" /> +</inbox_folder_view_folder> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml new file mode 100644 index 0000000000..830c27bdac --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_inventory_panel show_load_status="false" /> diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml index 93875d66e6..00f4c43915 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml @@ -3,4 +3,12 @@ bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" - /> + show_load_status="true" + > + <scroll + name="Inventory Scroller" + follows="all" + reserve_scroll_corner="true" + tab_stop="true" + /> +</panel> diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 37d60f1671..44436fb6f2 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -123,6 +123,14 @@ font="SansSerifSmall" text_color="TextFgColor" /> + <see_avatars_icon + name="see_avatars_icon" + width="22" + height="18" + top="21" + follows="right|top" + image_name="Parcel_SeeAVsOff_Light" + /> <combo_button name="Location History" label="" diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 9bf99fa363..47a210d9b7 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -10,4 +10,5 @@ bg_alpha_image_overlay="White" background_visible="false" background_opaque="false" - chrome="false"/>
\ No newline at end of file + chrome="false" + accepts_badge="true"/>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/time.xml b/indra/newview/skins/default/xui/en/widgets/time.xml new file mode 100644 index 0000000000..b5bdd564a6 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/time.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<time text_enabled_color="LabelTextColor" + text_disabled_color="LabelDisabledColor" + font="SansSerifSmall" + label_width="40" > + <time.up_button name="SpinCtrl Up" + image_unselected="Stepper_Up_Off" + image_selected="Stepper_Up_Press" + tab_stop="false" + follows="left|bottom" /> + <time.down_button name="SpinCtrl Down" + image_unselected="Stepper_Down_Off" + image_selected="Stepper_Down_Press" + tab_stop="false" + follows="left|bottom" /> +</time> diff --git a/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml deleted file mode 100644 index 9c3ac1be0e..0000000000 --- a/indra/newview/skins/default/xui/es/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="EDITOR DEL CICLO DE UN DÍA"> - <tab_container name="Day Cycle Tabs"> - <panel label="Ciclo de un día" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 12 am - </text> - <text name="WL3am"> - 3 am - </text> - <text name="WL6am"> - 6 am - </text> - <text name="WL9amHash"> - 9 am - </text> - <text name="WL12pmHash"> - 12 pm - </text> - <text name="WL3pm"> - 3 pm - </text> - <text name="WL6pm"> - 6 pm - </text> - <text name="WL9pm"> - 9 pm - </text> - <text name="WL12am2"> - 12 am - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Añadir un punto" label_selected="Añadir un punto" name="WLAddKey"/> - <button label="Quitar un punto" label_selected="Quitar un punto" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Configuración del fotograma clave: - </text> - <text name="WLCurKeyTimeText"> - Hora clave: - </text> - <spinner label="Hora" name="WLCurKeyHour"/> - <spinner label="Min." name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Modelo predefinido: - </text> - <combo_box label="Predefinido" name="WLKeyPresets"/> - <text name="DayCycleText"> - Intervalo: - </text> - <combo_box label="5 min." name="WLSnapOptions"/> - <text name="DayCycleText2"> - Duración del ciclo: - </text> - <spinner label="Hora" name="WLLengthOfDayHour"/> - <spinner label="Min." name="WLLengthOfDayMin"/> - <spinner label="Seg." name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Vista previa: - </text> - <button label="Probar" label_selected="Probar" name="WLAnimSky"/> - <button label="Parar" label_selected="Parar" name="WLStopAnimSky"/> - <button label="Usar el horario del estado" label_selected="Ir al horario del estado" name="WLUseLindenTime"/> - <button label="Guardar este tipo de día" label_selected="Guardar este tipo de día" name="WLSaveDayCycle"/> - <button label="Cargar y probar un tipo de día" label_selected="Cargar y probar un tipo de día" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/es/floater_env_settings.xml b/indra/newview/skins/default/xui/es/floater_env_settings.xml deleted file mode 100644 index 195690f546..0000000000 --- a/indra/newview/skins/default/xui/es/floater_env_settings.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="EDITOR DEL ENTORNO"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Duración de -un día - </text> - <text name="EnvTimeText2"> - 12:00 PM - </text> - <text name="EnvCloudText"> - Nubosidad - </text> - <text name="EnvWaterColorText"> - Color del -agua - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Pulsa para abrir el selector de color"/> - <text name="EnvWaterFogText"> - Claridad del -agua - </text> - <button bottom="-144" label="Usar el horario del estado" name="EnvUseEstateTimeButton" width="155"/> - <button label="Cielo avanzado" left="167" name="EnvAdvancedSkyButton" width="155"/> - <button label="Agua avanzada" left="326" name="EnvAdvancedWaterButton" width="155"/> -</floater> diff --git a/indra/newview/skins/default/xui/es/floater_water.xml b/indra/newview/skins/default/xui/es/floater_water.xml deleted file mode 100644 index 2c1f6cfbfb..0000000000 --- a/indra/newview/skins/default/xui/es/floater_water.xml +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="EDITOR AVANZADO DEL AGUA"> - <text name="KeyFramePresetsText"> - Agua predefinida: - </text> - <button label="Nueva" label_selected="Nueva" name="WaterNewPreset"/> - <button label="Guardar" label_selected="Guardar" name="WaterSavePreset"/> - <button label="Borrar" label_selected="Borrar" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="CONFIGURACIÓN" name="Settings"> - <text name="BHText"> - Color del agua - </text> - <button label="?" left="175" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Pulsa para abrir el selector de color"/> - <text name="WaterFogDensText"> - Transparencia - </text> - <button label="?" left="175" name="WaterFogDensityHelp"/> - <text name="WaterUnderWaterFogModText"> - Modificar la claridad del agua - </text> - <button label="?" left="175" name="WaterUnderWaterFogModHelp"/> - <text name="BDensText"> - Tamaño de las ondulaciones - </text> - <button label="?" left="405" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <text name="HDText"> - Escala de Fresnel - </text> - <button label="?" left="405" name="WaterFresnelScaleHelp"/> - <text name="FresnelOffsetText"> - Coeficiente de reflexión - </text> - <button label="?" left="405" name="WaterFresnelOffsetHelp"/> - <text name="DensMultText"> - Refracción de la superficie - </text> - <button label="?" left="640" name="WaterScaleAboveHelp"/> - <text name="WaterScaleBelowText"> - Refracción bajo la superficie - </text> - <button label="?" left="640" name="WaterScaleBelowHelp"/> - <text name="MaxAltText"> - Desenfoque - </text> - <button label="?" left="640" name="WaterBlurMultiplierHelp"/> - </panel> - <panel label="IMAGEN" name="Waves"> - <text name="BHText"> - Sentido de la onda grande - </text> - <button label="?" left="170" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Sentido de la onda pequeña - </text> - <button label="?" left="170" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Vista Normal - </text> - <button label="?" name="WaterNormalMapHelp"/> - </panel> - </tab_container> - <string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </string> -</floater> diff --git a/indra/newview/skins/default/xui/es/floater_windlight_options.xml b/indra/newview/skins/default/xui/es/floater_windlight_options.xml deleted file mode 100644 index 585a42e429..0000000000 --- a/indra/newview/skins/default/xui/es/floater_windlight_options.xml +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="EDITOR AVANZADO DEL CIELO"> - <text name="KeyFramePresetsText"> - Cielos definidos: - </text> - <button label="Nuevo" label_selected="Nuevo" name="WLNewPreset"/> - <button label="Guardar" label_selected="Guardar" name="WLSavePreset"/> - <button label="Borrar" label_selected="Borrar" name="WLDeletePreset"/> - <button font="SansSerifSmall" label="Editor del ciclo de un día" label_selected="Editor del ciclo de un día" left_delta="90" name="WLDayCycleMenuButton" width="150"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMÓSFERA" name="Atmosphere"> - <text name="BHText"> - Coloración - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - V - </text> - <text name="BHText4"> - A - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Cantidad de bruma - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Saturación - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - V - </text> - <text name="BHText8"> - A - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Densidad de la bruma - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Densidad - </text> - <button label="?" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Distancia - </text> - <button label="?" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Altitud máx. - </text> - <button label="?" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="LUZ" name="Lighting"> - <text name="SLCText"> - Color del Sol y de la Luna - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - V - </text> - <text name="BHText3"> - A - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Posición del Sol y la Luna - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Ambiental - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - V - </text> - <text name="BHText7"> - A - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Ángulo de elevación - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Resplandor del Sol - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Visión" name="WLGlowB"/> - <slider label="Tamaño" name="WLGlowR"/> - <text name="SceneGammaText"> - Gamma de la escena - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Brillo de las estrellas - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="NUBES" name="Clouds"> - <text name="WLCloudColorText"> - Color de las nubes - </text> - <button label="?" left="190" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - V - </text> - <text name="BHText3"> - A - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Posición/Densidad de las nubes - </text> - <button label="?" left="190" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Nubosidad - </text> - <button label="?" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Altitud de las nubes - </text> - <button label="?" name="WLCloudScaleHelp"/> - <text font="SansSerifSmall" name="WLCloudDetailText"> - Detalle de las nubes (Posición/Densidad) - </text> - <button label="?" name="WLCloudDetailHelp"/> - <text bottom="-113" name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <slider bottom="-127" name="WLCloudDetailX"/> - <text name="WLCloudScrollXText"> - Velocidad de X - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Bloquear" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Velocidad de Y - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Bloquear" name="WLCloudLockY"/> - <check_box label="Incluir nubes clásicas" name="DrawClassicClouds"/> - <button label="?" left="618" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/es/panel_edit_pick.xml b/indra/newview/skins/default/xui/es/panel_edit_pick.xml index 9b101ee4ba..cda465da9c 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Guardar" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Cancelar" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/fr/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/fr/floater_day_cycle_options.xml deleted file mode 100644 index 0ce17b9dc6..0000000000 --- a/indra/newview/skins/default/xui/fr/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="EDITEUR DU CYCLE DU JOUR"> - <tab_container name="Day Cycle Tabs"> - <panel label="Cycle du jour" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - Min. - </text> - <text name="WL3am"> - 3h - </text> - <text name="WL6am"> - 6h - </text> - <text name="WL9amHash"> - 9h - </text> - <text name="WL12pmHash"> - Midi - </text> - <text name="WL3pm"> - 15h - </text> - <text name="WL6pm"> - 18h - </text> - <text name="WL9pm"> - 21h - </text> - <text name="WL12am2"> - Min. - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Ajouter clé" label_selected="Ajouter clé" name="WLAddKey"/> - <button label="Supprimer clé" label_selected="Supprimer clé" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Réglages des images-clés : - </text> - <text name="WLCurKeyTimeText"> - Heure de la clé : - </text> - <spinner label="Heure" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Préréglages clés : - </text> - <combo_box label="Préréglage" name="WLKeyPresets"/> - <text name="DayCycleText"> - Snap : - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Durée du cycle : - </text> - <spinner label="Heure" name="WLLengthOfDayHour"/> - <spinner label="Min" name="WLLengthOfDayMin"/> - <spinner label="Sec" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Aperçu : - </text> - <button label="Lire" label_selected="Lire" name="WLAnimSky"/> - <button label="Arrêter" label_selected="Stop" name="WLStopAnimSky"/> - <button label="Utiliser heure domaine" label_selected="Aller heure domaine" name="WLUseLindenTime"/> - <button label="Enregistrer jour test" label_selected="Enregistrer jour test" name="WLSaveDayCycle"/> - <button label="Charger jour test" label_selected="Charger jour test" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/fr/floater_env_settings.xml b/indra/newview/skins/default/xui/fr/floater_env_settings.xml deleted file mode 100644 index dd714e85b6..0000000000 --- a/indra/newview/skins/default/xui/fr/floater_env_settings.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="ÉDITEUR D'ENVIRONNEMENT"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text bottom="-45" name="EnvTimeText" top="29"> - Heure de la -journée - </text> - <text bottom_delta="-36" name="EnvTimeText2"> - Midi - </text> - <text name="EnvCloudText"> - Couverture -nuageuse - </text> - <text bottom="-45" name="EnvWaterColorText" top="29"> - Couleur de -l'eau - </text> - <color_swatch name="EnvWaterColor" tool_tip="Cliquez pour ouvrir le sélecteur de couleurs"/> - <text name="EnvWaterFogText"> - Brouillard -dans l'eau - </text> - <button bottom="-144" label="Utiliser heure du domaine" name="EnvUseEstateTimeButton" width="152"/> - <button label="Ciel avancé" left="162" name="EnvAdvancedSkyButton" width="145"/> - <button label="Eau avancée" left="316" name="EnvAdvancedWaterButton" width="145"/> -</floater> diff --git a/indra/newview/skins/default/xui/fr/floater_water.xml b/indra/newview/skins/default/xui/fr/floater_water.xml deleted file mode 100644 index 7d1e3cd65c..0000000000 --- a/indra/newview/skins/default/xui/fr/floater_water.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="ÉDITEUR D'EAU AVANCÉ"> - <floater.string name="WLDefaultWaterNames"> - Valeur par défaut:Transparente:Bassin:Trouble:Première plaie:SERPENT !!!:Valdez - </floater.string> - <text name="KeyFramePresetsText" width="120"> - Préréglages : - </text> - <button label="Nouveau" label_selected="Nouveau" name="WaterNewPreset"/> - <button label="Enregistrer" label_selected="Enregistrer" left_delta="75" name="WaterSavePreset" width="75"/> - <button label="Supprimer" label_selected="Supprimer" left_delta="80" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="PARAMÈTRES" name="Settings"> - <text name="BHText"> - Couleur du brouillard dans l'eau - </text> - <color_swatch left="75" name="WaterFogColor" tool_tip="Cliquez pour ouvrir le sélecteur de couleurs"/> - <text name="WaterFogDensText"> - Densité du brouillard - </text> - <text name="WaterUnderWaterFogModText"> - Brouillard sous-marin - </text> - <text name="BDensText"> - Échelle des vaguelettes - </text> - <slider label="1" name="WaterNormalScaleX"/> - <slider label="2" name="WaterNormalScaleY"/> - <slider label="3" name="WaterNormalScaleZ"/> - <text name="HDText"> - Échelle Fresnel - </text> - <text name="FresnelOffsetText"> - Décalage Fresnel - </text> - <text name="DensMultText"> - Réfraction au-dessus - </text> - <text name="WaterScaleBelowText"> - Réfraction en dessous - </text> - <text name="MaxAltText"> - Multiplicateur de flou - </text> - </panel> - <panel label="IMAGE" name="Waves"> - <text name="BHText"> - Direction grande vague - </text> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Direction petite vague - </text> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Normal Map - </text> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/fr/floater_windlight_options.xml b/indra/newview/skins/default/xui/fr/floater_windlight_options.xml deleted file mode 100644 index 657e5f5051..0000000000 --- a/indra/newview/skins/default/xui/fr/floater_windlight_options.xml +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="ÉDITEUR DE CIEL AVANCÉ" width="706"> - <text name="KeyFramePresetsText"> - Préréglages : - </text> - <button label="Nouveau" label_selected="Nouveau" name="WLNewPreset"/> - <button label="Enregistrer" label_selected="Enregistrer" left_delta="75" name="WLSavePreset" width="75"/> - <button label="Supprimer" label_selected="Supprimer" left_delta="80" name="WLDeletePreset"/> - <button label="Éditeur du cycle du jour" label_selected="Éditeur du cycle du jour" left_delta="95" left_pad="20" name="WLDayCycleMenuButton" width="150"/> - <tab_container name="WindLight Tabs" width="706"> - <panel label="ATMOSPHÈRE" name="Atmosphere"> - <text name="BHText"> - Bleu de l'horizon - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - V - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Quantité de brume - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Densité du bleu - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - V - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Densité de la brume - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Multiplicateur de densité - </text> - <button label="?" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Multiplicateur de distance - </text> - <button label="?" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Altitude maximum - </text> - <button label="?" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="LUMIÈRE" name="Lighting"> - <text name="SLCText"> - Couleur soleil/lune - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - V - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Position soleil/lune - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Éclairage ambiant - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - V - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Angle du levant - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Rayonnement du soleil - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Netteté " name="WLGlowB"/> - <slider label="Taille " name="WLGlowR"/> - <text name="SceneGammaText"> - Gamma de la scène - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Éclat des étoiles - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="NUAGES" name="Clouds"> - <text name="WLCloudColorText"> - Couleur des nuages - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - V - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Nuages XY/densité - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Couverture nuageuse - </text> - <button label="?" left="407" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Altitude des nuages - </text> - <button label="?" left="407" name="WLCloudScaleHelp"/> - <text name="WLCloudDetailText"> - Détails nuages (XY/densité) - </text> - <button bottom_delta="-2" label="?" left="407" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Direction et vitesse X - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Verrouiller" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Direction et vitesse Y - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Verrouiller" name="WLCloudLockY"/> - <check_box label="Nuages classiques" name="DrawClassicClouds"/> - <button label="?" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-Minuit:A-Midi:A-3h:A-15h:A-16h30:A-6h:A-18h:A-9h:A-21h:Barcelone:Blizzard:Bleu mi-journée:Après-midi sur la côte:Coucher de soleil (côte):Valeur par défaut:Coucher de soleil (désert):Belle journée:Gros nuages floconneux:Brumeux:Funky Funky:Funky Funky Funky:Gelatto:Fantôme:Vérités incohérentes:Mi-journée 1:Mi-journée 2:Mi-journée 3:Mi-journée 4:Nuit:Pirate:Mauve:Rêve de navigateur:Sensualité pure - </string> -</floater> diff --git a/indra/newview/skins/default/xui/fr/panel_edit_pick.xml b/indra/newview/skins/default/xui/fr/panel_edit_pick.xml index 2364d9bbb2..247e18da82 100644 --- a/indra/newview/skins/default/xui/fr/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/fr/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Enregistrer" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Annuler" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml deleted file mode 100644 index 98c385d29f..0000000000 --- a/indra/newview/skins/default/xui/it/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="EDITOR DELLE CICLO GIORNO/NOTTE"> - <tab_container name="Day Cycle Tabs"> - <panel label="Ciclo giorno/notte" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 0:00 - </text> - <text name="WL3am"> - 3:00 - </text> - <text name="WL6am"> - 6:00 - </text> - <text name="WL9amHash"> - 9:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 24:00 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Aggiungi voce" label_selected="Aggiungi voce" name="WLAddKey"/> - <button label_selected="Cancella voce" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Impostazioni del fotogramma chiave: - </text> - <text name="WLCurKeyTimeText"> - Tempo: - </text> - <spinner label="Ora" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Impostazione chiave: - </text> - <combo_box label="Programma:" name="WLKeyPresets"/> - <text name="DayCycleText"> - Raggruppa: - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Lunghezza del ciclo: - </text> - <spinner label="Ore" name="WLLengthOfDayHour"/> - <spinner label="Min" name="WLLengthOfDayMin"/> - <spinner label="Sec" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Anteprima: - </text> - <button label="Avvia" label_selected="Avvia" name="WLAnimSky"/> - <button label="Arresta!" label_selected="Arresta" name="WLStopAnimSky"/> - <button label="Usa l'ora della proprietà" label_selected="Vai all'ora della proprietà" name="WLUseLindenTime"/> - <button label="Salva il test del giorno" label_selected="Salva il test del giorno" name="WLSaveDayCycle"/> - <button label="Carica il test del giorno" label_selected="Carica il test del giorno" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/it/floater_env_settings.xml b/indra/newview/skins/default/xui/it/floater_env_settings.xml deleted file mode 100644 index 1c17c18e84..0000000000 --- a/indra/newview/skins/default/xui/it/floater_env_settings.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="EDITOR DELL'AMBIENTE"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Ora del -giorno - </text> - <text name="EnvTimeText2"> - 12:00 PM - </text> - <text name="EnvCloudText"> - Intensità delle -Nuvole - </text> - <text name="EnvWaterColorText"> - Colore -dell'Acqua - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Clicca per aprire il selettore dei colori"/> - <text name="EnvWaterFogText"> - Nebbiosità -dell'acqua - </text> - <button bottom="-144" label="Usa orario della regione" name="EnvUseEstateTimeButton" width="145"/> - <button label="Cielo avanzato" name="EnvAdvancedSkyButton"/> - <button label="Acqua avanzata" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/it/floater_water.xml b/indra/newview/skins/default/xui/it/floater_water.xml deleted file mode 100644 index b25f0a6266..0000000000 --- a/indra/newview/skins/default/xui/it/floater_water.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="EDITOR AVANZATO DELL'ACQUA"> - <text name="KeyFramePresetsText" width="245"> - Impostazioni predeterminate dell'acqua: - </text> - <combo_box left_delta="245" name="WaterPresetsCombo" width="150"/> - <button label="Nuovo" label_selected="Nuovo" name="WaterNewPreset"/> - <button label="Salva" label_selected="Salva" name="WaterSavePreset"/> - <button label="Cancella" label_selected="Cancella" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="IMPOSTAZIONI" name="Settings"> - <text name="BHText"> - Colore della nebbiosità dell'acqua - </text> - <button label="?" left="209" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Clicca per aprire il selettore dei colori"/> - <text font="SansSerifSmall" name="WaterFogDensText"> - Esponente di densità della nebbia - dell'acqua - </text> - <slider bottom_delta="-40" name="WaterFogDensity"/> - <button label="?" left="209" name="WaterFogDensityHelp"/> - <text bottom="-140" font="SansSerifSmall" name="WaterUnderWaterFogModText"> - Regolatore effetto nebbia subacquea - </text> - <button label="?" left="209" name="WaterUnderWaterFogModHelp"/> - <text name="BDensText"> - Scala di riflessione delle onde - </text> - <button label="?" left="415" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <text name="HDText"> - Scala Fresnel - </text> - <button label="?" left="415" name="WaterFresnelScaleHelp"/> - <text name="FresnelOffsetText"> - Offset Fresnel - </text> - <button label="?" left="415" name="WaterFresnelOffsetHelp"/> - <text font="SansSerifSmall" name="DensMultText"> - Scala di rifrazione nell'acqua - dall'alto - </text> - <slider bottom_delta="-40" name="WaterScaleAbove"/> - <button label="?" left="650" name="WaterScaleAboveHelp"/> - <text bottom="-70" font="SansSerifSmall" name="WaterScaleBelowText"> - Scala di rifrazione nell'acqua - dal basso - </text> - <slider bottom_delta="-40" name="WaterScaleBelow"/> - <button label="?" left="650" name="WaterScaleBelowHelp"/> - <text bottom="-122" name="MaxAltText"> - Moltiplicatore della sfocatura - </text> - <button label="?" left="650" name="WaterBlurMultiplierHelp"/> - </panel> - <panel label="IMMAGINE" name="Waves"> - <text name="BHText"> - Direzione della grande onda - </text> - <button label="?" left="170" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Direzione della piccola onda - </text> - <button label="?" left="170" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Mappatura normale - </text> - <button label="?" name="WaterNormalMapHelp"/> - </panel> - </tab_container> - <string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </string> -</floater> diff --git a/indra/newview/skins/default/xui/it/floater_windlight_options.xml b/indra/newview/skins/default/xui/it/floater_windlight_options.xml deleted file mode 100644 index 6828d05be0..0000000000 --- a/indra/newview/skins/default/xui/it/floater_windlight_options.xml +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="EDITOR AVANZATO DEL CIELO"> - <text name="KeyFramePresetsText" width="105"> - Cieli predefiniti: - </text> - <combo_box left_delta="105" name="WLPresetsCombo"/> - <button label="Nuovo" label_selected="Nuovo" name="WLNewPreset"/> - <button label="Salva" label_selected="Salva" left_delta="72" name="WLSavePreset"/> - <button label="Elimina" label_selected="Elimina" left_delta="72" name="WLDeletePreset"/> - <button font="SansSerifSmall" label="Editor del ciclo giorno/notte" label_selected="Editor del ciclo giorno/notte" left_delta="85" name="WLDayCycleMenuButton" width="165"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSFERA" name="Atmosphere"> - <text name="BHText"> - Blu dell'Orizzonte - </text> - <button label="?" left="189" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text font="SansSerifSmall" name="BDensText"> - Altezza della Foschia all'Orizzonte - </text> - <button label="?" left="189" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Densità del Blu - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Densità della Foschia - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Moltiplicatore di Densità - </text> - <button label="?" left="645" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Moltiplicatore della Distanza - </text> - <button label="?" left="645" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Altitudine Massima - </text> - <button label="?" left="645" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="ILLUMINAZIONE" name="Lighting"> - <text name="SLCText"> - Colore Sole/Luna - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Posizione Sole/Luna - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Ambiente - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Angolo Est - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Corona intorno al sole - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Focus" name="WLGlowB"/> - <slider label="Grandezza" name="WLGlowR"/> - <text name="SceneGammaText"> - Gamma della Scena - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Luminosità delle stelle - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="NUVOLE" name="Clouds"> - <text name="WLCloudColorText"> - Colore delle Nuvole - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Nuvole XY/Densità - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Copertura delle Nuvole - </text> - <button label="?" left="415" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Altitudine delle Nuvole - </text> - <button label="?" left="415" name="WLCloudScaleHelp"/> - <text name="WLCloudDetailText"> - Dettagli Nuvole (XY/ Densità) - </text> - <button label="?" left="415" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Scorrimento delle X - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Blocca" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Scorrimento delle Y - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Blocca" name="WLCloudLockY"/> - <check_box label="Mostra le Nuvole Classiche" name="DrawClassicClouds"/> - <button label="?" left="645" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/it/panel_edit_pick.xml b/indra/newview/skins/default/xui/it/panel_edit_pick.xml index 8e464ca037..145b8cf4e3 100644 --- a/indra/newview/skins/default/xui/it/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/it/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Salva luogo preferito" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Annulla" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/ja/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/ja/floater_day_cycle_options.xml deleted file mode 100644 index b0949cd4e0..0000000000 --- a/indra/newview/skins/default/xui/ja/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="デイサイクル編集"> - <tab_container name="Day Cycle Tabs"> - <panel label="デイサイクル" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 深夜 12時 - </text> - <text name="WL3am"> - 午前 3時 - </text> - <text name="WL6am"> - 午前 6時 - </text> - <text name="WL9amHash"> - 午前 9時 - </text> - <text name="WL12pmHash"> - 正午 12時 - </text> - <text name="WL3pm"> - 午後 3時 - </text> - <text name="WL6pm"> - 午後 6時 - </text> - <text name="WL9pm"> - 午後 9時 - </text> - <text name="WL12am2"> - 深夜 12時 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="キーの追加" label_selected="キーの追加" name="WLAddKey"/> - <button label="キーの削除" label_selected="キーの削除" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - キーフレームの設定: - </text> - <text name="WLCurKeyTimeText"> - キータイム: - </text> - <spinner label="時間" name="WLCurKeyHour"/> - <spinner label="分" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - キーの事前設定: - </text> - <combo_box label="事前設定" name="WLKeyPresets"/> - <text name="DayCycleText"> - スナップ: - </text> - <combo_box label="5 分" name="WLSnapOptions"/> - <text name="DayCycleText2"> - サイクルの長さ: - </text> - <spinner label="時間" name="WLLengthOfDayHour"/> - <spinner label="分" name="WLLengthOfDayMin"/> - <spinner label="秒" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - プレビュー: - </text> - <button label="再生" label_selected="再生" name="WLAnimSky"/> - <button label="停止" label_selected="停止" name="WLStopAnimSky"/> - <button label="不動産の時刻を使用" label_selected="不動産の時刻に変更" name="WLUseLindenTime"/> - <button label="デイテストを保存" label_selected="デイテストを保存" name="WLSaveDayCycle"/> - <button label="デイテストをロード" label_selected="デイテストをロード" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_env_settings.xml b/indra/newview/skins/default/xui/ja/floater_env_settings.xml deleted file mode 100644 index 1d5f26a6eb..0000000000 --- a/indra/newview/skins/default/xui/ja/floater_env_settings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="自然環境エディター"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - 時刻 - </text> - <text name="EnvTimeText2"> - 正午 12:00 - </text> - <text name="EnvCloudText"> - 雲の量 - </text> - <text name="EnvWaterColorText"> - 水の色 - </text> - <color_swatch name="EnvWaterColor" tool_tip="クリックしてカラーピッカーを開きます"/> - <text name="EnvWaterFogText"> - 水中照度 - </text> - <button label="不動産の時刻を使用" name="EnvUseEstateTimeButton"/> - <button label="空の高度な設定" name="EnvAdvancedSkyButton"/> - <button label="水の高度な設定" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_water.xml b/indra/newview/skins/default/xui/ja/floater_water.xml deleted file mode 100644 index fb64332e79..0000000000 --- a/indra/newview/skins/default/xui/ja/floater_water.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="水の高度な編集"> - <floater.string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </floater.string> - <text name="KeyFramePresetsText"> - 水の事前設定: - </text> - <button label="新規" label_selected="新規" name="WaterNewPreset"/> - <button label="保存" label_selected="保存" name="WaterSavePreset"/> - <button label="削除" label_selected="削除" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="設定" name="Settings"> - <text name="BHText"> - 水中のフォグ効果の色 - </text> - <color_swatch name="WaterFogColor" tool_tip="クリックしてカラーピッカーを開きます"/> - <text name="WaterFogDensText"> - 水中の透明度指数 - </text> - <text name="WaterUnderWaterFogModText"> - 水中のフォグ効果加減 - </text> - <text name="BDensText"> - さざ波の反射スケール - </text> - <slider label="1" name="WaterNormalScaleX"/> - <slider label="2" name="WaterNormalScaleY"/> - <slider label="3" name="WaterNormalScaleZ"/> - <text name="HDText"> - フレネルのスケール - </text> - <text name="FresnelOffsetText"> - フレネルのオフセット - </text> - <text name="DensMultText"> - 水面の屈折スケール - </text> - <text name="WaterScaleBelowText"> - 水中の屈折スケール - </text> - <text name="MaxAltText"> - 不透明度の増幅 - </text> - </panel> - <panel label="画像" name="Waves"> - <text name="BHText"> - 大波の方向 - </text> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - 小波の方向 - </text> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - ノーマルマップ - </text> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/ja/floater_windlight_options.xml b/indra/newview/skins/default/xui/ja/floater_windlight_options.xml deleted file mode 100644 index feb94ef73e..0000000000 --- a/indra/newview/skins/default/xui/ja/floater_windlight_options.xml +++ /dev/null @@ -1,189 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="空の高度な編集"> - <text name="KeyFramePresetsText"> - 空の事前設定: - </text> - <button label="新規" label_selected="新規" name="WLNewPreset"/> - <button label="保存" label_selected="保存" name="WLSavePreset"/> - <button label="削除" label_selected="削除" name="WLDeletePreset"/> - <button label="デイサイクル編集" label_selected="デイサイクル編集" name="WLDayCycleMenuButton"/> - <tab_container name="WindLight Tabs"> - <panel label="大気" name="Atmosphere"> - <text name="BHText"> - 空の配色 - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - 空と遠景の露光 - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - 空の配色と濃度 - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - 大気の不透明度 - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - 大気の不透明度の増幅 - </text> - <button label="?" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - 視界の増幅 - </text> - <button label="?" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - 最大高度 - </text> - <button label="?" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="ライティング" name="Lighting"> - <text name="SLCText"> - 太陽/月の色 - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - 太陽/月の位置 - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - アンビエント - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - 東の角度 - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - 太陽の輝き - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="フォーカス " name="WLGlowB"/> - <slider label="サイズ " name="WLGlowR"/> - <text name="SceneGammaText"> - 風景ガンマ - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - 星の輝き - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="雲" name="Clouds"> - <text name="WLCloudColorText"> - 雲の色 - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - 雲の XY/密度 - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - 雲の量 - </text> - <button label="?" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - 雲のスケール - </text> - <button label="?" name="WLCloudScaleHelp"/> - <text name="WLCloudDetailText"> - 雲の詳細 (XY/密度) - </text> - <button label="?" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - 雲の移動速度 (X 方向) - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="ロック" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - 雲の移動速度 (Y 方向) - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="ロック" name="WLCloudLockY"/> - <check_box label="従来の雲を描画" name="DrawClassicClouds"/> - <button label="?" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/ja/panel_edit_pick.xml b/indra/newview/skins/default/xui/ja/panel_edit_pick.xml index 4fb031b677..39ea1df1e3 100644 --- a/indra/newview/skins/default/xui/ja/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/ja/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="ピックを保存" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="取り消し" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/nl/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/nl/floater_day_cycle_options.xml deleted file mode 100644 index 1f3e045a75..0000000000 --- a/indra/newview/skins/default/xui/nl/floater_day_cycle_options.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="DAGCYCLUS EDITOR"> - <tab_container name="Day Cycle Tabs"> - <panel label="Dagcyclus" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 0:00 - </text> - <text name="WL3am"> - 3:00 - </text> - <text name="WL6am"> - 6:00 - </text> - <text name="WL9amHash"> - 9:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 0:00 - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Key toevoegen" label_selected="Key toevoegen" name="WLAddKey"/> - <button label="Key verwijderen" label_selected="Key verwijderen" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Gemarkeerde frame instelling: - </text> - <text name="WLCurKeyTimeText"> - Markering tijd: - </text> - <spinner label="Uur" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Markering voorinstelling: - </text> - <combo_box label="Voorinstelling" name="WLKeyPresets"/> - <text name="DayCycleText"> - Snap: - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Lengte van cyclus: - </text> - <spinner label="Uur" name="WLLengthOfDayHour"/> - <spinner label="Min" name="WLLengthOfDayMin"/> - <spinner label="Sec" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Voorbeeld: - </text> - <button label="Afspelen" label_selected="Afspelen" name="WLAnimSky"/> - <button label="Stop!" label_selected="Stop" name="WLStopAnimSky"/> - <button label="Gebruik estatetijd" label_selected="Ga naar Estate tijd" name="WLUseLindenTime"/> - <button label="Opslaan testdag" label_selected="Opslaan testdag" name="WLSaveDayCycle"/> - <button label="Laad testdag" label_selected="Laad testdag" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/nl/floater_env_settings.xml b/indra/newview/skins/default/xui/nl/floater_env_settings.xml deleted file mode 100644 index 3c207040d2..0000000000 --- a/indra/newview/skins/default/xui/nl/floater_env_settings.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="OMGEVING EDITOR"> - <text bottom="-42" name="EnvTimeText"> - Tijd van de -dag - </text> - <text bottom_delta="-36" name="EnvTimeText2"> - 0:00 - </text> - <text name="EnvCloudText"> - Wolkendek - </text> - <text name="EnvWaterColorText"> - Waterkleur - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Klik om de kleurkiezer te openen"/> - <text name="EnvWaterFogText"> - Watermist - </text> - <button label="Gebruik estate tijd" name="EnvUseEstateTimeButton"/> - <button label="Geavanceerde lucht" name="EnvAdvancedSkyButton"/> - <button label="Geavanceerd water" name="EnvAdvancedWaterButton"/> - <button label="?" name="EnvSettingsHelpButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/nl/floater_water.xml b/indra/newview/skins/default/xui/nl/floater_water.xml deleted file mode 100644 index 1fb1ca241b..0000000000 --- a/indra/newview/skins/default/xui/nl/floater_water.xml +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="GEAVANCEERDE WATER EDITOR"> - <combo_box bottom="-50" height="18" left_delta="116" name="WaterPresetsCombo" width="150" /> - <text name="KeyFramePresetsText"> - Watervoorinstellingen - </text> - <button label="Nieuw" label_selected="Nieuw" name="WaterNewPreset" left_delta="190"/> - <button label="Opslaan" label_selected="Opslaan" name="WaterSavePreset"/> - <button label="Verwijderen" label_selected="Verwijderen" name="WaterDeletePreset" width="80"/> - <tab_container name="Water Tabs"> - <panel label="Instellingen" name="Settings"> - <text name="BHText"> - Watermistkleur - </text> - <button label="?" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Klik om de kleurkiezer te openen"/> - <text name="WaterFogDensText"> - Mistdichtheidsexponent - </text> - <button label="?" name="WaterFogDensityHelp"/> - <text name="WaterUnderWaterFogModText"> - Onderwatermist wijziger - </text> - <button label="?" name="WaterUnderWaterFogModHelp"/> - <text name="BDensText"> - Reflectie wavelet schaal - </text> - <button label="?" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <text name="HDText"> - Fresnelschaal - </text> - <button label="?" name="WaterFresnelScaleHelp"/> - <text name="FresnelOffsetText"> - Fresnelverplaatsing - </text> - <button label="?" name="WaterFresnelOffsetHelp"/> - <text name="DensMultText"> - Refractieschaal boven - </text> - <button label="?" name="WaterScaleAboveHelp"/> - <text name="WaterScaleBelowText"> - Refractieschaal onder - </text> - <button label="?" name="WaterScaleBelowHelp"/> - <text name="MaxAltText"> - Wazigheidvermeerderaar - </text> - <button label="?" name="WaterBlurMultiplierHelp"/> - </panel> - <panel label="Afbeelding" name="Waves"> - <text name="BHText"> - Grote golven richting - </text> - <button label="?" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Kleine golf richting - </text> - <button label="?" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Normaalmap - </text> - <button label="?" name="WaterNormalMapHelp"/> - </panel> - </tab_container> - <string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </string> -</floater> diff --git a/indra/newview/skins/default/xui/nl/floater_windlight_options.xml b/indra/newview/skins/default/xui/nl/floater_windlight_options.xml deleted file mode 100644 index b26dd7916e..0000000000 --- a/indra/newview/skins/default/xui/nl/floater_windlight_options.xml +++ /dev/null @@ -1,190 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="GEAVANCEERDE LUCHT EDITOR"> - <combo_box allow_text_entry="false" follows="left|top" mouse_opaque="true" name="WLPresetsCombo"/> - <text name="KeyFramePresetsText"> - Lucht voorinstellingen - </text> - <button label="Nieuw" label_selected="Nieuw" name="WLNewPreset"/> - <button label="Opslaan" label_selected="Opslaan" name="WLSavePreset"/> - <button label="Verwijderen" label_selected="Verwijderen" name="WLDeletePreset"/> - <button label="Dag cyclus editor" label_selected="Dag cyclus editor" name="WLDayCycleMenuButton"/> - <tab_container name="WindLight Tabs"> - <panel label="Atmosfeer" name="Atmosphere"> - <text name="BHText"> - Blauw Horizon - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Nevel horizon - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Blauw dichtheid - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Nevel dichtheid - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Dichtheidsfactor - </text> - <button label="?" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Afstandsfactor - </text> - <button label="?" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Max hoogte - </text> - <button label="?" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="Licht" name="Lighting"> - <text name="SLCText"> - Zon/maan kleur - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Zon/maan positie - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Omgeving - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Oosthoek - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Zonnegloed - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Focus " name="WLGlowB"/> - <slider label="Grootte" name="WLGlowR"/> - <text name="SceneGammaText"> - Scenegamma - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Ster helderheid - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="Wolken" name="Clouds"> - <text name="WLCloudColorText"> - Wolkenkleur - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Wolken (XY/Dichtheid) - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Wolkenbedekking - </text> - <button label="?" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Wolkenschaal - </text> - <button label="?" name="WLCloudScaleHelp"/> - <text name="WLCloudDetailText"> - Wolkendetail (XY/Dichtheid) - </text> - <button label="?" name="WLCloudDetailHelp" left="404"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Wolk verplaatsing X - </text> - <button label="?" name="WLCloudScrollXHelp" left="600"/> - <check_box label="Vastzetten" name="WLCloudLockX" left="622"/> - <text name="WLCloudScrollYText"> - Wolk verplaatsing Y - </text> - <button label="?" name="WLCloudScrollYHelp" left="600"/> - <check_box label="Vastzetten" name="WLCloudLockY" left="622"/> - <check_box label="Teken klassieke wolken" name="DrawClassicClouds"/> - <button label="?" name="WLClassicCloudsHelp" left="620"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/pl/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/pl/floater_day_cycle_options.xml deleted file mode 100644 index f3929df3e3..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_day_cycle_options.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="EDYTOR CYKLU DNIA"> - <tab_container name="Day Cycle Tabs"> - <panel label="Cykl dnia" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <multi_slider label="" name="WLTimeSlider"/> - <multi_slider label="" name="WLDayCycleKeys"/> - <text name="WL12am"> - 12am - </text> - <text name="WL3am"> - 3am - </text> - <text name="WL6am"> - 6am - </text> - <text name="WL9amHash"> - 9am - </text> - <text name="WL12pmHash"> - 12pm - </text> - <text name="WL3pm"> - 3pm - </text> - <text name="WL6pm"> - 6pm - </text> - <text name="WL9pm"> - 9pm - </text> - <text name="WL12am2"> - 12am - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Dodaj" label_selected="Dodaj" name="WLAddKey"/> - <button label="Usuń" label_selected="Usuń" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Preferencje czasu: - </text> - <text name="WLCurKeyTimeText"> - Czas: - </text> - <spinner label="Godz" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Ustawienia: - </text> - <combo_box label="Preset" name="WLKeyPresets"/> - <text name="DayCycleText"> - Przerwij: - </text> - <combo_box label="5 min" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Długość cyklu: - </text> - <spinner label="Godz" name="WLLengthOfDayHour"/> - <spinner label="Min" name="WLLengthOfDayMin"/> - <spinner label="Sek" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Przeglądaj: - </text> - <button label="Start" label_selected="Start" name="WLAnimSky"/> - <button label="Stop" label_selected="Stop" name="WLStopAnimSky"/> - <button label="Używaj czasu regionu" label_selected="Używaj czasu regionu" name="WLUseLindenTime"/> - <button label="Zapisz test dnia" label_selected="Zapisz test dnia" name="WLSaveDayCycle"/> - <button label="Załaduj test dnia" label_selected="Załaduj test dnia" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/pl/floater_env_settings.xml b/indra/newview/skins/default/xui/pl/floater_env_settings.xml deleted file mode 100644 index 3ab854fbbb..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_env_settings.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="EDYTOR ŚRODOWISKA"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Czas - </text> - <text name="EnvTimeText2"> - 12:00 PM - </text> - <slider label="" name="EnvTimeSlider"/> - <text name="EnvCloudText"> - Chmury: - </text> - <slider label="" name="EnvCloudSlider"/> - <text name="EnvWaterColorText"> - Kolor wody - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Kliknij aby wybrać kolor"/> - <text name="EnvWaterFogText"> - Zamglenie: - </text> - <slider label="" name="EnvWaterFogSlider"/> - <button label="Używaj czasu regionu" name="EnvUseEstateTimeButton"/> - <button label="Zaawansowane niebo" name="EnvAdvancedSkyButton"/> - <button label="Zaawansowana woda" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/pl/floater_water.xml b/indra/newview/skins/default/xui/pl/floater_water.xml deleted file mode 100644 index 9720dae516..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_water.xml +++ /dev/null @@ -1,103 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="ZAAWANSOWANY EDYTOR WODY"> - <text name="KeyFramePresetsText"> - Ustawienia wody: - </text> - <button label="Nowe" label_selected="Nowe" name="WaterNewPreset"/> - <button label="Zapisz" label_selected="Zapisz" name="WaterSavePreset"/> - <button label="Usuń" label_selected="Usuń" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="USTAWIENIA" name="Settings"> - <text name="BHText"> - Kolor podwodnej mgły - </text> - <button label="?" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Kliknij aby wybrać kolor"/> - <text name="WaterFogDensText"> - Wykładnik gęstości mgły - </text> - <button label="?" name="WaterFogDensityHelp"/> - <slider label="" name="WaterFogDensity"/> - <text name="WaterUnderWaterFogModText"> - Modyfikator mgły - </text> - <button label="?" name="WaterUnderWaterFogModHelp"/> - <slider label="" name="WaterUnderWaterFogMod"/> - <text name="BDensText"> - Skala zmarszczeń - </text> - <button label="?" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <slider label="" name="WaterNormalScaleX"/> - <slider label="" name="WaterNormalScaleY"/> - <slider label="" name="WaterNormalScaleZ"/> - <text name="HDText"> - Skala Fresnela - </text> - <button label="?" name="WaterFresnelScaleHelp"/> - <slider label="" name="WaterFresnelScale"/> - <text name="FresnelOffsetText"> - Przesunięcie Fresnela - </text> - <button label="?" name="WaterFresnelOffsetHelp"/> - <slider label="" name="WaterFresnelOffset"/> - <text name="DensMultText"> - Górna refrakcja - </text> - <button label="?" name="WaterScaleAboveHelp"/> - <slider label="" name="WaterScaleAbove"/> - <text name="WaterScaleBelowText"> - Dolna refrakcja - </text> - <button label="?" name="WaterScaleBelowHelp"/> - <slider label="" name="WaterScaleBelow"/> - <text name="MaxAltText"> - Mnożnik rozmycia - </text> - <button label="?" name="WaterBlurMultiplierHelp"/> - <slider label="" name="WaterBlurMult"/> - </panel> - <panel label="OBRAZ" name="Waves"> - <text name="BHText"> - Kierunek dużych fal - </text> - <button label="?" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <slider label="" name="WaterWave1DirX"/> - <slider label="" name="WaterWave1DirY"/> - <text name="BHText2"> - Kierunek małych fal - </text> - <button label="?" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <slider label="" name="WaterWave2DirX"/> - <slider label="" name="WaterWave2DirY"/> - <text name="BHText3"> - Mapa normalnych - </text> - <button label="?" name="WaterNormalMapHelp"/> - <texture_picker label="" name="WaterNormalMap"/> - </panel> - </tab_container> - <string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </string> -</floater> diff --git a/indra/newview/skins/default/xui/pl/floater_windlight_options.xml b/indra/newview/skins/default/xui/pl/floater_windlight_options.xml deleted file mode 100644 index 930e904464..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_windlight_options.xml +++ /dev/null @@ -1,228 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="ZAAWANSOWANY EDYTOR NIEBA"> - <text name="KeyFramePresetsText"> - Ustawienia nieba: - </text> - <button label="Nowe" label_selected="Nowe" name="WLNewPreset"/> - <button label="Zapisz" label_selected="Zapisz" name="WLSavePreset"/> - <button label="Usuń" label_selected="Usuń" name="WLDeletePreset"/> - <button label="Edytor cyklu dnia" label_selected="Edytor cyklu dnia" name="WLDayCycleMenuButton"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSFERA" name="Atmosphere"> - <text name="BHText"> - Horyzont błękitu - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <slider label="" name="WLBlueHorizonR"/> - <slider label="" name="WLBlueHorizonG"/> - <slider label="" name="WLBlueHorizonB"/> - <slider label="" name="WLBlueHorizonI"/> - <text name="BDensText"> - Horyzont zamglenia - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <slider label="" name="WLHazeHorizon"/> - <text name="BDensText2"> - Gęstość błękitu - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <slider label="" name="WLBlueDensityR"/> - <slider label="" name="WLBlueDensityG"/> - <slider label="" name="WLBlueDensityB"/> - <slider label="" name="WLBlueDensityI"/> - <text name="HDText"> - Gęstość zamglenia - </text> - <button label="?" name="WLHazeDensityHelp"/> - <slider label="" name="WLHazeDensity"/> - <text name="DensMultText"> - Mnożnik gęsości - </text> - <button label="?" name="WLDensityMultHelp"/> - <slider label="" name="WLDensityMult"/> - <text name="WLDistanceMultText"> - Mnożnik dystansu - </text> - <button label="?" name="WLDistanceMultHelp"/> - <slider label="" name="WLDistanceMult"/> - <text name="MaxAltText"> - Max wysokość - </text> - <button label="?" name="WLMaxAltitudeHelp"/> - <slider label="" name="WLMaxAltitude"/> - </panel> - <panel label="ŚWIATŁO" name="Lighting"> - <text name="SLCText"> - Kolor Słońca/Księżyca - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <slider label="" name="WLSunlightR"/> - <slider label="" name="WLSunlightG"/> - <slider label="" name="WLSunlightB"/> - <slider label="" name="WLSunlightI"/> - <text name="TODText"> - Pozycja Słońca/Księżyca - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <slider label="" name="WLSunAngle"/> - <text name="WLAmbientText"> - Otoczenie - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <slider label="" name="WLAmbientR"/> - <slider label="" name="WLAmbientG"/> - <slider label="" name="WLAmbientB"/> - <slider label="" name="WLAmbientI"/> - <text name="WLEastAngleText"> - Pozycja wschodu - </text> - <button label="?" name="WLEastAngleHelp"/> - <slider label="" name="WLEastAngle"/> - <text name="SunGlowText"> - Blask Słońca - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Ostrość" name="WLGlowB"/> - <slider label="Rozmiar" name="WLGlowR"/> - <text name="SceneGammaText"> - Jasność obrazu - </text> - <button label="?" name="WLSceneGammaHelp"/> - <slider label="" name="WLGamma"/> - <text name="WLStarText"> - Blask gwiazd - </text> - <button label="?" name="WLStarBrightnessHelp"/> - <slider label="" name="WLStarAlpha"/> - </panel> - <panel label="CHMURY" name="Clouds"> - <text name="WLCloudColorText"> - Kolor chmur - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <slider label="" name="WLCloudColorR"/> - <slider label="" name="WLCloudColorG"/> - <slider label="" name="WLCloudColorB"/> - <slider label="" name="WLCloudColorI"/> - <text name="WLCloudColorText2"> - Chmury (XY/Gęstość) - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - G - </text> - <slider label="" name="WLCloudX"/> - <slider label="" name="WLCloudY"/> - <slider label="" name="WLCloudDensity"/> - <text name="WLCloudCoverageText"> - Pokrycie chmur - </text> - <button label="?" name="WLCloudCoverageHelp"/> - <slider label="" name="WLCloudCoverage"/> - <text name="WLCloudScaleText"> - Skala chmur - </text> - <button label="?" name="WLCloudScaleHelp"/> - <slider label="" name="WLCloudScale"/> - <text name="WLCloudDetailText"> - Szczegóły (XY/gęstość) - </text> - <button label="?" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - G - </text> - <slider label="" name="WLCloudDetailX"/> - <slider label="" name="WLCloudDetailY"/> - <slider label="" name="WLCloudDetailDensity"/> - <text name="WLCloudScrollXText"> - Przewijanie chmur X - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Zablokuj" name="WLCloudLockX"/> - <slider label="" name="WLCloudScrollX"/> - <text name="WLCloudScrollYText"> - Przewijanie chmur Y - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Zablokuj" name="WLCloudLockY"/> - <slider label="" name="WLCloudScrollY"/> - <check_box label="Klasyczne chmury" name="DrawClassicClouds"/> - <button label="?" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> - <string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </string> -</floater> diff --git a/indra/newview/skins/default/xui/pl/panel_edit_pick.xml b/indra/newview/skins/default/xui/pl/panel_edit_pick.xml index 8a183c00cf..72c162f63d 100644 --- a/indra/newview/skins/default/xui/pl/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/pl/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Zapisz obrazek" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Cofnij" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml deleted file mode 100644 index 9560a3b418..0000000000 --- a/indra/newview/skins/default/xui/pt/floater_day_cycle_options.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="EDITOR DE CICLO DE DIA"> - <tab_container name="Day Cycle Tabs"> - <panel label="Ciclo do dia" name="Day Cycle"> - <button label="?" name="WLDayCycleHelp"/> - <text name="WL12am"> - 0:00 - </text> - <text name="WL3am"> - 3:00 - </text> - <text name="WL6am"> - 6:00 - </text> - <text name="WL9amHash"> - 9:00 - </text> - <text name="WL12pmHash"> - 12:00 - </text> - <text name="WL3pm"> - 15:00 - </text> - <text name="WL6pm"> - 18:00 - </text> - <text name="WL9pm"> - 21:00 - </text> - <text name="WL12am2"> - 24:00 - </text> - <button label="Adicionar chave" label_selected="Adicionar chave" name="WLAddKey"/> - <button label="Apagar chave" label_selected="Apagar chave" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Configurações de Quadro-chave: - </text> - <text name="WLCurKeyTimeText"> - Tempo-chave: - </text> - <spinner label="Hora" name="WLCurKeyHour"/> - <spinner label="Minutos" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Ajuste-chave: - </text> - <combo_box label="Ajuste" name="WLKeyPresets"/> - <text name="DayCycleText"> - Grudar: - </text> - <combo_box label="5 minutos" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Duração do Ciclo: - </text> - <spinner label="Hora" name="WLLengthOfDayHour"/> - <spinner label="Min." name="WLLengthOfDayMin"/> - <spinner label="Seg." name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - Visualizar - </text> - <button label="Tocar" label_selected="Tocar" name="WLAnimSky"/> - <button label="Pare!" label_selected="Pare" name="WLStopAnimSky"/> - <button label="Usar o horário da Propriedade" label_selected="Ir para o horário da Propriedade" name="WLUseLindenTime"/> - <button label="Salvar o Dia teste" label_selected="Salvar o Dia teste" name="WLSaveDayCycle"/> - <button label="Carregar o Dia teste" label_selected="Carregar o Dia teste" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/pt/floater_env_settings.xml b/indra/newview/skins/default/xui/pt/floater_env_settings.xml deleted file mode 100644 index 3ca8d934c9..0000000000 --- a/indra/newview/skins/default/xui/pt/floater_env_settings.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="EDITOR DO AMBIENTE"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Hora do Dia - </text> - <text name="EnvTimeText2"> - 12:00 PM - </text> - <text name="EnvCloudText"> - Cobertura de -Nuvens - </text> - <text name="EnvWaterColorText"> - Cor da água - </text> - <color_swatch label="" name="EnvWaterColor" tool_tip="Selecionar a cor"/> - <text name="EnvWaterFogText"> - Névoa da -água - </text> - <button bottom="-144" label="Usar hora da propriedade" name="EnvUseEstateTimeButton" width="155"/> - <button label="Céu Avançado" left="167" name="EnvAdvancedSkyButton" width="155"/> - <button label="Água Avançada" left="326" name="EnvAdvancedWaterButton" width="155"/> -</floater> diff --git a/indra/newview/skins/default/xui/pt/floater_water.xml b/indra/newview/skins/default/xui/pt/floater_water.xml deleted file mode 100644 index b2a06f4ff2..0000000000 --- a/indra/newview/skins/default/xui/pt/floater_water.xml +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="EDITOR DE ÁGUA AVANÇADO"> - <text name="KeyFramePresetsText" width="175"> - Pré-configurações da Água: - </text> - <combo_box left_delta="175" name="WaterPresetsCombo" width="150"/> - <button label="Novo" label_selected="Novo" name="WaterNewPreset"/> - <button label="Salvar" label_selected="Salvar" name="WaterSavePreset"/> - <button label="Deletar" label_selected="Deletar" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="DEFINIÇÕES" name="Settings"> - <text name="BHText"> - Cor da névoa da Água - </text> - <button label="?" name="WaterFogColorHelp"/> - <color_swatch label="" name="WaterFogColor" tool_tip="Selecionar a cor"/> - <text name="WaterFogDensText"> - Expoente da Densidade de névoa - </text> - <button label="?" left="209" name="WaterFogDensityHelp"/> - <text name="WaterUnderWaterFogModText"> - Modificador da névoa Subaquática - </text> - <button label="?" left="209" name="WaterUnderWaterFogModHelp"/> - <text name="BDensText"> - Escala da Marola de Reflexão - </text> - <button label="?" left="415" name="WaterNormalScaleHelp"/> - <text name="BHText2"> - 1 - </text> - <text name="BHText3"> - 2 - </text> - <text name="BHText4"> - 3 - </text> - <text name="HDText"> - Escala de Fresnel - </text> - <button label="?" left="415" name="WaterFresnelScaleHelp"/> - <text name="FresnelOffsetText"> - Deslocamento de Fresnel - </text> - <button label="?" left="415" name="WaterFresnelOffsetHelp"/> - <text name="DensMultText"> - Refratar a Escala para Cima - </text> - <button label="?" left="640" name="WaterScaleAboveHelp"/> - <text name="WaterScaleBelowText"> - Refratar a Escala para Baixo - </text> - <button label="?" left="640" name="WaterScaleBelowHelp"/> - <text name="MaxAltText"> - Multiplicador de Difusão - </text> - <button label="?" left="640" name="WaterBlurMultiplierHelp"/> - </panel> - <panel label="IMAGEM" name="Waves"> - <text name="BHText"> - Direção da Onda Maior - </text> - <button label="?" left="170" name="WaterWave1Help"/> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Direção da Onda Pequena - </text> - <button label="?" left="170" name="WaterWave2Help"/> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - Mapa Normal - </text> - <button label="?" name="WaterNormalMapHelp"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/pt/floater_windlight_options.xml b/indra/newview/skins/default/xui/pt/floater_windlight_options.xml deleted file mode 100644 index ec459bbb26..0000000000 --- a/indra/newview/skins/default/xui/pt/floater_windlight_options.xml +++ /dev/null @@ -1,187 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="EDITOR DE CÉU AVANÇADO"> - <text name="KeyFramePresetsText" width="140"> - Pré-definições de Céu: - </text> - <combo_box left_delta="140" name="WLPresetsCombo"/> - <button label="Novo" label_selected="Novo" name="WLNewPreset"/> - <button label="Salvar" label_selected="Salvar" left_delta="72" name="WLSavePreset"/> - <button label="Deletar" label_selected="Deletar" left_delta="72" name="WLDeletePreset"/> - <button label="Editor de Ciclos do Dia" label_selected="Editor de Ciclos do Dia" left_delta="84" name="WLDayCycleMenuButton" width="150"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSFERA" name="Atmosphere"> - <text name="BHText"> - Horizonte Azul - </text> - <button label="?" name="WLBlueHorizonHelp"/> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Horizonte da Neblina - </text> - <button label="?" name="WLHazeHorizonHelp"/> - <text name="BDensText2"> - Densidade de Azul - </text> - <button label="?" name="WLBlueDensityHelp"/> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Densidade da Neblina - </text> - <button label="?" name="WLHazeDensityHelp"/> - <text name="DensMultText"> - Multiplicador de Densidade - </text> - <button label="?" left="635" name="WLDensityMultHelp"/> - <text name="WLDistanceMultText"> - Multiplicador de Distância - </text> - <button label="?" left="635" name="WLDistanceMultHelp"/> - <text name="MaxAltText"> - Altitude Máxima - </text> - <button label="?" left="635" name="WLMaxAltitudeHelp"/> - </panel> - <panel label="ILUMINAÇÃO" name="Lighting"> - <text name="SLCText"> - Cor do Sol/Lua - </text> - <button label="?" name="WLSunlightColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Posição do Sol/Lua - </text> - <button label="?" name="WLTimeOfDayHelp"/> - <text name="WLAmbientText"> - Ambiente - </text> - <button label="?" name="WLAmbientHelp"/> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - Ângulo Leste - </text> - <button label="?" name="WLEastAngleHelp"/> - <text name="SunGlowText"> - Brilho do Sol - </text> - <button label="?" name="WLSunGlowHelp"/> - <slider label="Foco" name="WLGlowB"/> - <slider label="Tamanho" name="WLGlowR"/> - <text name="SceneGammaText"> - Gamma da Cena - </text> - <button label="?" name="WLSceneGammaHelp"/> - <text name="WLStarText"> - Brilho da Estrela - </text> - <button label="?" name="WLStarBrightnessHelp"/> - </panel> - <panel label="NUVENS" name="Clouds"> - <text name="WLCloudColorText"> - Cor da Nuvem - </text> - <button label="?" name="WLCloudColorHelp"/> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Densidade/ XY da Nuvem - </text> - <button label="?" name="WLCloudDensityHelp"/> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Cobertura da Nuvem - </text> - <button label="?" name="WLCloudCoverageHelp"/> - <text name="WLCloudScaleText"> - Escala da Nuvem - </text> - <button label="?" name="WLCloudScaleHelp"/> - <text font="SansSerifSmall" name="WLCloudDetailText"> - Detalhe da Nuvem (XY/Densidade) - </text> - <button label="?" left="421" name="WLCloudDetailHelp"/> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Rolagem X da Nuvem - </text> - <button label="?" name="WLCloudScrollXHelp"/> - <check_box label="Travar" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Rolagem Y da Nuvem - </text> - <button label="?" name="WLCloudScrollYHelp"/> - <check_box label="Travar" name="WLCloudLockY"/> - <check_box label="Desenhar Nuvens Clássicas" name="DrawClassicClouds"/> - <button label="?" left="645" name="WLClassicCloudsHelp"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/pt/panel_edit_pick.xml b/indra/newview/skins/default/xui/pt/panel_edit_pick.xml index 432affcf09..5eb9987e71 100644 --- a/indra/newview/skins/default/xui/pt/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/pt/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="Salvar destaque" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="Cancelar" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml deleted file mode 100644 index 28d2ba6ed4..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_day_cycle_options.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Day Cycle Floater" title="日循環編輯器"> - <tab_container name="Day Cycle Tabs"> - <panel label="日循環" name="Day Cycle"> - <multi_slider initial_value="0" name="WLTimeSlider"/> - <multi_slider initial_value="0" name="WLDayCycleKeys"/> - <text name="WL12am"> - 12am - </text> - <text name="WL3am"> - 3am - </text> - <text name="WL6am"> - 6am - </text> - <text name="WL9amHash"> - 9am - </text> - <text name="WL12pmHash"> - 12pm - </text> - <text name="WL3pm"> - 3pm - </text> - <text name="WL6pm"> - 6pm - </text> - <text name="WL9pm"> - 9pm - </text> - <text name="WL12am2"> - 12am - </text> - <text name="WL12amHash"> - | - </text> - <text name="WL3amHash"> - I - </text> - <text name="WL6amHash"> - | - </text> - <text name="WL9amHash2"> - I - </text> - <text name="WL12pmHash2"> - | - </text> - <text name="WL3pmHash"> - I - </text> - <text name="WL6pmHash"> - | - </text> - <text name="WL9pmHash"> - I - </text> - <text name="WL12amHash2"> - | - </text> - <button label="Add Key" label_selected="Add Key" name="WLAddKey"/> - <button label="Delete Key" label_selected="Delete Key" name="WLDeleteKey"/> - <text name="WLCurKeyFrameText"> - Key Frame Settings: - </text> - <text name="WLCurKeyTimeText"> - Key Time: - </text> - <spinner label="Hour" name="WLCurKeyHour"/> - <spinner label="Min" name="WLCurKeyMin"/> - <text name="WLCurKeyTimeText2"> - Key Preset: - </text> - <combo_box label="Preset" name="WLKeyPresets"/> - <text name="DayCycleText"> - Snap: - </text> - <combo_box label="五分鐘" name="WLSnapOptions"/> - <text name="DayCycleText2"> - Length of Cycle: - </text> - <spinner label="小時" name="WLLengthOfDayHour"/> - <spinner label="分" name="WLLengthOfDayMin"/> - <spinner label="秒" name="WLLengthOfDaySec"/> - <text name="DayCycleText3"> - 預覽: - </text> - <button label="Play" label_selected="Play" name="WLAnimSky"/> - <button label="停止!" label_selected="停止" name="WLStopAnimSky"/> - <button label="Use Estate Time" label_selected="Go to Estate Time" name="WLUseLindenTime"/> - <button label="Save Test Day" label_selected="Save Test Day" name="WLSaveDayCycle"/> - <button label="Load Test Day" label_selected="Load Test Day" name="WLLoadDayCycle"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_env_settings.xml b/indra/newview/skins/default/xui/zh/floater_env_settings.xml deleted file mode 100644 index 65a97f0cff..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_env_settings.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Environment Editor Floater" title="ENVIRONMENT EDITOR"> - <floater.string name="timeStr"> - [hour12,datetime,utc]:[min,datetime,utc] [ampm,datetime,utc] - </floater.string> - <text name="EnvTimeText"> - Time of Day - </text> - <text name="EnvTimeText2"> - 12:00 PM - </text> - <text name="EnvCloudText"> - Cloud Cover - </text> - <text name="EnvWaterColorText"> - Water Color - </text> - <color_swatch name="EnvWaterColor" tool_tip="Click to open color picker"/> - <text name="EnvWaterFogText"> - Water Fog - </text> - <button label="Use Estate Time" name="EnvUseEstateTimeButton"/> - <button label="Advanced Sky" name="EnvAdvancedSkyButton"/> - <button label="Advanced Water" name="EnvAdvancedWaterButton"/> -</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_water.xml b/indra/newview/skins/default/xui/zh/floater_water.xml deleted file mode 100644 index 5fb57272af..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_water.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="Water Floater" title="進階水文編輯器"> - <floater.string name="WLDefaultWaterNames"> - Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez - </floater.string> - <text name="KeyFramePresetsText"> - Water Presets: - </text> - <button label="新增" label_selected="新增" name="WaterNewPreset"/> - <button label="儲存" label_selected="儲存" name="WaterSavePreset"/> - <button label="刪除" label_selected="刪除" name="WaterDeletePreset"/> - <tab_container name="Water Tabs"> - <panel label="設定" name="Settings"> - <text name="BHText"> - Water Fog Color - </text> - <color_swatch name="WaterFogColor" tool_tip="點擊以開啟顏色挑選器"/> - <text name="WaterFogDensText"> - Fog Density Exponent - </text> - <text name="WaterUnderWaterFogModText"> - Underwater Fog Modifier - </text> - <text name="BDensText"> - Reflection Wavelet Scale - </text> - <slider label="1" name="WaterNormalScaleX"/> - <slider label="2" name="WaterNormalScaleY"/> - <slider label="3" name="WaterNormalScaleZ"/> - <text name="HDText"> - Fresnel Scale - </text> - <text name="FresnelOffsetText"> - Fresnel Offset - </text> - <text name="DensMultText"> - Refract Scale Above - </text> - <text name="WaterScaleBelowText"> - Refract Scale Below - </text> - <text name="MaxAltText"> - Blur Multiplier - </text> - </panel> - <panel label="圖像" name="Waves"> - <text name="BHText"> - Big Wave Direction - </text> - <text name="WaterWave1DirXText"> - X - </text> - <text name="WaterWave1DirYText"> - Y - </text> - <text name="BHText2"> - Little Wave Direction - </text> - <text name="WaterWave2DirXText"> - X - </text> - <text name="WaterWave2DirYText"> - Y - </text> - <text name="BHText3"> - 正常地圖 - </text> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/zh/floater_windlight_options.xml b/indra/newview/skins/default/xui/zh/floater_windlight_options.xml deleted file mode 100644 index fce851cc90..0000000000 --- a/indra/newview/skins/default/xui/zh/floater_windlight_options.xml +++ /dev/null @@ -1,167 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater name="WindLight floater" title="進階天空編輯器"> - <floater.string name="WLDefaultSkyNames"> - A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor's Delight:Sheer Sensuality - </floater.string> - <text name="KeyFramePresetsText"> - Sky Presets: - </text> - <button label="新增" label_selected="新增" name="WLNewPreset"/> - <button label="儲存" label_selected="儲存" name="WLSavePreset"/> - <button label="刪除" label_selected="刪除" name="WLDeletePreset"/> - <button label="Day Cycle Editor" label_selected="Day Cycle Editor" name="WLDayCycleMenuButton"/> - <tab_container name="WindLight Tabs"> - <panel label="ATMOSPHERE" name="Atmosphere"> - <text name="BHText"> - Blue Horizon - </text> - <text name="BHText2"> - R - </text> - <text name="BHText3"> - G - </text> - <text name="BHText4"> - B - </text> - <text name="BHText5"> - I - </text> - <text name="BDensText"> - Haze Horizon - </text> - <text name="BDensText2"> - Blue Density - </text> - <text name="BHText6"> - R - </text> - <text name="BHText7"> - G - </text> - <text name="BHText8"> - B - </text> - <text name="BHText9"> - I - </text> - <text name="HDText"> - Haze Density - </text> - <text name="DensMultText"> - Density Multiplier - </text> - <text name="WLDistanceMultText"> - Distance Multiplier - </text> - <text name="MaxAltText"> - Max Altitude - </text> - </panel> - <panel label="LIGHTING" name="Lighting"> - <text name="SLCText"> - Sun/Moon Color - </text> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="TODText"> - Sun/Moon Position - </text> - <text name="WLAmbientText"> - Ambient - </text> - <text name="BHText5"> - R - </text> - <text name="BHText6"> - G - </text> - <text name="BHText7"> - B - </text> - <text name="BHText8"> - I - </text> - <text name="WLEastAngleText"> - East Angle - </text> - <text name="SunGlowText"> - Sun Glow - </text> - <slider label="Focus" name="WLGlowB"/> - <slider label="尺寸" name="WLGlowR"/> - <text name="SceneGammaText"> - Scene Gamma - </text> - <text name="WLStarText"> - Star Brightness - </text> - </panel> - <panel label="CLOUDS" name="Clouds"> - <text name="WLCloudColorText"> - Cloud Color - </text> - <text name="BHText"> - R - </text> - <text name="BHText2"> - G - </text> - <text name="BHText3"> - B - </text> - <text name="BHText4"> - I - </text> - <text name="WLCloudColorText2"> - Cloud XY/Density - </text> - <text name="BHText5"> - X - </text> - <text name="BHText6"> - Y - </text> - <text name="BHText7"> - D - </text> - <text name="WLCloudCoverageText"> - Cloud Coverage - </text> - <text name="WLCloudScaleText"> - Cloud Scale - </text> - <text name="WLCloudDetailText"> - Cloud Detail (XY/Density) - </text> - <text name="BHText8"> - X - </text> - <text name="BHText9"> - Y - </text> - <text name="BHText10"> - D - </text> - <text name="WLCloudScrollXText"> - Cloud Scroll X - </text> - <check_box label="Lock" name="WLCloudLockX"/> - <text name="WLCloudScrollYText"> - Cloud Scroll Y - </text> - <check_box label="Lock" name="WLCloudLockY"/> - <check_box label="Draw Classic Clouds" name="DrawClassicClouds"/> - </panel> - </tab_container> -</floater> diff --git a/indra/newview/skins/default/xui/zh/panel_edit_pick.xml b/indra/newview/skins/default/xui/zh/panel_edit_pick.xml index 6ac7226185..a624877ab3 100644 --- a/indra/newview/skins/default/xui/zh/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/zh/panel_edit_pick.xml @@ -29,7 +29,7 @@ <layout_panel name="layout_panel1"> <button label="儲存精選地點" name="save_changes_btn"/> </layout_panel> - <layout_panel name="layout_panel1"> + <layout_panel name="layout_panel2"> <button label="取消" name="cancel_btn"/> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml index cc551f7d58..477f210352 100644 --- a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml @@ -3,14 +3,13 @@ legacy_header_height="18" can_resize="true" can_minimize="false" - height="360" + height="460" layout="topleft" min_height="360" - left="645" + left="10000" top="10" - min_width="345" + min_width="335" name="floater_help_browser" - save_rect="true" single_instance="true" title="HOW TO" width="335"> @@ -22,7 +21,7 @@ name="done_text"> </floater.string> <layout_stack - bottom="360" + bottom="460" follows="left|right|top|bottom" layout="topleft" left="5" @@ -38,7 +37,7 @@ user_resize="false" width="325"> <web_browser - trusted_content="true" + trusted_content="true" bottom="-5" follows="left|right|top|bottom" layout="topleft" diff --git a/indra/newview/skins/minimal/xui/en/floater_web_content.xml b/indra/newview/skins/minimal/xui/en/floater_web_content.xml index 50cb5b14ce..1d9a967d5a 100644 --- a/indra/newview/skins/minimal/xui/en/floater_web_content.xml +++ b/indra/newview/skins/minimal/xui/en/floater_web_content.xml @@ -17,6 +17,7 @@ follows="left|right|top|bottom" layout="topleft" left="5" + animate="false" name="stack1" orientation="vertical" top="20" @@ -155,14 +156,20 @@ name="external_controls" top_delta="0" user_resize="false" + auto_resize="true" width="585"> <web_browser - bottom="-22" + bottom="-2" follows="all" layout="topleft" left="0" name="webbrowser" top="0"/> + </layout_panel> + <layout_panel name="status_bar" + height="23" + auto_resize="false" + user_resize="false"> <text type="string" length="200" @@ -173,7 +180,7 @@ name="statusbartext" parse_urls="false" text_color="0.4 0.4 0.4 1" - top_pad="5" + top_pad="3" width="495"/> <progress_bar color_bar="0.3 1.0 0.3 1" diff --git a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml index be13bc1bb7..2cb77bcdf3 100644 --- a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml @@ -23,102 +23,172 @@ orientation="vertical" top_pad="5" width="145"> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="20" - layout="topleft" - left="2" - min_height="20" - width="140" - name="view_profile_btn_panel" - top="0" - user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Profile" - name="view_profile_btn" + <layout_panel + auto_resize="false" + follows="top|left|right" + height="20" + layout="topleft" + left="2" + min_height="20" + width="140" + name="view_profile_btn_panel" top="0" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="add_friend_btn_panel" - user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Add Friend" - name="add_friend_btn" - top="5" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="teleport_btn_panel" - user_resize="false"> - <button - auto_resize="false" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Profile" + name="view_profile_btn" + top="0" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="add_friend_btn_panel" + user_resize="false"> + <button follows="left|top|right" height="23" - label="Teleport" - name="teleport_btn" - tool_tip = "Offer to teleport this person" + label="Add Friend" + name="add_friend_btn" + top="5" width="140" /> - </layout_panel> - <layout_panel + </layout_panel> + <layout_panel auto_resize="false" follows="top|left|right" height="25" layout="topleft" min_height="25" width="140" - name="call_btn_panel" + name="teleport_btn_panel" user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Call" - name="call_btn" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="end_call_btn_panel" - user_resize="false" - visible="false"> - <button - follows="left|top|right" - height="23" - label="End Call" - name="end_call_btn" - width="140" /> - </layout_panel> - <layout_panel - mouse_opaque="false" - auto_resize="true" - follows="top|left" - height="0" - layout="topleft" - min_height="0" - width="140" - name="spacer" - user_resize="false" /> + <button + auto_resize="false" + follows="left|top|right" + height="23" + label="Teleport" + name="teleport_btn" + tool_tip = "Offer to teleport this person" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="call_btn_panel" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Call" + name="call_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="end_call_btn_panel" + user_resize="false" + visible="false"> + <button + follows="left|top|right" + height="23" + label="End Call" + name="end_call_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="block_btn_panel" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Block" + name="block_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="unblock_btn_panel" + user_resize="false" + visible="false"> + <button + follows="left|top|right" + height="23" + label="Unblock" + name="unblock_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="54" + width="140" + name="volume_ctrl_panel" + visible="false" + user_resize="false"> + <slider + follows="top|left" + height="23" + increment="0.01" + left="0" + max_val="0.95" + min_val="0.05" + name="volume_slider" + show_text="false" + tool_tip="Call Volume" + top_pad="32" + value="0.5" + width="125" /> + <button + follows="top|left" + height="16" + image_disabled="Audio_Off" + image_disabled_selected="AudioMute_Off" + image_hover_selected="AudioMute_Over" + image_selected="AudioMute_Off" + image_unselected="Audio_Off" + is_toggle="true" + left_pad="0" + top_delta="4" + name="mute_btn" + width="16" /> + </layout_panel> + <layout_panel + mouse_opaque="false" + auto_resize="true" + follows="top|left" + height="0" + layout="topleft" + min_height="0" + width="140" + name="spacer" + user_resize="false" /> </layout_stack> </panel> diff --git a/indra/newview/skins/minimal/xui/en/widgets/location_input.xml b/indra/newview/skins/minimal/xui/en/widgets/location_input.xml index fe06a2d816..ba148cf421 100644 --- a/indra/newview/skins/minimal/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/minimal/xui/en/widgets/location_input.xml @@ -113,6 +113,14 @@ font="SansSerifSmall" text_color="TextFgColor" /> + <see_avatars_icon + name="see_avatars_icon" + width="0" + height="0" + visible="false" + top="21" + follows="right|top" + /> <combo_button name="Location History" label="" diff --git a/indra/newview/tests/lldir_stub.cpp b/indra/newview/tests/lldir_stub.cpp new file mode 100644 index 0000000000..6646860b5e --- /dev/null +++ b/indra/newview/tests/lldir_stub.cpp @@ -0,0 +1,45 @@ +/** + * @file lldir_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Use me only if you need to stub out some helper functions, not if you e.g. need sane numbers from countFilesInDir + +LLDir::LLDir() {} +LLDir::~LLDir() {} +BOOL LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) { return true; } +void LLDir::setChatLogsDir(const std::string &path) {} +void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) {} +void LLDir::setLindenUserDir(const std::string &first, const std::string &last) {} +void LLDir::setSkinFolder(const std::string &skin_folder) {} +bool LLDir::setCacheDir(const std::string &path) { return true; } +void LLDir::dumpCurrentDirectories() {} + +class LLDir_stub : public LLDir +{ +public: + LLDir_stub() {} + ~LLDir_stub() {} + + /*virtual*/ void initAppDirs(const std::string &app_name) {} + + /*virtual*/ std::string getCurPath() { return "CUR_PATH_FROM_LLDIR"; } + /*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask) { return 42; } + /*virtual*/ BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) { fname = fname + "_NEXT"; return false; } + /*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) { fname = "RANDOM_FILE"; } + /*virtual*/ BOOL fileExists(const std::string &filename) const { return false; } +}; + +LLDir_stub gDirUtil; + +LLDir* gDirUtilp = &gDirUtil; + +std::string LLDir::getExpandedFilename(ELLPath loc, const std::string& subdir, const std::string& filename) const +{ + return subdir + " --- " + filename + " --- expanded!"; +} + diff --git a/indra/newview/tests/llglslshader_stub.cpp b/indra/newview/tests/llglslshader_stub.cpp new file mode 100644 index 0000000000..5333c8a361 --- /dev/null +++ b/indra/newview/tests/llglslshader_stub.cpp @@ -0,0 +1,22 @@ +/** + * @file llglslshader_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#include "llglslshader.h" + +void LLGLSLShader::uniform1f(const std::string& uniform, F32 num) +{ +} + +void LLGLSLShader::uniform3fv(const std::string& uniform, U32 count, const GLfloat *v) +{ +} + +void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) +{ +} diff --git a/indra/newview/tests/llpipeline_stub.cpp b/indra/newview/tests/llpipeline_stub.cpp new file mode 100644 index 0000000000..85bf0ae3fb --- /dev/null +++ b/indra/newview/tests/llpipeline_stub.cpp @@ -0,0 +1,15 @@ +/** + * @file llpipeline_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +class LLPipeline +{ +public: BOOL canUseWindLightShaders() const; +}; +BOOL LLPipeline::canUseWindLightShaders() const {return TRUE;} +LLPipeline gPipeline; diff --git a/indra/newview/tests/llsky_stub.cpp b/indra/newview/tests/llsky_stub.cpp new file mode 100644 index 0000000000..35f4944a95 --- /dev/null +++ b/indra/newview/tests/llsky_stub.cpp @@ -0,0 +1,20 @@ +/** + * @file llsky_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +class LLSky +{ +public: + void setOverrideSun(BOOL override); + void setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity); +}; + +void LLSky::setOverrideSun(BOOL override) {} +void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity) {} + +LLSky gSky; diff --git a/indra/newview/tests/llviewershadermgr_stub.cpp b/indra/newview/tests/llviewershadermgr_stub.cpp new file mode 100644 index 0000000000..0dae527035 --- /dev/null +++ b/indra/newview/tests/llviewershadermgr_stub.cpp @@ -0,0 +1,33 @@ +/** + * @file llglslshader_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#include "../llviewershadermgr.h" + +LLShaderMgr::LLShaderMgr() {} +LLShaderMgr::~LLShaderMgr() {} + +LLViewerShaderMgr::LLViewerShaderMgr() {} +LLViewerShaderMgr::~LLViewerShaderMgr() {} + +LLViewerShaderMgr* stub_instance = NULL; + +LLViewerShaderMgr* LLViewerShaderMgr::instance() { + if(NULL == stub_instance) + { + stub_instance = new LLViewerShaderMgr(); + } + + return stub_instance; +} +LLViewerShaderMgr::shader_iter fake_iter; +LLViewerShaderMgr::shader_iter LLViewerShaderMgr::beginShaders() const {return fake_iter;} +LLViewerShaderMgr::shader_iter LLViewerShaderMgr::endShaders() const {return fake_iter;} + +void LLViewerShaderMgr::updateShaderUniforms(LLGLSLShader* shader) {return;} +std::string LLViewerShaderMgr::getShaderDirPrefix() {return "SHADER_DIR_PREFIX-";} diff --git a/indra/newview/tests/llwlanimator_stub.cpp b/indra/newview/tests/llwlanimator_stub.cpp new file mode 100644 index 0000000000..4d1bb85544 --- /dev/null +++ b/indra/newview/tests/llwlanimator_stub.cpp @@ -0,0 +1,12 @@ +/** + * @file llwlanimator_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +LLWLAnimator::LLWLAnimator(void) {} +void LLWLAnimator::update(LLWLParamSet& set) {} +void LLWLAnimator::setTrack(std::map<F32, LLWLParamKey>& track, F32 dayRate, F64 dayTime, bool run) {} diff --git a/indra/newview/tests/llwldaycycle_stub.cpp b/indra/newview/tests/llwldaycycle_stub.cpp new file mode 100644 index 0000000000..d98c9614b4 --- /dev/null +++ b/indra/newview/tests/llwldaycycle_stub.cpp @@ -0,0 +1,35 @@ +/** + * @file llwldaycycle_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +LLWLDayCycle::LLWLDayCycle(void) +{ +} + +LLWLDayCycle::~LLWLDayCycle(void) +{ +} + +bool LLWLDayCycle::getKeytime(LLWLParamKey keyFrame, F32& keyTime) +{ + keyTime = 0.5; + return true; +} + +bool LLWLDayCycle::removeKeyframe(F32 time) +{ + return true; +} + +void LLWLDayCycle::loadDayCycleFromFile(const std::string& fileName) +{ +} + +void LLWLDayCycle::removeReferencesTo(const LLWLParamKey &keyframe) +{ +} diff --git a/indra/newview/tests/llwlparammanager_test.cpp b/indra/newview/tests/llwlparammanager_test.cpp new file mode 100644 index 0000000000..a6c6a2abf4 --- /dev/null +++ b/indra/newview/tests/llwlparammanager_test.cpp @@ -0,0 +1,254 @@ +/** + * @file llwlparammanager_test.cpp + * @brief LLWLParamManager tests + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +// Precompiled headers +#include "../llviewerprecompiledheaders.h" + +// Class to test +#include "../llwlparammanager.h" + +// Dependencies +#include "linden_common.h" + +// TUT header +#include "lltut.h" + +// Stubs +#include "llwldaycycle_stub.cpp" +#include "llwlparamset_stub.cpp" +#include "llwlanimator_stub.cpp" +#include "llglslshader_stub.cpp" +#include "lldir_stub.cpp" +#include "llsky_stub.cpp" +#include "llpipeline_stub.cpp" +#include "llviewershadermgr_stub.cpp" + +void assert_glerror(void) {} +LLViewerCamera::LLViewerCamera() {} +void LLViewerCamera::setView(F32 vertical_fov_rads) {} +std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return std::string(""); } + +char* curl_unescape(const char* c_str, int length) +{ + char* copy = new char[length+4]; + memcpy(copy, c_str, length); + copy[length+0] = 'E'; + copy[length+1] = 'S'; + copy[length+2] = 'C'; + copy[length+3] = '\0'; + return copy; +} +void curl_free(void* p) {delete[] ((char*)p);} +char* curl_escape(const char* c_str, int length) { + char* copy = new char[length+6]; + memcpy(copy, c_str, length); + copy[length+0] = 'U'; + copy[length+1] = 'N'; + copy[length+2] = 'E'; + copy[length+3] = 'S'; + copy[length+4] = 'C'; + copy[length+5] = '\0'; + return copy; +} + +namespace tut +{ + // Main Setup + struct LLWLParamManagerFixture + { + class LLWLParamManagerTest + { + }; + + LLWLParamManager* mTestManager; + + LLWLParamManagerFixture() + : mTestManager(LLWLParamManager::getInstance()) + { + } + + ~LLWLParamManagerFixture() + { + } + }; + typedef test_group<LLWLParamManagerFixture> factory; + typedef factory::object object; + factory tf("LLWLParamManager test"); + + // Tests + template<> template<> + void object::test<1>() + { + try + { + std::string preset = + "<llsd>\ + <map>\ + <key>ambient</key>\ + <array>\ + <real>1.0499999523162842</real>\ + <real>1.0499999523162842</real>\ + <real>1.0499999523162842</real>\ + <real>0.34999999403953552</real>\ + </array>\ + <key>blue_density</key>\ + <array>\ + <real>0.2447581488182351</real>\ + <real>0.44872328639030457</real>\ + <real>0.75999999046325684</real>\ + <real>0.38000004053115788</real>\ + </array>\ + <key>blue_horizon</key>\ + <array>\ + <real>0.49548382097675159</real>\ + <real>0.49548381382419748</real>\ + <real>0.63999999284744291</real>\ + <real>0.31999999642372146</real>\ + </array>\ + <key>cloud_color</key>\ + <array>\ + <real>0.40999999165535073</real>\ + <real>0.40999999165535073</real>\ + <real>0.40999999165535073</real>\ + <real>0.40999999165535073</real>\ + </array>\ + <key>cloud_pos_density1</key>\ + <array>\ + <real>1.6884100437164307</real>\ + <real>0.52609699964523315</real>\ + <real>0.99999999999999289</real>\ + <real>1</real>\ + </array>\ + <key>cloud_pos_density2</key>\ + <array>\ + <real>1.6884100437164307</real>\ + <real>0.52609699964523315</real>\ + <real>0.125</real>\ + <real>1</real>\ + </array>\ + <key>cloud_scale</key>\ + <array>\ + <real>0.4199999868869746</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>cloud_scroll_rate</key>\ + <array>\ + <real>10.199999809265137</real>\ + <real>10.01099967956543</real>\ + </array>\ + <key>cloud_shadow</key>\ + <array>\ + <real>0.26999998092651367</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>density_multiplier</key>\ + <array>\ + <real>0.00017999998817685818</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>distance_multiplier</key>\ + <array>\ + <real>0.80000001192093606</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>east_angle</key>\ + <real>0</real>\ + <key>enable_cloud_scroll</key>\ + <array>\ + <boolean>1</boolean>\ + <boolean>1</boolean>\ + </array>\ + <key>gamma</key>\ + <array>\ + <real>1</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>glow</key>\ + <array>\ + <real>5</real>\ + <real>0.0010000000474974513</real>\ + <real>-0.47999998927116394</real>\ + <real>1</real>\ + </array>\ + <key>haze_density</key>\ + <array>\ + <real>0.69999998807907104</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>haze_horizon</key>\ + <array>\ + <real>0.18999999761581243</real>\ + <real>0.19915600121021271</real>\ + <real>0.19915600121021271</real>\ + <real>1</real>\ + </array>\ + <key>lightnorm</key>\ + <array>\ + <real>0</real>\ + <real>0.70710659027099609</real>\ + <real>-0.70710694789886475</real>\ + <real>0</real>\ + </array>\ + <key>max_y</key>\ + <array>\ + <real>1605</real>\ + <real>0</real>\ + <real>0</real>\ + <real>1</real>\ + </array>\ + <key>preset_num</key>\ + <integer>22</integer>\ + <key>star_brightness</key>\ + <real>0</real>\ + <key>sun_angle</key>\ + <real>2.3561947345733643</real>\ + <key>sunlight_color</key>\ + <array>\ + <real>0.73421055078505759</real>\ + <real>0.78157895803450828</real>\ + <real>0.89999997615813498</real>\ + <real>0.29999998211860301</real>\ + </array>\ + </map>\ + </llsd>"; + + std::stringstream preset_stream(preset); + mTestManager->loadPresetFromXML(LLWLParamKey("test1", LLWLParamKey::SCOPE_LOCAL), preset_stream); + LLWLParamSet dummy; + ensure("Couldn't get ParamSet after loading it", mTestManager->getParamSet(LLWLParamKey("test1", LLWLParamKey::SCOPE_LOCAL), dummy)); + } + catch (...) + { + fail("loadPresetFromXML test crashed!"); + } + } + + template<> template<> + void object::test<2>() + { + mTestManager->propagateParameters(); + ensure_equals("Wrong value from getDomeOffset()", mTestManager->getDomeOffset(), 0.96f); + ensure_equals("Wrong value from getDomeRadius()", mTestManager->getDomeRadius(), 15000.f); + ensure_equals("Wrong value from getLightDir()", mTestManager->getLightDir(), LLVector4(-0,0,1,0)); + ensure_equals("Wrong value from getClampedLightDir()", mTestManager->getClampedLightDir(), LLVector4(-0,0,1,0)); + ensure_equals("Wrong value from getRotatedLightDir()", mTestManager->getRotatedLightDir(), LLVector4(0,0,0,1)); + } +} diff --git a/indra/newview/tests/llwlparamset_stub.cpp b/indra/newview/tests/llwlparamset_stub.cpp new file mode 100644 index 0000000000..6ce4b5827d --- /dev/null +++ b/indra/newview/tests/llwlparamset_stub.cpp @@ -0,0 +1,24 @@ +/** + * @file llwlparamset_stub.cpp + * @brief stub class to allow unit testing + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * Copyright (c) 2009, Linden Research, Inc. + * $/LicenseInfo$ + */ + +LLWLParamSet::LLWLParamSet(void) +{ +} + +void LLWLParamSet::updateCloudScrolling() +{ +} + +void LLWLParamSet::set(const std::string& name, const LLVector4& val) +{ +} + +void LLWLParamSet::update(LLGLSLShader *shader) const +{ +} |