summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llenvmanager.cpp6
-rw-r--r--indra/newview/llfloaterdaycycle.cpp10
-rw-r--r--indra/newview/llfloaterenvsettings.cpp200
-rw-r--r--indra/newview/llfloaterenvsettings.h41
-rw-r--r--indra/newview/llfloaterregioninfo.cpp21
-rw-r--r--indra/newview/llfloaterwindlight.cpp44
-rw-r--r--indra/newview/llfloaterwindlight.h9
-rw-r--r--indra/newview/llwlparammanager.cpp17
8 files changed, 111 insertions, 237 deletions
diff --git a/indra/newview/llenvmanager.cpp b/indra/newview/llenvmanager.cpp
index daf3f90234..8e5889e74b 100644
--- a/indra/newview/llenvmanager.cpp
+++ b/indra/newview/llenvmanager.cpp
@@ -80,7 +80,7 @@ void LLEnvManager::changedRegion(bool interp)
mInterpNextChangeMessage = interp;
mPendingOutgoingMessage = false;
- LLFloaterEnvSettings::instance()->closeFloater();
+ // TIGGGS LLFloaterEnvSettings::instance()->closeFloater();
resetInternalsToDefault(LLEnvKey::SCOPE_REGION);
@@ -179,8 +179,8 @@ void LLEnvManager::updateUIFromEditability()
// *TODO When the checkbox from LLFloaterEnvSettings is moved elsewhere, opening the local environment settings window should auto-display local settings
// Currently, disable all editing to ensure region settings are hidden from those that can't edit them (to preserve possibility of future tradable assets)
// Remove "!gSavedSettings.getBOOL(...)" when the desired behavior is implemented
- LLFloaterEnvSettings::instance()->setControlsEnabled(canEdit(LLEnvKey::SCOPE_LOCAL) && !gSavedSettings.getBOOL("UseEnvironmentFromRegion"));
- LLPanelRegionTerrainInfo::instance()->setEnvControls(canEdit(LLEnvKey::SCOPE_REGION));
+// LLFloaterEnvSettings::instance()->setControlsEnabled(canEdit(LLEnvKey::SCOPE_LOCAL) && !gSavedSettings.getBOOL("UseEnvironmentFromRegion"));
+// LLPanelRegionTerrainInfo::instance()->setEnvControls(canEdit(LLEnvKey::SCOPE_REGION));
// enable estate UI iff canEdit(LLEnvKey::SCOPE_ESTATE), etc.
}
diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp
index c54540d827..8979c7d6f7 100644
--- a/indra/newview/llfloaterdaycycle.cpp
+++ b/indra/newview/llfloaterdaycycle.cpp
@@ -338,10 +338,12 @@ void LLFloaterDayCycle::onStopAnimSky(void* userData)
void LLFloaterDayCycle::onUseLindenTime(void* userData)
{
- LLFloaterWindLight* wl = LLFloaterWindLight::instance();
- LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
- box->selectByValue("");
-
+ LLFloaterWindLight* wlfloater = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight");
+ if (wlfloater)
+ {
+ LLComboBox* box = wlfloater->getChild<LLComboBox>("WLPresetsCombo");
+ box->selectByValue("");
+ }
LLWLParamManager::getInstance()->mAnimator.deactivate();
}
diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp
index eea333745f..e863aef94f 100644
--- a/indra/newview/llfloaterenvsettings.cpp
+++ b/indra/newview/llfloaterenvsettings.cpp
@@ -34,6 +34,7 @@
#include "llfloaterenvsettings.h"
+#include "llfloaterreg.h"
#include "llfloaterwindlight.h"
#include "llfloaterwater.h"
#include "llfloaterdaycycle.h"
@@ -58,27 +59,29 @@
#include <sstream>
-LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL;
+// LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL;
LLFloaterEnvSettings::LLFloaterEnvSettings(const LLSD &key) : LLFloater(key)
{
- // load it up
- initCallbacks();
}
LLFloaterEnvSettings::~LLFloaterEnvSettings()
{
}
-void LLFloaterEnvSettings::onClickHelp(void* data)
-{
- LLNotifications::instance().add("EnvSettingsHelpButton", LLSD(), LLSD());
+// virtual
+BOOL LLFloaterEnvSettings::postBuild()
+{
+ // load it up
+ initCallbacks();
+ syncMenu();
+ return TRUE;
}
void LLFloaterEnvSettings::onUseRegionEnvironment(LLUICtrl* ctrl, void* data)
{
- LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data;
- LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)self->getChildView("RegionWLOptIn");
+ //LLFloaterEnvSettings* self = (LLFloaterEnvSettings*)data;
+ LLCheckBoxCtrl* checkbox = static_cast<LLCheckBoxCtrl*>(ctrl); //self->getChildView("RegionWLOptIn");
setOptIn(checkbox->getValue().asBoolean());
}
@@ -97,23 +100,19 @@ void LLFloaterEnvSettings::setOptIn(bool opt_in)
void LLFloaterEnvSettings::initCallbacks(void)
{
// our three sliders
- childSetCommitCallback("EnvTimeSlider", onChangeDayTime, NULL);
- childSetCommitCallback("EnvCloudSlider", onChangeCloudCoverage, NULL);
- childSetCommitCallback("EnvWaterFogSlider", onChangeWaterFogDensity,
- &LLWaterParamManager::getInstance()->mFogDensity);
+ childSetCommitCallback("EnvTimeSlider", &LLFloaterEnvSettings::onChangeDayTime, NULL);
+ childSetCommitCallback("EnvCloudSlider", &LLFloaterEnvSettings::onChangeCloudCoverage, NULL);
+ childSetCommitCallback("EnvWaterFogSlider", &LLFloaterEnvSettings::onChangeWaterFogDensity, &LLWaterParamManager::instance().mFogDensity);
// color picker
- childSetCommitCallback("EnvWaterColor", onChangeWaterColor,
- &LLWaterParamManager::getInstance()->mFogColor);
+ childSetCommitCallback("EnvWaterColor", &LLFloaterEnvSettings::onChangeWaterColor, &LLWaterParamManager::instance().mFogColor);
// WL Top
- childSetAction("EnvAdvancedSkyButton", onOpenAdvancedSky, NULL);
- childSetAction("EnvAdvancedWaterButton", onOpenAdvancedWater, NULL);
- childSetAction("EnvUseEstateTimeButton", onUseEstateTime, NULL);
- childSetAction("EnvUseLocalTimeButton", onUseLocalTime, NULL);
- childSetAction("EnvSettingsHelpButton", onClickHelp, this);
+ childSetCommitCallback("EnvAdvancedSkyButton", &LLFloaterEnvSettings::onOpenAdvancedSky, NULL);
+ childSetCommitCallback("EnvAdvancedWaterButton", &LLFloaterEnvSettings::onOpenAdvancedWater, NULL);
+ childSetCommitCallback("EnvUseEstateTimeButton", &LLFloaterEnvSettings::onUseEstateTime, NULL);
- childSetCommitCallback("RegionWLOptIn", onUseRegionEnvironment, this);
+ childSetCommitCallback("RegionWLOptIn", &LLFloaterEnvSettings::onUseRegionEnvironment, NULL);
}
@@ -122,14 +121,14 @@ void LLFloaterEnvSettings::initCallbacks(void)
void LLFloaterEnvSettings::syncMenu()
{
LLSliderCtrl* sldr;
- sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider");
+ sldr = getChild<LLSliderCtrl>("EnvTimeSlider");
// sync the clock
F32 val = (F32)LLWLParamManager::getInstance()->mAnimator.getDayTime();
std::string timeStr = LLWLAnimator::timeToString(val);
LLTextBox* textBox;
- textBox = sEnvSettings->getChild<LLTextBox>("EnvTimeText");
+ textBox = getChild<LLTextBox>("EnvTimeText");
textBox->setValue(timeStr);
@@ -148,7 +147,7 @@ void LLFloaterEnvSettings::syncMenu()
LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance();
// sync water params
LLColor4 col = param_mgr->getFogColor();
- LLColorSwatchCtrl* colCtrl = sEnvSettings->getChild<LLColorSwatchCtrl>("EnvWaterColor");
+ LLColorSwatchCtrl* colCtrl = getChild<LLColorSwatchCtrl>("EnvWaterColor");
col.mV[3] = 1.0f;
colCtrl->set(col);
@@ -204,99 +203,12 @@ void LLFloaterEnvSettings::syncMenu()
}
}
-
-// static instance of it
-LLFloaterEnvSettings* LLFloaterEnvSettings::instance()
-{
- if (!sEnvSettings)
- {
- sEnvSettings = new LLFloaterEnvSettings("Environment Editor Floater");
- // sEnvSettings->open();
- // sEnvSettings->setFocus(TRUE);
- }
- return sEnvSettings;
-}
-
-void LLFloaterEnvSettings::setControlsEnabled(bool enable)
-{
- if(enable)
- {
- // reenable UI elements, resync sliders, and reload saved settings
- childEnable("EnvAdvancedSkyButton");
- childEnable("EnvAdvancedWaterButton");
- childEnable("EnvUseEstateTimeButton");
- childShow("EnvTimeText");
- childShow("EnvWaterColor");
- childShow("EnvTimeSlider");
- childShow("EnvCloudSlider");
- childShow("EnvWaterFogSlider");
- syncMenu();
- }
- else
- {
- // disable UI elements the user shouldn't be able to see to protect potentially proprietary WL region settings from being visible
- LLFloaterWindLight::instance()->closeFloater();
- LLFloaterWater::instance()->closeFloater();
- LLFloaterDayCycle::instance()->closeFloater();
- childDisable("EnvAdvancedSkyButton");
- childDisable("EnvAdvancedWaterButton");
- childDisable("EnvUseEstateTimeButton");
- childHide("EnvTimeText");
- childHide("EnvWaterColor");
- childHide("EnvTimeSlider");
- childHide("EnvCloudSlider");
- childHide("EnvWaterFogSlider");
- }
-}
-
-
-void LLFloaterEnvSettings::show()
-{
- LLFloaterEnvSettings* envSettings = instance();
- envSettings->syncMenu();
-
- // comment in if you want the menu to rebuild each time
- //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml");
- //envSettings->initCallbacks();
-
- // Set environment opt-in checkbox based on saved value -- only need to do once, not every time syncMenu is called
-
- bool opt_in = gSavedSettings.getBOOL("UseEnvironmentFromRegion");
-
- sEnvSettings->childSetVisible("RegionWLOptIn", LLEnvManager::getInstance()->regionCapable());
- sEnvSettings->setOptIn(opt_in);
- LLCheckBoxCtrl* checkbox = (LLCheckBoxCtrl*)envSettings->getChildView("RegionWLOptIn");
- checkbox->setValue(LLSD::Boolean(opt_in));
- sEnvSettings->getChildView("RegionWLOptIn")->setToolTip(sEnvSettings->getString("region_environment_tooltip"));
- envSettings->openFloater();
-}
-
-bool LLFloaterEnvSettings::isOpen()
-{
- if (sEnvSettings != NULL)
- {
- return true;
- }
- return false;
-}
-
-// virtual
-void LLFloaterEnvSettings::onClose(bool app_quitting)
-{
- if (sEnvSettings)
- {
- sEnvSettings->setVisible(FALSE);
- }
-}
-
-
void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData)
{
- LLSliderCtrl* sldr;
- sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider");
+ LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl);
// deactivate animator
- LLWLParamManager::getInstance()->mAnimator.deactivate();
+ LLWLParamManager::instance().mAnimator.deactivate();
F32 val = sldr->getValueF32() + 0.25f;
if(val > 1.0)
@@ -304,81 +216,65 @@ void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData)
val--;
}
- LLWLParamManager::getInstance()->mAnimator.setDayTime((F64)val);
- LLWLParamManager::getInstance()->mAnimator.update(
- LLWLParamManager::getInstance()->mCurParams);
+ LLWLParamManager::instance().mAnimator.setDayTime((F64)val);
+ LLWLParamManager::instance().mAnimator.update(
+ LLWLParamManager::instance().mCurParams);
}
void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData)
{
- LLSliderCtrl* sldr;
- sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvCloudSlider");
+ LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl);
// deactivate animator
- //LLWLParamManager::getInstance()->mAnimator.mIsRunning = false;
- //LLWLParamManager::getInstance()->mAnimator.mUseLindenTime = false;
+ //LLWLParamManager::instance()->mAnimator.mIsRunning = false;
+ //LLWLParamManager::instance()->mAnimator.mUseLindenTime = false;
F32 val = sldr->getValueF32();
- LLWLParamManager::getInstance()->mCurParams.set("cloud_shadow", val);
+ LLWLParamManager::instance().mCurParams.set("cloud_shadow", val);
}
void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData)
{
- LLSliderCtrl* sldr;
- sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvWaterFogSlider");
-
- if(NULL == userData)
- {
- return;
- }
-
- WaterExpFloatControl * expFloatControl = static_cast<WaterExpFloatControl *>(userData);
-
+ LLSliderCtrl* sldr = static_cast<LLSliderCtrl*>(ctrl);
F32 val = sldr->getValueF32();
+
+ WaterExpFloatControl* expFloatControl = static_cast<WaterExpFloatControl*>(userData);
expFloatControl->mExp = val;
- LLWaterParamManager::getInstance()->setDensitySliderValue(val);
+ LLWaterParamManager::instance().setDensitySliderValue(val);
- expFloatControl->update(LLWaterParamManager::getInstance()->mCurParams);
- LLWaterParamManager::getInstance()->propagateParameters();
+ expFloatControl->update(LLWaterParamManager::instance().mCurParams);
+ LLWaterParamManager::instance().propagateParameters();
}
void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, void* userData)
{
LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
- WaterColorControl * colorControl = static_cast<WaterColorControl *>(userData);
+ WaterColorControl* colorControl = static_cast<WaterColorControl*>(userData);
*colorControl = swatch->get();
- colorControl->update(LLWaterParamManager::getInstance()->mCurParams);
- LLWaterParamManager::getInstance()->propagateParameters();
+ colorControl->update(LLWaterParamManager::instance().mCurParams);
+ LLWaterParamManager::instance().propagateParameters();
}
-
-void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData)
+void LLFloaterEnvSettings::onOpenAdvancedSky(void* userData1, void* userData2)
{
- LLFloaterWindLight::show();
+ LLFloaterReg::showInstance("env_windlight");
}
-void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData)
+void LLFloaterEnvSettings::onOpenAdvancedWater(void* userData1, void* userData2)
{
- LLFloaterWater::instance()->openFloater();
+ LLFloaterReg::showInstance("env_water");
}
-void LLFloaterEnvSettings::onUseEstateTime(void* userData)
+void LLFloaterEnvSettings::onUseEstateTime(void* userData1, void* userData2)
{
- if(LLFloaterWindLight::isOpen())
+ LLFloaterWindLight* wl = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight");
+ if(wl)
{
- // select the blank value in
- LLFloaterWindLight* wl = LLFloaterWindLight::instance();
LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo");
box->selectByValue("");
}
- LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LINDEN);
-}
-
-void LLFloaterEnvSettings::onUseLocalTime(void* userData)
-{
- LLWLParamManager::getInstance()->mAnimator.setDayTime(LLWLAnimator::getLocalTime());
- LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LOCAL);
+ LLWLParamManager::instance().mAnimator.activate(LLWLAnimator::TIME_LINDEN);
}
diff --git a/indra/newview/llfloaterenvsettings.h b/indra/newview/llfloaterenvsettings.h
index 54611a81c3..d4b02a61e2 100644
--- a/indra/newview/llfloaterenvsettings.h
+++ b/indra/newview/llfloaterenvsettings.h
@@ -46,17 +46,15 @@ class LLFloaterEnvSettings : public LLFloater
public:
LLFloaterEnvSettings(const LLSD &key);
- virtual ~LLFloaterEnvSettings();
-
+ /*virtual*/ ~LLFloaterEnvSettings();
+ /*virtual*/ BOOL postBuild();
+
/// initialize all the callbacks for the menu
void initCallbacks(void);
/// one and one instance only
- static LLFloaterEnvSettings* instance();
-
- /// callback for the menus help button
- static void onClickHelp(void* data);
-
+ LLFloaterEnvSettings* instance();
+
/// handle if time of day is changed
static void onChangeDayTime(LLUICtrl* ctrl, void* userData);
@@ -64,25 +62,19 @@ public:
static void onChangeCloudCoverage(LLUICtrl* ctrl, void* userData);
/// handle change in water fog density
- static void onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData);
-
- /// handle change in under water fog density
- static void onChangeUnderWaterFogMod(LLUICtrl* ctrl, void* userData);
+ static void onChangeWaterFogDensity(LLUICtrl* ctrl, void* expFloatControl);
/// handle change in water fog color
- static void onChangeWaterColor(LLUICtrl* ctrl, void* userData);
+ static void onChangeWaterColor(LLUICtrl* ctrl, void* colorControl);
/// open the advanced sky settings menu
- static void onOpenAdvancedSky(void* userData);
+ static void onOpenAdvancedSky(void* userData1, void* userData2);
/// open the advanced water settings menu
- static void onOpenAdvancedWater(void* userData);
+ static void onOpenAdvancedWater(void* userData1, void* userData2);
/// sync time with the server
- static void onUseEstateTime(void* userData);
-
- /// sync time with local clock
- static void onUseLocalTime(void* userData);
+ static void onUseEstateTime(void* userData1, void* userData2);
// opt-in for region Windlight settings
//static void onUseRegionEnvironment(LLUICtrl* ctrl, void* userData);
@@ -90,24 +82,11 @@ public:
//// menu management
- /// enables or disable all controls
- void setControlsEnabled(bool enable);
-
- /// show off our menu
- static void show();
-
- /// return if the menu exists or not
- static bool isOpen();
-
- /// stuff to do on exit
- virtual void onClose(bool app_quitting);
-
/// sync up sliders with parameters
void syncMenu();
private:
// one instance on the inside
- static LLFloaterEnvSettings* sEnvSettings;
static void setOptIn(bool opt_in);
};
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 7617b98f20..1f42b483d7 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -1403,17 +1403,18 @@ bool LLPanelRegionTerrainInfo::callbackBakeTerrain(const LLSD& notification, con
void LLPanelRegionTerrainInfo::onOpenAdvancedSky(void* userData)
{
- LLFloaterWindLight::show(LLEnvKey::SCOPE_REGION);
+// LLFloaterWindLight::show(LLEnvKey::SCOPE_REGION);
}
void LLPanelRegionTerrainInfo::onOpenAdvancedWater(void* userData)
{
- LLFloaterWater::instance()->show(LLEnvKey::SCOPE_REGION);
+// LLFloaterWater::instance()->show(LLEnvKey::SCOPE_REGION);
}
void LLPanelRegionTerrainInfo::onUseEstateTime(void* userData)
{
+#if 0
if(LLFloaterWindLight::isOpen())
{
// select the blank value in
@@ -1423,6 +1424,7 @@ void LLPanelRegionTerrainInfo::onUseEstateTime(void* userData)
}
LLWLParamManager::getInstance()->mAnimator.activate(LLWLAnimator::TIME_LINDEN);
+#endif
}
///////////////////////////////////////////////////////
@@ -1431,29 +1433,36 @@ void LLPanelRegionTerrainInfo::onUseEstateTime(void* userData)
// Handle commit of WL settings to region
void LLPanelRegionTerrainInfo::onCommitRegionWL(void* userData)
{
+#if 0
LLEnvManager::getInstance()->commitSettings(LLEnvKey::SCOPE_REGION);
LLEnvManager::getInstance()->maybeClearEditingScope(LLEnvKey::SCOPE_REGION, true, false);
+#endif
}
// Handle cancel of WL settings for region
void LLPanelRegionTerrainInfo::onCancelRegionWL(void* userData)
{
+#if 0
LLEnvManager::getInstance()->maybeClearEditingScope(LLEnvKey::SCOPE_REGION, true, false);
+#endif
}
// Handle reversion of region WL settings to default
void LLPanelRegionTerrainInfo::onSetRegionToDefaultWL(void* userData)
{
+#if 0
LLEnvManager::instance().resetInternalsToDefault(LLEnvKey::SCOPE_REGION);
LLEnvManager::instance().startEditingScope(LLEnvKey::SCOPE_REGION);
+#endif
}
void LLPanelRegionTerrainInfo::cancelChanges()
{
- LLFloaterWindLight::instance()->closeFloater();
- LLFloaterWater::instance()->closeFloater();
- LLFloaterDayCycle::instance()->closeFloater();
-
+#if 0
+ LLFloaterWindLight::instance().closeFloater();
+ LLFloaterWater::instance().closeFloater();
+ LLFloaterDayCycle::instance().closeFloater();
+#endif
// disable commmit and cancel
LLPanelRegionTerrainInfo::instance()->setCommitControls(false);
}
diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp
index d5ba0befec..217c7bd7ec 100644
--- a/indra/newview/llfloaterwindlight.cpp
+++ b/indra/newview/llfloaterwindlight.cpp
@@ -71,6 +71,10 @@ static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f;
LLFloaterWindLight::LLFloaterWindLight(const LLSD &key) : LLFloater(key)
{
+}
+
+BOOL LLFloaterWindLight::postBuild()
+{
sOriginalTitle = getTitle();
// add the combo boxes
@@ -108,44 +112,16 @@ LLFloaterWindLight::LLFloaterWindLight(const LLSD &key) : LLFloater(key)
// load it up
initCallbacks();
+
+ return TRUE;
}
LLFloaterWindLight::~LLFloaterWindLight()
{
}
-void LLFloaterWindLight::initCallbacks(void) {
-
- // help buttons
- initHelpBtn("WLBlueHorizonHelp", "HelpBlueHorizon");
- initHelpBtn("WLHazeHorizonHelp", "HelpHazeHorizon");
- initHelpBtn("WLBlueDensityHelp", "HelpBlueDensity");
- initHelpBtn("WLHazeDensityHelp", "HelpHazeDensity");
-
- initHelpBtn("WLDensityMultHelp", "HelpDensityMult");
- initHelpBtn("WLDistanceMultHelp", "HelpDistanceMult");
- initHelpBtn("WLMaxAltitudeHelp", "HelpMaxAltitude");
-
- initHelpBtn("WLSunlightColorHelp", "HelpSunlightColor");
- initHelpBtn("WLAmbientHelp", "HelpSunAmbient");
- initHelpBtn("WLSunGlowHelp", "HelpSunGlow");
- initHelpBtn("WLTimeOfDayHelp", "HelpTimeOfDay");
- initHelpBtn("WLEastAngleHelp", "HelpEastAngle");
-
- initHelpBtn("WLSceneGammaHelp", "HelpSceneGamma");
- initHelpBtn("WLStarBrightnessHelp", "HelpStarBrightness");
-
- initHelpBtn("WLCloudColorHelp", "HelpCloudColor");
- initHelpBtn("WLCloudDetailHelp", "HelpCloudDetail");
- initHelpBtn("WLCloudDensityHelp", "HelpCloudDensity");
- initHelpBtn("WLCloudCoverageHelp", "HelpCloudCoverage");
-
- initHelpBtn("WLCloudScaleHelp", "HelpCloudScale");
- initHelpBtn("WLCloudScrollXHelp", "HelpCloudScrollX");
- initHelpBtn("WLCloudScrollYHelp", "HelpCloudScrollY");
-
- initHelpBtn("WLClassicCloudsHelp", "HelpClassicClouds");
-
+void LLFloaterWindLight::initCallbacks(void)
+{
LLWLParamManager * param_mgr = LLWLParamManager::getInstance();
// blue horizon
@@ -235,6 +211,7 @@ void LLFloaterWindLight::initCallbacks(void) {
childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL);
}
+#if 0
void LLFloaterWindLight::onClickHelp(void* data)
{
const std::string xml_alert = *(std::string*)data;
@@ -245,6 +222,7 @@ void LLFloaterWindLight::initHelpBtn(const std::string& name, const std::string&
{
childSetAction(name, onClickHelp, new std::string(xml_alert));
}
+#endif
bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response)
{
@@ -442,6 +420,7 @@ void LLFloaterWindLight::syncMenu()
}
+#if 0
// static
LLFloaterWindLight* LLFloaterWindLight::instance()
{
@@ -500,6 +479,7 @@ void LLFloaterWindLight::onClose(bool app_quitting)
sWindLight->setVisible(FALSE);
}
}
+#endif
// color control callbacks
void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userData)
diff --git a/indra/newview/llfloaterwindlight.h b/indra/newview/llfloaterwindlight.h
index 3b137e601f..f91e97595f 100644
--- a/indra/newview/llfloaterwindlight.h
+++ b/indra/newview/llfloaterwindlight.h
@@ -52,17 +52,19 @@ class LLFloaterWindLight : public LLFloater
public:
LLFloaterWindLight(const LLSD &key);
virtual ~LLFloaterWindLight();
-
+ BOOL postBuild();
+
/// initialize all
void initCallbacks(void);
+#if 0
/// one and one instance only
static LLFloaterWindLight* instance();
// help button stuff
static void onClickHelp(void* data);
void initHelpBtn(const std::string& name, const std::string& xml_alert);
-
+#endif
static bool newPromptCallback(const LLSD& notification, const LLSD& response);
/// general purpose callbacks for dealing with color controllers
@@ -116,6 +118,7 @@ public:
//// menu management
+#if 0
/// show off our menu
static void show(LLEnvKey::EScope scope = LLEnvKey::SCOPE_LOCAL);
@@ -124,7 +127,7 @@ public:
/// stuff to do on exit
virtual void onClose(bool app_quitting);
-
+#endif
/// sync up sliders with parameters
void syncMenu();
diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp
index 3070fed81f..2adf9f4a77 100644
--- a/indra/newview/llwlparammanager.cpp
+++ b/indra/newview/llwlparammanager.cpp
@@ -37,6 +37,7 @@
#include "pipeline.h"
#include "llsky.h"
+#include "llfloaterreg.h"
#include "llsliderctrl.h"
#include "llspinctrl.h"
#include "llcheckboxctrl.h"
@@ -57,6 +58,7 @@
#include "llenvmanager.h"
#include "llwlparamset.h"
#include "llpostprocess.h"
+
#include "llfloaterwindlight.h"
#include "llfloaterdaycycle.h"
#include "llfloaterenvsettings.h"
@@ -523,17 +525,20 @@ void LLWLParamManager::update(LLViewerCamera * cam)
propagateParameters();
// sync menus if they exist
- if(LLFloaterWindLight::isOpen())
+ LLFloaterWindLight* wlfloater = LLFloaterReg::findTypedInstance<LLFloaterWindLight>("env_windlight");
+ if (wlfloater)
{
- LLFloaterWindLight::instance()->syncMenu();
+ wlfloater->syncMenu();
}
- if(LLFloaterDayCycle::isOpen())
+ LLFloaterDayCycle* dlfloater = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle");
+ if (dlfloater)
{
- LLFloaterDayCycle::instance()->syncMenu();
+ dlfloater->syncMenu();
}
- if(LLFloaterEnvSettings::isOpen())
+ LLFloaterEnvSettings* envfloater = LLFloaterReg::findTypedInstance<LLFloaterEnvSettings>("env_settings");
+ if (envfloater)
{
- LLFloaterEnvSettings::instance()->syncMenu();
+ envfloater->syncMenu();
}
F32 camYaw = cam->getYaw();