From 7419abc12ba07380593fa3c0571155b248b8c8a6 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 31 Mar 2011 18:24:01 +0300 Subject: 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. --- indra/newview/llenvmanager.cpp | 6 ++++++ indra/newview/llenvmanager.h | 2 ++ indra/newview/llfloaterregioninfo.cpp | 8 ++++++++ indra/newview/llfloaterregioninfo.h | 1 + indra/newview/llfloaterwindlight.cpp | 4 ++-- indra/newview/llfloaterwindlight.h | 2 +- .../newview/skins/default/xui/en/panel_region_terrain.xml | 15 ++++++++++++--- 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, ¶m_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 @@ +