From 855272b1ea67fa942e470bc059a6af944dbe2079 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 14 Apr 2011 15:00:35 +0200 Subject: [PATCH 01/10] - internal : reviewed for SL-2.6.0 --HG-- branch : Appearance-Misc --- .hgpatchinfo/Appearance-Misc.desc | 3 + indra/newview/llagentwearables.cpp | 10 +- indra/newview/llagentwearables.h | 10 +- indra/newview/llappearancemgr.cpp | 34 ++-- indra/newview/llappearancemgr.h | 4 +- indra/newview/llinventorybridge.cpp | 226 ++++++++++------------ indra/newview/lltooldraganddrop.cpp | 4 +- indra/newview/llviewerinventory.cpp | 4 +- indra/newview/llviewerinventory.h | 4 +- indra/newview/llviewerjointattachment.cpp | 2 +- indra/newview/llvoavatar.cpp | 4 +- indra/newview/llwearablelist.cpp | 2 +- 12 files changed, 149 insertions(+), 158 deletions(-) diff --git a/.hgpatchinfo/Appearance-Misc.desc b/.hgpatchinfo/Appearance-Misc.desc index 49491dd1f4..3ef1fb03d7 100644 --- a/.hgpatchinfo/Appearance-Misc.desc +++ b/.hgpatchinfo/Appearance-Misc.desc @@ -13,6 +13,9 @@ -> normal-drop : replace wear -> Ctrl-drop : add wear - fixed : LLAppearanceMgr::registerAttachment() fails to (re)add a link for worn attachments that aren't linked to in COF at log-on +- fixed : LLViewerObject::getAttachmentItemID() sometimes returns the NULL UUID for the avatar's own attachments +- fixed : LLAppearanceMgr::updateAppearanceFromCOF() doesn't properly filter items collected from folder links + -> create an outfit with a folder link + "Replace Outfit" == wearables that exist in both COF and the linked folder will end up worn multiple times - changed : deprecated removeItemFromAvatar() in favour of having LLAppearanceMgr::removeItemFromAvatar() handle it directly/correctly -> wearables can't be worn/removed in 2.X without the viewer already having an LLWearable instance for it anyway - changed : enable "Replace Current Outfit" on the base outfit if it's marked dirty diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6a5a78c082..d370fcbefa 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -55,7 +55,7 @@ LLAgentWearables gAgentWearables; BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE; -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d bool LLAgentWearables::mInitialWearablesLoaded = false; // [/SL:KB] @@ -1451,7 +1451,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; checkWearablesLoaded(); -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-09-22 (Catznip-2.5.0a) | Modified: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-09-22 (Catznip-2.6.0a) | Modified: Catznip-2.2.0a if (!mInitialWearablesLoaded) { mInitialWearablesLoaded = true; @@ -1736,7 +1736,7 @@ void LLAgentWearables::userRemoveAllClothesStep2(BOOL proceed) // Combines userRemoveAllAttachments() and userAttachMultipleAttachments() logic to // get attachments into desired state with minimal number of adds/removes. //void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array) -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.6.0a) | Added: Catznip-2.2.0a void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool fAttachOnly) // [/SL:KB] { @@ -1804,7 +1804,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj // Remove everything in objects_to_remove // userRemoveMultipleAttachments(objects_to_remove); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.6.0a) | Added: Catznip-2.2.0a if (!fAttachOnly) { userRemoveMultipleAttachments(objects_to_remove); @@ -2120,7 +2120,7 @@ boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_ return mLoadedSignal.connect(cb); } -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d boost::signals2::connection LLAgentWearables::addInitialWearablesLoadedCallback(loaded_callback_t cb) { return mInitialWearablesLoadedSignal.connect(cb); diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index c3134f5bdb..e96eba24d4 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -76,7 +76,7 @@ public: BOOL isWearableCopyable(LLWearableType::EType type, U32 index /*= 0*/) const; BOOL areWearablesLoaded() const; -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d bool areInitalWearablesLoaded() const { return mInitialWearablesLoaded; } // [/SL:KB] bool isCOFChangeInProgress() const { return mCOFChangeInProgress; } @@ -219,7 +219,7 @@ public: typedef std::vector llvo_vec_t; // static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.6.0a) | Added: Catznip-2.2.0a // Not the best way to go about this but other attempts changed far too much LL code to be a viable solution static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array, bool fAttachOnly = false); // [/SL:KB] @@ -241,7 +241,7 @@ public: typedef boost::function loaded_callback_t; typedef boost::signals2::signal loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d boost::signals2::connection addInitialWearablesLoadedCallback(loaded_callback_t cb); // [/SL:KB] @@ -251,7 +251,7 @@ public: private: loading_started_signal_t mLoadingStartedSignal; // should be called before wearables are changed loaded_signal_t mLoadedSignal; // emitted when all agent wearables get loaded -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d loaded_signal_t mInitialWearablesLoadedSignal; // emitted once when the initial wearables are loaded // [/SL:KB] @@ -264,7 +264,7 @@ private: wearableentry_map_t mWearableDatas; static BOOL mInitialWearablesUpdateReceived; -// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-InitialWearablesLoadedCallback | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.2.0a static bool mInitialWearablesLoaded; // [/SL:KB] BOOL mWearablesLoaded; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2c27547b3d..74fd6d4054 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -280,7 +280,7 @@ public: void onWearableAssetFetch(LLWearable *wearable); void onAllComplete(); -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.6.0a) | Added: Catznip-2.0.0a bool pollStopped(); // [/SL:KB] @@ -362,7 +362,7 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type) mTypesToRecover.erase(type); } -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.5.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.6.0a) | Added: Catznip-2.1.2a // Fix for http://jira.secondlife.com/browse/VWR-18512 /* void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) @@ -467,7 +467,7 @@ void LLWearableHoldingPattern::onAllComplete() llinfos << "Updating agent wearables with " << mResolved << " wearable items " << llendl; LLAppearanceMgr::instance().updateAgentWearables(this, false); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.5.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.6.0a) | Added: Catznip-2.1.2a // Fix for http://jira.secondlife.com/browse/VWR-18512 /* // Update attachments to match those requested. @@ -508,7 +508,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() { llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.6.0a) | Added: Catznip-2.0.0a // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); return true; @@ -605,7 +605,7 @@ public: { llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.6.0a) | Added: Catznip-2.0.0a // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves return; // [/SL:KB] @@ -683,7 +683,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() } } -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.6.0a) | Added: Catznip-2.0.0a bool LLWearableHoldingPattern::pollStopped() { // We have to keep on polling until we're sure that all callbacks have completed or they'll cause a crash @@ -1340,7 +1340,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) // Check whether it's the base outfit. // if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID()) -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-2.5.0a) | Added: Catznip-2.1.2d +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-2.6.0a) | Added: Catznip-2.1.2d if ( (outfit_cat_id.isNull()) || ((outfit_cat_id == getBaseOutfitUUID()) && (!isOutfitDirty())) ) // [/SL:KB] { @@ -1416,7 +1416,7 @@ void LLAppearanceMgr::filterWearableItems( if (size <= 0) continue; // S32 start_index = llmax(0,size-max_per_type); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-2.5.0a) | Added: Catznip-2.0.0h +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-2.6.0a) | Added: Catznip-2.0.0h S32 start_index = llmax(0, size - ((LLAssetType::AT_BODYPART == LLWearableType::getAssetType((LLWearableType::EType)i)) ? 1 : max_per_type)); // [/SL:KB[ @@ -1747,7 +1747,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) remove_non_link_items(wear_items); remove_non_link_items(obj_items); remove_non_link_items(gest_items); -// [SL:KB] - Patch: Apperance-Misc | Checked: 2010-11-24 (Catznip-2.5.0a) | Added: Catzip-2.4.0f +// [SL:KB] - Patch: Apperance-Misc | Checked: 2010-11-24 (Catznip-2.6.0a) | Added: Catzip-2.4.0f // Since we're following folder links we might have picked up new duplicates, or exceeded MAX_CLOTHING_PER_TYPE removeDuplicateItems(wear_items); removeDuplicateItems(obj_items); @@ -1758,7 +1758,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.6.0a) | Added: Catznip-2.2.0a // Update attachments to match those requested. if (isAgentAvatarValid()) { @@ -2610,9 +2610,9 @@ void LLAppearanceMgr::removeItemFromAvatar(const LLUUID& id_to_remove) // //*TODO move here the exact removing code from LLWearableBridge::removeItemFromAvatar in the future // LLWearableBridge::removeItemFromAvatar(item_to_remove); // } -// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.6.0a) | Added: Catznip-2.1.1d { - /*const*/ LLWearable* pWearable = gAgentWearables.getWearableFromItemID(item_to_remove->getLinkedUUID()); + const LLWearable* pWearable = gAgentWearables.getWearableFromItemID(item_to_remove->getLinkedUUID()); if ( (pWearable) && (LLAssetType::AT_BODYPART != pWearable->getAssetType()) ) { U32 idxWearable = gAgentWearables.getWearableIndex(pWearable); @@ -2771,7 +2771,7 @@ void LLAppearanceMgr::setAttachmentInvLinkEnable(bool val) { llinfos << "setAttachmentInvLinkEnable => " << (int) val << llendl; mAttachmentInvLinkEnabled = val; -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.6.0a) | Added: Catznip-2.2.0a if (mAttachmentInvLinkEnabled) { linkPendingAttachments(); @@ -2799,7 +2799,7 @@ void dumpAttachmentSet(const std::set& atts, const std::string& msg) void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.6.0a) | Added: Catznip-2.2.0a if (isLinkInCOF(item_id)) { return; @@ -2813,7 +2813,7 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) // it will trigger gAgentWariables.notifyLoadingFinished() // But it is not acceptable solution. See EXT-7777 // LLAppearanceMgr::addCOFItemLink(item_id, false); // Add COF link for item. -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.5.0a) | Modified: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.6.0a) | Modified: Catznip-2.2.0a LLPointer cb = new LLRegisterAttachmentCallback(); LLAppearanceMgr::addCOFItemLink(item_id, false, cb); // Add COF link for item. // [/SL:KB] @@ -2827,7 +2827,7 @@ void LLAppearanceMgr::registerAttachment(const LLUUID& item_id) void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) { gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-10-05 (Catznip-2.6.0a) | Added: Catznip-2.2.0a uuid_vec_t::iterator itPendingAttachLink = std::find(mPendingAttachLinks.begin(), mPendingAttachLinks.end(), item_id); if (itPendingAttachLink != mPendingAttachLinks.end()) { @@ -2845,7 +2845,7 @@ void LLAppearanceMgr::unregisterAttachment(const LLUUID& item_id) } } -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.5.0a) | Modified: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.6.0a) | Modified: Catznip-2.2.0a void LLAppearanceMgr::linkPendingAttachments() { LLPointer cb = NULL; diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 5e06010407..86b4a02098 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -217,7 +217,7 @@ private: std::auto_ptr mUnlockOutfitTimer; -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.5.0a) | Modified: Catznip-2.1.2e +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-18 (Catznip-2.6.0a) | Modified: Catznip-2.1.2e public: void linkPendingAttachments(); void onRegisterAttachmentComplete(const LLUUID& idItem); @@ -251,7 +251,7 @@ private: bool mUpdateBaseOrder; }; -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.5.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.6.0a) | Added: Catznip-2.1.2a class LLRegisterAttachmentCallback : public LLInventoryCallback { public: diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3ee1db47ec..8664d2e5e6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2473,7 +2473,7 @@ void LLFolderBridge::folderOptionsMenu() // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.5.0a) | Added: Catznip-2.4.0e +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.6.0a) | Added: Catznip-2.4.0e const bool is_outfit = (type == LLFolderType::FT_OUTFIT); // [/SL:KB] @@ -2529,7 +2529,7 @@ void LLFolderBridge::folderOptionsMenu() disabled_items.push_back(std::string("Remove From Outfit")); } // if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.5.0a) | Added: Catznip-2.4.0e +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-11-24 (Catznip-2.6.0a) | Added: Catznip-2.4.0e if ( ((is_outfit) && (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))) || ((!is_outfit) && (gAgentWearables.isCOFChangeInProgress())) ) // [/SL:KB] @@ -4505,14 +4505,12 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ continue; if (get_is_item_worn(item->getUUID())) { -/* - LLWearableList::instance().getAsset(item->getAssetUUID(), - item->getName(), - item->getType(), - LLWearableBridge::onRemoveFromAvatarArrived, - new OnRemoveStruct(item->getLinkedUUID())); -*/ -// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// LLWearableList::instance().getAsset(item->getAssetUUID(), +// item->getName(), +// item->getType(), +// LLWearableBridge::onRemoveFromAvatarArrived, +// new OnRemoveStruct(item->getLinkedUUID())); +// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.6.0a) | Added: Catznip-2.1.1d LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID()); // [/SL:KB] } @@ -4753,60 +4751,56 @@ void LLWearableBridge::wearAddOnAvatar() } // static -/* -void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata ) -{ - LLUUID* item_id = (LLUUID*) userdata; - if(wearable) - { - LLViewerInventoryItem* item = NULL; - item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); - if(item) - { - if(item->getAssetUUID() == wearable->getAssetID()) - { - gAgentWearables.setWearableItem(item, wearable); - gInventory.notifyObservers(); - //self->getFolderItem()->refreshFromRoot(); - } - else - { - llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; - } - } - } - delete item_id; -} -*/ +//void LLWearableBridge::onWearOnAvatarArrived( LLWearable* wearable, void* userdata ) +//{ +// LLUUID* item_id = (LLUUID*) userdata; +// if(wearable) +// { +// LLViewerInventoryItem* item = NULL; +// item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); +// if(item) +// { +// if(item->getAssetUUID() == wearable->getAssetID()) +// { +// gAgentWearables.setWearableItem(item, wearable); +// gInventory.notifyObservers(); +// //self->getFolderItem()->refreshFromRoot(); +// } +// else +// { +// llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; +// } +// } +// } +// delete item_id; +//} // static // BAP remove the "add" code path once everything is fully COF-ified. -/* -void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ) -{ - LLUUID* item_id = (LLUUID*) userdata; - if(wearable) - { - LLViewerInventoryItem* item = NULL; - item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); - if(item) - { - if(item->getAssetUUID() == wearable->getAssetID()) - { - bool do_append = true; - gAgentWearables.setWearableItem(item, wearable, do_append); - gInventory.notifyObservers(); - //self->getFolderItem()->refreshFromRoot(); - } - else - { - llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; - } - } - } - delete item_id; -} -*/ +//void LLWearableBridge::onWearAddOnAvatarArrived( LLWearable* wearable, void* userdata ) +//{ +// LLUUID* item_id = (LLUUID*) userdata; +// if(wearable) +// { +// LLViewerInventoryItem* item = NULL; +// item = (LLViewerInventoryItem*)gInventory.getItem(*item_id); +// if(item) +// { +// if(item->getAssetUUID() == wearable->getAssetID()) +// { +// bool do_append = true; +// gAgentWearables.setWearableItem(item, wearable, do_append); +// gInventory.notifyObservers(); +// //self->getFolderItem()->refreshFromRoot(); +// } +// else +// { +// llinfos << "By the time wearable asset arrived, its inv item already pointed to a different asset." << llendl; +// } +// } +// } +// delete item_id; +//} // static BOOL LLWearableBridge::canEditOnAvatar(void* user_data) @@ -4844,57 +4838,53 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) } // static -/* -void LLWearableBridge::onRemoveFromAvatar(void* user_data) -{ - LLWearableBridge* self = (LLWearableBridge*)user_data; - if(!self) return; - if(get_is_item_worn(self->mUUID)) - { - LLViewerInventoryItem* item = self->getItem(); - if (item) - { - LLUUID parent_id = item->getParentUUID(); - LLWearableList::instance().getAsset(item->getAssetUUID(), - item->getName(), - item->getType(), - onRemoveFromAvatarArrived, - new OnRemoveStruct(LLUUID(self->mUUID))); - } - } -} -*/ +//void LLWearableBridge::onRemoveFromAvatar(void* user_data) +//{ +// LLWearableBridge* self = (LLWearableBridge*)user_data; +// if(!self) return; +// if(get_is_item_worn(self->mUUID)) +// { +// LLViewerInventoryItem* item = self->getItem(); +// if (item) +// { +// LLUUID parent_id = item->getParentUUID(); +// LLWearableList::instance().getAsset(item->getAssetUUID(), +// item->getName(), +// item->getType(), +// onRemoveFromAvatarArrived, +// new OnRemoveStruct(LLUUID(self->mUUID))); +// } +// } +//} // static -/* -void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, - void* userdata) -{ - OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata; - const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID); - if(wearable) - { - if( get_is_item_worn( item_id ) ) - { - LLWearableType::EType type = wearable->getType(); - - if( !(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES ) ) //&& - //!((!gAgent.isTeen()) && ( type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT )) ) - { - bool do_remove_all = false; - U32 index = gAgentWearables.getWearableIndex(wearable); - gAgentWearables.removeWearable( type, do_remove_all, index ); - } - } - } - - // Find and remove this item from the COF. - LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); - gInventory.notifyObservers(); - - delete on_remove_struct; -} -*/ +//void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, +// void* userdata) +//{ +// OnRemoveStruct *on_remove_struct = (OnRemoveStruct*) userdata; +// const LLUUID &item_id = gInventory.getLinkedItemID(on_remove_struct->mUUID); +// if(wearable) +// { +// if( get_is_item_worn( item_id ) ) +// { +// LLWearableType::EType type = wearable->getType(); +// +// if( !(type==LLWearableType::WT_SHAPE || type==LLWearableType::WT_SKIN || type==LLWearableType::WT_HAIR || type==LLWearableType::WT_EYES ) ) //&& +// //!((!gAgent.isTeen()) && ( type==LLWearableType::WT_UNDERPANTS || type==LLWearableType::WT_UNDERSHIRT )) ) +// { +// bool do_remove_all = false; +// U32 index = gAgentWearables.getWearableIndex(wearable); +// gAgentWearables.removeWearable( type, do_remove_all, index ); +// } +// } +// } +// +// // Find and remove this item from the COF. +// LLAppearanceMgr::instance().removeCOFItemLinks(item_id,false); +// gInventory.notifyObservers(); +// +// delete on_remove_struct; +//} // static void LLWearableBridge::removeAllClothesFromAvatar() @@ -4906,7 +4896,7 @@ void LLWearableBridge::removeAllClothesFromAvatar() continue; // for (S32 index = gAgentWearables.getWearableCount(itype)-1; index >= 0 ; --index) -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-04 (Catznip-2.5.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-04 (Catznip-2.6.0a) | Added: Catznip-2.1.2a for (S32 index = gAgentWearables.getWearableCount((LLWearableType::EType)itype)-1; index >= 0 ; --index) // [/SL:KB] { @@ -4934,14 +4924,12 @@ void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item) { if (item) { -/* - LLWearableList::instance().getAsset(item->getAssetUUID(), - item->getName(), - item->getType(), - LLWearableBridge::onRemoveFromAvatarArrived, - new OnRemoveStruct(item->getUUID())); -*/ -// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// LLWearableList::instance().getAsset(item->getAssetUUID(), +// item->getName(), +// item->getType(), +// LLWearableBridge::onRemoveFromAvatarArrived, +// new OnRemoveStruct(item->getUUID())); +// [SL:KB] - Patch: Appearance-RemoveWearableFromAvatar | Checked: 2010-08-13 (Catznip-2.6.0a) | Added: Catznip-2.1.1d LLAppearanceMgr::instance().removeItemFromAvatar(item->getUUID()); // [/SL:KB] } diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 23b59839be..a8101a4dcf 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1623,7 +1623,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( if (mSource == SOURCE_LIBRARY) { // LLPointer cb = new RezAttachmentCallback(0); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a // Make this behave consistent with dad3dWearItem LLPointer cb = new RezAttachmentCallback(0, !(mask & MASK_CONTROL)); // [/SL:KB] @@ -1638,7 +1638,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( else { // rez_attachment(item, 0); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a // Make this behave consistent with dad3dWearItem rez_attachment(item, 0, !(mask & MASK_CONTROL)); // [/SL:KB] diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 7e7c3e9088..988cbe388f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -948,7 +948,7 @@ void ModifiedCOFCallback::fire(const LLUUID& inv_item) } //RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp) -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp, bool replace) : mAttach(attachmentp), mReplace(replace) // [/SL:KB] @@ -968,7 +968,7 @@ void RezAttachmentCallback::fire(const LLUUID& inv_item) if (item) { // rez_attachment(item, mAttach); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a rez_attachment(item, mAttach, mReplace); // [/SL:KB] } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 24f1935e60..071cdb557c 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -264,7 +264,7 @@ class RezAttachmentCallback : public LLInventoryCallback { public: // RezAttachmentCallback(LLViewerJointAttachment *attachmentp); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a RezAttachmentCallback(LLViewerJointAttachment *attachmentp, bool replace = false); // [/SL:KB] void fire(const LLUUID& inv_item); @@ -274,7 +274,7 @@ protected: private: LLViewerJointAttachment* mAttach; -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-28 (Catznip-2.6.0a) | Added: Catznip-2.2.0a bool mReplace; // [/SL:KB] }; diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index f0fcb7eeae..852a525caf 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -169,7 +169,7 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) // re-connect object to the joint correctly } -// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-2.4.0h (2011-01-13) | Added: Catznip-2.4.0h +// [SL:KB] - Patch: Appearance-Misc | Checked: Catznip-2.6.0a (2011-01-13) | Added: Catznip-2.4.0h // LLViewerJointAttachment::removeObject() sets the object's item to the NULL UUID so we need to extract it *after* the block above object->extractAttachmentItemID(); // [/SL:KB] diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b35c50b575..ce086d546a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5666,7 +5666,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi { llwarns << "Object attachment point invalid: " << attachmentID << llendl; // attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) -// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.5.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.6.0a) | Added: Catznip-2.1.2a S32 idxAttachPt = 1; if ( (!isSelf()) && (gSavedSettings.getBOOL("LegacyMultiAttachmentSupport")) && (attachmentID > 38) && (attachmentID <= 68) ) idxAttachPt = attachmentID - 38; @@ -6128,7 +6128,7 @@ BOOL LLVOAvatar::isFullyLoaded() const // return TRUE; // else // return mFullyLoaded; -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.5.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.6.0a) | Added: Catznip-2.2.0a // Changes to LLAppearanceMgr::updateAppearanceFromCOF() expect this function to actually return mFullyLoaded for gAgentAvatarp if ( (!isSelf()) && (gSavedSettings.getBOOL("RenderUnloadedAvatar")) ) return TRUE; diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 0f655969fc..b2c7687f33 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -96,7 +96,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID BOOL isNewWearable = FALSE; LLWearableArrivedData* data = (LLWearableArrivedData*) userdata; // LLWearable* wearable = NULL; // NULL indicates failure -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-08-13 (Catznip-2.6.0a) | Added: Catznip-2.1.1d LLWearable* wearable = get_if_there(LLWearableList::instance().mList, uuid, (LLWearable*)NULL); if (wearable) { From ac47040f86faf7aafe4e3edf4a19e9ebf5d4ee3a Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 14 Apr 2011 19:13:11 +0200 Subject: [PATCH 02/10] - internal : reviewed for SL-2.6.0 --HG-- branch : Appearance-MixedViewers --- indra/newview/llagentwearablesfetch.cpp | 12 +++++------- indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llappearancemgr.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 540d6d5eb1..d9d1704c7d 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -119,7 +119,7 @@ void LLInitialWearablesFetch::processContents() gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, LLInventoryModel::EXCLUDE_TRASH, is_wearable); -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-18 (Catznip-2.5.0a) | Modified: Catznip-2.0.0h +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-18 (Catznip-2.6.0a) | Modified: Catznip-2.0.0h // NOTE: don't use the current COF contents if 'wearable_array' is empty (ie first logon with 2.0 or some other problem) bool fUpdateFromCOF = !wearable_array.empty(); if (fUpdateFromCOF) @@ -133,8 +133,6 @@ void LLInitialWearablesFetch::processContents() (itWearableData != mAgentInitialWearables.end()) && (fUpdateFromCOF); ++itWearableData) { const LLUUID& idItem = itWearableData->mItemID; bool fFound = false; - - // TODO-Catznip: [SL-2.2.0] Bit of a hack until LL supports changing the descriptions of links for (S32 idxItem = 0, cntItem = items_by_type[itWearableData->mType].size(); idxItem < cntItem; idxItem++) { const LLViewerInventoryItem* pCOFItem = items_by_type[itWearableData->mType].get(idxItem); @@ -152,7 +150,7 @@ void LLInitialWearablesFetch::processContents() LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); // if (wearable_array.count() > 0) -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-28 (Catznip-2.5.0a) | Modified: Catznip-2.0.0e +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-28 (Catznip-2.6.0a) | Modified: Catznip-2.0.0e if (fUpdateFromCOF) // [/SL:KB] { @@ -205,12 +203,12 @@ public: link_waiter); } */ -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-08-14 (Catznip-2.5.0a) | Added: Catznip-2.1.1d +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-08-14 (Catznip-2.6.0a) | Added: Catznip-2.1.1d doOnIdleOneTime(boost::bind(&LLFetchAndLinkObserver::doneIdle, this)); // [/SL:KB] } -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0a void doneIdle() { // NOTE: the code above makes the assumption that COF is empty which won't be the case the way it's used now @@ -243,7 +241,7 @@ void LLInitialWearablesFetch::processWearablesMessage() { // Populate the current outfit folder with links to the wearables passed in the message // InitialWearableData *wearable_data = new InitialWearableData(mAgentInitialWearables[i]); // This will be deleted in the callback. -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-02 (Catznip-2.5.0a) | Added: Catznip-2.0.0f +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-05-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0f // Fixes minor leak: since COF is used onInitialWearableAssetArrived() will never get called and "wearable_data" leaks InitialWearableData* wearable_data = &mAgentInitialWearables[i]; // [/SL:KB] diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c62ed40612..9a0a589796 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1782,7 +1782,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } } -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0a void LLAppearanceMgr::updateAppearanceFromInitialWearables(LLInventoryModel::item_array_t& initial_items) { const LLUUID& idCOF = getCOF(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 9332286e12..91412d149b 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -51,7 +51,7 @@ public: typedef std::vector wearables_by_type_t; void updateAppearanceFromCOF(bool update_base_outfit_ordering = false); -// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.5.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-MixedViewers | Checked: 2010-04-02 (Catznip-2.6.0a) | Added: Catznip-2.0.0a void updateAppearanceFromInitialWearables(LLInventoryModel::item_array_t& initial_items); // [/SL:KB] bool needToSaveCOF(); From 2f12907d62132ebf0ba7becf369d137c89afa5e7 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 24 May 2011 20:43:51 +0200 Subject: [PATCH 03/10] - internal : fix EOL in llviewermessage.cpp --HG-- branch : Viewer-Build --- indra/newview/llviewermessage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 298e789f65..e3cb8965eb 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5373,10 +5373,10 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) { // notification was specified using the new mechanism, so we can just handle it here std::string notificationID; - msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); - if (!LLNotifications::getInstance()->templateExists(notificationID)) - { - return false; + msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID); + if (!LLNotifications::getInstance()->templateExists(notificationID)) + { + return false; } std::string llsdRaw; From 710d96eaedf27fc4a0e3a0e0777c6cb02892734f Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 24 May 2011 23:54:39 +0200 Subject: [PATCH 04/10] Updated patch branch dependencies --HG-- branch : .RLVa --- .hgpatchinfo/.RLVa.dep | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.hgpatchinfo/.RLVa.dep b/.hgpatchinfo/.RLVa.dep index 90a41514f9..3960ca6cc7 100644 --- a/.hgpatchinfo/.RLVa.dep +++ b/.hgpatchinfo/.RLVa.dep @@ -1,3 +1,2 @@ -66fb72119f033ed886d5712631343f88e1ead934 -1ff5ef68e9f33642e755b7e3840bdae7b7284597 -9ce13e5a6cacb30d5e01bdaf774a48b19823bcd6 \ No newline at end of file +20fb0c21c1d212361e2dce85a55dedd2e74bce5b +ca307c3bf9d3bb7dfb64420a018ae77374c9e5d8 \ No newline at end of file From 35e905d9b9286805730fabe9e96a72735bd1e05f Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 26 May 2011 21:52:09 +0200 Subject: [PATCH 05/10] Incremented version number to RLVa-1.4.0(a) -> general code review --HG-- branch : RLVa --- indra/newview/rlvdefines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 9b56de2b59..c5382b81e5 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -64,7 +64,7 @@ const S32 RLV_VERSION_BUILD = 0; // Implementation version const S32 RLVa_VERSION_MAJOR = 1; const S32 RLVa_VERSION_MINOR = 3; -const S32 RLVa_VERSION_PATCH = 1; +const S32 RLVa_VERSION_PATCH = 4; const S32 RLVa_VERSION_BUILD = 0; // Uncomment before a final release From 74183043c2c212cb718187bbdfb202dd1019aacd Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 26 May 2011 23:20:11 +0200 Subject: [PATCH 06/10] - fixed : inventory sidebar tab can be opened when @showinv=n restricted -> "OpenSidePanelsInFloaters" to TRUE + Ctrl-I shortcut => inventory tab opens as a floater --HG-- branch : RLVa --- indra/newview/llsidetray.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index f3731dca7c..d8afd20e58 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -718,7 +718,12 @@ LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel std::string tab_name = tab->getName(); -// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a +// [RLVa:KB] - Checked: 2011-05-26 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a + // Don't open a child panel if the tab it belongs to has its tab button disabled + const LLButton* pTabBtn = getButtonFromName(tab->getName()); + if ( (pTabBtn) && (!pTabBtn->getEnabled()) ) + return NULL; + // NOTE: - "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(tab_name))) ) return NULL; From edef7c480d060660596fc649cb6f465796ebeab8 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 26 May 2011 23:50:00 +0200 Subject: [PATCH 07/10] - internal : revert backing out the sidetray validation signal in changeset 43746f48573c -> fallback which would have caught the bug fixed in the previous changeset (not technically needed but could help with TPVs that mangle the sidebar in different ways) --HG-- branch : RLVa --- indra/newview/llsidetray.cpp | 10 +++++++--- indra/newview/rlvui.cpp | 18 +++++++++++++++++- indra/newview/rlvui.h | 9 ++++++--- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index d8afd20e58..3ac14bfd45 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -724,8 +724,8 @@ LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel if ( (pTabBtn) && (!pTabBtn->getEnabled()) ) return NULL; - // NOTE: - "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to - if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(tab_name))) ) + // NOTE: "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to + if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(panel_name))) ) return NULL; // [/RLVa:KB] @@ -790,11 +790,15 @@ bool LLSideTray::selectTabByName(const std::string& name, bool keep_prev_visible if (new_tab == mActiveTab) return false; -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2011-05-26 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a // Don't switch to a tab if its tab button is disabled const LLButton* pTabBtn = getButtonFromName(new_tab->getName()); if ( (pTabBtn) && (!pTabBtn->getEnabled()) ) return false; + + // Fire the validation signal to see if anyone objects to this tab being selected + if ( (mValidateSignal) && (!(*mValidateSignal)(new_tab, LLSD())) ) + return false; // [/RLVa:KB] //deselect old tab diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 0123d356d5..566e91c38a 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -273,11 +273,20 @@ void RlvUIEnabler::onToggleShowInv(bool fQuitting) (*itFloater)->closeFloater(); } - // Filter out (or stop filtering) newly spawned old style inventory floaters + // + // Filter (or stop filtering) opening the inventory sidebar tab and spawning old style inventory floaters + // + RLV_ASSERT_DBG( (fEnable) || (!m_ConnSidePanelInventory.connected()) ); if (!fEnable) + { + m_ConnSidePanelInventory = pSideTray->setValidateCallback(boost::bind(&RlvUIEnabler::canOpenSidebarTab, this, RLV_BHVR_SHOWINV, "sidebar_inventory", _1, _2)); addGenericFloaterFilter("inventory"); + } else + { + m_ConnSidePanelInventory.disconnect(); removeGenericFloaterFilter("inventory"); + } } // Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f @@ -527,6 +536,13 @@ bool RlvUIEnabler::filterFloaterViewXXX(const std::string& strName, const LLSD&) return true; } +// Checked: 2010-03-01 (RLVa-1.4.0a) | Added: RLVa-1.2.0a +bool RlvUIEnabler::canOpenSidebarTab(ERlvBehaviour eBhvrFilter, const std::string& strNameFilter, LLUICtrl* pCtrl, const LLSD& sdParam) +{ + // NOTE: pCtrl->getName() is the name of the sidebar tab and sdParam is the name of the child panel being activated (can be omitted) + return (!gRlvHandler.hasBehaviour(eBhvrFilter)) || (strNameFilter != pCtrl->getName()); +} + // ============================================================================ // Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index 2e88de23c5..c21c3c245f 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -60,20 +60,23 @@ protected: void onToggleViewXXX(); // viewnote, viewscript, viewtexture void onUpdateLoginLastLocation(); // tploc and unsit - /* - * Floater validation callbacks + /* + * Floater and sidebar validation callbacks */ protected: void addGenericFloaterFilter(const std::string& strFloaterName); void removeGenericFloaterFilter(const std::string& strFloaterName); + bool filterFloaterGeneric(const std::string&, const LLSD&); boost::signals2::connection m_ConnFloaterGeneric; - bool filterFloaterShowLoc(const std::string&, const LLSD& ); boost::signals2::connection m_ConnFloaterShowLoc; // showloc bool filterFloaterViewXXX(const std::string&, const LLSD&); boost::signals2::connection m_ConnFloaterViewXXX; // viewnote, viewscript, viewtexture + bool canOpenSidebarTab(ERlvBehaviour, const std::string&, LLUICtrl*, const LLSD&); + boost::signals2::connection m_ConnSidePanelInventory; // showinv + /* * Helper functions */ From 1e1d5493de83c75001f2dec1f619af84b3af7942 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 27 May 2011 11:38:14 +0200 Subject: [PATCH 08/10] - review : review of RLVa code in LLSideTrayTab and LLSideTray -> a lot of code could be dropped in favour of using the new 'setTabDocked' over our custom 'toggleTabDocked' -> 'onTabDestroy' is no longer strictly necessary since the new LLFloaterSideTrayTab class will redock a tab when it is closed (which happens as part of being destroyed) --HG-- branch : RLVa --- indra/newview/llsidetray.cpp | 66 ++++++------------------------------ indra/newview/llsidetray.h | 16 +++------ indra/newview/rlvui.cpp | 2 +- 3 files changed, 16 insertions(+), 68 deletions(-) diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3ac14bfd45..870940ef74 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -172,7 +172,8 @@ LLSideTrayTab::LLSideTrayTab(const Params& p) LLSideTrayTab::~LLSideTrayTab() { -// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + // NOTE-RLVa: [RLVa-1.4.0a] This isn't really needed anymore with LLFloaterSideTrayTab since onClose will redock the tab anyway if (LLSideTray::instanceCreated()) LLSideTray::getInstance()->onTabDestroy(this); // [/RLVa:KB] @@ -262,18 +263,12 @@ void LLSideTrayTab::toggleTabDocked(bool toggle_floater /* = true */) LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", tab_name); if (!floater_tab) return; +// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.4.0a) | Added: RLVa-1.2.2c + if (floater_tab->isMinimized()) + floater_tab->setMinimized(FALSE); +// [/RLVa:KB] bool docking = !isDocked(); -// bool docking = LLFloater::isShown(floater_tab); -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c -// if (floater_tab->isMinimized()) -// floater_tab->setMinimized(FALSE); -// -// LLSideTray* pSideTray = getSideTray(); -// if (!pSideTray) return; -// -// bool docking = !pSideTray->isTabAttached(this); -// [/RLVa:KB] // Hide the "Tear Off" button when a tab gets undocked // and show "Dock" button instead. @@ -642,52 +637,13 @@ LLSideTrayTab* LLSideTray::getTab(const std::string& name) return findChild(name,false); } -//bool LLSideTray::isTabAttached(const std::string& name) -//{ -// LLSideTrayTab* tab = getTab(name); -// if (!tab) return false; -// -// return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end(); -//} - -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c bool LLSideTray::isTabAttached(const std::string& name) { LLSideTrayTab* tab = getTab(name); - return (tab) ? isTabAttached(tab) : false; -} + if (!tab) return false; -bool LLSideTray::isTabAttached(const LLSideTrayTab* tab) -{ return std::find(mTabs.begin(), mTabs.end(), tab) != mTabs.end(); } -// [/RLVa:KB] - -// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Added: RLVa-1.2.1a -void LLSideTray::toggleTabDocked(const std::string& strTabName) -{ - if (!isTabAttached(strTabName)) - { - for (child_vector_iter_t itTab = mDetachedTabs.begin(); itTab != mDetachedTabs.end(); ++itTab) - { - LLSideTrayTab* pTab = *itTab; - if (strTabName == pTab->getName()) - { - pTab->toggleTabDocked(); - break; - } - } - } - else - { - LLSideTrayTab* pTab = getTab(strTabName); - if (pTab) - { - pTab->toggleTabDocked(); - } - } -} -// [/RLVa:KB] bool LLSideTray::hasTabs() { @@ -933,7 +889,7 @@ bool LLSideTray::removeTab(LLSideTrayTab* tab) while ((*next_tab_it)->getName() == "sidebar_openclose"); // selectTabByName((*next_tab_it)->getName(), true); // Don't hide the tab being removed. -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // If there are no tabs that can be switched to then mActiveTab should be NULL rather than point to a now undocked tab if (!selectTabByName((*next_tab_it)->getName(), true)) mActiveTab = NULL; @@ -1091,7 +1047,7 @@ void LLSideTray::onToggleCollapse() collapseSideBar(); } -// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.4.0a) | Added: RLVa-1.2.2c bool LLSideTray::onTabDestroy(const LLSideTrayTab* tab) { child_vector_iter_t itDetachedTab = std::find(mDetachedTabs.begin(), mDetachedTabs.end(), tab); @@ -1226,7 +1182,7 @@ void LLSideTray::collapseSideBar() void LLSideTray::expandSideBar(bool open_active) { -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // Don't expand the sidebar unless the currently active tab's button is enabled, or we have another tab we can switch to const LLPanel* pActiveTab = getActiveTab(); const LLButton* pTabBtn = (pActiveTab) ? getButtonFromName(pActiveTab->getName()) : NULL; @@ -1515,7 +1471,7 @@ void LLSideTray::setVisibleWidthChangeCallback(const commit_signal_t::slot_type& mVisibleWidthChangeSignal.connect(cb); } -// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.4.0a) | Added: RLVa-1.2.0a const LLPanel* LLSideTray::getActiveTab() const { return mActiveTab; diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 25fb1f119e..9b2e687945 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -141,7 +141,7 @@ public: /* * get currently active tab */ -// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-03-01 (RLVa-1.4.0a) | Added: RLVa-1.2.0a // *sighs* LLSideTrayTab is defined in llsidetray.cpp... we can make do with an LLPanel* though const LLPanel* getActiveTab() const; // [/RLVa:KB] @@ -171,10 +171,10 @@ public: } LLPanel* getButtonsPanel() { return mButtonsPanel; } -// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a LLButton* getButtonFromName(const std::string& strName) { - std::map::const_iterator itBtn = mTabButtons.find(strName); + button_map_t::const_iterator itBtn = mTabButtons.find(strName); return (mTabButtons.end() != itBtn) ? itBtn->second : NULL; } // [/RLVa:KB] @@ -206,15 +206,7 @@ public: void handleLoginComplete(); -// bool isTabAttached (const std::string& name); -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c bool isTabAttached (const std::string& name); - bool isTabAttached (const LLSideTrayTab* tab); -// [/RLVa:KB] - -// [RLVa:KB] - Checked: 2010-09-07 (RLVa-1.2.1a) | Added: RLVa-1.2.1a - void toggleTabDocked(const std::string& strTabName); -// [/RLVa:KB] protected: bool addChild (LLView* view, S32 tab_group); @@ -239,7 +231,7 @@ protected: LLPanel* openChildPanel (LLSideTrayTab* tab, const std::string& panel_name, const LLSD& params); void onTabButtonClick(std::string name); -// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-13 (RLVa-1.4.0a) | Added: RLVa-1.2.2c bool onTabDestroy (const LLSideTrayTab* tab); // [/RLVa:KB] void onToggleCollapse(); diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 566e91c38a..3f566000ec 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -209,7 +209,7 @@ void RlvUIEnabler::onToggleShowInv(bool fQuitting) bool fCollapsed = pSideTray->getCollapsed(); const LLPanel* pActiveTab = pSideTray->getActiveTab(); - pSideTray->toggleTabDocked("sidebar_inventory"); + pSideTray->setTabDocked("sidebar_inventory", true, false); if (pActiveTab) pSideTray->selectTabByName(pActiveTab->getName()); From 1e730666549311ed190de3475458cd4414d85c74 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 27 May 2011 15:48:16 +0200 Subject: [PATCH 09/10] - review : partial review of RlvUIEnabler and related scattered code blocks --HG-- branch : RLVa --- indra/llmessage/llavatarnamecache.cpp | 6 +-- indra/llmessage/llavatarnamecache.h | 2 +- indra/llui/llfloaterreg.cpp | 4 +- indra/llui/llfloaterreg.h | 2 +- indra/newview/llagent.cpp | 5 ++- indra/newview/llhudtext.cpp | 13 +++---- indra/newview/llhudtext.h | 4 +- indra/newview/llmoveview.cpp | 29 ++++++++++++--- indra/newview/llmoveview.h | 5 ++- indra/newview/llpaneloutfitsinventory.h | 2 +- indra/newview/llviewerobject.cpp | 4 +- indra/newview/rlvhandler.cpp | 18 +-------- indra/newview/rlvhandler.h | 2 +- indra/newview/rlvui.cpp | 49 ++++++++++++++----------- indra/newview/rlvui.h | 14 +------ 15 files changed, 81 insertions(+), 78 deletions(-) diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 3124aa9977..148e3e0115 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -47,7 +47,7 @@ namespace LLAvatarNameCache // supports it. bool sUseDisplayNames = true; -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // RLVa override for display names bool sForceDisplayNames = false; // [/RLVa:KB] @@ -714,7 +714,7 @@ void LLAvatarNameCache::get(const LLUUID& agent_id, callback_slot_t slot) } } -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c bool LLAvatarNameCache::getForceDisplayNames() { return sForceDisplayNames; @@ -732,7 +732,7 @@ void LLAvatarNameCache::setForceDisplayNames(bool force) void LLAvatarNameCache::setUseDisplayNames(bool use) { -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c // We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it) use |= getForceDisplayNames(); // [/RLVa:KB] diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 41eb64a066..3846463f1c 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -80,7 +80,7 @@ namespace LLAvatarNameCache void setUseDisplayNames(bool use); bool useDisplayNames(); -// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c bool getForceDisplayNames(); void setForceDisplayNames(bool force); // [/RLVa:KB] diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 96061c2030..7cffdfa23f 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -45,7 +45,7 @@ std::set LLFloaterReg::sAlwaysShowableList; static LLFloaterRegListener sFloaterRegListener; -// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a LLFloaterReg::validate_signal_t LLFloaterReg::mValidateSignal; // [/RLVa:KB] @@ -221,7 +221,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, // if( sBlockShowFloaters // // see EXT-7090 // && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) -// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a if ( (sBlockShowFloaters && sAlwaysShowableList.find(name) == sAlwaysShowableList.end()) || (!mValidateSignal(name, key)) ) // [/RLVa:KB] return 0;// diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index ab3866c760..290e18b04b 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -75,7 +75,7 @@ private: */ static std::set sAlwaysShowableList; -// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a +// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a // Used to determine whether a floater can be shown public: typedef boost::signals2::signal validate_signal_t; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 76d45c4fa3..373ab4cf62 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -707,7 +707,10 @@ void LLAgent::setRegion(LLViewerRegion *regionp) LLSelectMgr::getInstance()->updateSelectionCenter(); - LLFloaterMove::sUpdateFlyingStatus(); +// LLFloaterMove::sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + LLFloaterMove::sUpdateMovementStatus(); +// [/RLVa:KB] } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 524fd3294d..98f22c3c5c 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -46,7 +46,7 @@ #include "llstatusbar.h" #include "llmenugl.h" #include "pipeline.h" -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.2a) +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) #include "rlvhandler.h" // [/RLVa:KB] #include @@ -258,7 +258,7 @@ void LLHUDText::setString(const std::string &text_utf8) { mTextSegments.clear(); // addLine(text_utf8, mColor); -// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.2a) | Modified: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f // NOTE: setString() is called for debug and map beacons as well if (rlv_handler_t::isEnabled()) { @@ -663,17 +663,14 @@ F32 LLHUDText::LLHUDTextSegment::getWidth(const LLFontGL* font) } } -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.2a) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f void LLHUDText::refreshAllObjectText() { - for (TextObjectIterator itText = sTextObjects.begin(); itText != sTextObjects.end(); itText++) + for (TextObjectIterator itText = sTextObjects.begin(); itText != sTextObjects.end(); ++itText) { LLHUDText* pText = *itText; - if ( (pText) && (!pText->mObjText.empty() && ("" != pText->mObjText) ) && - (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) ) - { + if ( (pText) && (!pText->mObjText.empty()) && (pText->mSourceObject) && (LL_PCODE_VOLUME == pText->mSourceObject->getPCode()) ) pText->setString(pText->mObjText); - } } } // [/RLVa:KB] diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 83e537e17a..d5d81e1336 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -124,7 +124,7 @@ public: static void reshape(); static void setDisplayText(BOOL flag) { sDisplayText = flag ; } -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.2a) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f const std::string& getObjectText() const { return mObjText; } void setObjectText(const std::string &utf8string) { mObjText = utf8string; } static void refreshAllObjectText(); @@ -166,7 +166,7 @@ private: ETextAlignment mTextAlignment; EVertAlignment mVertAlignment; BOOL mHidden; -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.2a) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f std::string mObjText; // [/RLVa:KB] diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index d7168ef55b..70af848748 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -149,7 +149,10 @@ BOOL LLFloaterMove::postBuild() initMovementMode(); - LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); +// LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateFlyingStatus); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(LLFloaterMove::sUpdateMovementStatus); +// [/RLVa:KB] return TRUE; } @@ -478,12 +481,23 @@ void LLFloaterMove::updatePosition() } //static -void LLFloaterMove::sUpdateFlyingStatus() +//void LLFloaterMove::sUpdateFlyingStatus() +//{ +// LLFloaterMove *floater = LLFloaterReg::findTypedInstance("moveview"); +// if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); +// +//} +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a +void LLFloaterMove::sUpdateMovementStatus() { - LLFloaterMove *floater = LLFloaterReg::findTypedInstance("moveview"); - if (floater) floater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); - + LLFloaterMove* pFloater = LLFloaterReg::findTypedInstance("moveview"); + if (pFloater) + { + pFloater->mModeControlButtonMap[MM_RUN]->setEnabled(gRlvHandler.hasBehaviour(RLV_BHVR_ALWAYSRUN)); + pFloater->mModeControlButtonMap[MM_FLY]->setEnabled(gAgent.canFly()); + } } +// [/RLVa:KB] void LLFloaterMove::showModeButtons(BOOL bShow) { @@ -529,7 +543,10 @@ void LLFloaterMove::onOpen(const LLSD& key) anchor_panel, this, getDockTongue(), LLDockControl::TOP)); - sUpdateFlyingStatus(); +// sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + sUpdateMovementStatus(); +// [/RLVa:KB] } //virtual diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h index 1b87864651..94804adf65 100644 --- a/indra/newview/llmoveview.h +++ b/indra/newview/llmoveview.h @@ -60,7 +60,10 @@ public: /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void setDocked(bool docked, bool pop_on_undock = true); - static void sUpdateFlyingStatus(); +// static void sUpdateFlyingStatus(); +// [RLVa:KB] - Checked: 2011-05-27 (RLVa-1.4.0a) | Added: RLVa-1.4.0a + static void sUpdateMovementStatus(); +// [/RLVa:KB] protected: void turnLeft(); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index ff9f212df8..77c8a472e0 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -56,7 +56,7 @@ public: static LLSidepanelAppearance* getAppearanceSP(); -// [RLVa:KB] - Checked: 2010-08-24 (RLVa-1.2.1a) | Added: RLVa-1.2.1a +// [RLVa:KB] - Checked: 2010-08-24 (RLVa-1.4.0a) | Added: RLVa-1.2.1a LLTabContainer* getAppearanceTabs() { return mAppearanceTabs; } LLOutfitsList* getMyOutfitsPanel() { return mMyOutfitsPanel; } LLPanelWearing* getCurrentOutfitPanel() { return mCurrentOutfitPanel; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 2c3094d9b0..63ab7b457b 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1104,7 +1104,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setString(temp_string); -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f if (rlv_handler_t::isEnabled()) { mText->setObjectText(temp_string); @@ -1502,7 +1502,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, coloru.mV[3] = 255 - coloru.mV[3]; mText->setColor(LLColor4(coloru)); mText->setString(temp_string); -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Added: RLVa-1.0.0f +// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) | Added: RLVa-1.0.0f if (rlv_handler_t::isEnabled()) { mText->setObjectText(temp_string); diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index b9eb3df141..043e420311 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -1236,22 +1236,6 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) pObj->mText->setString( (RLV_TYPE_ADD == eType) ? "" : pObj->mText->getObjectText()); } break; - case RLV_BHVR_ALWAYSRUN: // @alwaysrun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i - { - VERIFY_OPTION_REF(strOption.empty()); - - if (RLV_TYPE_ADD == eType) - gAgent.clearAlwaysRun(); - } - break; - case RLV_BHVR_TEMPRUN: // @temprun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i - { - VERIFY_OPTION_REF(strOption.empty()); - - if (RLV_TYPE_ADD == eType) - gAgent.clearTempRun(); - } - break; // The following block is only valid if there's no option case RLV_BHVR_SHOWLOC: // @showloc=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h case RLV_BHVR_SHOWNAMES: // @shownames=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h @@ -1287,6 +1271,8 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd) case RLV_BHVR_TOUCHALL: // @touchall=n|y - Checked: 2011-01-21 (RLVa-1.3.0e) | Added: RLVa-1.3.0e case RLV_BHVR_TOUCHME: // @touchme=n|y - Checked: 2011-04-11 (RLVa-1.3.0h) | Added: RLVa-1.3.0h case RLV_BHVR_FLY: // @fly=n|y - Checked: 2010-03-02 (RLVa-1.2.0a) + case RLV_BHVR_ALWAYSRUN: // @alwaysrun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + case RLV_BHVR_TEMPRUN: // @temprun=n|y - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i case RLV_BHVR_SETGROUP: // @setgroup=n|y - Checked: 2011-03-28 (RLVa-1.3.0f) | Added: RLVa-1.3.0f case RLV_BHVR_UNSIT: // @unsit=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h case RLV_BHVR_SIT: // @sit=n|y - Checked: 2009-12-05 (RLVa-1.1.0h) | Modified: RLVa-1.1.0h diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 209ad17a58..6f4a90ac92 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -263,7 +263,7 @@ inline bool RlvHandler::canSendIM(const LLUUID& idRecipient) const ( (!hasBehaviour(RLV_BHVR_SENDIMTO)) || (!isException(RLV_BHVR_SENDIMTO, idRecipient)) ); } -// Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.0.0f +// Checked: 2010-03-27 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f inline bool RlvHandler::canShowHoverText(const LLViewerObject *pObj) const { return ( (!pObj) || (LL_PCODE_VOLUME != pObj->getPCode()) || diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 3f566000ec..20cbf1c081 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -49,7 +49,7 @@ // ============================================================================ -// Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.2.0a +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a RlvUIEnabler::RlvUIEnabler() { // Connect us to the behaviour toggle signal @@ -62,6 +62,11 @@ RlvUIEnabler::RlvUIEnabler() m_Handlers.insert(std::pair(RLV_BHVR_SHOWHOVERTEXTWORLD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this))); m_Handlers.insert(std::pair(RLV_BHVR_SHOWHOVERTEXTHUD, boost::bind(&RlvUIEnabler::onRefreshHoverText, this))); + // onToggleMovement + m_Handlers.insert(std::pair(RLV_BHVR_FLY, boost::bind(&RlvUIEnabler::onToggleMovement, this))); + m_Handlers.insert(std::pair(RLV_BHVR_ALWAYSRUN, boost::bind(&RlvUIEnabler::onToggleMovement, this))); + m_Handlers.insert(std::pair(RLV_BHVR_TEMPRUN, boost::bind(&RlvUIEnabler::onToggleMovement, this))); + // onToggleViewXXX m_Handlers.insert(std::pair(RLV_BHVR_VIEWNOTE, boost::bind(&RlvUIEnabler::onToggleViewXXX, this))); m_Handlers.insert(std::pair(RLV_BHVR_VIEWSCRIPT, boost::bind(&RlvUIEnabler::onToggleViewXXX, this))); @@ -69,7 +74,6 @@ RlvUIEnabler::RlvUIEnabler() // onToggleXXX m_Handlers.insert(std::pair(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this))); - m_Handlers.insert(std::pair(RLV_BHVR_FLY, boost::bind(&RlvUIEnabler::onToggleFly, this))); m_Handlers.insert(std::pair(RLV_BHVR_REZ, boost::bind(&RlvUIEnabler::onToggleRez, this))); m_Handlers.insert(std::pair(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this))); m_Handlers.insert(std::pair(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this, _1))); @@ -109,7 +113,7 @@ void RlvUIEnabler::onBehaviour(ERlvBehaviour eBhvr, ERlvParamType eType) // ============================================================================ -// Checked: 2010-03-02 (RLVa-1.2.0b) | Added: RLVa-1.2.0a +// Checked: 2010-03-02 (RLVa-1.4.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onRefreshHoverText() { // Refresh all hover text each time any of the monitored behaviours get set or unset @@ -145,20 +149,21 @@ void RlvUIEnabler::onToggleEdit() removeGenericFloaterFilter("beacons"); } -// Checked: 2010-03-02 (RLVa-1.2.0d) | Added: RLVa-1.2.0a -void RlvUIEnabler::onToggleFly() +// Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a +void RlvUIEnabler::onToggleMovement() { - bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_FLY); - - // Drop the avie out of the sky if currently flying and restricted - if ( (!fEnable) && (gAgent.getFlying()) ) + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FLY)) && (gAgent.getFlying()) ) gAgent.setFlying(FALSE); + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_ALWAYSRUN)) && (gAgent.getAlwaysRun()) ) + gAgent.clearAlwaysRun(); + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_TEMPRUN)) && (gAgent.getTempRun()) ) + gAgent.clearTempRun(); // Force an update since the status only updates when the current parcel changes [see LLFloaterMove::postBuild()] - LLFloaterMove::sUpdateFlyingStatus(); + LLFloaterMove::sUpdateMovementStatus(); } -// Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d +// Checked: 2010-09-11 (RLVa-1.4.0a) | Added: RLVa-1.2.1d void RlvUIEnabler::onToggleRez() { // Enable/disable the "Build" bottom tray button @@ -188,7 +193,7 @@ void RlvUIEnabler::onToggleSetEnv() } } -// Checked: 2010-09-07 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a +// Checked: 2010-09-07 (RLVa-1.4.0a) | Modified: RLVa-1.2.1a void RlvUIEnabler::onToggleShowInv(bool fQuitting) { if (fQuitting) @@ -349,7 +354,7 @@ void RlvUIEnabler::onToggleShowLoc() m_ConnFloaterShowLoc.disconnect(); } -// Checked: 2010-02-28 (RLVa-1.2.0b) | Added: RLVa-1.2.0a +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onToggleShowMinimap() { bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWMINIMAP); @@ -370,11 +375,12 @@ void RlvUIEnabler::onToggleShowMinimap() // Enable/disable the "Mini-Map" bottom tray button const LLBottomTray* pTray = LLBottomTray::getInstance(); LLView* pBtnView = (pTray) ? pTray->getChildView("mini_map_btn") : NULL; + RLV_ASSERT(pBtnView); if (pBtnView) pBtnView->setEnabled(fEnable); } -// Checked: 2010-12-08 (RLVa-1.2.2c) | Modified: RLVa-1.2.2c +// Checked: 2010-12-08 (RLVa-1.4.0a) | Modified: RLVa-1.2.2c void RlvUIEnabler::onToggleShowNames(bool fQuitting) { if (fQuitting) @@ -406,7 +412,7 @@ void RlvUIEnabler::onToggleShowNames(bool fQuitting) LLVOAvatar::invalidateNameTags(); // See handleDisplayNamesOptionChanged() } -// Checked: 2010-02-28 (RLVa-1.2.0b) | Added: RLVa-1.2.0a +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onToggleShowWorldMap() { bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP); @@ -418,6 +424,7 @@ void RlvUIEnabler::onToggleShowWorldMap() // Enable/disable the "Map" bottom tray button const LLBottomTray* pTray = LLBottomTray::getInstance(); LLView* pBtnView = (pTray) ? pTray->getChildView("world_map_btn") : NULL; + RLV_ASSERT(pBtnView); if (pBtnView) pBtnView->setEnabled(fEnable); @@ -476,8 +483,8 @@ void RlvUIEnabler::onUpdateLoginLastLocation() // ============================================================================ -// Checked: 2010-02-28 (RLVa-1.2.0b) | Added: RLVa-1.2.0a -inline void RlvUIEnabler::addGenericFloaterFilter(const std::string& strFloaterName) +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a +void RlvUIEnabler::addGenericFloaterFilter(const std::string& strFloaterName) { m_FilteredFloaters.insert(strFloaterName); @@ -485,8 +492,8 @@ inline void RlvUIEnabler::addGenericFloaterFilter(const std::string& strFloaterN m_ConnFloaterGeneric = LLFloaterReg::setValidateCallback(boost::bind(&RlvUIEnabler::filterFloaterGeneric, this, _1, _2)); } -// Checked: 2010-02-28 (RLVa-1.2.0b) | Added: RLVa-1.2.0a -inline void RlvUIEnabler::removeGenericFloaterFilter(const std::string& strFloaterName) +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a +void RlvUIEnabler::removeGenericFloaterFilter(const std::string& strFloaterName) { std::multiset::iterator itFloater = m_FilteredFloaters.find(strFloaterName); RLV_ASSERT_DBG(itFloater != m_FilteredFloaters.end()); @@ -497,10 +504,10 @@ inline void RlvUIEnabler::removeGenericFloaterFilter(const std::string& strFloat m_ConnFloaterGeneric.disconnect(); } -// Checked: 2010-02-28 (RLVa-1.2.0b) | Added: RLVa-1.2.0a +// Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a bool RlvUIEnabler::filterFloaterGeneric(const std::string& strName, const LLSD&) { - return m_FilteredFloaters.find(strName) == m_FilteredFloaters.end(); + return m_FilteredFloaters.end() == m_FilteredFloaters.find(strName); } // Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index c21c3c245f..fdb92fca80 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -37,8 +37,6 @@ protected: * Signal callbacks */ public: - typedef boost::function behaviour_handler_t; - void addBehaviourToggleCallback(ERlvBehaviour eBhvr, behaviour_handler_t cb); void onBehaviour(ERlvBehaviour eBhvr, ERlvParamType eType); // RlvHandler::rlv_behaviour_signal_t /* @@ -47,7 +45,7 @@ public: protected: void onRefreshHoverText(); // showloc, shownames, showhovertext(all|world|hud) void onToggleEdit(); // edit - void onToggleFly(); // fly + void onToggleMovement(); // fly, alwaysrun and temprun void onToggleRez(); // rez void onToggleSetEnv(); // setenv void onToggleShowInv(bool fQuitting); // showinv @@ -91,21 +89,13 @@ public: * Member variables */ protected: + typedef boost::function behaviour_handler_t; typedef std::multimap behaviour_handler_map_t; behaviour_handler_map_t m_Handlers; std::multiset m_FilteredFloaters; }; -// ============================================================================ -// Inlined member functions - -// Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a -inline void RlvUIEnabler::addBehaviourToggleCallback(ERlvBehaviour eBhvr, behaviour_handler_t cb) -{ - m_Handlers.insert(std::pair(eBhvr, cb)); -} - // ============================================================================ #endif // RLV_UI_H From 0b8099dc751ecec1cab736dd327084178d9c63be Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sat, 28 May 2011 02:36:26 +0200 Subject: [PATCH 10/10] - internal : hide locked debug settings with LLControlVariable::setHiddenFromSettingsEditor() --HG-- branch : RLVa --- indra/newview/llfloatersettingsdebug.cpp | 41 +++++++----------------- indra/newview/rlvcommon.cpp | 6 ++++ indra/newview/rlvui.cpp | 17 ++++++++++ indra/newview/rlvui.h | 1 + 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 354c90a0ce..796710bfb0 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -34,10 +34,6 @@ #include "llcolorswatch.h" #include "llviewercontrol.h" #include "lltexteditor.h" -// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) -#include "rlvhandler.h" -#include "rlvextensions.h" -// [/RLVa:KB] LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) @@ -213,31 +209,18 @@ void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) if (controlp) { -// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0e) | Modified: RLVa-0.2.1d - // TODO-RLVa: [RLVa-1.2.1] Look into rewriting the whole debug setting blocking code - if (rlv_handler_t::isEnabled()) - { - // Don't allow changing DBG_WRITE debug settings under @setdebug=n - bool fEnable = !( (gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG)) && - (RlvExtGetSet::getDebugSettingFlags(controlp->getName()) & RlvExtGetSet::DBG_WRITE) ); - // Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n - fEnable &= !((gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) && - (("VertexShaderEnable" == controlp->getName()) || ("WindLightUseAtmosShaders" == controlp->getName()))); -#ifdef RLV_EXTENSION_STARTLOCATION - // Don't allow toggling RestrainedLoveLoginLastLocation - fEnable &= !(RLV_SETTING_LOGINLASTLOCATION == controlp->getName()); -#endif // RLV_EXTENSION_STARTLOCATION - - // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() - spinner1->setEnabled(fEnable); - spinner2->setEnabled(fEnable); - spinner3->setEnabled(fEnable); - spinner4->setEnabled(fEnable); - color_swatch->setEnabled(fEnable); - childSetEnabled("val_text", fEnable); - childSetEnabled("boolean_combo", fEnable); - childSetEnabled("default_btn", fEnable); - } +// [RLVa:KB] - Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a + // If "HideFromEditor" was toggled while the floater is open then we need to manually disable access to the control + // NOTE: this runs per-frame so there's no need to explictly handle onCommitSettings() or onClickDefault() + bool fEnable = !controlp->isHiddenFromSettingsEditor(); + spinner1->setEnabled(fEnable); + spinner2->setEnabled(fEnable); + spinner3->setEnabled(fEnable); + spinner4->setEnabled(fEnable); + color_swatch->setEnabled(fEnable); + childSetEnabled("val_text", fEnable); + childSetEnabled("boolean_combo", fEnable); + childSetEnabled("default_btn", fEnable); // [/RLVa:KB] eControlType type = controlp->type(); diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 8ba3d257e0..66f2f14006 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -92,6 +92,12 @@ void RlvSettings::initClass() if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags)); +#ifdef RLV_EXTENSION_STARTLOCATION + // Don't allow toggling RLVaLoginLastLocation from the debug settings floater + if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) + gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true); +#endif // RLV_EXTENSION_STARTLOCATION + if (gSavedSettings.controlExists(RLV_SETTING_AVATAROFFSET_Z)) gSavedSettings.getControl(RLV_SETTING_AVATAROFFSET_Z)->getSignal()->connect(boost::bind(&onChangedAvatarOffset, _2)); diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index bcbc32cfd1..2392b05bf9 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -46,6 +46,7 @@ #include "rlvui.h" #include "rlvhandler.h" +#include "rlvextensions.h" // ============================================================================ @@ -75,6 +76,7 @@ RlvUIEnabler::RlvUIEnabler() // onToggleXXX m_Handlers.insert(std::pair(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this))); m_Handlers.insert(std::pair(RLV_BHVR_REZ, boost::bind(&RlvUIEnabler::onToggleRez, this))); + m_Handlers.insert(std::pair(RLV_BHVR_SETDEBUG, boost::bind(&RlvUIEnabler::onToggleSetDebug, this))); m_Handlers.insert(std::pair(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this))); m_Handlers.insert(std::pair(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this, _1))); m_Handlers.insert(std::pair(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this))); @@ -164,6 +166,17 @@ void RlvUIEnabler::onToggleRez() LLBottomTray::getInstance()->getChild("build_btn")->setEnabled(isBuildEnabled()); } +// Checked: 2011-05-28 (RLVa-1.4.0a) | Added: RLVa-1.4.0a +void RlvUIEnabler::onToggleSetDebug() +{ + bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SETDEBUG); + for (auto itSetting = RlvExtGetSet::m_DbgAllowed.cbegin(); itSetting != RlvExtGetSet::m_DbgAllowed.cend(); ++itSetting) + { + if (itSetting->second & RlvExtGetSet::DBG_WRITE) + gSavedSettings.getControl(itSetting->first)->setHiddenFromSettingsEditor(!fEnable); + } +} + // Checked: 2010-03-17 (RLVa-1.2.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onToggleSetEnv() { @@ -185,6 +198,10 @@ void RlvUIEnabler::onToggleSetEnv() removeGenericFloaterFilter(strEnvFloaters[idxFloater]); } } + + // Don't allow toggling "Basic Shaders" and/or "Atmopsheric Shaders" through the debug settings under @setenv=n + gSavedSettings.getControl("VertexShaderEnable")->setHiddenFromSettingsEditor(!fEnable); + gSavedSettings.getControl("WindLightUseAtmosShaders")->setHiddenFromSettingsEditor(!fEnable); } // Checked: 2010-09-07 (RLVa-1.4.0a) | Modified: RLVa-1.2.1a diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index f692413524..166d3f7524 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -47,6 +47,7 @@ protected: void onToggleEdit(); // edit void onToggleMovement(); // fly, alwaysrun and temprun void onToggleRez(); // rez + void onToggleSetDebug(); // setdebug void onToggleSetEnv(); // setenv void onToggleShowInv(bool fQuitting); // showinv void onToggleShowLoc(); // showloc