diff options
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 166d53fc74..ce4797c380 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -197,9 +197,33 @@ BOOL LLFloaterEditExtDayCycle::postBuild() LLTabContainer* tab_container = mSkyTabLayoutContainer->getChild<LLTabContainer>("sky_tabs"); S32 tab_count = tab_container->getTabCount(); + LLSettingsEditPanel *panel = nullptr; + + // Add or remove density tab as necessary + // Must be before operation on all tabs below + if (gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics")) + { + panel = dynamic_cast<LLPanelSettingsSky*>(tab_container->getChildView("panel_settings_sky_density")); + if (!panel) + { + panel = new LLPanelSettingsSkyDensityTab; + panel->buildFromFile("panel_settings_sky_density.xml"); + tab_container->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + } + } + else + { + panel = dynamic_cast<LLPanelSettingsSky*>(tab_container->getChildView("panel_settings_sky_density")); + if (panel) + { + tab_container->removeTabPanel(panel); + } + delete panel; + } + for (S32 idx = 0; idx < tab_count; ++idx) { - LLSettingsEditPanel *panel = static_cast<LLSettingsEditPanel *>(tab_container->getPanelByIndex(idx)); + panel = static_cast<LLSettingsEditPanel *>(tab_container->getPanelByIndex(idx)); if (panel) panel->setOnDirtyFlagChanged([this](LLPanel *, bool val) { onPanelDirtyFlagChanged(val); }); } @@ -817,7 +841,7 @@ void LLFloaterEditExtDayCycle::updateWaterTabs(const LLSettingsWaterPtr_t &p_wat void LLFloaterEditExtDayCycle::updateSkyTabs(const LLSettingsSkyPtr_t &p_sky) { - LLView* tab_container = mSkyTabLayoutContainer->getChild<LLView>(TABS_SKYS); //can't extract panels directly, since they are in 'tuple' + LLTabContainer* tab_container = mSkyTabLayoutContainer->getChild<LLTabContainer>(TABS_SKYS); //can't extract panels directly, since they are in 'tuple' LLPanelSettingsSky* panel; panel = dynamic_cast<LLPanelSettingsSky*>(tab_container->getChildView("atmosphere_panel")); @@ -835,6 +859,29 @@ void LLFloaterEditExtDayCycle::updateSkyTabs(const LLSettingsSkyPtr_t &p_sky) { panel->setSky(p_sky); } + + if (gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics")) + { + panel = dynamic_cast<LLPanelSettingsSky*>(tab_container->getChildView("panel_settings_sky_density")); + if (!panel) + { + panel = new LLPanelSettingsSkyDensityTab; + panel->buildFromFile("panel_settings_sky_density.xml"); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); + tab_container->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + } + panel->setSky(std::static_pointer_cast<LLSettingsSky>(p_sky)); + } + else + { + panel = dynamic_cast<LLPanelSettingsSky*>(tab_container->getChildView("panel_settings_sky_density")); + if (panel) + { + tab_container->removeTabPanel(panel); + } + delete panel; + } + } void LLFloaterEditExtDayCycle::updateButtons() @@ -1204,18 +1251,6 @@ void LLFloaterEditExtDayCycle::doApplyCommit() } } -bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed() -{ - if (mCurrentTrack <= LLSettingsDay::TRACK_GROUND_LEVEL) - { - return (mSliderKeyMap.size() > 1); - } - else - { - return (mSliderKeyMap.size() > 0); - } -} - void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) { LL_INFOS("ENVDAYEDIT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; |