From 7e16e0624ad92c9a1da5bd4975b8f6baf142213e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 7 May 2011 01:41:28 -0500 Subject: [PATCH] Scare everyone with a big-arsed warning. Horray! --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llagent.cpp | 51 ++++++++++++++++--- indra/newview/llappviewer.cpp | 1 + .../skins/default/xui/en-us/notifications.xml | 23 +++++++++ 4 files changed, 78 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 038090663..b821681a3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13707,6 +13707,17 @@ Value 1 + WarnFirstPhysicsWearable + + Comment + Enables Physics Wearable warning dialog + Persist + 1 + Type + Boolean + Value + 1 + WatchdogEnabled Comment diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index eb965d161..49dee2357 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -7733,7 +7733,8 @@ void LLAgent::sendAgentSetAppearance() } - const bool wearing_physics = !!getWearable(WT_PHYSICS); + static bool send_physics_params = false; + send_physics_params |= !!getWearable(WT_PHYSICS); S32 transmitted_params = 0; for (LLViewerVisualParam* param = (LLViewerVisualParam*)mAvatarObject->getFirstVisualParam(); param; @@ -7741,17 +7742,17 @@ void LLAgent::sendAgentSetAppearance() { if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) // do not transmit params of group VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT { - msg->nextBlockFast(_PREHASH_VisualParam ); - - // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. - const F32 param_value = param->getWeight(); - const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); - msg->addU8Fast(_PREHASH_ParamValue, new_weight ); //A hack to prevent ruthing on older viewers when phys wearables aren't being worn. - if(!wearing_physics && param->getID() >= 10000) + if(!send_physics_params && param->getID() >= 10000) { break; } + msg->nextBlockFast(_PREHASH_VisualParam ); + // We don't send the param ids. Instead, we assume that the receiver has the same params in the same sequence. + const F32 param_value = param->getWeight(); + const U8 new_weight = F32_to_U8(param_value, param->getMinWeight(), param->getMaxWeight()); + + msg->addU8Fast(_PREHASH_ParamValue, new_weight ); transmitted_params++; } } @@ -7892,6 +7893,30 @@ struct LLSetWearableData LLWearable* mNewWearable; }; +static bool isFirstPhysicsWearable(EWearableType type, LLInventoryItem *new_item, LLWearable *new_wearable) +{ + if (type == WT_PHYSICS && gSavedSettings.getWarning("FirstPhysicsWearable")) + { + class WearableDelayedCallback + { + public: + static void setDelayedWearable( const LLSD& notification, const LLSD& response, LLUUID item_id, LLWearable *wearable ) + { + if(LLNotification::getSelectedOption(notification, response) == 0) //User selected wear + { + gSavedSettings.setWarning("FirstPhysicsWearable",FALSE); + LLInventoryItem *item = gInventory.getItem(item_id); + if(item) + gAgent.setWearable(item,wearable); //re-enter. + } + } + }; + LLNotifications::instance().add("FirstPhysicsWearable",LLSD(),LLSD(),boost::bind(WearableDelayedCallback::setDelayedWearable, _1, _2, new_item->getUUID(),new_wearable)); + return true; + } + return false; +} + BOOL LLAgent::needsReplacement(EWearableType wearableType, S32 remove) { return TRUE; @@ -7961,6 +7986,11 @@ void LLAgent::setWearableOutfit( } } + if (isFirstPhysicsWearable(type, new_item, new_wearable)) + { + return; + } + mWearableEntry[ type ].mItemID = new_item->getUUID(); mWearableEntry[ type ].mWearable = new_wearable; } @@ -8025,6 +8055,11 @@ void LLAgent::setWearable( LLInventoryItem* new_item, LLWearable* new_wearable ) } // [/RLVa:KB] + if (isFirstPhysicsWearable(type, new_item, new_wearable)) + { + return; + } + if( old_wearable ) { const LLUUID& old_item_id = mWearableEntry[ type ].mItemID; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 38ae9202e..d9b80c9dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1791,6 +1791,7 @@ bool LLAppViewer::initConfiguration() LLFirstUse::addConfigVariable("FirstSculptedPrim"); LLFirstUse::addConfigVariable("FirstVoice"); LLFirstUse::addConfigVariable("FirstMedia"); + LLFirstUse::addConfigVariable("FirstPhysicsWearable"); // [RLVa:KB] - Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a //LLFirstUse::addConfigVariable(RLV_SETTING_FIRSTUSE_DETACH); diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 066eeee85..a6f57bbf3 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6940,5 +6940,28 @@ No Blocked chat-spam from avatar [FULL_NAME] ([SOURCE]) Blocked chat-spam from objects owned by [OWNER] ([SOURCE]) + +By wearing a Physics Wearable certain server behavior will be enabled that many older viewers are incompatable with. On such viewers you may display incorrectly (often as 'Ruth'). + +If you wish to keep compatability with old viewers then you must not wear a Physics Wearable during your session. If you have already worn one during this session remove it and reconnect. + +Click 'Wear' to attach the Physics Wearable, or click 'Cancel' if you wish to maintain compatability with legacy clients. + +
+