From 52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 30 Jul 2010 01:39:50 -0500 Subject: Added notification option to ignore all LightShare until you change regions. --- linden/indra/newview/lightshare.cpp | 37 ++++++++++++++++++---- linden/indra/newview/lightshare.h | 2 ++ linden/indra/newview/llviewermessage.cpp | 7 ++++ .../skins/default/xui/en-us/notifications.xml | 15 +++------ 4 files changed, 45 insertions(+), 16 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index e7c3410..b2bbb96 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp @@ -48,6 +48,7 @@ const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; WindlightMessage* WindlightMessage::sMostRecent = NULL; LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); +bool WindlightMessage::sIgnoreRegion = false; WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : @@ -132,6 +133,13 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) return; } + if(sIgnoreRegion) + { + // We are ignoring new settings until user enters a new region. + delete wl; + return; + } + if( sMostRecent == NULL ) { // No most recent, so store this and create notification @@ -160,13 +168,23 @@ bool WindlightMessage::applyCallback(const LLSD& notification, { S32 option = LLNotification::getSelectedOption(notification, response); - if( option == 0 ) // "Apply" + switch(option) { - sMostRecent->apply(); - } - else if( option == 2 ) // "Ignore" - { - resetIgnoreTimer(); + case 0:{ + // "Apply" + sMostRecent->apply(); + break; + } + case 1:{ + // "Not Now", ignore until the region stops spamming + resetIgnoreTimer(); + break; + } + case 2:{ + // "Ignore", ignore all until user leaves the region + sIgnoreRegion = true; + break; + } } delete sMostRecent; @@ -177,6 +195,13 @@ bool WindlightMessage::applyCallback(const LLSD& notification, // static +void WindlightMessage::resetRegion() +{ + sIgnoreRegion = false; +} + + +// static void WindlightMessage::resetIgnoreTimer() { F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); diff --git a/linden/indra/newview/lightshare.h b/linden/indra/newview/lightshare.h index 5b24ae3..0b2965e 100644 --- a/linden/indra/newview/lightshare.h +++ b/linden/indra/newview/lightshare.h @@ -51,6 +51,7 @@ class WindlightMessage static void processWindlight(LLMessageSystem* msg, void**); static bool applyCallback(const LLSD& notification, const LLSD& response); + static void resetRegion(); bool apply(); bool isValid(); @@ -64,6 +65,7 @@ class WindlightMessage static WindlightMessage* sMostRecent; static LLTimer* sIgnoreTimer; + static bool sIgnoreRegion; Meta7WindlightPacket* mPacket; LLWaterParamSet* mWater; diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 353fd9f..bc1aedb 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -65,6 +65,7 @@ #include "lltimer.h" #include "llmd5.h" +#include "lightshare.h" #include "llagent.h" #include "llcallingcard.h" #include "llconsole.h" @@ -3253,6 +3254,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // gTeleportDisplay = TRUE; // gTeleportDisplayTimer.reset(); // gViewerWindow->setShowProgress(TRUE); + + // Tell the LightShare handler that we have changed regions. + WindlightMessage::resetRegion(); } // stuff we have to do every time we get an AvatarInitComplete from a sim @@ -3500,6 +3504,9 @@ void process_crossed_region(LLMessageSystem* msg, void**) LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); regionp->setSeedCapability(seedCap); + + // Tell the LightShare handler that we have changed regions. + WindlightMessage::resetRegion(); } diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index 2a0af02..c59d713 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6996,18 +6996,13 @@ Note: To comply with the Second Life Terms of Service, Imprudence did not downlo name="ConfirmLightShare" type="notify" icon="notify.tga"> -This region has custom sky and water settings. +This region is broadcasting custom sky and water settings. -Apply region settings now? +Apply this region's settings? ("Ignore" will ignore all region settings until you leave this region.)
-