aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lightshare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lightshare.cpp')
-rw-r--r--linden/indra/newview/lightshare.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp
index c9f34ee..29eab07 100644
--- a/linden/indra/newview/lightshare.cpp
+++ b/linden/indra/newview/lightshare.cpp
@@ -45,7 +45,9 @@
45const std::string WindlightMessage::sWaterPresetName = "(Region settings)"; 45const std::string WindlightMessage::sWaterPresetName = "(Region settings)";
46const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; 46const std::string WindlightMessage::sSkyPresetName = "(Region settings)";
47 47
48
48WindlightMessage* WindlightMessage::sMostRecent = NULL; 49WindlightMessage* WindlightMessage::sMostRecent = NULL;
50LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer();
49 51
50 52
51WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : 53WindlightMessage::WindlightMessage( LLMessageSystem* msg ) :
@@ -116,6 +118,13 @@ void WindlightMessage::processWindlight(LLMessageSystem* msg, void**)
116 wl->apply(); 118 wl->apply();
117 delete wl; 119 delete wl;
118 } 120 }
121 else if( !ignoreTimerHasExpired() )
122 {
123 // The user recently ignored a windlight message, so ignore
124 // this one too, and reset the timer.
125 resetIgnoreTimer();
126 delete wl;
127 }
119 else 128 else
120 { 129 {
121 if( sMostRecent == NULL ) 130 if( sMostRecent == NULL )
@@ -145,10 +154,15 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
145 const LLSD& response) 154 const LLSD& response)
146{ 155{
147 S32 option = LLNotification::getSelectedOption(notification, response); 156 S32 option = LLNotification::getSelectedOption(notification, response);
148 if( option == 0 ) 157
158 if( option == 0 ) // "Apply"
149 { 159 {
150 sMostRecent->apply(); 160 sMostRecent->apply();
151 } 161 }
162 else if( option == 2 ) // "Ignore"
163 {
164 resetIgnoreTimer();
165 }
152 166
153 delete sMostRecent; 167 delete sMostRecent;
154 sMostRecent = NULL; 168 sMostRecent = NULL;
@@ -157,6 +171,21 @@ bool WindlightMessage::applyCallback(const LLSD& notification,
157} 171}
158 172
159 173
174// static
175void WindlightMessage::resetIgnoreTimer()
176{
177 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer");
178 sIgnoreTimer->start();
179 sIgnoreTimer->setTimerExpirySec( (time < 0) ? 0 : time );
180}
181
182// static
183bool WindlightMessage::ignoreTimerHasExpired()
184{
185 return sIgnoreTimer->hasExpired();
186}
187
188
160bool WindlightMessage::apply() 189bool WindlightMessage::apply()
161{ 190{
162 LLWaterParamManager* water_mgr = LLWaterParamManager::instance(); 191 LLWaterParamManager* water_mgr = LLWaterParamManager::instance();