summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llfloaterregioninfo.cpp57
-rwxr-xr-xindra/newview/llfloaterregioninfo.h6
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml13
4 files changed, 87 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1fdfdb51a8..2f396d20a0 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8149,6 +8149,17 @@
<key>Value</key>
<integer>256</integer>
</map>
+ <key>RegionCheckTextureHeights</key>
+ <map>
+ <key>Comment</key>
+ <string>Don't allow user to set low heights greater than high</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
<key>RememberPassword</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 16566bea73..df5b226d98 100755
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1184,6 +1184,22 @@ BOOL LLPanelRegionTerrainInfo::validateTextureSizes()
return TRUE;
}
+BOOL LLPanelRegionTerrainInfo::validateTextureHeights()
+{
+ for (S32 i = 0; i < CORNER_COUNT; ++i)
+ {
+ std::string low = llformat("height_start_spin_%d", i);
+ std::string high = llformat("height_range_spin_%d", i);
+
+ if (getChild<LLUICtrl>(low)->getValue().asReal() > getChild<LLUICtrl>(high)->getValue().asReal())
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
/////////////////////////////////////////////////////////////////////////////
// LLPanelRegionTerrainInfo
/////////////////////////////////////////////////////////////////////////////
@@ -1216,6 +1232,9 @@ BOOL LLPanelRegionTerrainInfo::postBuild()
childSetAction("upload_raw_btn", onClickUploadRaw, this);
childSetAction("bake_terrain_btn", onClickBakeTerrain, this);
+ mAskedTextureHeights = false;
+ mConfirmedTextureHeights = false;
+
return LLPanelRegionInfo::postBuild();
}
@@ -1298,6 +1317,21 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
return FALSE;
}
+ // Check if terrain Elevation Ranges are correct
+ if (gSavedSettings.getBOOL("RegionCheckTextureHeights") && !validateTextureHeights())
+ {
+ if (!mAskedTextureHeights)
+ {
+ LLNotificationsUtil::add("ConfirmTextureHeights", LLSD(), LLSD(), boost::bind(&LLPanelRegionTerrainInfo::callbackTextureHeights, this, _1, _2));
+ mAskedTextureHeights = true;
+ return FALSE;
+ }
+ else if (!mConfirmedTextureHeights)
+ {
+ return FALSE;
+ }
+ }
+
LLTextureCtrl* texture_ctrl;
std::string id_str;
LLMessageSystem* msg = gMessageSystem;
@@ -1338,6 +1372,29 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate()
return TRUE;
}
+bool LLPanelRegionTerrainInfo::callbackTextureHeights(const LLSD& notification, const LLSD& response)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0) // ok
+ {
+ mConfirmedTextureHeights = true;
+ }
+ else if (option == 1) // cancel
+ {
+ mConfirmedTextureHeights = false;
+ }
+ else if (option == 2) // don't ask
+ {
+ gSavedSettings.setBOOL("RegionCheckTextureHeights", FALSE);
+ mConfirmedTextureHeights = true;
+ }
+
+ onBtnSet();
+
+ mAskedTextureHeights = false;
+ return false;
+}
+
// static
void LLPanelRegionTerrainInfo::onClickDownloadRaw(void* data)
{
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index e7b49d8553..4cd50c0882 100755
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -237,6 +237,7 @@ public:
void setEnvControls(bool available); // Whether environment settings are available for this region
BOOL validateTextureSizes();
+ BOOL validateTextureHeights();
//static void onChangeAnything(LLUICtrl* ctrl, void* userData); // callback for any change, to enable commit button
@@ -246,6 +247,11 @@ public:
static void onClickUploadRaw(void*);
static void onClickBakeTerrain(void*);
bool callbackBakeTerrain(const LLSD& notification, const LLSD& response);
+ bool callbackTextureHeights(const LLSD& notification, const LLSD& response);
+
+private:
+ bool mConfirmedTextureHeights;
+ bool mAskedTextureHeights;
};
/////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index d567897ed8..74e1eb527c 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3580,6 +3580,19 @@ Do you really want to bake the current terrain, make it the center for terrain r
<notification
icon="alertmodal.tga"
+ name="ConfirmTextureHeights"
+ type="alertmodal">
+You're about to use low values greater than high ones for Elevation Ranges. Proceed?
+ <tag>confirm</tag>
+ <usetemplate
+ name="yesnocancelbuttons"
+ yestext="Ok"
+ notext="Cancel"
+ canceltext="Don't ask"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="MaxAllowedAgentOnRegion"
type="alertmodal">
You can only have [MAX_AGENTS] Allowed Residents.