aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRevolutionSmythe2010-10-20 16:31:09 -0500
committerMcCabe Maxsted2010-11-01 16:58:02 -0700
commitaf6877fbfe94e80948c559cf77f008049f8168dc (patch)
tree4fe687aaec6a1b964a0e989d3c03c143b4ab07f6
parentMerge remote branch 'thickbrick/weekly' into weekly (diff)
downloadmeta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.zip
meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.gz
meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.bz2
meta-impy-af6877fbfe94e80948c559cf77f008049f8168dc.tar.xz
Finishes the OpenRegionSettings module, adds a new panel to Region/Estate for OpenRegionSettings, adds the new CAPS based WindLight Settings module, cleans up a few UI parts, and rebuilds the ToS window to support OpenSim regions better.
-rw-r--r--linden/etc/message.xml10
-rw-r--r--linden/indra/llcommon/lltimer.cpp28
-rw-r--r--linden/indra/llcommon/lltimer.h1
-rw-r--r--linden/indra/newview/CMakeLists.txt9
-rw-r--r--linden/indra/newview/hippoLimits.cpp123
-rw-r--r--linden/indra/newview/hippoLimits.h33
-rw-r--r--linden/indra/newview/kowopenregionsettings.cpp92
-rw-r--r--linden/indra/newview/llagent.cpp10
-rw-r--r--linden/indra/newview/llagent.h2
-rw-r--r--linden/indra/newview/llappviewer.cpp2
-rw-r--r--linden/indra/newview/llcloud.cpp30
-rw-r--r--linden/indra/newview/llfloaterenvsettings.cpp8
-rw-r--r--linden/indra/newview/llfloaterenvsettings.h3
-rw-r--r--linden/indra/newview/llfloatermap.cpp4
-rw-r--r--linden/indra/newview/llfloaterregioninfo.cpp6734
-rw-r--r--linden/indra/newview/llfloaterregioninfo.h20
-rw-r--r--linden/indra/newview/llfloatertools.cpp49
-rw-r--r--linden/indra/newview/llfloatertos.cpp594
-rw-r--r--linden/indra/newview/llfloaterwater.cpp8
-rw-r--r--linden/indra/newview/llfloaterwindlight.cpp58
-rw-r--r--linden/indra/newview/llfloaterwindlight.h4
-rw-r--r--linden/indra/newview/llhomelocationresponder.cpp2
-rw-r--r--linden/indra/newview/llmaniptranslate.cpp2
-rw-r--r--linden/indra/newview/llprefschat.cpp5
-rw-r--r--linden/indra/newview/llsurface.cpp26
-rw-r--r--linden/indra/newview/llsurface.h2
-rw-r--r--linden/indra/newview/lltooldraganddrop.cpp10
-rw-r--r--linden/indra/newview/llviewerdisplay.cpp20
-rw-r--r--linden/indra/newview/llviewerinventory.cpp2
-rwxr-xr-xlinden/indra/newview/llviewermessage.cpp16
-rw-r--r--linden/indra/newview/llviewerregion.cpp9
-rw-r--r--linden/indra/newview/llviewerregion.h4
-rw-r--r--linden/indra/newview/llvoavatar.cpp3
-rw-r--r--linden/indra/newview/llvoavatar.h1
-rw-r--r--linden/indra/newview/llwaterparammanager.cpp38
-rw-r--r--linden/indra/newview/llwaterparammanager.h7
-rw-r--r--linden/indra/newview/llwaterparamset.cpp92
-rw-r--r--linden/indra/newview/llwlparammanager.cpp42
-rw-r--r--linden/indra/newview/llwlparammanager.h7
-rw-r--r--linden/indra/newview/llwlparamset.cpp5
-rw-r--r--linden/indra/newview/llworld.cpp11
-rw-r--r--linden/indra/newview/llworld.h2
-rw-r--r--linden/indra/newview/pipeline.cpp4
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_env_settings.xml10
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml2
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_tos.xml9
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_water.xml549
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_windlight_manager.xml35
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml45
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_windlight_remote_save.xml123
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml366
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/legacy_menu_pie_attachment.xml46
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/notifications.xml84
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml10
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml8
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml46
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml28
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_radar.xml8
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_region_estate.xml13
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_region_general.xml13
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_region_open_region_settings.xml76
-rw-r--r--linden/indra/newview/viewertime.cpp20
-rw-r--r--linden/indra/newview/viewertime.h3
-rw-r--r--linden/indra/newview/windlightsettingsupdate.cpp200
-rw-r--r--linden/indra/newview/wlfloatermanager.cpp281
-rw-r--r--linden/indra/newview/wlfloatermanager.h93
-rw-r--r--linden/indra/newview/wlfloaterwindlightsend.cpp300
-rw-r--r--linden/indra/newview/wlfloaterwindlightsend.h88
-rw-r--r--linden/indra/newview/wlretrievesettings.cpp238
-rw-r--r--linden/indra/newview/wlretrievesettings.h59
-rw-r--r--linden/indra/newview/wlsettingsmanager.cpp249
-rw-r--r--linden/indra/newview/wlsettingsmanager.h90
73 files changed, 7006 insertions, 4220 deletions
diff --git a/linden/etc/message.xml b/linden/etc/message.xml
index f9baf0b..c53e846 100644
--- a/linden/etc/message.xml
+++ b/linden/etc/message.xml
@@ -378,7 +378,15 @@
378 <boolean>true</boolean> 378 <boolean>true</boolean>
379 </map> 379 </map>
380 380
381 <key>ParcelVoiceInfo</key> 381 <key>WindLightSettingsUpdate</key>
382 <map>
383 <key>flavor</key>
384 <string>llsd</string>
385 <key>trusted-sender</key>
386 <boolean>true</boolean>
387 </map>
388
389 <key>ParcelVoiceInfo</key>
382 <map> 390 <map>
383 <key>flavor</key> 391 <key>flavor</key>
384 <string>llsd</string> 392 <string>llsd</string>
diff --git a/linden/indra/llcommon/lltimer.cpp b/linden/indra/llcommon/lltimer.cpp
index fa6efaf..fb3e1ef 100644
--- a/linden/indra/llcommon/lltimer.cpp
+++ b/linden/indra/llcommon/lltimer.cpp
@@ -527,6 +527,34 @@ struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time)
527} 527}
528 528
529 529
530struct tm* utc_to_offset_time(time_t utc_time, S32 offset, BOOL DST)
531{
532 if (DST)
533 {
534 //Subtract one then
535 offset--;
536 }
537
538 // We subtract off the PST/PDT offset _before_ getting
539 // "UTC" time, because this will handle wrapping around
540 // for 5 AM UTC -> 10 PM PDT of the previous day.
541 utc_time -= offset * MIN_PER_HOUR * SEC_PER_MIN;
542
543 // Internal buffer to PST/PDT (see above)
544 struct tm* internal_time = gmtime(&utc_time);
545
546 /*
547 // Don't do this, this won't correctly tell you if daylight savings is active in CA or not.
548 if (pacific_daylight_time)
549 {
550 internal_time->tm_isdst = 1;
551 }
552 */
553
554 return internal_time;
555}
556
557
530void microsecondsToTimecodeString(U64 current_time, std::string& tcstring) 558void microsecondsToTimecodeString(U64 current_time, std::string& tcstring)
531{ 559{
532 U64 hours; 560 U64 hours;
diff --git a/linden/indra/llcommon/lltimer.h b/linden/indra/llcommon/lltimer.h
index e2cf1c7..a653233 100644
--- a/linden/indra/llcommon/lltimer.h
+++ b/linden/indra/llcommon/lltimer.h
@@ -166,6 +166,7 @@ BOOL is_daylight_savings();
166// utc_time = time_corrected(); 166// utc_time = time_corrected();
167// struct tm* internal_time = utc_to_pacific_time(utc_time, gDaylight); 167// struct tm* internal_time = utc_to_pacific_time(utc_time, gDaylight);
168struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time); 168struct tm* utc_to_pacific_time(time_t utc_time, BOOL pacific_daylight_time);
169struct tm* utc_to_offset_time(time_t utc_time, S32 offset, BOOL DST);
169 170
170void microsecondsToTimecodeString(U64 current_time, std::string& tcstring); 171void microsecondsToTimecodeString(U64 current_time, std::string& tcstring);
171void secondsToTimecodeString(F32 current_time, std::string& tcstring); 172void secondsToTimecodeString(F32 current_time, std::string& tcstring);
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index 1a6ad30..c3c6566 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -493,6 +493,11 @@ set(viewer_SOURCE_FILES
493 rlvfloaterbehaviour.cpp 493 rlvfloaterbehaviour.cpp
494 viewertime.cpp 494 viewertime.cpp
495 viewerversion.cpp 495 viewerversion.cpp
496 windlightsettingsupdate.cpp
497 wlfloatermanager.cpp
498 wlfloaterwindlightsend.cpp
499 wlretrievesettings.cpp
500 wlsettingsmanager.cpp
496 ) 501 )
497 502
498set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING 503set(VIEWER_BINARY_NAME "imprudence-bin" CACHE STRING
@@ -950,6 +955,10 @@ set(viewer_HEADER_FILES
950 VorbisFramework.h 955 VorbisFramework.h
951 viewertime.h 956 viewertime.h
952 viewerversion.h 957 viewerversion.h
958 wlfloatermanager.h
959 wlfloaterwindlightsend.h
960 wlretrievesettings.h
961 wlsettingsmanager.h
953 ) 962 )
954 963
955source_group("CMake Rules" FILES ViewerInstall.cmake) 964source_group("CMake Rules" FILES ViewerInstall.cmake)
diff --git a/linden/indra/newview/hippoLimits.cpp b/linden/indra/newview/hippoLimits.cpp
index 92e2ed3..88b86a9 100644
--- a/linden/indra/newview/hippoLimits.cpp
+++ b/linden/indra/newview/hippoLimits.cpp
@@ -43,11 +43,30 @@ void HippoLimits::setLimits()
43void HippoLimits::setOpenSimLimits() 43void HippoLimits::setOpenSimLimits()
44{ 44{
45 mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); 45 mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups();
46 if (mMaxAgentGroups < 0) mMaxAgentGroups = 50; 46
47 if (mMaxAgentGroups < 0)
48 mMaxAgentGroups = 50;
49
47 mMaxPrimScale = 256.0f; 50 mMaxPrimScale = 256.0f;
48 mMinPrimScale = 0.001f; 51 mMinPrimScale = 0.001f;
52 mMinPrimXPos = 0;
53 mMinPrimYPos = 0;
54 mMinPrimZPos = 0;
55 mMaxPrimXPos = F32_MAX;
56 mMaxPrimYPos = F32_MAX;
57 mMaxPrimZPos = F32_MAX;
49 mMaxHeight = 10000.0f; 58 mMaxHeight = 10000.0f;
50 mMaxLinkedPrims = -1; 59 mMaxLinkedPrims = -1;
60 mMaxPhysLinkedPrims = -1;
61 mAllowParcelWindLight = TRUE;
62 mAllowMinimap = TRUE;
63 mMaxInventoryItemsTransfer = -1;
64 mRenderName = 2;
65 mAllowPhysicalPrims = TRUE;
66 skyUseClassicClouds = TRUE;
67 mEnableTeenMode = FALSE;
68 mEnforceMaxBuild = FALSE;
69 mRenderWater = TRUE;
51 70
52 if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { 71 if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) {
53 llinfos << "Using rendering compatible OpenSim limits" << llendl; 72 llinfos << "Using rendering compatible OpenSim limits" << llendl;
@@ -72,11 +91,27 @@ void HippoLimits::setSecondLifeLimits()
72 mMinHoleSize = 0.05f; 91 mMinHoleSize = 0.05f;
73 mMaxHollow = 0.95f; 92 mMaxHollow = 0.95f;
74 mMaxLinkedPrims = 255; 93 mMaxLinkedPrims = 255;
94 mMaxPhysLinkedPrims = 32;
95 mMinPrimXPos = 0;
96 mMinPrimYPos = 0;
97 mMinPrimZPos = 0;
98 mMaxPrimXPos = 256;
99 mMaxPrimYPos = 256;
100 mMaxPrimZPos = 4096;
101 mAllowParcelWindLight = FALSE;
102 mAllowMinimap = TRUE;
103 mMaxInventoryItemsTransfer = 42;
104 mRenderName = 2;
105 mAllowPhysicalPrims = TRUE;
106 skyUseClassicClouds = TRUE;
107 mEnableTeenMode = FALSE;
108 mEnforceMaxBuild = FALSE;
109 mRenderWater = TRUE;
75} 110}
76 111
77F32 HippoLimits::getMaxPrimScale() const 112F32 HippoLimits::getMaxPrimScale() const
78{ 113{
79 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints")) 114 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
80 { 115 {
81 return FLT_MAX; 116 return FLT_MAX;
82 } 117 }
@@ -85,3 +120,87 @@ F32 HippoLimits::getMaxPrimScale() const
85 return mMaxPrimScale; 120 return mMaxPrimScale;
86 } 121 }
87} 122}
123
124F32 HippoLimits::getMinPrimScale() const
125{
126 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
127 {
128 return 0;
129 }
130 else
131 {
132 return mMinPrimScale;
133 }
134}
135
136F32 HippoLimits::getMaxPrimXPos() const
137{
138 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
139 {
140 return FLT_MAX;
141 }
142 else
143 {
144 return mMaxPrimXPos;
145 }
146}
147
148F32 HippoLimits::getMaxPrimYPos() const
149{
150 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
151 {
152 return FLT_MAX;
153 }
154 else
155 {
156 return mMaxPrimYPos;
157 }
158}
159
160F32 HippoLimits::getMaxPrimZPos() const
161{
162 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
163 {
164 return FLT_MAX;
165 }
166 else
167 {
168 return mMaxPrimZPos;
169 }
170}
171
172F32 HippoLimits::getMinPrimXPos() const
173{
174 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
175 {
176 return FLT_MAX;
177 }
178 else
179 {
180 return mMinPrimXPos;
181 }
182}
183
184F32 HippoLimits::getMinPrimYPos() const
185{
186 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
187 {
188 return FLT_MAX;
189 }
190 else
191 {
192 return mMinPrimYPos;
193 }
194}
195
196F32 HippoLimits::getMinPrimZPos() const
197{
198 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints") && !mEnforceMaxBuild)
199 {
200 return FLT_MAX;
201 }
202 else
203 {
204 return mMinPrimZPos;
205 }
206}
diff --git a/linden/indra/newview/hippoLimits.h b/linden/indra/newview/hippoLimits.h
index a5fe351..a5493eb 100644
--- a/linden/indra/newview/hippoLimits.h
+++ b/linden/indra/newview/hippoLimits.h
@@ -11,12 +11,23 @@ public:
11 const F32& getMaxHeight() const { return mMaxHeight; } 11 const F32& getMaxHeight() const { return mMaxHeight; }
12 const F32& getMinHoleSize() const { return mMinHoleSize; } 12 const F32& getMinHoleSize() const { return mMinHoleSize; }
13 const F32& getMaxHollow() const { return mMaxHollow; } 13 const F32& getMaxHollow() const { return mMaxHollow; }
14 const F32& getMinPrimScale() const { return mMinPrimScale; }
15 const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; } 14 const S32& getMaxLinkedPrims() const { return mMaxLinkedPrims; }
15 const F32& getMaxDragDistance() const { return mMaxDragDistance; }
16 const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; }
17 const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; }
18
16 19
17 // Returns the max prim size we can use on a grid 20 // Returns the max prim size we can use on a grid
21 F32 getMinPrimScale() const;
18 F32 getMaxPrimScale() const; 22 F32 getMaxPrimScale() const;
19 23
24 F32 getMinPrimXPos() const;
25 F32 getMinPrimYPos() const;
26 F32 getMinPrimZPos() const;
27 F32 getMaxPrimXPos() const;
28 F32 getMaxPrimYPos() const;
29 F32 getMaxPrimZPos() const;
30
20 void setLimits(); 31 void setLimits();
21 32
22 S32 mMaxAgentGroups; 33 S32 mMaxAgentGroups;
@@ -27,6 +38,26 @@ public:
27 F32 mMaxPrimScale; 38 F32 mMaxPrimScale;
28 F32 mMinPrimScale; 39 F32 mMinPrimScale;
29 S32 mMaxLinkedPrims; 40 S32 mMaxLinkedPrims;
41 S32 mMaxPhysLinkedPrims;
42 F32 mMaxPrimXPos;
43 F32 mMaxPrimYPos;
44 F32 mMaxPrimZPos;
45 F32 mMinPrimXPos;
46 F32 mMinPrimYPos;
47 F32 mMinPrimZPos;
48
49 S32 mRenderName;
50
51 F32 mMaxInventoryItemsTransfer;
52 F32 mMaxDragDistance;
53
54 BOOL skyUseClassicClouds;
55 BOOL mAllowParcelWindLight;
56 BOOL mAllowMinimap;
57 BOOL mAllowPhysicalPrims;
58 BOOL mEnableTeenMode;
59 BOOL mEnforceMaxBuild;
60 BOOL mRenderWater;
30 61
31private: 62private:
32 void setOpenSimLimits(); 63 void setOpenSimLimits();
diff --git a/linden/indra/newview/kowopenregionsettings.cpp b/linden/indra/newview/kowopenregionsettings.cpp
index f568473..3cceb0c 100644
--- a/linden/indra/newview/kowopenregionsettings.cpp
+++ b/linden/indra/newview/kowopenregionsettings.cpp
@@ -30,6 +30,12 @@
30#include "hippoLimits.h" 30#include "hippoLimits.h"
31#include "llfloatertools.h" 31#include "llfloatertools.h"
32#include "llviewercontrol.h" 32#include "llviewercontrol.h"
33#include "llagent.h"
34#include "llsurface.h"
35#include "llviewerregion.h"
36#include "llviewerobject.h"
37#include "llfloaterregioninfo.h"
38#include "llfloaterworldmap.h"
33 39
34//DEBUG includes 40//DEBUG includes
35//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string 41//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
@@ -62,19 +68,20 @@ class OpenRegionInfoUpdate : public LLHTTPNode
62 68
63 if ( body.has("AllowMinimap") ) 69 if ( body.has("AllowMinimap") )
64 { 70 {
65 //IMPLEMENT ME 71 gHippoLimits->mAllowMinimap = body["AllowMinimap"].asInteger() == 1;
66 } 72 }
67 if ( body.has("AllowPhysicalPrims") ) 73 if ( body.has("AllowPhysicalPrims") )
68 { 74 {
69 //IMPLEMENT ME 75 gHippoLimits->mAllowPhysicalPrims = body["AllowPhysicalPrims"].asInteger() == 1;
76 limitschanged = TRUE;
70 } 77 }
71 if ( body.has("DrawDistance") ) 78 if ( body.has("DrawDistance") )
72 { 79 {
73 //IMPLEMENT ME 80 gAgent.mDrawDistance = body["DrawDistance"].asReal();
74 } 81 }
75 if ( body.has("ForceDrawDistance") ) 82 if ( body.has("ForceDrawDistance") )
76 { 83 {
77 //IMPLEMENT ME 84 gAgent.mLockedDrawDistance = body["ForceDrawDistance"].asInteger() == 1;
78 } 85 }
79 if ( body.has("LSLFunctions") ) 86 if ( body.has("LSLFunctions") )
80 { 87 {
@@ -82,19 +89,23 @@ class OpenRegionInfoUpdate : public LLHTTPNode
82 } 89 }
83 if ( body.has("MaxDragDistance") ) 90 if ( body.has("MaxDragDistance") )
84 { 91 {
85 //IMPLEMENT ME 92 gHippoLimits->mMaxDragDistance = body["MaxDragDistance"].asReal();
86 } 93 }
87 if ( body.has("MinHoleSize") ) 94 if ( body.has("MinHoleSize") )
88 { 95 {
96 //Note: does NOT update correctly
89 gHippoLimits->mMinHoleSize = body["MinHoleSize"].asReal(); 97 gHippoLimits->mMinHoleSize = body["MinHoleSize"].asReal();
98 limitschanged = TRUE;
90 } 99 }
91 if ( body.has("MaxHollowSize") ) 100 if ( body.has("MaxHollowSize") )
92 { 101 {
102 //Note: does NOT update correctly
93 gHippoLimits->mMaxHollow = body["MaxHollowSize"].asReal(); 103 gHippoLimits->mMaxHollow = body["MaxHollowSize"].asReal();
104 limitschanged = TRUE;
94 } 105 }
95 if ( body.has("MaxInventoryItemsTransfer") ) 106 if ( body.has("MaxInventoryItemsTransfer") )
96 { 107 {
97 //IMPLEMENT ME 108 gHippoLimits->mMaxInventoryItemsTransfer = body["MaxInventoryItemsTransfer"].asReal();
98 } 109 }
99 if ( body.has("MaxLinkCount") ) 110 if ( body.has("MaxLinkCount") )
100 { 111 {
@@ -102,22 +113,28 @@ class OpenRegionInfoUpdate : public LLHTTPNode
102 } 113 }
103 if ( body.has("MaxLinkCountPhys") ) 114 if ( body.has("MaxLinkCountPhys") )
104 { 115 {
105 //IMPLEMENT ME 116 gHippoLimits->mMaxPhysLinkedPrims = body["MaxLinkCountPhys"].asInteger();
106 } 117 }
107 if ( body.has("MaxPhysPrimScale") ) 118 if ( body.has("MaxPos") )
108 { 119 {
109 //IMPLEMENT ME 120 gHippoLimits->mMaxPrimXPos = body["MaxPosX"].asReal();
121 gHippoLimits->mMaxPrimYPos = body["MaxPosY"].asReal();
122 gHippoLimits->mMaxPrimZPos = body["MaxPosZ"].asReal();
123 limitschanged = TRUE;
110 } 124 }
111 if ( body.has("MaxPos") ) 125 if ( body.has("MinPos") )
112 { 126 {
113 //IMPLEMENT ME 127 gHippoLimits->mMinPrimXPos = body["MinPosX"].asReal();
128 gHippoLimits->mMinPrimYPos = body["MinPosY"].asReal();
129 gHippoLimits->mMinPrimZPos = body["MinPosZ"].asReal();
130 limitschanged = TRUE;
114 } 131 }
115 if ( body.has("MaxPrimScale") ) 132 if ( body.has("MaxPrimScale") )
116 { 133 {
117 gHippoLimits->mMaxPrimScale = body["MaxPrimScale"].asReal(); 134 gHippoLimits->mMaxPrimScale = body["MaxPrimScale"].asReal();
118 limitschanged = TRUE; 135 limitschanged = TRUE;
119 } 136 }
120 if ( body.has("MinPos") ) 137 if ( body.has("MaxPhysPrimScale") )
121 { 138 {
122 //IMPLEMENT ME 139 //IMPLEMENT ME
123 } 140 }
@@ -128,32 +145,69 @@ class OpenRegionInfoUpdate : public LLHTTPNode
128 } 145 }
129 if ( body.has("OffsetOfUTC") ) 146 if ( body.has("OffsetOfUTC") )
130 { 147 {
131 //IMPLEMENT ME 148 gSavedSettings.setS32("TimeOffset", body["OffsetOfUTC"].asReal());
149 gSavedSettings.setBOOL("UseTimeOffset", true);
150 }
151 if ( body.has("OffsetOfUTCDST") )
152 {
153 gSavedSettings.setBOOL("TimeOffsetDST", body["OffsetOfUTCDST"].asInteger() == 1 ? TRUE : FALSE);
132 } 154 }
133 if ( body.has("RenderWater") ) 155 if ( body.has("RenderWater") )
134 { 156 {
135 gSavedSettings.setBOOL("RenderWater", body["RenderWater"].asBoolean()); 157 gHippoLimits->mRenderWater = body["RenderWater"].asInteger() == 1 ? TRUE : FALSE;
158 gAgent.getRegion()->rebuildWater();
136 } 159 }
137 if ( body.has("SayDistance") ) 160 if ( body.has("SayDistance") )
138 { 161 {
139 //IMPLEMENT ME 162 gSavedSettings.setU32("ChatDistance", body["SayDistance"].asReal());
140 } 163 }
141 if ( body.has("ShoutDistance") ) 164 if ( body.has("ShoutDistance") )
142 { 165 {
143 //IMPLEMENT ME 166 //IMPLEMENT ME
144 } 167 }
168 if ( body.has("WhisperDistance") )
169 {
170 //IMPLEMENT ME
171 }
145 if ( body.has("ToggleTeenMode") ) 172 if ( body.has("ToggleTeenMode") )
146 { 173 {
147 gSavedSettings.setBOOL("ToggleTeenMode", body["ToggleTeenMode"].asBoolean()); 174 gHippoLimits->mEnableTeenMode = body["ToggleTeenMode"].asInteger() == 1 ? TRUE : FALSE;
148
149 } 175 }
150 if ( body.has("WhisperDistance") ) 176 if ( body.has("SetTeenMode") )
151 { 177 {
152 //IMPLEMENT ME 178 gAgent.setTeen( body["SetTeenMode"].asInteger() == 1 ? TRUE : FALSE );
179 LLFloaterWorldMap::reloadIcons(NULL);
180 llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl;
181 }
182 if ( body.has("ShowTags") )
183 {
184 gHippoLimits->mRenderName = body["ShowTags"].asReal();
185 }
186 if ( body.has("EnforceMaxBuild") )
187 {
188 gHippoLimits->mEnforceMaxBuild = body["EnforceMaxBuild"].asInteger() == 1 ? TRUE : FALSE;
189 limitschanged = TRUE;
190 }
191 if ( body.has("MaxGroups") )
192 {
193 gHippoLimits->mMaxAgentGroups = body["MaxGroups"].asReal();
194 }
195 if ( body.has("AllowParcelWindLight") )
196 {
197 gHippoLimits->mAllowParcelWindLight = body["AllowParcelWindLight"].asInteger() == 1;
153 } 198 }
154 199
155 if (limitschanged) 200 if (limitschanged)
156 gFloaterTools->updateToolsSizeLimits(); 201 gFloaterTools->updateToolsSizeLimits();
202
203 //Update the floater if its around
204 LLPanelRegionOpenSettingsInfo* floater;
205 floater = LLFloaterRegionInfo::getPanelOpenSettings();
206
207 if(floater != NULL)
208 {
209 floater->refreshFromRegion(gAgent.getRegion());
210 }
157 } 211 }
158}; 212};
159 213
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 758cae2..de1fc84 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -36,7 +36,6 @@
36#include "stdenums.h" 36#include "stdenums.h"
37 37
38#include "llagent.h" 38#include "llagent.h"
39
40#include "llcamera.h" 39#include "llcamera.h"
41#include "llcoordframe.h" 40#include "llcoordframe.h"
42#include "indra_constants.h" 41#include "indra_constants.h"
@@ -441,6 +440,7 @@ LLAgent::LLAgent() :
441void LLAgent::init() 440void LLAgent::init()
442{ 441{
443 mDrawDistance = gSavedSettings.getF32("RenderFarClip"); 442 mDrawDistance = gSavedSettings.getF32("RenderFarClip");
443 mLockedDrawDistance = FALSE;
444 444
445 // *Note: this is where LLViewerCamera::getInstance() used to be constructed. 445 // *Note: this is where LLViewerCamera::getInstance() used to be constructed.
446 446
@@ -6026,6 +6026,14 @@ void LLAgent::setHomePosRegion( const U64& region_handle, const LLVector3& pos_r
6026 mHomePosRegion = pos_region; 6026 mHomePosRegion = pos_region;
6027} 6027}
6028 6028
6029void LLAgent::takeHomeScreenshot()
6030{
6031 std::string snap_filename = gDirUtilp->getLindenUserDir();
6032 snap_filename += gDirUtilp->getDirDelimiter();
6033 snap_filename += SCREEN_HOME_FILENAME;
6034 gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, FALSE);
6035}
6036
6029BOOL LLAgent::getHomePosGlobal( LLVector3d* pos_global ) 6037BOOL LLAgent::getHomePosGlobal( LLVector3d* pos_global )
6030{ 6038{
6031 if(!mHaveHomePosition) 6039 if(!mHaveHomePosition)
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h
index 6bc4dac..fe50bf5 100644
--- a/linden/indra/newview/llagent.h
+++ b/linden/indra/newview/llagent.h
@@ -584,6 +584,7 @@ public:
584 EPointAtType getPointAtType(); 584 EPointAtType getPointAtType();
585 585
586 void setHomePosRegion( const U64& region_handle, const LLVector3& pos_region ); 586 void setHomePosRegion( const U64& region_handle, const LLVector3& pos_region );
587 void takeHomeScreenshot();
587 BOOL getHomePosGlobal( LLVector3d* pos_global ); 588 BOOL getHomePosGlobal( LLVector3d* pos_global );
588 void setCameraAnimating( BOOL b ) { mCameraAnimating = b; } 589 void setCameraAnimating( BOOL b ) { mCameraAnimating = b; }
589 BOOL getCameraAnimating( ) { return mCameraAnimating; } 590 BOOL getCameraAnimating( ) { return mCameraAnimating; }
@@ -742,6 +743,7 @@ public:
742 LLUUID mSecureSessionID; // secure token for this login session 743 LLUUID mSecureSessionID; // secure token for this login session
743 744
744 F32 mDrawDistance; 745 F32 mDrawDistance;
746 BOOL mLockedDrawDistance;
745 747
746 U64 mGroupPowers; 748 U64 mGroupPowers;
747 BOOL mHideGroupTitle; 749 BOOL mHideGroupTitle;
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 4485cdf..c53ced6 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -360,7 +360,7 @@ void request_initial_instant_messages()
360 static BOOL requested = FALSE; 360 static BOOL requested = FALSE;
361 if (!requested 361 if (!requested
362 && gMessageSystem 362 && gMessageSystem
363 && LLMuteList::getInstance()->isLoaded() 363 //&& LLMuteList::getInstance()->isLoaded() //We don't always want to have a mute list module
364 && gAgent.getAvatarObject()) 364 && gAgent.getAvatarObject())
365 { 365 {
366 // Auto-accepted inventory items may require the avatar object 366 // Auto-accepted inventory items may require the avatar object
diff --git a/linden/indra/newview/llcloud.cpp b/linden/indra/newview/llcloud.cpp
index 0099817..f4f5761 100644
--- a/linden/indra/newview/llcloud.cpp
+++ b/linden/indra/newview/llcloud.cpp
@@ -38,6 +38,7 @@
38#include "v4math.h" 38#include "v4math.h"
39#include "llquaternion.h" 39#include "llquaternion.h"
40#include "v4color.h" 40#include "v4color.h"
41#include "llviewercontrol.h"
41 42
42#include "llwind.h" 43#include "llwind.h"
43#include "llcloud.h" 44#include "llcloud.h"
@@ -56,15 +57,6 @@
56 57
57extern LLPipeline gPipeline; 58extern LLPipeline gPipeline;
58 59
59const F32 CLOUD_UPDATE_RATE = 1.0f; // Global time dilation for clouds
60const F32 CLOUD_GROW_RATE = 0.05f;
61const F32 CLOUD_DECAY_RATE = -0.05f;
62const F32 CLOUD_VELOCITY_SCALE = 0.01f;
63const F32 CLOUD_DENSITY = 25.f;
64const S32 CLOUD_COUNT_MAX = 20;
65const F32 CLOUD_HEIGHT_RANGE = 48.f;
66const F32 CLOUD_HEIGHT_MEAN = 192.f;
67
68enum 60enum
69{ 61{
70 LL_PUFF_GROWING = 0, 62 LL_PUFF_GROWING = 0,
@@ -80,7 +72,7 @@ S32 LLCloudPuff::sPuffCount = 0;
80 72
81LLCloudPuff::LLCloudPuff() : 73LLCloudPuff::LLCloudPuff() :
82 mAlpha(0.01f), 74 mAlpha(0.01f),
83 mRate(CLOUD_GROW_RATE*CLOUD_UPDATE_RATE), 75 mRate((gSavedSettings.getF32("CloudGrowRate")/100)*gSavedSettings.getF32("CloudUpdateRate")),
84 mLifeState(LL_PUFF_GROWING) 76 mLifeState(LL_PUFF_GROWING)
85{ 77{
86} 78}
@@ -121,7 +113,7 @@ void LLCloudGroup::updatePuffs(const F32 dt)
121 mVOCloudsp->setPositionRegion(mCenterRegion); 113 mVOCloudsp->setPositionRegion(mCenterRegion);
122 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 114 mVOCloudsp->setScale(LLVector3(256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
123 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH, 115 256.f/CLOUD_GROUPS_PER_EDGE + CLOUD_PUFF_WIDTH,
124 CLOUD_HEIGHT_RANGE + CLOUD_PUFF_HEIGHT)*0.5f); 116 gSavedSettings.getF32("ClassicCloudRange") + CLOUD_PUFF_HEIGHT)*0.5f);
125 gPipeline.createObject(mVOCloudsp); 117 gPipeline.createObject(mVOCloudsp);
126 } 118 }
127 119
@@ -132,7 +124,7 @@ void LLCloudGroup::updatePuffs(const F32 dt)
132 { 124 {
133 LLCloudPuff &puff = mCloudPuffs[i]; 125 LLCloudPuff &puff = mCloudPuffs[i];
134 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal)); 126 velocity = mCloudLayerp->getRegion()->mWind.getCloudVelocity(mCloudLayerp->getRegion()->getPosRegionFromGlobal(puff.mPositionGlobal));
135 velocity *= CLOUD_VELOCITY_SCALE*CLOUD_UPDATE_RATE; 127 velocity *= (gSavedSettings.getF32("CloudVelocityScale")/100)*gSavedSettings.getF32("CloudUpdateRate");
136 vel_d.setVec(velocity); 128 vel_d.setVec(velocity);
137 mCloudPuffs[i].mPositionGlobal += vel_d; 129 mCloudPuffs[i].mPositionGlobal += vel_d;
138 mCloudPuffs[i].mAlpha += mCloudPuffs[i].mRate * dt; 130 mCloudPuffs[i].mAlpha += mCloudPuffs[i].mRate * dt;
@@ -163,7 +155,7 @@ void LLCloudGroup::updatePuffOwnership()
163 { 155 {
164 //llinfos << "Killing puff not in group" << llendl; 156 //llinfos << "Killing puff not in group" << llendl;
165 mCloudPuffs[i].setLifeState(LL_PUFF_DYING); 157 mCloudPuffs[i].setLifeState(LL_PUFF_DYING);
166 mCloudPuffs[i].mRate = CLOUD_DECAY_RATE*CLOUD_UPDATE_RATE; 158 mCloudPuffs[i].mRate = (gSavedSettings.getF32("CloudDecayRate")/100)*gSavedSettings.getF32("CloudUpdateRate");
167 i++; 159 i++;
168 continue; 160 continue;
169 } 161 }
@@ -185,9 +177,9 @@ void LLCloudGroup::updatePuffCount()
185 return; 177 return;
186 } 178 }
187 S32 i; 179 S32 i;
188 S32 target_puff_count = llround(CLOUD_DENSITY * mDensity); 180 S32 target_puff_count = llround((S32)gSavedSettings.getF32("CloudDensity") * mDensity);
189 target_puff_count = llmax(0, target_puff_count); 181 target_puff_count = llmax(0, target_puff_count);
190 target_puff_count = llmin(CLOUD_COUNT_MAX, target_puff_count); 182 target_puff_count = llmin((S32)gSavedSettings.getF32("CloudCountMax"), target_puff_count);
191 S32 current_puff_count = (S32) mCloudPuffs.size(); 183 S32 current_puff_count = (S32) mCloudPuffs.size();
192 // Create a new cloud if we need one 184 // Create a new cloud if we need one
193 if (current_puff_count < target_puff_count) 185 if (current_puff_count < target_puff_count)
@@ -199,7 +191,7 @@ void LLCloudGroup::updatePuffCount()
199 puff_pos_global = mVOCloudsp->getPositionGlobal(); 191 puff_pos_global = mVOCloudsp->getPositionGlobal();
200 F32 x = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE; 192 F32 x = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE;
201 F32 y = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE; 193 F32 y = ll_frand(256.f/CLOUD_GROUPS_PER_EDGE) - 128.f/CLOUD_GROUPS_PER_EDGE;
202 F32 z = ll_frand(CLOUD_HEIGHT_RANGE) - 0.5f*CLOUD_HEIGHT_RANGE; 194 F32 z = ll_frand(gSavedSettings.getF32("ClassicCloudRange")) - 0.5f*gSavedSettings.getF32("ClassicCloudRange");
203 puff_pos_global += LLVector3d(x, y, z); 195 puff_pos_global += LLVector3d(x, y, z);
204 mCloudPuffs[i].mPositionGlobal = puff_pos_global; 196 mCloudPuffs[i].mPositionGlobal = puff_pos_global;
205 mCloudPuffs[i].mAlpha = 0.01f; 197 mCloudPuffs[i].mAlpha = 0.01f;
@@ -227,7 +219,7 @@ void LLCloudGroup::updatePuffCount()
227 { 219 {
228 //llinfos << "Killing extra live cloud" << llendl; 220 //llinfos << "Killing extra live cloud" << llendl;
229 mCloudPuffs[i].setLifeState(LL_PUFF_DYING); 221 mCloudPuffs[i].setLifeState(LL_PUFF_DYING);
230 mCloudPuffs[i].mRate = CLOUD_DECAY_RATE*CLOUD_UPDATE_RATE; 222 mCloudPuffs[i].mRate = (gSavedSettings.getF32("CloudDecayRate")/100)*gSavedSettings.getF32("CloudUpdateRate");
231 new_dying_count--; 223 new_dying_count--;
232 } 224 }
233 i++; 225 i++;
@@ -294,7 +286,7 @@ LLCloudLayer::LLCloudLayer()
294 x = (0.5f + j)*(256.f/CLOUD_GROUPS_PER_EDGE); 286 x = (0.5f + j)*(256.f/CLOUD_GROUPS_PER_EDGE);
295 287
296 mCloudGroups[i][j].setCloudLayerp(this); 288 mCloudGroups[i][j].setCloudLayerp(this);
297 mCloudGroups[i][j].setCenterRegion(LLVector3(x, y, CLOUD_HEIGHT_MEAN)); 289 mCloudGroups[i][j].setCenterRegion(LLVector3(x, y, gSavedSettings.getF32("ClassicCloudHeight")));
298 } 290 }
299 } 291 }
300} 292}
@@ -348,8 +340,6 @@ void LLCloudLayer::destroy()
348void LLCloudLayer::reset() 340void LLCloudLayer::reset()
349{ 341{
350} 342}
351
352
353void LLCloudLayer::setWindPointer(LLWind *windp) 343void LLCloudLayer::setWindPointer(LLWind *windp)
354{ 344{
355 if (mWindp) 345 if (mWindp)
diff --git a/linden/indra/newview/llfloaterenvsettings.cpp b/linden/indra/newview/llfloaterenvsettings.cpp
index 557a5e1..801ff49 100644
--- a/linden/indra/newview/llfloaterenvsettings.cpp
+++ b/linden/indra/newview/llfloaterenvsettings.cpp
@@ -47,6 +47,7 @@
47#include "llwaterparammanager.h" 47#include "llwaterparammanager.h"
48#include "llmath.h" 48#include "llmath.h"
49#include "llviewerwindow.h" 49#include "llviewerwindow.h"
50#include "wlfloatermanager.h"
50 51
51#include "pipeline.h" 52#include "pipeline.h"
52 53
@@ -87,7 +88,7 @@ void LLFloaterEnvSettings::initCallbacks(void)
87 // WL Top 88 // WL Top
88 childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL); 89 childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL);
89 childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL); 90 childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL);
90 childSetAction("EnvSubmitWindlight", onSubmitWindlight, NULL); 91 childSetAction("EnvWLManager", onOpenWLManager, NULL);
91 childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL); 92 childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL);
92 childSetAction("EnvSettingsHelpButton", onClickHelp, this); 93 childSetAction("EnvSettingsHelpButton", onClickHelp, this);
93} 94}
@@ -285,6 +286,11 @@ void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData)
285 LLFloaterWater::show(); 286 LLFloaterWater::show();
286} 287}
287 288
289void LLFloaterEnvSettings::onOpenWLManager(void* userData)
290{
291 WLFloaterManager::show();
292}
293
288void LLFloaterEnvSettings::onSubmitWindlight(void* userData) 294void LLFloaterEnvSettings::onSubmitWindlight(void* userData)
289{ 295{
290 Meta7WindlightPacket * wl = new Meta7WindlightPacket(); 296 Meta7WindlightPacket * wl = new Meta7WindlightPacket();
diff --git a/linden/indra/newview/llfloaterenvsettings.h b/linden/indra/newview/llfloaterenvsettings.h
index 49bf4fd..8b44621 100644
--- a/linden/indra/newview/llfloaterenvsettings.h
+++ b/linden/indra/newview/llfloaterenvsettings.h
@@ -78,6 +78,9 @@ public:
78 /// open the advanced water settings menu 78 /// open the advanced water settings menu
79 static void onOpenAdvancedWater(void* userData); 79 static void onOpenAdvancedWater(void* userData);
80 80
81 /// open the windlight manager floater
82 static void onOpenWLManager(void* userData);
83
81 /// submit windlight settings to the estate 84 /// submit windlight settings to the estate
82 static void onSubmitWindlight(void* userData); 85 static void onSubmitWindlight(void* userData);
83 86
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp
index c15678d..34b8dde 100644
--- a/linden/indra/newview/llfloatermap.cpp
+++ b/linden/indra/newview/llfloatermap.cpp
@@ -44,6 +44,7 @@
44#include "lluictrlfactory.h" 44#include "lluictrlfactory.h"
45#include "llfirstuse.h" 45#include "llfirstuse.h"
46#include "panelradar.h" 46#include "panelradar.h"
47#include "hippoLimits.h"
47 48
48 49
49// [RLVa:KB] 50// [RLVa:KB]
@@ -149,7 +150,7 @@ void LLFloaterMap::draw()
149 drawChild(mPanelRadar); 150 drawChild(mPanelRadar);
150 } 151 }
151 } 152 }
152 else 153 else if (gHippoLimits->mAllowMinimap) //Check for if minimap is blocked
153 { 154 {
154 setMouseOpaque(TRUE); 155 setMouseOpaque(TRUE);
155 getDragHandle()->setMouseOpaque(TRUE); 156 getDragHandle()->setMouseOpaque(TRUE);
@@ -215,7 +216,6 @@ void LLFloaterMap::setRadarButtonState( bool showing_radar )
215 } 216 }
216} 217}
217 218
218
219void LLFloaterMap::adjustLayout( bool expand ) 219void LLFloaterMap::adjustLayout( bool expand )
220{ 220{
221 S32 radar_height = mPanelRadar->getRect().getHeight(); 221 S32 radar_height = mPanelRadar->getRect().getHeight();
diff --git a/linden/indra/newview/llfloaterregioninfo.cpp b/linden/indra/newview/llfloaterregioninfo.cpp
index deee0f6..c7f1c38 100644
--- a/linden/indra/newview/llfloaterregioninfo.cpp
+++ b/linden/indra/newview/llfloaterregioninfo.cpp
@@ -1,3298 +1,3436 @@
1/** 1/**
2 * @file llfloaterregioninfo.cpp 2 * @file llfloaterregioninfo.cpp
3 * @author Aaron Brashears 3 * @author Aaron Brashears
4 * @brief Implementation of the region info and controls floater and panels. 4 * @brief Implementation of the region info and controls floater and panels.
5 * 5 *
6 * $LicenseInfo:firstyear=2004&license=viewergpl$ 6 * $LicenseInfo:firstyear=2004&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2004-2009, Linden Research, Inc. 8 * Copyright (c) 2004-2009, Linden Research, Inc.
9 * 9 *
10 * Second Life Viewer Source Code 10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab 11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0 12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement 13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 * 17 *
18 * There are special exceptions to the terms and conditions of the GPL as 18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception 19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or 20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at 21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception 22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 * 23 *
24 * By copying, modifying or distributing this software, you acknowledge 24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above, 25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations. 26 * and agree to abide by those obligations.
27 * 27 *
28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
30 * COMPLETENESS OR PERFORMANCE. 30 * COMPLETENESS OR PERFORMANCE.
31 * $/LicenseInfo$ 31 * $/LicenseInfo$
32 */ 32 */
33 33
34#include "llviewerprecompiledheaders.h" 34#include "llviewerprecompiledheaders.h"
35#include "llfloaterregioninfo.h" 35#include "llfloaterregioninfo.h"
36 36
37#include <algorithm> 37#include <algorithm>
38#include <functional> 38#include <functional>
39 39
40#include "llcachename.h" 40#include "llcachename.h"
41#include "lldir.h" 41#include "lldir.h"
42#include "lldispatcher.h" 42#include "lldispatcher.h"
43#include "llglheaders.h" 43#include "llglheaders.h"
44#include "llregionflags.h" 44#include "llregionflags.h"
45#include "llstl.h" 45#include "llstl.h"
46#include "indra_constants.h" 46#include "indra_constants.h"
47#include "message.h" 47#include "message.h"
48 48
49#include "llagent.h" 49#include "llagent.h"
50#include "llalertdialog.h" 50#include "llalertdialog.h"
51#include "llappviewer.h" 51#include "llappviewer.h"
52#include "llfloateravatarpicker.h" 52#include "llfloateravatarpicker.h"
53#include "llbutton.h" 53#include "llbutton.h"
54#include "llcheckboxctrl.h" 54#include "llcheckboxctrl.h"
55#include "llcombobox.h" 55#include "llcombobox.h"
56#include "llfilepicker.h" 56#include "llfilepicker.h"
57#include "llfloaterdaycycle.h" 57#include "llfloaterdaycycle.h"
58#include "llfloatergodtools.h" // for send_sim_wide_deletes() 58#include "llfloatergodtools.h" // for send_sim_wide_deletes()
59#include "llfloatertopobjects.h" // added to fix SL-32336 59#include "llfloatertopobjects.h" // added to fix SL-32336
60#include "llfloatergroups.h" 60#include "llfloatergroups.h"
61#include "llfloatertelehub.h" 61#include "llfloatertelehub.h"
62#include "llfloaterwindlight.h" 62#include "llfloaterwindlight.h"
63#include "llinventorymodel.h" 63#include "llinventorymodel.h"
64#include "lllineeditor.h" 64#include "lllineeditor.h"
65#include "llalertdialog.h" 65#include "llalertdialog.h"
66#include "llnamelistctrl.h" 66#include "llnamelistctrl.h"
67#include "llsliderctrl.h" 67#include "llsliderctrl.h"
68#include "llspinctrl.h" 68#include "llspinctrl.h"
69#include "lltabcontainer.h" 69#include "lltabcontainer.h"
70#include "lltextbox.h" 70#include "lltextbox.h"
71#include "llinventory.h" 71#include "llinventory.h"
72#include "lltexturectrl.h" 72#include "lltexturectrl.h"
73#include "lltrans.h" 73#include "lltrans.h"
74#include "llviewercontrol.h" 74#include "llviewercontrol.h"
75#include "lluictrlfactory.h" 75#include "lluictrlfactory.h"
76#include "llviewerimage.h" 76#include "llviewerimage.h"
77#include "llviewerimagelist.h" 77#include "llviewerimagelist.h"
78#include "llviewerregion.h" 78#include "llviewerregion.h"
79#include "llviewerstats.h" 79#include "llviewerstats.h"
80#include "llviewertexteditor.h" 80#include "llviewertexteditor.h"
81#include "llviewerwindow.h" 81#include "llviewerwindow.h"
82#include "llvlcomposition.h" 82#include "llvlcomposition.h"
83 83#include "hippoLimits.h"
84// [RLVa:KB] 84
85#include "rlvhandler.h" 85// [RLVa:KB]
86// [/RLVa:KB] 86#include "rlvhandler.h"
87 87// [/RLVa:KB]
88#define ELAR_ENABLED 0 // Enable when server support is implemented 88
89 89#define ELAR_ENABLED 0 // Enable when server support is implemented
90const S32 TERRAIN_TEXTURE_COUNT = 4; 90
91const S32 CORNER_COUNT = 4; 91const S32 TERRAIN_TEXTURE_COUNT = 4;
92 92const S32 CORNER_COUNT = 4;
93///---------------------------------------------------------------------------- 93
94/// Local class declaration 94///----------------------------------------------------------------------------
95///---------------------------------------------------------------------------- 95/// Local class declaration
96 96///----------------------------------------------------------------------------
97class LLDispatchEstateUpdateInfo : public LLDispatchHandler 97
98{ 98class LLDispatchEstateUpdateInfo : public LLDispatchHandler
99public: 99{
100 LLDispatchEstateUpdateInfo() {} 100public:
101 virtual ~LLDispatchEstateUpdateInfo() {} 101 LLDispatchEstateUpdateInfo() {}
102 virtual bool operator()( 102 virtual ~LLDispatchEstateUpdateInfo() {}
103 const LLDispatcher* dispatcher, 103 virtual bool operator()(
104 const std::string& key, 104 const LLDispatcher* dispatcher,
105 const LLUUID& invoice, 105 const std::string& key,
106 const sparam_t& strings); 106 const LLUUID& invoice,
107}; 107 const sparam_t& strings);
108 108};
109class LLDispatchSetEstateAccess : public LLDispatchHandler 109
110{ 110class LLDispatchSetEstateAccess : public LLDispatchHandler
111public: 111{
112 LLDispatchSetEstateAccess() {} 112public:
113 virtual ~LLDispatchSetEstateAccess() {} 113 LLDispatchSetEstateAccess() {}
114 virtual bool operator()( 114 virtual ~LLDispatchSetEstateAccess() {}
115 const LLDispatcher* dispatcher, 115 virtual bool operator()(
116 const std::string& key, 116 const LLDispatcher* dispatcher,
117 const LLUUID& invoice, 117 const std::string& key,
118 const sparam_t& strings); 118 const LLUUID& invoice,
119}; 119 const sparam_t& strings);
120 120};
121 121
122/* 122
123void unpack_request_params( 123/*
124 LLMessageSystem* msg, 124void unpack_request_params(
125 LLDispatcher::sparam_t& strings, 125 LLMessageSystem* msg,
126 LLDispatcher::iparam_t& integers) 126 LLDispatcher::sparam_t& strings,
127{ 127 LLDispatcher::iparam_t& integers)
128 char str_buf[MAX_STRING]; 128{
129 S32 str_count = msg->getNumberOfBlocksFast(_PREHASH_StringData); 129 char str_buf[MAX_STRING];
130 S32 i; 130 S32 str_count = msg->getNumberOfBlocksFast(_PREHASH_StringData);
131 for (i = 0; i < str_count; ++i) 131 S32 i;
132 { 132 for (i = 0; i < str_count; ++i)
133 // we treat the SParam as binary data (since it might be an 133 {
134 // LLUUID in compressed form which may have embedded \0's,) 134 // we treat the SParam as binary data (since it might be an
135 str_buf[0] = '\0'; 135 // LLUUID in compressed form which may have embedded \0's,)
136 S32 data_size = msg->getSizeFast(_PREHASH_StringData, i, _PREHASH_SParam); 136 str_buf[0] = '\0';
137 if (data_size >= 0) 137 S32 data_size = msg->getSizeFast(_PREHASH_StringData, i, _PREHASH_SParam);
138 { 138 if (data_size >= 0)
139 msg->getBinaryDataFast(_PREHASH_StringData, _PREHASH_SParam, 139 {
140 str_buf, data_size, i, MAX_STRING - 1); 140 msg->getBinaryDataFast(_PREHASH_StringData, _PREHASH_SParam,
141 strings.push_back(std::string(str_buf, data_size)); 141 str_buf, data_size, i, MAX_STRING - 1);
142 } 142 strings.push_back(std::string(str_buf, data_size));
143 } 143 }
144 144 }
145 U32 int_buf; 145
146 S32 int_count = msg->getNumberOfBlocksFast(_PREHASH_IntegerData); 146 U32 int_buf;
147 for (i = 0; i < int_count; ++i) 147 S32 int_count = msg->getNumberOfBlocksFast(_PREHASH_IntegerData);
148 { 148 for (i = 0; i < int_count; ++i)
149 msg->getU32("IntegerData", "IParam", int_buf, i); 149 {
150 integers.push_back(int_buf); 150 msg->getU32("IntegerData", "IParam", int_buf, i);
151 } 151 integers.push_back(int_buf);
152} 152 }
153*/ 153}
154 154*/
155 155
156 156
157bool estate_dispatch_initialized = false; 157
158 158bool estate_dispatch_initialized = false;
159 159
160///---------------------------------------------------------------------------- 160
161/// LLFloaterRegionInfo 161///----------------------------------------------------------------------------
162///---------------------------------------------------------------------------- 162/// LLFloaterRegionInfo
163 163///----------------------------------------------------------------------------
164//S32 LLFloaterRegionInfo::sRequestSerial = 0; 164
165LLUUID LLFloaterRegionInfo::sRequestInvoice; 165//S32 LLFloaterRegionInfo::sRequestSerial = 0;
166 166LLUUID LLFloaterRegionInfo::sRequestInvoice;
167LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) 167
168{ 168LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed)
169 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); 169{
170} 170 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE);
171 171}
172BOOL LLFloaterRegionInfo::postBuild() 172
173{ 173BOOL LLFloaterRegionInfo::postBuild()
174 mTab = getChild<LLTabContainer>("region_panels"); 174{
175 175 mTab = getChild<LLTabContainer>("region_panels");
176 // contruct the panels 176
177 LLPanelRegionInfo* panel; 177 // contruct the panels
178 panel = new LLPanelRegionGeneralInfo; 178 LLPanelRegionInfo* panel;
179 mInfoPanels.push_back(panel); 179
180 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); 180 panel = new LLPanelRegionGeneralInfo;
181 mTab->addTabPanel(panel, panel->getLabel(), TRUE); 181 mInfoPanels.push_back(panel);
182 182 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml");
183 panel = new LLPanelRegionDebugInfo; 183 mTab->addTabPanel(panel, panel->getLabel(), TRUE);
184 mInfoPanels.push_back(panel); 184
185 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); 185 panel = new LLPanelRegionOpenSettingsInfo;
186 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 186 mInfoPanels.push_back(panel);
187 187 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_open_region_settings.xml");
188 panel = new LLPanelRegionTextureInfo; 188 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
189 mInfoPanels.push_back(panel); 189
190 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); 190 panel = new LLPanelRegionDebugInfo;
191 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 191 mInfoPanels.push_back(panel);
192 192 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml");
193 panel = new LLPanelRegionTerrainInfo; 193 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
194 mInfoPanels.push_back(panel); 194
195 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); 195 panel = new LLPanelRegionTextureInfo;
196 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 196 mInfoPanels.push_back(panel);
197 197 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml");
198 panel = new LLPanelEstateInfo; 198 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
199 mInfoPanels.push_back(panel); 199
200 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); 200 panel = new LLPanelRegionTerrainInfo;
201 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 201 mInfoPanels.push_back(panel);
202 202 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml");
203 panel = new LLPanelEstateCovenant; 203 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
204 mInfoPanels.push_back(panel); 204
205 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); 205 panel = new LLPanelEstateInfo;
206 mTab->addTabPanel(panel, panel->getLabel(), FALSE); 206 mInfoPanels.push_back(panel);
207 207 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml");
208 gMessageSystem->setHandlerFunc( 208 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
209 "EstateOwnerMessage", 209
210 &processEstateOwnerRequest); 210 panel = new LLPanelEstateCovenant;
211 211 mInfoPanels.push_back(panel);
212 return TRUE; 212 LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml");
213} 213 mTab->addTabPanel(panel, panel->getLabel(), FALSE);
214 214
215LLFloaterRegionInfo::~LLFloaterRegionInfo() 215 gMessageSystem->setHandlerFunc(
216{ 216 "EstateOwnerMessage",
217} 217 &processEstateOwnerRequest);
218 218
219void LLFloaterRegionInfo::onOpen() 219 return TRUE;
220{ 220}
221 LLRect rect = gSavedSettings.getRect("FloaterRegionInfo"); 221
222 S32 left, top; 222LLFloaterRegionInfo::~LLFloaterRegionInfo()
223 gFloaterView->getNewFloaterPosition(&left, &top); 223{
224 rect.translate(left,top); 224}
225 225
226 refreshFromRegion(gAgent.getRegion()); 226void LLFloaterRegionInfo::onOpen()
227 requestRegionInfo(); 227{
228 LLFloater::onOpen(); 228 LLRect rect = gSavedSettings.getRect("FloaterRegionInfo");
229} 229 S32 left, top;
230 230 gFloaterView->getNewFloaterPosition(&left, &top);
231// static 231 rect.translate(left,top);
232void LLFloaterRegionInfo::requestRegionInfo() 232
233{ 233 refreshFromRegion(gAgent.getRegion());
234 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); 234 requestRegionInfo();
235 235 LLFloater::onOpen();
236 tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE); 236}
237 tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); 237
238 tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE); 238// static
239 tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE); 239void LLFloaterRegionInfo::requestRegionInfo()
240 240{
241 // Must allow anyone to request the RegionInfo data 241 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels");
242 // so non-owners/non-gods can see the values. 242
243 // Therefore can't use an EstateOwnerMessage JC 243 tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE);
244 LLMessageSystem* msg = gMessageSystem; 244 tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE);
245 msg->newMessage("RequestRegionInfo"); 245 tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE);
246 msg->nextBlock("AgentData"); 246 tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE);
247 msg->addUUID("AgentID", gAgent.getID()); 247 tab->getChild<LLPanel>("RegionSettings")->setCtrlsEnabled(FALSE);
248 msg->addUUID("SessionID", gAgent.getSessionID()); 248
249 gAgent.sendReliableMessage(); 249 // Must allow anyone to request the RegionInfo data
250} 250 // so non-owners/non-gods can see the values.
251 251 // Therefore can't use an EstateOwnerMessage JC
252// static 252 LLMessageSystem* msg = gMessageSystem;
253void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) 253 msg->newMessage("RequestRegionInfo");
254{ 254 msg->nextBlock("AgentData");
255 static LLDispatcher dispatch; 255 msg->addUUID("AgentID", gAgent.getID());
256 if(!findInstance()) 256 msg->addUUID("SessionID", gAgent.getSessionID());
257 { 257 gAgent.sendReliableMessage();
258 return; 258}
259 } 259
260 260// static
261 if (!estate_dispatch_initialized) 261void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**)
262 { 262{
263 LLPanelEstateInfo::initDispatch(dispatch); 263 static LLDispatcher dispatch;
264 } 264 if(!findInstance())
265 265 {
266 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); 266 return;
267 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); 267 }
268 268
269 // unpack the message 269 if (!estate_dispatch_initialized)
270 std::string request; 270 {
271 LLUUID invoice; 271 LLPanelEstateInfo::initDispatch(dispatch);
272 LLDispatcher::sparam_t strings; 272 }
273 LLDispatcher::unpackMessage(msg, request, invoice, strings); 273
274 if(invoice != getLastInvoice()) 274 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels");
275 { 275 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate");
276 llwarns << "Mismatched Estate message: " << request << llendl; 276
277 return; 277 // unpack the message
278 } 278 std::string request;
279 279 LLUUID invoice;
280 //dispatch the message 280 LLDispatcher::sparam_t strings;
281 dispatch.dispatch(request, invoice, strings); 281 LLDispatcher::unpackMessage(msg, request, invoice, strings);
282 282 if(invoice != getLastInvoice())
283 LLViewerRegion* region = gAgent.getRegion(); 283 {
284 panel->updateControls(region); 284 llwarns << "Mismatched Estate message: " << request << llendl;
285} 285 return;
286 286 }
287 287
288// static 288 //dispatch the message
289void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) 289 dispatch.dispatch(request, invoice, strings);
290{ 290
291 LLPanel* panel; 291 LLViewerRegion* region = gAgent.getRegion();
292 292 panel->updateControls(region);
293 llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl; 293}
294 if(!findInstance()) 294
295 { 295
296 return; 296// static
297 } 297void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)
298 298{
299 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); 299 LLPanel* panel;
300 300
301 LLViewerRegion* region = gAgent.getRegion(); 301 llinfos << "LLFloaterRegionInfo::processRegionInfo" << llendl;
302 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 302 if(!findInstance())
303 303 {
304 // extract message 304 return;
305 std::string sim_name; 305 }
306 std::string sim_type = LLTrans::getString("land_type_unknown"); 306
307 U32 region_flags; 307 LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels");
308 U8 agent_limit; 308
309 F32 object_bonus_factor; 309 LLViewerRegion* region = gAgent.getRegion();
310 U8 sim_access; 310 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
311 F32 water_height; 311
312 F32 terrain_raise_limit; 312 // extract message
313 F32 terrain_lower_limit; 313 std::string sim_name;
314 BOOL use_estate_sun; 314 std::string sim_type = LLTrans::getString("land_type_unknown");
315 F32 sun_hour; 315 U32 region_flags;
316 msg->getString("RegionInfo", "SimName", sim_name); 316 U8 agent_limit;
317 msg->getU32("RegionInfo", "RegionFlags", region_flags); 317 F32 object_bonus_factor;
318 msg->getU8("RegionInfo", "MaxAgents", agent_limit); 318 U8 sim_access;
319 msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor); 319 F32 water_height;
320 msg->getU8("RegionInfo", "SimAccess", sim_access); 320 F32 terrain_raise_limit;
321 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height); 321 F32 terrain_lower_limit;
322 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit); 322 BOOL use_estate_sun;
323 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit); 323 F32 sun_hour;
324 msg->getBOOL("RegionInfo", "UseEstateSun", use_estate_sun); 324 msg->getString("RegionInfo", "SimName", sim_name);
325 // actually the "last set" sun hour, not the current sun hour. JC 325 msg->getU32("RegionInfo", "RegionFlags", region_flags);
326 msg->getF32("RegionInfo", "SunHour", sun_hour); 326 msg->getU8("RegionInfo", "MaxAgents", agent_limit);
327 // the only reasonable way to decide if we actually have any data is to 327 msg->getF32("RegionInfo", "ObjectBonusFactor", object_bonus_factor);
328 // check to see if any of these fields have nonzero sizes 328 msg->getU8("RegionInfo", "SimAccess", sim_access);
329 if (msg->getSize("RegionInfo2", "ProductSKU") > 0 || 329 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_WaterHeight, water_height);
330 msg->getSize("RegionInfo2", "ProductName") > 0) 330 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainRaiseLimit, terrain_raise_limit);
331 { 331 msg->getF32Fast(_PREHASH_RegionInfo, _PREHASH_TerrainLowerLimit, terrain_lower_limit);
332 msg->getString("RegionInfo2", "ProductName", sim_type); 332 msg->getBOOL("RegionInfo", "UseEstateSun", use_estate_sun);
333 } 333 // actually the "last set" sun hour, not the current sun hour. JC
334 334 msg->getF32("RegionInfo", "SunHour", sun_hour);
335 // GENERAL PANEL 335 // the only reasonable way to decide if we actually have any data is to
336 panel = tab->getChild<LLPanel>("General"); 336 // check to see if any of these fields have nonzero sizes
337 panel->childSetValue("region_text", LLSD(sim_name)); 337 if (msg->getSize("RegionInfo2", "ProductSKU") > 0 ||
338 panel->childSetValue("region_type", LLSD(sim_type)); 338 msg->getSize("RegionInfo2", "ProductName") > 0)
339 panel->childSetValue("version_channel_text", gLastVersionChannel); 339 {
340 340 msg->getString("RegionInfo2", "ProductName", sim_type);
341 panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); 341 }
342 panel->childSetValue("block_fly_check", (region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE ); 342
343 panel->childSetValue("allow_damage_check", (region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE ); 343 // GENERAL PANEL
344 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE ); 344 panel = tab->getChild<LLPanel>("General");
345 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE ); 345 panel->childSetValue("region_text", LLSD(sim_name));
346 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE ); 346 panel->childSetValue("region_type", LLSD(sim_type));
347 panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE ); 347 panel->childSetValue("version_channel_text", gLastVersionChannel);
348 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) ); 348
349 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) ); 349 panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE );
350 panel->childSetValue("access_combo", LLSD(sim_access) ); 350 panel->childSetValue("block_fly_check", (region_flags & REGION_FLAGS_BLOCK_FLY) ? TRUE : FALSE );
351 351 panel->childSetValue("allow_damage_check", (region_flags & REGION_FLAGS_ALLOW_DAMAGE) ? TRUE : FALSE );
352 352 panel->childSetValue("restrict_pushobject", (region_flags & REGION_FLAGS_RESTRICT_PUSHOBJECT) ? TRUE : FALSE );
353 // detect teen grid for maturity 353 panel->childSetValue("allow_land_resell_check", (region_flags & REGION_FLAGS_BLOCK_LAND_RESELL) ? FALSE : TRUE );
354 354 panel->childSetValue("allow_parcel_changes_check", (region_flags & REGION_FLAGS_ALLOW_PARCEL_CHANGES) ? TRUE : FALSE );
355 U32 parent_estate_id; 355 panel->childSetValue("block_parcel_search_check", (region_flags & REGION_FLAGS_BLOCK_PARCEL_SEARCH) ? TRUE : FALSE );
356 msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id); 356 panel->childSetValue("agent_limit_spin", LLSD((F32)agent_limit) );
357 BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that 357 panel->childSetValue("object_bonus_spin", LLSD(object_bonus_factor) );
358 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid)); 358 panel->childSetValue("access_combo", LLSD(sim_access) );
359 panel->setCtrlsEnabled(allow_modify); 359
360 360
361 361 // detect teen grid for maturity
362 // DEBUG PANEL 362
363 panel = tab->getChild<LLPanel>("Debug"); 363 U32 parent_estate_id;
364 364 msg->getU32("RegionInfo", "ParentEstateID", parent_estate_id);
365 panel->childSetValue("region_text", LLSD(sim_name) ); 365 BOOL teen_grid = (parent_estate_id == 5); // *TODO add field to estate table and test that
366 panel->childSetValue("disable_scripts_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); 366 panel->childSetEnabled("access_combo", gAgent.isGodlike() || (region && region->canManageEstate() && !teen_grid));
367 panel->childSetValue("disable_collisions_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) ); 367 panel->setCtrlsEnabled(allow_modify);
368 panel->childSetValue("disable_physics_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) ); 368
369 panel->setCtrlsEnabled(allow_modify); 369 // RegionSettings PANEL
370 370 panel = tab->getChild<LLPanel>("RegionSettings");
371 // TERRAIN PANEL 371 panel->setCtrlsEnabled(allow_modify);
372 panel = tab->getChild<LLPanel>("Terrain"); 372
373 373 // DEBUG PANEL
374 panel->childSetValue("region_text", LLSD(sim_name)); 374 panel = tab->getChild<LLPanel>("Debug");
375 panel->childSetValue("water_height_spin", LLSD(water_height)); 375
376 panel->childSetValue("terrain_raise_spin", LLSD(terrain_raise_limit)); 376 panel->childSetValue("region_text", LLSD(sim_name) );
377 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit)); 377 panel->childSetValue("disable_scripts_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) );
378 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun)); 378 panel->childSetValue("disable_collisions_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_COLLISIONS)) );
379 379 panel->childSetValue("disable_physics_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_PHYSICS)) );
380 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED))); 380 panel->setCtrlsEnabled(allow_modify);
381 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun); 381
382 panel->childSetValue("sun_hour_slider", LLSD(sun_hour)); 382 // TERRAIN PANEL
383 panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun); 383 panel = tab->getChild<LLPanel>("Terrain");
384 panel->setCtrlsEnabled(allow_modify); 384
385 385 panel->childSetValue("region_text", LLSD(sim_name));
386 getInstance()->refreshFromRegion( gAgent.getRegion() ); 386 panel->childSetValue("water_height_spin", LLSD(water_height));
387} 387 panel->childSetValue("terrain_raise_spin", LLSD(terrain_raise_limit));
388 388 panel->childSetValue("terrain_lower_spin", LLSD(terrain_lower_limit));
389// static 389 panel->childSetValue("use_estate_sun_check", LLSD(use_estate_sun));
390LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() 390
391{ 391 panel->childSetValue("fixed_sun_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SUN_FIXED)));
392 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 392 panel->childSetEnabled("fixed_sun_check", allow_modify && !use_estate_sun);
393 if (!floater) return NULL; 393 panel->childSetValue("sun_hour_slider", LLSD(sun_hour));
394 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); 394 panel->childSetEnabled("sun_hour_slider", allow_modify && !use_estate_sun);
395 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); 395 panel->setCtrlsEnabled(allow_modify);
396 return panel; 396
397} 397 getInstance()->refreshFromRegion( gAgent.getRegion() );
398 398}
399// static 399
400LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() 400// static
401{ 401LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate()
402 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 402{
403 if (!floater) return NULL; 403 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
404 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); 404 if (!floater) return NULL;
405 LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)tab->getChild<LLPanel>("Covenant"); 405 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
406 return panel; 406 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate");
407} 407 return panel;
408 408}
409void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) 409
410{ 410// static
411 // call refresh from region on all panels 411LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant()
412 std::for_each( 412{
413 mInfoPanels.begin(), 413 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
414 mInfoPanels.end(), 414 if (!floater) return NULL;
415 llbind2nd( 415 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
416#if LL_WINDOWS 416 LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)tab->getChild<LLPanel>("Covenant");
417 std::mem_fun1(&LLPanelRegionInfo::refreshFromRegion), 417 return panel;
418#else 418}
419 std::mem_fun(&LLPanelRegionInfo::refreshFromRegion), 419
420#endif 420// static
421 region)); 421LLPanelRegionOpenSettingsInfo* LLFloaterRegionInfo::getPanelOpenSettings()
422} 422{
423 423 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
424// public 424 if (!floater) return NULL;
425void LLFloaterRegionInfo::refresh() 425 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
426{ 426 LLPanelRegionOpenSettingsInfo* panel;
427 for(info_panels_t::iterator iter = mInfoPanels.begin(); 427 panel = (LLPanelRegionOpenSettingsInfo*)tab->getChild<LLPanel>("RegionSettings");
428 iter != mInfoPanels.end(); ++iter) 428 return panel;
429 { 429}
430 (*iter)->refresh(); 430
431 } 431void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
432} 432{
433 433 // call refresh from region on all panels
434 434 std::for_each(
435///---------------------------------------------------------------------------- 435 mInfoPanels.begin(),
436/// Local class implementation 436 mInfoPanels.end(),
437///---------------------------------------------------------------------------- 437 llbind2nd(
438 438#if LL_WINDOWS
439// 439 std::mem_fun1(&LLPanelRegionInfo::refreshFromRegion),
440// LLPanelRegionInfo 440#else
441// 441 std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
442 442#endif
443// static 443 region));
444void LLPanelRegionInfo::onBtnSet(void* user_data) 444}
445{ 445
446 LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data; 446// public
447 if(!panel) return; 447void LLFloaterRegionInfo::refresh()
448 if (panel->sendUpdate()) 448{
449 { 449 for(info_panels_t::iterator iter = mInfoPanels.begin();
450 panel->disableButton("apply_btn"); 450 iter != mInfoPanels.end(); ++iter)
451 } 451 {
452} 452 (*iter)->refresh();
453 453 }
454//static 454}
455void LLPanelRegionInfo::onChangeChildCtrl(LLUICtrl* ctrl, void* user_data) 455
456{ 456
457 if (ctrl) 457///----------------------------------------------------------------------------
458 { 458/// Local class implementation
459 LLPanelRegionInfo* panel = (LLPanelRegionInfo*) ctrl->getParent(); 459///----------------------------------------------------------------------------
460 panel->updateChild(ctrl); 460
461 } 461//
462} 462// LLPanelRegionInfo
463 463//
464// static 464
465// Enables the "set" button if it is not already enabled 465// static
466void LLPanelRegionInfo::onChangeAnything(LLUICtrl* ctrl, void* user_data) 466void LLPanelRegionInfo::onBtnSet(void* user_data)
467{ 467{
468 LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data; 468 LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data;
469 if(panel) 469 if(!panel) return;
470 { 470 if (panel->sendUpdate())
471 panel->enableButton("apply_btn"); 471 {
472 panel->refresh(); 472 panel->disableButton("apply_btn");
473 } 473 }
474} 474}
475 475
476// static 476//static
477// Enables set button on change to line editor 477void LLPanelRegionInfo::onChangeChildCtrl(LLUICtrl* ctrl, void* user_data)
478void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data) 478{
479{ 479 if (ctrl)
480 // reuse the previous method 480 {
481 onChangeAnything(0, user_data); 481 LLPanelRegionInfo* panel = (LLPanelRegionInfo*) ctrl->getParent();
482} 482 panel->updateChild(ctrl);
483 483 }
484 484}
485// virtual 485
486BOOL LLPanelRegionInfo::postBuild() 486// static
487{ 487// Enables the "set" button if it is not already enabled
488 childSetAction("apply_btn", onBtnSet, this); 488void LLPanelRegionInfo::onChangeAnything(LLUICtrl* ctrl, void* user_data)
489 childDisable("apply_btn"); 489{
490 refresh(); 490 LLPanelRegionInfo* panel = (LLPanelRegionInfo*)user_data;
491 return TRUE; 491 if(panel)
492} 492 {
493 493 panel->enableButton("apply_btn");
494// virtual 494 panel->refresh();
495void LLPanelRegionInfo::updateChild(LLUICtrl* child_ctr) 495 }
496{ 496}
497} 497
498 498// static
499// virtual 499// Enables set button on change to line editor
500bool LLPanelRegionInfo::refreshFromRegion(LLViewerRegion* region) 500void LLPanelRegionInfo::onChangeText(LLLineEditor* caller, void* user_data)
501{ 501{
502 if (region) mHost = region->getHost(); 502 // reuse the previous method
503 return true; 503 onChangeAnything(0, user_data);
504} 504}
505 505
506void LLPanelRegionInfo::sendEstateOwnerMessage( 506
507 LLMessageSystem* msg, 507// virtual
508 const std::string& request, 508BOOL LLPanelRegionInfo::postBuild()
509 const LLUUID& invoice, 509{
510 const strings_t& strings) 510 childSetAction("apply_btn", onBtnSet, this);
511{ 511 childDisable("apply_btn");
512 llinfos << "Sending estate request '" << request << "'" << llendl; 512 refresh();
513 msg->newMessage("EstateOwnerMessage"); 513 return TRUE;
514 msg->nextBlockFast(_PREHASH_AgentData); 514}
515 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 515
516 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 516// virtual
517 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used 517void LLPanelRegionInfo::updateChild(LLUICtrl* child_ctr)
518 msg->nextBlock("MethodData"); 518{
519 msg->addString("Method", request); 519}
520 msg->addUUID("Invoice", invoice); 520
521 if(strings.empty()) 521// virtual
522 { 522bool LLPanelRegionInfo::refreshFromRegion(LLViewerRegion* region)
523 msg->nextBlock("ParamList"); 523{
524 msg->addString("Parameter", NULL); 524 if (region) mHost = region->getHost();
525 } 525 return true;
526 else 526}
527 { 527
528 strings_t::const_iterator it = strings.begin(); 528void LLPanelRegionInfo::sendEstateOwnerMessage(
529 strings_t::const_iterator end = strings.end(); 529 LLMessageSystem* msg,
530 for(; it != end; ++it) 530 const std::string& request,
531 { 531 const LLUUID& invoice,
532 msg->nextBlock("ParamList"); 532 const strings_t& strings)
533 msg->addString("Parameter", *it); 533{
534 } 534 llinfos << "Sending estate request '" << request << "'" << llendl;
535 } 535 msg->newMessage("EstateOwnerMessage");
536 msg->sendReliable(mHost); 536 msg->nextBlockFast(_PREHASH_AgentData);
537} 537 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
538 538 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
539void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable) 539 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
540{ 540 msg->nextBlock("MethodData");
541 childSetEnabled(btn_name, enable); 541 msg->addString("Method", request);
542} 542 msg->addUUID("Invoice", invoice);
543 543 if(strings.empty())
544void LLPanelRegionInfo::disableButton(const std::string& btn_name) 544 {
545{ 545 msg->nextBlock("ParamList");
546 childDisable(btn_name); 546 msg->addString("Parameter", NULL);
547} 547 }
548 548 else
549void LLPanelRegionInfo::initCtrl(const std::string& name) 549 {
550{ 550 strings_t::const_iterator it = strings.begin();
551 childSetCommitCallback(name, onChangeAnything, this); 551 strings_t::const_iterator end = strings.end();
552} 552 for(; it != end; ++it)
553 553 {
554void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert) 554 msg->nextBlock("ParamList");
555{ 555 msg->addString("Parameter", *it);
556 childSetAction(name, onClickHelp, new std::string(xml_alert)); 556 }
557} 557 }
558 558 msg->sendReliable(mHost);
559// static 559}
560void LLPanelRegionInfo::onClickHelp(void* data) 560
561{ 561void LLPanelRegionInfo::enableButton(const std::string& btn_name, BOOL enable)
562 std::string* xml_alert = (std::string*)data; 562{
563 LLNotifications::instance().add(*xml_alert); 563 childSetEnabled(btn_name, enable);
564} 564}
565 565
566///////////////////////////////////////////////////////////////////////////// 566void LLPanelRegionInfo::disableButton(const std::string& btn_name)
567// LLPanelRegionGeneralInfo 567{
568// 568 childDisable(btn_name);
569bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region) 569}
570{ 570
571 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 571void LLPanelRegionInfo::initCtrl(const std::string& name)
572 setCtrlsEnabled(allow_modify); 572{
573 childDisable("apply_btn"); 573 childSetCommitCallback(name, onChangeAnything, this);
574 childSetEnabled("access_text", allow_modify); 574}
575 // childSetEnabled("access_combo", allow_modify); 575
576 // now set in processRegionInfo for teen grid detection 576void LLPanelRegionInfo::initHelpBtn(const std::string& name, const std::string& xml_alert)
577 childSetEnabled("kick_btn", allow_modify); 577{
578 childSetEnabled("kick_all_btn", allow_modify); 578 childSetAction(name, onClickHelp, new std::string(xml_alert));
579 childSetEnabled("im_btn", allow_modify); 579}
580 childSetEnabled("manage_telehub_btn", allow_modify); 580
581 581// static
582 // Data gets filled in by processRegionInfo 582void LLPanelRegionInfo::onClickHelp(void* data)
583 583{
584 return LLPanelRegionInfo::refreshFromRegion(region); 584 std::string* xml_alert = (std::string*)data;
585} 585 LLNotifications::instance().add(*xml_alert);
586 586}
587BOOL LLPanelRegionGeneralInfo::postBuild() 587
588{ 588/////////////////////////////////////////////////////////////////////////////
589 // Enable the "Apply" button if something is changed. JC 589// LLPanelRegionGeneralInfo
590 initCtrl("block_terraform_check"); 590//
591 initCtrl("block_fly_check"); 591bool LLPanelRegionGeneralInfo::refreshFromRegion(LLViewerRegion* region)
592 initCtrl("allow_damage_check"); 592{
593 initCtrl("allow_land_resell_check"); 593 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
594 initCtrl("allow_parcel_changes_check"); 594 setCtrlsEnabled(allow_modify);
595 initCtrl("agent_limit_spin"); 595 childDisable("apply_btn");
596 initCtrl("object_bonus_spin"); 596 childSetEnabled("access_text", allow_modify);
597 initCtrl("access_combo"); 597 // childSetEnabled("access_combo", allow_modify);
598 initCtrl("restrict_pushobject"); 598 // now set in processRegionInfo for teen grid detection
599 initCtrl("block_parcel_search_check"); 599 childSetEnabled("kick_btn", allow_modify);
600 600 childSetEnabled("kick_all_btn", allow_modify);
601 initHelpBtn("terraform_help", "HelpRegionBlockTerraform"); 601 childSetEnabled("im_btn", allow_modify);
602 initHelpBtn("fly_help", "HelpRegionBlockFly"); 602 childSetEnabled("manage_telehub_btn", allow_modify);
603 initHelpBtn("damage_help", "HelpRegionAllowDamage"); 603
604 initHelpBtn("agent_limit_help", "HelpRegionAgentLimit"); 604 // Data gets filled in by processRegionInfo
605 initHelpBtn("object_bonus_help", "HelpRegionObjectBonus"); 605
606 initHelpBtn("access_help", "HelpRegionMaturity"); 606 return LLPanelRegionInfo::refreshFromRegion(region);
607 initHelpBtn("restrict_pushobject_help", "HelpRegionRestrictPushObject"); 607}
608 initHelpBtn("land_resell_help", "HelpRegionLandResell"); 608
609 initHelpBtn("parcel_changes_help", "HelpParcelChanges"); 609BOOL LLPanelRegionGeneralInfo::postBuild()
610 initHelpBtn("parcel_search_help", "HelpRegionSearch"); 610{
611 611 // Enable the "Apply" button if something is changed. JC
612 childSetAction("kick_btn", onClickKick, this); 612 initCtrl("block_terraform_check");
613 childSetAction("kick_all_btn", onClickKickAll, this); 613 initCtrl("block_fly_check");
614 childSetAction("im_btn", onClickMessage, this); 614 initCtrl("allow_damage_check");
615 childSetAction("manage_telehub_btn", onClickManageTelehub, this); 615 initCtrl("allow_land_resell_check");
616 616 initCtrl("allow_parcel_changes_check");
617 return LLPanelRegionInfo::postBuild(); 617 initCtrl("agent_limit_spin");
618} 618 initCtrl("object_bonus_spin");
619 619 initCtrl("access_combo");
620// static 620 initCtrl("restrict_pushobject");
621void LLPanelRegionGeneralInfo::onClickKick(void* userdata) 621 initCtrl("block_parcel_search_check");
622{ 622 initCtrl("minimum_agent_age");
623 llinfos << "LLPanelRegionGeneralInfo::onClickKick" << llendl; 623
624 LLPanelRegionGeneralInfo* panelp = (LLPanelRegionGeneralInfo*)userdata; 624 initHelpBtn("terraform_help", "HelpRegionBlockTerraform");
625 625 initHelpBtn("fly_help", "HelpRegionBlockFly");
626 // this depends on the grandparent view being a floater 626 initHelpBtn("damage_help", "HelpRegionAllowDamage");
627 // in order to set up floater dependency 627 initHelpBtn("agent_limit_help", "HelpRegionAgentLimit");
628 LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); 628 initHelpBtn("object_bonus_help", "HelpRegionObjectBonus");
629 LLFloater* child_floater = LLFloaterAvatarPicker::show(onKickCommit, userdata, FALSE, TRUE); 629 initHelpBtn("access_help", "HelpRegionMaturity");
630 parent_floater->addDependentFloater(child_floater); 630 initHelpBtn("restrict_pushobject_help", "HelpRegionRestrictPushObject");
631} 631 initHelpBtn("land_resell_help", "HelpRegionLandResell");
632 632 initHelpBtn("parcel_changes_help", "HelpParcelChanges");
633// static 633 initHelpBtn("parcel_search_help", "HelpRegionSearch");
634void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) 634
635{ 635 childSetAction("kick_btn", onClickKick, this);
636 if (names.empty() || ids.empty()) return; 636 childSetAction("kick_all_btn", onClickKickAll, this);
637 if(ids[0].notNull()) 637 childSetAction("im_btn", onClickMessage, this);
638 { 638 childSetAction("manage_telehub_btn", onClickManageTelehub, this);
639 LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata; 639
640 if(!self) return; 640 return LLPanelRegionInfo::postBuild();
641 strings_t strings; 641}
642 // [0] = our agent id 642
643 // [1] = target agent id 643// static
644 std::string buffer; 644void LLPanelRegionGeneralInfo::onClickKick(void* userdata)
645 gAgent.getID().toString(buffer); 645{
646 strings.push_back(buffer); 646 llinfos << "LLPanelRegionGeneralInfo::onClickKick" << llendl;
647 647 LLPanelRegionGeneralInfo* panelp = (LLPanelRegionGeneralInfo*)userdata;
648 ids[0].toString(buffer); 648
649 strings.push_back(strings_t::value_type(buffer)); 649 // this depends on the grandparent view being a floater
650 650 // in order to set up floater dependency
651 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 651 LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
652 self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings); 652 LLFloater* child_floater = LLFloaterAvatarPicker::show(onKickCommit, userdata, FALSE, TRUE);
653 } 653 parent_floater->addDependentFloater(child_floater);
654} 654}
655 655
656// static 656// static
657void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata) 657void LLPanelRegionGeneralInfo::onKickCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
658{ 658{
659 llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl; 659 if (names.empty() || ids.empty()) return;
660 LLNotifications::instance().add("KickUsersFromRegion", 660 if(ids[0].notNull())
661 LLSD(), 661 {
662 LLSD(), 662 LLPanelRegionGeneralInfo* self = (LLPanelRegionGeneralInfo*)userdata;
663 boost::bind(&LLPanelRegionGeneralInfo::onKickAllCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2)); 663 if(!self) return;
664} 664 strings_t strings;
665 665 // [0] = our agent id
666bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const LLSD& response) 666 // [1] = target agent id
667{ 667 std::string buffer;
668 S32 option = LLNotification::getSelectedOption(notification, response); 668 gAgent.getID().toString(buffer);
669 if (option == 0) 669 strings.push_back(buffer);
670 { 670
671 strings_t strings; 671 ids[0].toString(buffer);
672 // [0] = our agent id 672 strings.push_back(strings_t::value_type(buffer));
673 std::string buffer; 673
674 gAgent.getID().toString(buffer); 674 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
675 strings.push_back(buffer); 675 self->sendEstateOwnerMessage(gMessageSystem, "teleporthomeuser", invoice, strings);
676 676 }
677 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 677}
678 // historical message name 678
679 sendEstateOwnerMessage(gMessageSystem, "teleporthomeallusers", invoice, strings); 679// static
680 } 680void LLPanelRegionGeneralInfo::onClickKickAll(void* userdata)
681 return false; 681{
682} 682 llinfos << "LLPanelRegionGeneralInfo::onClickKickAll" << llendl;
683 683 LLNotifications::instance().add("KickUsersFromRegion",
684// static 684 LLSD(),
685void LLPanelRegionGeneralInfo::onClickMessage(void* userdata) 685 LLSD(),
686{ 686 boost::bind(&LLPanelRegionGeneralInfo::onKickAllCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2));
687 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl; 687}
688 LLNotifications::instance().add("MessageRegion", 688
689 LLSD(), 689bool LLPanelRegionGeneralInfo::onKickAllCommit(const LLSD& notification, const LLSD& response)
690 LLSD(), 690{
691 boost::bind(&LLPanelRegionGeneralInfo::onMessageCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2)); 691 S32 option = LLNotification::getSelectedOption(notification, response);
692} 692 if (option == 0)
693 693 {
694// static 694 strings_t strings;
695bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const LLSD& response) 695 // [0] = our agent id
696{ 696 std::string buffer;
697 if(LLNotification::getSelectedOption(notification, response) != 0) return false; 697 gAgent.getID().toString(buffer);
698 698 strings.push_back(buffer);
699 std::string text = response["message"].asString(); 699
700 if (text.empty()) return false; 700 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
701 701 // historical message name
702 llinfos << "Message to everyone: " << text << llendl; 702 sendEstateOwnerMessage(gMessageSystem, "teleporthomeallusers", invoice, strings);
703 strings_t strings; 703 }
704 // [0] grid_x, unused here 704 return false;
705 // [1] grid_y, unused here 705}
706 // [2] agent_id of sender 706
707 // [3] sender name 707// static
708 // [4] message 708void LLPanelRegionGeneralInfo::onClickMessage(void* userdata)
709 strings.push_back("-1"); 709{
710 strings.push_back("-1"); 710 llinfos << "LLPanelRegionGeneralInfo::onClickMessage" << llendl;
711 std::string buffer; 711 LLNotifications::instance().add("MessageRegion",
712 gAgent.getID().toString(buffer); 712 LLSD(),
713 strings.push_back(buffer); 713 LLSD(),
714 std::string name; 714 boost::bind(&LLPanelRegionGeneralInfo::onMessageCommit, (LLPanelRegionGeneralInfo*)userdata, _1, _2));
715 gAgent.buildFullname(name); 715}
716 strings.push_back(strings_t::value_type(name)); 716
717 strings.push_back(strings_t::value_type(text)); 717// static
718 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 718bool LLPanelRegionGeneralInfo::onMessageCommit(const LLSD& notification, const LLSD& response)
719 sendEstateOwnerMessage(gMessageSystem, "simulatormessage", invoice, strings); 719{
720 return false; 720 if(LLNotification::getSelectedOption(notification, response) != 0) return false;
721} 721
722 722 std::string text = response["message"].asString();
723// static 723 if (text.empty()) return false;
724void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data) 724
725{ 725 llinfos << "Message to everyone: " << text << llendl;
726 LLFloaterRegionInfo::getInstance()->close(); 726 strings_t strings;
727 727 // [0] grid_x, unused here
728 LLFloaterTelehub::show(); 728 // [1] grid_y, unused here
729} 729 // [2] agent_id of sender
730 730 // [3] sender name
731// setregioninfo 731 // [4] message
732// strings[0] = 'Y' - block terraform, 'N' - not 732 strings.push_back("-1");
733// strings[1] = 'Y' - block fly, 'N' - not 733 strings.push_back("-1");
734// strings[2] = 'Y' - allow damage, 'N' - not 734 std::string buffer;
735// strings[3] = 'Y' - allow land sale, 'N' - not 735 gAgent.getID().toString(buffer);
736// strings[4] = agent limit 736 strings.push_back(buffer);
737// strings[5] = object bonus 737 std::string name;
738// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature, 42 = Adult) 738 gAgent.buildFullname(name);
739// strings[7] = restrict pushobject 739 strings.push_back(strings_t::value_type(name));
740// strings[8] = 'Y' - allow parcel subdivide, 'N' - not 740 strings.push_back(strings_t::value_type(text));
741// strings[9] = 'Y' - block parcel search, 'N' - allow 741 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
742BOOL LLPanelRegionGeneralInfo::sendUpdate() 742 sendEstateOwnerMessage(gMessageSystem, "simulatormessage", invoice, strings);
743{ 743 return false;
744 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl; 744}
745 745
746 // First try using a Cap. If that fails use the old method. 746// static
747 LLSD body; 747void LLPanelRegionGeneralInfo::onClickManageTelehub(void* data)
748 std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo"); 748{
749 if (!url.empty()) 749 LLFloaterRegionInfo::getInstance()->close();
750 { 750
751 body["block_terraform"] = childGetValue("block_terraform_check"); 751 LLFloaterTelehub::show();
752 body["block_fly"] = childGetValue("block_fly_check"); 752}
753 body["allow_damage"] = childGetValue("allow_damage_check"); 753
754 body["allow_land_resell"] = childGetValue("allow_land_resell_check"); 754// setregioninfo
755 body["agent_limit"] = childGetValue("agent_limit_spin"); 755// strings[0] = 'Y' - block terraform, 'N' - not
756 body["prim_bonus"] = childGetValue("object_bonus_spin"); 756// strings[1] = 'Y' - block fly, 'N' - not
757 body["sim_access"] = childGetValue("access_combo"); 757// strings[2] = 'Y' - allow damage, 'N' - not
758 body["restrict_pushobject"] = childGetValue("restrict_pushobject"); 758// strings[3] = 'Y' - allow land sale, 'N' - not
759 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check"); 759// strings[4] = agent limit
760 body["block_parcel_search"] = childGetValue("block_parcel_search_check"); 760// strings[5] = object bonus
761 761// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature, 42 = Adult)
762 LLHTTPClient::post(url, body, new LLHTTPClient::Responder()); 762// strings[7] = restrict pushobject
763 } 763// strings[8] = 'Y' - allow parcel subdivide, 'N' - not
764 else 764// strings[9] = 'Y' - block parcel search, 'N' - allow
765 { 765BOOL LLPanelRegionGeneralInfo::sendUpdate()
766 strings_t strings; 766{
767 std::string buffer; 767 llinfos << "LLPanelRegionGeneralInfo::sendUpdate()" << llendl;
768 768
769 buffer = llformat("%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N")); 769 // First try using a Cap. If that fails use the old method.
770 strings.push_back(strings_t::value_type(buffer)); 770 LLSD body;
771 771 std::string url = gAgent.getRegion()->getCapability("DispatchRegionInfo");
772 buffer = llformat("%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N")); 772 if (!url.empty())
773 strings.push_back(strings_t::value_type(buffer)); 773 {
774 774 body["block_terraform"] = childGetValue("block_terraform_check");
775 buffer = llformat("%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N")); 775 body["block_fly"] = childGetValue("block_fly_check");
776 strings.push_back(strings_t::value_type(buffer)); 776 body["allow_damage"] = childGetValue("allow_damage_check");
777 777 body["allow_land_resell"] = childGetValue("allow_land_resell_check");
778 buffer = llformat("%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N")); 778 body["agent_limit"] = childGetValue("agent_limit_spin");
779 strings.push_back(strings_t::value_type(buffer)); 779 body["prim_bonus"] = childGetValue("object_bonus_spin");
780 780 body["sim_access"] = childGetValue("access_combo");
781 F32 value = (F32)childGetValue("agent_limit_spin").asReal(); 781 body["restrict_pushobject"] = childGetValue("restrict_pushobject");
782 buffer = llformat("%f", value); 782 body["allow_parcel_changes"] = childGetValue("allow_parcel_changes_check");
783 strings.push_back(strings_t::value_type(buffer)); 783 body["block_parcel_search"] = childGetValue("block_parcel_search_check");
784 784 body["minimum_agent_age"] = childGetValue("minimum_agent_age");
785 value = (F32)childGetValue("object_bonus_spin").asReal(); 785
786 buffer = llformat("%f", value); 786 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
787 strings.push_back(strings_t::value_type(buffer)); 787 }
788 788 else
789 buffer = llformat("%d", childGetValue("access_combo").asInteger()); 789 {
790 strings.push_back(strings_t::value_type(buffer)); 790 strings_t strings;
791 791 std::string buffer;
792 buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N")); 792
793 strings.push_back(strings_t::value_type(buffer)); 793 buffer = llformat("%s", (childGetValue("block_terraform_check").asBoolean() ? "Y" : "N"));
794 794 strings.push_back(strings_t::value_type(buffer));
795 buffer = llformat("%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N")); 795
796 strings.push_back(strings_t::value_type(buffer)); 796 buffer = llformat("%s", (childGetValue("block_fly_check").asBoolean() ? "Y" : "N"));
797 797 strings.push_back(strings_t::value_type(buffer));
798 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 798
799 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings); 799 buffer = llformat("%s", (childGetValue("allow_damage_check").asBoolean() ? "Y" : "N"));
800 } 800 strings.push_back(strings_t::value_type(buffer));
801 801
802 // if we changed access levels, tell user about it 802 buffer = llformat("%s", (childGetValue("allow_land_resell_check").asBoolean() ? "Y" : "N"));
803 LLViewerRegion* region = gAgent.getRegion(); 803 strings.push_back(strings_t::value_type(buffer));
804 if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) ) 804
805 { 805 F32 value = (F32)childGetValue("agent_limit_spin").asReal();
806 LLNotifications::instance().add("RegionMaturityChange"); 806 buffer = llformat("%f", value);
807 } 807 strings.push_back(strings_t::value_type(buffer));
808 808
809 return TRUE; 809 value = (F32)childGetValue("object_bonus_spin").asReal();
810} 810 buffer = llformat("%f", value);
811 811 strings.push_back(strings_t::value_type(buffer));
812///////////////////////////////////////////////////////////////////////////// 812
813// LLPanelRegionDebugInfo 813 buffer = llformat("%d", childGetValue("access_combo").asInteger());
814///////////////////////////////////////////////////////////////////////////// 814 strings.push_back(strings_t::value_type(buffer));
815BOOL LLPanelRegionDebugInfo::postBuild() 815
816{ 816 buffer = llformat("%s", (childGetValue("restrict_pushobject").asBoolean() ? "Y" : "N"));
817 LLPanelRegionInfo::postBuild(); 817 strings.push_back(strings_t::value_type(buffer));
818 initCtrl("disable_scripts_check"); 818
819 initCtrl("disable_collisions_check"); 819 buffer = llformat("%s", (childGetValue("allow_parcel_changes_check").asBoolean() ? "Y" : "N"));
820 initCtrl("disable_physics_check"); 820 strings.push_back(strings_t::value_type(buffer));
821 821
822 initHelpBtn("disable_scripts_help", "HelpRegionDisableScripts"); 822 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
823 initHelpBtn("disable_collisions_help", "HelpRegionDisableCollisions"); 823 sendEstateOwnerMessage(gMessageSystem, "setregioninfo", invoice, strings);
824 initHelpBtn("disable_physics_help", "HelpRegionDisablePhysics"); 824 }
825 initHelpBtn("top_colliders_help", "HelpRegionTopColliders"); 825
826 initHelpBtn("top_scripts_help", "HelpRegionTopScripts"); 826 // if we changed access levels, tell user about it
827 initHelpBtn("restart_help", "HelpRegionRestart"); 827 LLViewerRegion* region = gAgent.getRegion();
828 828 if (region && (childGetValue("access_combo").asInteger() != region->getSimAccess()) )
829 childSetAction("choose_avatar_btn", onClickChooseAvatar, this); 829 {
830 childSetAction("return_btn", onClickReturn, this); 830 LLNotifications::instance().add("RegionMaturityChange");
831 childSetAction("top_colliders_btn", onClickTopColliders, this); 831 }
832 childSetAction("top_scripts_btn", onClickTopScripts, this); 832
833 childSetAction("restart_btn", onClickRestart, this); 833 return TRUE;
834 childSetAction("cancel_restart_btn", onClickCancelRestart, this); 834}
835 835
836 return TRUE; 836/////////////////////////////////////////////////////////////////////////////
837} 837// LLPanelRegionOpenSettingsInfo
838 838//
839// virtual 839bool LLPanelRegionOpenSettingsInfo::refreshFromRegion(LLViewerRegion* region)
840bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region) 840{
841{ 841 // Data gets filled in by hippo manager
842 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 842 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
843 setCtrlsEnabled(allow_modify); 843
844 childDisable("apply_btn"); 844 childSetValue("draw_distance", gAgent.mDrawDistance);
845 childDisable("target_avatar_name"); 845 childSetValue("force_draw_distance", gAgent.mLockedDrawDistance);
846 846 childSetValue("allow_minimap", LLSD(gHippoLimits->mAllowMinimap));
847 childSetEnabled("choose_avatar_btn", allow_modify); 847 childSetValue("allow_physical_prims", (gHippoLimits->mAllowPhysicalPrims == 1 ? TRUE : FALSE));
848 childSetEnabled("return_scripts", allow_modify && !mTargetAvatar.isNull()); 848 childSetValue("max_drag_distance", LLSD(gHippoLimits->mMaxDragDistance));
849 childSetEnabled("return_other_land", allow_modify && !mTargetAvatar.isNull()); 849 childSetValue("min_hole_size", LLSD(gHippoLimits->mMinHoleSize));
850 childSetEnabled("return_estate_wide", allow_modify && !mTargetAvatar.isNull()); 850 childSetValue("max_hollow_size", LLSD(gHippoLimits->mMaxHollow));
851 childSetEnabled("return_btn", allow_modify && !mTargetAvatar.isNull()); 851 childSetValue("max_inventory_items_transfer", LLSD(gHippoLimits->mMaxInventoryItemsTransfer));
852 childSetEnabled("top_colliders_btn", allow_modify); 852 childSetValue("max_link_count", LLSD(gHippoLimits->mMaxLinkedPrims));
853 childSetEnabled("top_scripts_btn", allow_modify); 853 childSetValue("max_link_count_phys", LLSD(gHippoLimits->mMaxPhysLinkedPrims));
854 childSetEnabled("restart_btn", allow_modify); 854 childSetValue("max_phys_prim_scale", LLSD(gHippoLimits->mMaxPrimScale));//Todo:Fix
855 childSetEnabled("cancel_restart_btn", allow_modify); 855 childSetValue("max_prim_scale", LLSD(gHippoLimits->mMaxPrimScale));
856 856 childSetValue("min_prim_scale", LLSD(gHippoLimits->mMinPrimScale));
857 return LLPanelRegionInfo::refreshFromRegion(region); 857 childSetValue("render_water", LLSD(gHippoLimits->mRenderWater));
858} 858 childSetValue("show_tags", LLSD(gHippoLimits->mRenderName));
859 859 childSetValue("max_groups", LLSD(gHippoLimits->mMaxAgentGroups));
860// virtual 860 childSetValue("allow_parcel_windlight", LLSD(gHippoLimits->mAllowParcelWindLight));
861BOOL LLPanelRegionDebugInfo::sendUpdate() 861 childSetValue("enable_teen_mode", LLSD(gHippoLimits->mEnableTeenMode));
862{ 862 childSetValue("enforce_max_build", LLSD(gHippoLimits->mEnforceMaxBuild));
863 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl; 863
864 strings_t strings; 864 setCtrlsEnabled(allow_modify);
865 std::string buffer; 865
866 866 return LLPanelRegionInfo::refreshFromRegion(region);
867 buffer = llformat("%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N")); 867}
868 strings.push_back(buffer); 868
869 869BOOL LLPanelRegionOpenSettingsInfo::postBuild()
870 buffer = llformat("%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N")); 870{
871 strings.push_back(buffer); 871 // Enable the "Apply" button if something is changed. JC
872 872 initCtrl("draw_distance");
873 buffer = llformat("%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N")); 873 initCtrl("force_draw_distance");
874 strings.push_back(buffer); 874 initCtrl("max_drag_distance");
875 875 initCtrl("max_prim_scale");
876 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 876 initCtrl("min_prim_scale");
877 sendEstateOwnerMessage(gMessageSystem, "setregiondebug", invoice, strings); 877 initCtrl("max_phys_prim_scale");
878 return TRUE; 878 initCtrl("max_hollow_size");
879} 879 initCtrl("min_hole_size");
880 880 initCtrl("max_link_count");
881void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data) 881 initCtrl("max_link_count_phys");
882{ 882 initCtrl("max_inventory_items_transfer");
883 LLFloaterAvatarPicker::show(callbackAvatarID, data, FALSE, TRUE); 883 initCtrl("max_groups");
884} 884 initCtrl("render_water");
885 885 initCtrl("allow_minimap");
886// static 886 initCtrl("allow_physical_prims");
887void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) 887 initCtrl("enable_teen_mode");
888{ 888 initCtrl("show_tags");
889 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) data; 889 initCtrl("allow_parcel_windlight");
890 if (ids.empty() || names.empty()) return; 890
891 self->mTargetAvatar = ids[0]; 891 initHelpBtn("force_draw_distance_help", "HelpForceDrawDistance");
892 self->childSetValue("target_avatar_name", LLSD(names[0])); 892 initHelpBtn("max_inventory_items_transfer_help", "HelpMaxInventoryItemsTransfer");
893 self->refreshFromRegion( gAgent.getRegion() ); 893 initHelpBtn("max_groups_help", "HelpMaxGroups");
894} 894 initHelpBtn("render_water_help", "HelpRenderWater");
895 895 initHelpBtn("allow_minimap_help", "HelpAllowMinimap");
896// static 896 initHelpBtn("allow_physical_prims_help", "HelpAllowPhysicalPrims");
897void LLPanelRegionDebugInfo::onClickReturn(void* data) 897 initHelpBtn("enable_teen_mode_help", "HelpEnableTeenMode");
898{ 898 initHelpBtn("show_tags_help", "HelpShowTags");
899 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data; 899 initHelpBtn("allow_parcel_windlight_help", "HelpAllowParcelWindLight");
900 if (panelp->mTargetAvatar.isNull()) return; 900
901 901 childSetAction("apply_ors_btn", sendUpdate, this);
902 LLSD args; 902
903 args["USER_NAME"] = panelp->childGetValue("target_avatar_name").asString(); 903 refreshFromRegion(gAgent.getRegion());
904 LLSD payload; 904
905 payload["avatar_id"] = panelp->mTargetAvatar; 905 return LLPanelRegionInfo::postBuild();
906 906}
907 U32 flags = SWD_ALWAYS_RETURN_OBJECTS; 907
908 908// setregioninfo
909 if (panelp->childGetValue("return_scripts").asBoolean()) 909// strings[0] = 'Y' - block terraform, 'N' - not
910 { 910// strings[1] = 'Y' - block fly, 'N' - not
911 flags |= SWD_SCRIPTED_ONLY; 911// strings[2] = 'Y' - allow damage, 'N' - not
912 } 912// strings[3] = 'Y' - allow land sale, 'N' - not
913 913// strings[4] = agent limit
914 if (panelp->childGetValue("return_other_land").asBoolean()) 914// strings[5] = object bonus
915 { 915// strings[6] = sim access (0 = unknown, 13 = PG, 21 = Mature, 42 = Adult)
916 flags |= SWD_OTHERS_LAND_ONLY; 916// strings[7] = restrict pushobject
917 } 917// strings[8] = 'Y' - allow parcel subdivide, 'N' - not
918 payload["flags"] = int(flags); 918// strings[9] = 'Y' - block parcel search, 'N' - allow
919 payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean(); 919void LLPanelRegionOpenSettingsInfo::sendUpdate(void* userdata)
920 LLNotifications::instance().add("EstateObjectReturn", args, payload, 920{
921 boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2)); 921 LLPanelRegionOpenSettingsInfo* self;
922} 922 self = (LLPanelRegionOpenSettingsInfo*)userdata;
923 923
924bool LLPanelRegionDebugInfo::callbackReturn(const LLSD& notification, const LLSD& response) 924 llinfos << "LLPanelRegionOpenSettingsInfo::sendUpdate()" << llendl;
925{ 925
926 S32 option = LLNotification::getSelectedOption(notification, response); 926 LLSD body;
927 if (option != 0) return false; 927 std::string url = gAgent.getRegion()->getCapability("DispatchOpenRegionSettings");
928 928 if (!url.empty())
929 LLUUID target_avatar = notification["payload"]["avatar_id"].asUUID(); 929 {
930 if (!target_avatar.isNull()) 930 body["draw_distance"] = self->childGetValue("draw_distance");
931 { 931 body["force_draw_distance"] = self->childGetValue("force_draw_distance");
932 U32 flags = notification["payload"]["flags"].asInteger(); 932 body["allow_minimap"] = self->childGetValue("allow_minimap");
933 bool return_estate_wide = notification["payload"]["return_estate_wide"]; 933 body["allow_physical_prims"] = self->childGetValue("allow_physical_prims");
934 if (return_estate_wide) 934 body["max_drag_distance"] = self->childGetValue("max_drag_distance");
935 { 935 body["min_hole_size"] = self->childGetValue("min_hole_size");
936 // send as estate message - routed by spaceserver to all regions in estate 936 body["max_hollow_size"] = self->childGetValue("max_hollow_size");
937 strings_t strings; 937 body["max_inventory_items_transfer"] = self->childGetValue("max_inventory_items_transfer");
938 strings.push_back(llformat("%d", flags)); 938 body["max_link_count"] = self->childGetValue("max_link_count");
939 strings.push_back(target_avatar.asString()); 939 body["max_link_count_phys"] = self->childGetValue("max_link_count_phys");
940 940 body["max_phys_prim_scale"] = self->childGetValue("max_phys_prim_scale");
941 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 941 body["max_prim_scale"] = self->childGetValue("max_prim_scale");
942 942 body["min_prim_scale"] = self->childGetValue("min_prim_scale");
943 sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings); 943 body["render_water"] = self->childGetValue("render_water");
944 } 944 body["show_tags"] = self->childGetValue("show_tags");
945 else 945 body["max_groups"] = self->childGetValue("max_groups");
946 { 946 body["allow_parcel_windlight"] = self->childGetValue("allow_parcel_windlight");
947 // send to this simulator only 947 body["enable_teen_mode"] = self->childGetValue("enable_teen_mode");
948 send_sim_wide_deletes(target_avatar, flags); 948 body["enforce_max_build"] = self->childGetValue("enforce_max_build");
949 } 949
950 } 950 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
951 return false; 951 }
952} 952}
953 953
954 954/////////////////////////////////////////////////////////////////////////////
955// static 955// LLPanelRegionDebugInfo
956void LLPanelRegionDebugInfo::onClickTopColliders(void* data) 956/////////////////////////////////////////////////////////////////////////////
957{ 957BOOL LLPanelRegionDebugInfo::postBuild()
958 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; 958{
959 strings_t strings; 959 LLPanelRegionInfo::postBuild();
960 strings.push_back("1"); // one physics step 960 initCtrl("disable_scripts_check");
961 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 961 initCtrl("disable_collisions_check");
962 LLFloaterTopObjects::show(); 962 initCtrl("disable_physics_check");
963 LLFloaterTopObjects::clearList(); 963
964 self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings); 964 initHelpBtn("disable_scripts_help", "HelpRegionDisableScripts");
965} 965 initHelpBtn("disable_collisions_help", "HelpRegionDisableCollisions");
966 966 initHelpBtn("disable_physics_help", "HelpRegionDisablePhysics");
967// static 967 initHelpBtn("top_colliders_help", "HelpRegionTopColliders");
968void LLPanelRegionDebugInfo::onClickTopScripts(void* data) 968 initHelpBtn("top_scripts_help", "HelpRegionTopScripts");
969{ 969 initHelpBtn("restart_help", "HelpRegionRestart");
970 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; 970 initHelpBtn("minimum_agent_age_help", "HelpRegionMinimumAge");
971 strings_t strings; 971
972 strings.push_back("6"); // top 5 scripts 972
973 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 973 childSetAction("choose_avatar_btn", onClickChooseAvatar, this);
974 LLFloaterTopObjects::show(); 974 childSetAction("return_btn", onClickReturn, this);
975 LLFloaterTopObjects::clearList(); 975 childSetAction("top_colliders_btn", onClickTopColliders, this);
976 self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings); 976 childSetAction("top_scripts_btn", onClickTopScripts, this);
977} 977 childSetAction("restart_btn", onClickRestart, this);
978 978 childSetAction("cancel_restart_btn", onClickCancelRestart, this);
979// static 979
980void LLPanelRegionDebugInfo::onClickRestart(void* data) 980 return TRUE;
981{ 981}
982 LLNotifications::instance().add("ConfirmRestart", LLSD(), LLSD(), 982
983 boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2)); 983// virtual
984} 984bool LLPanelRegionDebugInfo::refreshFromRegion(LLViewerRegion* region)
985 985{
986bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response) 986 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
987{ 987 setCtrlsEnabled(allow_modify);
988 S32 option = LLNotification::getSelectedOption(notification, response); 988 childDisable("apply_btn");
989 if (option != 0) return false; 989 childDisable("target_avatar_name");
990 990
991 strings_t strings; 991 childSetEnabled("choose_avatar_btn", allow_modify);
992 strings.push_back("120"); 992 childSetEnabled("return_scripts", allow_modify && !mTargetAvatar.isNull());
993 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 993 childSetEnabled("return_other_land", allow_modify && !mTargetAvatar.isNull());
994 sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); 994 childSetEnabled("return_estate_wide", allow_modify && !mTargetAvatar.isNull());
995 return false; 995 childSetEnabled("return_btn", allow_modify && !mTargetAvatar.isNull());
996} 996 childSetEnabled("top_colliders_btn", allow_modify);
997 997 childSetEnabled("top_scripts_btn", allow_modify);
998// static 998 childSetEnabled("restart_btn", allow_modify);
999void LLPanelRegionDebugInfo::onClickCancelRestart(void* data) 999 childSetEnabled("cancel_restart_btn", allow_modify);
1000{ 1000
1001 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data; 1001 return LLPanelRegionInfo::refreshFromRegion(region);
1002 strings_t strings; 1002}
1003 strings.push_back("-1"); 1003
1004 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1004// virtual
1005 self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings); 1005BOOL LLPanelRegionDebugInfo::sendUpdate()
1006} 1006{
1007 1007 llinfos << "LLPanelRegionDebugInfo::sendUpdate" << llendl;
1008 1008 strings_t strings;
1009///////////////////////////////////////////////////////////////////////////// 1009 std::string buffer;
1010// LLPanelRegionTextureInfo 1010
1011// 1011 buffer = llformat("%s", (childGetValue("disable_scripts_check").asBoolean() ? "Y" : "N"));
1012LLPanelRegionTextureInfo::LLPanelRegionTextureInfo() : LLPanelRegionInfo() 1012 strings.push_back(buffer);
1013{ 1013
1014 // nothing. 1014 buffer = llformat("%s", (childGetValue("disable_collisions_check").asBoolean() ? "Y" : "N"));
1015} 1015 strings.push_back(buffer);
1016 1016
1017bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) 1017 buffer = llformat("%s", (childGetValue("disable_physics_check").asBoolean() ? "Y" : "N"));
1018{ 1018 strings.push_back(buffer);
1019 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); 1019
1020 setCtrlsEnabled(allow_modify); 1020 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1021 childDisable("apply_btn"); 1021 sendEstateOwnerMessage(gMessageSystem, "setregiondebug", invoice, strings);
1022 1022 return TRUE;
1023 if (region) 1023}
1024 { 1024
1025 childSetValue("region_text", LLSD(region->getName())); 1025void LLPanelRegionDebugInfo::onClickChooseAvatar(void* data)
1026 } 1026{
1027 else 1027 LLFloaterAvatarPicker::show(callbackAvatarID, data, FALSE, TRUE);
1028 { 1028}
1029 childSetValue("region_text", LLSD("")); 1029
1030 } 1030// static
1031 1031void LLPanelRegionDebugInfo::callbackAvatarID(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
1032 if (!region) return LLPanelRegionInfo::refreshFromRegion(region); 1032{
1033 1033 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*) data;
1034 LLVLComposition* compp = region->getComposition(); 1034 if (ids.empty() || names.empty()) return;
1035 LLTextureCtrl* texture_ctrl; 1035 self->mTargetAvatar = ids[0];
1036 std::string buffer; 1036 self->childSetValue("target_avatar_name", LLSD(names[0]));
1037 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1037 self->refreshFromRegion( gAgent.getRegion() );
1038 { 1038}
1039 buffer = llformat("texture_detail_%d", i); 1039
1040 texture_ctrl = getChild<LLTextureCtrl>(buffer); 1040// static
1041 if(texture_ctrl) 1041void LLPanelRegionDebugInfo::onClickReturn(void* data)
1042 { 1042{
1043 lldebugs << "Detail Texture " << i << ": " 1043 LLPanelRegionDebugInfo* panelp = (LLPanelRegionDebugInfo*) data;
1044 << compp->getDetailTextureID(i) << llendl; 1044 if (panelp->mTargetAvatar.isNull()) return;
1045 LLUUID tmp_id(compp->getDetailTextureID(i)); 1045
1046 texture_ctrl->setImageAssetID(tmp_id); 1046 LLSD args;
1047 } 1047 args["USER_NAME"] = panelp->childGetValue("target_avatar_name").asString();
1048 } 1048 LLSD payload;
1049 1049 payload["avatar_id"] = panelp->mTargetAvatar;
1050 for(S32 i = 0; i < CORNER_COUNT; ++i) 1050
1051 { 1051 U32 flags = SWD_ALWAYS_RETURN_OBJECTS;
1052 buffer = llformat("height_start_spin_%d", i); 1052
1053 childSetValue(buffer, LLSD(compp->getStartHeight(i))); 1053 if (panelp->childGetValue("return_scripts").asBoolean())
1054 buffer = llformat("height_range_spin_%d", i); 1054 {
1055 childSetValue(buffer, LLSD(compp->getHeightRange(i))); 1055 flags |= SWD_SCRIPTED_ONLY;
1056 } 1056 }
1057 1057
1058 // Call the parent for common book-keeping 1058 if (panelp->childGetValue("return_other_land").asBoolean())
1059 return LLPanelRegionInfo::refreshFromRegion(region); 1059 {
1060} 1060 flags |= SWD_OTHERS_LAND_ONLY;
1061 1061 }
1062 1062 payload["flags"] = int(flags);
1063BOOL LLPanelRegionTextureInfo::postBuild() 1063 payload["return_estate_wide"] = panelp->childGetValue("return_estate_wide").asBoolean();
1064{ 1064 LLNotifications::instance().add("EstateObjectReturn", args, payload,
1065 LLPanelRegionInfo::postBuild(); 1065 boost::bind(&LLPanelRegionDebugInfo::callbackReturn, panelp, _1, _2));
1066 std::string buffer; 1066}
1067 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1067
1068 { 1068bool LLPanelRegionDebugInfo::callbackReturn(const LLSD& notification, const LLSD& response)
1069 buffer = llformat("texture_detail_%d", i); 1069{
1070 initCtrl(buffer); 1070 S32 option = LLNotification::getSelectedOption(notification, response);
1071 } 1071 if (option != 0) return false;
1072 1072
1073 for(S32 i = 0; i < CORNER_COUNT; ++i) 1073 LLUUID target_avatar = notification["payload"]["avatar_id"].asUUID();
1074 { 1074 if (!target_avatar.isNull())
1075 buffer = llformat("height_start_spin_%d", i); 1075 {
1076 initCtrl(buffer); 1076 U32 flags = notification["payload"]["flags"].asInteger();
1077 buffer = llformat("height_range_spin_%d", i); 1077 bool return_estate_wide = notification["payload"]["return_estate_wide"];
1078 initCtrl(buffer); 1078 if (return_estate_wide)
1079 } 1079 {
1080 1080 // send as estate message - routed by spaceserver to all regions in estate
1081// LLButton* btn = new LLButton("dump", LLRect(0, 20, 100, 0), "", onClickDump, this); 1081 strings_t strings;
1082// btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT); 1082 strings.push_back(llformat("%d", flags));
1083// addChild(btn); 1083 strings.push_back(target_avatar.asString());
1084 1084
1085 return LLPanelRegionInfo::postBuild(); 1085 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1086} 1086
1087 1087 sendEstateOwnerMessage(gMessageSystem, "estateobjectreturn", invoice, strings);
1088BOOL LLPanelRegionTextureInfo::sendUpdate() 1088 }
1089{ 1089 else
1090 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; 1090 {
1091 1091 // send to this simulator only
1092 // Make sure user hasn't chosen wacky textures. 1092 send_sim_wide_deletes(target_avatar, flags);
1093 if (!validateTextureSizes()) 1093 }
1094 { 1094 }
1095 return FALSE; 1095 return false;
1096 } 1096}
1097 1097
1098 LLTextureCtrl* texture_ctrl; 1098
1099 std::string buffer; 1099// static
1100 std::string id_str; 1100void LLPanelRegionDebugInfo::onClickTopColliders(void* data)
1101 LLMessageSystem* msg = gMessageSystem; 1101{
1102 strings_t strings; 1102 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data;
1103 1103 strings_t strings;
1104 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1104 strings.push_back("1"); // one physics step
1105 1105 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1106 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1106 LLFloaterTopObjects::show();
1107 { 1107 LLFloaterTopObjects::clearList();
1108 buffer = llformat("texture_detail_%d", i); 1108 self->sendEstateOwnerMessage(gMessageSystem, "colliders", invoice, strings);
1109 texture_ctrl = getChild<LLTextureCtrl>(buffer); 1109}
1110 if(texture_ctrl) 1110
1111 { 1111// static
1112 LLUUID tmp_id(texture_ctrl->getImageAssetID()); 1112void LLPanelRegionDebugInfo::onClickTopScripts(void* data)
1113 tmp_id.toString(id_str); 1113{
1114 buffer = llformat("%d %s", i, id_str.c_str()); 1114 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data;
1115 strings.push_back(buffer); 1115 strings_t strings;
1116 } 1116 strings.push_back("6"); // top 5 scripts
1117 } 1117 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1118 sendEstateOwnerMessage(msg, "texturedetail", invoice, strings); 1118 LLFloaterTopObjects::show();
1119 strings.clear(); 1119 LLFloaterTopObjects::clearList();
1120 for(S32 i = 0; i < CORNER_COUNT; ++i) 1120 self->sendEstateOwnerMessage(gMessageSystem, "scripts", invoice, strings);
1121 { 1121}
1122 buffer = llformat("height_start_spin_%d", i); 1122
1123 std::string buffer2 = llformat("height_range_spin_%d", i); 1123// static
1124 std::string buffer3 = llformat("%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal()); 1124void LLPanelRegionDebugInfo::onClickRestart(void* data)
1125 strings.push_back(buffer3); 1125{
1126 } 1126 LLNotifications::instance().add("ConfirmRestart", LLSD(), LLSD(),
1127 sendEstateOwnerMessage(msg, "textureheights", invoice, strings); 1127 boost::bind(&LLPanelRegionDebugInfo::callbackRestart, (LLPanelRegionDebugInfo*)data, _1, _2));
1128 strings.clear(); 1128}
1129 sendEstateOwnerMessage(msg, "texturecommit", invoice, strings); 1129
1130 return TRUE; 1130bool LLPanelRegionDebugInfo::callbackRestart(const LLSD& notification, const LLSD& response)
1131} 1131{
1132 1132 S32 option = LLNotification::getSelectedOption(notification, response);
1133BOOL LLPanelRegionTextureInfo::validateTextureSizes() 1133 if (option != 0) return false;
1134{ 1134
1135 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) 1135 strings_t strings;
1136 { 1136 strings.push_back("120");
1137 std::string buffer; 1137 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1138 buffer = llformat("texture_detail_%d", i); 1138 sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
1139 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(buffer); 1139 return false;
1140 if (!texture_ctrl) continue; 1140}
1141 1141
1142 LLUUID image_asset_id = texture_ctrl->getImageAssetID(); 1142// static
1143 LLViewerImage* img = gImageList.getImage(image_asset_id); 1143void LLPanelRegionDebugInfo::onClickCancelRestart(void* data)
1144 S32 components = img->getComponents(); 1144{
1145 // Must ask for highest resolution version's width. JC 1145 LLPanelRegionDebugInfo* self = (LLPanelRegionDebugInfo*)data;
1146 S32 width = img->getWidth(0); 1146 strings_t strings;
1147 S32 height = img->getHeight(0); 1147 strings.push_back("-1");
1148 1148 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1149 //llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl; 1149 self->sendEstateOwnerMessage(gMessageSystem, "restart", invoice, strings);
1150 1150}
1151 if (components != 3) 1151
1152 { 1152
1153 LLSD args; 1153/////////////////////////////////////////////////////////////////////////////
1154 args["TEXTURE_NUM"] = i+1; 1154// LLPanelRegionTextureInfo
1155 args["TEXTURE_BIT_DEPTH"] = llformat("%d",components * 8); 1155//
1156 LLNotifications::instance().add("InvalidTerrainBitDepth", args); 1156LLPanelRegionTextureInfo::LLPanelRegionTextureInfo() : LLPanelRegionInfo()
1157 return FALSE; 1157{
1158 } 1158 // nothing.
1159 1159}
1160 if (width > 512 || height > 512) 1160
1161 { 1161bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region)
1162 1162{
1163 LLSD args; 1163 BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate());
1164 args["TEXTURE_NUM"] = i+1; 1164 setCtrlsEnabled(allow_modify);
1165 args["TEXTURE_SIZE_X"] = width; 1165 childDisable("apply_btn");
1166 args["TEXTURE_SIZE_Y"] = height; 1166
1167 LLNotifications::instance().add("InvalidTerrainSize", args); 1167 if (region)
1168 return FALSE; 1168 {
1169 1169 childSetValue("region_text", LLSD(region->getName()));
1170 } 1170 }
1171 } 1171 else
1172 1172 {
1173 return TRUE; 1173 childSetValue("region_text", LLSD(""));
1174} 1174 }
1175 1175
1176 1176 if (!region) return LLPanelRegionInfo::refreshFromRegion(region);
1177// static 1177
1178void LLPanelRegionTextureInfo::onClickDump(void* data) 1178 LLVLComposition* compp = region->getComposition();
1179{ 1179 LLTextureCtrl* texture_ctrl;
1180 llinfos << "LLPanelRegionTextureInfo::onClickDump()" << llendl; 1180 std::string buffer;
1181} 1181 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1182 1182 {
1183 1183 buffer = llformat("texture_detail_%d", i);
1184///////////////////////////////////////////////////////////////////////////// 1184 texture_ctrl = getChild<LLTextureCtrl>(buffer);
1185// LLPanelRegionTerrainInfo 1185 if(texture_ctrl)
1186///////////////////////////////////////////////////////////////////////////// 1186 {
1187BOOL LLPanelRegionTerrainInfo::postBuild() 1187 lldebugs << "Detail Texture " << i << ": "
1188{ 1188 << compp->getDetailTextureID(i) << llendl;
1189 LLPanelRegionInfo::postBuild(); 1189 LLUUID tmp_id(compp->getDetailTextureID(i));
1190 1190 texture_ctrl->setImageAssetID(tmp_id);
1191 initHelpBtn("water_height_help", "HelpRegionWaterHeight"); 1191 }
1192 initHelpBtn("terrain_raise_help", "HelpRegionTerrainRaise"); 1192 }
1193 initHelpBtn("terrain_lower_help", "HelpRegionTerrainLower"); 1193
1194 initHelpBtn("upload_raw_help", "HelpRegionUploadRaw"); 1194 for(S32 i = 0; i < CORNER_COUNT; ++i)
1195 initHelpBtn("download_raw_help", "HelpRegionDownloadRaw"); 1195 {
1196 initHelpBtn("use_estate_sun_help", "HelpRegionUseEstateSun"); 1196 buffer = llformat("height_start_spin_%d", i);
1197 initHelpBtn("fixed_sun_help", "HelpRegionFixedSun"); 1197 childSetValue(buffer, LLSD(compp->getStartHeight(i)));
1198 initHelpBtn("bake_terrain_help", "HelpRegionBakeTerrain"); 1198 buffer = llformat("height_range_spin_%d", i);
1199 1199 childSetValue(buffer, LLSD(compp->getHeightRange(i)));
1200 initCtrl("water_height_spin"); 1200 }
1201 initCtrl("terrain_raise_spin"); 1201
1202 initCtrl("terrain_lower_spin"); 1202 // Call the parent for common book-keeping
1203 1203 return LLPanelRegionInfo::refreshFromRegion(region);
1204 initCtrl("fixed_sun_check"); 1204}
1205 childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this); 1205
1206 childSetCommitCallback("use_estate_sun_check", onChangeUseEstateTime, this); 1206
1207 childSetCommitCallback("sun_hour_slider", onChangeSunHour, this); 1207BOOL LLPanelRegionTextureInfo::postBuild()
1208 1208{
1209 childSetAction("download_raw_btn", onClickDownloadRaw, this); 1209 LLPanelRegionInfo::postBuild();
1210 childSetAction("upload_raw_btn", onClickUploadRaw, this); 1210 std::string buffer;
1211 childSetAction("bake_terrain_btn", onClickBakeTerrain, this); 1211 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1212 1212 {
1213 return TRUE; 1213 buffer = llformat("texture_detail_%d", i);
1214} 1214 initCtrl(buffer);
1215 1215 }
1216// virtual 1216
1217bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region) 1217 for(S32 i = 0; i < CORNER_COUNT; ++i)
1218{ 1218 {
1219 llinfos << "LLPanelRegionTerrainInfo::refreshFromRegion" << llendl; 1219 buffer = llformat("height_start_spin_%d", i);
1220 1220 initCtrl(buffer);
1221 BOOL owner_or_god = gAgent.isGodlike() 1221 buffer = llformat("height_range_spin_%d", i);
1222 || (region && (region->getOwner() == gAgent.getID())); 1222 initCtrl(buffer);
1223 BOOL owner_or_god_or_manager = owner_or_god 1223 }
1224 || (region && region->isEstateManager()); 1224
1225 setCtrlsEnabled(owner_or_god_or_manager); 1225// LLButton* btn = new LLButton("dump", LLRect(0, 20, 100, 0), "", onClickDump, this);
1226 childDisable("apply_btn"); 1226// btn->setFollows(FOLLOWS_TOP|FOLLOWS_LEFT);
1227 1227// addChild(btn);
1228 childSetEnabled("download_raw_btn", owner_or_god); 1228
1229 childSetEnabled("upload_raw_btn", owner_or_god); 1229 return LLPanelRegionInfo::postBuild();
1230 childSetEnabled("bake_terrain_btn", owner_or_god); 1230}
1231 1231
1232 return LLPanelRegionInfo::refreshFromRegion(region); 1232BOOL LLPanelRegionTextureInfo::sendUpdate()
1233} 1233{
1234 1234 llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl;
1235// virtual 1235
1236BOOL LLPanelRegionTerrainInfo::sendUpdate() 1236 // Make sure user hasn't chosen wacky textures.
1237{ 1237 if (!validateTextureSizes())
1238 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl; 1238 {
1239 std::string buffer; 1239 return FALSE;
1240 strings_t strings; 1240 }
1241 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1241
1242 1242 LLTextureCtrl* texture_ctrl;
1243 buffer = llformat("%f", (F32)childGetValue("water_height_spin").asReal()); 1243 std::string buffer;
1244 strings.push_back(buffer); 1244 std::string id_str;
1245 buffer = llformat("%f", (F32)childGetValue("terrain_raise_spin").asReal()); 1245 LLMessageSystem* msg = gMessageSystem;
1246 strings.push_back(buffer); 1246 strings_t strings;
1247 buffer = llformat("%f", (F32)childGetValue("terrain_lower_spin").asReal()); 1247
1248 strings.push_back(buffer); 1248 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1249 buffer = llformat("%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N")); 1249
1250 strings.push_back(buffer); 1250 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1251 buffer = llformat("%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N")); 1251 {
1252 strings.push_back(buffer); 1252 buffer = llformat("texture_detail_%d", i);
1253 buffer = llformat("%f", (F32)childGetValue("sun_hour_slider").asReal() ); 1253 texture_ctrl = getChild<LLTextureCtrl>(buffer);
1254 strings.push_back(buffer); 1254 if(texture_ctrl)
1255 1255 {
1256 // Grab estate information in case the user decided to set the 1256 LLUUID tmp_id(texture_ctrl->getImageAssetID());
1257 // region back to estate time. JC 1257 tmp_id.toString(id_str);
1258 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); 1258 buffer = llformat("%d %s", i, id_str.c_str());
1259 if (!floater) return true; 1259 strings.push_back(buffer);
1260 1260 }
1261 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); 1261 }
1262 if (!tab) return true; 1262 sendEstateOwnerMessage(msg, "texturedetail", invoice, strings);
1263 1263 strings.clear();
1264 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); 1264 for(S32 i = 0; i < CORNER_COUNT; ++i)
1265 if (!panel) return true; 1265 {
1266 1266 buffer = llformat("height_start_spin_%d", i);
1267 BOOL estate_global_time = panel->getGlobalTime(); 1267 std::string buffer2 = llformat("height_range_spin_%d", i);
1268 BOOL estate_fixed_sun = panel->getFixedSun(); 1268 std::string buffer3 = llformat("%d %f %f", i, (F32)childGetValue(buffer).asReal(), (F32)childGetValue(buffer2).asReal());
1269 F32 estate_sun_hour; 1269 strings.push_back(buffer3);
1270 if (estate_global_time) 1270 }
1271 { 1271 sendEstateOwnerMessage(msg, "textureheights", invoice, strings);
1272 estate_sun_hour = 0.f; 1272 strings.clear();
1273 } 1273 sendEstateOwnerMessage(msg, "texturecommit", invoice, strings);
1274 else 1274 return TRUE;
1275 { 1275}
1276 estate_sun_hour = panel->getSunHour(); 1276
1277 } 1277BOOL LLPanelRegionTextureInfo::validateTextureSizes()
1278 1278{
1279 buffer = llformat("%s", (estate_global_time ? "Y" : "N") ); 1279 for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i)
1280 strings.push_back(buffer); 1280 {
1281 buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") ); 1281 std::string buffer;
1282 strings.push_back(buffer); 1282 buffer = llformat("texture_detail_%d", i);
1283 buffer = llformat("%f", estate_sun_hour); 1283 LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(buffer);
1284 strings.push_back(buffer); 1284 if (!texture_ctrl) continue;
1285 1285
1286 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); 1286 LLUUID image_asset_id = texture_ctrl->getImageAssetID();
1287 return TRUE; 1287 LLViewerImage* img = gImageList.getImage(image_asset_id);
1288} 1288 S32 components = img->getComponents();
1289 1289 // Must ask for highest resolution version's width. JC
1290// static 1290 S32 width = img->getWidth(0);
1291void LLPanelRegionTerrainInfo::onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data) 1291 S32 height = img->getHeight(0);
1292{ 1292
1293 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data; 1293 //llinfos << "texture detail " << i << " is " << width << "x" << height << "x" << components << llendl;
1294 if (!panel) return; 1294
1295 BOOL use_estate_sun = panel->childGetValue("use_estate_sun_check").asBoolean(); 1295 if (components != 3)
1296 panel->childSetEnabled("fixed_sun_check", !use_estate_sun); 1296 {
1297 panel->childSetEnabled("sun_hour_slider", !use_estate_sun); 1297 LLSD args;
1298 if (use_estate_sun) 1298 args["TEXTURE_NUM"] = i+1;
1299 { 1299 args["TEXTURE_BIT_DEPTH"] = llformat("%d",components * 8);
1300 panel->childSetValue("fixed_sun_check", LLSD(FALSE)); 1300 LLNotifications::instance().add("InvalidTerrainBitDepth", args);
1301 panel->childSetValue("sun_hour_slider", LLSD(0.f)); 1301 return FALSE;
1302 } 1302 }
1303 panel->childEnable("apply_btn"); 1303
1304} 1304 if (width > 512 || height > 512)
1305 1305 {
1306// static 1306
1307void LLPanelRegionTerrainInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data) 1307 LLSD args;
1308{ 1308 args["TEXTURE_NUM"] = i+1;
1309 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data; 1309 args["TEXTURE_SIZE_X"] = width;
1310 if (!panel) return; 1310 args["TEXTURE_SIZE_Y"] = height;
1311 // Just enable the apply button. We let the sun-hour slider be enabled 1311 LLNotifications::instance().add("InvalidTerrainSize", args);
1312 // for both fixed-sun and non-fixed-sun. JC 1312 return FALSE;
1313 panel->childEnable("apply_btn"); 1313
1314} 1314 }
1315 1315 }
1316// static 1316
1317void LLPanelRegionTerrainInfo::onChangeSunHour(LLUICtrl* ctrl, void*) 1317 return TRUE;
1318{ 1318}
1319 // can't use userdata to get panel, slider uses it internally 1319
1320 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) ctrl->getParent(); 1320
1321 if (!panel) return; 1321// static
1322 panel->childEnable("apply_btn"); 1322void LLPanelRegionTextureInfo::onClickDump(void* data)
1323} 1323{
1324 1324 llinfos << "LLPanelRegionTextureInfo::onClickDump()" << llendl;
1325// static 1325}
1326void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data) 1326
1327{ 1327
1328 LLFilePicker& picker = LLFilePicker::instance(); 1328/////////////////////////////////////////////////////////////////////////////
1329 if (!picker.getSaveFile(LLFilePicker::FFSAVE_RAW, "terrain.raw")) 1329// LLPanelRegionTerrainInfo
1330 { 1330/////////////////////////////////////////////////////////////////////////////
1331 llwarns << "No file" << llendl; 1331BOOL LLPanelRegionTerrainInfo::postBuild()
1332 return; 1332{
1333 } 1333 LLPanelRegionInfo::postBuild();
1334 std::string filepath = picker.getFirstFile(); 1334
1335 gXferManager->expectFileForRequest(filepath); 1335 initHelpBtn("water_height_help", "HelpRegionWaterHeight");
1336 1336 initHelpBtn("terrain_raise_help", "HelpRegionTerrainRaise");
1337 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; 1337 initHelpBtn("terrain_lower_help", "HelpRegionTerrainLower");
1338 strings_t strings; 1338 initHelpBtn("upload_raw_help", "HelpRegionUploadRaw");
1339 strings.push_back("download filename"); 1339 initHelpBtn("download_raw_help", "HelpRegionDownloadRaw");
1340 strings.push_back(filepath); 1340 initHelpBtn("use_estate_sun_help", "HelpRegionUseEstateSun");
1341 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1341 initHelpBtn("fixed_sun_help", "HelpRegionFixedSun");
1342 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); 1342 initHelpBtn("bake_terrain_help", "HelpRegionBakeTerrain");
1343} 1343
1344 1344 initCtrl("water_height_spin");
1345// static 1345 initCtrl("terrain_raise_spin");
1346void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data) 1346 initCtrl("terrain_lower_spin");
1347{ 1347
1348 LLFilePicker& picker = LLFilePicker::instance(); 1348 initCtrl("fixed_sun_check");
1349 if (!picker.getOpenFile(LLFilePicker::FFLOAD_RAW)) 1349 childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this);
1350 { 1350 childSetCommitCallback("use_estate_sun_check", onChangeUseEstateTime, this);
1351 llwarns << "No file" << llendl; 1351 childSetCommitCallback("sun_hour_slider", onChangeSunHour, this);
1352 return; 1352
1353 } 1353 childSetAction("download_raw_btn", onClickDownloadRaw, this);
1354 std::string filepath = picker.getFirstFile(); 1354 childSetAction("upload_raw_btn", onClickUploadRaw, this);
1355 gXferManager->expectFileForTransfer(filepath); 1355 childSetAction("bake_terrain_btn", onClickBakeTerrain, this);
1356 1356
1357 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data; 1357 return TRUE;
1358 strings_t strings; 1358}
1359 strings.push_back("upload filename"); 1359
1360 strings.push_back(filepath); 1360// virtual
1361 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1361bool LLPanelRegionTerrainInfo::refreshFromRegion(LLViewerRegion* region)
1362 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); 1362{
1363 1363 llinfos << "LLPanelRegionTerrainInfo::refreshFromRegion" << llendl;
1364 LLNotifications::instance().add("RawUploadStarted"); 1364
1365} 1365 BOOL owner_or_god = gAgent.isGodlike()
1366 1366 || (region && (region->getOwner() == gAgent.getID()));
1367// static 1367 BOOL owner_or_god_or_manager = owner_or_god
1368void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data) 1368 || (region && region->isEstateManager());
1369{ 1369 setCtrlsEnabled(owner_or_god_or_manager);
1370 LLNotifications::instance().add( 1370 childDisable("apply_btn");
1371 LLNotification::Params("ConfirmBakeTerrain") 1371
1372 .functor(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2))); 1372 childSetEnabled("download_raw_btn", owner_or_god);
1373} 1373 childSetEnabled("upload_raw_btn", owner_or_god);
1374 1374 childSetEnabled("bake_terrain_btn", owner_or_god);
1375bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response) 1375
1376{ 1376 return LLPanelRegionInfo::refreshFromRegion(region);
1377 S32 option = LLNotification::getSelectedOption(notification, response); 1377}
1378 if (option != 0) return false; 1378
1379 1379// virtual
1380 strings_t strings; 1380BOOL LLPanelRegionTerrainInfo::sendUpdate()
1381 strings.push_back("bake"); 1381{
1382 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 1382 llinfos << "LLPanelRegionTerrainInfo::sendUpdate" << llendl;
1383 sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings); 1383 std::string buffer;
1384 return false; 1384 strings_t strings;
1385} 1385 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1386 1386
1387///////////////////////////////////////////////////////////////////////////// 1387 buffer = llformat("%f", (F32)childGetValue("water_height_spin").asReal());
1388// LLPanelEstateInfo 1388 strings.push_back(buffer);
1389// 1389 buffer = llformat("%f", (F32)childGetValue("terrain_raise_spin").asReal());
1390 1390 strings.push_back(buffer);
1391LLPanelEstateInfo::LLPanelEstateInfo() 1391 buffer = llformat("%f", (F32)childGetValue("terrain_lower_spin").asReal());
1392: LLPanelRegionInfo(), 1392 strings.push_back(buffer);
1393 mEstateID(0) // invalid 1393 buffer = llformat("%s", (childGetValue("use_estate_sun_check").asBoolean() ? "Y" : "N"));
1394{ 1394 strings.push_back(buffer);
1395} 1395 buffer = llformat("%s", (childGetValue("fixed_sun_check").asBoolean() ? "Y" : "N"));
1396 1396 strings.push_back(buffer);
1397// static 1397 buffer = llformat("%f", (F32)childGetValue("sun_hour_slider").asReal() );
1398void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch) 1398 strings.push_back(buffer);
1399{ 1399
1400 std::string name; 1400 // Grab estate information in case the user decided to set the
1401 1401 // region back to estate time. JC
1402// name.assign("setowner"); 1402 LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance();
1403// static LLDispatchSetEstateOwner set_owner; 1403 if (!floater) return true;
1404// dispatch.addHandler(name, &set_owner); 1404
1405 1405 LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels");
1406 name.assign("estateupdateinfo"); 1406 if (!tab) return true;
1407 static LLDispatchEstateUpdateInfo estate_update_info; 1407
1408 dispatch.addHandler(name, &estate_update_info); 1408 LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate");
1409 1409 if (!panel) return true;
1410 name.assign("setaccess"); 1410
1411 static LLDispatchSetEstateAccess set_access; 1411 BOOL estate_global_time = panel->getGlobalTime();
1412 dispatch.addHandler(name, &set_access); 1412 BOOL estate_fixed_sun = panel->getFixedSun();
1413 1413 F32 estate_sun_hour;
1414 estate_dispatch_initialized = true; 1414 if (estate_global_time)
1415} 1415 {
1416 1416 estate_sun_hour = 0.f;
1417// static 1417 }
1418// Disables the sun-hour slider and the use fixed time check if the use global time is check 1418 else
1419void LLPanelEstateInfo::onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data) 1419 {
1420{ 1420 estate_sun_hour = panel->getSunHour();
1421 LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data; 1421 }
1422 if (panel) 1422
1423 { 1423 buffer = llformat("%s", (estate_global_time ? "Y" : "N") );
1424 bool enabled = !panel->childGetValue("use_global_time_check").asBoolean(); 1424 strings.push_back(buffer);
1425 panel->childSetEnabled("sun_hour_slider", enabled); 1425 buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") );
1426 panel->childSetEnabled("fixed_sun_check", enabled); 1426 strings.push_back(buffer);
1427 panel->childSetValue("fixed_sun_check", LLSD(FALSE)); 1427 buffer = llformat("%f", estate_sun_hour);
1428 panel->enableButton("apply_btn"); 1428 strings.push_back(buffer);
1429 } 1429
1430} 1430 sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings);
1431 1431 return TRUE;
1432// Enables the sun-hour slider if the fixed-sun checkbox is set 1432}
1433void LLPanelEstateInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data) 1433
1434{ 1434// static
1435 LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data; 1435void LLPanelRegionTerrainInfo::onChangeUseEstateTime(LLUICtrl* ctrl, void* user_data)
1436 if (panel) 1436{
1437 { 1437 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data;
1438 bool enabled = !panel->childGetValue("fixed_sun_check").asBoolean(); 1438 if (!panel) return;
1439 panel->childSetEnabled("use_global_time_check", enabled); 1439 BOOL use_estate_sun = panel->childGetValue("use_estate_sun_check").asBoolean();
1440 panel->childSetValue("use_global_time_check", LLSD(FALSE)); 1440 panel->childSetEnabled("fixed_sun_check", !use_estate_sun);
1441 panel->enableButton("apply_btn"); 1441 panel->childSetEnabled("sun_hour_slider", !use_estate_sun);
1442 } 1442 if (use_estate_sun)
1443} 1443 {
1444 1444 panel->childSetValue("fixed_sun_check", LLSD(FALSE));
1445 1445 panel->childSetValue("sun_hour_slider", LLSD(0.f));
1446 1446 }
1447 1447 panel->childEnable("apply_btn");
1448//--------------------------------------------------------------------------- 1448}
1449// Add/Remove estate access button callbacks 1449
1450//--------------------------------------------------------------------------- 1450// static
1451void LLPanelEstateInfo::onClickEditSky(void* user_data) 1451void LLPanelRegionTerrainInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data)
1452{ 1452{
1453 LLFloaterWindLight::show(); 1453 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) user_data;
1454} 1454 if (!panel) return;
1455 1455 // Just enable the apply button. We let the sun-hour slider be enabled
1456void LLPanelEstateInfo::onClickEditDayCycle(void* user_data) 1456 // for both fixed-sun and non-fixed-sun. JC
1457{ 1457 panel->childEnable("apply_btn");
1458 LLFloaterDayCycle::show(); 1458}
1459} 1459
1460 1460// static
1461// static 1461void LLPanelRegionTerrainInfo::onChangeSunHour(LLUICtrl* ctrl, void*)
1462void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data) 1462{
1463{ 1463 // can't use userdata to get panel, slider uses it internally
1464 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; 1464 LLPanelRegionTerrainInfo* panel = (LLPanelRegionTerrainInfo*) ctrl->getParent();
1465 LLCtrlListInterface *list = self->childGetListInterface("allowed_avatar_name_list"); 1465 if (!panel) return;
1466 if (!list) return; 1466 panel->childEnable("apply_btn");
1467 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1467}
1468 { 1468
1469 //args 1469// static
1470 1470void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data)
1471 LLSD args; 1471{
1472 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1472 LLFilePicker& picker = LLFilePicker::instance();
1473 LLNotifications::instance().add("MaxAllowedAgentOnRegion", args); 1473 if (!picker.getSaveFile(LLFilePicker::FFSAVE_RAW, "terrain.raw"))
1474 return; 1474 {
1475 } 1475 llwarns << "No file" << llendl;
1476 accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd"); 1476 return;
1477} 1477 }
1478 1478 std::string filepath = picker.getFirstFile();
1479// static 1479 gXferManager->expectFileForRequest(filepath);
1480void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data) 1480
1481{ 1481 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data;
1482 accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list"); 1482 strings_t strings;
1483} 1483 strings.push_back("download filename");
1484 1484 strings.push_back(filepath);
1485// static 1485 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1486void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data) 1486 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings);
1487{ 1487}
1488 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; 1488
1489 LLCtrlListInterface *list = self->childGetListInterface("allowed_group_name_list"); 1489// static
1490 if (!list) return; 1490void LLPanelRegionTerrainInfo::onClickUploadRaw(void* data)
1491 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1491{
1492 { 1492 LLFilePicker& picker = LLFilePicker::instance();
1493 LLSD args; 1493 if (!picker.getOpenFile(LLFilePicker::FFLOAD_RAW))
1494 args["MAX_GROUPS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1494 {
1495 LLNotifications::instance().add("MaxAllowedGroupsOnRegion", args); 1495 llwarns << "No file" << llendl;
1496 return; 1496 return;
1497 } 1497 }
1498 1498 std::string filepath = picker.getFirstFile();
1499 LLNotification::Params params("ChangeLindenAccess"); 1499 gXferManager->expectFileForTransfer(filepath);
1500 params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2)); 1500
1501 if (isLindenEstate()) 1501 LLPanelRegionTerrainInfo* self = (LLPanelRegionTerrainInfo*)data;
1502 { 1502 strings_t strings;
1503 LLNotifications::instance().add(params); 1503 strings.push_back("upload filename");
1504 } 1504 strings.push_back(filepath);
1505 else 1505 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1506 { 1506 self->sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings);
1507 LLNotifications::instance().forceResponse(params, 0); 1507
1508 } 1508 LLNotifications::instance().add("RawUploadStarted");
1509} 1509}
1510 1510
1511bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response) 1511// static
1512{ 1512void LLPanelRegionTerrainInfo::onClickBakeTerrain(void* data)
1513 S32 option = LLNotification::getSelectedOption(notification, response); 1513{
1514 if (option != 0) return false; 1514 LLNotifications::instance().add(
1515 1515 LLNotification::Params("ConfirmBakeTerrain")
1516 LLFloater* parent_floater = gFloaterView->getParentFloater(this); 1516 .functor(boost::bind(&LLPanelRegionTerrainInfo::callbackBakeTerrain, (LLPanelRegionTerrainInfo*)data, _1, _2)));
1517 1517}
1518 LLFloaterGroupPicker* widget; 1518
1519 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID())); 1519bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, const LLSD& response)
1520 if (widget) 1520{
1521 { 1521 S32 option = LLNotification::getSelectedOption(notification, response);
1522 widget->setSelectCallback(addAllowedGroup2, NULL); 1522 if (option != 0) return false;
1523 if (parent_floater) 1523
1524 { 1524 strings_t strings;
1525 LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget); 1525 strings.push_back("bake");
1526 widget->setOrigin(new_rect.mLeft, new_rect.mBottom); 1526 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
1527 parent_floater->addDependentFloater(widget); 1527 sendEstateOwnerMessage(gMessageSystem, "terrain", invoice, strings);
1528 } 1528 return false;
1529 } 1529}
1530 1530
1531 return false; 1531/////////////////////////////////////////////////////////////////////////////
1532} 1532// LLPanelEstateInfo
1533 1533//
1534// static 1534
1535void LLPanelEstateInfo::onClickRemoveAllowedGroup(void* user_data) 1535LLPanelEstateInfo::LLPanelEstateInfo()
1536{ 1536: LLPanelRegionInfo(),
1537 accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list"); 1537 mEstateID(0) // invalid
1538} 1538{
1539 1539}
1540// static 1540
1541void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data) 1541// static
1542{ 1542void LLPanelEstateInfo::initDispatch(LLDispatcher& dispatch)
1543 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; 1543{
1544 LLCtrlListInterface *list = self->childGetListInterface("banned_avatar_name_list"); 1544 std::string name;
1545 if (!list) return; 1545
1546 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS) 1546// name.assign("setowner");
1547 { 1547// static LLDispatchSetEstateOwner set_owner;
1548 LLSD args; 1548// dispatch.addHandler(name, &set_owner);
1549 args["MAX_BANNED"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1549
1550 LLNotifications::instance().add("MaxBannedAgentsOnRegion", args); 1550 name.assign("estateupdateinfo");
1551 return; 1551 static LLDispatchEstateUpdateInfo estate_update_info;
1552 } 1552 dispatch.addHandler(name, &estate_update_info);
1553 accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd"); 1553
1554} 1554 name.assign("setaccess");
1555 1555 static LLDispatchSetEstateAccess set_access;
1556// static 1556 dispatch.addHandler(name, &set_access);
1557void LLPanelEstateInfo::onClickRemoveBannedAgent(void* user_data) 1557
1558{ 1558 estate_dispatch_initialized = true;
1559 accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list"); 1559}
1560} 1560
1561 1561// static
1562// static 1562// Disables the sun-hour slider and the use fixed time check if the use global time is check
1563void LLPanelEstateInfo::onClickAddEstateManager(void* user_data) 1563void LLPanelEstateInfo::onChangeUseGlobalTime(LLUICtrl* ctrl, void* user_data)
1564{ 1564{
1565 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data; 1565 LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data;
1566 LLCtrlListInterface *list = self->childGetListInterface("estate_manager_name_list"); 1566 if (panel)
1567 if (!list) return; 1567 {
1568 if (list->getItemCount() >= ESTATE_MAX_MANAGERS) 1568 bool enabled = !panel->childGetValue("use_global_time_check").asBoolean();
1569 { // Tell user they can't add more managers 1569 panel->childSetEnabled("sun_hour_slider", enabled);
1570 LLSD args; 1570 panel->childSetEnabled("fixed_sun_check", enabled);
1571 args["MAX_MANAGER"] = llformat("%d",ESTATE_MAX_MANAGERS); 1571 panel->childSetValue("fixed_sun_check", LLSD(FALSE));
1572 LLNotifications::instance().add("MaxManagersOnRegion", args); 1572 panel->enableButton("apply_btn");
1573 } 1573 }
1574 else 1574}
1575 { // Go pick managers to add 1575
1576 accessAddCore(ESTATE_ACCESS_MANAGER_ADD, "EstateManagerAdd"); 1576// Enables the sun-hour slider if the fixed-sun checkbox is set
1577 } 1577void LLPanelEstateInfo::onChangeFixedSun(LLUICtrl* ctrl, void* user_data)
1578} 1578{
1579 1579 LLPanelEstateInfo* panel = (LLPanelEstateInfo*) user_data;
1580// static 1580 if (panel)
1581void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data) 1581 {
1582{ 1582 bool enabled = !panel->childGetValue("fixed_sun_check").asBoolean();
1583 accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list"); 1583 panel->childSetEnabled("use_global_time_check", enabled);
1584} 1584 panel->childSetValue("use_global_time_check", LLSD(FALSE));
1585 1585 panel->enableButton("apply_btn");
1586//--------------------------------------------------------------------------- 1586 }
1587// Kick from estate methods 1587}
1588//--------------------------------------------------------------------------- 1588
1589struct LLKickFromEstateInfo 1589
1590{ 1590
1591 LLPanelEstateInfo *mEstatePanelp; 1591
1592 LLUUID mAgentID; 1592//---------------------------------------------------------------------------
1593}; 1593// Add/Remove estate access button callbacks
1594 1594//---------------------------------------------------------------------------
1595void LLPanelEstateInfo::onClickKickUser(void *user_data) 1595void LLPanelEstateInfo::onClickEditSky(void* user_data)
1596{ 1596{
1597 LLPanelEstateInfo* panelp = (LLPanelEstateInfo*)user_data; 1597 LLFloaterWindLight::show();
1598 1598}
1599 // this depends on the grandparent view being a floater 1599
1600 // in order to set up floater dependency 1600void LLPanelEstateInfo::onClickEditDayCycle(void* user_data)
1601 LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); 1601{
1602 LLFloater* child_floater = LLFloaterAvatarPicker::show(LLPanelEstateInfo::onKickUserCommit, user_data, FALSE, TRUE); 1602 LLFloaterDayCycle::show();
1603 parent_floater->addDependentFloater(child_floater); 1603}
1604} 1604
1605 1605// static
1606void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata) 1606void LLPanelEstateInfo::onClickAddAllowedAgent(void* user_data)
1607{ 1607{
1608 if (names.empty() || ids.empty()) return; 1608 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data;
1609 1609 LLCtrlListInterface *list = self->childGetListInterface("allowed_avatar_name_list");
1610 //check to make sure there is one valid user and id 1610 if (!list) return;
1611 if( (ids[0].isNull()) || 1611 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1612 (names[0].length() == 0) ) 1612 {
1613 { 1613 //args
1614 return; 1614
1615 } 1615 LLSD args;
1616 1616 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1617 LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata; 1617 LLNotifications::instance().add("MaxAllowedAgentOnRegion", args);
1618 if(!self) return; 1618 return;
1619 1619 }
1620 //keep track of what user they want to kick and other misc info 1620 accessAddCore(ESTATE_ACCESS_ALLOWED_AGENT_ADD, "EstateAllowedAgentAdd");
1621 LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo(); 1621}
1622 kick_info->mEstatePanelp = self; 1622
1623 kick_info->mAgentID = ids[0]; 1623// static
1624 1624void LLPanelEstateInfo::onClickRemoveAllowedAgent(void* user_data)
1625 //Bring up a confirmation dialog 1625{
1626 LLSD args; 1626 accessRemoveCore(ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, "EstateAllowedAgentRemove", "allowed_avatar_name_list");
1627 args["EVIL_USER"] = names[0]; 1627}
1628 LLSD payload; 1628
1629 payload["agent_id"] = ids[0]; 1629// static
1630 LLNotifications::instance().add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2)); 1630void LLPanelEstateInfo::onClickAddAllowedGroup(void* user_data)
1631 1631{
1632} 1632 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data;
1633 1633 LLCtrlListInterface *list = self->childGetListInterface("allowed_group_name_list");
1634bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& response) 1634 if (!list) return;
1635{ 1635 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1636 S32 option = LLNotification::getSelectedOption(notification, response); 1636 {
1637 switch(option) 1637 LLSD args;
1638 { 1638 args["MAX_GROUPS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1639 case 0: 1639 LLNotifications::instance().add("MaxAllowedGroupsOnRegion", args);
1640 { 1640 return;
1641 //Kick User 1641 }
1642 strings_t strings; 1642
1643 strings.push_back(notification["payload"]["agent_id"].asString()); 1643 LLNotification::Params params("ChangeLindenAccess");
1644 1644 params.functor(boost::bind(&LLPanelEstateInfo::addAllowedGroup, self, _1, _2));
1645 sendEstateOwnerMessage(gMessageSystem, "kickestate", LLFloaterRegionInfo::getLastInvoice(), strings); 1645 if (isLindenEstate())
1646 break; 1646 {
1647 } 1647 LLNotifications::instance().add(params);
1648 default: 1648 }
1649 break; 1649 else
1650 } 1650 {
1651 return false; 1651 LLNotifications::instance().forceResponse(params, 0);
1652} 1652 }
1653 1653}
1654//--------------------------------------------------------------------------- 1654
1655// Core Add/Remove estate access methods 1655bool LLPanelEstateInfo::addAllowedGroup(const LLSD& notification, const LLSD& response)
1656// TODO: INTERNATIONAL: don't build message text here; 1656{
1657// instead, create multiple translatable messages and choose 1657 S32 option = LLNotification::getSelectedOption(notification, response);
1658// one based on the status. 1658 if (option != 0) return false;
1659//--------------------------------------------------------------------------- 1659
1660std::string all_estates_text() 1660 LLFloater* parent_floater = gFloaterView->getParentFloater(this);
1661{ 1661
1662 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 1662 LLFloaterGroupPicker* widget;
1663 if (!panel) return "(error)"; 1663 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
1664 1664 if (widget)
1665 std::string owner = panel->getOwnerName(); 1665 {
1666 1666 widget->setSelectCallback(addAllowedGroup2, NULL);
1667 LLViewerRegion* region = gAgent.getRegion(); 1667 if (parent_floater)
1668 if (gAgent.isGodlike()) 1668 {
1669 { 1669 LLRect new_rect = gFloaterView->findNeighboringPosition(parent_floater, widget);
1670 return llformat("all estates\nowned by %s", owner.c_str()); 1670 widget->setOrigin(new_rect.mLeft, new_rect.mBottom);
1671 } 1671 parent_floater->addDependentFloater(widget);
1672 else if (region && region->getOwner() == gAgent.getID()) 1672 }
1673 { 1673 }
1674 return "all estates you own"; 1674
1675 } 1675 return false;
1676 else if (region && region->isEstateManager()) 1676}
1677 { 1677
1678 return llformat("all estates that\nyou manage for %s", owner.c_str()); 1678// static
1679 } 1679void LLPanelEstateInfo::onClickRemoveAllowedGroup(void* user_data)
1680 else 1680{
1681 { 1681 accessRemoveCore(ESTATE_ACCESS_ALLOWED_GROUP_REMOVE, "EstateAllowedGroupRemove", "allowed_group_name_list");
1682 return "(error)"; 1682}
1683 } 1683
1684} 1684// static
1685 1685void LLPanelEstateInfo::onClickAddBannedAgent(void* user_data)
1686// static 1686{
1687bool LLPanelEstateInfo::isLindenEstate() 1687 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data;
1688{ 1688 LLCtrlListInterface *list = self->childGetListInterface("banned_avatar_name_list");
1689 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 1689 if (!list) return;
1690 if (!panel) return false; 1690 if (list->getItemCount() >= ESTATE_MAX_ACCESS_IDS)
1691 1691 {
1692 U32 estate_id = panel->getEstateID(); 1692 LLSD args;
1693 return (estate_id <= ESTATE_LAST_LINDEN); 1693 args["MAX_BANNED"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1694} 1694 LLNotifications::instance().add("MaxBannedAgentsOnRegion", args);
1695 1695 return;
1696typedef std::vector<LLUUID> AgentOrGroupIDsVector; 1696 }
1697struct LLEstateAccessChangeInfo 1697 accessAddCore(ESTATE_ACCESS_BANNED_AGENT_ADD, "EstateBannedAgentAdd");
1698{ 1698}
1699 LLEstateAccessChangeInfo(const LLSD& sd) 1699
1700 { 1700// static
1701 mDialogName = sd["dialog_name"].asString(); 1701void LLPanelEstateInfo::onClickRemoveBannedAgent(void* user_data)
1702 mOperationFlag = (U32)sd["operation"].asInteger(); 1702{
1703 LLSD::array_const_iterator end_it = sd["allowed_ids"].endArray(); 1703 accessRemoveCore(ESTATE_ACCESS_BANNED_AGENT_REMOVE, "EstateBannedAgentRemove", "banned_avatar_name_list");
1704 for (LLSD::array_const_iterator id_it = sd["allowed_ids"].beginArray(); 1704}
1705 id_it != end_it; 1705
1706 ++id_it) 1706// static
1707 { 1707void LLPanelEstateInfo::onClickAddEstateManager(void* user_data)
1708 mAgentOrGroupIDs.push_back(id_it->asUUID()); 1708{
1709 } 1709 LLPanelEstateInfo* self = (LLPanelEstateInfo*)user_data;
1710 } 1710 LLCtrlListInterface *list = self->childGetListInterface("estate_manager_name_list");
1711 1711 if (!list) return;
1712 const LLSD asLLSD() const 1712 if (list->getItemCount() >= ESTATE_MAX_MANAGERS)
1713 { 1713 { // Tell user they can't add more managers
1714 LLSD sd; 1714 LLSD args;
1715 sd["name"] = mDialogName; 1715 args["MAX_MANAGER"] = llformat("%d",ESTATE_MAX_MANAGERS);
1716 sd["operation"] = (S32)mOperationFlag; 1716 LLNotifications::instance().add("MaxManagersOnRegion", args);
1717 for (AgentOrGroupIDsVector::const_iterator it = mAgentOrGroupIDs.begin(); 1717 }
1718 it != mAgentOrGroupIDs.end(); 1718 else
1719 ++it) 1719 { // Go pick managers to add
1720 { 1720 accessAddCore(ESTATE_ACCESS_MANAGER_ADD, "EstateManagerAdd");
1721 sd["allowed_ids"].append(*it); 1721 }
1722 } 1722}
1723 return sd; 1723
1724 } 1724// static
1725 1725void LLPanelEstateInfo::onClickRemoveEstateManager(void* user_data)
1726 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc. 1726{
1727 std::string mDialogName; 1727 accessRemoveCore(ESTATE_ACCESS_MANAGER_REMOVE, "EstateManagerRemove", "estate_manager_name_list");
1728 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change 1728}
1729}; 1729
1730 1730//---------------------------------------------------------------------------
1731// Special case callback for groups, since it has different callback format than names 1731// Kick from estate methods
1732// static 1732//---------------------------------------------------------------------------
1733void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data) 1733struct LLKickFromEstateInfo
1734{ 1734{
1735 LLSD payload; 1735 LLPanelEstateInfo *mEstatePanelp;
1736 payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD; 1736 LLUUID mAgentID;
1737 payload["dialog_name"] = "EstateAllowedGroupAdd"; 1737};
1738 payload["allowed_ids"].append(id); 1738
1739 1739void LLPanelEstateInfo::onClickKickUser(void *user_data)
1740 LLSD args; 1740{
1741 args["ALL_ESTATES"] = all_estates_text(); 1741 LLPanelEstateInfo* panelp = (LLPanelEstateInfo*)user_data;
1742 1742
1743 LLNotification::Params params("EstateAllowedGroupAdd"); 1743 // this depends on the grandparent view being a floater
1744 params.payload(payload) 1744 // in order to set up floater dependency
1745 .substitutions(args) 1745 LLFloater* parent_floater = gFloaterView->getParentFloater(panelp);
1746 .functor(accessCoreConfirm); 1746 LLFloater* child_floater = LLFloaterAvatarPicker::show(LLPanelEstateInfo::onKickUserCommit, user_data, FALSE, TRUE);
1747 if (isLindenEstate()) 1747 parent_floater->addDependentFloater(child_floater);
1748 { 1748}
1749 LLNotifications::instance().forceResponse(params, 0); 1749
1750 } 1750void LLPanelEstateInfo::onKickUserCommit(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* userdata)
1751 else 1751{
1752 { 1752 if (names.empty() || ids.empty()) return;
1753 LLNotifications::instance().add(params); 1753
1754 } 1754 //check to make sure there is one valid user and id
1755} 1755 if( (ids[0].isNull()) ||
1756 1756 (names[0].length() == 0) )
1757// static 1757 {
1758void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name) 1758 return;
1759{ 1759 }
1760 LLSD payload; 1760
1761 payload["operation"] = (S32)operation_flag; 1761 LLPanelEstateInfo* self = (LLPanelEstateInfo*)userdata;
1762 payload["dialog_name"] = dialog_name; 1762 if(!self) return;
1763 // agent id filled in after avatar picker 1763
1764 1764 //keep track of what user they want to kick and other misc info
1765 LLNotification::Params params("ChangeLindenAccess"); 1765 LLKickFromEstateInfo *kick_info = new LLKickFromEstateInfo();
1766 params.payload(payload) 1766 kick_info->mEstatePanelp = self;
1767 .functor(accessAddCore2); 1767 kick_info->mAgentID = ids[0];
1768 1768
1769 if (isLindenEstate()) 1769 //Bring up a confirmation dialog
1770 { 1770 LLSD args;
1771 LLNotifications::instance().add(params); 1771 args["EVIL_USER"] = names[0];
1772 } 1772 LLSD payload;
1773 else 1773 payload["agent_id"] = ids[0];
1774 { 1774 LLNotifications::instance().add("EstateKickUser", args, payload, boost::bind(&LLPanelEstateInfo::kickUserConfirm, self, _1, _2));
1775 // same as clicking "OK" 1775
1776 LLNotifications::instance().forceResponse(params, 0); 1776}
1777 } 1777
1778} 1778bool LLPanelEstateInfo::kickUserConfirm(const LLSD& notification, const LLSD& response)
1779 1779{
1780// static 1780 S32 option = LLNotification::getSelectedOption(notification, response);
1781bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& response) 1781 switch(option)
1782{ 1782 {
1783 S32 option = LLNotification::getSelectedOption(notification, response); 1783 case 0:
1784 if (option != 0) 1784 {
1785 { 1785 //Kick User
1786 // abort change 1786 strings_t strings;
1787 return false; 1787 strings.push_back(notification["payload"]["agent_id"].asString());
1788 } 1788
1789 1789 sendEstateOwnerMessage(gMessageSystem, "kickestate", LLFloaterRegionInfo::getLastInvoice(), strings);
1790 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]); 1790 break;
1791 // avatar picker yes multi-select, yes close-on-select 1791 }
1792 LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE); 1792 default:
1793 return false; 1793 break;
1794} 1794 }
1795 1795 return false;
1796// static 1796}
1797void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data) 1797
1798{ 1798//---------------------------------------------------------------------------
1799 LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data; 1799// Core Add/Remove estate access methods
1800 if (!change_info) return; 1800// TODO: INTERNATIONAL: don't build message text here;
1801 if (ids.empty()) 1801// instead, create multiple translatable messages and choose
1802 { 1802// one based on the status.
1803 // User didn't select a name. 1803//---------------------------------------------------------------------------
1804 delete change_info; 1804std::string all_estates_text()
1805 change_info = NULL; 1805{
1806 return; 1806 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1807 } 1807 if (!panel) return "(error)";
1808 // User did select a name. 1808
1809 change_info->mAgentOrGroupIDs = ids; 1809 std::string owner = panel->getOwnerName();
1810 // Can't put estate owner on ban list 1810
1811 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 1811 LLViewerRegion* region = gAgent.getRegion();
1812 if (!panel) return; 1812 if (gAgent.isGodlike())
1813 LLViewerRegion* region = gAgent.getRegion(); 1813 {
1814 if (!region) return; 1814 return llformat("all estates\nowned by %s", owner.c_str());
1815 1815 }
1816 if (change_info->mOperationFlag & ESTATE_ACCESS_ALLOWED_AGENT_ADD) 1816 else if (region && region->getOwner() == gAgent.getID())
1817 { 1817 {
1818 LLCtrlListInterface *list = panel->childGetListInterface("allowed_avatar_name_list"); 1818 return "all estates you own";
1819 int currentCount = (list ? list->getItemCount() : 0); 1819 }
1820 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1820 else if (region && region->isEstateManager())
1821 { 1821 {
1822 LLSD args; 1822 return llformat("all estates that\nyou manage for %s", owner.c_str());
1823 args["NUM_ADDED"] = llformat("%d",ids.size()); 1823 }
1824 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1824 else
1825 args["LIST_TYPE"] = "Allowed Residents"; 1825 {
1826 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); 1826 return "(error)";
1827 LLNotifications::instance().add("MaxAgentOnRegionBatch", args); 1827 }
1828 delete change_info; 1828}
1829 return; 1829
1830 } 1830// static
1831 } 1831bool LLPanelEstateInfo::isLindenEstate()
1832 if (change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD) 1832{
1833 { 1833 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1834 LLCtrlListInterface *list = panel->childGetListInterface("banned_avatar_name_list"); 1834 if (!panel) return false;
1835 int currentCount = (list ? list->getItemCount() : 0); 1835
1836 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS) 1836 U32 estate_id = panel->getEstateID();
1837 { 1837 return (estate_id <= ESTATE_LAST_LINDEN);
1838 LLSD args; 1838}
1839 args["NUM_ADDED"] = llformat("%d",ids.size()); 1839
1840 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS); 1840typedef std::vector<LLUUID> AgentOrGroupIDsVector;
1841 args["LIST_TYPE"] = "Banned Residents"; 1841struct LLEstateAccessChangeInfo
1842 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS); 1842{
1843 LLNotifications::instance().add("MaxAgentOnRegionBatch", args); 1843 LLEstateAccessChangeInfo(const LLSD& sd)
1844 delete change_info; 1844 {
1845 return; 1845 mDialogName = sd["dialog_name"].asString();
1846 } 1846 mOperationFlag = (U32)sd["operation"].asInteger();
1847 } 1847 LLSD::array_const_iterator end_it = sd["allowed_ids"].endArray();
1848 1848 for (LLSD::array_const_iterator id_it = sd["allowed_ids"].beginArray();
1849 LLSD args; 1849 id_it != end_it;
1850 args["ALL_ESTATES"] = all_estates_text(); 1850 ++id_it)
1851 1851 {
1852 LLNotification::Params params(change_info->mDialogName); 1852 mAgentOrGroupIDs.push_back(id_it->asUUID());
1853 params.substitutions(args) 1853 }
1854 .payload(change_info->asLLSD()) 1854 }
1855 .functor(accessCoreConfirm); 1855
1856 1856 const LLSD asLLSD() const
1857 if (isLindenEstate()) 1857 {
1858 { 1858 LLSD sd;
1859 // just apply to this estate 1859 sd["name"] = mDialogName;
1860 LLNotifications::instance().forceResponse(params, 0); 1860 sd["operation"] = (S32)mOperationFlag;
1861 } 1861 for (AgentOrGroupIDsVector::const_iterator it = mAgentOrGroupIDs.begin();
1862 else 1862 it != mAgentOrGroupIDs.end();
1863 { 1863 ++it)
1864 // ask if this estate or all estates with this owner 1864 {
1865 LLNotifications::instance().add(params); 1865 sd["allowed_ids"].append(*it);
1866 } 1866 }
1867} 1867 return sd;
1868 1868 }
1869// static 1869
1870void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name) 1870 U32 mOperationFlag; // ESTATE_ACCESS_BANNED_AGENT_ADD, _REMOVE, etc.
1871{ 1871 std::string mDialogName;
1872 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 1872 AgentOrGroupIDsVector mAgentOrGroupIDs; // List of agent IDs to apply to this change
1873 if (!panel) return; 1873};
1874 LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>(list_ctrl_name); 1874
1875 if (!name_list) return; 1875// Special case callback for groups, since it has different callback format than names
1876 1876// static
1877 std::vector<LLScrollListItem*> list_vector = name_list->getAllSelected(); 1877void LLPanelEstateInfo::addAllowedGroup2(LLUUID id, void* user_data)
1878 if (list_vector.size() == 0) 1878{
1879 return; 1879 LLSD payload;
1880 1880 payload["operation"] = (S32)ESTATE_ACCESS_ALLOWED_GROUP_ADD;
1881 LLSD payload; 1881 payload["dialog_name"] = "EstateAllowedGroupAdd";
1882 payload["operation"] = (S32)operation_flag; 1882 payload["allowed_ids"].append(id);
1883 payload["dialog_name"] = dialog_name; 1883
1884 1884 LLSD args;
1885 for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin(); 1885 args["ALL_ESTATES"] = all_estates_text();
1886 iter != list_vector.end(); 1886
1887 iter++) 1887 LLNotification::Params params("EstateAllowedGroupAdd");
1888 { 1888 params.payload(payload)
1889 LLScrollListItem *item = (*iter); 1889 .substitutions(args)
1890 payload["allowed_ids"].append(item->getUUID()); 1890 .functor(accessCoreConfirm);
1891 } 1891 if (isLindenEstate())
1892 1892 {
1893 LLNotification::Params params("ChangeLindenAccess"); 1893 LLNotifications::instance().forceResponse(params, 0);
1894 params.payload(payload) 1894 }
1895 .functor(accessRemoveCore2); 1895 else
1896 1896 {
1897 if (isLindenEstate()) 1897 LLNotifications::instance().add(params);
1898 { 1898 }
1899 // warn on change linden estate 1899}
1900 LLNotifications::instance().add(params); 1900
1901 } 1901// static
1902 else 1902void LLPanelEstateInfo::accessAddCore(U32 operation_flag, const std::string& dialog_name)
1903 { 1903{
1904 // just proceed, as if clicking OK 1904 LLSD payload;
1905 LLNotifications::instance().forceResponse(params, 0); 1905 payload["operation"] = (S32)operation_flag;
1906 } 1906 payload["dialog_name"] = dialog_name;
1907} 1907 // agent id filled in after avatar picker
1908 1908
1909// static 1909 LLNotification::Params params("ChangeLindenAccess");
1910bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& response) 1910 params.payload(payload)
1911{ 1911 .functor(accessAddCore2);
1912 S32 option = LLNotification::getSelectedOption(notification, response); 1912
1913 if (option != 0) 1913 if (isLindenEstate())
1914 { 1914 {
1915 // abort 1915 LLNotifications::instance().add(params);
1916 return false; 1916 }
1917 } 1917 else
1918 1918 {
1919 // If Linden estate, can only apply to "this" estate, not all estates 1919 // same as clicking "OK"
1920 // owned by NULL. 1920 LLNotifications::instance().forceResponse(params, 0);
1921 if (isLindenEstate()) 1921 }
1922 { 1922}
1923 accessCoreConfirm(notification, response); 1923
1924 } 1924// static
1925 else 1925bool LLPanelEstateInfo::accessAddCore2(const LLSD& notification, const LLSD& response)
1926 { 1926{
1927 LLSD args; 1927 S32 option = LLNotification::getSelectedOption(notification, response);
1928 args["ALL_ESTATES"] = all_estates_text(); 1928 if (option != 0)
1929 LLNotifications::instance().add(notification["payload"]["dialog_name"], 1929 {
1930 args, 1930 // abort change
1931 notification["payload"], 1931 return false;
1932 accessCoreConfirm); 1932 }
1933 } 1933
1934 return false; 1934 LLEstateAccessChangeInfo* change_info = new LLEstateAccessChangeInfo(notification["payload"]);
1935} 1935 // avatar picker yes multi-select, yes close-on-select
1936 1936 LLFloaterAvatarPicker::show(accessAddCore3, (void*)change_info, TRUE, TRUE);
1937// Used for both access add and remove operations, depending on the mOperationFlag 1937 return false;
1938// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.) 1938}
1939// static 1939
1940bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& response) 1940// static
1941{ 1941void LLPanelEstateInfo::accessAddCore3(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* data)
1942 S32 option = LLNotification::getSelectedOption(notification, response); 1942{
1943 const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger(); 1943 LLEstateAccessChangeInfo* change_info = (LLEstateAccessChangeInfo*)data;
1944 1944 if (!change_info) return;
1945 LLViewerRegion* region = gAgent.getRegion(); 1945 if (ids.empty())
1946 1946 {
1947 LLSD::array_const_iterator end_it = notification["payload"]["allowed_ids"].endArray(); 1947 // User didn't select a name.
1948 1948 delete change_info;
1949 for (LLSD::array_const_iterator iter = notification["payload"]["allowed_ids"].beginArray(); 1949 change_info = NULL;
1950 iter != end_it; 1950 return;
1951 iter++) 1951 }
1952 { 1952 // User did select a name.
1953 U32 flags = originalFlags; 1953 change_info->mAgentOrGroupIDs = ids;
1954 if (iter + 1 != end_it) 1954 // Can't put estate owner on ban list
1955 flags |= ESTATE_ACCESS_NO_REPLY; 1955 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
1956 1956 if (!panel) return;
1957 const LLUUID id = iter->asUUID(); 1957 LLViewerRegion* region = gAgent.getRegion();
1958 if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD) 1958 if (!region) return;
1959 && region && (region->getOwner() == id)) 1959
1960 { 1960 if (change_info->mOperationFlag & ESTATE_ACCESS_ALLOWED_AGENT_ADD)
1961 LLNotifications::instance().add("OwnerCanNotBeDenied"); 1961 {
1962 break; 1962 LLCtrlListInterface *list = panel->childGetListInterface("allowed_avatar_name_list");
1963 } 1963 int currentCount = (list ? list->getItemCount() : 0);
1964 switch(option) 1964 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1965 { 1965 {
1966 case 0: 1966 LLSD args;
1967 // This estate 1967 args["NUM_ADDED"] = llformat("%d",ids.size());
1968 sendEstateAccessDelta(flags, id); 1968 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1969 break; 1969 args["LIST_TYPE"] = "Allowed Residents";
1970 case 1: 1970 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
1971 { 1971 LLNotifications::instance().add("MaxAgentOnRegionBatch", args);
1972 // All estates, either than I own or manage for this owner. 1972 delete change_info;
1973 // This will be verified on simulator. JC 1973 return;
1974 if (!region) break; 1974 }
1975 if (region->getOwner() == gAgent.getID() 1975 }
1976 || gAgent.isGodlike()) 1976 if (change_info->mOperationFlag & ESTATE_ACCESS_BANNED_AGENT_ADD)
1977 { 1977 {
1978 flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES; 1978 LLCtrlListInterface *list = panel->childGetListInterface("banned_avatar_name_list");
1979 sendEstateAccessDelta(flags, id); 1979 int currentCount = (list ? list->getItemCount() : 0);
1980 } 1980 if (ids.size() + currentCount > ESTATE_MAX_ACCESS_IDS)
1981 else if (region->isEstateManager()) 1981 {
1982 { 1982 LLSD args;
1983 flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES; 1983 args["NUM_ADDED"] = llformat("%d",ids.size());
1984 sendEstateAccessDelta(flags, id); 1984 args["MAX_AGENTS"] = llformat("%d",ESTATE_MAX_ACCESS_IDS);
1985 } 1985 args["LIST_TYPE"] = "Banned Residents";
1986 break; 1986 args["NUM_EXCESS"] = llformat("%d",(ids.size()+currentCount)-ESTATE_MAX_ACCESS_IDS);
1987 } 1987 LLNotifications::instance().add("MaxAgentOnRegionBatch", args);
1988 case 2: 1988 delete change_info;
1989 default: 1989 return;
1990 break; 1990 }
1991 } 1991 }
1992 } 1992
1993 return false; 1993 LLSD args;
1994} 1994 args["ALL_ESTATES"] = all_estates_text();
1995 1995
1996// key = "estateaccessdelta" 1996 LLNotification::Params params(change_info->mDialogName);
1997// str(estate_id) will be added to front of list by forward_EstateOwnerRequest_to_dataserver 1997 params.substitutions(args)
1998// str[0] = str(agent_id) requesting the change 1998 .payload(change_info->asLLSD())
1999// str[1] = str(flags) (ESTATE_ACCESS_DELTA_*) 1999 .functor(accessCoreConfirm);
2000// str[2] = str(agent_id) to add or remove 2000
2001// static 2001 if (isLindenEstate())
2002void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_group_id) 2002 {
2003{ 2003 // just apply to this estate
2004 LLMessageSystem* msg = gMessageSystem; 2004 LLNotifications::instance().forceResponse(params, 0);
2005 msg->newMessage("EstateOwnerMessage"); 2005 }
2006 msg->nextBlockFast(_PREHASH_AgentData); 2006 else
2007 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2007 {
2008 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 2008 // ask if this estate or all estates with this owner
2009 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used 2009 LLNotifications::instance().add(params);
2010 2010 }
2011 msg->nextBlock("MethodData"); 2011}
2012 msg->addString("Method", "estateaccessdelta"); 2012
2013 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 2013// static
2014 2014void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const std::string& dialog_name, const std::string& list_ctrl_name)
2015 std::string buf; 2015{
2016 gAgent.getID().toString(buf); 2016 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
2017 msg->nextBlock("ParamList"); 2017 if (!panel) return;
2018 msg->addString("Parameter", buf); 2018 LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>(list_ctrl_name);
2019 2019 if (!name_list) return;
2020 buf = llformat("%u", flags); 2020
2021 msg->nextBlock("ParamList"); 2021 std::vector<LLScrollListItem*> list_vector = name_list->getAllSelected();
2022 msg->addString("Parameter", buf); 2022 if (list_vector.size() == 0)
2023 2023 return;
2024 agent_or_group_id.toString(buf); 2024
2025 msg->nextBlock("ParamList"); 2025 LLSD payload;
2026 msg->addString("Parameter", buf); 2026 payload["operation"] = (S32)operation_flag;
2027 2027 payload["dialog_name"] = dialog_name;
2028 2028
2029 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 2029 for (std::vector<LLScrollListItem*>::const_iterator iter = list_vector.begin();
2030 2030 iter != list_vector.end();
2031 if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE | 2031 iter++)
2032 ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_BANNED_AGENT_REMOVE)) 2032 {
2033 { 2033 LLScrollListItem *item = (*iter);
2034 2034 payload["allowed_ids"].append(item->getUUID());
2035 panel->clearAccessLists(); 2035 }
2036 } 2036
2037 2037 LLNotification::Params params("ChangeLindenAccess");
2038 gAgent.sendReliableMessage(); 2038 params.payload(payload)
2039} 2039 .functor(accessRemoveCore2);
2040 2040
2041void LLPanelEstateInfo::updateControls(LLViewerRegion* region) 2041 if (isLindenEstate())
2042{ 2042 {
2043 BOOL god = gAgent.isGodlike(); 2043 // warn on change linden estate
2044 BOOL owner = (region && (region->getOwner() == gAgent.getID())); 2044 LLNotifications::instance().add(params);
2045 BOOL manager = (region && region->isEstateManager()); 2045 }
2046 setCtrlsEnabled(god || owner || manager); 2046 else
2047 2047 {
2048 childDisable("apply_btn"); 2048 // just proceed, as if clicking OK
2049 childSetEnabled("add_allowed_avatar_btn", god || owner || manager); 2049 LLNotifications::instance().forceResponse(params, 0);
2050 childSetEnabled("remove_allowed_avatar_btn", god || owner || manager); 2050 }
2051 childSetEnabled("add_allowed_group_btn", god || owner || manager); 2051}
2052 childSetEnabled("remove_allowed_group_btn", god || owner || manager); 2052
2053 childSetEnabled("add_banned_avatar_btn", god || owner || manager); 2053// static
2054 childSetEnabled("remove_banned_avatar_btn", god || owner || manager); 2054bool LLPanelEstateInfo::accessRemoveCore2(const LLSD& notification, const LLSD& response)
2055 childSetEnabled("message_estate_btn", god || owner || manager); 2055{
2056 childSetEnabled("kick_user_from_estate_btn", god || owner || manager); 2056 S32 option = LLNotification::getSelectedOption(notification, response);
2057#if ELAR_ENABLED 2057 if (option != 0)
2058 childSetEnabled("abuse_email_address", god || owner || manager); 2058 {
2059#else 2059 // abort
2060 childSetEnabled("abuse_email_address", false); 2060 return false;
2061#endif 2061 }
2062 2062
2063 // estate managers can't add estate managers 2063 // If Linden estate, can only apply to "this" estate, not all estates
2064 childSetEnabled("add_estate_manager_btn", god || owner); 2064 // owned by NULL.
2065 childSetEnabled("remove_estate_manager_btn", god || owner); 2065 if (isLindenEstate())
2066 childSetEnabled("estate_manager_name_list", god || owner); 2066 {
2067} 2067 accessCoreConfirm(notification, response);
2068 2068 }
2069bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region) 2069 else
2070{ 2070 {
2071 updateControls(region); 2071 LLSD args;
2072 2072 args["ALL_ESTATES"] = all_estates_text();
2073 // let the parent class handle the general data collection. 2073 LLNotifications::instance().add(notification["payload"]["dialog_name"],
2074 bool rv = LLPanelRegionInfo::refreshFromRegion(region); 2074 args,
2075 2075 notification["payload"],
2076 // We want estate info. To make sure it works across region 2076 accessCoreConfirm);
2077 // boundaries and multiple packets, we add a serial number to the 2077 }
2078 // integers and track against that on update. 2078 return false;
2079 strings_t strings; 2079}
2080 //integers_t integers; 2080
2081 //LLFloaterRegionInfo::incrementSerial(); 2081// Used for both access add and remove operations, depending on the mOperationFlag
2082 LLFloaterRegionInfo::nextInvoice(); 2082// passed in (ESTATE_ACCESS_BANNED_AGENT_ADD, ESTATE_ACCESS_ALLOWED_AGENT_REMOVE, etc.)
2083 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 2083// static
2084 //integers.push_back(LLFloaterRegionInfo::());::getPanelEstate(); 2084bool LLPanelEstateInfo::accessCoreConfirm(const LLSD& notification, const LLSD& response)
2085 2085{
2086 2086 S32 option = LLNotification::getSelectedOption(notification, response);
2087 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 2087 const U32 originalFlags = (U32)notification["payload"]["operation"].asInteger();
2088 panel->clearAccessLists(); 2088
2089 2089 LLViewerRegion* region = gAgent.getRegion();
2090 2090
2091 sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings); 2091 LLSD::array_const_iterator end_it = notification["payload"]["allowed_ids"].endArray();
2092 2092
2093 refresh(); 2093 for (LLSD::array_const_iterator iter = notification["payload"]["allowed_ids"].beginArray();
2094 2094 iter != end_it;
2095 return rv; 2095 iter++)
2096} 2096 {
2097 2097 U32 flags = originalFlags;
2098void LLPanelEstateInfo::updateChild(LLUICtrl* child_ctrl) 2098 if (iter + 1 != end_it)
2099{ 2099 flags |= ESTATE_ACCESS_NO_REPLY;
2100 if (checkRemovalButton(child_ctrl->getName())) 2100
2101 { 2101 const LLUUID id = iter->asUUID();
2102 // do nothing 2102 if (((U32)notification["payload"]["operation"].asInteger() & ESTATE_ACCESS_BANNED_AGENT_ADD)
2103 } 2103 && region && (region->getOwner() == id))
2104 else if (checkSunHourSlider(child_ctrl)) 2104 {
2105 { 2105 LLNotifications::instance().add("OwnerCanNotBeDenied");
2106 // do nothing 2106 break;
2107 } 2107 }
2108} 2108 switch(option)
2109 2109 {
2110bool LLPanelEstateInfo::estateUpdate(LLMessageSystem* msg) 2110 case 0:
2111{ 2111 // This estate
2112 llinfos << "LLPanelEstateInfo::estateUpdate()" << llendl; 2112 sendEstateAccessDelta(flags, id);
2113 return false; 2113 break;
2114} 2114 case 1:
2115 2115 {
2116 2116 // All estates, either than I own or manage for this owner.
2117BOOL LLPanelEstateInfo::postBuild() 2117 // This will be verified on simulator. JC
2118{ 2118 if (!region) break;
2119 // set up the callbacks for the generic controls 2119 if (region->getOwner() == gAgent.getID()
2120 initCtrl("externally_visible_check"); 2120 || gAgent.isGodlike())
2121 initCtrl("use_global_time_check"); 2121 {
2122 initCtrl("fixed_sun_check"); 2122 flags |= ESTATE_ACCESS_APPLY_TO_ALL_ESTATES;
2123 initCtrl("allow_direct_teleport"); 2123 sendEstateAccessDelta(flags, id);
2124 initCtrl("limit_payment"); 2124 }
2125 initCtrl("limit_age_verified"); 2125 else if (region->isEstateManager())
2126 initCtrl("voice_chat_check"); 2126 {
2127 childSetCommitCallback("abuse_email_address", onChangeAnything, this); 2127 flags |= ESTATE_ACCESS_APPLY_TO_MANAGED_ESTATES;
2128 childSetKeystrokeCallback("abuse_email_address", onChangeText, this); 2128 sendEstateAccessDelta(flags, id);
2129 2129 }
2130 initHelpBtn("estate_manager_help", "HelpEstateEstateManager"); 2130 break;
2131 initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime"); 2131 }
2132 initHelpBtn("fixed_sun_help", "HelpEstateFixedSun"); 2132 case 2:
2133 initHelpBtn("WLEditSkyHelp", "HelpEditSky"); 2133 default:
2134 initHelpBtn("WLEditDayCycleHelp", "HelpEditDayCycle"); 2134 break;
2135 2135 }
2136 initHelpBtn("externally_visible_help", "HelpEstateExternallyVisible"); 2136 }
2137 initHelpBtn("allow_direct_teleport_help", "HelpEstateAllowDirectTeleport"); 2137 return false;
2138 initHelpBtn("allow_resident_help", "HelpEstateAllowResident"); 2138}
2139 initHelpBtn("allow_group_help", "HelpEstateAllowGroup"); 2139
2140 initHelpBtn("ban_resident_help", "HelpEstateBanResident"); 2140// key = "estateaccessdelta"
2141 initHelpBtn("abuse_email_address_help", "HelpEstateAbuseEmailAddress"); 2141// str(estate_id) will be added to front of list by forward_EstateOwnerRequest_to_dataserver
2142 initHelpBtn("voice_chat_help", "HelpEstateVoiceChat"); 2142// str[0] = str(agent_id) requesting the change
2143 2143// str[1] = str(flags) (ESTATE_ACCESS_DELTA_*)
2144 // set up the use global time checkbox 2144// str[2] = str(agent_id) to add or remove
2145 childSetCommitCallback("use_global_time_check", onChangeUseGlobalTime, this); 2145// static
2146 childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this); 2146void LLPanelEstateInfo::sendEstateAccessDelta(U32 flags, const LLUUID& agent_or_group_id)
2147 childSetCommitCallback("sun_hour_slider", onChangeChildCtrl, this); 2147{
2148 2148 LLMessageSystem* msg = gMessageSystem;
2149 childSetCommitCallback("allowed_avatar_name_list", onChangeChildCtrl, this); 2149 msg->newMessage("EstateOwnerMessage");
2150 LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); 2150 msg->nextBlockFast(_PREHASH_AgentData);
2151 if (avatar_name_list) 2151 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
2152 { 2152 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
2153 avatar_name_list->setCommitOnSelectionChange(TRUE); 2153 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
2154 avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); 2154
2155 } 2155 msg->nextBlock("MethodData");
2156 2156 msg->addString("Method", "estateaccessdelta");
2157 childSetAction("add_allowed_avatar_btn", onClickAddAllowedAgent, this); 2157 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
2158 childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this); 2158
2159 2159 std::string buf;
2160 childSetCommitCallback("allowed_group_name_list", onChangeChildCtrl, this); 2160 gAgent.getID().toString(buf);
2161 LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); 2161 msg->nextBlock("ParamList");
2162 if (group_name_list) 2162 msg->addString("Parameter", buf);
2163 { 2163
2164 group_name_list->setCommitOnSelectionChange(TRUE); 2164 buf = llformat("%u", flags);
2165 group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); 2165 msg->nextBlock("ParamList");
2166 } 2166 msg->addString("Parameter", buf);
2167 2167
2168 childSetAction("add_allowed_group_btn", onClickAddAllowedGroup, this); 2168 agent_or_group_id.toString(buf);
2169 childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); 2169 msg->nextBlock("ParamList");
2170 2170 msg->addString("Parameter", buf);
2171 childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this); 2171
2172 LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); 2172
2173 if (banned_name_list) 2173 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
2174 { 2174
2175 banned_name_list->setCommitOnSelectionChange(TRUE); 2175 if (flags & (ESTATE_ACCESS_ALLOWED_AGENT_ADD | ESTATE_ACCESS_ALLOWED_AGENT_REMOVE |
2176 banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS); 2176 ESTATE_ACCESS_BANNED_AGENT_ADD | ESTATE_ACCESS_BANNED_AGENT_REMOVE))
2177 } 2177 {
2178 2178
2179 childSetAction("add_banned_avatar_btn", onClickAddBannedAgent, this); 2179 panel->clearAccessLists();
2180 childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this); 2180 }
2181 2181
2182 childSetCommitCallback("estate_manager_name_list", onChangeChildCtrl, this); 2182 gAgent.sendReliableMessage();
2183 LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); 2183}
2184 if (manager_name_list) 2184
2185 { 2185void LLPanelEstateInfo::updateControls(LLViewerRegion* region)
2186 manager_name_list->setCommitOnSelectionChange(TRUE); 2186{
2187 manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue 2187 BOOL god = gAgent.isGodlike();
2188 } 2188 BOOL owner = (region && (region->getOwner() == gAgent.getID()));
2189 2189 BOOL manager = (region && region->isEstateManager());
2190 childSetAction("add_estate_manager_btn", onClickAddEstateManager, this); 2190 setCtrlsEnabled(god || owner || manager);
2191 childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this); 2191
2192 childSetAction("message_estate_btn", onClickMessageEstate, this); 2192 childDisable("apply_btn");
2193 childSetAction("kick_user_from_estate_btn", onClickKickUser, this); 2193 childSetEnabled("add_allowed_avatar_btn", god || owner || manager);
2194 2194 childSetEnabled("remove_allowed_avatar_btn", god || owner || manager);
2195 childSetAction("WLEditSky", onClickEditSky, this); 2195 childSetEnabled("add_allowed_group_btn", god || owner || manager);
2196 childSetAction("WLEditDayCycle", onClickEditDayCycle, this); 2196 childSetEnabled("remove_allowed_group_btn", god || owner || manager);
2197 2197 childSetEnabled("add_banned_avatar_btn", god || owner || manager);
2198 return LLPanelRegionInfo::postBuild(); 2198 childSetEnabled("remove_banned_avatar_btn", god || owner || manager);
2199} 2199 childSetEnabled("message_estate_btn", god || owner || manager);
2200 2200 childSetEnabled("kick_user_from_estate_btn", god || owner || manager);
2201void LLPanelEstateInfo::refresh() 2201 childSetEnabled("abuse_email_address", god || owner || manager);
2202{ 2202
2203 bool public_access = childGetValue("externally_visible_check").asBoolean(); 2203 // estate managers can't add estate managers
2204 childSetEnabled("Only Allow", public_access); 2204 childSetEnabled("add_estate_manager_btn", god || owner);
2205 childSetEnabled("limit_payment", public_access); 2205 childSetEnabled("remove_estate_manager_btn", god || owner);
2206 childSetEnabled("limit_age_verified", public_access); 2206 childSetEnabled("estate_manager_name_list", god || owner);
2207 // if this is set to false, then the limit fields are meaningless and should be turned off 2207}
2208 if (public_access == false) 2208
2209 { 2209bool LLPanelEstateInfo::refreshFromRegion(LLViewerRegion* region)
2210 childSetValue("limit_payment", false); 2210{
2211 childSetValue("limit_age_verified", false); 2211 updateControls(region);
2212 } 2212
2213} 2213 // let the parent class handle the general data collection.
2214 2214 bool rv = LLPanelRegionInfo::refreshFromRegion(region);
2215BOOL LLPanelEstateInfo::sendUpdate() 2215
2216{ 2216 // We want estate info. To make sure it works across region
2217 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl; 2217 // boundaries and multiple packets, we add a serial number to the
2218 2218 // integers and track against that on update.
2219 LLNotification::Params params("ChangeLindenEstate"); 2219 strings_t strings;
2220 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); 2220 //integers_t integers;
2221 2221 //LLFloaterRegionInfo::incrementSerial();
2222 if (getEstateID() <= ESTATE_LAST_LINDEN) 2222 LLFloaterRegionInfo::nextInvoice();
2223 { 2223 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
2224 // trying to change reserved estate, warn 2224 //integers.push_back(LLFloaterRegionInfo::());::getPanelEstate();
2225 LLNotifications::instance().add(params); 2225
2226 } 2226
2227 else 2227 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
2228 { 2228 panel->clearAccessLists();
2229 // for normal estates, just make the change 2229
2230 LLNotifications::instance().forceResponse(params, 0); 2230
2231 } 2231 sendEstateOwnerMessage(gMessageSystem, "getinfo", invoice, strings);
2232 return TRUE; 2232
2233} 2233 refresh();
2234 2234
2235bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response) 2235 return rv;
2236{ 2236}
2237 S32 option = LLNotification::getSelectedOption(notification, response); 2237
2238 switch(option) 2238void LLPanelEstateInfo::updateChild(LLUICtrl* child_ctrl)
2239 { 2239{
2240 case 0: 2240 if (checkRemovalButton(child_ctrl->getName()))
2241 // send the update 2241 {
2242 if (!commitEstateInfoCaps()) 2242 // do nothing
2243 { 2243 }
2244 // the caps method failed, try the old way 2244 else if (checkSunHourSlider(child_ctrl))
2245 LLFloaterRegionInfo::nextInvoice(); 2245 {
2246 commitEstateInfoDataserver(); 2246 // do nothing
2247 } 2247 }
2248 // we don't want to do this because we'll get it automatically from the sim 2248}
2249 // after the spaceserver processes it 2249
2250// else 2250bool LLPanelEstateInfo::estateUpdate(LLMessageSystem* msg)
2251// { 2251{
2252// // caps method does not automatically send this info 2252 llinfos << "LLPanelEstateInfo::estateUpdate()" << llendl;
2253// LLFloaterRegionInfo::requestRegionInfo(); 2253 return false;
2254// } 2254}
2255 break; 2255
2256 case 1: 2256
2257 default: 2257BOOL LLPanelEstateInfo::postBuild()
2258 // do nothing 2258{
2259 break; 2259 // set up the callbacks for the generic controls
2260 } 2260 initCtrl("externally_visible_check");
2261 return false; 2261 initCtrl("use_global_time_check");
2262} 2262 initCtrl("fixed_sun_check");
2263 2263 initCtrl("allow_direct_teleport");
2264 2264 initCtrl("limit_payment");
2265/* 2265 initCtrl("limit_age_verified");
2266// Request = "getowner" 2266 initCtrl("voice_chat_check");
2267// SParam[0] = "" (empty string) 2267 childSetCommitCallback("abuse_email_address", onChangeAnything, this);
2268// IParam[0] = serial 2268 childSetKeystrokeCallback("abuse_email_address", onChangeText, this);
2269void LLPanelEstateInfo::getEstateOwner() 2269
2270{ 2270 initHelpBtn("estate_manager_help", "HelpEstateEstateManager");
2271 // TODO -- disable the panel 2271 initHelpBtn("use_global_time_help", "HelpEstateUseGlobalTime");
2272 // and call this function whenever we cross a region boundary 2272 initHelpBtn("fixed_sun_help", "HelpEstateFixedSun");
2273 // re-enable when owner matches, and get new estate info 2273 initHelpBtn("WLEditSkyHelp", "HelpEditSky");
2274 LLMessageSystem* msg = gMessageSystem; 2274 initHelpBtn("WLEditDayCycleHelp", "HelpEditDayCycle");
2275 msg->newMessageFast(_PREHASH_EstateOwnerRequest); 2275
2276 msg->nextBlockFast(_PREHASH_AgentData); 2276 initHelpBtn("externally_visible_help", "HelpEstateExternallyVisible");
2277 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2277 initHelpBtn("allow_direct_teleport_help", "HelpEstateAllowDirectTeleport");
2278 2278 initHelpBtn("allow_resident_help", "HelpEstateAllowResident");
2279 msg->nextBlockFast(_PREHASH_RequestData); 2279 initHelpBtn("allow_group_help", "HelpEstateAllowGroup");
2280 msg->addStringFast(_PREHASH_Request, "getowner"); 2280 initHelpBtn("ban_resident_help", "HelpEstateBanResident");
2281 2281 initHelpBtn("abuse_email_address_help", "HelpEstateAbuseEmailAddress");
2282 // we send an empty string so that the variable block is not empty 2282 initHelpBtn("voice_chat_help", "HelpEstateVoiceChat");
2283 msg->nextBlockFast(_PREHASH_StringData); 2283
2284 msg->addStringFast(_PREHASH_SParam, ""); 2284 // set up the use global time checkbox
2285 2285 childSetCommitCallback("use_global_time_check", onChangeUseGlobalTime, this);
2286 msg->nextBlockFast(_PREHASH_IntegerData); 2286 childSetCommitCallback("fixed_sun_check", onChangeFixedSun, this);
2287 msg->addS32Fast(_PREHASH_IParam, LLFloaterRegionInfo::getSerial()); 2287 childSetCommitCallback("sun_hour_slider", onChangeChildCtrl, this);
2288 2288
2289 gAgent.sendMessage(); 2289 childSetCommitCallback("allowed_avatar_name_list", onChangeChildCtrl, this);
2290} 2290 LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list");
2291*/ 2291 if (avatar_name_list)
2292 2292 {
2293class LLEstateChangeInfoResponder : public LLHTTPClient::Responder 2293 avatar_name_list->setCommitOnSelectionChange(TRUE);
2294{ 2294 avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
2295public: 2295 }
2296 LLEstateChangeInfoResponder(void* userdata) : mpPanel((LLPanelEstateInfo*)userdata) {}; 2296
2297 2297 childSetAction("add_allowed_avatar_btn", onClickAddAllowedAgent, this);
2298 // if we get a normal response, handle it here 2298 childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this);
2299 virtual void result(const LLSD& content) 2299
2300 { 2300 childSetCommitCallback("allowed_group_name_list", onChangeChildCtrl, this);
2301 // refresh the panel from the database 2301 LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list");
2302 mpPanel->refresh(); 2302 if (group_name_list)
2303 } 2303 {
2304 2304 group_name_list->setCommitOnSelectionChange(TRUE);
2305 // if we get an error response 2305 group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
2306 virtual void error(U32 status, const std::string& reason) 2306 }
2307 { 2307
2308 llinfos << "LLEstateChangeInfoResponder::error " 2308 childSetAction("add_allowed_group_btn", onClickAddAllowedGroup, this);
2309 << status << ": " << reason << llendl; 2309 childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this);
2310 } 2310
2311private: 2311 childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this);
2312 LLPanelEstateInfo* mpPanel; 2312 LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list");
2313}; 2313 if (banned_name_list)
2314 2314 {
2315// tries to send estate info using a cap; returns true if it succeeded 2315 banned_name_list->setCommitOnSelectionChange(TRUE);
2316bool LLPanelEstateInfo::commitEstateInfoCaps() 2316 banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
2317{ 2317 }
2318 std::string url = gAgent.getRegion()->getCapability("EstateChangeInfo"); 2318
2319 2319 childSetAction("add_banned_avatar_btn", onClickAddBannedAgent, this);
2320 if (url.empty()) 2320 childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this);
2321 { 2321
2322 // whoops, couldn't find the cap, so bail out 2322 childSetCommitCallback("estate_manager_name_list", onChangeChildCtrl, this);
2323 return false; 2323 LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list");
2324 } 2324 if (manager_name_list)
2325 2325 {
2326 LLSD body; 2326 manager_name_list->setCommitOnSelectionChange(TRUE);
2327 body["estate_name"] = getEstateName(); 2327 manager_name_list->setMaxItemCount(ESTATE_MAX_MANAGERS * 4); // Allow extras for dupe issue
2328 2328 }
2329 body["is_externally_visible"] = childGetValue("externally_visible_check").asBoolean(); 2329
2330 body["allow_direct_teleport"] = childGetValue("allow_direct_teleport").asBoolean(); 2330 childSetAction("add_estate_manager_btn", onClickAddEstateManager, this);
2331 body["is_sun_fixed" ] = childGetValue("fixed_sun_check").asBoolean(); 2331 childSetAction("remove_estate_manager_btn", onClickRemoveEstateManager, this);
2332 body["deny_anonymous" ] = childGetValue("limit_payment").asBoolean(); 2332 childSetAction("message_estate_btn", onClickMessageEstate, this);
2333 body["deny_age_unverified" ] = childGetValue("limit_age_verified").asBoolean(); 2333 childSetAction("kick_user_from_estate_btn", onClickKickUser, this);
2334 body["allow_voice_chat" ] = childGetValue("voice_chat_check").asBoolean(); 2334
2335 body["invoice" ] = LLFloaterRegionInfo::getLastInvoice(); 2335 childSetAction("WLEditSky", onClickEditSky, this);
2336 2336 childSetAction("WLEditDayCycle", onClickEditDayCycle, this);
2337 // block fly is in estate database but not in estate UI, so we're not supporting it 2337
2338 //body["block_fly" ] = childGetValue("").asBoolean(); 2338 return LLPanelRegionInfo::postBuild();
2339 2339}
2340 F32 sun_hour = getSunHour(); 2340
2341 if (childGetValue("use_global_time_check").asBoolean()) 2341void LLPanelEstateInfo::refresh()
2342 { 2342{
2343 sun_hour = 0.f; // 0 = global time 2343 bool public_access = childGetValue("externally_visible_check").asBoolean();
2344 } 2344 childSetEnabled("Only Allow", public_access);
2345 body["sun_hour"] = sun_hour; 2345 childSetEnabled("limit_payment", public_access);
2346 2346 childSetEnabled("limit_age_verified", public_access);
2347 body["owner_abuse_email"] = childGetValue("abuse_email_address").asString(); 2347 // if this is set to false, then the limit fields are meaningless and should be turned off
2348 2348 if (public_access == false)
2349 // we use a responder so that we can re-get the data after committing to the database 2349 {
2350 LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder((void*)this)); 2350 childSetValue("limit_payment", false);
2351 return true; 2351 childSetValue("limit_age_verified", false);
2352} 2352 }
2353 2353}
2354/* This is the old way of doing things, is deprecated, and should be 2354
2355 deleted when the dataserver model can be removed */ 2355BOOL LLPanelEstateInfo::sendUpdate()
2356// key = "estatechangeinfo" 2356{
2357// strings[0] = str(estate_id) (added by simulator before relay - not here) 2357 llinfos << "LLPanelEsateInfo::sendUpdate()" << llendl;
2358// strings[1] = estate_name 2358
2359// strings[2] = str(estate_flags) 2359 LLNotification::Params params("ChangeLindenEstate");
2360// strings[3] = str((S32)(sun_hour * 1024.f)) 2360 params.functor(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2));
2361void LLPanelEstateInfo::commitEstateInfoDataserver() 2361
2362{ 2362 if (getEstateID() <= ESTATE_LAST_LINDEN)
2363 LLMessageSystem* msg = gMessageSystem; 2363 {
2364 msg->newMessage("EstateOwnerMessage"); 2364 // trying to change reserved estate, warn
2365 msg->nextBlockFast(_PREHASH_AgentData); 2365 LLNotifications::instance().add(params);
2366 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2366 }
2367 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 2367 else
2368 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used 2368 {
2369 2369 // for normal estates, just make the change
2370 msg->nextBlock("MethodData"); 2370 LLNotifications::instance().forceResponse(params, 0);
2371 msg->addString("Method", "estatechangeinfo"); 2371 }
2372 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 2372 return TRUE;
2373 2373}
2374 msg->nextBlock("ParamList"); 2374
2375 msg->addString("Parameter", getEstateName()); 2375bool LLPanelEstateInfo::callbackChangeLindenEstate(const LLSD& notification, const LLSD& response)
2376 2376{
2377 std::string buffer; 2377 S32 option = LLNotification::getSelectedOption(notification, response);
2378 buffer = llformat("%u", computeEstateFlags()); 2378 switch(option)
2379 msg->nextBlock("ParamList"); 2379 {
2380 msg->addString("Parameter", buffer); 2380 case 0:
2381 2381 // send the update
2382 F32 sun_hour = getSunHour(); 2382 if (!commitEstateInfoCaps())
2383 if (childGetValue("use_global_time_check").asBoolean()) 2383 {
2384 { 2384 // the caps method failed, try the old way
2385 sun_hour = 0.f; // 0 = global time 2385 LLFloaterRegionInfo::nextInvoice();
2386 } 2386 commitEstateInfoDataserver();
2387 2387 }
2388 buffer = llformat("%d", (S32)(sun_hour*1024.0f)); 2388 // we don't want to do this because we'll get it automatically from the sim
2389 msg->nextBlock("ParamList"); 2389 // after the spaceserver processes it
2390 msg->addString("Parameter", buffer); 2390// else
2391 2391// {
2392 gAgent.sendMessage(); 2392// // caps method does not automatically send this info
2393} 2393// LLFloaterRegionInfo::requestRegionInfo();
2394 2394// }
2395void LLPanelEstateInfo::setEstateFlags(U32 flags) 2395 break;
2396{ 2396 case 1:
2397 childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) ); 2397 default:
2398 childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) ); 2398 // do nothing
2399 childSetValue( 2399 break;
2400 "voice_chat_check", 2400 }
2401 LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE)); 2401 return false;
2402 childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) ); 2402}
2403 childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) ); 2403
2404 childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) ); 2404
2405 2405/*
2406 refresh(); 2406// Request = "getowner"
2407} 2407// SParam[0] = "" (empty string)
2408 2408// IParam[0] = serial
2409U32 LLPanelEstateInfo::computeEstateFlags() 2409void LLPanelEstateInfo::getEstateOwner()
2410{ 2410{
2411 U32 flags = 0; 2411 // TODO -- disable the panel
2412 2412 // and call this function whenever we cross a region boundary
2413 if (childGetValue("externally_visible_check").asBoolean()) 2413 // re-enable when owner matches, and get new estate info
2414 { 2414 LLMessageSystem* msg = gMessageSystem;
2415 flags |= REGION_FLAGS_EXTERNALLY_VISIBLE; 2415 msg->newMessageFast(_PREHASH_EstateOwnerRequest);
2416 } 2416 msg->nextBlockFast(_PREHASH_AgentData);
2417 2417 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
2418 if ( childGetValue("voice_chat_check").asBoolean() ) 2418
2419 { 2419 msg->nextBlockFast(_PREHASH_RequestData);
2420 flags |= REGION_FLAGS_ALLOW_VOICE; 2420 msg->addStringFast(_PREHASH_Request, "getowner");
2421 } 2421
2422 2422 // we send an empty string so that the variable block is not empty
2423 if (childGetValue("allow_direct_teleport").asBoolean()) 2423 msg->nextBlockFast(_PREHASH_StringData);
2424 { 2424 msg->addStringFast(_PREHASH_SParam, "");
2425 flags |= REGION_FLAGS_ALLOW_DIRECT_TELEPORT; 2425
2426 } 2426 msg->nextBlockFast(_PREHASH_IntegerData);
2427 2427 msg->addS32Fast(_PREHASH_IParam, LLFloaterRegionInfo::getSerial());
2428 if (childGetValue("fixed_sun_check").asBoolean()) 2428
2429 { 2429 gAgent.sendMessage();
2430 flags |= REGION_FLAGS_SUN_FIXED; 2430}
2431 } 2431*/
2432 2432
2433 if (childGetValue("limit_payment").asBoolean()) 2433class LLEstateChangeInfoResponder : public LLHTTPClient::Responder
2434 { 2434{
2435 flags |= REGION_FLAGS_DENY_ANONYMOUS; 2435public:
2436 } 2436 LLEstateChangeInfoResponder(void* userdata) : mpPanel((LLPanelEstateInfo*)userdata) {};
2437 2437
2438 if (childGetValue("limit_age_verified").asBoolean()) 2438 // if we get a normal response, handle it here
2439 { 2439 virtual void result(const LLSD& content)
2440 flags |= REGION_FLAGS_DENY_AGEUNVERIFIED; 2440 {
2441 } 2441 // refresh the panel from the database
2442 2442 mpPanel->refresh();
2443 2443 }
2444 return flags; 2444
2445} 2445 // if we get an error response
2446 2446 virtual void error(U32 status, const std::string& reason)
2447BOOL LLPanelEstateInfo::getGlobalTime() 2447 {
2448{ 2448 llinfos << "LLEstateChangeInfoResponder::error "
2449 return childGetValue("use_global_time_check").asBoolean(); 2449 << status << ": " << reason << llendl;
2450} 2450 }
2451 2451private:
2452void LLPanelEstateInfo::setGlobalTime(bool b) 2452 LLPanelEstateInfo* mpPanel;
2453{ 2453};
2454 childSetValue("use_global_time_check", LLSD(b)); 2454
2455 childSetEnabled("fixed_sun_check", LLSD(!b)); 2455// tries to send estate info using a cap; returns true if it succeeded
2456 childSetEnabled("sun_hour_slider", LLSD(!b)); 2456bool LLPanelEstateInfo::commitEstateInfoCaps()
2457 if (b) 2457{
2458 { 2458 std::string url = gAgent.getRegion()->getCapability("EstateChangeInfo");
2459 childSetValue("sun_hour_slider", LLSD(0.f)); 2459
2460 } 2460 if (url.empty())
2461} 2461 {
2462 2462 // whoops, couldn't find the cap, so bail out
2463 2463 return false;
2464BOOL LLPanelEstateInfo::getFixedSun() 2464 }
2465{ 2465
2466 return childGetValue("fixed_sun_check").asBoolean(); 2466 LLSD body;
2467} 2467 body["estate_name"] = getEstateName();
2468 2468
2469void LLPanelEstateInfo::setSunHour(F32 sun_hour) 2469 body["is_externally_visible"] = childGetValue("externally_visible_check").asBoolean();
2470{ 2470 body["allow_direct_teleport"] = childGetValue("allow_direct_teleport").asBoolean();
2471 if(sun_hour < 6.0f) 2471 body["is_sun_fixed" ] = childGetValue("fixed_sun_check").asBoolean();
2472 { 2472 body["deny_anonymous" ] = childGetValue("limit_payment").asBoolean();
2473 sun_hour = 24.0f + sun_hour; 2473 body["deny_age_unverified" ] = childGetValue("limit_age_verified").asBoolean();
2474 } 2474 body["allow_voice_chat" ] = childGetValue("voice_chat_check").asBoolean();
2475 childSetValue("sun_hour_slider", LLSD(sun_hour)); 2475 body["invoice" ] = LLFloaterRegionInfo::getLastInvoice();
2476} 2476
2477 2477 // block fly is in estate database but not in estate UI, so we're not supporting it
2478F32 LLPanelEstateInfo::getSunHour() 2478 //body["block_fly" ] = childGetValue("").asBoolean();
2479{ 2479
2480 if (childIsEnabled("sun_hour_slider")) 2480 F32 sun_hour = getSunHour();
2481 { 2481 if (childGetValue("use_global_time_check").asBoolean())
2482 return (F32)childGetValue("sun_hour_slider").asReal(); 2482 {
2483 } 2483 sun_hour = 0.f; // 0 = global time
2484 return 0.f; 2484 }
2485} 2485 body["sun_hour"] = sun_hour;
2486 2486
2487const std::string LLPanelEstateInfo::getEstateName() const 2487 body["owner_abuse_email"] = childGetValue("abuse_email_address").asString();
2488{ 2488
2489 return childGetValue("estate_name").asString(); 2489 // we use a responder so that we can re-get the data after committing to the database
2490} 2490 LLHTTPClient::post(url, body, new LLEstateChangeInfoResponder((void*)this));
2491 2491 return true;
2492void LLPanelEstateInfo::setEstateName(const std::string& name) 2492}
2493{ 2493
2494 childSetValue("estate_name", LLSD(name)); 2494/* This is the old way of doing things, is deprecated, and should be
2495} 2495 deleted when the dataserver model can be removed */
2496 2496// key = "estatechangeinfo"
2497const std::string LLPanelEstateInfo::getOwnerName() const 2497// strings[0] = str(estate_id) (added by simulator before relay - not here)
2498{ 2498// strings[1] = estate_name
2499 return childGetValue("estate_owner").asString(); 2499// strings[2] = str(estate_flags)
2500} 2500// strings[3] = str((S32)(sun_hour * 1024.f))
2501 2501void LLPanelEstateInfo::commitEstateInfoDataserver()
2502void LLPanelEstateInfo::setOwnerName(const std::string& name) 2502{
2503{ 2503 LLMessageSystem* msg = gMessageSystem;
2504 childSetValue("estate_owner", LLSD(name)); 2504 msg->newMessage("EstateOwnerMessage");
2505} 2505 msg->nextBlockFast(_PREHASH_AgentData);
2506 2506 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
2507const std::string LLPanelEstateInfo::getAbuseEmailAddress() const 2507 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
2508{ 2508 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
2509 return childGetValue("abuse_email_address").asString(); 2509
2510} 2510 msg->nextBlock("MethodData");
2511 2511 msg->addString("Method", "estatechangeinfo");
2512void LLPanelEstateInfo::setAbuseEmailAddress(const std::string& address) 2512 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
2513{ 2513
2514 childSetValue("abuse_email_address", LLSD(address)); 2514 msg->nextBlock("ParamList");
2515} 2515 msg->addString("Parameter", getEstateName());
2516 2516
2517void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent, 2517 std::string buffer;
2518 bool enable_group, 2518 buffer = llformat("%u", computeEstateFlags());
2519 bool enable_ban) 2519 msg->nextBlock("ParamList");
2520{ 2520 msg->addString("Parameter", buffer);
2521 childSetEnabled("allow_resident_label", enable_agent); 2521
2522 childSetEnabled("allowed_avatar_name_list", enable_agent); 2522 F32 sun_hour = getSunHour();
2523 childSetVisible("allowed_avatar_name_list", enable_agent); 2523 if (childGetValue("use_global_time_check").asBoolean())
2524 childSetEnabled("add_allowed_avatar_btn", enable_agent); 2524 {
2525 childSetEnabled("remove_allowed_avatar_btn", enable_agent); 2525 sun_hour = 0.f; // 0 = global time
2526 2526 }
2527 // Groups 2527
2528 childSetEnabled("allow_group_label", enable_group); 2528 buffer = llformat("%d", (S32)(sun_hour*1024.0f));
2529 childSetEnabled("allowed_group_name_list", enable_group); 2529 msg->nextBlock("ParamList");
2530 childSetVisible("allowed_group_name_list", enable_group); 2530 msg->addString("Parameter", buffer);
2531 childSetEnabled("add_allowed_group_btn", enable_group); 2531
2532 childSetEnabled("remove_allowed_group_btn", enable_group); 2532 gAgent.sendMessage();
2533 2533}
2534 // Ban 2534
2535 childSetEnabled("ban_resident_label", enable_ban); 2535void LLPanelEstateInfo::setEstateFlags(U32 flags)
2536 childSetEnabled("banned_avatar_name_list", enable_ban); 2536{
2537 childSetVisible("banned_avatar_name_list", enable_ban); 2537 childSetValue("externally_visible_check", LLSD(flags & REGION_FLAGS_EXTERNALLY_VISIBLE ? TRUE : FALSE) );
2538 childSetEnabled("add_banned_avatar_btn", enable_ban); 2538 childSetValue("fixed_sun_check", LLSD(flags & REGION_FLAGS_SUN_FIXED ? TRUE : FALSE) );
2539 childSetEnabled("remove_banned_avatar_btn", enable_ban); 2539 childSetValue(
2540 2540 "voice_chat_check",
2541 // Update removal buttons if needed 2541 LLSD(flags & REGION_FLAGS_ALLOW_VOICE ? TRUE : FALSE));
2542 if (enable_agent) 2542 childSetValue("allow_direct_teleport", LLSD(flags & REGION_FLAGS_ALLOW_DIRECT_TELEPORT ? TRUE : FALSE) );
2543 { 2543 childSetValue("limit_payment", LLSD(flags & REGION_FLAGS_DENY_ANONYMOUS ? TRUE : FALSE) );
2544 checkRemovalButton("allowed_avatar_name_list"); 2544 childSetValue("limit_age_verified", LLSD(flags & REGION_FLAGS_DENY_AGEUNVERIFIED ? TRUE : FALSE) );
2545 } 2545
2546 2546 refresh();
2547 if (enable_group) 2547}
2548 { 2548
2549 checkRemovalButton("allowed_group_name_list"); 2549U32 LLPanelEstateInfo::computeEstateFlags()
2550 } 2550{
2551 2551 U32 flags = 0;
2552 if (enable_ban) 2552
2553 { 2553 if (childGetValue("externally_visible_check").asBoolean())
2554 checkRemovalButton("banned_avatar_name_list"); 2554 {
2555 } 2555 flags |= REGION_FLAGS_EXTERNALLY_VISIBLE;
2556} 2556 }
2557 2557
2558// static 2558 if ( childGetValue("voice_chat_check").asBoolean() )
2559void LLPanelEstateInfo::callbackCacheName( 2559 {
2560 const LLUUID& id, 2560 flags |= REGION_FLAGS_ALLOW_VOICE;
2561 const std::string& first, 2561 }
2562 const std::string& last, 2562
2563 BOOL is_group, 2563 if (childGetValue("allow_direct_teleport").asBoolean())
2564 void*) 2564 {
2565{ 2565 flags |= REGION_FLAGS_ALLOW_DIRECT_TELEPORT;
2566 LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate(); 2566 }
2567 if (!self) return; 2567
2568 2568 if (childGetValue("fixed_sun_check").asBoolean())
2569 std::string name; 2569 {
2570 2570 flags |= REGION_FLAGS_SUN_FIXED;
2571 if (id.isNull()) 2571 }
2572 { 2572
2573 name = "(none)"; 2573 if (childGetValue("limit_payment").asBoolean())
2574 } 2574 {
2575 else 2575 flags |= REGION_FLAGS_DENY_ANONYMOUS;
2576 { 2576 }
2577 name = first + " " + last; 2577
2578 } 2578 if (childGetValue("limit_age_verified").asBoolean())
2579 2579 {
2580 self->setOwnerName(name); 2580 flags |= REGION_FLAGS_DENY_AGEUNVERIFIED;
2581} 2581 }
2582 2582
2583void LLPanelEstateInfo::clearAccessLists() 2583
2584{ 2584 return flags;
2585 LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); 2585}
2586 if (name_list) 2586
2587 { 2587BOOL LLPanelEstateInfo::getGlobalTime()
2588 name_list->deleteAllItems(); 2588{
2589 } 2589 return childGetValue("use_global_time_check").asBoolean();
2590 2590}
2591 name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); 2591
2592 if (name_list) 2592void LLPanelEstateInfo::setGlobalTime(bool b)
2593 { 2593{
2594 name_list->deleteAllItems(); 2594 childSetValue("use_global_time_check", LLSD(b));
2595 } 2595 childSetEnabled("fixed_sun_check", LLSD(!b));
2596} 2596 childSetEnabled("sun_hour_slider", LLSD(!b));
2597 2597 if (b)
2598// enables/disables the "remove" button for the various allow/ban lists 2598 {
2599BOOL LLPanelEstateInfo::checkRemovalButton(std::string name) 2599 childSetValue("sun_hour_slider", LLSD(0.f));
2600{ 2600 }
2601 std::string btn_name = ""; 2601}
2602 if (name == "allowed_avatar_name_list") 2602
2603 { 2603
2604 btn_name = "remove_allowed_avatar_btn"; 2604BOOL LLPanelEstateInfo::getFixedSun()
2605 } 2605{
2606 else if (name == "allowed_group_name_list") 2606 return childGetValue("fixed_sun_check").asBoolean();
2607 { 2607}
2608 btn_name = "remove_allowed_group_btn"; 2608
2609 } 2609void LLPanelEstateInfo::setSunHour(F32 sun_hour)
2610 else if (name == "banned_avatar_name_list") 2610{
2611 { 2611 if(sun_hour < 6.0f)
2612 btn_name = "remove_banned_avatar_btn"; 2612 {
2613 } 2613 sun_hour = 24.0f + sun_hour;
2614 else if (name == "estate_manager_name_list") 2614 }
2615 { 2615 childSetValue("sun_hour_slider", LLSD(sun_hour));
2616 //ONLY OWNER CAN ADD /DELET ESTATE MANAGER 2616}
2617 LLViewerRegion* region = gAgent.getRegion(); 2617
2618 if (region && (region->getOwner() == gAgent.getID())) 2618F32 LLPanelEstateInfo::getSunHour()
2619 { 2619{
2620 btn_name = "remove_estate_manager_btn"; 2620 if (childIsEnabled("sun_hour_slider"))
2621 } 2621 {
2622 } 2622 return (F32)childGetValue("sun_hour_slider").asReal();
2623 2623 }
2624 // enable the remove button if something is selected 2624 return 0.f;
2625 LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name); 2625}
2626 childSetEnabled(btn_name, name_list && name_list->getFirstSelected() ? TRUE : FALSE); 2626
2627 2627const std::string LLPanelEstateInfo::getEstateName() const
2628 return (btn_name != ""); 2628{
2629} 2629 return childGetValue("estate_name").asString();
2630 2630}
2631BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl) 2631
2632{ 2632void LLPanelEstateInfo::setEstateName(const std::string& name)
2633 BOOL found_child_ctrl = FALSE; 2633{
2634 if (child_ctrl->getName() == "sun_hour_slider") 2634 childSetValue("estate_name", LLSD(name));
2635 { 2635}
2636 enableButton("apply_btn"); 2636
2637 found_child_ctrl = TRUE; 2637const std::string LLPanelEstateInfo::getOwnerName() const
2638 } 2638{
2639 return found_child_ctrl; 2639 return childGetValue("estate_owner").asString();
2640} 2640}
2641 2641
2642// static 2642void LLPanelEstateInfo::setOwnerName(const std::string& name)
2643void LLPanelEstateInfo::onClickMessageEstate(void* userdata) 2643{
2644{ 2644 childSetValue("estate_owner", LLSD(name));
2645 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl; 2645}
2646 LLNotifications::instance().add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2)); 2646
2647} 2647const std::string LLPanelEstateInfo::getAbuseEmailAddress() const
2648 2648{
2649bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& response) 2649 return childGetValue("abuse_email_address").asString();
2650{ 2650}
2651 S32 option = LLNotification::getSelectedOption(notification, response); 2651
2652 std::string text = response["message"].asString(); 2652void LLPanelEstateInfo::setAbuseEmailAddress(const std::string& address)
2653 if(option != 0) return false; 2653{
2654 if(text.empty()) return false; 2654 childSetValue("abuse_email_address", LLSD(address));
2655 llinfos << "Message to everyone: " << text << llendl; 2655}
2656 strings_t strings; 2656
2657 //integers_t integers; 2657void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,
2658 std::string name; 2658 bool enable_group,
2659 gAgent.buildFullname(name); 2659 bool enable_ban)
2660 strings.push_back(strings_t::value_type(name)); 2660{
2661 strings.push_back(strings_t::value_type(text)); 2661 childSetEnabled("allow_resident_label", enable_agent);
2662 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice()); 2662 childSetEnabled("allowed_avatar_name_list", enable_agent);
2663 sendEstateOwnerMessage(gMessageSystem, "instantmessage", invoice, strings); 2663 childSetVisible("allowed_avatar_name_list", enable_agent);
2664 return false; 2664 childSetEnabled("add_allowed_avatar_btn", enable_agent);
2665} 2665 childSetEnabled("remove_allowed_avatar_btn", enable_agent);
2666 2666
2667LLPanelEstateCovenant::LLPanelEstateCovenant() 2667 // Groups
2668: mCovenantID(LLUUID::null) 2668 childSetEnabled("allow_group_label", enable_group);
2669{ 2669 childSetEnabled("allowed_group_name_list", enable_group);
2670} 2670 childSetVisible("allowed_group_name_list", enable_group);
2671 2671 childSetEnabled("add_allowed_group_btn", enable_group);
2672// virtual 2672 childSetEnabled("remove_allowed_group_btn", enable_group);
2673bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region) 2673
2674{ 2674 // Ban
2675 LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); 2675 childSetEnabled("ban_resident_label", enable_ban);
2676 if (region_name) 2676 childSetEnabled("banned_avatar_name_list", enable_ban);
2677 { 2677 childSetVisible("banned_avatar_name_list", enable_ban);
2678 region_name->setText(region->getName()); 2678 childSetEnabled("add_banned_avatar_btn", enable_ban);
2679 } 2679 childSetEnabled("remove_banned_avatar_btn", enable_ban);
2680 2680
2681 LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause"); 2681 // Update removal buttons if needed
2682 if (resellable_clause) 2682 if (enable_agent)
2683 { 2683 {
2684 if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL) 2684 checkRemovalButton("allowed_avatar_name_list");
2685 { 2685 }
2686 resellable_clause->setText(getString("can_not_resell")); 2686
2687 } 2687 if (enable_group)
2688 else 2688 {
2689 { 2689 checkRemovalButton("allowed_group_name_list");
2690 resellable_clause->setText(getString("can_resell")); 2690 }
2691 } 2691
2692 } 2692 if (enable_ban)
2693 2693 {
2694 LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause"); 2694 checkRemovalButton("banned_avatar_name_list");
2695 if (changeable_clause) 2695 }
2696 { 2696}
2697 if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES) 2697
2698 { 2698// static
2699 changeable_clause->setText(getString("can_change")); 2699void LLPanelEstateInfo::callbackCacheName(
2700 } 2700 const LLUUID& id,
2701 else 2701 const std::string& first,
2702 { 2702 const std::string& last,
2703 changeable_clause->setText(getString("can_not_change")); 2703 BOOL is_group,
2704 } 2704 void*)
2705 } 2705{
2706 2706 LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate();
2707 LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text"); 2707 if (!self) return;
2708 if (region_maturity) 2708
2709 { 2709 std::string name;
2710 region_maturity->setText(region->getSimAccessString()); 2710
2711 } 2711 if (id.isNull())
2712 2712 {
2713 LLTextBox* region_landtype = getChild<LLTextBox>("region_landtype_text"); 2713 name = "(none)";
2714 if (region_landtype) 2714 }
2715 { 2715 else
2716 region_landtype->setText(region->getSimProductName()); 2716 {
2717 } 2717 name = first + " " + last;
2718 2718 }
2719 2719
2720 // let the parent class handle the general data collection. 2720 self->setOwnerName(name);
2721 bool rv = LLPanelRegionInfo::refreshFromRegion(region); 2721}
2722 LLMessageSystem *msg = gMessageSystem; 2722
2723 msg->newMessage("EstateCovenantRequest"); 2723void LLPanelEstateInfo::clearAccessLists()
2724 msg->nextBlockFast(_PREHASH_AgentData); 2724{
2725 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2725 LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list");
2726 msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); 2726 if (name_list)
2727 msg->sendReliable(region->getHost()); 2727 {
2728 return rv; 2728 name_list->deleteAllItems();
2729} 2729 }
2730 2730
2731// virtual 2731 name_list = getChild<LLNameListCtrl>("banned_avatar_name_list");
2732bool LLPanelEstateCovenant::estateUpdate(LLMessageSystem* msg) 2732 if (name_list)
2733{ 2733 {
2734 llinfos << "LLPanelEstateCovenant::estateUpdate()" << llendl; 2734 name_list->deleteAllItems();
2735 return true; 2735 }
2736} 2736}
2737 2737
2738// virtual 2738// enables/disables the "remove" button for the various allow/ban lists
2739BOOL LLPanelEstateCovenant::postBuild() 2739BOOL LLPanelEstateInfo::checkRemovalButton(std::string name)
2740{ 2740{
2741 initHelpBtn("covenant_help", "HelpEstateCovenant"); 2741 std::string btn_name = "";
2742 mEstateNameText = getChild<LLTextBox>("estate_name_text"); 2742 if (name == "allowed_avatar_name_list")
2743 mEstateOwnerText = getChild<LLTextBox>("estate_owner_text"); 2743 {
2744 mLastModifiedText = getChild<LLTextBox>("covenant_timestamp_text"); 2744 btn_name = "remove_allowed_avatar_btn";
2745 mEditor = getChild<LLViewerTextEditor>("covenant_editor"); 2745 }
2746 if (mEditor) mEditor->setHandleEditKeysDirectly(TRUE); 2746 else if (name == "allowed_group_name_list")
2747 LLButton* reset_button = getChild<LLButton>("reset_covenant"); 2747 {
2748 reset_button->setEnabled(gAgent.canManageEstate()); 2748 btn_name = "remove_allowed_group_btn";
2749 reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, NULL); 2749 }
2750 2750 else if (name == "banned_avatar_name_list")
2751 return LLPanelRegionInfo::postBuild(); 2751 {
2752} 2752 btn_name = "remove_banned_avatar_btn";
2753 2753 }
2754// virtual 2754 else if (name == "estate_manager_name_list")
2755void LLPanelEstateCovenant::updateChild(LLUICtrl* child_ctrl) 2755 {
2756{ 2756 //ONLY OWNER CAN ADD /DELET ESTATE MANAGER
2757} 2757 LLViewerRegion* region = gAgent.getRegion();
2758 2758 if (region && (region->getOwner() == gAgent.getID()))
2759// virtual 2759 {
2760BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, 2760 btn_name = "remove_estate_manager_btn";
2761 EDragAndDropType cargo_type, 2761 }
2762 void* cargo_data, 2762 }
2763 EAcceptance* accept, 2763
2764 std::string& tooltip_msg) 2764 // enable the remove button if something is selected
2765{ 2765 LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name);
2766 LLInventoryItem* item = (LLInventoryItem*)cargo_data; 2766 childSetEnabled(btn_name, name_list && name_list->getFirstSelected() ? TRUE : FALSE);
2767 2767
2768 if (!gAgent.canManageEstate()) 2768 return (btn_name != "");
2769 { 2769}
2770 *accept = ACCEPT_NO; 2770
2771 return TRUE; 2771BOOL LLPanelEstateInfo::checkSunHourSlider(LLUICtrl* child_ctrl)
2772 } 2772{
2773 2773 BOOL found_child_ctrl = FALSE;
2774 switch(cargo_type) 2774 if (child_ctrl->getName() == "sun_hour_slider")
2775 { 2775 {
2776 case DAD_NOTECARD: 2776 enableButton("apply_btn");
2777 *accept = ACCEPT_YES_COPY_SINGLE; 2777 found_child_ctrl = TRUE;
2778 if (item && drop) 2778 }
2779 { 2779 return found_child_ctrl;
2780 LLSD payload; 2780}
2781 payload["item_id"] = item->getUUID(); 2781
2782 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), payload, 2782// static
2783 LLPanelEstateCovenant::confirmChangeCovenantCallback); 2783void LLPanelEstateInfo::onClickMessageEstate(void* userdata)
2784 } 2784{
2785 break; 2785 llinfos << "LLPanelEstateInfo::onClickMessageEstate" << llendl;
2786 default: 2786 LLNotifications::instance().add("MessageEstate", LLSD(), LLSD(), boost::bind(&LLPanelEstateInfo::onMessageCommit, (LLPanelEstateInfo*)userdata, _1, _2));
2787 *accept = ACCEPT_NO; 2787}
2788 break; 2788
2789 } 2789bool LLPanelEstateInfo::onMessageCommit(const LLSD& notification, const LLSD& response)
2790 2790{
2791 return TRUE; 2791 S32 option = LLNotification::getSelectedOption(notification, response);
2792} 2792 std::string text = response["message"].asString();
2793 2793 if(option != 0) return false;
2794// static 2794 if(text.empty()) return false;
2795bool LLPanelEstateCovenant::confirmChangeCovenantCallback(const LLSD& notification, const LLSD& response) 2795 llinfos << "Message to everyone: " << text << llendl;
2796{ 2796 strings_t strings;
2797 S32 option = LLNotification::getSelectedOption(notification, response); 2797 //integers_t integers;
2798 LLInventoryItem* item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); 2798 std::string name;
2799 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); 2799 gAgent.buildFullname(name);
2800 2800 strings.push_back(strings_t::value_type(name));
2801 if (!item || !self) return false; 2801 strings.push_back(strings_t::value_type(text));
2802 2802 LLUUID invoice(LLFloaterRegionInfo::getLastInvoice());
2803 switch(option) 2803 sendEstateOwnerMessage(gMessageSystem, "instantmessage", invoice, strings);
2804 { 2804 return false;
2805 case 0: 2805}
2806 self->loadInvItem(item); 2806
2807 break; 2807LLPanelEstateCovenant::LLPanelEstateCovenant()
2808 default: 2808: mCovenantID(LLUUID::null)
2809 break; 2809{
2810 } 2810}
2811 return false; 2811
2812} 2812// virtual
2813 2813bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region)
2814// static 2814{
2815void LLPanelEstateCovenant::resetCovenantID(void* userdata) 2815 LLTextBox* region_name = getChild<LLTextBox>("region_name_text");
2816{ 2816 if (region_name)
2817 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), LLSD(), confirmResetCovenantCallback); 2817 {
2818} 2818 region_name->setText(region->getName());
2819 2819 }
2820// static 2820
2821bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notification, const LLSD& response) 2821 LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause");
2822{ 2822 if (resellable_clause)
2823 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant(); 2823 {
2824 if (!self) return false; 2824 if (region->getRegionFlags() & REGION_FLAGS_BLOCK_LAND_RESELL)
2825 2825 {
2826 S32 option = LLNotification::getSelectedOption(notification, response); 2826 resellable_clause->setText(getString("can_not_resell"));
2827 switch(option) 2827 }
2828 { 2828 else
2829 case 0: 2829 {
2830 self->loadInvItem(NULL); 2830 resellable_clause->setText(getString("can_resell"));
2831 break; 2831 }
2832 default: 2832 }
2833 break; 2833
2834 } 2834 LLTextBox* changeable_clause = getChild<LLTextBox>("changeable_clause");
2835 return false; 2835 if (changeable_clause)
2836} 2836 {
2837 2837 if (region->getRegionFlags() & REGION_FLAGS_ALLOW_PARCEL_CHANGES)
2838void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp) 2838 {
2839{ 2839 changeable_clause->setText(getString("can_change"));
2840 const BOOL high_priority = TRUE; 2840 }
2841 if (itemp) 2841 else
2842 { 2842 {
2843 gAssetStorage->getInvItemAsset(gAgent.getRegionHost(), 2843 changeable_clause->setText(getString("can_not_change"));
2844 gAgent.getID(), 2844 }
2845 gAgent.getSessionID(), 2845 }
2846 itemp->getPermissions().getOwner(), 2846
2847 LLUUID::null, 2847 LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text");
2848 itemp->getUUID(), 2848 if (region_maturity)
2849 itemp->getAssetUUID(), 2849 {
2850 itemp->getType(), 2850 region_maturity->setText(region->getSimAccessString());
2851 onLoadComplete, 2851 }
2852 (void*)this, 2852
2853 high_priority); 2853 LLTextBox* region_landtype = getChild<LLTextBox>("region_landtype_text");
2854 mAssetStatus = ASSET_LOADING; 2854 if (region_landtype)
2855 } 2855 {
2856 else 2856 region_landtype->setText(region->getSimProductName());
2857 { 2857 }
2858 mAssetStatus = ASSET_LOADED; 2858
2859 setCovenantTextEditor("There is no Covenant provided for this Estate."); 2859
2860 sendChangeCovenantID(LLUUID::null); 2860 // let the parent class handle the general data collection.
2861 } 2861 bool rv = LLPanelRegionInfo::refreshFromRegion(region);
2862} 2862 LLMessageSystem *msg = gMessageSystem;
2863 2863 msg->newMessage("EstateCovenantRequest");
2864// static 2864 msg->nextBlockFast(_PREHASH_AgentData);
2865void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, 2865 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
2866 const LLUUID& asset_uuid, 2866 msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
2867 LLAssetType::EType type, 2867 msg->sendReliable(region->getHost());
2868 void* user_data, S32 status, LLExtStat ext_status) 2868 return rv;
2869{ 2869}
2870 llinfos << "LLPanelEstateCovenant::onLoadComplete()" << llendl; 2870
2871 LLPanelEstateCovenant* panelp = (LLPanelEstateCovenant*)user_data; 2871// virtual
2872 if( panelp ) 2872bool LLPanelEstateCovenant::estateUpdate(LLMessageSystem* msg)
2873 { 2873{
2874 if(0 == status) 2874 llinfos << "LLPanelEstateCovenant::estateUpdate()" << llendl;
2875 { 2875 return true;
2876 LLVFile file(vfs, asset_uuid, type, LLVFile::READ); 2876}
2877 2877
2878 S32 file_length = file.getSize(); 2878// virtual
2879 2879BOOL LLPanelEstateCovenant::postBuild()
2880 char* buffer = new char[file_length+1]; 2880{
2881 if (buffer == NULL) 2881 initHelpBtn("covenant_help", "HelpEstateCovenant");
2882 { 2882 mEstateNameText = getChild<LLTextBox>("estate_name_text");
2883 llerrs << "Memory Allocation Failed" << llendl; 2883 mEstateOwnerText = getChild<LLTextBox>("estate_owner_text");
2884 return; 2884 mLastModifiedText = getChild<LLTextBox>("covenant_timestamp_text");
2885 } 2885 mEditor = getChild<LLViewerTextEditor>("covenant_editor");
2886 2886 if (mEditor) mEditor->setHandleEditKeysDirectly(TRUE);
2887 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */ 2887 LLButton* reset_button = getChild<LLButton>("reset_covenant");
2888 // put a EOS at the end 2888 reset_button->setEnabled(gAgent.canManageEstate());
2889 buffer[file_length] = 0; 2889 reset_button->setClickedCallback(LLPanelEstateCovenant::resetCovenantID, NULL);
2890 2890
2891 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) 2891 return LLPanelRegionInfo::postBuild();
2892 { 2892}
2893 if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) ) 2893
2894 { 2894// virtual
2895 llwarns << "Problem importing estate covenant." << llendl; 2895void LLPanelEstateCovenant::updateChild(LLUICtrl* child_ctrl)
2896 LLNotifications::instance().add("ProblemImportingEstateCovenant"); 2896{
2897 } 2897}
2898 else 2898
2899 { 2899// virtual
2900 panelp->sendChangeCovenantID(asset_uuid); 2900BOOL LLPanelEstateCovenant::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
2901 } 2901 EDragAndDropType cargo_type,
2902 } 2902 void* cargo_data,
2903 else 2903 EAcceptance* accept,
2904 { 2904 std::string& tooltip_msg)
2905 // Version 0 (just text, doesn't include version number) 2905{
2906 panelp->sendChangeCovenantID(asset_uuid); 2906 LLInventoryItem* item = (LLInventoryItem*)cargo_data;
2907 } 2907
2908 delete[] buffer; 2908 if (!gAgent.canManageEstate())
2909 } 2909 {
2910 else 2910 *accept = ACCEPT_NO;
2911 { 2911 return TRUE;
2912 LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); 2912 }
2913 2913
2914 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || 2914 switch(cargo_type)
2915 LL_ERR_FILE_EMPTY == status) 2915 {
2916 { 2916 case DAD_NOTECARD:
2917 LLNotifications::instance().add("MissingNotecardAssetID"); 2917 *accept = ACCEPT_YES_COPY_SINGLE;
2918 } 2918 if (item && drop)
2919 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) 2919 {
2920 { 2920 LLSD payload;
2921 LLNotifications::instance().add("NotAllowedToViewNotecard"); 2921 payload["item_id"] = item->getUUID();
2922 } 2922 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), payload,
2923 else 2923 LLPanelEstateCovenant::confirmChangeCovenantCallback);
2924 { 2924 }
2925 LLNotifications::instance().add("UnableToLoadNotecardAsset"); 2925 break;
2926 } 2926 default:
2927 2927 *accept = ACCEPT_NO;
2928 llwarns << "Problem loading notecard: " << status << llendl; 2928 break;
2929 } 2929 }
2930 panelp->mAssetStatus = ASSET_LOADED; 2930
2931 panelp->setCovenantID(asset_uuid); 2931 return TRUE;
2932 } 2932}
2933} 2933
2934 2934// static
2935// key = "estatechangecovenantid" 2935bool LLPanelEstateCovenant::confirmChangeCovenantCallback(const LLSD& notification, const LLSD& response)
2936// strings[0] = str(estate_id) (added by simulator before relay - not here) 2936{
2937// strings[1] = str(covenant_id) 2937 S32 option = LLNotification::getSelectedOption(notification, response);
2938void LLPanelEstateCovenant::sendChangeCovenantID(const LLUUID &asset_id) 2938 LLInventoryItem* item = gInventory.getItem(notification["payload"]["item_id"].asUUID());
2939{ 2939 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant();
2940 if (asset_id != getCovenantID()) 2940
2941 { 2941 if (!item || !self) return false;
2942 setCovenantID(asset_id); 2942
2943 2943 switch(option)
2944 LLMessageSystem* msg = gMessageSystem; 2944 {
2945 msg->newMessage("EstateOwnerMessage"); 2945 case 0:
2946 msg->nextBlockFast(_PREHASH_AgentData); 2946 self->loadInvItem(item);
2947 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); 2947 break;
2948 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); 2948 default:
2949 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used 2949 break;
2950 2950 }
2951 msg->nextBlock("MethodData"); 2951 return false;
2952 msg->addString("Method", "estatechangecovenantid"); 2952}
2953 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice()); 2953
2954 2954// static
2955 msg->nextBlock("ParamList"); 2955void LLPanelEstateCovenant::resetCovenantID(void* userdata)
2956 msg->addString("Parameter", getCovenantID().asString()); 2956{
2957 gAgent.sendReliableMessage(); 2957 LLNotifications::instance().add("EstateChangeCovenant", LLSD(), LLSD(), confirmResetCovenantCallback);
2958 } 2958}
2959} 2959
2960 2960// static
2961// virtual 2961bool LLPanelEstateCovenant::confirmResetCovenantCallback(const LLSD& notification, const LLSD& response)
2962BOOL LLPanelEstateCovenant::sendUpdate() 2962{
2963{ 2963 LLPanelEstateCovenant* self = LLFloaterRegionInfo::getPanelCovenant();
2964 return TRUE; 2964 if (!self) return false;
2965} 2965
2966 2966 S32 option = LLNotification::getSelectedOption(notification, response);
2967const std::string& LLPanelEstateCovenant::getEstateName() const 2967 switch(option)
2968{ 2968 {
2969 return mEstateNameText->getText(); 2969 case 0:
2970} 2970 self->loadInvItem(NULL);
2971 2971 break;
2972void LLPanelEstateCovenant::setEstateName(const std::string& name) 2972 default:
2973{ 2973 break;
2974 mEstateNameText->setText(name); 2974 }
2975} 2975 return false;
2976 2976}
2977// static 2977
2978void LLPanelEstateCovenant::updateCovenantText(const std::string& string, const LLUUID& asset_id) 2978void LLPanelEstateCovenant::loadInvItem(LLInventoryItem *itemp)
2979{ 2979{
2980 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant(); 2980 const BOOL high_priority = TRUE;
2981 if( panelp ) 2981 if (itemp)
2982 { 2982 {
2983 panelp->mEditor->setText(string); 2983 gAssetStorage->getInvItemAsset(gAgent.getRegionHost(),
2984 panelp->setCovenantID(asset_id); 2984 gAgent.getID(),
2985 } 2985 gAgent.getSessionID(),
2986} 2986 itemp->getPermissions().getOwner(),
2987 2987 LLUUID::null,
2988// static 2988 itemp->getUUID(),
2989void LLPanelEstateCovenant::updateEstateName(const std::string& name) 2989 itemp->getAssetUUID(),
2990{ 2990 itemp->getType(),
2991 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant(); 2991 onLoadComplete,
2992 if( panelp ) 2992 (void*)this,
2993 { 2993 high_priority);
2994 panelp->mEstateNameText->setText(name); 2994 mAssetStatus = ASSET_LOADING;
2995 } 2995 }
2996} 2996 else
2997 2997 {
2998// static 2998 mAssetStatus = ASSET_LOADED;
2999void LLPanelEstateCovenant::updateLastModified(const std::string& text) 2999 setCovenantTextEditor("There is no Covenant provided for this Estate.");
3000{ 3000 sendChangeCovenantID(LLUUID::null);
3001 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant(); 3001 }
3002 if( panelp ) 3002}
3003 { 3003
3004 panelp->mLastModifiedText->setText(text); 3004// static
3005 } 3005void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs,
3006} 3006 const LLUUID& asset_uuid,
3007 3007 LLAssetType::EType type,
3008// static 3008 void* user_data, S32 status, LLExtStat ext_status)
3009void LLPanelEstateCovenant::updateEstateOwnerName(const std::string& name) 3009{
3010{ 3010 llinfos << "LLPanelEstateCovenant::onLoadComplete()" << llendl;
3011 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant(); 3011 LLPanelEstateCovenant* panelp = (LLPanelEstateCovenant*)user_data;
3012 if( panelp ) 3012 if( panelp )
3013 { 3013 {
3014 panelp->mEstateOwnerText->setText(name); 3014 if(0 == status)
3015 } 3015 {
3016} 3016 LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
3017 3017
3018const std::string& LLPanelEstateCovenant::getOwnerName() const 3018 S32 file_length = file.getSize();
3019{ 3019
3020 return mEstateOwnerText->getText(); 3020 char* buffer = new char[file_length+1];
3021} 3021 if (buffer == NULL)
3022 3022 {
3023void LLPanelEstateCovenant::setOwnerName(const std::string& name) 3023 llerrs << "Memory Allocation Failed" << llendl;
3024{ 3024 return;
3025 mEstateOwnerText->setText(name); 3025 }
3026} 3026
3027 3027 file.read((U8*)buffer, file_length); /* Flawfinder: ignore */
3028void LLPanelEstateCovenant::setCovenantTextEditor(const std::string& text) 3028 // put a EOS at the end
3029{ 3029 buffer[file_length] = 0;
3030 mEditor->setText(text); 3030
3031} 3031 if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
3032 3032 {
3033// key = "estateupdateinfo" 3033 if( !panelp->mEditor->importBuffer( buffer, file_length+1 ) )
3034// strings[0] = estate name 3034 {
3035// strings[1] = str(owner_id) 3035 llwarns << "Problem importing estate covenant." << llendl;
3036// strings[2] = str(estate_id) 3036 LLNotifications::instance().add("ProblemImportingEstateCovenant");
3037// strings[3] = str(estate_flags) 3037 }
3038// strings[4] = str((S32)(sun_hour * 1024)) 3038 else
3039// strings[5] = str(parent_estate_id) 3039 {
3040// strings[6] = str(covenant_id) 3040 panelp->sendChangeCovenantID(asset_uuid);
3041// strings[7] = str(covenant_timestamp) 3041 }
3042// strings[8] = str(send_to_agent_only) 3042 }
3043// strings[9] = str(abuse_email_addr) 3043 else
3044bool LLDispatchEstateUpdateInfo::operator()( 3044 {
3045 const LLDispatcher* dispatcher, 3045 // Version 0 (just text, doesn't include version number)
3046 const std::string& key, 3046 panelp->sendChangeCovenantID(asset_uuid);
3047 const LLUUID& invoice, 3047 }
3048 const sparam_t& strings) 3048 delete[] buffer;
3049{ 3049 }
3050 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 3050 else
3051 if (!panel) return true; 3051 {
3052 3052 LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED );
3053 // NOTE: LLDispatcher extracts strings with an extra \0 at the 3053
3054 // end. If we pass the std::string direct to the UI/renderer 3054 if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ||
3055 // it draws with a weird character at the end of the string. 3055 LL_ERR_FILE_EMPTY == status)
3056 std::string estate_name = strings[0].c_str(); // preserve c_str() call! 3056 {
3057 panel->setEstateName(estate_name); 3057 LLNotifications::instance().add("MissingNotecardAssetID");
3058 3058 }
3059#if ELAR_ENABLED 3059 else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status)
3060 if (strings.size() > 9) 3060 {
3061 { 3061 LLNotifications::instance().add("NotAllowedToViewNotecard");
3062 std::string abuse_email = strings[9].c_str(); // preserve c_str() call! 3062 }
3063 panel->setAbuseEmailAddress(abuse_email); 3063 else
3064 } 3064 {
3065 else 3065 LLNotifications::instance().add("UnableToLoadNotecardAsset");
3066#endif 3066 }
3067 { 3067
3068 panel->setAbuseEmailAddress(panel->getString("email_unsupported")); 3068 llwarns << "Problem loading notecard: " << status << llendl;
3069 } 3069 }
3070 3070 panelp->mAssetStatus = ASSET_LOADED;
3071 LLViewerRegion* regionp = gAgent.getRegion(); 3071 panelp->setCovenantID(asset_uuid);
3072 3072 }
3073 LLUUID owner_id(strings[1]); 3073}
3074 regionp->setOwner(owner_id); 3074
3075 // Update estate owner name in UI 3075// key = "estatechangecovenantid"
3076 const BOOL is_group = FALSE; 3076// strings[0] = str(estate_id) (added by simulator before relay - not here)
3077 gCacheName->get(owner_id, is_group, LLPanelEstateInfo::callbackCacheName); 3077// strings[1] = str(covenant_id)
3078 3078void LLPanelEstateCovenant::sendChangeCovenantID(const LLUUID &asset_id)
3079 U32 estate_id = strtoul(strings[2].c_str(), NULL, 10); 3079{
3080 panel->setEstateID(estate_id); 3080 if (asset_id != getCovenantID())
3081 3081 {
3082 U32 flags = strtoul(strings[3].c_str(), NULL, 10); 3082 setCovenantID(asset_id);
3083 panel->setEstateFlags(flags); 3083
3084 3084 LLMessageSystem* msg = gMessageSystem;
3085 F32 sun_hour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f; 3085 msg->newMessage("EstateOwnerMessage");
3086 if(sun_hour == 0 && (flags & REGION_FLAGS_SUN_FIXED ? FALSE : TRUE)) 3086 msg->nextBlockFast(_PREHASH_AgentData);
3087 { 3087 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3088 panel->setGlobalTime(TRUE); 3088 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3089 } 3089 msg->addUUIDFast(_PREHASH_TransactionID, LLUUID::null); //not used
3090 else 3090
3091 { 3091 msg->nextBlock("MethodData");
3092 panel->setGlobalTime(FALSE); 3092 msg->addString("Method", "estatechangecovenantid");
3093 panel->setSunHour(sun_hour); 3093 msg->addUUID("Invoice", LLFloaterRegionInfo::getLastInvoice());
3094 } 3094
3095 3095 msg->nextBlock("ParamList");
3096 bool visible_from_mainland = (bool)(flags & REGION_FLAGS_EXTERNALLY_VISIBLE); 3096 msg->addString("Parameter", getCovenantID().asString());
3097 bool god = gAgent.isGodlike(); 3097 gAgent.sendReliableMessage();
3098 bool linden_estate = (estate_id <= ESTATE_LAST_LINDEN); 3098 }
3099 3099}
3100 // If visible from mainland, disable the access allowed 3100
3101 // UI, as anyone can teleport there. 3101// virtual
3102 // However, gods need to be able to edit the access list for 3102BOOL LLPanelEstateCovenant::sendUpdate()
3103 // linden estates, regardless of visibility, to allow object 3103{
3104 // and L$ transfers. 3104 return TRUE;
3105 bool enable_agent = (!visible_from_mainland || (god && linden_estate)); 3105}
3106 bool enable_group = enable_agent; 3106
3107 bool enable_ban = !linden_estate; 3107const std::string& LLPanelEstateCovenant::getEstateName() const
3108 panel->setAccessAllowedEnabled(enable_agent, enable_group, enable_ban); 3108{
3109 3109 return mEstateNameText->getText();
3110 return true; 3110}
3111} 3111
3112 3112void LLPanelEstateCovenant::setEstateName(const std::string& name)
3113 3113{
3114// key = "setaccess" 3114 mEstateNameText->setText(name);
3115// strings[0] = str(estate_id) 3115}
3116// strings[1] = str(packed_access_lists) 3116
3117// strings[2] = str(num allowed agent ids) 3117// static
3118// strings[3] = str(num allowed group ids) 3118void LLPanelEstateCovenant::updateCovenantText(const std::string& string, const LLUUID& asset_id)
3119// strings[4] = str(num banned agent ids) 3119{
3120// strings[5] = str(num estate manager agent ids) 3120 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
3121// strings[6] = bin(uuid) 3121 if( panelp )
3122// strings[7] = bin(uuid) 3122 {
3123// strings[8] = bin(uuid) 3123 panelp->mEditor->setText(string);
3124// ... 3124 panelp->setCovenantID(asset_id);
3125bool LLDispatchSetEstateAccess::operator()( 3125 }
3126 const LLDispatcher* dispatcher, 3126}
3127 const std::string& key, 3127
3128 const LLUUID& invoice, 3128// static
3129 const sparam_t& strings) 3129void LLPanelEstateCovenant::updateEstateName(const std::string& name)
3130{ 3130{
3131 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); 3131 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
3132 if (!panel) return true; 3132 if( panelp )
3133 3133 {
3134 S32 index = 1; // skip estate_id 3134 panelp->mEstateNameText->setText(name);
3135 U32 access_flags = strtoul(strings[index++].c_str(), NULL,10); 3135 }
3136 S32 num_allowed_agents = strtol(strings[index++].c_str(), NULL, 10); 3136}
3137 S32 num_allowed_groups = strtol(strings[index++].c_str(), NULL, 10); 3137
3138 S32 num_banned_agents = strtol(strings[index++].c_str(), NULL, 10); 3138// static
3139 S32 num_estate_managers = strtol(strings[index++].c_str(), NULL, 10); 3139void LLPanelEstateCovenant::updateLastModified(const std::string& text)
3140 3140{
3141 // sanity ckecks 3141 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
3142 if (num_allowed_agents > 0 3142 if( panelp )
3143 && !(access_flags & ESTATE_ACCESS_ALLOWED_AGENTS)) 3143 {
3144 { 3144 panelp->mLastModifiedText->setText(text);
3145 llwarns << "non-zero count for allowed agents, but no corresponding flag" << llendl; 3145 }
3146 } 3146}
3147 if (num_allowed_groups > 0 3147
3148 && !(access_flags & ESTATE_ACCESS_ALLOWED_GROUPS)) 3148// static
3149 { 3149void LLPanelEstateCovenant::updateEstateOwnerName(const std::string& name)
3150 llwarns << "non-zero count for allowed groups, but no corresponding flag" << llendl; 3150{
3151 } 3151 LLPanelEstateCovenant* panelp = LLFloaterRegionInfo::getPanelCovenant();
3152 if (num_banned_agents > 0 3152 if( panelp )
3153 && !(access_flags & ESTATE_ACCESS_BANNED_AGENTS)) 3153 {
3154 { 3154 panelp->mEstateOwnerText->setText(name);
3155 llwarns << "non-zero count for banned agents, but no corresponding flag" << llendl; 3155 }
3156 } 3156}
3157 if (num_estate_managers > 0 3157
3158 && !(access_flags & ESTATE_ACCESS_MANAGERS)) 3158const std::string& LLPanelEstateCovenant::getOwnerName() const
3159 { 3159{
3160 llwarns << "non-zero count for managers, but no corresponding flag" << llendl; 3160 return mEstateOwnerText->getText();
3161 } 3161}
3162 3162
3163 // grab the UUID's out of the string fields 3163void LLPanelEstateCovenant::setOwnerName(const std::string& name)
3164 if (access_flags & ESTATE_ACCESS_ALLOWED_AGENTS) 3164{
3165 { 3165 mEstateOwnerText->setText(name);
3166 LLNameListCtrl* allowed_agent_name_list; 3166}
3167 allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list"); 3167
3168 3168void LLPanelEstateCovenant::setCovenantTextEditor(const std::string& text)
3169 int totalAllowedAgents = num_allowed_agents; 3169{
3170 3170 mEditor->setText(text);
3171 if (allowed_agent_name_list) 3171}
3172 { 3172
3173 totalAllowedAgents += allowed_agent_name_list->getItemCount(); 3173// key = "estateupdateinfo"
3174 } 3174// strings[0] = estate name
3175 3175// strings[1] = str(owner_id)
3176 std::string msg = llformat("Allowed residents: (%d, max %d)", 3176// strings[2] = str(estate_id)
3177 totalAllowedAgents, 3177// strings[3] = str(estate_flags)
3178 ESTATE_MAX_ACCESS_IDS); 3178// strings[4] = str((S32)(sun_hour * 1024))
3179 panel->childSetValue("allow_resident_label", LLSD(msg)); 3179// strings[5] = str(parent_estate_id)
3180 3180// strings[6] = str(covenant_id)
3181 if (allowed_agent_name_list) 3181// strings[7] = str(covenant_timestamp)
3182 { 3182// strings[8] = str(send_to_agent_only)
3183 //allowed_agent_name_list->deleteAllItems(); 3183// strings[9] = str(abuse_email_addr)
3184 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 3184bool LLDispatchEstateUpdateInfo::operator()(
3185 { 3185 const LLDispatcher* dispatcher,
3186 LLUUID id; 3186 const std::string& key,
3187 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ 3187 const LLUUID& invoice,
3188 allowed_agent_name_list->addNameItem(id); 3188 const sparam_t& strings)
3189 } 3189{
3190 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE); 3190 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
3191 allowed_agent_name_list->sortByColumnIndex(0, TRUE); 3191 if (!panel) return true;
3192 } 3192
3193 } 3193 // NOTE: LLDispatcher extracts strings with an extra \0 at the
3194 3194 // end. If we pass the std::string direct to the UI/renderer
3195 if (access_flags & ESTATE_ACCESS_ALLOWED_GROUPS) 3195 // it draws with a weird character at the end of the string.
3196 { 3196 std::string estate_name = strings[0].c_str(); // preserve c_str() call!
3197 LLNameListCtrl* allowed_group_name_list; 3197 panel->setEstateName(estate_name);
3198 allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); 3198
3199 3199 if (strings.size() > 3)
3200 std::string msg = llformat("Allowed groups: (%d, max %d)", 3200 {
3201 num_allowed_groups, 3201 std::string abuse_email = strings[9].c_str(); // preserve c_str() call!
3202 (S32) ESTATE_MAX_GROUP_IDS); 3202 panel->setAbuseEmailAddress(abuse_email);
3203 panel->childSetValue("allow_group_label", LLSD(msg)); 3203 }
3204 3204 else
3205 if (allowed_group_name_list) 3205 {
3206 { 3206 panel->setAbuseEmailAddress(panel->getString("email_unsupported"));
3207 allowed_group_name_list->deleteAllItems(); 3207 }
3208 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++) 3208
3209 { 3209 LLViewerRegion* regionp = gAgent.getRegion();
3210 LLUUID id; 3210
3211 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ 3211 LLUUID owner_id(strings[1]);
3212 allowed_group_name_list->addGroupNameItem(id); 3212 regionp->setOwner(owner_id);
3213 } 3213 // Update estate owner name in UI
3214 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE); 3214 const BOOL is_group = FALSE;
3215 allowed_group_name_list->sortByColumnIndex(0, TRUE); 3215 gCacheName->get(owner_id, is_group, LLPanelEstateInfo::callbackCacheName);
3216 } 3216
3217 } 3217 U32 estate_id = strtoul(strings[2].c_str(), NULL, 10);
3218 3218 panel->setEstateID(estate_id);
3219 if (access_flags & ESTATE_ACCESS_BANNED_AGENTS) 3219
3220 { 3220 U32 flags = strtoul(strings[3].c_str(), NULL, 10);
3221 LLNameListCtrl* banned_agent_name_list; 3221 panel->setEstateFlags(flags);
3222 banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list"); 3222
3223 3223 F32 sun_hour = ((F32)(strtod(strings[4].c_str(), NULL)))/1024.0f;
3224 int totalBannedAgents = num_banned_agents; 3224 if(sun_hour == 0 && (flags & REGION_FLAGS_SUN_FIXED ? FALSE : TRUE))
3225 3225 {
3226 if (banned_agent_name_list) 3226 panel->setGlobalTime(TRUE);
3227 { 3227 }
3228 totalBannedAgents += banned_agent_name_list->getItemCount(); 3228 else
3229 } 3229 {
3230 3230 panel->setGlobalTime(FALSE);
3231 3231 panel->setSunHour(sun_hour);
3232 std::string msg = llformat("Banned residents: (%d, max %d)", 3232 }
3233 totalBannedAgents, 3233
3234 ESTATE_MAX_ACCESS_IDS); 3234 bool visible_from_mainland = (bool)(flags & REGION_FLAGS_EXTERNALLY_VISIBLE);
3235 panel->childSetValue("ban_resident_label", LLSD(msg)); 3235 bool god = gAgent.isGodlike();
3236 3236 bool linden_estate = (estate_id <= ESTATE_LAST_LINDEN);
3237 if (banned_agent_name_list) 3237
3238 { 3238 // If visible from mainland, disable the access allowed
3239 //banned_agent_name_list->deleteAllItems(); 3239 // UI, as anyone can teleport there.
3240 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++) 3240 // However, gods need to be able to edit the access list for
3241 { 3241 // linden estates, regardless of visibility, to allow object
3242 LLUUID id; 3242 // and L$ transfers.
3243 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ 3243 bool enable_agent = (!visible_from_mainland || (god && linden_estate));
3244 banned_agent_name_list->addNameItem(id); 3244 bool enable_group = enable_agent;
3245 } 3245 bool enable_ban = !linden_estate;
3246 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE); 3246 panel->setAccessAllowedEnabled(enable_agent, enable_group, enable_ban);
3247 banned_agent_name_list->sortByColumnIndex(0, TRUE); 3247
3248 } 3248 return true;
3249 } 3249}
3250 3250
3251 if (access_flags & ESTATE_ACCESS_MANAGERS) 3251
3252 { 3252// key = "setaccess"
3253 std::string msg = llformat("Estate Managers: (%d, max %d)", 3253// strings[0] = str(estate_id)
3254 num_estate_managers, 3254// strings[1] = str(packed_access_lists)
3255 ESTATE_MAX_MANAGERS); 3255// strings[2] = str(num allowed agent ids)
3256 panel->childSetValue("estate_manager_label", LLSD(msg)); 3256// strings[3] = str(num allowed group ids)
3257 3257// strings[4] = str(num banned agent ids)
3258 LLNameListCtrl* estate_manager_name_list = 3258// strings[5] = str(num estate manager agent ids)
3259 panel->getChild<LLNameListCtrl>("estate_manager_name_list"); 3259// strings[6] = bin(uuid)
3260 if (estate_manager_name_list) 3260// strings[7] = bin(uuid)
3261 { 3261// strings[8] = bin(uuid)
3262 estate_manager_name_list->deleteAllItems(); // Clear existing entries 3262// ...
3263 3263bool LLDispatchSetEstateAccess::operator()(
3264 // There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't 3264 const LLDispatcher* dispatcher,
3265 // truncate the list unless it's really big. Go ahead and show the extras so the user doesn't get confused, 3265 const std::string& key,
3266 // and they can still remove them. 3266 const LLUUID& invoice,
3267 for (S32 i = 0; i < num_estate_managers && i < (ESTATE_MAX_MANAGERS * 4); i++) 3267 const sparam_t& strings)
3268 { 3268{
3269 LLUUID id; 3269 LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate();
3270 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */ 3270 if (!panel) return true;
3271 estate_manager_name_list->addNameItem(id); 3271
3272 } 3272 S32 index = 1; // skip estate_id
3273 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE); 3273 U32 access_flags = strtoul(strings[index++].c_str(), NULL,10);
3274 estate_manager_name_list->sortByColumnIndex(0, TRUE); 3274 S32 num_allowed_agents = strtol(strings[index++].c_str(), NULL, 10);
3275 } 3275 S32 num_allowed_groups = strtol(strings[index++].c_str(), NULL, 10);
3276 } 3276 S32 num_banned_agents = strtol(strings[index++].c_str(), NULL, 10);
3277 3277 S32 num_estate_managers = strtol(strings[index++].c_str(), NULL, 10);
3278 return true; 3278
3279} 3279 // sanity ckecks
3280 3280 if (num_allowed_agents > 0
3281// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) 3281 && !(access_flags & ESTATE_ACCESS_ALLOWED_AGENTS))
3282void LLFloaterRegionInfo::open() 3282 {
3283{ 3283 llwarns << "non-zero count for allowed agents, but no corresponding flag" << llendl;
3284 // We'll allow access to the estate tools for estate managers (and for the sim owner) 3284 }
3285 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) 3285 if (num_allowed_groups > 0
3286 { 3286 && !(access_flags & ESTATE_ACCESS_ALLOWED_GROUPS))
3287 LLViewerRegion* pRegion = gAgent.getRegion(); 3287 {
3288 if (!pRegion) 3288 llwarns << "non-zero count for allowed groups, but no corresponding flag" << llendl;
3289 return; 3289 }
3290 3290 if (num_banned_agents > 0
3291 // Should be able to call LLRegion::canManageEstate() but then we can fake god like 3291 && !(access_flags & ESTATE_ACCESS_BANNED_AGENTS))
3292 if ( (!pRegion->isEstateManager()) && (pRegion->getOwner() != gAgent.getID()) ) 3292 {
3293 return; 3293 llwarns << "non-zero count for banned agents, but no corresponding flag" << llendl;
3294 } 3294 }
3295 3295 if (num_estate_managers > 0
3296 LLFloater::open(); 3296 && !(access_flags & ESTATE_ACCESS_MANAGERS))
3297} 3297 {
3298// [/RLVa:KB] 3298 llwarns << "non-zero count for managers, but no corresponding flag" << llendl;
3299 }
3300
3301 // grab the UUID's out of the string fields
3302 if (access_flags & ESTATE_ACCESS_ALLOWED_AGENTS)
3303 {
3304 LLNameListCtrl* allowed_agent_name_list;
3305 allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list");
3306
3307 int totalAllowedAgents = num_allowed_agents;
3308
3309 if (allowed_agent_name_list)
3310 {
3311 totalAllowedAgents += allowed_agent_name_list->getItemCount();
3312 }
3313
3314 std::string msg = llformat("Allowed residents: (%d, max %d)",
3315 totalAllowedAgents,
3316 ESTATE_MAX_ACCESS_IDS);
3317 panel->childSetValue("allow_resident_label", LLSD(msg));
3318
3319 if (allowed_agent_name_list)
3320 {
3321 //allowed_agent_name_list->deleteAllItems();
3322 for (S32 i = 0; i < num_allowed_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
3323 {
3324 LLUUID id;
3325 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
3326 allowed_agent_name_list->addNameItem(id);
3327 }
3328 panel->childSetEnabled("remove_allowed_avatar_btn", allowed_agent_name_list->getFirstSelected() ? TRUE : FALSE);
3329 allowed_agent_name_list->sortByColumnIndex(0, TRUE);
3330 }
3331 }
3332
3333 if (access_flags & ESTATE_ACCESS_ALLOWED_GROUPS)
3334 {
3335 LLNameListCtrl* allowed_group_name_list;
3336 allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list");
3337
3338 std::string msg = llformat("Allowed groups: (%d, max %d)",
3339 num_allowed_groups,
3340 (S32) ESTATE_MAX_GROUP_IDS);
3341 panel->childSetValue("allow_group_label", LLSD(msg));
3342
3343 if (allowed_group_name_list)
3344 {
3345 allowed_group_name_list->deleteAllItems();
3346 for (S32 i = 0; i < num_allowed_groups && i < ESTATE_MAX_GROUP_IDS; i++)
3347 {
3348 LLUUID id;
3349 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
3350 allowed_group_name_list->addGroupNameItem(id);
3351 }
3352 panel->childSetEnabled("remove_allowed_group_btn", allowed_group_name_list->getFirstSelected() ? TRUE : FALSE);
3353 allowed_group_name_list->sortByColumnIndex(0, TRUE);
3354 }
3355 }
3356
3357 if (access_flags & ESTATE_ACCESS_BANNED_AGENTS)
3358 {
3359 LLNameListCtrl* banned_agent_name_list;
3360 banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list");
3361
3362 int totalBannedAgents = num_banned_agents;
3363
3364 if (banned_agent_name_list)
3365 {
3366 totalBannedAgents += banned_agent_name_list->getItemCount();
3367 }
3368
3369
3370 std::string msg = llformat("Banned residents: (%d, max %d)",
3371 totalBannedAgents,
3372 ESTATE_MAX_ACCESS_IDS);
3373 panel->childSetValue("ban_resident_label", LLSD(msg));
3374
3375 if (banned_agent_name_list)
3376 {
3377 //banned_agent_name_list->deleteAllItems();
3378 for (S32 i = 0; i < num_banned_agents && i < ESTATE_MAX_ACCESS_IDS; i++)
3379 {
3380 LLUUID id;
3381 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
3382 banned_agent_name_list->addNameItem(id);
3383 }
3384 panel->childSetEnabled("remove_banned_avatar_btn", banned_agent_name_list->getFirstSelected() ? TRUE : FALSE);
3385 banned_agent_name_list->sortByColumnIndex(0, TRUE);
3386 }
3387 }
3388
3389 if (access_flags & ESTATE_ACCESS_MANAGERS)
3390 {
3391 std::string msg = llformat("Estate Managers: (%d, max %d)",
3392 num_estate_managers,
3393 ESTATE_MAX_MANAGERS);
3394 panel->childSetValue("estate_manager_label", LLSD(msg));
3395
3396 LLNameListCtrl* estate_manager_name_list =
3397 panel->getChild<LLNameListCtrl>("estate_manager_name_list");
3398 if (estate_manager_name_list)
3399 {
3400 estate_manager_name_list->deleteAllItems(); // Clear existing entries
3401
3402 // There should be only ESTATE_MAX_MANAGERS people in the list, but if the database gets more (SL-46107) don't
3403 // truncate the list unless it's really big. Go ahead and show the extras so the user doesn't get confused,
3404 // and they can still remove them.
3405 for (S32 i = 0; i < num_estate_managers && i < (ESTATE_MAX_MANAGERS * 4); i++)
3406 {
3407 LLUUID id;
3408 memcpy(id.mData, strings[index++].data(), UUID_BYTES); /* Flawfinder: ignore */
3409 estate_manager_name_list->addNameItem(id);
3410 }
3411 panel->childSetEnabled("remove_estate_manager_btn", estate_manager_name_list->getFirstSelected() ? TRUE : FALSE);
3412 estate_manager_name_list->sortByColumnIndex(0, TRUE);
3413 }
3414 }
3415
3416 return true;
3417}
3418
3419// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
3420void LLFloaterRegionInfo::open()
3421{
3422 // We'll allow access to the estate tools for estate managers (and for the sim owner)
3423 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
3424 {
3425 LLViewerRegion* pRegion = gAgent.getRegion();
3426 if (!pRegion)
3427 return;
3428
3429 // Should be able to call LLRegion::canManageEstate() but then we can fake god like
3430 if ( (!pRegion->isEstateManager()) && (pRegion->getOwner() != gAgent.getID()) )
3431 return;
3432 }
3433
3434 LLFloater::open();
3435}
3436// [/RLVa:KB]
diff --git a/linden/indra/newview/llfloaterregioninfo.h b/linden/indra/newview/llfloaterregioninfo.h
index fd0d9ce..ee01c7c 100644
--- a/linden/indra/newview/llfloaterregioninfo.h
+++ b/linden/indra/newview/llfloaterregioninfo.h
@@ -53,6 +53,7 @@ class LLSpinCtrl;
53class LLTextBox; 53class LLTextBox;
54 54
55class LLPanelRegionGeneralInfo; 55class LLPanelRegionGeneralInfo;
56class LLPanelRegionOpenSettingsInfo;
56class LLPanelRegionDebugInfo; 57class LLPanelRegionDebugInfo;
57class LLPanelRegionTextureInfo; 58class LLPanelRegionTextureInfo;
58class LLPanelRegionTerrainInfo; 59class LLPanelRegionTerrainInfo;
@@ -83,6 +84,7 @@ public:
83 84
84 static LLPanelEstateInfo* getPanelEstate(); 85 static LLPanelEstateInfo* getPanelEstate();
85 static LLPanelEstateCovenant* getPanelCovenant(); 86 static LLPanelEstateCovenant* getPanelCovenant();
87 static LLPanelRegionOpenSettingsInfo* getPanelOpenSettings();
86 88
87 // from LLPanel 89 // from LLPanel
88 virtual void refresh(); 90 virtual void refresh();
@@ -173,6 +175,24 @@ protected:
173 175
174///////////////////////////////////////////////////////////////////////////// 176/////////////////////////////////////////////////////////////////////////////
175 177
178class LLPanelRegionOpenSettingsInfo : public LLPanelRegionInfo
179{
180public:
181 LLPanelRegionOpenSettingsInfo()
182 : LLPanelRegionInfo() {}
183 ~LLPanelRegionOpenSettingsInfo() {}
184
185 virtual bool refreshFromRegion(LLViewerRegion* region);
186
187 // LLPanel
188 virtual BOOL postBuild();
189
190protected:
191 static void sendUpdate(void* userdata);
192};
193
194/////////////////////////////////////////////////////////////////////////////
195
176class LLPanelRegionDebugInfo : public LLPanelRegionInfo 196class LLPanelRegionDebugInfo : public LLPanelRegionInfo
177{ 197{
178public: 198public:
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index 6744faf..c092f5a 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -181,26 +181,23 @@ void* LLFloaterTools::createPanelLandInfo(void* data)
181 181
182void LLFloaterTools::updateToolsSizeLimits() 182void LLFloaterTools::updateToolsSizeLimits()
183{ 183{
184 if (gSavedSettings.getBOOL("DisableMaxBuildConstraints")) 184 getChild<LLSpinCtrl>("Scale X")->setMinValue(gHippoLimits->getMinPrimScale());
185 { 185 getChild<LLSpinCtrl>("Scale Y")->setMinValue(gHippoLimits->getMinPrimScale());
186 getChild<LLSpinCtrl>("Scale X")->setMaxValue(F32_MAX); 186 getChild<LLSpinCtrl>("Scale Z")->setMinValue(gHippoLimits->getMinPrimScale());
187 getChild<LLSpinCtrl>("Scale Y")->setMaxValue(F32_MAX);
188 getChild<LLSpinCtrl>("Scale Z")->setMaxValue(F32_MAX);
189 187
190 getChild<LLSpinCtrl>("Pos X")->setMaxValue(F32_MAX); 188 getChild<LLSpinCtrl>("Scale X")->setMaxValue(gHippoLimits->getMaxPrimScale());
191 getChild<LLSpinCtrl>("Pos Y")->setMaxValue(F32_MAX); 189 getChild<LLSpinCtrl>("Scale Y")->setMaxValue(gHippoLimits->getMaxPrimScale());
192 getChild<LLSpinCtrl>("Pos Z")->setMaxValue(F32_MAX); 190 getChild<LLSpinCtrl>("Scale Z")->setMaxValue(gHippoLimits->getMaxPrimScale());
193 }
194 else
195 {
196 getChild<LLSpinCtrl>("Scale X")->setMaxValue(gHippoLimits->getMaxPrimScale());
197 getChild<LLSpinCtrl>("Scale Y")->setMaxValue(gHippoLimits->getMaxPrimScale());
198 getChild<LLSpinCtrl>("Scale Z")->setMaxValue(gHippoLimits->getMaxPrimScale());
199 191
200 getChild<LLSpinCtrl>("Scale X")->setMinValue(gHippoLimits->getMinPrimScale()); 192 getChild<LLSpinCtrl>("Pos X")->setMinValue(gHippoLimits->getMinPrimXPos());
201 getChild<LLSpinCtrl>("Scale Y")->setMinValue(gHippoLimits->getMinPrimScale()); 193 getChild<LLSpinCtrl>("Pos Y")->setMinValue(gHippoLimits->getMinPrimYPos());
202 getChild<LLSpinCtrl>("Scale Z")->setMinValue(gHippoLimits->getMinPrimScale()); 194 getChild<LLSpinCtrl>("Pos Z")->setMinValue(gHippoLimits->getMinPrimZPos());
203 } 195
196 getChild<LLSpinCtrl>("Pos X")->setMaxValue(gHippoLimits->getMaxPrimXPos());
197 getChild<LLSpinCtrl>("Pos Y")->setMaxValue(gHippoLimits->getMaxPrimYPos());
198 getChild<LLSpinCtrl>("Pos Z")->setMaxValue(gHippoLimits->getMinPrimZPos());
199
200 getChild<LLCheckBoxCtrl>("Physical Checkbox Ctrl")->setEnabled(gHippoLimits->mAllowPhysicalPrims);
204} 201}
205 202
206void LLFloaterTools::updateToolsPrecision() 203void LLFloaterTools::updateToolsPrecision()
@@ -1258,8 +1255,18 @@ void LLFloaterTools::onClickLink(void* data)
1258 return; 1255 return;
1259 } 1256 }
1260 1257
1261 S32 max_linked_prims = gHippoLimits->getMaxLinkedPrims(); 1258 S32 max_linked_prims = 0;
1262 if (max_linked_prims > -1) 1259 if(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()->usePhysics())
1260 {
1261 //Physical - use phys prim limit
1262 max_linked_prims = gHippoLimits->getMaxPhysLinkedPrims();
1263 }
1264 else
1265 {
1266 //Non phys limit
1267 max_linked_prims = gHippoLimits->getMaxLinkedPrims();
1268 }
1269 if (max_linked_prims > -1) //-1 : no limits
1263 { 1270 {
1264 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); 1271 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
1265 if (object_count > max_linked_prims + 1) 1272 if (object_count > max_linked_prims + 1)
@@ -1271,7 +1278,7 @@ void LLFloaterTools::onClickLink(void* data)
1271 return; 1278 return;
1272 } 1279 }
1273 } 1280 }
1274 1281
1275 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) 1282 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2)
1276 { 1283 {
1277 LLNotifications::instance().add("CannotLinkIncompleteSet"); 1284 LLNotifications::instance().add("CannotLinkIncompleteSet");
diff --git a/linden/indra/newview/llfloatertos.cpp b/linden/indra/newview/llfloatertos.cpp
index 52d7b1f..2684e10 100644
--- a/linden/indra/newview/llfloatertos.cpp
+++ b/linden/indra/newview/llfloatertos.cpp
@@ -1,284 +1,310 @@
1/** 1/**
2 * @file llfloatertos.cpp 2 * @file llfloatertos.cpp
3 * @brief Terms of Service Agreement dialog 3 * @brief Terms of Service Agreement dialog
4 * 4 *
5 * $LicenseInfo:firstyear=2003&license=viewergpl$ 5 * $LicenseInfo:firstyear=2003&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2003-2009, Linden Research, Inc. 7 * Copyright (c) 2003-2009, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0 11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception 21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 * 22 *
23 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations. 25 * and agree to abide by those obligations.
26 * 26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE. 29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$ 30 * $/LicenseInfo$
31 */ 31 */
32 32
33#include "llviewerprecompiledheaders.h" 33#include "llviewerprecompiledheaders.h"
34 34
35#include "llfloatertos.h" 35#include "llfloatertos.h"
36 36
37// viewer includes 37// viewer includes
38#include "llagent.h" 38#include "llagent.h"
39#include "llappviewer.h" 39#include "llappviewer.h"
40#include "llstartup.h" 40#include "llstartup.h"
41#include "llviewerstats.h" 41#include "llviewerstats.h"
42#include "llviewertexteditor.h" 42#include "llviewertexteditor.h"
43#include "llviewerwindow.h" 43#include "llviewerwindow.h"
44 44
45// linden library includes 45// linden library includes
46#include "llbutton.h" 46#include "llbutton.h"
47#include "llhttpclient.h" 47#include "llhttpclient.h"
48#include "llhttpstatuscodes.h" // for HTTP_FOUND 48#include "llhttpstatuscodes.h" // for HTTP_FOUND
49#include "llradiogroup.h" 49#include "llradiogroup.h"
50#include "lltextbox.h" 50#include "lltextbox.h"
51#include "llui.h" 51#include "llui.h"
52#include "lluictrlfactory.h" 52#include "lluictrlfactory.h"
53#include "llvfile.h" 53#include "llvfile.h"
54#include "message.h" 54#include "message.h"
55 55#include "hippoGridManager.h"
56 56
57// static 57
58LLFloaterTOS* LLFloaterTOS::sInstance = NULL; 58// static
59 59LLFloaterTOS* LLFloaterTOS::sInstance = NULL;
60// static 60
61LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) 61// static
62{ 62LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message)
63 if( !LLFloaterTOS::sInstance ) 63{
64 { 64 if( !LLFloaterTOS::sInstance )
65 LLFloaterTOS::sInstance = new LLFloaterTOS(type, message); 65 {
66 } 66 LLFloaterTOS::sInstance = new LLFloaterTOS(type, message);
67 67 }
68 if (type == TOS_TOS) 68
69 { 69 if (type == TOS_TOS)
70 LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml"); 70 {
71 } 71 LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml");
72 else 72 }
73 { 73 else
74 LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml"); 74 {
75 } 75 LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml");
76 76 }
77 return LLFloaterTOS::sInstance; 77
78} 78 return LLFloaterTOS::sInstance;
79 79}
80 80
81LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message) 81
82: LLModalDialog( std::string(" "), 100, 100 ), 82LLFloaterTOS::LLFloaterTOS(ETOSType type, const std::string & message)
83 mType(type), 83: LLModalDialog( std::string(" "), 100, 100 ),
84 mMessage(message), 84 mType(type),
85 mWebBrowserWindowId( 0 ), 85 mMessage(message),
86 mLoadCompleteCount( 0 ) 86 mWebBrowserWindowId( 0 ),
87{ 87 mLoadCompleteCount( 0 )
88} 88{
89 89}
90// helper class that trys to download a URL from a web site and calls a method 90
91// on parent class indicating if the web server is working or not 91// helper class that trys to download a URL from a web site and calls a method
92class LLIamHereTOS : public LLHTTPClient::Responder 92// on parent class indicating if the web server is working or not
93{ 93class LLIamHereTOS : public LLHTTPClient::Responder
94 private: 94{
95 LLIamHereTOS( LLFloaterTOS* parent ) : 95 private:
96 mParent( parent ) 96 LLIamHereTOS( LLFloaterTOS* parent ) :
97 {} 97 mParent( parent )
98 98 {}
99 LLFloaterTOS* mParent; 99
100 100 LLFloaterTOS* mParent;
101 public: 101
102 102 public:
103 static boost::intrusive_ptr< LLIamHereTOS > build( LLFloaterTOS* parent ) 103
104 { 104 static boost::intrusive_ptr< LLIamHereTOS > build( LLFloaterTOS* parent )
105 return boost::intrusive_ptr< LLIamHereTOS >( new LLIamHereTOS( parent ) ); 105 {
106 }; 106 return boost::intrusive_ptr< LLIamHereTOS >( new LLIamHereTOS( parent ) );
107 107 };
108 virtual void setParent( LLFloaterTOS* parentIn ) 108
109 { 109 virtual void setParent( LLFloaterTOS* parentIn )
110 mParent = parentIn; 110 {
111 }; 111 mParent = parentIn;
112 112 };
113 virtual void result( const LLSD& content ) 113
114 { 114 virtual void result( const LLSD& content )
115 if ( mParent ) 115 {
116 mParent->setSiteIsAlive( true ); 116 if ( mParent )
117 }; 117 mParent->setSiteIsAlive( true );
118 118 };
119 virtual void error( U32 status, const std::string& reason ) 119
120 { 120 virtual void error( U32 status, const std::string& reason )
121 if ( mParent ) 121 {
122 { 122 if ( mParent )
123 // *HACK: For purposes of this alive check, 302 Found 123 {
124 // (aka Moved Temporarily) is considered alive. The web site 124 // *HACK: For purposes of this alive check, 302 Found
125 // redirects this link to a "cache busting" temporary URL. JC 125 // (aka Moved Temporarily) is considered alive. The web site
126 bool alive = (status == HTTP_FOUND); 126 // redirects this link to a "cache busting" temporary URL. JC
127 mParent->setSiteIsAlive( alive ); 127 bool alive = (status == HTTP_FOUND);
128 } 128 mParent->setSiteIsAlive( alive );
129 }; 129 }
130}; 130 };
131 131};
132// this is global and not a class member to keep crud out of the header file 132
133namespace { 133// this is global and not a class member to keep crud out of the header file
134 boost::intrusive_ptr< LLIamHereTOS > gResponsePtr = 0; 134namespace {
135}; 135 boost::intrusive_ptr< LLIamHereTOS > gResponsePtr = 0;
136 136};
137BOOL LLFloaterTOS::postBuild() 137
138{ 138BOOL LLFloaterTOS::postBuild()
139 childSetAction("Continue", onContinue, this); 139{
140 childSetAction("Cancel", onCancel, this); 140 childSetAction("Continue", onContinue, this);
141 childSetCommitCallback("agree_chk", updateAgree, this); 141 childSetAction("Cancel", onCancel, this);
142 142 childSetCommitCallback("agree_chk", updateAgree, this);
143 if ( mType != TOS_TOS ) 143
144 { 144 LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
145 llinfos << "tos_type != TOS_TOS" << llendl; 145 tos_agreement->setEnabled( true );
146 // this displays the critical message 146
147 LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); 147 //Always set this so that the TOS is displayed whether the web browser pops up or not.
148 editor->setHandleEditKeysDirectly( TRUE ); 148 LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
149 editor->setEnabled( FALSE ); 149 editor->setHandleEditKeysDirectly( TRUE );
150 editor->setWordWrap(TRUE); 150 editor->setEnabled( FALSE );
151 editor->setFocus(TRUE); 151 editor->setWordWrap(TRUE);
152 // editor->setValue(LLSD(mMessage)); 152 editor->setFocus(TRUE);
153 editor->setValue(mMessage); 153 editor->setValue(LLSD(mMessage));
154 154 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
155 return TRUE; 155 if (web_browser)
156 } 156 {
157 157 //Disable for critical messages and text messages, it is reenabled later
158 // disable Agree to TOS radio button until the page has fully loaded 158 web_browser->setVisible( FALSE );
159 LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 159 }
160 tos_agreement->setEnabled( false ); 160
161 161 if ( mType != TOS_TOS )
162 // hide the SL text widget if we're displaying TOS with using a browser widget. 162 {
163 LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); 163 // this displays the critical message only
164 editor->setVisible(FALSE); 164 return TRUE;
165 165 }
166 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 166 bool use_web_browser = false;
167 if ( web_browser ) 167
168 { 168 //Check to see if the message is a link to display
169 // start to observe it so we see navigate complete events 169 std::string token = "http://";
170 web_browser->addObserver( this ); 170 std::string::size_type iIndex = mMessage.rfind(token);
171 171 //IF it has http:// in it, we use the web browser
172 gResponsePtr = LLIamHereTOS::build( this ); 172 if(iIndex != std::string::npos && mMessage.length() >= 2)
173 LLHTTPClient::head( getString( "real_url" ), gResponsePtr ); 173 {
174 } 174 // it exists
175 175 use_web_browser = true;
176 return TRUE; 176 }
177} 177 else if (gHippoGridManager->getConnectedGrid()->isSecondLife())
178 178 {
179void LLFloaterTOS::setSiteIsAlive( bool alive ) 179 //Its SL, use the browser for it as thats what it should do
180{ 180 use_web_browser = true;
181 // only do this for TOS pages 181 }
182 if ( mType == TOS_TOS ) 182
183 { 183 if ( web_browser && use_web_browser)
184 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 184 {
185 // if the contents of the site was retrieved 185 // hide the SL text widget if we're displaying TOS with using a browser widget.
186 if ( alive ) 186 LLTextEditor *editor = getChild<LLTextEditor>("tos_text");
187 { 187 editor->setVisible( FALSE );
188 if ( web_browser ) 188
189 { 189 // disable Agree to TOS radio button until the page has fully loaded
190 // navigate to the "real" page 190 tos_agreement->setEnabled( false );
191 web_browser->navigateTo( getString( "real_url" ) ); 191
192 }; 192 // Reenable the web browser
193 } 193 web_browser->setVisible( TRUE );
194 else 194
195 { 195 // start to observe it so we see navigate complete events
196 // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads) 196 web_browser->addObserver( this );
197 // but if the page is unavailable, we need to do this now 197
198 LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 198 gResponsePtr = LLIamHereTOS::build( this );
199 tos_agreement->setEnabled( true ); 199 LLHTTPClient::head( getString( "real_url" ), gResponsePtr );
200 }; 200 }
201 }; 201
202} 202 return TRUE;
203 203}
204LLFloaterTOS::~LLFloaterTOS() 204
205{ 205void LLFloaterTOS::setSiteIsAlive( bool alive )
206 // stop obsaerving events 206{
207 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html"); 207 // only do this for TOS pages
208 if ( web_browser ) 208 if ( mType == TOS_TOS )
209 { 209 {
210 web_browser->remObserver( this ); 210 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
211 }; 211 // if the contents of the site was retrieved
212 212 if ( alive )
213 // tell the responder we're not here anymore 213 {
214 if ( gResponsePtr ) 214 if ( web_browser )
215 gResponsePtr->setParent( 0 ); 215 {
216 216 // navigate to the "real" page
217 LLFloaterTOS::sInstance = NULL; 217 web_browser->navigateTo( getString( "real_url" ) );
218} 218 };
219 219 }
220// virtual 220 else
221void LLFloaterTOS::draw() 221 {
222{ 222 // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads)
223 // draw children 223 // but if the page is unavailable, we need to do this now
224 LLModalDialog::draw(); 224 LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
225} 225 tos_agreement->setEnabled( true );
226 226 };
227// static 227 };
228void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata ) 228}
229{ 229
230 LLFloaterTOS* self = (LLFloaterTOS*) userdata; 230LLFloaterTOS::~LLFloaterTOS()
231 bool agree = self->childGetValue("agree_chk").asBoolean(); 231{
232 self->childSetEnabled("Continue", agree); 232 // stop obsaerving events
233} 233 LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("tos_html");
234 234 if ( web_browser )
235// static 235 {
236void LLFloaterTOS::onContinue( void* userdata ) 236 web_browser->remObserver( this );
237{ 237 };
238 LLFloaterTOS* self = (LLFloaterTOS*) userdata; 238
239 llinfos << "User agrees with TOS." << llendl; 239 // tell the responder we're not here anymore
240 if (self->mType == TOS_TOS) 240 if ( gResponsePtr )
241 { 241 gResponsePtr->setParent( 0 );
242 gAcceptTOS = TRUE; 242
243 } 243 LLFloaterTOS::sInstance = NULL;
244 else 244}
245 { 245
246 gAcceptCriticalMessage = TRUE; 246// virtual
247 } 247void LLFloaterTOS::draw()
248 248{
249 // Testing TOS dialog 249 // draw children
250 #if ! LL_RELEASE_FOR_DOWNLOAD 250 LLModalDialog::draw();
251 if ( LLStartUp::getStartupState() == STATE_LOGIN_WAIT ) 251}
252 { 252
253 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 253// static
254 } 254void LLFloaterTOS::updateAgree(LLUICtrl*, void* userdata )
255 else 255{
256 #endif 256 LLFloaterTOS* self = (LLFloaterTOS*) userdata;
257 257 bool agree = self->childGetValue("agree_chk").asBoolean();
258 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication 258 self->childSetEnabled("Continue", agree);
259 self->close(); // destroys this object 259}
260} 260
261 261// static
262// static 262void LLFloaterTOS::onContinue( void* userdata )
263void LLFloaterTOS::onCancel( void* userdata ) 263{
264{ 264 LLFloaterTOS* self = (LLFloaterTOS*) userdata;
265 LLFloaterTOS* self = (LLFloaterTOS*) userdata; 265 llinfos << "User agrees with TOS." << llendl;
266 llinfos << "User disagrees with TOS." << llendl; 266 if (self->mType == TOS_TOS)
267 LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done); 267 {
268 LLStartUp::setStartupState( STATE_LOGIN_SHOW ); 268 gAcceptTOS = TRUE;
269 self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS 269 }
270 self->close(); // destroys this object 270 else
271} 271 {
272 272 gAcceptCriticalMessage = TRUE;
273//virtual 273 }
274void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) 274
275{ 275 // Testing TOS dialog
276 // skip past the loading screen navigate complete 276 #if ! LL_RELEASE_FOR_DOWNLOAD
277 if ( ++mLoadCompleteCount == 2 ) 277 if ( LLStartUp::getStartupState() == STATE_LOGIN_WAIT )
278 { 278 {
279 llinfos << "NAVIGATE COMPLETE" << llendl; 279 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
280 // enable Agree to TOS radio button now that page has loaded 280 }
281 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); 281 else
282 tos_agreement->setEnabled( true ); 282 #endif
283 }; 283
284} 284 LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); // Go back and finish authentication
285 self->close(); // destroys this object
286}
287
288// static
289void LLFloaterTOS::onCancel( void* userdata )
290{
291 LLFloaterTOS* self = (LLFloaterTOS*) userdata;
292 llinfos << "User disagrees with TOS." << llendl;
293 LLNotifications::instance().add("MustAgreeToLogIn", LLSD(), LLSD(), login_alert_done);
294 LLStartUp::setStartupState( STATE_LOGIN_SHOW );
295 self->mLoadCompleteCount = 0; // reset counter for next time we come to TOS
296 self->close(); // destroys this object
297}
298
299//virtual
300void LLFloaterTOS::onNavigateComplete( const EventType& eventIn )
301{
302 // skip past the loading screen navigate complete
303 if ( ++mLoadCompleteCount == 2 )
304 {
305 llinfos << "NAVIGATE COMPLETE" << llendl;
306 // enable Agree to TOS radio button now that page has loaded
307 LLCheckBoxCtrl * tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk");
308 tos_agreement->setEnabled( true );
309 };
310}
diff --git a/linden/indra/newview/llfloaterwater.cpp b/linden/indra/newview/llfloaterwater.cpp
index c4b6d0d..782c56e 100644
--- a/linden/indra/newview/llfloaterwater.cpp
+++ b/linden/indra/newview/llfloaterwater.cpp
@@ -64,6 +64,8 @@
64#include "llwaterparammanager.h" 64#include "llwaterparammanager.h"
65#include "llpostprocess.h" 65#include "llpostprocess.h"
66 66
67#include "wlfloaterwindlightsend.h"
68
67#undef max 69#undef max
68 70
69LLFloaterWater* LLFloaterWater::sWaterMenu = NULL; 71LLFloaterWater* LLFloaterWater::sWaterMenu = NULL;
@@ -680,6 +682,12 @@ void LLFloaterWater::onSavePreset(LLUICtrl* ctrl, void* userData)
680 682
681 } 683 }
682 } 684 }
685 else if (ctrl->getValue().asString() == "send_to_server_item")
686 {
687 //Open the other box
688 WLFloaterWindLightSend::instance();
689 WLFloaterWindLightSend::instance()->open();
690 }
683 else 691 else
684 { 692 {
685 LLWaterParamManager::instance()->mCurParams.mName = 693 LLWaterParamManager::instance()->mCurParams.mName =
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp
index be3c1fd..4937232 100644
--- a/linden/indra/newview/llfloaterwindlight.cpp
+++ b/linden/indra/newview/llfloaterwindlight.cpp
@@ -63,6 +63,9 @@
63#include "llwlparamset.h" 63#include "llwlparamset.h"
64#include "llwlparammanager.h" 64#include "llwlparammanager.h"
65#include "llpostprocess.h" 65#include "llpostprocess.h"
66#include "wlfloaterwindlightsend.h"
67#include "llworld.h"
68#include "hippolimits.h"
66 69
67#undef max 70#undef max
68 71
@@ -216,7 +219,9 @@ void LLFloaterWindLight::initCallbacks(void) {
216 childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL); 219 childSetCommitCallback("WLCloudScrollX", onCloudScrollXMoved, NULL);
217 childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL); 220 childSetCommitCallback("WLCloudScrollY", onCloudScrollYMoved, NULL);
218 childSetCommitCallback("WLDistanceMult", onFloatControlMoved, &param_mgr->mDistanceMult); 221 childSetCommitCallback("WLDistanceMult", onFloatControlMoved, &param_mgr->mDistanceMult);
219 childSetCommitCallback("DrawClassicClouds", LLSavedSettingsGlue::setBOOL, (void*)"SkyUseClassicClouds"); 222 childSetCommitCallback("DrawClassicClouds", onCloudDrawToggled, NULL);
223 childSetCommitCallback("WLCloudHeight", onCloudHeightMoved, NULL);
224 childSetCommitCallback("WLCloudRange", onCloudRangeMoved, NULL);
220 225
221 // WL Top 226 // WL Top
222 childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL); 227 childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL);
@@ -425,7 +430,21 @@ void LLFloaterWindLight::syncMenu()
425 bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY(); 430 bool lockY = !param_mgr->mCurParams.getEnableCloudScrollY();
426 childSetValue("WLCloudLockX", lockX); 431 childSetValue("WLCloudLockX", lockX);
427 childSetValue("WLCloudLockY", lockY); 432 childSetValue("WLCloudLockY", lockY);
428 childSetValue("DrawClassicClouds", gSavedSettings.getBOOL("SkyUseClassicClouds")); 433 childSetValue("DrawClassicClouds", gHippoLimits->skyUseClassicClouds);
434
435 childSetValue("WLCloudHeight", gSavedSettings.getF32("ClassicCloudHeight"));
436 childSetValue("WLCloudRange", gSavedSettings.getF32("ClassicCloudRange"));
437
438 if(!gHippoLimits->skyUseClassicClouds)
439 {
440 childDisable("WLCloudHeight");
441 childDisable("WLCloudRange");
442 }
443 else
444 {
445 childEnable("WLCloudHeight");
446 childEnable("WLCloudRange");
447 }
429 448
430 // disable if locked, enable if not 449 // disable if locked, enable if not
431 if(lockX) 450 if(lockX)
@@ -874,6 +893,12 @@ void LLFloaterWindLight::onSavePreset(LLUICtrl* ctrl, void* userData)
874 893
875 } 894 }
876 } 895 }
896 else if (ctrl->getValue().asString() == "send_to_server_item")
897 {
898 //Open the other box
899 WLFloaterWindLightSend::instance();
900 WLFloaterWindLightSend::instance()->open();
901 }
877 else 902 else
878 { 903 {
879 // check to see if it's a default and shouldn't be overwritten 904 // check to see if it's a default and shouldn't be overwritten
@@ -1046,6 +1071,35 @@ void LLFloaterWindLight::onCloudScrollYMoved(LLUICtrl* ctrl, void* userData)
1046 // *HACK all cloud scrolling is off by an additive of 10. 1071 // *HACK all cloud scrolling is off by an additive of 10.
1047 LLWLParamManager::instance()->mCurParams.setCloudScrollY(sldrCtrl->getValueF32() + 10.0f); 1072 LLWLParamManager::instance()->mCurParams.setCloudScrollY(sldrCtrl->getValueF32() + 10.0f);
1048} 1073}
1074void LLFloaterWindLight::onCloudDrawToggled(LLUICtrl* ctrl, void* userData)
1075{
1076 LLCheckBoxCtrl* cbCtrl = static_cast<LLCheckBoxCtrl*>(ctrl);
1077
1078 bool lock = cbCtrl->get();
1079 gHippoLimits->skyUseClassicClouds = lock;
1080
1081 LLWorld::getInstance()->rebuildClouds(gAgent.getRegion());
1082}
1083
1084void LLFloaterWindLight::onCloudHeightMoved(LLUICtrl* ctrl, void* userData)
1085{
1086 deactivateAnimator();
1087
1088 LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
1089
1090 gSavedSettings.setF32("ClassicCloudHeight", sldrCtrl->getValueF32());
1091
1092 LLWorld::getInstance()->rebuildClouds(gAgent.getRegion());
1093}
1094
1095void LLFloaterWindLight::onCloudRangeMoved(LLUICtrl* ctrl, void* userData)
1096{
1097 deactivateAnimator();
1098
1099 LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
1100
1101 gSavedSettings.setF32("ClassicCloudRange", sldrCtrl->getValueF32());
1102}
1049 1103
1050void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) 1104void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData)
1051{ 1105{
diff --git a/linden/indra/newview/llfloaterwindlight.h b/linden/indra/newview/llfloaterwindlight.h
index b9e5311..24b0e87 100644
--- a/linden/indra/newview/llfloaterwindlight.h
+++ b/linden/indra/newview/llfloaterwindlight.h
@@ -118,6 +118,10 @@ public:
118 static void onCloudScrollXToggled(LLUICtrl* ctrl, void* userData); 118 static void onCloudScrollXToggled(LLUICtrl* ctrl, void* userData);
119 static void onCloudScrollYToggled(LLUICtrl* ctrl, void* userData); 119 static void onCloudScrollYToggled(LLUICtrl* ctrl, void* userData);
120 120
121 static void onCloudDrawToggled(LLUICtrl* ctrl, void* userData);
122 static void onCloudHeightMoved(LLUICtrl* ctrl, void* userData);
123 static void onCloudRangeMoved(LLUICtrl* ctrl, void* userData);
124
121 //// menu management 125 //// menu management
122 126
123 /// show off our menu 127 /// show off our menu
diff --git a/linden/indra/newview/llhomelocationresponder.cpp b/linden/indra/newview/llhomelocationresponder.cpp
index 3ef58e7..e609237 100644
--- a/linden/indra/newview/llhomelocationresponder.cpp
+++ b/linden/indra/newview/llhomelocationresponder.cpp
@@ -100,6 +100,8 @@ void LLHomeLocationResponder::result( const LLSD& content )
100 100
101 LLViewerRegion *viewer_region = gAgent.getRegion(); 101 LLViewerRegion *viewer_region = gAgent.getRegion();
102 gAgent.setHomePosRegion( viewer_region->getHandle(), agent_pos ); 102 gAgent.setHomePosRegion( viewer_region->getHandle(), agent_pos );
103 gAgent.takeHomeScreenshot();
104
103 } 105 }
104} 106}
105 107
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp
index 01fe6f8..aada658 100644
--- a/linden/indra/newview/llmaniptranslate.cpp
+++ b/linden/indra/newview/llmaniptranslate.cpp
@@ -533,7 +533,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
533 { 533 {
534 F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance"); 534 F32 max_drag_distance = gSavedSettings.getF32("MaxDragDistance");
535 535
536 if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance) 536 if(max_drag_distance < gHippoLimits->getMaxDragDistance()) max_drag_distance = gHippoLimits->getMaxDragDistance(); //Take the more restrictive if (relative_move.magVecSquared() > max_drag_distance * max_drag_distance)
537 { 537 {
538 lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (too far)" << llendl; 538 lldebugst(LLERR_USER_INPUT) << "hover handled by LLManipTranslate (too far)" << llendl;
539 gViewerWindow->setCursor(UI_CURSOR_NOLOCKED); 539 gViewerWindow->setCursor(UI_CURSOR_NOLOCKED);
diff --git a/linden/indra/newview/llprefschat.cpp b/linden/indra/newview/llprefschat.cpp
index 6ebc880..8d704d5 100644
--- a/linden/indra/newview/llprefschat.cpp
+++ b/linden/indra/newview/llprefschat.cpp
@@ -72,6 +72,7 @@ private:
72 BOOL mShowTimestamps; 72 BOOL mShowTimestamps;
73 BOOL mPlayTypingAnim; 73 BOOL mPlayTypingAnim;
74 BOOL mChatBubbles; 74 BOOL mChatBubbles;
75 BOOL mLocalChatBubbles;
75 BOOL mScriptErrorAsChat; 76 BOOL mScriptErrorAsChat;
76 BOOL mChatChannel; 77 BOOL mChatChannel;
77 F32 mConsoleOpacity; 78 F32 mConsoleOpacity;
@@ -106,6 +107,7 @@ LLPrefsChatImpl::LLPrefsChatImpl()
106 childSetValue("script_errors_as_chat", gSavedSettings.getBOOL("ScriptErrorsAsChat")); 107 childSetValue("script_errors_as_chat", gSavedSettings.getBOOL("ScriptErrorsAsChat"));
107 108
108 childSetValue("bubble_text_chat", gSavedSettings.getBOOL("UseChatBubbles")); 109 childSetValue("bubble_text_chat", gSavedSettings.getBOOL("UseChatBubbles"));
110 childSetValue("local_bubble_text_chat", gSavedSettings.getBOOL("UseLocalChatWithBubbles"));
109 childSetValue("chat_full_width_check", gSavedSettings.getBOOL("ChatFullWidth")); 111 childSetValue("chat_full_width_check", gSavedSettings.getBOOL("ChatFullWidth"));
110 childSetValue("close_chat_on_return_check", gSavedSettings.getBOOL("CloseChatOnReturn")); 112 childSetValue("close_chat_on_return_check", gSavedSettings.getBOOL("CloseChatOnReturn"));
111 childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim")); 113 childSetValue("play_typing_animation", gSavedSettings.getBOOL("PlayTypingAnim"));
@@ -135,6 +137,7 @@ void LLPrefsChatImpl::refreshValues()
135 mShowTimestamps = gSavedSettings.getBOOL("ChatShowTimestamps"); 137 mShowTimestamps = gSavedSettings.getBOOL("ChatShowTimestamps");
136 mScriptErrorAsChat = gSavedSettings.getBOOL("ScriptErrorsAsChat"); 138 mScriptErrorAsChat = gSavedSettings.getBOOL("ScriptErrorsAsChat");
137 mChatBubbles = gSavedSettings.getBOOL("UseChatBubbles"); 139 mChatBubbles = gSavedSettings.getBOOL("UseChatBubbles");
140 mLocalChatBubbles = gSavedSettings.getBOOL("UseLocalChatWithBubbles");
138 mChatFullWidth = gSavedSettings.getBOOL("ChatFullWidth"); 141 mChatFullWidth = gSavedSettings.getBOOL("ChatFullWidth");
139 mCloseChatOnReturn = gSavedSettings.getBOOL("CloseChatOnReturn"); 142 mCloseChatOnReturn = gSavedSettings.getBOOL("CloseChatOnReturn");
140 mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim"); 143 mPlayTypingAnim = gSavedSettings.getBOOL("PlayTypingAnim");
@@ -164,6 +167,7 @@ void LLPrefsChatImpl::cancel()
164 gSavedSettings.setBOOL("ChatShowTimestamps", mShowTimestamps); 167 gSavedSettings.setBOOL("ChatShowTimestamps", mShowTimestamps);
165 gSavedSettings.setBOOL("ScriptErrorsAsChat", mScriptErrorAsChat); 168 gSavedSettings.setBOOL("ScriptErrorsAsChat", mScriptErrorAsChat);
166 gSavedSettings.setBOOL("UseChatBubbles", mChatBubbles); 169 gSavedSettings.setBOOL("UseChatBubbles", mChatBubbles);
170 gSavedSettings.setBOOL("UseLocalChatWithBubbles", mLocalChatBubbles);
167 gSavedSettings.setBOOL("ChatFullWidth", mChatFullWidth); 171 gSavedSettings.setBOOL("ChatFullWidth", mChatFullWidth);
168 gSavedSettings.setBOOL("CloseChatOnReturn", mCloseChatOnReturn); 172 gSavedSettings.setBOOL("CloseChatOnReturn", mCloseChatOnReturn);
169 gSavedSettings.setBOOL("PlayTypingAnim", mPlayTypingAnim); 173 gSavedSettings.setBOOL("PlayTypingAnim", mPlayTypingAnim);
@@ -196,6 +200,7 @@ void LLPrefsChatImpl::apply()
196 gSavedSettings.setBOOL("ChatShowTimestamps", childGetValue("show_timestamps_check")); 200 gSavedSettings.setBOOL("ChatShowTimestamps", childGetValue("show_timestamps_check"));
197 gSavedSettings.setBOOL("ScriptErrorsAsChat", childGetValue("script_errors_as_chat")); 201 gSavedSettings.setBOOL("ScriptErrorsAsChat", childGetValue("script_errors_as_chat"));
198 gSavedSettings.setBOOL("UseChatBubbles", childGetValue("bubble_text_chat")); 202 gSavedSettings.setBOOL("UseChatBubbles", childGetValue("bubble_text_chat"));
203 gSavedSettings.setBOOL("UseLocalChatWithBubbles", childGetValue("local_bubble_text_chat"));
199 gSavedSettings.setBOOL("ChatFullWidth", childGetValue("chat_full_width_check")); 204 gSavedSettings.setBOOL("ChatFullWidth", childGetValue("chat_full_width_check"));
200 gSavedSettings.setBOOL("CloseChatOnReturn", childGetValue("close_chat_on_return_check")); 205 gSavedSettings.setBOOL("CloseChatOnReturn", childGetValue("close_chat_on_return_check"));
201 gSavedSettings.setBOOL("PlayTypingAnim", childGetValue("play_typing_animation")); 206 gSavedSettings.setBOOL("PlayTypingAnim", childGetValue("play_typing_animation"));
diff --git a/linden/indra/newview/llsurface.cpp b/linden/indra/newview/llsurface.cpp
index caaba05..d736fb0 100644
--- a/linden/indra/newview/llsurface.cpp
+++ b/linden/indra/newview/llsurface.cpp
@@ -59,6 +59,7 @@
59#include "llglheaders.h" 59#include "llglheaders.h"
60#include "lldrawpoolterrain.h" 60#include "lldrawpoolterrain.h"
61#include "lldrawable.h" 61#include "lldrawable.h"
62#include "hippolimits.h"
62 63
63extern LLPipeline gPipeline; 64extern LLPipeline gPipeline;
64 65
@@ -295,7 +296,7 @@ void LLSurface::initTextures()
295 // 296 //
296 // Water texture 297 // Water texture
297 // 298 //
298 if (gSavedSettings.getBOOL("RenderWater") ) 299 if (gSavedSettings.getBOOL("RenderWater") && gHippoLimits->mRenderWater)
299 { 300 {
300 createWaterTexture(); 301 createWaterTexture();
301 mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); 302 mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
@@ -306,6 +307,29 @@ void LLSurface::initTextures()
306 } 307 }
307} 308}
308 309
310//static
311void LLSurface::rebuildWater()
312{
313 //lldebugs << "Rebuilding Water...";
314 if(!mWaterObjp.isNull())
315 {
316 //lldebugs << "Removing Water";
317 //Remove the old
318 gObjectList.killObject(mWaterObjp);
319 }
320
321 if (gSavedSettings.getBOOL("RenderWater") && gHippoLimits->mRenderWater)
322 {
323 //lldebugs << "Building Water";
324 createWaterTexture();
325 mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp);
326 gPipeline.createObject(mWaterObjp);
327 LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle());
328 water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT);
329 mWaterObjp->setPositionGlobal(water_pos_global);
330 }
331 //lldebugs << "Rebuilding Water Complete";
332}
309 333
310void LLSurface::setOriginGlobal(const LLVector3d &origin_global) 334void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
311{ 335{
diff --git a/linden/indra/newview/llsurface.h b/linden/indra/newview/llsurface.h
index 003b2f2..c217b19 100644
--- a/linden/indra/newview/llsurface.h
+++ b/linden/indra/newview/llsurface.h
@@ -91,6 +91,8 @@ public:
91 void disconnectNeighbor(LLSurface *neighborp); 91 void disconnectNeighbor(LLSurface *neighborp);
92 void disconnectAllNeighbors(); 92 void disconnectAllNeighbors();
93 93
94 void rebuildWater(); //Destroys (if nesessary) and then rebuilds (if needed)
95
94 virtual void decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL b_large_patch); 96 virtual void decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL b_large_patch);
95 virtual void updatePatchVisibilities(LLAgent &agent); 97 virtual void updatePatchVisibilities(LLAgent &agent);
96 98
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp
index 2bc6e3e..4e133de 100644
--- a/linden/indra/newview/lltooldraganddrop.cpp
+++ b/linden/indra/newview/lltooldraganddrop.cpp
@@ -75,6 +75,7 @@
75// [RLVa:KB] 75// [RLVa:KB]
76#include "rlvhandler.h" 76#include "rlvhandler.h"
77// [/RLVa:KB] 77// [/RLVa:KB]
78#include "hippoLimits.h"
78 79
79// MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES 80// MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES
80// or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a 81// or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a
@@ -1679,8 +1680,10 @@ void LLToolDragAndDrop::giveInventoryCategory(const LLUUID& to_agent,
1679 LLNotifications::instance().add("IncompleteInventory"); 1680 LLNotifications::instance().add("IncompleteInventory");
1680 return; 1681 return;
1681 } 1682 }
1683
1682 count = items.count() + cats.count(); 1684 count = items.count() + cats.count();
1683 if(count > MAX_ITEMS) 1685 if(count > gHippoLimits->getMaxInventoryItemsTransfer() &&
1686 gHippoLimits->getMaxInventoryItemsTransfer() != -1) //MAX_ITEMS)
1684 { 1687 {
1685 LLNotifications::instance().add("TooManyItems"); 1688 LLNotifications::instance().add("TooManyItems");
1686 return; 1689 return;
@@ -1776,8 +1779,9 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent,
1776 // MTUBYTES or 18 * count < 1200 => count < 1200/18 => 1779 // MTUBYTES or 18 * count < 1200 => count < 1200/18 =>
1777 // 66. I've cut it down a bit from there to give some pad. 1780 // 66. I've cut it down a bit from there to give some pad.
1778 S32 count = items.count() + cats.count(); 1781 S32 count = items.count() + cats.count();
1779 if(count > MAX_ITEMS) 1782 if(count > gHippoLimits->getMaxInventoryItemsTransfer() &&
1780 { 1783 gHippoLimits->getMaxInventoryItemsTransfer() != -1) //MAX_ITEMS)
1784 {
1781 LLNotifications::instance().add("TooManyItems"); 1785 LLNotifications::instance().add("TooManyItems");
1782 return; 1786 return;
1783 } 1787 }
diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp
index 78940cc..4167464 100644
--- a/linden/indra/newview/llviewerdisplay.cpp
+++ b/linden/indra/newview/llviewerdisplay.cpp
@@ -82,6 +82,7 @@
82#include "llwlparammanager.h" 82#include "llwlparammanager.h"
83#include "llwaterparammanager.h" 83#include "llwaterparammanager.h"
84#include "llpostprocess.h" 84#include "llpostprocess.h"
85#include "hippoLimits.h"
85 86
86// [RLVa:KB] 87// [RLVa:KB]
87#include "rlvhandler.h" 88#include "rlvhandler.h"
@@ -181,6 +182,12 @@ void display_update_camera()
181 { 182 {
182 final_far *= 0.5f; 183 final_far *= 0.5f;
183 } 184 }
185 if(gAgent.mLockedDrawDistance)
186 {
187 //Reset the draw distance and do not update with the new val
188 final_far = LLViewerCamera::getInstance()->getFar();
189 gAgent.mDrawDistance = final_far;
190 }
184 LLViewerCamera::getInstance()->setFar(final_far); 191 LLViewerCamera::getInstance()->setFar(final_far);
185 gViewerWindow->setup3DRender(); 192 gViewerWindow->setup3DRender();
186 193
@@ -305,13 +312,19 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
305 // Update GL Texture statistics (used for discard logic?) 312 // Update GL Texture statistics (used for discard logic?)
306 // 313 //
307 314
315
308 LLAppViewer::instance()->pingMainloopTimeout("Display:TextureStats"); 316 LLAppViewer::instance()->pingMainloopTimeout("Display:TextureStats");
309 gFrameStats.start(LLFrameStats::UPDATE_TEX_STATS); 317 gFrameStats.start(LLFrameStats::UPDATE_TEX_STATS);
310 stop_glerror(); 318 stop_glerror();
311 319
312 LLImageGL::updateStats(gFrameTimeSeconds); 320 LLImageGL::updateStats(gFrameTimeSeconds);
313 321
314 LLVOAvatar::sRenderName = gSavedSettings.getS32("RenderName"); 322 S32 RenderName = gSavedSettings.getS32("RenderName");
323
324 if(RenderName > gHippoLimits->mRenderName)//The most restricted gets set here
325 RenderName = gHippoLimits->mRenderName;
326
327 LLVOAvatar::sRenderName = RenderName;
315 LLVOAvatar::sRenderGroupTitles = !gSavedSettings.getBOOL("RenderHideGroupTitleAll"); 328 LLVOAvatar::sRenderGroupTitles = !gSavedSettings.getBOOL("RenderHideGroupTitleAll");
316 329
317 gPipeline.mBackfaceCull = TRUE; 330 gPipeline.mBackfaceCull = TRUE;
@@ -835,6 +848,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
835 //} 848 //}
836 849
837 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; 850 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE;
851
852 //Check for RenderWater
853 if (!gSavedSettings.getBOOL("RenderWater") || !gHippoLimits->mRenderWater)
854 LLPipeline::sUnderWaterRender = FALSE;
855
838 LLPipeline::updateRenderDeferred(); 856 LLPipeline::updateRenderDeferred();
839 857
840 stop_glerror(); 858 stop_glerror();
diff --git a/linden/indra/newview/llviewerinventory.cpp b/linden/indra/newview/llviewerinventory.cpp
index 33113f1..0e06353 100644
--- a/linden/indra/newview/llviewerinventory.cpp
+++ b/linden/indra/newview/llviewerinventory.cpp
@@ -268,7 +268,7 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
268 msg->addU32Fast(_PREHASH_Flags, mFlags); 268 msg->addU32Fast(_PREHASH_Flags, mFlags);
269 mSaleInfo.packMessage(msg); 269 mSaleInfo.packMessage(msg);
270 msg->addStringFast(_PREHASH_Name, mName); 270 msg->addStringFast(_PREHASH_Name, mName);
271 msg->addStringFast(_PREHASH_Description, mDescription); 271 msg->addStringFast(_PREHASH_Description, mDescription);
272 msg->addS32Fast(_PREHASH_CreationDate, mCreationDate); 272 msg->addS32Fast(_PREHASH_CreationDate, mCreationDate);
273 U32 crc = getCRC32(); 273 U32 crc = getCRC32();
274 msg->addU32Fast(_PREHASH_CRC, crc); 274 msg->addU32Fast(_PREHASH_CRC, crc);
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index d3ca5f6..9e7b166 100755
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp
@@ -152,6 +152,7 @@
152 152
153#include "hippoGridManager.h" 153#include "hippoGridManager.h"
154#include "hippoLimits.h" 154#include "hippoLimits.h"
155#include "wlsettingsmanager.h"
155 156
156#if LL_WINDOWS // For Windows specific error handler 157#if LL_WINDOWS // For Windows specific error handler
157#include "llwindebug.h" // For the invalid message handler 158#include "llwindebug.h" // For the invalid message handler
@@ -3116,8 +3117,17 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
3116 3117
3117 if (!is_muted && !is_busy) 3118 if (!is_muted && !is_busy)
3118 { 3119 {
3119 static BOOL* sUseChatBubbles = rebind_llcontrol<BOOL>("UseChatBubbles", &gSavedSettings, true); 3120
3120 visible_in_chat_bubble = *sUseChatBubbles; 3121 BOOL sUseChatBubbles = gSavedSettings.getBOOL("UseChatBubbles");
3122 if(sUseChatBubbles)
3123 {
3124 BOOL localChat = gSavedSettings.getBOOL("UseLocalChatWithBubbles");
3125 if(localChat)
3126 sUseChatBubbles = FALSE; //Act like they arn't enabled and show it anyway
3127 }
3128 //Update..
3129 visible_in_chat_bubble = sUseChatBubbles;
3130
3121 ((LLVOAvatar*)chatter)->addChat(chat); 3131 ((LLVOAvatar*)chatter)->addChat(chat);
3122 } 3132 }
3123 } 3133 }
@@ -3569,6 +3579,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)
3569 3579
3570 // Tell the LightShare handler that we have changed regions. 3580 // Tell the LightShare handler that we have changed regions.
3571 WindlightMessage::resetRegion(); 3581 WindlightMessage::resetRegion();
3582 WLSettingsManager::wlresetRegion();
3572} 3583}
3573 3584
3574// stuff we have to do every time we get an AvatarInitComplete from a sim 3585// stuff we have to do every time we get an AvatarInitComplete from a sim
@@ -3835,6 +3846,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)
3835 3846
3836 // Tell the LightShare handler that we have changed regions. 3847 // Tell the LightShare handler that we have changed regions.
3837 WindlightMessage::resetRegion(); 3848 WindlightMessage::resetRegion();
3849 WLSettingsManager::wlresetRegion();
3838} 3850}
3839 3851
3840 3852
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp
index 4fd3bfb..b63914c 100644
--- a/linden/indra/newview/llviewerregion.cpp
+++ b/linden/indra/newview/llviewerregion.cpp
@@ -452,6 +452,12 @@ void LLViewerRegion::setWaterHeight(F32 water_level)
452 mLandp->setWaterHeight(water_level); 452 mLandp->setWaterHeight(water_level);
453} 453}
454 454
455
456void LLViewerRegion::rebuildWater()
457{
458 mLandp->rebuildWater();
459}
460
455F32 LLViewerRegion::getWaterHeight() const 461F32 LLViewerRegion::getWaterHeight() const
456{ 462{
457 return mLandp->getWaterHeight(); 463 return mLandp->getWaterHeight();
@@ -1416,7 +1422,9 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1416 LLSD capabilityNames = LLSD::emptyArray(); 1422 LLSD capabilityNames = LLSD::emptyArray();
1417 capabilityNames.append("ChatSessionRequest"); 1423 capabilityNames.append("ChatSessionRequest");
1418 capabilityNames.append("CopyInventoryFromNotecard"); 1424 capabilityNames.append("CopyInventoryFromNotecard");
1425 capabilityNames.append("DispatchOpenRegionSettings");
1419 capabilityNames.append("DispatchRegionInfo"); 1426 capabilityNames.append("DispatchRegionInfo");
1427 capabilityNames.append("DispatchWindLightSettings");
1420 capabilityNames.append("EstateChangeInfo"); 1428 capabilityNames.append("EstateChangeInfo");
1421 capabilityNames.append("EventQueueGet"); 1429 capabilityNames.append("EventQueueGet");
1422 capabilityNames.append("FetchInventory"); 1430 capabilityNames.append("FetchInventory");
@@ -1434,6 +1442,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
1434 capabilityNames.append("ProvisionVoiceAccountRequest"); 1442 capabilityNames.append("ProvisionVoiceAccountRequest");
1435 capabilityNames.append("RemoteParcelRequest"); 1443 capabilityNames.append("RemoteParcelRequest");
1436 capabilityNames.append("RequestTextureDownload"); 1444 capabilityNames.append("RequestTextureDownload");
1445 capabilityNames.append("RetrieveWindLightSettings");
1437 capabilityNames.append("SearchStatRequest"); 1446 capabilityNames.append("SearchStatRequest");
1438 capabilityNames.append("SearchStatTracking"); 1447 capabilityNames.append("SearchStatTracking");
1439 capabilityNames.append("SendPostcard"); 1448 capabilityNames.append("SendPostcard");
diff --git a/linden/indra/newview/llviewerregion.h b/linden/indra/newview/llviewerregion.h
index 09280a5..8cc80e3 100644
--- a/linden/indra/newview/llviewerregion.h
+++ b/linden/indra/newview/llviewerregion.h
@@ -132,6 +132,7 @@ public:
132 132
133 void setWaterHeight(F32 water_level); 133 void setWaterHeight(F32 water_level);
134 F32 getWaterHeight() const; 134 F32 getWaterHeight() const;
135 void rebuildWater();
135 136
136 BOOL isVoiceEnabled() const; 137 BOOL isVoiceEnabled() const;
137 138
@@ -315,10 +316,11 @@ public:
315 LLDynamicArray<U32> mMapAvatars; 316 LLDynamicArray<U32> mMapAvatars;
316 LLDynamicArray<LLUUID> mMapAvatarIDs; 317 LLDynamicArray<LLUUID> mMapAvatarIDs;
317 318
318private:
319 // The surfaces and other layers 319 // The surfaces and other layers
320 LLSurface* mLandp; 320 LLSurface* mLandp;
321 321
322private:
323
322 // Region geometry data 324 // Region geometry data
323 LLVector3d mOriginGlobal; // Location of southwest corner of region (meters) 325 LLVector3d mOriginGlobal; // Location of southwest corner of region (meters)
324 LLVector3d mCenterGlobal; // Location of center in world space (meters) 326 LLVector3d mCenterGlobal; // Location of center in world space (meters)
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 9937ed9..a20769e 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -94,7 +94,7 @@
94#include "boost/lexical_cast.hpp" 94#include "boost/lexical_cast.hpp"
95#endif 95#endif
96#include "hippoLimits.h"// getMaxPrimScale 96#include "hippoLimits.h"// getMaxPrimScale
97 97#include "llstartup.h"
98// [RLVa:KB] 98// [RLVa:KB]
99#include "rlvhandler.h" 99#include "rlvhandler.h"
100// [/RLVa:KB] 100// [/RLVa:KB]
@@ -3666,7 +3666,6 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
3666 } 3666 }
3667// [/RLVa:KB] 3667// [/RLVa:KB]
3668 3668
3669
3670 BOOL need_comma = FALSE; 3669 BOOL need_comma = FALSE;
3671 3670
3672 static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true); 3671 static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true);
diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h
index 50ce53a..548818d 100644
--- a/linden/indra/newview/llvoavatar.h
+++ b/linden/indra/newview/llvoavatar.h
@@ -148,6 +148,7 @@ public:
148 void clampAttachmentPositions(); 148 void clampAttachmentPositions();
149 S32 getAttachmentCount(); // Warning: order(N) not order(1) 149 S32 getAttachmentCount(); // Warning: order(N) not order(1)
150 150
151
151 // HUD functions 152 // HUD functions
152 BOOL hasHUDAttachment() const; 153 BOOL hasHUDAttachment() const;
153 LLBBox getHUDBBox() const; 154 LLBBox getHUDBBox() const;
diff --git a/linden/indra/newview/llwaterparammanager.cpp b/linden/indra/newview/llwaterparammanager.cpp
index e01506e..0156622 100644
--- a/linden/indra/newview/llwaterparammanager.cpp
+++ b/linden/indra/newview/llwaterparammanager.cpp
@@ -75,6 +75,7 @@
75#include "curl/curl.h" 75#include "curl/curl.h"
76 76
77LLWaterParamManager * LLWaterParamManager::sInstance = NULL; 77LLWaterParamManager * LLWaterParamManager::sInstance = NULL;
78LLFrameTimer waterSmoothTransitionTimer;
78 79
79LLWaterParamManager::LLWaterParamManager() : 80LLWaterParamManager::LLWaterParamManager() :
80 mFogColor(22.f/255.f, 43.f/255.f, 54.f/255.f, 0.0f, 0.0f, "waterFogColor", "WaterFogColor"), 81 mFogColor(22.f/255.f, 43.f/255.f, 54.f/255.f, 0.0f, 0.0f, "waterFogColor", "WaterFogColor"),
@@ -454,9 +455,44 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
454 shaders_iter->mUniformsDirty = TRUE; 455 shaders_iter->mUniformsDirty = TRUE;
455 } 456 }
456 } 457 }
458 //Mix windlight settings if needed
459 if(sNeedsMix == TRUE)
460 {
461 if(sMixSet == NULL)
462 {
463 sNeedsMix = FALSE;
464 return;
465 }
466 if (waterSmoothTransitionTimer.getElapsedTimeF32() >=
467 (sMixTime / 100)) //100 steps inbetween
468 {
469 waterSmoothTransitionTimer.reset();
470 mCurParams.mix(mCurParams, *sMixSet, sMixCount / 100);//.01 to 1.0
471 }
472 sMixCount++;
473 if((sMixCount / 100) == 1)
474 {
475 //All done
476 sNeedsMix = FALSE;
477 std::string wlWaterPresetName = "(Region settings)";
478 mCurParams.mName = wlWaterPresetName;
479 removeParamSet( wlWaterPresetName, true );
480 addParamSet( wlWaterPresetName, mCurParams );
481 savePreset( wlWaterPresetName );
482 loadPreset( wlWaterPresetName, true );
483 sMixSet = NULL;
484 }
485 }
457 } 486 }
458} 487}
459 488void LLWaterParamManager::SetMixTime(LLWaterParamSet *mixSet, F32 mixTime)
489{
490 waterSmoothTransitionTimer.reset();
491 sNeedsMix = TRUE;
492 sMixSet = mixSet;
493 sMixTime = mixTime;
494 sMixCount = 1;
495}
460// static 496// static
461void LLWaterParamManager::initClass(void) 497void LLWaterParamManager::initClass(void)
462{ 498{
diff --git a/linden/indra/newview/llwaterparammanager.h b/linden/indra/newview/llwaterparammanager.h
index 588e436..96dd1aa 100644
--- a/linden/indra/newview/llwaterparammanager.h
+++ b/linden/indra/newview/llwaterparammanager.h
@@ -304,6 +304,8 @@ public:
304 // singleton pattern implementation 304 // singleton pattern implementation
305 static LLWaterParamManager * instance(); 305 static LLWaterParamManager * instance();
306 306
307 void SetMixTime(LLWaterParamSet* mixSet, F32 mixTime);
308
307public: 309public:
308 310
309 LLWaterParamSet mCurParams; 311 LLWaterParamSet mCurParams;
@@ -334,6 +336,11 @@ private:
334 LLVector4 mWaterPlane; 336 LLVector4 mWaterPlane;
335 F32 mWaterFogKS; 337 F32 mWaterFogKS;
336 338
339 BOOL sNeedsMix;
340 LLWaterParamSet* sMixSet;
341 F32 sMixTime;
342 F32 sMixCount;
343
337 // our parameter manager singleton instance 344 // our parameter manager singleton instance
338 static LLWaterParamManager * sInstance; 345 static LLWaterParamManager * sInstance;
339 346
diff --git a/linden/indra/newview/llwaterparamset.cpp b/linden/indra/newview/llwaterparamset.cpp
index a26cced..4b2e426 100644
--- a/linden/indra/newview/llwaterparamset.cpp
+++ b/linden/indra/newview/llwaterparamset.cpp
@@ -229,4 +229,96 @@ F32 LLWaterParamSet::getFloat(const std::string& paramName, bool& error)
229 error = true; 229 error = true;
230 return 0; 230 return 0;
231} 231}
232void LLWaterParamSet::mix(LLWaterParamSet& src, LLWaterParamSet& dest, F32 weight)
233{
234 // set up the iterators
235 LLSD::map_iterator cIt = mParamValues.beginMap();
236
237 LLSD srcVal;
238 LLSD destVal;
239
240 // do the interpolation for all the ones saved as vectors
241 // skip the weird ones
242 for(; cIt != mParamValues.endMap(); cIt++) {
243
244 // check params to make sure they're actually there
245 if(src.mParamValues.has(cIt->first))
246 {
247 srcVal = src.mParamValues[cIt->first];
248 }
249 else
250 {
251 continue;
252 }
253
254 if(dest.mParamValues.has(cIt->first))
255 {
256 destVal = dest.mParamValues[cIt->first];
257 }
258 else
259 {
260 continue;
261 }
262
263 // skip if not a vector
264 if(!cIt->second.isArray())
265 {
266 continue;
267 }
268
269 // only Real vectors allowed
270 if(!cIt->second[0].isReal())
271 {
272 continue;
273 }
274
275 // make sure all the same size
276 if( cIt->second.size() != srcVal.size() ||
277 cIt->second.size() != destVal.size())
278 {
279 continue;
280 }
281
282 // more error checking might be necessary;
283
284 for(int i=0; i < cIt->second.size(); ++i)
285 {
286 cIt->second[i] = (1.0f - weight) * (F32) srcVal[i].asReal() +
287 weight * (F32) destVal[i].asReal();
288 }
289 }
290 mParamValues["waterFogColor"][0] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][0].asReal()
291 + weight * (F32) dest.mParamValues["waterFogColor"][0].asReal();
292 mParamValues["waterFogColor"][1] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][1].asReal()
293 + weight * (F32) dest.mParamValues["waterFogColor"][1].asReal();
294 mParamValues["waterFogColor"][2] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][2].asReal()
295 + weight * (F32) dest.mParamValues["waterFogColor"][2].asReal();
296 mParamValues["waterFogColor"][3] = (1 - weight) * (F32) src.mParamValues["waterFogColor"][3].asReal()
297 + weight * (F32) dest.mParamValues["waterFogColor"][3].asReal();
298
299 mParamValues["waterFogDensity"] = (1 - weight) * (F32) src.mParamValues["waterFogDensity"].asReal()
300 + weight * (F32) dest.mParamValues["waterFogDensity"].asReal();
301 mParamValues["underWaterFogMod"] = (1 - weight) * (F32) src.mParamValues["underWaterFogMod"].asReal()
302 + weight * (F32) dest.mParamValues["underWaterFogMod"].asReal();
303 mParamValues["fresnelScale"] = (1 - weight) * (F32) src.mParamValues["fresnelScale"].asReal()
304 + weight * (F32) dest.mParamValues["fresnelScale"].asReal();
305 mParamValues["fresnelOffset"] = (1 - weight) * (F32) src.mParamValues["fresnelOffset"].asReal()
306 + weight * (F32) dest.mParamValues["fresnelOffset"].asReal();
307 mParamValues["scaleAbove"] = (1 - weight) * (F32) src.mParamValues["scaleAbove"].asReal()
308 + weight * (F32) dest.mParamValues["scaleAbove"].asReal();
309 mParamValues["scaleBelow"] = (1 - weight) * (F32) src.mParamValues["scaleBelow"].asReal()
310 + weight * (F32) dest.mParamValues["scaleBelow"].asReal();
311 mParamValues["blurMultiplier"] = (1 - weight) * (F32) src.mParamValues["blurMultiplier"].asReal()
312 + weight * (F32) dest.mParamValues["blurMultiplier"].asReal();
313
314 mParamValues["wave2Dir"][0] = (1 - weight) * (F32) src.mParamValues["wave2Dir"][0].asReal()
315 + weight * (F32) dest.mParamValues["wave2Dir"][0].asReal();
316 mParamValues["wave2Dir"][1] = (1 - weight) * (F32) src.mParamValues["wave2Dir"][1].asReal()
317 + weight * (F32) dest.mParamValues["wave2Dir"][1].asReal();
318
319 mParamValues["wave1Dir"][0] = (1 - weight) * (F32) src.mParamValues["wave1Dir"][0].asReal()
320 + weight * (F32) dest.mParamValues["wave1Dir"][0].asReal();
321 mParamValues["wave1Dir"][1] = (1 - weight) * (F32) src.mParamValues["wave1Dir"][1].asReal()
322 + weight * (F32) dest.mParamValues["wave1Dir"][1].asReal();
323}
232 324
diff --git a/linden/indra/newview/llwlparammanager.cpp b/linden/indra/newview/llwlparammanager.cpp
index 31471d7..8007cce 100644
--- a/linden/indra/newview/llwlparammanager.cpp
+++ b/linden/indra/newview/llwlparammanager.cpp
@@ -71,11 +71,13 @@
71#include "llviewerinventory.h" 71#include "llviewerinventory.h"
72#include "llviewerregion.h" 72#include "llviewerregion.h"
73#include "llassetuploadresponders.h" 73#include "llassetuploadresponders.h"
74#include "llframetimer.h"
74 75
75#include "curl/curl.h" 76#include "curl/curl.h"
76 77
77LLWLParamManager * LLWLParamManager::sInstance = NULL; 78LLWLParamManager * LLWLParamManager::sInstance = NULL;
78std::vector<LLWLPresetsObserver*> LLWLParamManager::sObservers; 79std::vector<LLWLPresetsObserver*> LLWLParamManager::sObservers;
80LLFrameTimer wlSmoothTransitionTimer;
79 81
80LLWLParamManager::LLWLParamManager() : 82LLWLParamManager::LLWLParamManager() :
81 83
@@ -562,6 +564,46 @@ void LLWLParamManager::update(LLViewerCamera * cam)
562 } 564 }
563 } 565 }
564 } 566 }
567
568 //Mix windlight settings if needed
569 if(sNeedsMix == TRUE)
570 {
571 if(sMixSet == NULL)
572 {
573 sNeedsMix = FALSE;
574 return;
575 }
576 if (wlSmoothTransitionTimer.getElapsedTimeF32() >=
577 (sMixTime / 100)) //100 steps inbetween
578 {
579 wlSmoothTransitionTimer.reset();
580 mCurParams.mix(mCurParams, *sMixSet, sMixCount / 100);//.01 to 1.0
581 }
582 sMixCount++;
583 if((sMixCount / 100) == 1)
584 {
585 //All done
586 sNeedsMix = FALSE;
587 std::string wlSkyPresetName = "(Region settings)";
588 mCurParams.mName = wlSkyPresetName;
589 removeParamSet( wlSkyPresetName, true );
590 addParamSet( wlSkyPresetName, mCurParams );
591 savePreset( wlSkyPresetName );
592 mAnimator.mIsRunning = false;
593 mAnimator.mUseLindenTime = false;
594 loadPreset( wlSkyPresetName, true );
595 sMixSet = NULL;
596 }
597 }
598}
599
600void LLWLParamManager::SetMixTime(LLWLParamSet *mixSet, F32 mixTime)
601{
602 wlSmoothTransitionTimer.reset();
603 sNeedsMix = TRUE;
604 sMixSet = mixSet;
605 sMixTime = mixTime;
606 sMixCount = 1;
565} 607}
566 608
567// static 609// static
diff --git a/linden/indra/newview/llwlparammanager.h b/linden/indra/newview/llwlparammanager.h
index 612a507..fc1127e 100644
--- a/linden/indra/newview/llwlparammanager.h
+++ b/linden/indra/newview/llwlparammanager.h
@@ -221,6 +221,8 @@ public:
221 static void removeObserver(LLWLPresetsObserver* observer); 221 static void removeObserver(LLWLPresetsObserver* observer);
222 static void notifyObservers(); 222 static void notifyObservers();
223 223
224 void SetMixTime(LLWLParamSet* mixSet, F32 mixTime);
225
224public: 226public:
225 227
226 // helper variables 228 // helper variables
@@ -280,6 +282,11 @@ public:
280private: 282private:
281 // our parameter manager singleton instance 283 // our parameter manager singleton instance
282 static LLWLParamManager * sInstance; 284 static LLWLParamManager * sInstance;
285
286 BOOL sNeedsMix;
287 LLWLParamSet* sMixSet;
288 F32 sMixTime;
289 F32 sMixCount;
283 290
284 static std::vector<LLWLPresetsObserver*> sObservers; 291 static std::vector<LLWLPresetsObserver*> sObservers;
285 292
diff --git a/linden/indra/newview/llwlparamset.cpp b/linden/indra/newview/llwlparamset.cpp
index ea9c00a..19528eb 100644
--- a/linden/indra/newview/llwlparamset.cpp
+++ b/linden/indra/newview/llwlparamset.cpp
@@ -145,6 +145,11 @@ void LLWLParamSet::set(const std::string& paramName, float x)
145 { 145 {
146 mParamValues[paramName][0] = x; 146 mParamValues[paramName][0] = x;
147 } 147 }
148 else
149 {
150 //Default this
151 mParamValues[paramName] = x;
152 }
148} 153}
149 154
150void LLWLParamSet::set(const std::string& paramName, float x, float y) { 155void LLWLParamSet::set(const std::string& paramName, float x, float y) {
diff --git a/linden/indra/newview/llworld.cpp b/linden/indra/newview/llworld.cpp
index ca8ce2d..c484462 100644
--- a/linden/indra/newview/llworld.cpp
+++ b/linden/indra/newview/llworld.cpp
@@ -669,7 +669,8 @@ void LLWorld::updateClouds(const F32 dt)
669{ 669{
670 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true); 670 static BOOL* sFreezeTime = rebind_llcontrol<BOOL>("FreezeTime", &gSavedSettings, true);
671 if ((*sFreezeTime) || 671 if ((*sFreezeTime) ||
672 !gSavedSettings.getBOOL("SkyUseClassicClouds")) 672 !gSavedSettings.getBOOL("SkyUseClassicClouds") ||
673 !gHippoLimits->skyUseClassicClouds)
673 { 674 {
674 // don't move clouds in snapshot mode 675 // don't move clouds in snapshot mode
675 return; 676 return;
@@ -830,6 +831,14 @@ void LLWorld::setLandFarClip(const F32 far_clip)
830 } 831 }
831} 832}
832 833
834void LLWorld::rebuildClouds(LLViewerRegion *regionp)
835{
836 regionp->mCloudLayer.destroy();
837 regionp->mCloudLayer.create(regionp);
838 regionp->mCloudLayer.setWidth((F32)mWidth);
839 regionp->mCloudLayer.setWindPointer(&regionp->mWind);
840}
841
833// Some region that we're connected to, but not the one we're in, gave us 842// Some region that we're connected to, but not the one we're in, gave us
834// a (possibly) new water height. Update it in our local copy. 843// a (possibly) new water height. Update it in our local copy.
835void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_height) 844void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_height)
diff --git a/linden/indra/newview/llworld.h b/linden/indra/newview/llworld.h
index 2c5815c..964729d 100644
--- a/linden/indra/newview/llworld.h
+++ b/linden/indra/newview/llworld.h
@@ -150,6 +150,8 @@ public:
150 150
151 void getInfo(LLSD& info); 151 void getInfo(LLSD& info);
152 152
153 void rebuildClouds(LLViewerRegion *regionp);
154
153public: 155public:
154 typedef std::list<LLViewerRegion*> region_list_t; 156 typedef std::list<LLViewerRegion*> region_list_t;
155 const region_list_t& getRegionList() const { return mActiveRegionList; } 157 const region_list_t& getRegionList() const { return mActiveRegionList; }
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index cf766e0..2932865 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -101,6 +101,7 @@
101#include "llwaterparammanager.h" 101#include "llwaterparammanager.h"
102#include "llspatialpartition.h" 102#include "llspatialpartition.h"
103#include "llmutelist.h" 103#include "llmutelist.h"
104#include "hippolimits.h"
104 105
105// [RLVa:KB] 106// [RLVa:KB]
106#include "rlvhandler.h" 107#include "rlvhandler.h"
@@ -5980,6 +5981,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
5980 stop_glerror(); 5981 stop_glerror();
5981 5982
5982 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE; 5983 LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE;
5984
5985 if (!gSavedSettings.getBOOL("RenderWater") || !gHippoLimits->mRenderWater)
5986 LLPipeline::sUnderWaterRender = FALSE;
5983 5987
5984 if (LLPipeline::sUnderWaterRender) 5988 if (LLPipeline::sUnderWaterRender)
5985 { 5989 {
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml b/linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml
index 0e5a642..cd88c2e 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_avatar_picker.xml
@@ -58,7 +58,7 @@
58 font="SansSerif" mouse_opaque="true" name="Refresh" scale_image="TRUE" /> 58 font="SansSerif" mouse_opaque="true" name="Refresh" scale_image="TRUE" />
59 <slider bottom_delta="-20" left="10" follows="left|top" width="175" height="15" 59 <slider bottom_delta="-20" left="10" follows="left|top" width="175" height="15"
60 name="near_me_range" label="Range" control_name="NearMeRange" 60 name="near_me_range" label="Range" control_name="NearMeRange"
61 min_val="5" max_val="40" increment="1" initial_val="20" decimal_digits="0" /> 61 min_val="5" max_val="512" increment="1" initial_val="20" decimal_digits="0" />
62 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 62 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
63 bottom_delta="0" left="185" drop_shadow_visible="true" follows="left|top" 63 bottom_delta="0" left="185" drop_shadow_visible="true" follows="left|top"
64 font="SansSerifSmall" h_pad="0" halign="left" height="15" 64 font="SansSerifSmall" h_pad="0" halign="left" height="15"
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_env_settings.xml b/linden/indra/newview/skins/default/xui/en-us/floater_env_settings.xml
index e2bafbf..0a4f2a9 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_env_settings.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_env_settings.xml
@@ -58,9 +58,11 @@
58 <button bottom="-140" follows="left|top" font="SansSerifSmall" height="20" 58 <button bottom="-140" follows="left|top" font="SansSerifSmall" height="20"
59 label="Use Estate Time" left="8" name="EnvUseEstateTimeButton" width="137" /> 59 label="Use Estate Time" left="8" name="EnvUseEstateTimeButton" width="137" />
60 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="20" 60 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="20"
61 label="Advanced Sky" left="154" name="EnvAdvancedSkyButton" width="137" /> 61 label="Advanced Sky" left="154" name="EnvAdvancedSkyButton" width="107" />
62 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="20" 62 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="20"
63 label="Advanced Water" left="300" name="EnvAdvancedWaterButton" width="137" /> 63 label="Advanced Water" left="270" name="EnvAdvancedWaterButton" width="137" />
64 <button bottom="-40" follows="left|top" font="SansSerif" height="18" label="?" 64 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="20"
65 label="Advanced WindLight Manager" left="416" name="EnvWLManager" width="177" />
66 <button bottom="-40" follows="left|top" font="SansSerif" height="18" label="?"
65 left="570" name="EnvSettingsHelpButton" width="22" /> 67 left="570" name="EnvSettingsHelpButton" width="22" />
66</floater> 68</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml b/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml
index 82a65b8..0175508 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml
@@ -5,7 +5,7 @@
5 embedded_items="false" enabled="true" follows="left|top|right|bottom" 5 embedded_items="false" enabled="true" follows="left|top|right|bottom"
6 font="Monospace" height="376" ignore_tab="false" left="4" 6 font="Monospace" height="376" ignore_tab="false" left="4"
7 max_length="65536" mouse_opaque="true" name="Script Editor" width="492" border_drop_shadow_visible="false" border_visible="false" bevel_style="none" border_style="line" border_thickness="0" 7 max_length="65536" mouse_opaque="true" name="Script Editor" width="492" border_drop_shadow_visible="false" border_visible="false" bevel_style="none" border_style="line" border_thickness="0"
8 word_wrap="true" show_line_numbers="true"> 8 word_wrap="true" show_line_numbers="true" spell_check="false">
9 Loading... 9 Loading...
10 </text_editor> 10 </text_editor>
11 <button bottom="-499" enabled="true" follows="right|bottom" font="SansSerif" 11 <button bottom="-499" enabled="true" follows="right|bottom" font="SansSerif"
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tos.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tos.xml
index 485cfcc..beea02f 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_tos.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_tos.xml
@@ -15,15 +15,14 @@
15 bottom="-50" drop_shadow_visible="true" follows="left|top" font="SansSerif" 15 bottom="-50" drop_shadow_visible="true" follows="left|top" font="SansSerif"
16 h_pad="0" halign="left" height="30" left="16" mouse_opaque="true" 16 h_pad="0" halign="left" height="30" left="16" mouse_opaque="true"
17 name="tos_heading" v_pad="0" width="552"> 17 name="tos_heading" v_pad="0" width="552">
18 Please read the following Terms of Service carefully. To continue logging in to Second Life, 18 Please read the following Terms of Service carefully. To continue logging in you must accept the agreement.
19you must accept the agreement.
20 </text> 19 </text>
21 <text_editor bottom="-376" embedded_items="false" follows="left|top" font="SansSerif" 20 <text_editor bottom="-376" embedded_items="false" follows="left|top" font="SansSerif"
22 height="283" left="16" max_length="65536" mouse_opaque="true" 21 height="283" left="16" max_length="65536" mouse_opaque="true"
23 name="tos_text" width="568" 22 name="tos_text" width="568"
24 word_wrap="true"> 23 word_wrap="true">
25 TOS_TEXT 24 TOS_TEXT
26 </text_editor> 25 </text_editor>
27 <!-- Loading text says: "Loading Terms of Service..." URL encoded --> 26 <!-- Loading text says: "Loading Terms of Service..." URL encoded -->
28 <web_browser bottom="-406" embedded_items="false" follows="left|top" font="SansSerif" 27 <web_browser bottom="-406" embedded_items="false" follows="left|top" font="SansSerif"
29 height="340" left="16" max_length="65536" mouse_opaque="true" 28 height="340" left="16" max_length="65536" mouse_opaque="true"
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_water.xml b/linden/indra/newview/skins/default/xui/en-us/floater_water.xml
index 441ce7b..a05deb6 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_water.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_water.xml
@@ -1,273 +1,276 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-150" can_close="true" can_drag_on_left="false" can_minimize="true" 2<floater bottom="-150" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" height="240" left="50" min_height="200" 3 can_resize="false" height="240" left="50" min_height="200"
4 min_width="400" mouse_opaque="true" name="Water Floater" 4 min_width="400" mouse_opaque="true" name="Water Floater"
5 rect_control="FloaterAdvancedWaterRect" title="Advanced Water Editor" 5 rect_control="FloaterAdvancedWaterRect" title="Advanced Water Editor"
6 width="700"> 6 width="700">
7 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 7 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
8 bottom="-50" drop_shadow_visible="true" follows="left|top|right" 8 bottom="-50" drop_shadow_visible="true" follows="left|top|right"
9 font="SansSerif" h_pad="0" halign="left" height="16" 9 font="SansSerif" h_pad="0" halign="left" height="16"
10 left="10" mouse_opaque="true" name="KeyFramePresetsText" v_pad="0" 10 left="10" mouse_opaque="true" name="KeyFramePresetsText" v_pad="0"
11 width="110"> 11 width="110">
12 Water Presets: 12 Water Presets:
13 </text> 13 </text>
14 <combo_box allow_text_entry="false" bottom="-52" follows="left|top" height="18" 14 <combo_box allow_text_entry="false" bottom="-52" follows="left|top" height="18"
15 left_delta="120" max_chars="20" mouse_opaque="true" 15 left_delta="120" max_chars="20" mouse_opaque="true"
16 name="WaterPresetsCombo" width="150" /> 16 name="WaterPresetsCombo" width="150" />
17 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" 17 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
18 label="" label_selected="" left_delta="-25" image_overlay="arrow_left.tga" 18 label="" label_selected="" left_delta="-25" image_overlay="arrow_left.tga"
19 mouse_opaque="true" name="prev" scale_image="true" width="20" /> 19 mouse_opaque="true" name="prev" scale_image="true" width="20" />
20 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" 20 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
21 label="" label_selected="" left_delta="180" image_overlay="arrow_right.tga" 21 label="" label_selected="" left_delta="180" image_overlay="arrow_right.tga"
22 mouse_opaque="true" name="next" scale_image="true" width="20" /> 22 mouse_opaque="true" name="next" scale_image="true" width="20" />
23 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" 23 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
24 label="New" right="-270" 24 label="New" right="-270"
25 mouse_opaque="true" name="WaterNewPreset" scale_image="true" width="100" /> 25 mouse_opaque="true" name="WaterNewPreset" scale_image="true" width="100" />
26 <flyout_button bottom_delta="0" follows="left|top" height="20" label="Save to Disk" 26 <flyout_button bottom_delta="0" follows="left|top" height="20" label="Save to Disk"
27 right="-140" halign="center" list_position="above" enabled="true" 27 right="-140" halign="center" list_position="above" enabled="true"
28 mouse_opaque="true" width="125" name="WaterSavePreset"> 28 mouse_opaque="true" width="125" name="WaterSavePreset">
29 <flyout_button_item value="save_inventory_item" name="save_inventory_item"> 29 <flyout_button_item value="save_inventory_item" name="save_inventory_item">
30 Save to Inventory 30 Save to Inventory
31 </flyout_button_item> 31 </flyout_button_item>
32 <flyout_button_item value="save_disk_item" name="save_disk_item"> 32 <flyout_button_item value="save_disk_item" name="save_disk_item">
33 Save to Disk 33 Save to Disk
34 </flyout_button_item> 34 </flyout_button_item>
35 </flyout_button> 35 <flyout_button_item value="send_to_server_item" name="send_to_server_item">
36 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" 36 Send to Server
37 label="Delete File" label_selected="Delete File" right="-10" 37 </flyout_button_item>
38 mouse_opaque="true" name="WaterDeletePreset" scale_image="true" width="125" /> 38 </flyout_button>
39 <tab_container bottom="-240" follows="left|top" height="180" left="0" 39 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20"
40 mouse_opaque="false" name="Water Tabs" tab_position="top" width="700"> 40 label="Delete File" label_selected="Delete File" right="-10"
41 <panel border="true" bottom="-240" follows="left|top|right|bottom" height="180" 41 mouse_opaque="true" name="WaterDeletePreset" scale_image="true" width="125" />
42 label="Settings" left="1" mouse_opaque="false" 42 <tab_container bottom="-240" follows="left|top" height="180" left="0"
43 name="Settings" width="698"> 43 mouse_opaque="false" name="Water Tabs" tab_position="top" width="700">
44 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 44 <panel border="true" bottom="-240" follows="left|top|right|bottom" height="180"
45 bottom="-20" drop_shadow_visible="true" follows="left|top|right" 45 label="Settings" left="1" mouse_opaque="false"
46 font="SansSerif" h_pad="0" halign="left" height="16" 46 name="Settings" width="698">
47 left="10" mouse_opaque="true" name="BHText" v_pad="0" width="355"> 47 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
48 Water Fog Color 48 bottom="-20" drop_shadow_visible="true" follows="left|top|right"
49 </text> 49 font="SansSerif" h_pad="0" halign="left" height="16"
50 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 50 left="10" mouse_opaque="true" name="BHText" v_pad="0" width="355">
51 left="160" name="WaterFogColorHelp" width="18" /> 51 Water Fog Color
52 <color_swatch border_color="0.45098, 0.517647, 0.607843, 1" bottom="-80" 52 </text>
53 can_apply_immediately="true" color="0.5, 0.5, 0.5, 1" follows="left|top" 53 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
54 height="50" label="" left="40" mouse_opaque="true" 54 left="160" name="WaterFogColorHelp" width="18" />
55 name="WaterFogColor" tool_tip="Click to open Color Picker" width="40" /> 55 <color_swatch border_color="0.45098, 0.517647, 0.607843, 1" bottom="-80"
56 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 56 can_apply_immediately="true" color="0.5, 0.5, 0.5, 1" follows="left|top"
57 bottom="-90" drop_shadow_visible="true" follows="left|top|right" 57 height="50" label="" left="40" mouse_opaque="true"
58 font="SansSerif" h_pad="0" halign="left" height="16" 58 name="WaterFogColor" tool_tip="Click to open Color Picker" width="40" />
59 left="10" mouse_opaque="true" name="WaterFogDensText" v_pad="0" width="355"> 59 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
60 Fog Density Exponent 60 bottom="-90" drop_shadow_visible="true" follows="left|top|right"
61 </text> 61 font="SansSerif" h_pad="0" halign="left" height="16"
62 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 62 left="10" mouse_opaque="true" name="WaterFogDensText" v_pad="0" width="355">
63 left="160" name="WaterFogDensityHelp" width="18" /> 63 Fog Density Exponent
64 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFogDensity" 64 </text>
65 decimal_digits="1" follows="left" height="10" increment=".1" 65 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
66 initial_val="16" label="" left="24" max_val="10" min_val="0" 66 left="160" name="WaterFogDensityHelp" width="18" />
67 mouse_opaque="true" name="WaterFogDensity" show_text="true" value="1.0" 67 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFogDensity"
68 width="200" /> 68 decimal_digits="1" follows="left" height="10" increment=".1"
69 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 69 initial_val="16" label="" left="24" max_val="10" min_val="0"
70 bottom="-130" drop_shadow_visible="true" follows="left|top|right" 70 mouse_opaque="true" name="WaterFogDensity" show_text="true" value="1.0"
71 font="SansSerif" h_pad="0" halign="left" height="16" 71 width="200" />
72 left="10" mouse_opaque="true" name="WaterUnderWaterFogModText" v_pad="0" 72 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
73 width="355"> 73 bottom="-130" drop_shadow_visible="true" follows="left|top|right"
74 Underwater Fog Modifier 74 font="SansSerif" h_pad="0" halign="left" height="16"
75 </text> 75 left="10" mouse_opaque="true" name="WaterUnderWaterFogModText" v_pad="0"
76 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 76 width="355">
77 left="160" name="WaterUnderWaterFogModHelp" width="18" /> 77 Underwater Fog Modifier
78 <slider bottom_delta="-30" can_edit_text="false" control_name="" decimal_digits="2" 78 </text>
79 follows="left" height="10" increment=".01" initial_val="16" label="" 79 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
80 left="24" max_val="2" min_val="0" mouse_opaque="true" 80 left="160" name="WaterUnderWaterFogModHelp" width="18" />
81 name="WaterUnderWaterFogMod" show_text="true" value="0.25" width="200" /> 81 <slider bottom_delta="-30" can_edit_text="false" control_name="" decimal_digits="2"
82 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 82 follows="left" height="10" increment=".01" initial_val="16" label=""
83 bottom="-20" drop_shadow_visible="true" follows="left|top|right" 83 left="24" max_val="2" min_val="0" mouse_opaque="true"
84 font="SansSerif" h_pad="0" halign="left" height="16" 84 name="WaterUnderWaterFogMod" show_text="true" value="0.25" width="200" />
85 left="245" mouse_opaque="true" name="BDensText" v_pad="0" width="355"> 85 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
86 Reflection Wavelet Scale 86 bottom="-20" drop_shadow_visible="true" follows="left|top|right"
87 </text> 87 font="SansSerif" h_pad="0" halign="left" height="16"
88 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 88 left="245" mouse_opaque="true" name="BDensText" v_pad="0" width="355">
89 left="395" name="WaterNormalScaleHelp" width="18" /> 89 Reflection Wavelet Scale
90 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 90 </text>
91 bottom="-37" drop_shadow_visible="true" follows="left|top|right" 91 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
92 font="SansSerifSmall" h_pad="0" halign="center" height="16" 92 left="395" name="WaterNormalScaleHelp" width="18" />
93 left="245" mouse_opaque="true" name="BHText2" v_pad="0" width="10"> 93 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
94 1 94 bottom="-37" drop_shadow_visible="true" follows="left|top|right"
95 </text> 95 font="SansSerifSmall" h_pad="0" halign="center" height="16"
96 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 96 left="245" mouse_opaque="true" name="BHText2" v_pad="0" width="10">
97 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right" 97 1
98 font="SansSerifSmall" h_pad="0" halign="center" height="16" 98 </text>
99 left_delta="0" mouse_opaque="true" name="BHText3" v_pad="0" width="10"> 99 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
100 2 100 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right"
101 </text> 101 font="SansSerifSmall" h_pad="0" halign="center" height="16"
102 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 102 left_delta="0" mouse_opaque="true" name="BHText3" v_pad="0" width="10">
103 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right" 103 2
104 font="SansSerifSmall" h_pad="0" halign="center" height="16" 104 </text>
105 left_delta="0" mouse_opaque="true" name="BHText4" v_pad="0" width="10"> 105 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
106 3 106 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right"
107 </text> 107 font="SansSerifSmall" h_pad="0" halign="center" height="16"
108 <slider bottom="-50" can_edit_text="false" control_name="WaterNormalScaleX" 108 left_delta="0" mouse_opaque="true" name="BHText4" v_pad="0" width="10">
109 decimal_digits="1" follows="left" height="10" increment="0.1" 109 3
110 initial_val="0.7" label="" left="259" max_val="10" min_val="0" 110 </text>
111 mouse_opaque="true" name="WaterNormalScaleX" show_text="true" value="1.0" 111 <slider bottom="-50" can_edit_text="false" control_name="WaterNormalScaleX"
112 width="200" /> 112 decimal_digits="1" follows="left" height="10" increment="0.1"
113 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterNormalScaleY" 113 initial_val="0.7" label="" left="259" max_val="10" min_val="0"
114 decimal_digits="1" follows="left" height="10" increment="0.1" 114 mouse_opaque="true" name="WaterNormalScaleX" show_text="true" value="1.0"
115 initial_val="0.7" label="" left="259" max_val="10" min_val="0" 115 width="200" />
116 mouse_opaque="true" name="WaterNormalScaleY" show_text="true" value="1.0" 116 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterNormalScaleY"
117 width="200" /> 117 decimal_digits="1" follows="left" height="10" increment="0.1"
118 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterNormalScaleZ" 118 initial_val="0.7" label="" left="259" max_val="10" min_val="0"
119 decimal_digits="1" follows="left" height="10" increment="0.1" 119 mouse_opaque="true" name="WaterNormalScaleY" show_text="true" value="1.0"
120 initial_val="0.7" label="" left="259" max_val="10" min_val="0" 120 width="200" />
121 mouse_opaque="true" name="WaterNormalScaleZ" show_text="true" value="1.0" 121 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterNormalScaleZ"
122 width="200" /> 122 decimal_digits="1" follows="left" height="10" increment="0.1"
123 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 123 initial_val="0.7" label="" left="259" max_val="10" min_val="0"
124 bottom="-80" drop_shadow_visible="true" follows="left|top|right" 124 mouse_opaque="true" name="WaterNormalScaleZ" show_text="true" value="1.0"
125 font="SansSerif" h_pad="0" halign="left" height="16" 125 width="200" />
126 left="245" mouse_opaque="true" name="HDText" v_pad="0" width="355"> 126 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
127 Fresnel Scale 127 bottom="-80" drop_shadow_visible="true" follows="left|top|right"
128 </text> 128 font="SansSerif" h_pad="0" halign="left" height="16"
129 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 129 left="245" mouse_opaque="true" name="HDText" v_pad="0" width="355">
130 left="395" name="WaterFresnelScaleHelp" width="18" /> 130 Fresnel Scale
131 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFresnelScale" 131 </text>
132 decimal_digits="2" follows="left" height="10" increment="0.01" 132 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
133 initial_val="0.7" label="" left="259" max_val="1" min_val="0" 133 left="395" name="WaterFresnelScaleHelp" width="18" />
134 mouse_opaque="true" name="WaterFresnelScale" show_text="true" value="1.0" 134 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFresnelScale"
135 width="200" /> 135 decimal_digits="2" follows="left" height="10" increment="0.01"
136 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 136 initial_val="0.7" label="" left="259" max_val="1" min_val="0"
137 bottom="-115" drop_shadow_visible="true" follows="left|top|right" 137 mouse_opaque="true" name="WaterFresnelScale" show_text="true" value="1.0"
138 font="SansSerif" h_pad="0" halign="left" height="16" 138 width="200" />
139 left="245" mouse_opaque="true" name="FresnelOffsetText" v_pad="0" 139 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
140 width="355"> 140 bottom="-115" drop_shadow_visible="true" follows="left|top|right"
141 Fresnel Offset 141 font="SansSerif" h_pad="0" halign="left" height="16"
142 </text> 142 left="245" mouse_opaque="true" name="FresnelOffsetText" v_pad="0"
143 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 143 width="355">
144 left="395" name="WaterFresnelOffsetHelp" width="18" /> 144 Fresnel Offset
145 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFresnelOffset" 145 </text>
146 decimal_digits="2" follows="left" height="10" increment="0.01" 146 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
147 initial_val="0.7" label="" left="259" max_val="1" min_val="0" 147 left="395" name="WaterFresnelOffsetHelp" width="18" />
148 mouse_opaque="true" name="WaterFresnelOffset" show_text="true" value="1.0" 148 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterFresnelOffset"
149 width="200" /> 149 decimal_digits="2" follows="left" height="10" increment="0.01"
150 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 150 initial_val="0.7" label="" left="259" max_val="1" min_val="0"
151 bottom="-20" drop_shadow_visible="true" follows="left|top|right" 151 mouse_opaque="true" name="WaterFresnelOffset" show_text="true" value="1.0"
152 font="SansSerif" h_pad="0" halign="left" height="16" 152 width="200" />
153 left="480" mouse_opaque="true" name="DensMultText" v_pad="0" width="355"> 153 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
154 Refract Scale Above 154 bottom="-20" drop_shadow_visible="true" follows="left|top|right"
155 </text> 155 font="SansSerif" h_pad="0" halign="left" height="16"
156 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 156 left="480" mouse_opaque="true" name="DensMultText" v_pad="0" width="355">
157 left="630" name="WaterScaleAboveHelp" width="18" /> 157 Refract Scale Above
158 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterScaleAbove" 158 </text>
159 decimal_digits="2" follows="left" height="10" increment="0.01" 159 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
160 initial_val="0.1" label="" left="494" max_val="1" min_val="0" 160 left="630" name="WaterScaleAboveHelp" width="18" />
161 mouse_opaque="true" name="WaterScaleAbove" show_text="true" value="1.0" 161 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterScaleAbove"
162 width="200" /> 162 decimal_digits="2" follows="left" height="10" increment="0.01"
163 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 163 initial_val="0.1" label="" left="494" max_val="1" min_val="0"
164 bottom="-53" drop_shadow_visible="true" follows="left|top|right" 164 mouse_opaque="true" name="WaterScaleAbove" show_text="true" value="1.0"
165 font="SansSerif" h_pad="0" halign="left" height="16" 165 width="200" />
166 left="480" mouse_opaque="true" name="WaterScaleBelowText" v_pad="0" 166 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
167 width="355"> 167 bottom="-53" drop_shadow_visible="true" follows="left|top|right"
168 Refract Scale Below 168 font="SansSerif" h_pad="0" halign="left" height="16"
169 </text> 169 left="480" mouse_opaque="true" name="WaterScaleBelowText" v_pad="0"
170 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 170 width="355">
171 left="630" name="WaterScaleBelowHelp" width="18" /> 171 Refract Scale Below
172 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterScaleBelow" 172 </text>
173 decimal_digits="2" follows="left" height="10" increment="0.01" 173 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
174 initial_val="0" label="" left="494" max_val="1" min_val="0" 174 left="630" name="WaterScaleBelowHelp" width="18" />
175 mouse_opaque="true" name="WaterScaleBelow" show_text="true" value="0.0" 175 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterScaleBelow"
176 width="200" /> 176 decimal_digits="2" follows="left" height="10" increment="0.01"
177 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 177 initial_val="0" label="" left="494" max_val="1" min_val="0"
178 bottom="-87" drop_shadow_visible="true" follows="left|top|right" 178 mouse_opaque="true" name="WaterScaleBelow" show_text="true" value="0.0"
179 font="SansSerif" h_pad="0" halign="left" height="16" 179 width="200" />
180 left="480" mouse_opaque="true" name="MaxAltText" v_pad="0" width="355"> 180 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
181 Blur Multiplier 181 bottom="-87" drop_shadow_visible="true" follows="left|top|right"
182 </text> 182 font="SansSerif" h_pad="0" halign="left" height="16"
183 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 183 left="480" mouse_opaque="true" name="MaxAltText" v_pad="0" width="355">
184 left="630" name="WaterBlurMultiplierHelp" width="18" /> 184 Blur Multiplier
185 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterBlurMult" 185 </text>
186 decimal_digits="3" follows="left" height="10" increment=".001" 186 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
187 initial_val="0" label="" left="494" max_val=".16" min_val="0" 187 left="630" name="WaterBlurMultiplierHelp" width="18" />
188 mouse_opaque="true" name="WaterBlurMult" show_text="true" value="0" 188 <slider bottom_delta="-30" can_edit_text="false" control_name="WaterBlurMult"
189 width="200" /> 189 decimal_digits="3" follows="left" height="10" increment=".001"
190 </panel> 190 initial_val="0" label="" left="494" max_val=".16" min_val="0"
191 <panel border="true" bottom="-240" follows="left|top|right|bottom" height="180" 191 mouse_opaque="true" name="WaterBlurMult" show_text="true" value="0"
192 label="Image" left="1" mouse_opaque="false" name="Waves" 192 width="200" />
193 width="698"> 193 </panel>
194 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 194 <panel border="true" bottom="-240" follows="left|top|right|bottom" height="180"
195 bottom="-20" drop_shadow_visible="true" follows="left|top|right" 195 label="Image" left="1" mouse_opaque="false" name="Waves"
196 font="SansSerif" h_pad="0" halign="left" height="16" 196 width="698">
197 left="10" mouse_opaque="true" name="BHText" v_pad="0" width="355"> 197 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
198 Big Wave Direction 198 bottom="-20" drop_shadow_visible="true" follows="left|top|right"
199 </text> 199 font="SansSerif" h_pad="0" halign="left" height="16"
200 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 200 left="10" mouse_opaque="true" name="BHText" v_pad="0" width="355">
201 left="155" name="WaterWave1Help" width="18" /> 201 Big Wave Direction
202 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 202 </text>
203 bottom="-37" drop_shadow_visible="true" follows="left|top|right" 203 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
204 font="SansSerifSmall" h_pad="0" halign="center" height="16" 204 left="155" name="WaterWave1Help" width="18" />
205 left="10" mouse_opaque="true" name="WaterWave1DirXText" v_pad="0" 205 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
206 width="10"> 206 bottom="-37" drop_shadow_visible="true" follows="left|top|right"
207 X 207 font="SansSerifSmall" h_pad="0" halign="center" height="16"
208 </text> 208 left="10" mouse_opaque="true" name="WaterWave1DirXText" v_pad="0"
209 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 209 width="10">
210 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right" 210 X
211 font="SansSerifSmall" h_pad="0" halign="center" height="16" 211 </text>
212 left_delta="0" mouse_opaque="true" name="WaterWave1DirYText" v_pad="0" 212 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
213 width="10"> 213 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right"
214 Y 214 font="SansSerifSmall" h_pad="0" halign="center" height="16"
215 </text> 215 left_delta="0" mouse_opaque="true" name="WaterWave1DirYText" v_pad="0"
216 <slider bottom="-50" can_edit_text="false" control_name="WaterWave1DirX" 216 width="10">
217 decimal_digits="2" follows="left" height="10" increment="0.01" 217 Y
218 initial_val="0.7" label="" left="24" max_val="4" min_val="-4" 218 </text>
219 mouse_opaque="true" name="WaterWave1DirX" show_text="true" value="0.7" 219 <slider bottom="-50" can_edit_text="false" control_name="WaterWave1DirX"
220 width="200" /> 220 decimal_digits="2" follows="left" height="10" increment="0.01"
221 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterWave1DirY" 221 initial_val="0.7" label="" left="24" max_val="4" min_val="-4"
222 decimal_digits="2" follows="left" height="10" increment="0.01" 222 mouse_opaque="true" name="WaterWave1DirX" show_text="true" value="0.7"
223 initial_val="0.7" label="" left="24" max_val="4" min_val="-4" 223 width="200" />
224 mouse_opaque="true" name="WaterWave1DirY" show_text="true" value="0.7" 224 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterWave1DirY"
225 width="200" /> 225 decimal_digits="2" follows="left" height="10" increment="0.01"
226 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 226 initial_val="0.7" label="" left="24" max_val="4" min_val="-4"
227 bottom="-70" drop_shadow_visible="true" follows="left|top|right" 227 mouse_opaque="true" name="WaterWave1DirY" show_text="true" value="0.7"
228 font="SansSerif" h_pad="0" halign="left" height="16" 228 width="200" />
229 left="10" mouse_opaque="true" name="BHText2" v_pad="0" width="355"> 229 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
230 Little Wave Direction 230 bottom="-70" drop_shadow_visible="true" follows="left|top|right"
231 </text> 231 font="SansSerif" h_pad="0" halign="left" height="16"
232 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 232 left="10" mouse_opaque="true" name="BHText2" v_pad="0" width="355">
233 left="155" name="WaterWave2Help" width="18" /> 233 Little Wave Direction
234 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 234 </text>
235 bottom="-87" drop_shadow_visible="true" follows="left|top|right" 235 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
236 font="SansSerifSmall" h_pad="0" halign="center" height="16" 236 left="155" name="WaterWave2Help" width="18" />
237 left="10" mouse_opaque="true" name="WaterWave2DirXText" v_pad="0" 237 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
238 width="10"> 238 bottom="-87" drop_shadow_visible="true" follows="left|top|right"
239 X 239 font="SansSerifSmall" h_pad="0" halign="center" height="16"
240 </text> 240 left="10" mouse_opaque="true" name="WaterWave2DirXText" v_pad="0"
241 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 241 width="10">
242 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right" 242 X
243 font="SansSerifSmall" h_pad="0" halign="center" height="16" 243 </text>
244 left_delta="0" mouse_opaque="true" name="WaterWave2DirYText" v_pad="0" 244 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
245 width="10"> 245 bottom_delta="-11" drop_shadow_visible="true" follows="left|top|right"
246 Y 246 font="SansSerifSmall" h_pad="0" halign="center" height="16"
247 </text> 247 left_delta="0" mouse_opaque="true" name="WaterWave2DirYText" v_pad="0"
248 <slider bottom="-100" can_edit_text="false" control_name="WaterWave2DirX" 248 width="10">
249 decimal_digits="2" follows="left" height="10" increment="0.01" 249 Y
250 initial_val="0.7" label="" left="24" max_val="4" min_val="-4" 250 </text>
251 mouse_opaque="true" name="WaterWave2DirX" show_text="true" value="0.7" 251 <slider bottom="-100" can_edit_text="false" control_name="WaterWave2DirX"
252 width="200" /> 252 decimal_digits="2" follows="left" height="10" increment="0.01"
253 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterWave2DirY" 253 initial_val="0.7" label="" left="24" max_val="4" min_val="-4"
254 decimal_digits="2" follows="left" height="10" increment="0.01" 254 mouse_opaque="true" name="WaterWave2DirX" show_text="true" value="0.7"
255 initial_val="0.7" label="" left="24" max_val="4" min_val="-4" 255 width="200" />
256 mouse_opaque="true" name="WaterWave2DirY" show_text="true" value="0.7" 256 <slider bottom_delta="-11" can_edit_text="false" control_name="WaterWave2DirY"
257 width="200" /> 257 decimal_digits="2" follows="left" height="10" increment="0.01"
258 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 258 initial_val="0.7" label="" left="24" max_val="4" min_val="-4"
259 bottom="-20" drop_shadow_visible="true" follows="left|top|right" 259 mouse_opaque="true" name="WaterWave2DirY" show_text="true" value="0.7"
260 font="SansSerif" h_pad="0" halign="left" height="16" 260 width="200" />
261 left="240" mouse_opaque="true" name="BHText3" v_pad="0" width="355"> 261 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
262 Normal Map 262 bottom="-20" drop_shadow_visible="true" follows="left|top|right"
263 </text> 263 font="SansSerif" h_pad="0" halign="left" height="16"
264 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 264 left="240" mouse_opaque="true" name="BHText3" v_pad="0" width="355">
265 left="365" name="WaterNormalMapHelp" width="18" /> 265 Normal Map
266 <texture_picker bottom="-165" height="143" label="" left="250" name="WaterNormalMap" 266 </text>
267 width="128" /> 267 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
268 </panel> 268 left="365" name="WaterNormalMapHelp" width="18" />
269 </tab_container> 269 <texture_picker bottom="-165" height="143" label="" left="250" name="WaterNormalMap"
270 <string name="WLDefaultWaterNames"> 270 width="128" />
271 Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez 271 </panel>
272 </string> 272 </tab_container>
273</floater> 273 <string name="WLDefaultWaterNames">
274 Default:Glassy:Pond:Murky:Second Plague:SNAKE!!!:Valdez
275 </string>
276</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_manager.xml b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_manager.xml
new file mode 100644
index 0000000..9ef70c8
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_manager.xml
@@ -0,0 +1,35 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-150" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="false" height="130" left="50" min_height="130"
4 min_width="300" mouse_opaque="true" name="WindLight send to server floater"
5 title="WindLight Manager"
6 width="300">
7 <button bottom="-50" enabled="true" font="SansSerif" halign="center" height="20"
8 label="This Parcel" label_selected="This Parcel" left="10"
9 mouse_opaque="true" name="this_parcel" scale_image="true" width="90" />
10 <button bottom="-50" enabled="true" font="SansSerif" halign="center" height="20"
11 label="All Parcels" label_selected="All Parcels" left_delta="95 "
12 mouse_opaque="true" name="all_parcels" scale_image="true" width="90" />
13 <button bottom="-50" enabled="true" font="SansSerif" halign="center" height="20"
14 label="This Region" label_selected="This Region" left_delta="95 "
15 mouse_opaque="true" name="this_region" scale_image="true" width="90" />
16 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
17 bottom="-75" drop_shadow_visible="true" follows="left|top|right"
18 font="SansSerif" h_pad="0" halign="left" height="16"
19 left="10" mouse_opaque="true" name="KeyFramePresetsText" v_pad="0"
20 width="110">
21 Settings:
22 </text>
23 <combo_box allow_text_entry="false" bottom="-77" follows="left|top" height="18"
24 left_delta="70" max_chars="20" mouse_opaque="true" name="WLSettingsCombo"
25 width="200" />
26 <button bottom="-125" enabled="true" font="SansSerif" halign="center" height="20"
27 label="Show" label_selected="Show" left="10"
28 mouse_opaque="true" name="show" scale_image="true" width="80" />
29 <button bottom="-125" enabled="true" font="SansSerif" halign="center" height="20"
30 label="Set to Current" label_selected="Set to Current" left="95"
31 mouse_opaque="true" name="set_to_current" scale_image="true" width="100" />
32 <button bottom="-125" enabled="true" font="SansSerif" halign="center" height="20"
33 label="Remove" label_selected="Remove" left="200"
34 mouse_opaque="true" name="remove" scale_image="true" width="80" />
35</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
index 4f5fc4a..c5e2c2a 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
@@ -32,6 +32,9 @@
32 <flyout_button_item value="save_disk_item" name="save_disk_item"> 32 <flyout_button_item value="save_disk_item" name="save_disk_item">
33 Save to Disk 33 Save to Disk
34 </flyout_button_item> 34 </flyout_button_item>
35 <flyout_button_item value="send_to_server_item" name="send_to_server_item">
36 Send to Server
37 </flyout_button_item>
35 </flyout_button> 38 </flyout_button>
36 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" 39 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20"
37 label="Delete File" label_selected="Delete File" right="-10" 40 label="Delete File" label_selected="Delete File" right="-10"
@@ -211,6 +214,10 @@
211 initial_val="500" label="" left="494" max_val="4000" min_val="0" 214 initial_val="500" label="" left="494" max_val="4000" min_val="0"
212 mouse_opaque="true" name="WLMaxAltitude" show_text="true" value="4000" 215 mouse_opaque="true" name="WLMaxAltitude" show_text="true" value="4000"
213 width="205" /> 216 width="205" />
217 <button bottom="4" enabled="true" font="SansSerif" halign="center" height="20"
218 label="Day Cycle Editor" label_selected="Day Cycle Editor"
219 right="-10" mouse_opaque="true" name="WLDayCycleMenuButton"
220 scale_image="true" width="150" />
214 </panel> 221 </panel>
215 <panel border="true" bottom="-180" follows="left|top|right|bottom" height="160" 222 <panel border="true" bottom="-180" follows="left|top|right|bottom" height="160"
216 label="Lighting" left="1" mouse_opaque="true" 223 label="Lighting" left="1" mouse_opaque="true"
@@ -572,34 +579,54 @@
572 mouse_opaque="true" name="WLCloudScrollX" show_text="true" value="0.0" 579 mouse_opaque="true" name="WLCloudScrollX" show_text="true" value="0.0"
573 width="200" /> 580 width="200" />
574 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 581 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
575 bottom="-60" drop_shadow_visible="true" follows="left|top|right" 582 bottom="-52" drop_shadow_visible="true" follows="left|top|right"
576 font="SansSerif" h_pad="0" halign="left" height="16" 583 font="SansSerif" h_pad="0" halign="left" height="16"
577 left="480" mouse_opaque="true" name="WLCloudScrollYText" v_pad="0" 584 left="480" mouse_opaque="true" name="WLCloudScrollYText" v_pad="0"
578 width="355"> 585 width="355">
579 Cloud Scroll Y 586 Cloud Scroll Y
580 </text> 587 </text>
581 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 588 <button bottom_delta="-2" follows="left|top" font="SansSerifSmall" height="18" label="?"
582 left="605" name="WLCloudScrollYHelp" width="18" /> 589 left="605" name="WLCloudScrollYHelp" width="18" />
583 <check_box control_name="WLCloudLockY" follows="left" font="SansSerifSmall" height="16" 590 <check_box control_name="WLCloudLockY" follows="left" font="SansSerifSmall" height="16"
584 initial_value="false" label="Lock" left="625" mouse_opaque="true" 591 initial_value="false" label="Lock" left="625" mouse_opaque="true"
585 name="WLCloudLockY" width="200" /> 592 name="WLCloudLockY" width="200" />
586 <slider bottom_delta="-15" can_edit_text="false" control_name="WLCloudScrollY" 593 <slider bottom_delta="-10" can_edit_text="false" control_name="WLCloudScrollY"
587 decimal_digits="2" follows="left" height="10" increment="0.01" 594 decimal_digits="2" follows="left" height="10" increment="0.01"
588 initial_val="0.5" label="" left="494" max_val="10" min_val="-10" 595 initial_val="0.5" label="" left="494" max_val="10" min_val="-10"
589 mouse_opaque="true" name="WLCloudScrollY" show_text="true" value="0.0" 596 mouse_opaque="true" name="WLCloudScrollY" show_text="true" value="0.0"
590 width="200" /> 597 width="200" />
591 <check_box bottom="-120" control_name="DrawClassicClouds" follows="left" 598 <check_box bottom="-102" control_name="DrawClassicClouds" follows="left"
592 font="SansSerifSmall" height="16" initial_value="false" 599 font="SansSerifSmall" height="16" initial_value="false"
593 label="Draw Classic Clouds" left="480" mouse_opaque="true" 600 label="Draw Classic Clouds" left="480" mouse_opaque="true"
594 name="DrawClassicClouds" width="200" /> 601 name="DrawClassicClouds" width="200" />
595 <button bottom="-102" follows="left|top" font="SansSerifSmall" height="18" label="?" 602 <button bottom="-85" follows="left|top" font="SansSerifSmall" height="18" label="?"
596 left="608" name="WLClassicCloudsHelp" width="18" /> 603 left="608" name="WLClassicCloudsHelp" width="18" />
604 <text bottom_delta="-19" type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
605 drop_shadow_visible="true" follows="left|top|right"
606 font="SansSerif" h_pad="0" halign="left" height="20"
607 left="480" mouse_opaque="true" name="WLCloudHeightText" v_pad="0"
608 width="355">
609 Classic Cloud Height
610 </text>
611 <slider bottom_delta="-27" can_edit_text="true" control_name="WLCloudHeight"
612 decimal_digits="0" follows="left" height="16" increment="1"
613 initial_val="192" label="" left="494" max_val="1000" min_val="0"
614 mouse_opaque="true" name="WLCloudHeight" show_text="true" value="192"
615 width="200" />
616 <text bottom_delta="0" type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
617 drop_shadow_visible="true" follows="left|top|right"
618 font="SansSerif" h_pad="0" halign="left" height="20"
619 left="480" mouse_opaque="true" name="WLCloudClassicRangeText" v_pad="0"
620 width="355">
621 Classic Cloud Range
622 </text>
623 <slider bottom_delta="-27" can_edit_text="true" control_name="WLCloudClassicRange"
624 decimal_digits="0" follows="left" height="16" increment="1 "
625 initial_val="48" label="" left="494" max_val="100" min_val="0"
626 mouse_opaque="true" name="WLCloudRange" show_text="true" value="48"
627 width="200" />
597 </panel> 628 </panel>
598 </tab_container> 629 </tab_container>
599 <button bottom="4" enabled="true" font="SansSerif" halign="center" height="20"
600 label="Day Cycle Editor" label_selected="Day Cycle Editor"
601 right="-10" mouse_opaque="true" name="WLDayCycleMenuButton"
602 scale_image="true" width="150" />
603 <string name="WLDefaultSkyNames"> 630 <string name="WLDefaultSkyNames">
604 A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor&apos;s Delight:Sheer Sensuality 631 A-12AM:A-12PM:A-3AM:A-3PM:A-4.30PM:A-6AM:A-6PM:A-9AM:A-9PM:Barcelona:Blizzard:Blue Midday:Coastal Afternoon:Coastal Sunset:Default:Desert Sunset:Fine Day:Fluffy Big Clouds:Foggy:Funky Funky:Funky Funky Funky:Gelatto:Ghost:Incongruent Truths:Midday 1:Midday 2:Midday 3:Midday 4:Night:Pirate:Purple:Sailor&apos;s Delight:Sheer Sensuality
605 </string> 632 </string>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_remote_save.xml b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_remote_save.xml
new file mode 100644
index 0000000..84c1d04
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_remote_save.xml
@@ -0,0 +1,123 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater bottom="-150" can_close="true" can_drag_on_left="false" can_minimize="true"
3 can_resize="true" height="220" left="50" min_height="220"
4 min_width="300" mouse_opaque="true" name="WindLight send to server floater"
5 title="WindLight Send to Server"
6 width="300">
7 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
8 left="10" bottom="180" drop_shadow_visible="true" follows="left|top"
9 font="SansSerif" h_pad="0" halign="left" height="10"
10 mouse_opaque="true" name="label Type" v_pad="0" width="275">
11 WindLight Send to Server
12 </text>
13 <slider can_edit_text="true" control_name="max_altitude"
14 left="20" bottom="110"
15 decimal_digits="2" follows="left" height="18" increment="0.1"
16 initial_val="4096.0" label="Max Altitude" max_val="4096.001" min_val="0"
17 mouse_opaque="true" name="max_altitude" show_text="true" value="4096.0"
18 width="200" />
19 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
20 left_delta="210" bottom="125" name="max_altitude_help" width="18" enabled="true" />
21
22 <slider can_edit_text="true" control_name="min_altitude"
23 left="20" bottom="80"
24 decimal_digits="2" follows="left" height="18" increment="0.1"
25 initial_val="1.0" label="Min Altitude" max_val="4096" min_val="0"
26 mouse_opaque="true" name="min_altitude" show_text="true" value="0"
27 width="200" />
28 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
29 left_delta="210" bottom="95" name="min_altitude_help" width="18" enabled="true" />
30 <slider can_edit_text="true" control_name="Fade"
31 left="20" bottom="50"
32 decimal_digits="2" follows="left" height="18" increment="0.1"
33 initial_val="1.0" label="Fade" max_val="10" min_val="0"
34 mouse_opaque="true" name="Fade" show_text="true" value="1.0"
35 width="200" />
36 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
37 left_delta="210" bottom="65" name="fade_help" width="18" />
38
39 <tab_container bottom="-220" follows="left|top" height="160" left="0"
40 mouse_opaque="false" name="WindLight_Setting_Types" tab_position="top" width="299">
41 <panel border="true" bottom="175" follows="left|top|right|bottom" height="160"
42 label="Region" left="1" mouse_opaque="false"
43 name="Region" width="698">
44 <check_box control_name="override_parcel" follows="left" font="SansSerifSmall" height="16"
45 left="20" bottom="30"
46 initial_value="false" label="Override Parcels" mouse_opaque="true"
47 name="override_parcel" width="200" enabled="true" />
48 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
49 left_delta="210" bottom="45" name="override_parcel_help" width="18" enabled="true" />
50
51 <button follows="top|right" font="SansSerif" halign="center"
52 right="-10" bottom="20"
53 height="20" label="Send" label_selected="Send"
54 mouse_opaque="true" name="button_region_send_to_server" scale_image="TRUE" width="78" />
55 </panel>
56 <panel border="true" bottom="175" follows="left|top|right|bottom" height="160"
57 label="Parcel" left="1" mouse_opaque="false"
58 name="Parcel" width="698">
59
60 <!--<slider can_edit_text="true" control_name="max_altitude"
61 left="20" bottom="110"
62 decimal_digits="2" follows="left" height="18" increment="0.1"
63 initial_val="4096.0" label="Max Altitude" max_val="4096.001" min_val="0"
64 mouse_opaque="true" name="max_altitude" show_text="true" value="4096.0"
65 width="200" />
66 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
67 left_delta="210" bottom="125" name="max_altitude_help" width="18" enabled="true" />
68
69 <slider can_edit_text="true" control_name="min_altitude"
70 left="20" bottom="80"
71 decimal_digits="2" follows="left" height="18" increment="0.1"
72 initial_val="1.0" label="Min Altitude" max_val="4096" min_val="0"
73 mouse_opaque="true" name="min_altitude" show_text="true" value="0"
74 width="200" />
75 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
76 left_delta="210" bottom="95" name="min_altitude_help" width="18" enabled="true" />
77
78 <slider can_edit_text="true" control_name="Fade"
79 left="20" bottom="50"
80 decimal_digits="2" follows="left" height="18" increment="0.1"
81 initial_val="1.0" label="Fade" max_val="10" min_val="0"
82 mouse_opaque="true" name="Fade" show_text="true" value="1.0"
83 width="200" />
84 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
85 left_delta="210" bottom="65" name="fade_help" width="18" />-->
86
87 <button follows="top|right" font="SansSerif" halign="center"
88 right="-10" bottom="20" height="20" label="Send"
89 mouse_opaque="true" name="button_parcel_send_to_server" width="78" />
90 </panel>
91 <!--<panel border="true" bottom="175" follows="left|top|right|bottom" height="160"
92 label="Area" left="1" mouse_opaque="false"
93 name="Area" width="698">
94
95 <slider can_edit_text="true" control_name="Max Altitude"
96 left="20" bottom="110"
97 decimal_digits="2" follows="left" height="18" increment="0.1"
98 initial_val="4096.0" label="Max Altitude" max_val="4096.001" min_val="0"
99 mouse_opaque="true" name="Max Altitude" show_text="true" value="4096.0"
100 width="200" />
101 <slider can_edit_text="true" control_name="Min Altitude"
102 left="20" bottom="80"
103 decimal_digits="2" follows="left" height="18" increment="0.1"
104 initial_val="1.0" label="Min Altitude" max_val="4096" min_val="0"
105 mouse_opaque="true" name="Min Altitude" show_text="true" value="0"
106 width="200" />
107
108 <slider can_edit_text="true" control_name="Fade"
109 left="20" bottom="50"
110 decimal_digits="2" follows="left" height="18" increment="0.1"
111 initial_val="1.0" label="Fade" max_val="10" min_val="0"
112 mouse_opaque="true" name="Fade" show_text="true" value="1.0"
113 width="200" />
114 <button follows="left|top" font="SansSerifSmall" height="18" label="?"
115 left_delta="210" bottom="65" name="fade_help" width="18" />
116
117 <button follows="top|right" font="SansSerif" halign="center"
118 right="-10" bottom="20"
119 height="20" label="Send" label_selected="Send"
120 mouse_opaque="true" name="button send to server" scale_image="TRUE" width="78" />
121 </panel>-->
122 </tab_container>
123</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
index 389efb5..daf217e 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_world_map.xml
@@ -1,183 +1,183 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" 2<floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true"
3 height="711" min_height="520" min_width="410" name="worldmap" 3 height="711" min_height="520" min_width="410" name="worldmap"
4 rect_control="FloaterWorldMapRect2" title="World Map" width="1243"> 4 rect_control="FloaterWorldMapRect2" title="World Map" width="1243">
5 <tab_container bottom="-701" follows="left|top|right|bottom" height="681" left="15" 5 <tab_container bottom="-701" follows="left|top|right|bottom" height="681" left="15"
6 mouse_opaque="false" name="maptab" tab_position="top" width="995"> 6 mouse_opaque="false" name="maptab" tab_position="top" width="995">
7 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Objects" 7 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Objects"
8 left="1" mouse_opaque="true" name="objects_mapview" width="993" /> 8 left="1" mouse_opaque="true" name="objects_mapview" width="993" />
9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain" 9 <panel bottom="-680" follows="left|top|right|bottom" height="664" label="Terrain"
10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" /> 10 left="1" mouse_opaque="true" name="terrain_mapview" width="993" />
11 </tab_container> 11 </tab_container>
12 <icon bottom="-50" color="1, 1, 1, 1" follows="top|right" height="16" 12 <icon bottom="-50" color="1, 1, 1, 1" follows="top|right" height="16"
13 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self" 13 image_name="map_avatar_16.tga" left="1013" mouse_opaque="true" name="self"
14 width="16" /> 14 width="16" />
15 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 15 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
16 bottom="-50" drop_shadow_visible="true" follows="top|right" 16 bottom="-50" drop_shadow_visible="true" follows="top|right"
17 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 17 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
18 mouse_opaque="true" name="you_label" v_pad="0" width="145"> 18 mouse_opaque="true" name="you_label" v_pad="0" width="145">
19 You 19 You
20 </text> 20 </text>
21 <icon bottom="-50" color="1, 1, 1, 1" follows="top|right" height="16" 21 <icon bottom="-50" color="1, 1, 1, 1" follows="top|right" height="16"
22 image_name="map_home.tga" left="1083" mouse_opaque="true" name="home" 22 image_name="map_home.tga" left="1083" mouse_opaque="true" name="home"
23 width="16" /> 23 width="16" />
24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 24 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
25 bottom="-50" drop_shadow_visible="true" follows="top|right" 25 bottom="-50" drop_shadow_visible="true" follows="top|right"
26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 26 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
27 mouse_opaque="true" name="home_label" v_pad="0" width="145"> 27 mouse_opaque="true" name="home_label" v_pad="0" width="145">
28 Home 28 Home
29 </text> 29 </text>
30 <icon bottom="-70" color="0.5, 0.25, 1, 1" follows="top|right" height="16" 30 <icon bottom="-70" color="0.5, 0.25, 1, 1" follows="top|right" height="16"
31 image_name="legend.tga" left="1013" mouse_opaque="true" name="square2" 31 image_name="legend.tga" left="1013" mouse_opaque="true" name="square2"
32 width="16" /> 32 width="16" />
33 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 33 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
34 bottom="-70" drop_shadow_visible="true" follows="top|right" 34 bottom="-70" drop_shadow_visible="true" follows="top|right"
35 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 35 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
36 mouse_opaque="true" name="auction_label" v_pad="0" width="145"> 36 mouse_opaque="true" name="auction_label" v_pad="0" width="145">
37 Auction 37 Auction
38 </text> 38 </text>
39 <icon bottom="-70" color="1, 1, 0.25, 1" follows="top|right" height="16" 39 <icon bottom="-70" color="1, 1, 0.25, 1" follows="top|right" height="16"
40 image_name="legend.tga" left="1083" mouse_opaque="true" name="square" 40 image_name="legend.tga" left="1083" mouse_opaque="true" name="square"
41 width="16" /> 41 width="16" />
42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 42 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
43 bottom="-70" drop_shadow_visible="true" follows="top|right" 43 bottom="-70" drop_shadow_visible="true" follows="top|right"
44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20" 44 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="20"
45 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145"> 45 mouse_opaque="true" name="land_for_sale_label" v_pad="0" width="145">
46 Land For Sale 46 Land For Sale
47 </text> 47 </text>
48 <button bottom="-50" follows="top|right" font="SansSerifSmall" halign="center" 48 <button bottom="-50" follows="top|right" font="SansSerifSmall" halign="center"
49 height="16" label="Go Home" label_selected="Go Home" left="1150" 49 height="16" label="Go Home" label_selected="Go Home" left="1150"
50 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home" 50 mouse_opaque="true" name="Go Home" tool_tip="Teleport to your home"
51 width="88" /> 51 width="88" />
52 <icon bottom="-92" color="0, 1, 0, 1" follows="top|right" height="8" 52 <icon bottom="-92" color="0, 1, 0, 1" follows="top|right" height="8"
53 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person" 53 image_name="map_avatar_8.tga" left="1017" mouse_opaque="true" name="person"
54 width="8" /> 54 width="8" />
55 <check_box bottom="-96" control_name="MapShowPeople" follows="top|right" 55 <check_box bottom="-96" control_name="MapShowPeople" follows="top|right"
56 font="SansSerifSmall" height="16" initial_value="false" label="Resident" 56 font="SansSerifSmall" height="16" initial_value="false" label="Resident"
57 left_delta="16" mouse_opaque="true" name="people_chk" width="110" /> 57 left_delta="16" mouse_opaque="true" name="people_chk" width="110" />
58 <icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16" 58 <icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16"
59 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub" 59 image_name="map_infohub.tga" left="1013" mouse_opaque="true" name="infohub"
60 width="16" /> 60 width="16" />
61 <check_box bottom="-116" control_name="MapShowInfohubs" follows="top|right" 61 <check_box bottom="-116" control_name="MapShowInfohubs" follows="top|right"
62 font="SansSerifSmall" height="16" initial_value="false" label="Infohub" 62 font="SansSerifSmall" height="16" initial_value="false" label="Infohub"
63 left_delta="20" mouse_opaque="true" name="infohub_chk" width="110" /> 63 left_delta="20" mouse_opaque="true" name="infohub_chk" width="110" />
64 <icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16" 64 <icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16"
65 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub" 65 image_name="map_telehub.tga" left="1013" mouse_opaque="true" name="telehub"
66 width="16" /> 66 width="16" />
67 <check_box bottom="-136" control_name="MapShowTelehubs" follows="top|right" 67 <check_box bottom="-136" control_name="MapShowTelehubs" follows="top|right"
68 font="SansSerifSmall" height="16" initial_value="false" label="Telehub" 68 font="SansSerifSmall" height="16" initial_value="false" label="Telehub"
69 left_delta="20" mouse_opaque="true" name="telehubchk" width="110" /> 69 left_delta="20" mouse_opaque="true" name="telehubchk" width="110" />
70 <icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16" 70 <icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16"
71 image_name="icon_for_sale.tga" left="1013" mouse_opaque="true" 71 image_name="icon_for_sale.tga" left="1013" mouse_opaque="true"
72 name="landforsale" width="16" /> 72 name="landforsale" width="16" />
73 <check_box bottom="-156" control_name="MapShowLandForSale" follows="top|right" 73 <check_box bottom="-156" control_name="MapShowLandForSale" follows="top|right"
74 font="SansSerifSmall" height="16" initial_value="false" label="Land for Sale" 74 font="SansSerifSmall" height="16" initial_value="false" label="Land for Sale"
75 left_delta="20" mouse_opaque="true" name="land_for_sale_chk" width="110" /> 75 left_delta="20" mouse_opaque="true" name="land_for_sale_chk" width="110" />
76 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 76 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
77 bottom="-96" drop_shadow_visible="true" follows="top|right" 77 bottom="-96" drop_shadow_visible="true" follows="top|right"
78 font="SansSerifSmall" h_pad="0" halign="left" height="16" left="1139" 78 font="SansSerifSmall" h_pad="0" halign="left" height="16" left="1139"
79 mouse_opaque="true" name="events_label" v_pad="0" width="145"> 79 mouse_opaque="true" name="events_label" v_pad="0" width="145">
80 Events: 80 Events:
81 </text> 81 </text>
82 <icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16" 82 <icon bottom="-116" color="1, 1, 1, 1" follows="top|right" height="16"
83 image_name="map_event.tga" left="1151" mouse_opaque="true" name="event" 83 image_name="map_event.tga" left="1151" mouse_opaque="true" name="event"
84 width="16" /> 84 width="16" />
85 <check_box bottom="-116" control_name="MapShowEvents" follows="top|right" 85 <check_box bottom="-116" control_name="MapShowEvents" follows="top|right"
86 font="SansSerifSmall" height="16" initial_value="false" label="PG" 86 font="SansSerifSmall" height="16" initial_value="false" label="PG"
87 left_delta="20" mouse_opaque="true" name="event_chk" width="55" /> 87 left_delta="20" mouse_opaque="true" name="event_chk" width="55" />
88 <icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16" 88 <icon bottom="-136" color="1, 1, 1, 1" follows="top|right" height="16"
89 image_name="map_event_mature.tga" left="1151" mouse_opaque="true" 89 image_name="map_event_mature.tga" left="1151" mouse_opaque="true"
90 name="events_mature_icon" width="16" /> 90 name="events_mature_icon" width="16" />
91 <check_box bottom="-136" control_name="ShowMatureEvents" follows="top|right" 91 <check_box bottom="-136" control_name="ShowMatureEvents" follows="top|right"
92 font="SansSerifSmall" height="16" initial_value="true" label="Mature" 92 font="SansSerifSmall" height="16" initial_value="true" label="Mature"
93 left_delta="20" mouse_opaque="true" name="event_mature_chk" width="55" /> 93 left_delta="20" mouse_opaque="true" name="event_mature_chk" width="55" />
94 <icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16" 94 <icon bottom="-156" color="1, 1, 1, 1" follows="top|right" height="16"
95 image_name="map_event_adult.tga" left="1151" mouse_opaque="true" 95 image_name="map_event_adult.tga" left="1151" mouse_opaque="true"
96 name="events_adult_icon" width="16" /> 96 name="events_adult_icon" width="16" />
97 <check_box bottom="-156" control_name="ShowAdultEvents" follows="top|right" 97 <check_box bottom="-156" control_name="ShowAdultEvents" follows="top|right"
98 font="SansSerifSmall" height="16" initial_value="false" label="Adult" 98 font="SansSerifSmall" height="16" initial_value="false" label="Adult"
99 left_delta="20" mouse_opaque="true" name="event_adult_chk" width="55" /> 99 left_delta="20" mouse_opaque="true" name="event_adult_chk" width="55" />
100 <icon bottom="-180" color="0.5, 0, 0, 1" follows="top|right" height="16" 100 <icon bottom="-180" color="0.5, 0, 0, 1" follows="top|right" height="16"
101 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 101 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
102 name="avatar_icon" width="16" /> 102 name="avatar_icon" width="16" />
103 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20" 103 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20"
104 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true" 104 label="Online Friends" left_delta="20" max_chars="60" mouse_opaque="true"
105 name="friend combo" tool_tip="Friend to Show on Map" width="202"> 105 name="friend combo" tool_tip="Friend to Show on Map" width="202">
106 <combo_item name="none_selected" value="None"> 106 <combo_item name="none_selected" value="None">
107 Online Friends 107 Online Friends
108 </combo_item> 108 </combo_item>
109 </combo_box> 109 </combo_box>
110 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 110 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
111 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 111 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
112 name="landmark_icon" width="16" /> 112 name="landmark_icon" width="16" />
113 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20" 113 <combo_box allow_text_entry="true" bottom_delta="0" follows="top|right" height="20"
114 label="Landmarks" left_delta="20" max_chars="64" mouse_opaque="true" 114 label="Landmarks" left_delta="20" max_chars="64" mouse_opaque="true"
115 name="landmark combo" tool_tip="Landmark to Show on Map" width="202"> 115 name="landmark combo" tool_tip="Landmark to Show on Map" width="202">
116 <combo_item name="none_selected" value="None"> 116 <combo_item name="none_selected" value="None">
117 Landmarks 117 Landmarks
118 </combo_item> 118 </combo_item>
119 </combo_box> 119 </combo_box>
120 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16" 120 <icon bottom_delta="-25" color="0.5, 0, 0, 1" follows="top|right" height="16"
121 image_name="map_track_16.tga" left="1013" mouse_opaque="true" 121 image_name="map_track_16.tga" left="1013" mouse_opaque="true"
122 name="location_icon" width="16" /> 122 name="location_icon" width="16" />
123 <line_editor bottom_delta="0" follows="top|right" height="20" label="Search by Region Name" 123 <line_editor bottom_delta="0" follows="top|right" height="20" label="Search by Region Name"
124 left_delta="20" name="location" select_on_focus="true" 124 left_delta="20" name="location" select_on_focus="true"
125 tool_tip="Type the name of a region" width="140" /> 125 tool_tip="Type the name of a region" width="140" />
126 <button bottom_delta="0" follows="top|right" font="SansSerif" halign="center" 126 <button bottom_delta="0" follows="top|right" font="SansSerif" halign="center"
127 height="20" label="Search" left_delta="145" mouse_opaque="true" 127 height="20" label="Search" left_delta="145" mouse_opaque="true"
128 name="DoSearch" tool_tip="Search for region" width="60" /> 128 name="DoSearch" tool_tip="Search for region" width="60" />
129 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 129 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
130 bottom_delta="-20" drop_shadow_visible="true" follows="top|right" 130 bottom_delta="-20" drop_shadow_visible="true" follows="top|right"
131 font="SansSerif" h_pad="0" halign="left" height="16" left="1013" 131 font="SansSerif" h_pad="0" halign="left" height="16" left="1013"
132 mouse_opaque="true" name="search_label" v_pad="0" width="222"> 132 mouse_opaque="true" name="search_label" v_pad="0" width="222">
133 Search Results: 133 Search Results:
134 </text> 134 </text>
135 <scroll_list background_visible="true" bottom_delta="-326" draw_border="true" 135 <scroll_list background_visible="true" bottom_delta="-326" draw_border="true"
136 draw_stripes="false" 136 draw_stripes="false"
137 follows="top|right|bottom" height="320" left="1013" multi_select="false" 137 follows="top|right|bottom" height="320" left="1013" multi_select="false"
138 name="search_results" width="222"> 138 name="search_results" width="222">
139 <column label="" name="icon" width="16" /> 139 <column label="" name="icon" width="16" />
140 <column label="" name="sim_name" width="206" /> 140 <column label="" name="sim_name" width="206" />
141 </scroll_list> 141 </scroll_list>
142 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 142 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
143 bottom_delta="-20" drop_shadow_visible="true" follows="bottom|right" 143 bottom_delta="-20" drop_shadow_visible="true" follows="bottom|right"
144 font="SansSerif" h_pad="0" halign="left" height="16" left="1013" 144 font="SansSerif" h_pad="0" halign="left" height="16" left="1013"
145 mouse_opaque="true" name="location_label" v_pad="0" width="98"> 145 mouse_opaque="true" name="location_label" v_pad="0" width="98">
146 Location: 146 Location:
147 </text> 147 </text>
148 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16" 148 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16"
149 increment="1" initial_val="128" left="1090" max_val="255" min_val="0" 149 increment="1" initial_val="128" left="1090" max_val="99999" min_val="0"
150 mouse_opaque="true" name="spin x" 150 mouse_opaque="true" name="spin x"
151 tool_tip="X coordinate of location to show on map" width="48" /> 151 tool_tip="X coordinate of location to show on map" width="48" />
152 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16" 152 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16"
153 increment="1" initial_val="128" left_delta="50" max_val="255" min_val="0" 153 increment="1" initial_val="128" left_delta="50" max_val="99999" min_val="0"
154 mouse_opaque="true" name="spin y" 154 mouse_opaque="true" name="spin y"
155 tool_tip="Y coordinate of location to show on map" width="48" /> 155 tool_tip="Y coordinate of location to show on map" width="48" />
156 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16" 156 <spinner bottom_delta="0" decimal_digits="0" follows="bottom|right" height="16"
157 increment="1" initial_val="0" left_delta="50" max_val="4096" min_val="0" 157 increment="1" initial_val="0" left_delta="50" max_val="4096" min_val="0"
158 mouse_opaque="true" name="spin z" 158 mouse_opaque="true" name="spin z"
159 tool_tip="Z coordinate of location to show on map" width="48" /> 159 tool_tip="Z coordinate of location to show on map" width="48" />
160 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center" 160 <button bottom="-625" follows="right|bottom" font="SansSerif" halign="center"
161 height="20" label="Teleport" label_selected="Teleport" left="-230" 161 height="20" label="Teleport" label_selected="Teleport" left="-230"
162 mouse_opaque="true" name="Teleport" 162 mouse_opaque="true" name="Teleport"
163 tool_tip="Teleport to selected location" width="90" /> 163 tool_tip="Teleport to selected location" width="90" />
164 <button bottom_delta="0" follows="right|bottom" font="SansSerif" halign="center" 164 <button bottom_delta="0" follows="right|bottom" font="SansSerif" halign="center"
165 height="20" label="Show Destination" label_selected="Show Destination" 165 height="20" label="Show Destination" label_selected="Show Destination"
166 left_delta="100" mouse_opaque="true" name="Show Destination" 166 left_delta="100" mouse_opaque="true" name="Show Destination"
167 tool_tip="Center map on selected location" width="125" /> 167 tool_tip="Center map on selected location" width="125" />
168 <button bottom_delta="-24" follows="right|bottom" font="SansSerif" halign="center" 168 <button bottom_delta="-24" follows="right|bottom" font="SansSerif" halign="center"
169 height="20" label="Clear" label_selected="Clear" left="-230" 169 height="20" label="Clear" label_selected="Clear" left="-230"
170 mouse_opaque="true" name="Clear" tool_tip="Stop tracking" width="90" /> 170 mouse_opaque="true" name="Clear" tool_tip="Stop tracking" width="90" />
171 <button bottom_delta="0" follows="right|bottom" font="SansSerif" halign="center" 171 <button bottom_delta="0" follows="right|bottom" font="SansSerif" halign="center"
172 height="20" label="Show My Location" label_selected="Show My Location" 172 height="20" label="Show My Location" label_selected="Show My Location"
173 left_delta="100" mouse_opaque="true" name="Show My Location" 173 left_delta="100" mouse_opaque="true" name="Show My Location"
174 tool_tip="Center map on your avatar&apos;s location" width="125" /> 174 tool_tip="Center map on your avatar&apos;s location" width="125" />
175 <button bottom_delta="-24" enabled="false" follows="bottom|right" font="SansSerif" 175 <button bottom_delta="-24" enabled="false" follows="bottom|right" font="SansSerif"
176 height="20" label="Copy SLURL to clipboard" left="-230" name="copy_slurl" 176 height="20" label="Copy SLURL to clipboard" left="-230" name="copy_slurl"
177 tool_tip="Copies current location as SLURL to be used on the web." 177 tool_tip="Copies current location as SLURL to be used on the web."
178 width="222" /> 178 width="222" />
179 <slider bottom="-697" can_edit_text="false" decimal_digits="3" follows="right|bottom" 179 <slider bottom="-697" can_edit_text="false" decimal_digits="3" follows="right|bottom"
180 height="16" increment="0.2" initial_val="48.5029" label="Zoom" left="-230" 180 height="16" increment="0.2" initial_val="48.5029" label="Zoom" left="-230"
181 max_val="0" min_val="-8" mouse_opaque="true" name="zoom slider" 181 max_val="0" min_val="-8" mouse_opaque="true" name="zoom slider"
182 show_text="false" value="48.5029" width="222" /> 182 show_text="false" value="48.5029" width="222" />
183</floater> 183</floater>
diff --git a/linden/indra/newview/skins/default/xui/en-us/legacy_menu_pie_attachment.xml b/linden/indra/newview/skins/default/xui/en-us/legacy_menu_pie_attachment.xml
index 18bedd0..35f3037 100644
--- a/linden/indra/newview/skins/default/xui/en-us/legacy_menu_pie_attachment.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/legacy_menu_pie_attachment.xml
@@ -1,23 +1,23 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<pie_menu name="Attachment Pie"> 2<pie_menu name="Attachment Pie">
3 <menu_item_call enabled="false" label="Drop" mouse_opaque="true" name="Drop"> 3 <menu_item_call enabled="false" label="Drop" mouse_opaque="true" name="Drop">
4 <on_click function="Attachment.Drop" /> 4 <on_click function="Attachment.Drop" />
5 <on_enable function="Attachment.EnableDrop" /> 5 <on_enable function="Attachment.EnableDrop" />
6 </menu_item_call> 6 </menu_item_call>
7 <menu_item_separator /> 7 <menu_item_separator />
8 <menu_item_separator /> 8 <menu_item_separator />
9 <menu_item_separator /> 9 <menu_item_separator />
10 <menu_item_call enabled="true" label="Inspect" mouse_opaque="true" name="Object Inspect"> 10 <menu_item_call enabled="true" label="Inspect" mouse_opaque="true" name="Object Inspect">
11 <on_click function="Object.Inspect" /> 11 <on_click function="Object.Inspect" />
12 <on_enable function="Object.EnableInspect" /> 12 <on_enable function="Object.EnableInspect" />
13 </menu_item_call> 13 </menu_item_call>
14 <menu_item_separator /> 14 <menu_item_separator />
15 <menu_item_call enabled="false" label="Detach" mouse_opaque="true" name="Detach"> 15 <menu_item_call enabled="false" label="Detach" mouse_opaque="true" name="Detach">
16 <on_click function="Attachment.Detach" /> 16 <on_click function="Attachment.Detach" />
17 <on_enable function="Attachment.EnableDetach" /> 17 <on_enable function="Attachment.EnableDetach" />
18 </menu_item_call> 18 </menu_item_call>
19 <menu_item_call enabled="false" label="Edit..." mouse_opaque="true" name="Edit"> 19 <menu_item_call enabled="false" label="Edit..." mouse_opaque="true" name="Edit">
20 <on_click function="Object.Edit" /> 20 <on_click function="Object.Edit" />
21 <on_enable function="EnableEdit" /> 21 <on_enable function="EnableEdit" />
22 </menu_item_call> 22 </menu_item_call>
23</pie_menu> 23</pie_menu>
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 0ac7401..b98ff7c 100644
--- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml
@@ -3663,6 +3663,90 @@ Default: off
3663 3663
3664<notification 3664<notification
3665 icon="alertmodal.tga" 3665 icon="alertmodal.tga"
3666 label="Force Draw Distance"
3667 name="HelpForceDrawDistance"
3668 type="alertmodal">
3669If this box is checked, draw distance will be locked for all people in the sim. Note: This will lag people on older machines. PLEASE think before setting this setting.
3670
3671Default: off
3672</notification>
3673
3674<notification
3675 icon="alertmodal.tga"
3676 label="Max Inventory Items To Transfer"
3677 name="HelpMaxInventoryItemsTransfer"
3678 type="alertmodal">
3679This box controls how many objects can be transfered between clients at a time. -1 sets no limit on the amount of objects. Default Second Life setting is 42.
3680
3681Default: -1
3682</notification>
3683<notification
3684 icon="alertmodal.tga"
3685 label="Max Groups"
3686 name="HelpMaxGroups"
3687 type="alertmodal">
3688This box controls how many groups an agent can join. -1 sets no limit on the amount of groups.
3689
3690Default: -1
3691</notification>
3692 <notification
3693 icon="alertmodal.tga"
3694 label="Render Water"
3695 name="HelpRenderWater"
3696 type="alertmodal">
3697 If this box is checked, water will not be shown for users in this sim.
3698
3699 Default: -1
3700 </notification>
3701<notification
3702 icon="alertmodal.tga"
3703 label="Allow Minimap"
3704 name="HelpAllowMinimap"
3705 type="alertmodal">
3706If this box is checked, the minimap will be disabled for users in this sim.
3707
3708Default: on
3709</notification>
3710<notification
3711 icon="alertmodal.tga"
3712 label="Allow Minimap"
3713 name="HelpAllowPhysicalPrims"
3714 type="alertmodal">
3715If this box is checked, physical prims will be allowed to be created in this sim.
3716
3717Default: on
3718</notification>
3719<notification
3720 icon="alertmodal.tga"
3721 label="Enable Teen Mode"
3722 name="HelpEnableTeenMode"
3723 type="alertmodal">
3724If this box is checked, all avatars will be forced to wear underwear and will not be able to take it off.
3725
3726Default: off
3727</notification>
3728<notification
3729 icon="alertmodal.tga"
3730 label="Show Tags"
3731 name="HelpShowTags"
3732 type="alertmodal">
3733This box controls how avatar name tags are shown in this sim. 2 sets tags to always be shown. 1 sets tags to disappear after some time. 0 blocks the viewing of name tags.
3734
3735Default: 2
3736</notification>
3737<notification
3738 icon="alertmodal.tga"
3739 label="Allow Parcel WindLight"
3740 name="HelpAllowParcelWindLight"
3741 type="alertmodal">
3742If this box is checked, setting WindLight settings in parcels will be enabled.
3743
3744Default: on
3745</notification>
3746
3747
3748<notification
3749 icon="alertmodal.tga"
3666 label="Bulk Change Content Permissions" 3750 label="Bulk Change Content Permissions"
3667 name="HelpBulkPermission" 3751 name="HelpBulkPermission"
3668 type="alertmodal"> 3752 type="alertmodal">
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml b/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml
index 2360e6b..0df65e7 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml
@@ -138,11 +138,11 @@
138 bottom_delta="-6" drop_shadow_visible="true" follows="left|top" 138 bottom_delta="-6" drop_shadow_visible="true" follows="left|top"
139 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="0" 139 font="SansSerifSmall" h_pad="0" halign="left" height="16" left_delta="0"
140 mouse_opaque="true" name="About:" v_pad="0" width="170"> 140 mouse_opaque="true" name="About:" v_pad="0" width="170">
141 About (500 chars): 141 About (8196 chars):
142 </text> 142 </text>
143 <text_editor bottom_delta="-137" embedded_items="false" 143 <text_editor bottom_delta="-137" embedded_items="false"
144 enabled="true" follows="left|top" font="SansSerifSmall" height="137" 144 enabled="true" follows="left|top" font="SansSerifSmall" height="137"
145 is_unicode="false" left_delta="0" max_length="511" mouse_opaque="true" 145 is_unicode="false" left_delta="0" max_length="8196" mouse_opaque="true"
146 name="about" width="235" word_wrap="true" spell_check="true" /> 146 name="about" width="235" word_wrap="true" spell_check="true" />
147 147
148 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 148 <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
@@ -350,11 +350,11 @@
350 bottom_delta="-8" drop_shadow_visible="true" follows="left|top" 350 bottom_delta="-8" drop_shadow_visible="true" follows="left|top"
351 font="SansSerifSmall" h_pad="0" halign="left" height="16" left="12" 351 font="SansSerifSmall" h_pad="0" halign="left" height="16" left="12"
352 mouse_opaque="true" name="Info:" v_pad="0" width="161"> 352 mouse_opaque="true" name="Info:" v_pad="0" width="161">
353 Info (250 chars): 353 Info (8196 chars):
354 </text> 354 </text>
355 <text_editor bottom_delta="-179" embedded_items="false" 355 <text_editor bottom_delta="-179" embedded_items="false"
356 enabled="true" follows="left|top" font="SansSerifSmall" height="178" 356 enabled="true" follows="left|top" font="SansSerifSmall" height="178"
357 is_unicode="false" left="12" max_length="254" mouse_opaque="false" 357 is_unicode="false" left="12" max_length="8196" mouse_opaque="false"
358 name="about" width="378" word_wrap="true" spell_check="true" /> 358 name="about" width="378" word_wrap="true" spell_check="true" />
359 </panel> 359 </panel>
360 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466" 360 <panel border="true" bottom="-482" follows="left|top|right|bottom" height="466"
@@ -372,7 +372,7 @@
372 </text> 372 </text>
373 <text_editor bottom_delta="-260" embedded_items="false" enabled="true" follows="left|top" 373 <text_editor bottom_delta="-260" embedded_items="false" enabled="true" follows="left|top"
374 font="SansSerif" height="256" is_unicode="false" left="10" 374 font="SansSerif" height="256" is_unicode="false" left="10"
375 max_length="1023" mouse_opaque="true" name="notes edit" width="400" 375 max_length="8196" mouse_opaque="true" name="notes edit" width="400"
376 word_wrap="false" spell_check="true" /> 376 word_wrap="false" spell_check="true" />
377 </panel> 377 </panel>
378 </tab_container> 378 </tab_container>
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml
index 95d0c33..fe60203 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_chat.xml
@@ -153,11 +153,15 @@
153 mouse_opaque="false" name="text_box7" v_pad="0" width="128"> 153 mouse_opaque="false" name="text_box7" v_pad="0" width="128">
154 Chat Bubbles: 154 Chat Bubbles:
155 </text> 155 </text>
156 <check_box bottom="-386" control_name="UseChatBubbles" enabled="true" follows="left|top" 156 <check_box bottom="-386" control_name="UseChatBubbles" enabled="true" follows="left|top"
157 font="SansSerifSmall" height="16" initial_value="false" 157 font="SansSerifSmall" height="16" initial_value="false"
158 label="Show chat bubbles" left="148" mouse_opaque="true" 158 label="Show chat bubbles" left="148" mouse_opaque="true"
159 name="bubble_text_chat" radio_style="false" width="237" /> 159 name="bubble_text_chat" radio_style="false" width="237" />
160 <slider bottom="-402" can_edit_text="false" control_name="ChatBubbleOpacity" 160 <check_box bottom="-386" control_name="UseLocalChatBubbles" enabled="true" follows="left|top"
161 font="SansSerifSmall" height="16" initial_value="false"
162 label="Show local chat and bubbles" left="288" mouse_opaque="true"
163 name="local_bubble_text_chat" radio_style="false" width="237" />
164 <slider bottom="-402" can_edit_text="false" control_name="ChatBubbleOpacity"
161 decimal_digits="3" enabled="true" follows="left|top" height="12" 165 decimal_digits="3" enabled="true" follows="left|top" height="12"
162 increment="0.05" initial_val="1" label="Bubble opacity:" left="148" max_val="1" 166 increment="0.05" initial_val="1" label="Bubble opacity:" left="148" max_val="1"
163 min_val="0" mouse_opaque="true" name="bubble_chat_opacity" show_text="true" 167 min_val="0" mouse_opaque="true" name="bubble_chat_opacity" show_text="true"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
index f85e3c0..b47794b 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml
@@ -61,34 +61,34 @@
61 font="SansSerifSmall" height="16" initial_value="false" 61 font="SansSerifSmall" height="16" initial_value="false"
62 label="Hide my group title" left="151" name="show_my_title_checkbox" 62 label="Hide my group title" left="151" name="show_my_title_checkbox"
63 radio_style="false" width="256" /> 63 radio_style="false" width="256" />
64 <color_swatch border_color="0.45098 0.517647 0.607843 1" bottom="-230" 64 <color_swatch border_color="0.45098 0.517647 0.607843 1" bottom="-210"
65 can_apply_immediately="false" color="1 1 1 1" 65 can_apply_immediately="false" color="1 1 1 1"
66 enabled="true" follows="left|top" height="65" label="" left="153" 66 enabled="true" follows="left|top" height="65" label="" left="153"
67 mouse_opaque="true" name="effect_color_swatch" 67 mouse_opaque="true" name="effect_color_swatch"
68 tool_tip="Click to open Color Picker" width="55" /> 68 tool_tip="Click to open Color Picker" width="55" />
69 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 69 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
70 bottom="-235" drop_shadow_visible="true" enabled="true" follows="left|top" 70 bottom="-215" drop_shadow_visible="true" enabled="true" follows="left|top"
71 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" 71 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
72 mouse_opaque="true" name="UI Size:" v_pad="0" width="128"> 72 mouse_opaque="true" name="UI Size:" v_pad="0" width="128">
73 UI Size: 73 UI Size:
74 </text> 74 </text>
75 <slider bottom="-237" can_edit_text="true" 75 <slider bottom="-217" can_edit_text="true"
76 decimal_digits="3" enabled="true" height="16" increment="0.001" 76 decimal_digits="3" enabled="true" height="16" increment="0.001"
77 initial_val="1" left="148" max_val="1.4" min_val="0.75" mouse_opaque="true" 77 initial_val="1" left="148" max_val="1.4" min_val="0.75" mouse_opaque="true"
78 name="ui_scale_slider" show_text="true" value="1" width="220" /> 78 name="ui_scale_slider" show_text="true" value="1" width="220" />
79 <button bottom="-241" enabled="true" follows="left|top" 79 <button bottom="-221" enabled="true" follows="left|top"
80 font="SansSerif" halign="center" height="22" label="Reset" 80 font="SansSerif" halign="center" height="22" label="Reset"
81 label_selected="Reset" left_delta="226" mouse_opaque="true" 81 label_selected="Reset" left_delta="226" mouse_opaque="true"
82 name="reset_ui_size" scale_image="true" width="80" /> 82 name="reset_ui_size" scale_image="true" width="80" />
83 <check_box bottom="-256" enabled="true" follows="left|top" 83 <check_box bottom="-236" enabled="true" follows="left|top"
84 font="SansSerifSmall" height="16" initial_value="false" 84 font="SansSerifSmall" height="16" initial_value="false"
85 label="Use resolution independent scale" left="151" mouse_opaque="true" 85 label="Use resolution independent scale" left="151" mouse_opaque="true"
86 name="ui_auto_scale" radio_style="false" width="256" /> 86 name="ui_auto_scale" radio_style="false" width="256" />
87 <check_box bottom="-280" enabled="true" follows="left|top" 87 <check_box bottom="-260" enabled="true" follows="left|top"
88 font="SansSerifSmall" height="16" initial_value="false" 88 font="SansSerifSmall" height="16" initial_value="false"
89 label="Go Away/AFK when idle" left="330" mouse_opaque="true" 89 label="Go Away/AFK when idle" left="330" mouse_opaque="true"
90 name="afk_timeout_checkbox" radio_style="false" width="256" /> 90 name="afk_timeout_checkbox" radio_style="false" width="256" />
91 <spinner bottom="-280" decimal_digits="0" enabled="true" 91 <spinner bottom="-260" decimal_digits="0" enabled="true"
92 follows="left|top" height="16" increment="1" initial_val="300" 92 follows="left|top" height="16" increment="1" initial_val="300"
93 label="Away Timeout:" label_width="141" left="10" max_val="600" 93 label="Away Timeout:" label_width="141" left="10" max_val="600"
94 min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" /> 94 min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" />
@@ -109,18 +109,18 @@
109 mouse_opaque="true" name="mini_map_notify_sim" radio_style="false" 109 mouse_opaque="true" name="mini_map_notify_sim" radio_style="false"
110 width="256" /> 110 width="256" />
111 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 111 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
112 bottom="-332" drop_shadow_visible="true" enabled="true" follows="left|top" 112 bottom="-312" drop_shadow_visible="true" enabled="true" follows="left|top"
113 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10" 113 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
114 mouse_opaque="true" name="maturity_desired_label" v_pad="0" width="394"> 114 mouse_opaque="true" name="maturity_desired_label" v_pad="0" width="394">
115 Rating: 115 Rating:
116 </text> 116 </text>
117 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 117 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
118 bottom="-332" drop_shadow_visible="true" enabled="true" follows="left|top" 118 bottom="-312" drop_shadow_visible="true" enabled="true" follows="left|top"
119 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="151" 119 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="151"
120 mouse_opaque="true" name="maturity_desired_prompt" v_pad="0" width="394"> 120 mouse_opaque="true" name="maturity_desired_prompt" v_pad="0" width="394">
121 I want to access content rated: 121 I want to access content rated:
122 </text> 122 </text>
123 <combo_box bottom="-338" follows="left|top" height="18" left="320" 123 <combo_box bottom="-318" follows="left|top" height="18" left="315"
124 mouse_opaque="true" name="maturity_desired_combobox" width="150"> 124 mouse_opaque="true" name="maturity_desired_combobox" width="150">
125 <combo_item name="Desired_Adult" value="42"> 125 <combo_item name="Desired_Adult" value="42">
126 PG, Mature and Adult 126 PG, Mature and Adult
@@ -133,8 +133,8 @@
133 </combo_item> 133 </combo_item>
134 </combo_box> 134 </combo_box>
135 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 135 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
136 bottom="-332" drop_shadow_visible="true" enabled="true" follows="left|top" 136 bottom="-312" drop_shadow_visible="true" enabled="true" follows="left|top"
137 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="320" 137 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="315"
138 mouse_opaque="true" name="maturity_desired_textbox" v_pad="0" width="150"> 138 mouse_opaque="true" name="maturity_desired_textbox" v_pad="0" width="150">
139 PG only 139 PG only
140 </text> 140 </text>
@@ -151,25 +151,25 @@
151 Nametags: 151 Nametags:
152 </text> 152 </text>
153 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 153 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
154 bottom="-175" drop_shadow_visible="true" enabled="true" follows="left|top" 154 bottom="-155" drop_shadow_visible="true" enabled="true" follows="left|top"
155 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10" 155 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="10"
156 mouse_opaque="true" name="effects_color_textbox" v_pad="0" width="394"> 156 mouse_opaque="true" name="effects_color_textbox" v_pad="0" width="394">
157 Selection Beam Color: 157 Selection Beam Color:
158 </text> 158 </text>
159 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 159 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
160 bottom="-274" drop_shadow_visible="true" enabled="true" follows="left|top" 160 bottom="-254" drop_shadow_visible="true" enabled="true" follows="left|top"
161 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="220" 161 font="SansSerifSmall" h_pad="0" halign="left" height="10" left="220"
162 mouse_opaque="true" name="seconds_textbox" v_pad="0" width="128"> 162 mouse_opaque="true" name="seconds_textbox" v_pad="0" width="128">
163 seconds 163 seconds
164 </text> 164 </text>
165 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 165 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
166 bottom="-372" drop_shadow_visible="true" enabled="true" follows="left|top" 166 bottom="-352" drop_shadow_visible="true" enabled="true" follows="left|top"
167 font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10" 167 font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10"
168 mouse_opaque="true" name="time_textbox" v_pad="0" width="394"> 168 mouse_opaque="true" name="time_textbox" v_pad="0" width="394">
169 Clock: 169 Clock:
170 </text> 170 </text>
171 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 171 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
172 bottom="-404" drop_shadow_visible="true" enabled="true" follows="left|top" 172 bottom="-384" drop_shadow_visible="true" enabled="true" follows="left|top"
173 font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10" 173 font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10"
174 mouse_opaque="true" name="language_textbox" v_pad="0" width="394"> 174 mouse_opaque="true" name="language_textbox" v_pad="0" width="394">
175 Language: 175 Language:
@@ -181,10 +181,20 @@
181 v_pad="0" width="400"> 181 v_pad="0" width="400">
182 (requires restart for full effect) 182 (requires restart for full effect)
183 </text> 183 </text>
184 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
185 bottom_delta="-20" drop_shadow_visible="true" enabled="true" follows="left|top"
186 font="SansSerifSmall" h_pad="0" halign="left" height="18" left="10"
187 mouse_opaque="true" name="remember_password_text" v_pad="0" width="394">
188 Remember Password:
189 </text>
190 <check_box bottom_delta="0" follows="left|top"
191 font="SansSerifSmall" height="16" initial_value="false"
192 label="Remember Password" left="151" mouse_opaque="true"
193 name="remember_password" radio_style="false" width="256" />
184 <string name="region_name_prompt"> 194 <string name="region_name_prompt">
185 &lt;Type region name&gt; 195 &lt;Type region name&gt;
186 </string> 196 </string>
187 <combo_box allow_text_entry="false" bottom="-372" enabled="true" follows="left|top" 197 <combo_box allow_text_entry="false" bottom="-352" enabled="true" follows="left|top"
188 height="18" left="153" max_chars="20" mouse_opaque="true" 198 height="18" left="153" max_chars="20" mouse_opaque="true"
189 name="time_combobox" width="146"> 199 name="time_combobox" width="146">
190 <combo_item type="string" name="12HourTime" value="PST 12"> 200 <combo_item type="string" name="12HourTime" value="PST 12">
@@ -197,7 +207,7 @@
197 UTC 207 UTC
198 </combo_item> 208 </combo_item>
199 </combo_box> 209 </combo_box>
200 <combo_box allow_text_entry="true" bottom="-402" enabled="true" 210 <combo_box allow_text_entry="true" bottom="-382" enabled="true"
201 follows="left|top" height="16" left="153" max_chars="135" 211 follows="left|top" height="16" left="153" max_chars="135"
202 mouse_opaque="true" name="language_combobox" width="146"> 212 mouse_opaque="true" name="language_combobox" width="146">
203 <combo_item type="string" length="1" enabled="true" name="System Default Language" value="default"> 213 <combo_item type="string" length="1" enabled="true" name="System Default Language" value="default">
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml
index 0611ce3..58a2989 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_skins.xml
@@ -5,8 +5,8 @@
5 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 5 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
6 bottom="-22" drop_shadow_visible="true" enabled="true" follows="left|top" 6 bottom="-22" drop_shadow_visible="true" enabled="true" follows="left|top"
7 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" 7 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10"
8 mouse_opaque="true" name="muting_text" v_pad="0" width="400"> 8 mouse_opaque="true" name="muting_text" v_pad="0" width="500">
9 Select a skin (requires restart). 9 Select a skin (requires restart). (Please see the skin folders for information and credits)
10 </text> 10 </text>
11 <radio_group bottom="0" draw_border="false" follows="top|left" height="380" left="12" 11 <radio_group bottom="0" draw_border="false" follows="top|left" height="380" left="12"
12 name="skin_selection" width="480"> 12 name="skin_selection" width="480">
@@ -40,12 +40,24 @@
40 scale_image="true" label="" image_selected="skin_thumbnail_gemini.png" 40 scale_image="true" label="" image_selected="skin_thumbnail_gemini.png"
41 image_hover_selected="skin_thumbnail_gemini.png" image_unselected="skin_thumbnail_gemini.png" 41 image_hover_selected="skin_thumbnail_gemini.png" image_unselected="skin_thumbnail_gemini.png"
42 image_hover_unselected="skin_thumbnail_gemini.png" follows="left|top" /> 42 image_hover_unselected="skin_thumbnail_gemini.png" follows="left|top" />
43 43 <text name="skin_current_text"
44 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 44 left="10" bottom="5" halign="left" height="12"
45 bottom="10" drop_shadow_visible="true" enabled="true" follows="left|bottom" 45 follows="left|bottom" h_pad="0" v_pad="0"
46 font="SansSerifSmall" h_pad="0" halign="left" height="12" left="90" 46 bg_visible="false" drop_shadow_visible="true"
47 mouse_opaque="true" name="muting_text" v_pad="0" width="400"> 47 border_visible="false" border_drop_shadow_visible="false"
48 (Please see the skin folders for information and credits) 48 font="SansSerif" mouse_opaque="true">
49 Other Skin Name:
49 </text> 50 </text>
51 <line_editor name="skin_current_edit"
52 bottom_delta="0" left_delta="120" height="20" width="120"
53 follows="left|bottom" font="SansSerif"
54 bevel_style="in" border_style="line" border_thickness="1"
55 max_length="31" mouse_opaque="true"
56 handle_edit_keys_directly="true"
57 select_all_on_focus_received="true" />
58 <button name="save_skin" label="Save"
59 bottom_delta="-2" left_delta="120" height="24" width="90"
60 follows="left|center" font="SansSerif" halign="center"
61 mouse_opaque="true" scale_image="TRUE" />
50</panel> 62</panel>
51 63
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml b/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml
index 603f2d8..ce2d5ad 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_radar.xml
@@ -41,15 +41,15 @@
41 </text> 41 </text>
42 42
43 <slider name="near_me_range" label="" control_name="NearMeRange" 43 <slider name="near_me_range" label="" control_name="NearMeRange"
44 bottom_delta="0" left_delta="62" width="110" height="15" 44 bottom_delta="0" left_delta="62" width="150" height="15"
45 follows="left|top" min_val="5" max_val="512" increment="1" 45 follows="left|top" min_val="5" max_val="2048" increment="1"
46 initial_val="96" decimal_digits="0" /> 46 initial_val="96" decimal_digits="0" />
47 47
48 <text name="meters" 48 <text name="meters"
49 bottom_delta="0" left="180" height="15" width="40" 49 bottom_delta="0" left_delta="10" height="15" width="40"
50 h_pad="0" halign="left" v_pad="0" follows="left|top" 50 h_pad="0" halign="left" v_pad="0" follows="left|top"
51 bg_visible="false" border_drop_shadow_visible="false" 51 bg_visible="false" border_drop_shadow_visible="false"
52 border_visible="false" drop_shadow_visible="true" 52 border_visible="false" drop_shadow_visible="true"
53 font="SansSerifSmall" mouse_opaque="true"> 53 font="SansSerifSmall" mouse_opaque="true">
54 m 54 m
55 </text> 55 </text>
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_region_estate.xml b/linden/indra/newview/skins/default/xui/en-us/panel_region_estate.xml
index 84ce9d0..5dd738a 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_region_estate.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_region_estate.xml
@@ -25,7 +25,7 @@ regions in the estate.
25 (unknown) 25 (unknown)
26 </text> 26 </text>
27 <view_border bevel_style="in" border="true" border_thickness="1" bottom_delta="-295" 27 <view_border bevel_style="in" border="true" border_thickness="1" bottom_delta="-295"
28 follows="top|left" height="290" left="6" width="250" /> 28 follows="top|left" height="350" left="6" width="250" />
29 <check_box bottom_delta="265" follows="left|top" height="20" label="Use Global Time" 29 <check_box bottom_delta="265" follows="left|top" height="20" label="Use Global Time"
30 left="12" name="use_global_time_check" width="200" /> 30 left="12" name="use_global_time_check" width="200" />
31 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 31 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
@@ -69,13 +69,12 @@ regions in the estate.
69 left="12" name="allow_direct_teleport" width="80" /> 69 left="12" name="allow_direct_teleport" width="80" />
70 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 70 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
71 name="allow_direct_teleport_help" right="250" width="18" /> 71 name="allow_direct_teleport_help" right="250" width="18" />
72 <text bottom_delta="-26" follows="left|top" font="SansSerifSmall" height="20" 72 <text bottom_delta="-26" follows="left|top" font="SansSerifSmall" height="20"
73 left="10" name="abuse_email_text" width="180"> 73 left="10" name="abuse_email_text" width="180">
74 Abuse email address: 74 Abuse email address:
75 </text> 75 </text>
76 <line_editor bottom_delta="-16" follows="top|left" height="19" left="15" max_length="254" 76 <line_editor bottom_delta="-16" follows="top|left" height="19" left="15" max_length="254"
77 name="abuse_email_address" width="205" /> 77 name="abuse_email_address" width="205" />
78 <string name="email_unsupported">Feature unsupported</string>
79 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 78 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
80 name="abuse_email_address_help" right="250" width="18" /> 79 name="abuse_email_address_help" right="250" width="18" />
81 <button bottom_delta="-26" enabled="false" follows="left|top" height="20" label="Apply" 80 <button bottom_delta="-26" enabled="false" follows="left|top" height="20" label="Apply"
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_region_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_region_general.xml
index 6302428..70df1df 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_region_general.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_region_general.xml
@@ -58,16 +58,21 @@
58 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 58 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
59 left="205" name="parcel_search_help" width="18" /> 59 left="205" name="parcel_search_help" width="18" />
60 <spinner bottom_delta="-40" follows="left|top" height="20" increment="1" 60 <spinner bottom_delta="-40" follows="left|top" height="20" increment="1"
61 label="Agent Limit" label_width="97" left="10" max_val="100" min_val="1" 61 label="Agent Limit" label_width="100" left="10" max_val="100" min_val="1"
62 name="agent_limit_spin" width="170" /> 62 name="agent_limit_spin" width="170" />
63 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 63 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
64 left="205" name="agent_limit_help" width="18" /> 64 left="205" name="agent_limit_help" width="18" />
65 <spinner bottom_delta="-20" follows="left|top" height="20" increment="0.5" 65 <spinner bottom_delta="-20" follows="left|top" height="20" increment="0.5"
66 label="Object Bonus" label_width="97" left="10" max_val="10" min_val="1" 66 label="Object Bonus" label_width="100" left="10" max_val="10" min_val="1"
67 name="object_bonus_spin" width="170" /> 67 name="object_bonus_spin" width="170" />
68 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?" 68 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
69 left="205" name="object_bonus_help" width="18" /> 69 left="205" name="object_bonus_help" width="18" />
70 <text bottom_delta="-30" follows="left|top" height="20" label="Maturity" left="10" 70 <spinner bottom_delta="-20" follows="left|top" height="20" increment="0.5"
71 label="Minimum Agent Age" label_width="100" left="10" max_val="1000" min_val="0"
72 name="minimum_agent_age" width="170" />
73 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
74 left="205" name="minimum_agent_age_help" width="18" />
75 <text bottom_delta="-30" follows="left|top" height="20" label="Maturity" left="10"
71 name="access_text" width="100"> 76 name="access_text" width="100">
72 Rating: 77 Rating:
73 </text> 78 </text>
@@ -87,7 +92,7 @@
87 left="205" name="access_help" width="18" /> 92 left="205" name="access_help" width="18" />
88 <button bottom_delta="-30" enabled="false" follows="left|top" height="20" label="Apply" 93 <button bottom_delta="-30" enabled="false" follows="left|top" height="20" label="Apply"
89 left="108" name="apply_btn" width="100" /> 94 left="108" name="apply_btn" width="100" />
90 <button bottom_delta="-60" follows="left|top" height="20" 95 <button bottom_delta="-40" follows="left|top" height="20"
91 label="Teleport Home One User..." left="10" name="kick_btn" width="250" /> 96 label="Teleport Home One User..." left="10" name="kick_btn" width="250" />
92 <button bottom_delta="-23" follows="left|top" height="20" 97 <button bottom_delta="-23" follows="left|top" height="20"
93 label="Teleport Home All Users..." left="10" name="kick_all_btn" width="250" /> 98 label="Teleport Home All Users..." left="10" name="kick_all_btn" width="250" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_region_open_region_settings.xml b/linden/indra/newview/skins/default/xui/en-us/panel_region_open_region_settings.xml
new file mode 100644
index 0000000..3eb7806
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_region_open_region_settings.xml
@@ -0,0 +1,76 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2<panel border="true" bottom="100" follows="top|left" height="320" label="Region Settings"
3 left="0" name="RegionSettings" width="480">
4 <spinner bottom_delta="-40" follows="left|top" height="20" increment="1"
5 label="Default Draw Distance" label_width="175" left="10" max_val="10000" min_val="1"
6 name="draw_distance" width="250" />
7 <check_box bottom_delta="-20" follows="left|top" height="20" label="Force Draw Distance"
8 left="10" name="force_draw_distance" width="80" />
9 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
10 left="285" name="force_draw_distance_help" width="18" />
11 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
12 label="Max Drag Distance" label_width="175" left="10" max_val="1000 0" min_val="0"
13 name="max_drag_distance" width="250" />
14 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
15 label="Max Prim Scale" label_width="175" left="10" max_val="10000" min_val="0"
16 name="max_prim_scale" width="250" />
17 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
18 label="Min Prim Scale" label_width="175" left="10" max_val="10000" min_val="0"
19 name="min_prim_scale" width="250" />
20 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
21 label="Max Physical Prim Scale" label_width="175" left="10" max_val="10000" min_val="0"
22 name="max_phys_prim_scale" width="250" />
23 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
24 label="Max Hollow Size" label_width="175" left="10" max_val="100" min_val="0"
25 name="max_hollow_size" width="250" />
26 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
27 label="Min Hole Size" label_width="175" left="10" max_val="100" min_val="0"
28 name="min_hole_size" width="250" />
29 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
30 label="Max Link Count" label_width="175" left="10" max_val="100000" min_val="0"
31 name="max_link_count" width="250" />
32 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
33 label="Max Link Count Phys" label_width="175" left="10" max_val="100000" min_val="0"
34 name="max_link_count_phys" width="250" />
35 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
36 label="Max Inventory Items To Transfer" label_width="175" left="10" max_val="10000" min_val="-1"
37 name="max_inventory_items_transfer" width="250" />
38 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
39 left="285" name="max_inventory_items_transfer_help" width="18" />
40 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
41 label="Show Tags" label_width="175" left="10" max_val="2" min_val="0"
42 name="show_tags" width="250" />
43 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
44 left="285" name="show_tags_help" width="18" />
45 <spinner bottom_delta="-20" follows="left|top" height="20" increment="1"
46 label="Max Groups" label_width="175" left="10" max_val="1000" min_val="-1"
47 name="max_groups" width="250" />
48 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
49 left="285" name="max_groups_help" width="18" />
50 <check_box bottom_delta="-20" follows="left|top" height="20" label="Render Water" left="10"
51 name="render_water" width="80" />
52 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
53 left="285" name="render_water_help" width="18" />
54 <check_box bottom_delta="-20" follows="left|top" height="20" label="Allow Minimap"
55 left="10" name="allow_minimap" width="80" />
56 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
57 left="285" name="allow_minimap_help" width="18" />
58 <check_box bottom_delta="-20" follows="left|top" height="20" label="Allow Physical Prims"
59 left="10" name="allow_physical_prims" width="80" />
60 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
61 left="285" name="allow_physical_prims_help" width="18" />
62 <check_box bottom_delta="-20" follows="left|top" height="20" label="Enable Teen Mode"
63 left="10" name="enable_teen_mode" width="80" />
64 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
65 left="285" name="enable_teen_mode_help" width="18" />
66 <check_box bottom_delta="-20" follows="left|top" height="20" label="Enforce Max Build Constraints"
67 left="10" name="enforce_max_build" width="80" />
68 <check_box bottom_delta="-20" follows="left|top" height="20"
69 label="Allow Parcel WindLight" left="10"
70 name="allow_parcel_windlight"
71 width="80" />
72 <button bottom_delta="0" follows="left|top" font="SansSerifSmall" height="18" label="?"
73 left="285" name="allow_parcel_windlight_help" width="18" />
74 <button bottom_delta="-30" enabled="false" follows="left|top" height="20" label="Apply"
75 left="108" name="apply_ors_btn" width="100" />
76</panel>
diff --git a/linden/indra/newview/viewertime.cpp b/linden/indra/newview/viewertime.cpp
index 06dd91a..06436b6 100644
--- a/linden/indra/newview/viewertime.cpp
+++ b/linden/indra/newview/viewertime.cpp
@@ -47,6 +47,9 @@ ViewerTime* gViewerTime = 0;
47// We use statics here for speed reasons 47// We use statics here for speed reasons
48bool ViewerTime::sUse24HourTime = false; 48bool ViewerTime::sUse24HourTime = false;
49bool ViewerTime::sUseUTCTime = false; 49bool ViewerTime::sUseUTCTime = false;
50bool ViewerTime::sUseTimeOffset = false;
51S32 ViewerTime::sTimeOffset = 0;
52bool ViewerTime::sTimeOffsetDST = false;
50 53
51std::vector<std::string> ViewerTime::sDays; 54std::vector<std::string> ViewerTime::sDays;
52std::vector<std::string> ViewerTime::sMonths; 55std::vector<std::string> ViewerTime::sMonths;
@@ -87,16 +90,21 @@ void ViewerTime::refresh()
87 // There's only one internal tm buffer. 90 // There's only one internal tm buffer.
88 struct tm* internal_time; 91 struct tm* internal_time;
89 92
90 if (!sUseUTCTime) 93 if (sUseUTCTime)
91 { 94 {
92 // Convert to Pacific, based on server's opinion of whether 95 time(&utc_time);
93 // it's daylight savings time there. 96 internal_time = gmtime(&utc_time);
94 internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); 97 }
98 else if (sUseTimeOffset)
99 {
100 //Its a UTC offset, deal with it
101 internal_time = utc_to_offset_time(utc_time, sTimeOffset, sTimeOffsetDST);
95 } 102 }
96 else 103 else
97 { 104 {
98 time(&utc_time); 105 // Convert to Pacific, based on server's opinion of whether
99 internal_time = gmtime(&utc_time); 106 // it's daylight savings time there.
107 internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);
100 } 108 }
101 109
102 mMinute = internal_time->tm_min; 110 mMinute = internal_time->tm_min;
diff --git a/linden/indra/newview/viewertime.h b/linden/indra/newview/viewertime.h
index 525a2bc..f7a80a6 100644
--- a/linden/indra/newview/viewertime.h
+++ b/linden/indra/newview/viewertime.h
@@ -59,6 +59,9 @@ public:
59 59
60 static bool sUse24HourTime; 60 static bool sUse24HourTime;
61 static bool sUseUTCTime; 61 static bool sUseUTCTime;
62 static bool sUseTimeOffset;
63 static S32 sTimeOffset;
64 static bool sTimeOffsetDST;
62 65
63 void updateTimeFormat(const U32& index); 66 void updateTimeFormat(const U32& index);
64 67
diff --git a/linden/indra/newview/windlightsettingsupdate.cpp b/linden/indra/newview/windlightsettingsupdate.cpp
new file mode 100644
index 0000000..a5f9cb7
--- /dev/null
+++ b/linden/indra/newview/windlightsettingsupdate.cpp
@@ -0,0 +1,200 @@
1/*
2 * @file kowopenregionsettings.cpp
3 * @brief Handler for OpenRegionInfo event queue message.
4 *
5 * Copyright (c) 2010, Patrick Sapinski
6 *
7 * The source code in this file ("Source Code") is provided to you
8 * under the terms of the GNU General Public License, version 2.0
9 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in
10 * this distribution, or online at
11 * http://secondlifegrid.net/programs/open_source/licensing/gplv2
12 *
13 * There are special exceptions to the terms and conditions of the GPL as
14 * it is applied to this Source Code. View the full text of the exception
15 * in the file doc/FLOSS-exception.txt in this software distribution, or
16 * online at
17 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL SOURCE CODE IS PROVIDED "AS IS." THE AUTHOR MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29#include "llhttpnode.h"
30#include "hippoLimits.h"
31#include "llfloatertools.h"
32#include "llviewercontrol.h"
33#include "llagent.h"
34#include "llsurface.h"
35#include "llviewerregion.h"
36#include "llviewerobject.h"
37
38#include "linden_common.h"
39#include "llwaterparammanager.h"
40#include "llwaterparamset.h"
41#include "llwlparammanager.h"
42#include "llwlparamset.h"
43#include "message.h"
44#include "meta7windlight.h"
45#include "lightshare.h"
46#include "wlsettingsmanager.h"
47
48//DEBUG includes
49//#include "llsdserialize.h" //LLSDNotationStreamer - for dumping LLSD to string
50
51class WindLightSettingsUpdate : public LLHTTPNode
52{
53 /*virtual*/ void post(
54 LLHTTPNode::ResponsePtr response,
55 const LLSD& context,
56 const LLSD& input) const
57 {
58 if (!input.isMap() || !input.has("body"))
59 {
60 llinfos << "malformed WindLightSettingsUpdate update!" << llendl;
61 return;
62 }
63 LLWaterParamSet* mWater;
64 LLWLParamSet* mSky;
65 LLUUID* mWaterNormal;
66
67 mWater = new LLWaterParamSet();
68 mSky = new LLWLParamSet();
69 mWaterNormal = new LLUUID();
70
71 LLSD body = input["body"];
72
73 mWater->set("waterFogColor",
74 body["waterColorX"].asReal() / 256.f,
75 body["waterColorY"].asReal() / 256.f,
76 body["waterColorZ"].asReal() / 256.f,
77 body["waterColorW"].asReal() / 256.f);
78 mWater->set("waterFogDensity", body["waterFogDensityExponent"].asReal());
79 mWater->set("underWaterFogMod", body["underwaterFogModifier"].asReal());
80 mWater->set("normScale", body["reflectionWaveletScaleX"].asReal(),
81 body["reflectionWaveletScaleY"].asReal(),
82 body["reflectionWaveletScaleZ"].asReal());
83 mWater->set("fresnelScale", body["fresnelScale"].asReal());
84 mWater->set("fresnelOffset", body["fresnelOffset"].asReal());
85 mWater->set("scaleAbove", body["refractScaleAbove"].asReal());
86 mWater->set("scaleBelow", body["refractScaleBelow"].asReal());
87 mWater->set("blurMultiplier", body["blurMultiplier"].asReal());
88 mWater->set("wave2Dir", body["bigWaveDirectionX"].asReal(),
89 body["bigWaveDirectionY"].asReal());
90 mWater->set("wave1Dir", body["littleWaveDirectionX"].asReal(),
91 body["littleWaveDirectionY"].asReal());
92 mWaterNormal->parseUUID(body["normalMapTexture"].asUUID().asString(), mWaterNormal);
93
94 mSky->setSunAngle(body["sunMoonPosition"].asReal());
95 mSky->setEastAngle(body["eastAngle"].asReal());
96
97 mSky->set("sunlight_color",
98 body["sunMoonColorX"].asReal() * 3.0f,
99 body["sunMoonColorY"].asReal() * 3.0f,
100 body["sunMoonColorZ"].asReal() * 3.0f,
101 body["sunMoonColorW"].asReal() * 3.0f);
102
103 mSky->set("ambient",
104 body["ambientX"].asReal() * 3.0f,
105 body["ambientY"].asReal() * 3.0f,
106 body["ambientZ"].asReal() * 3.0f,
107 body["ambientW"].asReal() * 3.0f);
108
109 mSky->set("blue_horizon",
110 body["horizonX"].asReal() * 2.0f,
111 body["horizonY"].asReal() * 2.0f,
112 body["horizonZ"].asReal() * 2.0f,
113 body["horizonW"].asReal() * 2.0f);
114
115 mSky->set("blue_density",
116 body["blueDensityX"].asReal(),
117 body["blueDensityY"].asReal(),
118 body["blueDensityZ"].asReal(),
119 1.0);
120
121 mSky->set("haze_horizon",
122 body["hazeHorizon"].asReal(),
123 body["hazeHorizon"].asReal(),
124 body["hazeHorizon"].asReal(),
125 1.f);
126
127 mSky->set("haze_density",
128 body["hazeDensity"].asReal(),
129 0.f, 0.f, 1.f);
130
131 mSky->set("cloud_shadow",
132 body["cloudCoverage"].asReal(),
133 0.f, 0.f, 1.f);
134
135 mSky->set("density_multiplier",
136 body["densityMultiplier"].asReal() / 1000.0f,
137 0.f, 0.f, 1.f);
138
139 mSky->set("distance_multiplier",
140 body["distanceMultiplier"].asReal(),
141 0.f, 0.f, 1.f);
142
143 mSky->set("max_y",
144 body["maxAltitude"].asReal(),
145 0.f, 0.f, 1.f);
146
147 mSky->set("cloud_color",
148 body["cloudColorX"].asReal(),
149 body["cloudColorY"].asReal(),
150 body["cloudColorZ"].asReal(),
151 body["cloudColorW"].asReal());
152
153 mSky->set("cloud_pos_density1",
154 body["cloudXYDensityX"].asReal(),
155 body["cloudXYDensityY"].asReal(),
156 body["cloudXYDensityZ"].asReal(),
157 1.f);
158
159 mSky->set("cloud_pos_density2",
160 body["cloudDetailXYDensityX"].asReal(),
161 body["cloudDetailXYDensityY"].asReal(),
162 body["cloudDetailXYDensityZ"].asReal(),
163 1.f);
164
165 mSky->set("cloud_scale",
166 body["cloudScale"].asReal(),
167 0.f, 0.f, 1.f);
168
169 mSky->set("gamma",
170 body["sceneGamma"].asReal(),
171 0.f, 0.f, 1.f);
172
173 mSky->set("glow",
174 (2 - body["sunGlowSize"].asReal()) * 20,
175 0.f,
176 -body["sunGlowFocus"].asReal() * 5,
177 1.f);
178
179 mSky->setCloudScrollX(body["cloudScrollX"].asReal() + 10.0f);
180 mSky->setCloudScrollY(body["cloudScrollY"].asReal() + 10.0f);
181
182 mSky->setEnableCloudScrollX(!body["cloudScrollXLock"].asBoolean());
183 mSky->setEnableCloudScrollY(!body["cloudScrollYLock"].asBoolean());
184
185 mSky->setStarBrightness(body["starBrightness"].asReal());
186
187 mSky->set("fade", body["fade"].asReal());
188
189 //Update this here.. since it isn't a part of WL... go figure
190 gHippoLimits->skyUseClassicClouds = body["drawClassicClouds"].asBoolean();
191 gSavedSettings.setF32("ClassicCloudHeight",body["classicCloudHeight"].asReal());
192 gSavedSettings.setF32("ClassicCloudRange",body["classicCloudRange"].asReal());
193
194 WLSettingsManager::Apply(mSky, mWater, mWaterNormal);
195}
196};
197
198LLHTTPRegistration<WindLightSettingsUpdate>
199gHTTPRegistrationWindLightSettingsUpdate(
200 "/message/WindLightSettingsUpdate"); \ No newline at end of file
diff --git a/linden/indra/newview/wlfloatermanager.cpp b/linden/indra/newview/wlfloatermanager.cpp
new file mode 100644
index 0000000..1946807
--- /dev/null
+++ b/linden/indra/newview/wlfloatermanager.cpp
@@ -0,0 +1,281 @@
1/**
2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition
4*
5* $LicenseInfo:firstyear=2007&license=viewergpl$
6*
7* Copyright (c) 2007-2009, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at
21* http://secondlifegrid.net/programs/open_source/licensing/flossexception
22*
23* By copying, modifying or distributing this software, you acknowledge
24* that you have read and understood your obligations described above,
25* and agree to abide by those obligations.
26*
27* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29* COMPLETENESS OR PERFORMANCE.
30* $/LicenseInfo$
31*/
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterwindlight.h"
36
37#include "pipeline.h"
38#include "llsky.h"
39
40#include "llsliderctrl.h"
41#include "llmultislider.h"
42#include "llmultisliderctrl.h"
43#include "llspinctrl.h"
44#include "llcheckboxctrl.h"
45#include "lluictrlfactory.h"
46#include "llviewercamera.h"
47#include "llcombobox.h"
48#include "lllineeditor.h"
49#include "llfloaterdaycycle.h"
50#include "lltabcontainer.h"
51#include "llboost.h"
52
53#include "llagent.h"
54#include "llinventorymodel.h"
55#include "llviewerinventory.h"
56
57#include "v4math.h"
58#include "llviewerdisplay.h"
59#include "llviewercontrol.h"
60#include "llviewerwindow.h"
61#include "llsavedsettingsglue.h"
62
63#include "llwlparamset.h"
64#include "llwlparammanager.h"
65#include "llwaterparammanager.h"
66#include "llpostprocess.h"
67#include "hippoLimits.h"
68#include "wlfloatermanager.h"
69#include "llviewerregion.h"
70#include "llviewerparcelmgr.h"
71#include "llparcel.h"
72#include "wlretrievesettings.h"
73#include "wlsettingsmanager.h"
74#include "wlfloaterwindlightsend.h"
75
76#undef max
77WLFloaterManager* WLFloaterManager::sWindLight;
78std::map<std::string, LLWLParamSet*> WLFloaterManager::mWLParamList;
79std::map<std::string, LLWaterParamSet*> WLFloaterManager::mWaterParamList;
80std::map<std::string, LLUUID*> WLFloaterManager::mWaterNormalParamList;
81std::map<std::string, LLSD> WLFloaterManager::mMinAltParamList;
82std::map<std::string, LLSD> WLFloaterManager::mMaxAltParamList;
83std::map<std::string, LLSD> WLFloaterManager::mFadeParamList;
84
85WLFloaterManager::WLFloaterManager() : LLFloater(std::string("windlight manager floater"))
86{
87 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_manager.xml");
88
89 // load it up
90 initCallbacks();
91}
92
93WLFloaterManager::~WLFloaterManager()
94{
95}
96
97void WLFloaterManager::initCallbacks(void) {
98
99 // help buttons
100 childSetAction("this_parcel", onGetThisParcel, this);
101 childSetAction("all_parcels", onGetAllParcels, this);
102 childSetAction("this_region", onGetThisRegion, this);
103 childSetAction("show", onShow, this);
104 childSetAction("set_to_current", onSetToCurrent, this);
105 childSetAction("remove", onRemove, this);
106}
107
108void WLFloaterManager::onClickHelp(void* data)
109{
110 LLFloaterWindLight* self = LLFloaterWindLight::instance();
111
112 const std::string xml_alert = *(std::string*)data;
113 LLNotifications::instance().add(self->contextualNotification(xml_alert));
114}
115
116void WLFloaterManager::initHelpBtn(const std::string& name, const std::string& xml_alert)
117{
118 childSetAction(name, onClickHelp, new std::string(xml_alert));
119}
120
121// static
122WLFloaterManager* WLFloaterManager::instance()
123{
124 if (!sWindLight)
125 {
126 sWindLight = new WLFloaterManager();
127 sWindLight->open();
128 sWindLight->setFocus(TRUE);
129 }
130 return sWindLight;
131}
132
133void WLFloaterManager::show()
134{
135 if (!sWindLight)
136 {
137 WLFloaterManager::instance();
138 }
139 else
140 {
141 if (sWindLight->getVisible())
142 {
143 sWindLight->close();
144 }
145 else
146 {
147 sWindLight->open();
148 }
149 }
150}
151
152bool WLFloaterManager::isOpen()
153{
154 if (sWindLight != NULL) {
155 return true;
156 }
157 return false;
158}
159
160// virtual
161void WLFloaterManager::onClose(bool app_quitting)
162{
163 if (sWindLight)
164 {
165 sWindLight->setVisible(FALSE);
166 }
167}
168
169void WLFloaterManager::onGetThisRegion(void* userData)
170{
171 LLSD body;
172
173 //Send the update CAPS to the server
174 std::string url = gAgent.getRegion()->getCapability("RetrieveWindLightSettings");
175 if (!url.empty())
176 {
177 body["RegionID"] = gAgent.getRegion()->getRegionID();
178 LLHTTPClient::post(url, body, new retrieveWindlightSettings(body));
179 }
180}
181
182void WLFloaterManager::onGetThisParcel(void* userData)
183{
184 LLSD body;
185
186 //Send the update CAPS to the server
187 std::string url = gAgent.getRegion()->getCapability("RetrieveWindLightSettings");
188 if (!url.empty())
189 {
190 body["ParcelID"] = LLViewerParcelMgr::getInstance()->getAgentParcel()->getLocalID();
191 LLHTTPClient::post(url, body, new retrieveWindlightSettings(body));
192 }
193}
194void WLFloaterManager::onGetAllParcels(void* userData)
195{
196 LLSD body;
197
198 //Send the update CAPS to the server
199 std::string url = gAgent.getRegion()->getCapability("RetrieveWindLightSettings");
200 if (!url.empty())
201 {
202 body["ParcelID"] = -1;
203 LLHTTPClient::post(url, body, new retrieveWindlightSettings(body));
204 }
205}
206
207void WLFloaterManager::onShow(void* userData)
208{
209 WLFloaterManager* mgr = WLFloaterManager::instance();
210 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo");
211 std::string name = comboBox->getSelectedItemLabel();
212 //Set the new settings up
213 LLWLParamSet* mSky = mgr->mWLParamList[name];
214 LLWaterParamSet* mWater = mgr->mWaterParamList[name];
215 LLUUID* mWaterNormal = mgr->mWaterNormalParamList[name];
216 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
217 WLSettingsManager::Apply(mSky, mWater, mWaterNormal);
218}
219void WLFloaterManager::onSetToCurrent(void* userData)
220{
221 WLFloaterManager* mgr = WLFloaterManager::instance();
222 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo");
223 std::string name = comboBox->getSelectedItemLabel();
224
225 LLWLParamSet* mSky = mgr->mWLParamList[name];
226 LLWaterParamSet* mWater = mgr->mWaterParamList[name];
227 LLUUID* mWaterNormal = mgr->mWaterNormalParamList[name];
228 LLSD fade = mgr->mFadeParamList[name];
229 LLSD minAlt = mgr->mMinAltParamList[name];
230 LLSD maxAlt = mgr->mMaxAltParamList[name];
231
232 int type = 1;
233 if(name == "(Region Settings)")
234 {
235 type = 0;
236 }
237
238 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
239 WLFloaterWindLightSend::SendSettings(false, type, NULL, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal);
240}
241void WLFloaterManager::onRemove(void* userData)
242{
243 WLFloaterManager* mgr = WLFloaterManager::instance();
244 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo");
245 std::string name = comboBox->getSelectedItemLabel();
246
247 LLWLParamSet* mSky = mgr->mWLParamList[name];
248 LLWaterParamSet* mWater = mgr->mWaterParamList[name];
249 LLUUID* mWaterNormal = mgr->mWaterNormalParamList[name];
250 LLSD fade = mgr->mFadeParamList[name];
251 LLSD minAlt = mgr->mMinAltParamList[name];
252 LLSD maxAlt = mgr->mMaxAltParamList[name];
253
254 int type = 1;
255 if(name == "(Region Settings)")
256 {
257 type = 0;
258 }
259
260 if(mSky != NULL && mWater != NULL && mWaterNormal != NULL)
261 WLFloaterWindLightSend::SendSettings(true, type, false, *mSky, *mWater, fade, minAlt, maxAlt, *mWaterNormal);
262}
263
264
265//static
266void WLFloaterManager::UpdateFloater()
267{
268 WLFloaterManager* mgr = WLFloaterManager::instance();
269 LLComboBox* comboBox = mgr->getChild<LLComboBox>("WLSettingsCombo");
270 comboBox->clear();
271 comboBox->removeall();
272 std::map<std::string, LLWLParamSet*>::iterator mIt =
273 WLFloaterManager::instance()->mWLParamList.begin();
274 for(; mIt != WLFloaterManager::instance()->mWLParamList.end(); mIt++)
275 {
276 comboBox->add(mIt->first);
277 }
278 //Reorder them
279 comboBox->sortByName();
280}
281
diff --git a/linden/indra/newview/wlfloatermanager.h b/linden/indra/newview/wlfloatermanager.h
new file mode 100644
index 0000000..0a2d0ca
--- /dev/null
+++ b/linden/indra/newview/wlfloatermanager.h
@@ -0,0 +1,93 @@
1/**
2 * @file wlfloaterwindlightsend.h
3 * @brief WLFloaterWindLightSend class definition
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33/*
34 * Menu for adjusting the atmospheric settings of the world
35 */
36
37#include "llfloater.h"
38
39#include <vector>
40#include "llwlparamset.h"
41
42struct WLColorControl;
43struct WLFloatControl;
44
45
46/// Menuing system for all of windlight's functionality
47class WLFloaterManager : public LLFloater
48{
49public:
50
51 WLFloaterManager();
52 virtual ~WLFloaterManager();
53
54 /// initialize all
55 void initCallbacks(void);
56
57 /// one and one instance only
58 static WLFloaterManager* instance();
59
60 // help button stuff
61 static void onClickHelp(void* data);
62 void initHelpBtn(const std::string& name, const std::string& xml_alert);
63
64 static void onGetThisRegion(void* userData);
65 static void onGetThisParcel(void* userData);
66 static void onGetAllParcels(void* userData);
67 static void onShow(void* userData);
68 static void onSetToCurrent(void* userData);
69 static void onRemove(void* userData);
70
71 //// menu management
72
73 /// show off our menu
74 static void show();
75
76 /// return if the menu exists or not
77 static bool isOpen();
78
79 /// stuff to do on exit
80 virtual void onClose(bool app_quitting);
81
82 static void UpdateFloater();
83 static std::map<std::string, LLWLParamSet*> mWLParamList;
84 static std::map<std::string, LLWaterParamSet*> mWaterParamList;
85 static std::map<std::string, LLUUID*> mWaterNormalParamList;
86 static std::map<std::string, LLSD> mMinAltParamList;
87 static std::map<std::string, LLSD> mMaxAltParamList;
88 static std::map<std::string, LLSD> mFadeParamList;
89
90private:
91 // one instance on the inside
92 static WLFloaterManager* sWindLight;
93}; \ No newline at end of file
diff --git a/linden/indra/newview/wlfloaterwindlightsend.cpp b/linden/indra/newview/wlfloaterwindlightsend.cpp
new file mode 100644
index 0000000..5244bcd
--- /dev/null
+++ b/linden/indra/newview/wlfloaterwindlightsend.cpp
@@ -0,0 +1,300 @@
1/**
2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition
4*
5* $LicenseInfo:firstyear=2007&license=viewergpl$
6*
7* Copyright (c) 2007-2009, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at
21* http://secondlifegrid.net/programs/open_source/licensing/flossexception
22*
23* By copying, modifying or distributing this software, you acknowledge
24* that you have read and understood your obligations described above,
25* and agree to abide by those obligations.
26*
27* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29* COMPLETENESS OR PERFORMANCE.
30* $/LicenseInfo$
31*/
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterwindlight.h"
36
37#include "pipeline.h"
38#include "llsky.h"
39
40#include "llsliderctrl.h"
41#include "llmultislider.h"
42#include "llmultisliderctrl.h"
43#include "llspinctrl.h"
44#include "llcheckboxctrl.h"
45#include "lluictrlfactory.h"
46#include "llviewercamera.h"
47#include "llcombobox.h"
48#include "lllineeditor.h"
49#include "llfloaterdaycycle.h"
50#include "lltabcontainer.h"
51#include "llboost.h"
52
53#include "llagent.h"
54#include "llinventorymodel.h"
55#include "llviewerinventory.h"
56
57#include "v4math.h"
58#include "llviewerdisplay.h"
59#include "llviewercontrol.h"
60#include "llviewerwindow.h"
61#include "llsavedsettingsglue.h"
62
63#include "llwlparamset.h"
64#include "llwlparammanager.h"
65#include "llwaterparammanager.h"
66#include "llpostprocess.h"
67#include "hippoLimits.h"
68#include "wlfloaterwindlightsend.h"
69#include "llviewerregion.h"
70
71#undef max
72
73
74WLFloaterWindLightSend* WLFloaterWindLightSend::sWindLight = NULL;
75
76WLFloaterWindLightSend::WLFloaterWindLightSend() : LLFloater(std::string("windlight send floater"))
77{
78 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_remote_save.xml");
79
80 // load it up
81 initCallbacks();
82}
83
84WLFloaterWindLightSend::~WLFloaterWindLightSend()
85{
86}
87
88void WLFloaterWindLightSend::initCallbacks(void) {
89
90 // help buttons
91 initHelpBtn("fade_help", "HelpBlueHorizon");
92 initHelpBtn("override_parcel_default_help", "HelpHazeHorizon");
93 initHelpBtn("override_parcel_help", "HelpBlueDensity");
94 initHelpBtn("max_altitude_help", "HelpHazeDensity");
95 initHelpBtn("min_altitude_help", "HelpDensityMult");
96 childSetAction("button_region_send_to_server", onSaveRegionPreset, this);
97 childSetAction("button_parcel_send_to_server", onSaveParcelPreset, this);
98}
99
100void WLFloaterWindLightSend::onClickHelp(void* data)
101{
102 LLFloaterWindLight* self = LLFloaterWindLight::instance();
103
104 const std::string xml_alert = *(std::string*)data;
105 LLNotifications::instance().add(self->contextualNotification(xml_alert));
106}
107
108void WLFloaterWindLightSend::initHelpBtn(const std::string& name, const std::string& xml_alert)
109{
110 childSetAction(name, onClickHelp, new std::string(xml_alert));
111}
112
113// static
114WLFloaterWindLightSend* WLFloaterWindLightSend::instance()
115{
116 if (!sWindLight)
117 {
118 sWindLight = new WLFloaterWindLightSend();
119 sWindLight->open();
120 sWindLight->setFocus(TRUE);
121 }
122 return sWindLight;
123}
124
125void WLFloaterWindLightSend::show()
126{
127 if (!sWindLight)
128 {
129 WLFloaterWindLightSend::instance();
130 }
131 else
132 {
133 if (sWindLight->getVisible())
134 {
135 sWindLight->close();
136 }
137 else
138 {
139 sWindLight->open();
140 }
141 }
142}
143
144bool WLFloaterWindLightSend::isOpen()
145{
146 if (sWindLight != NULL) {
147 return true;
148 }
149 return false;
150}
151
152// virtual
153void WLFloaterWindLightSend::onClose(bool app_quitting)
154{
155 if (sWindLight)
156 {
157 sWindLight->setVisible(FALSE);
158 }
159}
160
161void WLFloaterWindLightSend::onSaveRegionPreset(void* userData)
162{
163 int RegionType = 0;
164 SendSettings(false, RegionType,
165 WLFloaterWindLightSend::instance()->childGetValue("override_parcel"),
166 LLWLParamManager::instance()->mCurParams,
167 LLWaterParamManager::instance()->mCurParams,
168 WLFloaterWindLightSend::instance()->childGetValue("Fade"),
169 WLFloaterWindLightSend::instance()->childGetValue("min_altitude"),
170 WLFloaterWindLightSend::instance()->childGetValue("max_altitude"),
171 LLWaterParamManager::instance()->getNormalMapID());
172}
173void WLFloaterWindLightSend::onSaveParcelPreset(void* userData)
174{
175 int ParcelType = 1;
176 SendSettings(false, ParcelType, false, LLWLParamManager::instance()->mCurParams,
177 LLWaterParamManager::instance()->mCurParams,
178 WLFloaterWindLightSend::instance()->childGetValue("Fade"),
179 WLFloaterWindLightSend::instance()->childGetValue("min_altitude"),
180 WLFloaterWindLightSend::instance()->childGetValue("max_altitude"),
181 LLWaterParamManager::instance()->getNormalMapID());
182}
183void WLFloaterWindLightSend::SendSettings(bool remove, int type, bool overrideParcels,
184 LLWLParamSet mSky, LLWaterParamSet mWater,
185 LLSD fade, LLSD minAlt, LLSD maxAlt,
186 LLUUID normalMap)
187{
188 LLSD body;
189 std::string url = gAgent.getRegion()->getCapability("DispatchWindLightSettings");
190 if (!url.empty())
191 {
192 bool error;
193
194 body["type"] = type;
195 body["remove"] = remove;
196 body["fade"] = fade;
197 body["maxEffectiveAltitude"] = maxAlt;
198 body["minEffectiveAltitude"] = minAlt;
199 if(overrideParcels == true || overrideParcels == false)
200 body["overrideParcels"] = overrideParcels;
201
202 LLVector4 v = mSky.getVector("ambient", error);
203 body["ambientX"] = v[0] / 3.0;
204 body["ambientY"] = v[1] / 3.0;
205 body["ambientZ"] = v[2] / 3.0;
206 body["ambientW"] = v[3] / 3.0;
207
208 body["eastAngle"] = mSky.getEastAngle();
209 body["sunMoonPosition"] = mSky.getSunAngle();
210
211 v = mSky.getVector("sunlight_color",error);
212 body["sunMoonColorX"] = v[0] / 3.0;
213 body["sunMoonColorY"] = v[1] / 3.0;
214 body["sunMoonColorZ"] = v[2] / 3.0;
215 body["sunMoonColorW"] = v[3] / 3.0;
216
217 v = mSky.getVector("blue_horizon",error);
218 body["horizonX"] = v[0] / 2.0;
219 body["horizonY"] = v[1] / 2.0;
220 body["horizonZ"] = v[2] / 2.0;
221 body["horizonW"] = v[3] / 2.0;
222
223 v = mSky.getVector("blue_density",error);
224 body["blueDensityX"] = v[0];
225 body["blueDensityY"] = v[1];
226 body["blueDensityZ"] = v[2];
227
228 v = mSky.getVector("haze_horizon",error);
229 body["hazeHorizon"] = v[0];
230
231 body["hazeDensity"] = mSky.getFloat("haze_density",error);
232 body["cloudCoverage"] = mSky.getFloat("cloud_shadow",error);
233 body["densityMultiplier"] = mSky.getFloat("density_multiplier",error) * 1000;
234 body["distanceMultiplier"] = mSky.getFloat("distance_multiplier",error);
235 body["maxAltitude"] = mSky.getFloat("max_y",error);
236
237 v = mSky.getVector("cloud_color",error);
238 body["cloudColorX"] = v[0];
239 body["cloudColorY"] = v[1];
240 body["cloudColorZ"] = v[2];
241 body["cloudColorW"] = v[3];
242
243 v = mSky.getVector("cloud_pos_density1",error);
244 body["cloudXYDensityX"] = v[0];
245 body["cloudXYDensityY"] = v[1];
246 body["cloudXYDensityZ"] = v[2];
247
248 v = mSky.getVector("cloud_pos_density2",error);
249 body["cloudDetailXYDensityX"] = v[0];
250 body["cloudDetailXYDensityY"] = v[1];
251 body["cloudDetailXYDensityZ"] = v[2];
252
253 v = mSky.getVector("glow",error);
254 body["sunGlowSize"] = -((v[0]/ 20) - 2);
255 body["sunGlowFocus"] = -v[2] / 5;
256
257 body["cloudScale"] = mSky.getFloat("cloud_scale",error);
258 body["sceneGamma"] = mSky.getFloat("gamma",error);
259 body["cloudScrollX"] = mSky.getCloudScrollX() - 10;
260 body["cloudScrollY"] = mSky.getCloudScrollY() - 10;
261 body["cloudScrollXLock"] = !mSky.getEnableCloudScrollX();
262 body["cloudScrollYLock"] = !mSky.getEnableCloudScrollY();
263 body["starBrightness"] = mSky.getStarBrightness();
264 body["drawClassicClouds"] = gHippoLimits->skyUseClassicClouds;
265 body["classicCloudHeight"] = gSavedSettings.getF32("ClassicCloudHeight");
266 body["classicCloudRange"] = gSavedSettings.getF32("ClassicCloudRange");
267
268 LLVector3 vvv = mWater.getVector3("normScale",error);
269 body["reflectionWaveletScaleX"] = vvv[0];
270 body["reflectionWaveletScaleY"] = vvv[1];
271 body["reflectionWaveletScaleZ"] = vvv[2];
272
273 v = mWater.getVector4("waterFogColor",error);
274 body["waterColorX"] = v[0] * 256.0;
275 body["waterColorY"] = v[1] * 256.0;
276 body["waterColorZ"] = v[2] * 256.0;
277 body["waterColorW"] = v[3] * 256.0;
278
279 body["waterFogDensityExponent"] = mWater.getFloat("waterFogDensity", error);
280 body["underwaterFogModifier"] = mWater.getFloat("underWaterFogMod", error);
281
282 body["fresnelScale"] = mWater.getFloat("fresnelScale", error);
283 body["fresnelOffset"] = mWater.getFloat("fresnelOffset", error);
284 body["refractScaleAbove"] = mWater.getFloat("scaleAbove", error);
285 body["refractScaleBelow"] = mWater.getFloat("scaleBelow", error);
286 body["blurMultiplier"] = mWater.getFloat("blurMultiplier", error);
287
288 LLVector2 vv = mWater.getVector2("wave1Dir",error);
289 body["littleWaveDirectionX"] = vv[0];
290 body["littleWaveDirectionY"] = vv[1];
291
292 vv = mWater.getVector2("wave2Dir",error);
293 body["bigWaveDirectionX"] = vv[0];
294 body["bigWaveDirectionY"] = vv[1];
295
296 body["normalMapTexture"] = normalMap;
297
298 LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
299 }
300} \ No newline at end of file
diff --git a/linden/indra/newview/wlfloaterwindlightsend.h b/linden/indra/newview/wlfloaterwindlightsend.h
new file mode 100644
index 0000000..acd4386
--- /dev/null
+++ b/linden/indra/newview/wlfloaterwindlightsend.h
@@ -0,0 +1,88 @@
1/**
2 * @file wlfloaterwindlightsend.h
3 * @brief WLFloaterWindLightSend class definition
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33/*
34 * Menu for adjusting the atmospheric settings of the world
35 */
36
37#include "llfloater.h"
38
39#include <vector>
40#include "llwlparamset.h"
41#include "llwaterparamset.h"
42#include "llsd.h"
43
44struct WLColorControl;
45struct WLFloatControl;
46
47
48/// Menuing system for all of windlight's functionality
49class WLFloaterWindLightSend : public LLFloater
50{
51public:
52
53 WLFloaterWindLightSend();
54 virtual ~WLFloaterWindLightSend();
55
56 /// initialize all
57 void initCallbacks(void);
58
59 /// one and one instance only
60 static WLFloaterWindLightSend* instance();
61
62 // help button stuff
63 static void onClickHelp(void* data);
64 void initHelpBtn(const std::string& name, const std::string& xml_alert);
65
66 static void onSaveParcelPreset(void* userData);
67 static void onSaveRegionPreset(void* userData);
68
69 //// menu management
70
71 /// show off our menu
72 static void show();
73
74 /// return if the menu exists or not
75 static bool isOpen();
76
77 /// stuff to do on exit
78 virtual void onClose(bool app_quitting);
79
80 static void SendSettings(bool remove, int type, bool overrideParcel,
81 LLWLParamSet mSky, LLWaterParamSet mWater,
82 LLSD Fade, LLSD minAlt, LLSD maxAlt,
83 LLUUID normalMap);
84
85private:
86 // one instance on the inside
87 static WLFloaterWindLightSend* sWindLight;
88}; \ No newline at end of file
diff --git a/linden/indra/newview/wlretrievesettings.cpp b/linden/indra/newview/wlretrievesettings.cpp
new file mode 100644
index 0000000..ca91ba2
--- /dev/null
+++ b/linden/indra/newview/wlretrievesettings.cpp
@@ -0,0 +1,238 @@
1/**
2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition
4*
5* $LicenseInfo:firstyear=2007&license=viewergpl$
6*
7* Copyright (c) 2007-2009, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at
21* http://secondlifegrid.net/programs/open_source/licensing/flossexception
22*
23* By copying, modifying or distributing this software, you acknowledge
24* that you have read and understood your obligations described above,
25* and agree to abide by those obligations.
26*
27* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29* COMPLETENESS OR PERFORMANCE.
30* $/LicenseInfo$
31*/
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterwindlight.h"
36
37#include "pipeline.h"
38#include "llsky.h"
39
40#include "llsliderctrl.h"
41#include "llmultislider.h"
42#include "llmultisliderctrl.h"
43#include "llspinctrl.h"
44#include "llcheckboxctrl.h"
45#include "lluictrlfactory.h"
46#include "llviewercamera.h"
47#include "llcombobox.h"
48#include "lllineeditor.h"
49#include "llfloaterdaycycle.h"
50#include "lltabcontainer.h"
51#include "llboost.h"
52
53#include "llagent.h"
54#include "llinventorymodel.h"
55#include "llviewerinventory.h"
56
57#include "v4math.h"
58#include "llviewerdisplay.h"
59#include "llviewercontrol.h"
60#include "llviewerwindow.h"
61#include "llsavedsettingsglue.h"
62
63#include "llwlparamset.h"
64#include "llwlparammanager.h"
65#include "llwaterparammanager.h"
66#include "llpostprocess.h"
67#include "hippoLimits.h"
68#include "wlfloaterwindlightsend.h"
69#include "llviewerregion.h"
70#include "wlsettingsmanager.h"
71#include "lightshare.h"
72
73#include "linden_common.h"
74#include "llviewercontrol.h"
75#include "message.h"
76#include "meta7windlight.h"
77#include "wlretrievesettings.h"
78#include "wlfloatermanager.h"
79
80#undef max
81
82//If we get back a normal response, handle it here
83void retrieveWindlightSettings::result(const LLSD& content)
84{
85 //Clear the lists first
86 WLFloaterManager::mMinAltParamList.clear();
87 WLFloaterManager::mMaxAltParamList.clear();
88 WLFloaterManager::mFadeParamList.clear();
89 WLFloaterManager::mWLParamList.clear();
90 WLFloaterManager::mWaterParamList.clear();
91 WLFloaterManager::mWaterNormalParamList.clear();
92
93 for(LLSD::array_const_iterator wls = content["WindLight"].beginArray();
94 wls != content["WindLight"].endArray();
95 ++wls)
96 {
97 LLSD windLightLLSD = *wls;
98 LLWaterParamSet* mWater;
99 LLWLParamSet* mSky;
100 LLUUID* mWaterNormal;
101
102 mWater = new LLWaterParamSet();
103 mSky = new LLWLParamSet();
104 mWaterNormal = new LLUUID();
105
106 mWater->set("waterFogColor",
107 windLightLLSD["waterColorX"].asReal() / 256.f,
108 windLightLLSD["waterColorY"].asReal() / 256.f,
109 windLightLLSD["waterColorZ"].asReal() / 256.f,
110 windLightLLSD["waterColorW"].asReal() / 256.f);
111 mWater->set("waterFogDensity", windLightLLSD["waterFogDensityExponent"].asReal());
112 mWater->set("underWaterFogMod", windLightLLSD["underwaterFogModifier"].asReal());
113 mWater->set("normScale", windLightLLSD["reflectionWaveletScaleX"].asReal(),
114 windLightLLSD["reflectionWaveletScaleY"].asReal(),
115 windLightLLSD["reflectionWaveletScaleZ"].asReal());
116 mWater->set("fresnelScale", windLightLLSD["fresnelScale"].asReal());
117 mWater->set("fresnelOffset", windLightLLSD["fresnelOffset"].asReal());
118 mWater->set("scaleAbove", windLightLLSD["refractScaleAbove"].asReal());
119 mWater->set("scaleBelow", windLightLLSD["refractScaleBelow"].asReal());
120 mWater->set("blurMultiplier", windLightLLSD["blurMultiplier"].asReal());
121 mWater->set("wave2Dir", windLightLLSD["bigWaveDirectionX"].asReal(),
122 windLightLLSD["bigWaveDirectionY"].asReal());
123 mWater->set("wave1Dir", windLightLLSD["littleWaveDirectionX"].asReal(),
124 windLightLLSD["littleWaveDirectionY"].asReal());
125 mWaterNormal->parseUUID(windLightLLSD["normalMapTexture"].asUUID().asString(), mWaterNormal);
126
127 mSky->setSunAngle(windLightLLSD["sunMoonPosition"].asReal());
128 mSky->setEastAngle(windLightLLSD["eastAngle"].asReal());
129
130 mSky->set("sunlight_color",
131 windLightLLSD["sunMoonColorX"].asReal() * 3.0f,
132 windLightLLSD["sunMoonColorY"].asReal() * 3.0f,
133 windLightLLSD["sunMoonColorZ"].asReal() * 3.0f,
134 windLightLLSD["sunMoonColorW"].asReal() * 3.0f);
135
136 mSky->set("ambient",
137 windLightLLSD["ambientX"].asReal() * 3.0f,
138 windLightLLSD["ambientY"].asReal() * 3.0f,
139 windLightLLSD["ambientZ"].asReal() * 3.0f,
140 windLightLLSD["ambientW"].asReal() * 3.0f);
141
142 mSky->set("blue_horizon",
143 windLightLLSD["horizonX"].asReal() * 2.0f,
144 windLightLLSD["horizonY"].asReal() * 2.0f,
145 windLightLLSD["horizonZ"].asReal() * 2.0f,
146 windLightLLSD["horizonW"].asReal() * 2.0f);
147
148 mSky->set("blue_density",
149 windLightLLSD["blueDensityX"].asReal(),
150 windLightLLSD["blueDensityY"].asReal(),
151 windLightLLSD["blueDensityZ"].asReal(),
152 1.0);
153
154 mSky->set("haze_horizon",
155 windLightLLSD["hazeHorizon"].asReal(),
156 windLightLLSD["hazeHorizon"].asReal(),
157 windLightLLSD["hazeHorizon"].asReal(),
158 1.f);
159
160 mSky->set("haze_density",
161 windLightLLSD["hazeDensity"].asReal(),
162 0.f, 0.f, 1.f);
163
164 mSky->set("cloud_shadow",
165 windLightLLSD["cloudCoverage"].asReal(),
166 0.f, 0.f, 1.f);
167
168 mSky->set("density_multiplier",
169 windLightLLSD["densityMultiplier"].asReal() / 1000.0f,
170 0.f, 0.f, 1.f);
171
172 mSky->set("distance_multiplier",
173 windLightLLSD["distanceMultiplier"].asReal(),
174 0.f, 0.f, 1.f);
175
176 mSky->set("max_y",
177 windLightLLSD["maxAltitude"].asReal(),
178 0.f, 0.f, 1.f);
179
180 mSky->set("cloud_color",
181 windLightLLSD["cloudColorX"].asReal(),
182 windLightLLSD["cloudColorY"].asReal(),
183 windLightLLSD["cloudColorZ"].asReal(),
184 windLightLLSD["cloudColorW"].asReal());
185
186 mSky->set("cloud_pos_density1",
187 windLightLLSD["cloudXYDensityX"].asReal(),
188 windLightLLSD["cloudXYDensityY"].asReal(),
189 windLightLLSD["cloudXYDensityZ"].asReal(),
190 1.f);
191
192 mSky->set("cloud_pos_density2",
193 windLightLLSD["cloudDetailXYDensityX"].asReal(),
194 windLightLLSD["cloudDetailXYDensityY"].asReal(),
195 windLightLLSD["cloudDetailXYDensityZ"].asReal(),
196 1.f);
197
198 mSky->set("cloud_scale",
199 windLightLLSD["cloudScale"].asReal(),
200 0.f, 0.f, 1.f);
201
202 mSky->set("gamma",
203 windLightLLSD["sceneGamma"].asReal(),
204 0.f, 0.f, 1.f);
205
206 mSky->set("glow",
207 (2 - windLightLLSD["sunGlowSize"].asReal()) * 20,
208 0.f,
209 -windLightLLSD["sunGlowFocus"].asReal() * 5,
210 1.f);
211
212 mSky->setCloudScrollX(windLightLLSD["cloudScrollX"].asReal() + 10.0f);
213 mSky->setCloudScrollY(windLightLLSD["cloudScrollY"].asReal() + 10.0f);
214
215 mSky->setEnableCloudScrollX(!windLightLLSD["cloudScrollXLock"].asBoolean());
216 mSky->setEnableCloudScrollY(!windLightLLSD["cloudScrollYLock"].asBoolean());
217
218 mSky->setStarBrightness(windLightLLSD["starBrightness"].asReal());
219
220 mSky->set("fade", windLightLLSD["fade"].asReal());
221
222 WLFloaterManager::mMinAltParamList[windLightLLSD["Name"].asString()] = windLightLLSD["minEffectiveAltitude"].asReal();
223 WLFloaterManager::mMaxAltParamList[windLightLLSD["Name"].asString()] = windLightLLSD["maxEffectiveAltitude"].asReal();
224 WLFloaterManager::mFadeParamList[windLightLLSD["Name"].asString()] = windLightLLSD["fade"].asReal();
225
226 WLFloaterManager::mWLParamList[windLightLLSD["Name"].asString()] = mSky;
227 WLFloaterManager::mWaterParamList[windLightLLSD["Name"].asString()] = mWater;
228 WLFloaterManager::mWaterNormalParamList[windLightLLSD["Name"].asString()] = mWaterNormal;
229 }
230 WLFloaterManager::UpdateFloater();
231}
232
233//If we get back an error (not found, etc...), handle it here
234void retrieveWindlightSettings::error(U32 status, const std::string& reason)
235{
236 LL_INFOS("Inventory") << "retrieveWindlightSettings::error "
237 << status << ": " << reason << LL_ENDL;
238} \ No newline at end of file
diff --git a/linden/indra/newview/wlretrievesettings.h b/linden/indra/newview/wlretrievesettings.h
new file mode 100644
index 0000000..d75d0d1
--- /dev/null
+++ b/linden/indra/newview/wlretrievesettings.h
@@ -0,0 +1,59 @@
1/**
2 * @file wlfloaterwindlightsend.h
3 * @brief WLFloaterWindLightSend class definition
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33/*
34 * Menu for adjusting the atmospheric settings of the world
35 */
36
37
38#include <string>
39#include "llwlparamset.h"
40#include "llwaterparamset.h"
41#include "lluuid.h"
42
43class LLSD;
44class LLTimer;
45class LLUUID;
46class LLWaterParamSet;
47class LLWLParamSet;
48
49
50/// Menuing system for all of windlight's functionality
51class retrieveWindlightSettings: public LLHTTPClient::Responder
52{
53public:
54 retrieveWindlightSettings(const LLSD& request_sd) : mRequestSD(request_sd) {};
55 void result(const LLSD& content);
56 void error(U32 status, const std::string& reason);
57protected:
58 LLSD mRequestSD;
59}; \ No newline at end of file
diff --git a/linden/indra/newview/wlsettingsmanager.cpp b/linden/indra/newview/wlsettingsmanager.cpp
new file mode 100644
index 0000000..78516df
--- /dev/null
+++ b/linden/indra/newview/wlsettingsmanager.cpp
@@ -0,0 +1,249 @@
1/**
2* @file wlfloaterwindlightsend.cpp
3* @brief WLFloaterWindLightSend class definition
4*
5* $LicenseInfo:firstyear=2007&license=viewergpl$
6*
7* Copyright (c) 2007-2009, Linden Research, Inc.
8*
9* Second Life Viewer Source Code
10* The source code in this file ("Source Code") is provided by Linden Lab
11* to you under the terms of the GNU General Public License, version 2.0
12* ("GPL"), unless you have obtained a separate licensing agreement
13* ("Other License"), formally executed by you and Linden Lab. Terms of
14* the GPL can be found in doc/GPL-license.txt in this distribution, or
15* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16*
17* There are special exceptions to the terms and conditions of the GPL as
18* it is applied to this Source Code. View the full text of the exception
19* in the file doc/FLOSS-exception.txt in this software distribution, or
20* online at
21* http://secondlifegrid.net/programs/open_source/licensing/flossexception
22*
23* By copying, modifying or distributing this software, you acknowledge
24* that you have read and understood your obligations described above,
25* and agree to abide by those obligations.
26*
27* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29* COMPLETENESS OR PERFORMANCE.
30* $/LicenseInfo$
31*/
32
33#include "llviewerprecompiledheaders.h"
34
35#include "llfloaterwindlight.h"
36
37#include "pipeline.h"
38#include "llsky.h"
39
40#include "llsliderctrl.h"
41#include "llmultislider.h"
42#include "llmultisliderctrl.h"
43#include "llspinctrl.h"
44#include "llcheckboxctrl.h"
45#include "lluictrlfactory.h"
46#include "llviewercamera.h"
47#include "llcombobox.h"
48#include "lllineeditor.h"
49#include "llfloaterdaycycle.h"
50#include "lltabcontainer.h"
51#include "llboost.h"
52
53#include "llagent.h"
54#include "llinventorymodel.h"
55#include "llviewerinventory.h"
56
57#include "v4math.h"
58#include "llviewerdisplay.h"
59#include "llviewercontrol.h"
60#include "llviewerwindow.h"
61#include "llsavedsettingsglue.h"
62
63#include "llwlparamset.h"
64#include "llwlparammanager.h"
65#include "llwaterparammanager.h"
66#include "llpostprocess.h"
67#include "hippoLimits.h"
68#include "wlfloaterwindlightsend.h"
69#include "llviewerregion.h"
70#include "wlsettingsmanager.h"
71#include "lightshare.h"
72
73#include "linden_common.h"
74#include "llviewercontrol.h"
75#include "message.h"
76#include "meta7windlight.h"
77
78#undef max
79
80const std::string WLSettingsManager::wlWaterPresetName = "(Region settings)";
81const std::string WLSettingsManager::wlSkyPresetName = "(Region settings)";
82
83LLTimer* WLSettingsManager::wlIgnoreTimer = new LLTimer();
84bool WLSettingsManager::wlIgnoreRegion = false;
85LLWaterParamSet* WLSettingsManager::mWater = NULL;
86LLWLParamSet* WLSettingsManager::mSky = NULL;
87LLUUID* WLSettingsManager::mWaterNormal = NULL;
88
89void WLSettingsManager::Apply( LLWLParamSet* Sky, LLWaterParamSet* Water, LLUUID* WaterNormal )
90{
91 if( gSavedSettings.getU32("LightShareAllowed") <= WindlightMessage::LIGHTSHARE_NEVER )
92 return;
93
94 std::string water = LLWaterParamManager::instance()->mCurParams.mName;
95 std::string sky = LLWLParamManager::instance()->mCurParams.mName;
96
97 // If they are using region settings already, or LightShare is
98 // always allowed, just apply the new settings, don't bother asking.
99 if( gSavedSettings.getU32("LightShareAllowed") == WindlightMessage::LIGHTSHARE_ALWAYS ||
100 (sky == wlSkyPresetName && water == wlWaterPresetName) )
101 {
102 mSky = Sky;
103 mWater = Water;
104 mWaterNormal = WaterNormal;
105 Apply();
106 return;
107 }
108
109 if( !wlignoreTimerHasExpired() )
110 {
111 // The user recently ignored a windlight message, so ignore
112 // this one too, and restart the timer.
113 wlrestartIgnoreTimer();
114 return;
115 }
116
117 if(wlIgnoreRegion)
118 {
119 // We are ignoring new settings until user enters a new region.
120 return;
121 }
122
123 if( gSavedSettings.getU32("LightShareAllowed") == WindlightMessage::LIGHTSHARE_ASK &&
124 mSky == NULL && mWater == NULL)
125 {
126 // No most recent, so store this and create notification
127 // asking the user whether to apply or not.
128 mSky = Sky;
129 mWater = Water;
130 mWaterNormal = WaterNormal;
131 LLNotifications::instance().add("ConfirmLightShare", LLSD(), LLSD(),
132 boost::bind(&wlapplyCallback, _1, _2));
133 }
134 else
135 {
136 // No new notification (to avoid spamming the user, we do keep the saves from above)
137 mSky = Sky;
138 mWater = Water;
139 mWaterNormal = WaterNormal;
140 }
141}
142
143// static
144bool WLSettingsManager::wlapplyCallback(const LLSD& notification,
145 const LLSD& response)
146{
147 S32 option = LLNotification::getSelectedOption(notification, response);
148
149 switch(option)
150 {
151 case 0:{
152 // "Apply"
153 Apply();
154 break;
155 }
156 case 1:{
157 // "Not Now", ignore until the region stops spamming
158 wlrestartIgnoreTimer();
159 break;
160 }
161 case 2:{
162 // "Ignore", ignore all until user leaves the region
163 wlIgnoreRegion = true;
164 break;
165 }
166 }
167 return false;
168}
169
170//static
171void WLSettingsManager::Apply()
172{
173 LLWaterParamManager* water_mgr = LLWaterParamManager::instance();
174 LLWLParamManager* sky_mgr = LLWLParamManager::instance();
175
176 F32 fade = 0; //Instant
177 bool error;
178 fade = mSky->getFloat("fade", error);
179
180 mWater->mName = wlWaterPresetName;
181 if(fade != 0)
182 {
183 LLWaterParamSet oldWset = water_mgr->mCurParams;
184 //This still needs done so that we update right, but load it to the old
185 water_mgr->removeParamSet( wlWaterPresetName, false );
186 water_mgr->addParamSet( wlWaterPresetName, oldWset );
187 water_mgr->savePreset( wlWaterPresetName );
188 water_mgr->loadPreset( wlWaterPresetName, true );
189 water_mgr->setNormalMapID( *mWaterNormal );
190 //Then mix with the new
191 water_mgr->SetMixTime(mWater, fade);
192 }
193 else
194 {
195 //Instant if fade is 0
196 water_mgr->removeParamSet( wlWaterPresetName, false );
197 water_mgr->addParamSet( wlWaterPresetName, *mWater );
198 water_mgr->savePreset( wlWaterPresetName );
199 water_mgr->loadPreset( wlWaterPresetName, true );
200 water_mgr->setNormalMapID( *mWaterNormal );
201 }
202
203 mSky->mName = wlSkyPresetName;
204 if(fade != 0)
205 {
206 LLWLParamSet oldset = sky_mgr->mCurParams;
207 //This still needs done so that we update right, but load it to the old
208 sky_mgr->removeParamSet( wlSkyPresetName, true );
209 sky_mgr->addParamSet( wlSkyPresetName, oldset );
210 sky_mgr->savePreset( wlSkyPresetName );
211 sky_mgr->loadPreset( wlSkyPresetName, true );
212 //Then mix with the new
213 sky_mgr->SetMixTime(mSky, fade);
214 }
215 else
216 {
217 //Instant if fade is 0
218 sky_mgr->mAnimator.mIsRunning = false;
219 sky_mgr->mAnimator.mUseLindenTime = false;
220 sky_mgr->removeParamSet( wlSkyPresetName, false );
221 sky_mgr->addParamSet( wlSkyPresetName, *mSky );
222 sky_mgr->savePreset( wlSkyPresetName );
223 sky_mgr->loadPreset( wlSkyPresetName, true );
224 }
225
226 mSky = NULL;
227 mWater = NULL;
228 mWaterNormal = NULL;
229}
230
231// static
232void WLSettingsManager::wlresetRegion()
233{
234 wlIgnoreRegion = false;
235}
236
237// static
238void WLSettingsManager::wlrestartIgnoreTimer()
239{
240 F32 time = gSavedSettings.getF32("LightShareIgnoreTimer");
241 wlIgnoreTimer->start();
242 wlIgnoreTimer->setTimerExpirySec( (time < 0) ? 0 : time );
243}
244
245// static
246bool WLSettingsManager::wlignoreTimerHasExpired()
247{
248 return wlIgnoreTimer->hasExpired();
249} \ No newline at end of file
diff --git a/linden/indra/newview/wlsettingsmanager.h b/linden/indra/newview/wlsettingsmanager.h
new file mode 100644
index 0000000..5a0e9e7
--- /dev/null
+++ b/linden/indra/newview/wlsettingsmanager.h
@@ -0,0 +1,90 @@
1/**
2 * @file wlfloaterwindlightsend.h
3 * @brief WLFloaterWindLightSend class definition
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33/*
34 * Menu for adjusting the atmospheric settings of the world
35 */
36
37#ifndef WINDLIGHTSETTINGSMANAGER_H
38#define WINDLIGHTSETTINGSMANAGER_H
39
40#include <string>
41#include "llwlparamset.h"
42#include "llwaterparamset.h"
43#include "lluuid.h"
44
45class LLSD;
46class LLTimer;
47class LLUUID;
48class LLWaterParamSet;
49class LLWLParamSet;
50
51
52/// Menuing system for all of windlight's functionality
53class WLSettingsManager
54{
55public:
56
57 static LLTimer* wlIgnoreTimer;
58 static bool wlIgnoreRegion;
59
60 // Called after the user has entered a new region, to reset the
61 // "ignore while in this region" state.
62 static void wlresetRegion();
63
64 static void Apply( LLWLParamSet* Sky, LLWaterParamSet* Water, LLUUID* WaterNormal );
65
66 // Callback when the user interacts with the notification.
67 static bool wlapplyCallback(const LLSD& notification,
68 const LLSD& response);
69
70 static LLWaterParamSet* mWater;
71 static LLWLParamSet* mSky;
72 static LLUUID* mWaterNormal;
73
74private:
75 static void Apply();
76
77 // The name of the water preset where the region settings are stored.
78 static const std::string wlWaterPresetName;
79
80 // The name of the sky preset where the region settings are stored.
81 static const std::string wlSkyPresetName;
82
83 // Restart the timer for temporarily ignoring settings.
84 static void wlrestartIgnoreTimer();
85
86 // Returns true if the ignore timer has expired (i.e. new settings
87 // should not be ignored anymore).
88 static bool wlignoreTimerHasExpired();
89};
90#endif \ No newline at end of file