aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview
diff options
context:
space:
mode:
authorJacek Antonelli2010-07-30 01:39:50 -0500
committerJacek Antonelli2010-08-01 00:32:24 -0500
commit52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9 (patch)
tree20e64166a3f2a417ccd5ebd2cad997928a0a60a9 /linden/indra/newview
parentRestructured WindlightMessage::processWindlight(). (diff)
downloadmeta-impy-52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9.zip
meta-impy-52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9.tar.gz
meta-impy-52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9.tar.bz2
meta-impy-52837b1a3b63eaa07cc784c4b4aca0e98e8e43e9.tar.xz
Added notification option to ignore all LightShare until you change regions.
Diffstat (limited to 'linden/indra/newview')
-rw-r--r--linden/indra/newview/lightshare.cpp37
-rw-r--r--linden/indra/newview/lightshare.h2
-rw-r--r--linden/indra/newview/llviewermessage.cpp7
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml15
4 files changed, 45 insertions, 16 deletions
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)";
48 48
49WindlightMessage* WindlightMessage::sMostRecent = NULL; 49WindlightMessage* WindlightMessage::sMostRecent = NULL;
50LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); 50LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer();
51bool WindlightMessage::sIgnoreRegion = false;
51 52
52 53
53WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : 54WindlightMessage::WindlightMessage( LLMessageSystem* msg ) :
@@ -132,6 +133,13 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**)
132 return; 133 return;
133 } 134 }
134 135
136 if(sIgnoreRegion)
137 {
138 // We are ignoring new settings until user enters a new region.
139 delete wl;
140 return;
141 }
142
135 if( sMostRecent == NULL ) 143 if( sMostRecent == NULL )
136 { 144 {
137 // No most recent, so store this and create notification 145 // No most recent, so store this and create notification
@@ -160,13 +168,23 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
160{ 168{
161 S32 option = LLNotification::getSelectedOption(notification, response); 169 S32 option = LLNotification::getSelectedOption(notification, response);
162 170
163 if( option == 0 ) // "Apply" 171 switch(option)
164 { 172 {
165 sMostRecent->apply(); 173 case 0:{
166 } 174 // "Apply"
167 else if( option == 2 ) // "Ignore" 175 sMostRecent->apply();
168 { 176 break;
169 resetIgnoreTimer(); 177 }
178 case 1:{
179 // "Not Now", ignore until the region stops spamming
180 resetIgnoreTimer();
181 break;
182 }
183 case 2:{
184 // "Ignore", ignore all until user leaves the region
185 sIgnoreRegion = true;
186 break;
187 }
170 } 188 }
171 189
172 delete sMostRecent; 190 delete sMostRecent;
@@ -177,6 +195,13 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
177 195
178 196
179// static 197// static
198void WindlightMessage::resetRegion()
199{
200 sIgnoreRegion = false;
201}
202
203
204// static
180void WindlightMessage::resetIgnoreTimer() 205void WindlightMessage::resetIgnoreTimer()
181{ 206{
182 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); 207 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
51 static void processWindlight(LLMessageSystem* msg, void**); 51 static void processWindlight(LLMessageSystem* msg, void**);
52 static bool applyCallback(const LLSD& notification, 52 static bool applyCallback(const LLSD& notification,
53 const LLSD& response); 53 const LLSD& response);
54 static void resetRegion();
54 55
55 bool apply(); 56 bool apply();
56 bool isValid(); 57 bool isValid();
@@ -64,6 +65,7 @@ class WindlightMessage
64 65
65 static WindlightMessage* sMostRecent; 66 static WindlightMessage* sMostRecent;
66 static LLTimer* sIgnoreTimer; 67 static LLTimer* sIgnoreTimer;
68 static bool sIgnoreRegion;
67 69
68 Meta7WindlightPacket* mPacket; 70 Meta7WindlightPacket* mPacket;
69 LLWaterParamSet* mWater; 71 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 @@
65#include "lltimer.h" 65#include "lltimer.h"
66#include "llmd5.h" 66#include "llmd5.h"
67 67
68#include "lightshare.h"
68#include "llagent.h" 69#include "llagent.h"
69#include "llcallingcard.h" 70#include "llcallingcard.h"
70#include "llconsole.h" 71#include "llconsole.h"
@@ -3253,6 +3254,9 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3253// gTeleportDisplay = TRUE; 3254// gTeleportDisplay = TRUE;
3254// gTeleportDisplayTimer.reset(); 3255// gTeleportDisplayTimer.reset();
3255// gViewerWindow->setShowProgress(TRUE); 3256// gViewerWindow->setShowProgress(TRUE);
3257
3258 // Tell the LightShare handler that we have changed regions.
3259 WindlightMessage::resetRegion();
3256} 3260}
3257 3261
3258// stuff we have to do every time we get an AvatarInitComplete from a sim 3262// 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**)
3500 3504
3501 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); 3505 LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host);
3502 regionp->setSeedCapability(seedCap); 3506 regionp->setSeedCapability(seedCap);
3507
3508 // Tell the LightShare handler that we have changed regions.
3509 WindlightMessage::resetRegion();
3503} 3510}
3504 3511
3505 3512
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
6996 name="ConfirmLightShare" 6996 name="ConfirmLightShare"
6997 type="notify" 6997 type="notify"
6998 icon="notify.tga"> 6998 icon="notify.tga">
6999This region has custom sky and water settings. 6999This region is broadcasting custom sky and water settings.
7000 7000
7001Apply region settings now? 7001Apply this region's settings? ("Ignore" will ignore all region settings until you leave this region.)
7002 <form name="form"> 7002 <form name="form">
7003 <button 7003 <button index="0" name="apply" text="Apply"/>
7004 index="0" 7004 <button index="1" name="temp" text="Not Now"/>
7005 name="Apply" 7005 <button index="2" name="region" text="Ignore"/>
7006 text="Apply"/>
7007 <button
7008 index="2"
7009 name="Ignore"
7010 text="Ignore"/>
7011 </form> 7006 </form>
7012</notification> 7007</notification>
7013 7008