diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/lightshare.cpp | 31 | ||||
-rw-r--r-- | linden/indra/newview/lightshare.h | 7 |
3 files changed, 48 insertions, 1 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index a59fac6..e2871ad 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -310,6 +310,17 @@ | |||
310 | <key>Value</key> | 310 | <key>Value</key> |
311 | <integer>0</integer> | 311 | <integer>0</integer> |
312 | </map> | 312 | </map> |
313 | <key>LightShareIgnoreTimer</key> | ||
314 | <map> | ||
315 | <key>Comment</key> | ||
316 | <string>After ignoring a region Windlight settings message, new messages are ignored for this many seconds. The timer starts again each time a message is ignored.</string> | ||
317 | <key>Persist</key> | ||
318 | <integer>1</integer> | ||
319 | <key>Type</key> | ||
320 | <string>F32</string> | ||
321 | <key>Value</key> | ||
322 | <integer>30</integer> | ||
323 | </map> | ||
313 | <key>MapShowAgentCount</key> | 324 | <key>MapShowAgentCount</key> |
314 | <map> | 325 | <map> |
315 | <key>Comment</key> | 326 | <key>Comment</key> |
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 @@ | |||
45 | const std::string WindlightMessage::sWaterPresetName = "(Region settings)"; | 45 | const std::string WindlightMessage::sWaterPresetName = "(Region settings)"; |
46 | const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; | 46 | const std::string WindlightMessage::sSkyPresetName = "(Region settings)"; |
47 | 47 | ||
48 | |||
48 | WindlightMessage* WindlightMessage::sMostRecent = NULL; | 49 | WindlightMessage* WindlightMessage::sMostRecent = NULL; |
50 | LLTimer* WindlightMessage::sIgnoreTimer = new LLTimer(); | ||
49 | 51 | ||
50 | 52 | ||
51 | WindlightMessage::WindlightMessage( LLMessageSystem* msg ) : | 53 | WindlightMessage::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 | ||
175 | void WindlightMessage::resetIgnoreTimer() | ||
176 | { | ||
177 | F32 time = gSavedSettings.getF32("LightShareIgnoreTimer"); | ||
178 | sIgnoreTimer->start(); | ||
179 | sIgnoreTimer->setTimerExpirySec( (time < 0) ? 0 : time ); | ||
180 | } | ||
181 | |||
182 | // static | ||
183 | bool WindlightMessage::ignoreTimerHasExpired() | ||
184 | { | ||
185 | return sIgnoreTimer->hasExpired(); | ||
186 | } | ||
187 | |||
188 | |||
160 | bool WindlightMessage::apply() | 189 | bool WindlightMessage::apply() |
161 | { | 190 | { |
162 | LLWaterParamManager* water_mgr = LLWaterParamManager::instance(); | 191 | LLWaterParamManager* water_mgr = LLWaterParamManager::instance(); |
diff --git a/linden/indra/newview/lightshare.h b/linden/indra/newview/lightshare.h index cbc03ad..5b24ae3 100644 --- a/linden/indra/newview/lightshare.h +++ b/linden/indra/newview/lightshare.h | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | #include "message.h" | 32 | #include "message.h" |
33 | #include "meta7windlight.h" | 33 | #include "meta7windlight.h" |
34 | #include "lltimer.h" | ||
34 | #include "llwaterparamset.h" | 35 | #include "llwaterparamset.h" |
35 | #include "llwlparamset.h" | 36 | #include "llwlparamset.h" |
36 | 37 | ||
@@ -54,9 +55,15 @@ class WindlightMessage | |||
54 | bool apply(); | 55 | bool apply(); |
55 | bool isValid(); | 56 | bool isValid(); |
56 | 57 | ||
58 | protected: | ||
59 | |||
60 | static void resetIgnoreTimer(); | ||
61 | static bool ignoreTimerHasExpired(); | ||
62 | |||
57 | private: | 63 | private: |
58 | 64 | ||
59 | static WindlightMessage* sMostRecent; | 65 | static WindlightMessage* sMostRecent; |
66 | static LLTimer* sIgnoreTimer; | ||
60 | 67 | ||
61 | Meta7WindlightPacket* mPacket; | 68 | Meta7WindlightPacket* mPacket; |
62 | LLWaterParamSet* mWater; | 69 | LLWaterParamSet* mWater; |