diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lightshare.cpp | 91 |
1 files changed, 48 insertions, 43 deletions
diff --git a/linden/indra/newview/lightshare.cpp b/linden/indra/newview/lightshare.cpp index 29eab07..e7c3410 100644 --- a/linden/indra/newview/lightshare.cpp +++ b/linden/indra/newview/lightshare.cpp | |||
@@ -102,53 +102,58 @@ WindlightMessage::~WindlightMessage() | |||
102 | // static | 102 | // static |
103 | void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) | 103 | void WindlightMessage::processWindlight(LLMessageSystem* msg, void**) |
104 | { | 104 | { |
105 | if( gSavedSettings.getBOOL("UseServersideWindlightSettings") ) | 105 | if( !gSavedSettings.getBOOL("UseServersideWindlightSettings") ) |
106 | return; | ||
107 | |||
108 | WindlightMessage* wl = new WindlightMessage(msg); | ||
109 | |||
110 | if( !wl->isValid() ) | ||
111 | return; | ||
112 | |||
113 | std::string water = LLWaterParamManager::instance()->mCurParams.mName; | ||
114 | std::string sky = LLWLParamManager::instance()->mCurParams.mName; | ||
115 | |||
116 | // If they are using the default or region settings, just apply | ||
117 | // the new settings, don't bother asking. | ||
118 | if( (sky == "Default" || sky == sSkyPresetName) && | ||
119 | (water == "Default" || water == sWaterPresetName) ) | ||
120 | { | ||
121 | wl->apply(); | ||
122 | delete wl; | ||
123 | return; | ||
124 | } | ||
125 | |||
126 | if( !ignoreTimerHasExpired() ) | ||
106 | { | 127 | { |
107 | WindlightMessage* wl = new WindlightMessage(msg); | 128 | // The user recently ignored a windlight message, so ignore |
108 | if( wl->isValid() ) | 129 | // this one too, and reset the timer. |
109 | { | 130 | resetIgnoreTimer(); |
110 | std::string water = LLWaterParamManager::instance()->mCurParams.mName; | 131 | delete wl; |
111 | std::string sky = LLWLParamManager::instance()->mCurParams.mName; | 132 | return; |
112 | 133 | } | |
113 | // If they are using the default or region settings, just apply | 134 | |
114 | // the new settings, don't bother asking. | 135 | if( sMostRecent == NULL ) |
115 | if((sky == "Default" || sky == sSkyPresetName) && | 136 | { |
116 | (water == "Default" || water == sWaterPresetName)) | 137 | // No most recent, so store this and create notification |
117 | { | 138 | // asking the user whether to apply or not. |
118 | wl->apply(); | 139 | sMostRecent = wl; |
119 | delete wl; | 140 | LLNotifications::instance() |
120 | } | 141 | .add("ConfirmLightShare", |
121 | else if( !ignoreTimerHasExpired() ) | 142 | LLSD(), LLSD(), |
122 | { | 143 | boost::bind(&applyCallback, _1, _2)); |
123 | // The user recently ignored a windlight message, so ignore | 144 | return; |
124 | // this one too, and reset the timer. | 145 | } |
125 | resetIgnoreTimer(); | 146 | else |
126 | delete wl; | 147 | { |
127 | } | 148 | // No new notification (to avoid spamming the user), just |
128 | else | 149 | // store this as most recent. |
129 | { | 150 | delete sMostRecent; |
130 | if( sMostRecent == NULL ) | 151 | sMostRecent = wl; |
131 | { | 152 | return; |
132 | // No most recent, so store this and create notification | ||
133 | // asking the user whether to apply or not. | ||
134 | sMostRecent = wl; | ||
135 | LLNotifications::instance() | ||
136 | .add("ConfirmLightShare", | ||
137 | LLSD(), LLSD(), | ||
138 | boost::bind(&applyCallback, _1, _2)); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | // No new notification (to avoid spamming the user), just | ||
143 | // store this as most recent. | ||
144 | delete sMostRecent; | ||
145 | sMostRecent = wl; | ||
146 | } | ||
147 | } | ||
148 | } | ||
149 | } | 153 | } |
150 | } | 154 | } |
151 | 155 | ||
156 | |||
152 | // static | 157 | // static |
153 | bool WindlightMessage::applyCallback(const LLSD& notification, | 158 | bool WindlightMessage::applyCallback(const LLSD& notification, |
154 | const LLSD& response) | 159 | const LLSD& response) |