summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-03-31 18:24:01 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-03-31 18:24:01 +0300
commit7419abc12ba07380593fa3c0571155b248b8c8a6 (patch)
tree42085618659d245e93589e6554ab0607f1c294f8
parent79fb8e2ec26dc2c5a42ef1ee48ebaaa39183c67b (diff)
STORM-1126 WIP Windlight Estate Settings integration: pass 5
* Added "Apply Local to Region" button to the region terrain setttings panel. * Fixed previewing presets via a combomox in the Advanced Sky Editor floater.
-rw-r--r--indra/newview/llenvmanager.cpp6
-rw-r--r--indra/newview/llenvmanager.h2
-rw-r--r--indra/newview/llfloaterregioninfo.cpp8
-rw-r--r--indra/newview/llfloaterregioninfo.h1
-rw-r--r--indra/newview/llfloaterwindlight.cpp4
-rw-r--r--indra/newview/llfloaterwindlight.h2
-rw-r--r--indra/newview/skins/default/xui/en/panel_region_terrain.xml15
7 files changed, 32 insertions, 6 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index d4e60ffd94..010ecc267b 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -374,6 +374,12 @@ void LLEnvManager::commitSettingsFinished(LLEnvKey::EScope scope)
updateUIFromEditability();
}
+void LLEnvManager::applyLocalSettingsToRegion()
+{
+ // Immediately apply current environment settings to region.
+ LLEnvManager::instance().commitSettings(LLEnvKey::SCOPE_REGION);
+}
+
/*******
* Loading defaults
*******/
diff --git a/indra/newview/llenvmanager.h b/indra/newview/llenvmanager.h
index 0228648a39..138921b432 100644
--- a/indra/newview/llenvmanager.h
+++ b/indra/newview/llenvmanager.h
@@ -145,6 +145,8 @@ public:
void commitSettings(LLEnvKey::EScope scope);
// called back when the commit finishes
void commitSettingsFinished(LLEnvKey::EScope scope);
+ // Immediately apply current settings from managers to region.
+ void applyLocalSettingsToRegion();
/*
* notify of changes in god/not-god mode, estate ownership, etc.
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 874cc1a030..c09baf1e09 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1225,6 +1225,7 @@ BOOL LLPanelRegionTerrainInfo::postBuild()
childSetAction("WLRegionApply", onCommitRegionWL, this);
childSetAction("WLRegionCancel", onCancelRegionWL, this);
childSetAction("WLRegionDefault", onSetRegionToDefaultWL, this);
+ childSetAction("WLCurrentApply", onApplyCurrentWL, this);
return TRUE;
}
@@ -1469,6 +1470,13 @@ void LLPanelRegionTerrainInfo::onSetRegionToDefaultWL(void* userData)
LLEnvManager::instance().startEditingScope(LLEnvKey::SCOPE_REGION);
}
+// static
+void LLPanelRegionTerrainInfo::onApplyCurrentWL(void* userData)
+{
+ // Immediately apply current environment settings to region.
+ LLEnvManager::instance().applyLocalSettingsToRegion();
+}
+
void LLPanelRegionTerrainInfo::cancelChanges()
{
LLFloaterReg::hideInstance("env_windlight");
diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h
index b936900abc..5c0c229a54 100644
--- a/indra/newview/llfloaterregioninfo.h
+++ b/indra/newview/llfloaterregioninfo.h
@@ -271,6 +271,7 @@ protected:
static void onCommitRegionWL(void* userData); // commit region information to server
static void onCancelRegionWL(void* userData); // cancel changes to region
static void onSetRegionToDefaultWL(void* userData); // revert region WL settings to default
+ static void onApplyCurrentWL(void* userData); // apply current settings to region
};
/////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp
index 4fb470fa45..04adf62733 100644
--- a/indra/newview/llfloaterwindlight.cpp
+++ b/indra/newview/llfloaterwindlight.cpp
@@ -206,7 +206,7 @@ void LLFloaterWindLight::initCallbacks(void)
childSetAction("WLSavePreset", onSavePreset, comboBox);
childSetAction("WLDeletePreset", onDeletePreset, comboBox);
- //childSetAction("WLPresetsCombo", onChangePresetName, comboBox);
+ comboBox->setCommitCallback(boost::bind(&LLFloaterWindLight::onChangePresetName, _1));
// Dome
childSetCommitCallback("WLGamma", onFloatControlMoved, &param_mgr->mWLGamma);
@@ -901,7 +901,7 @@ bool LLFloaterWindLight::deleteAlertCallback(const LLSD& notification, const LLS
}
-void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl, void * userData)
+void LLFloaterWindLight::onChangePresetName(LLUICtrl* ctrl)
{
llassert(sWindLight);
LLWLParamManager::getInstance()->mAnimator.deactivate();
diff --git a/indra/newview/llfloaterwindlight.h b/indra/newview/llfloaterwindlight.h
index 6dde1408f8..9cdb6818c7 100644
--- a/indra/newview/llfloaterwindlight.h
+++ b/indra/newview/llfloaterwindlight.h
@@ -101,7 +101,7 @@ public:
bool deleteAlertCallback(const LLSD& notification, const LLSD& response);
/// what to do when you change the preset name
- static void onChangePresetName(LLUICtrl* ctrl, void* userData);
+ static void onChangePresetName(LLUICtrl* ctrl);
/// when user hits the save preset button
static void onOpenDayCycle(void* userData);
diff --git a/indra/newview/skins/default/xui/en/panel_region_terrain.xml b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
index e6022d467a..fb94423a5c 100644
--- a/indra/newview/skins/default/xui/en/panel_region_terrain.xml
+++ b/indra/newview/skins/default/xui/en/panel_region_terrain.xml
@@ -2,7 +2,7 @@
<panel
border="true"
follows="top|left"
- height="320"
+ height="400"
help_topic="panel_region_terrain_tab"
label="Terrain"
layout="topleft"
@@ -196,6 +196,15 @@ See &apos;?&apos; for details.
top_pad="3"
width="160" />
<button
+ enabled="false"
+ follows="left|top"
+ height="20"
+ label="Apply Local to Region"
+ left_delta="0"
+ top_pad="3"
+ name="WLCurrentApply"
+ width="160" />
+ <button
follows="left|top"
height="20"
label="Download RAW terrain..."
@@ -203,7 +212,7 @@ See &apos;?&apos; for details.
left="10"
name="download_raw_btn"
tool_tip="Available only to estate owners, not managers"
- top="240"
+ top="330"
width="170" />
<button
follows="left|top"
@@ -223,6 +232,6 @@ See &apos;?&apos; for details.
left="10"
name="bake_terrain_btn"
tool_tip="Set current terrain as mid-point for raise/lower limits"
- top="283"
+ top_pad="3"
width="100" />
</panel>