diff options
Diffstat (limited to 'indra/newview/llpaneleditsky.cpp')
-rw-r--r-- | indra/newview/llpaneleditsky.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 73c92b0137..f84fdbb897 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -29,10 +29,13 @@ #include "llpaneleditsky.h" #include "llslider.h" +#include "llsliderctrl.h" #include "lltexturectrl.h" #include "llcolorswatch.h" #include "llvirtualtrackball.h" +#include "llsettingssky.h" +static LLDefaultChildRegistry::Register<LLDensityCtrl> register_density_control("densityctrl"); namespace { @@ -79,6 +82,7 @@ namespace static LLPanelInjector<LLPanelSettingsSkyAtmosTab> t_settings_atmos("panel_settings_atmos"); static LLPanelInjector<LLPanelSettingsSkyCloudTab> t_settings_cloud("panel_settings_cloud"); static LLPanelInjector<LLPanelSettingsSkySunMoonTab> t_settings_sunmoon("panel_settings_sunmoon"); +static LLPanelInjector<LLPanelSettingsDensityTab> t_settings_density("panel_settings_density"); //========================================================================== LLPanelSettingsSky::LLPanelSettingsSky() : @@ -435,3 +439,91 @@ void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() mSkySettings->setMoonTextureId(getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->getValue().asUUID()); mSkySettings->update(); } + +LLPanelSettingsDensityTab::LLPanelSettingsDensityTab() +{ +} + +BOOL LLPanelSettingsDensityTab::postBuild() +{ + mControlName = LLDensityCtrl::NameForDensityProfileType(mProfileType); + getChild<LLDensityCtrl>(mControlName)->setProfileType(mProfileType); + refresh(); + return TRUE; +} + +void LLPanelSettingsDensityTab::setEnabled(BOOL enabled) +{ + LLPanelSettingsSky::setEnabled(enabled); + getChild<LLDensityCtrl>(mControlName)->setEnabled(enabled); +} + +void LLPanelSettingsDensityTab::refresh() +{ + if (!mSkySettings) + { + setAllChildrenEnabled(FALSE); + setEnabled(FALSE); + return; + } + + setEnabled(TRUE); + setAllChildrenEnabled(TRUE); + getChild<LLDensityCtrl>(mControlName)->setSky(mSkySettings); + getChild<LLDensityCtrl>(mControlName)->refresh(); +} + +void LLPanelSettingsDensityTab::updateProfile() +{ + getChild<LLDensityCtrl>(mControlName)->setSky(mSkySettings); + getChild<LLDensityCtrl>(mControlName)->updateProfile(); + mSkySettings->update(); +} + +LLPanelSettingsDensity::LLPanelSettingsDensity() +{ +} + +BOOL LLPanelSettingsDensity::postBuild() +{ + //static_cast<LLPanelSettingsDensityTab*>(getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_RAYLEIGH))->setProfileType(LLDensityCtrl::Rayleigh); + //static_cast<LLPanelSettingsDensityTab*>(getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_MIE))->setProfileType(LLDensityCtrl::Mie); + //static_cast<LLPanelSettingsDensityTab*>(getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_ABSORPTION))->setProfileType(LLDensityCtrl::Absorption); + refresh(); + return TRUE; +} + +void LLPanelSettingsDensity::setEnabled(BOOL enabled) +{ + LLPanelSettingsSky::setEnabled(enabled); + + //getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_RAYLEIGH)->setEnabled(enabled); + //getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_MIE)->setEnabled(enabled); + //getChild<LLPanelSettingsDensityTab>(LLDensityCtrl::DENSITY_ABSORPTION)->setEnabled(enabled); +} + +void LLPanelSettingsDensity::refresh() +{ + if (!mSkySettings) + { + setAllChildrenEnabled(FALSE); + setEnabled(FALSE); + return; + } + + setEnabled(TRUE); + setAllChildrenEnabled(TRUE); + + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_RAYLEIGH)->refresh(); + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_MIE)->refresh(); + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_ABSORPTION)->refresh(); +} + +void LLPanelSettingsDensity::updateProfile() +{ + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_RAYLEIGH)->updateProfile(); + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_MIE)->updateProfile(); + //getChild<LLDensityCtrl>(LLDensityCtrl::DENSITY_ABSORPTION)->updateProfile(); + mSkySettings->update(); +} + |