From f7fa0b1afa99596df47f68511d0fddf7522448fc Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 11 Oct 2009 07:53:03 -0700 Subject: Added advanced water and windlight sky tabs to sky presets pulldown --- linden/indra/newview/llfloaterwindlight.cpp | 11 +++++++ linden/indra/newview/llfloaterwindlight.h | 2 ++ linden/indra/newview/llwindlightremotectrl.cpp | 36 +++++++++++++++++++++- .../default/xui/en-us/panel_windlight_remote.xml | 12 ++++++++ .../xui/en-us/panel_windlight_remote_expanded.xml | 12 ++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) (limited to 'linden') diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp index 71e81fa..80090a0 100644 --- a/linden/indra/newview/llfloaterwindlight.cpp +++ b/linden/indra/newview/llfloaterwindlight.cpp @@ -46,6 +46,7 @@ #include "llcombobox.h" #include "lllineeditor.h" #include "llfloaterdaycycle.h" +#include "lltabcontainer.h" #include "llboost.h" #include "v4math.h" @@ -1066,3 +1067,13 @@ void LLFloaterWindLight::onClickPrev(void* user_data) param_mgr->mAnimator.mUseLindenTime = false; param_mgr->loadPreset(mIt->first, true); } + +//static +void LLFloaterWindLight::selectTab(std::string tab_name) +{ + if (!tab_name.empty()) + { + LLTabContainer* tabs = LLFloaterWindLight::instance()->getChild("WindLight Tabs"); + tabs->selectTabByName(tab_name); + } +} diff --git a/linden/indra/newview/llfloaterwindlight.h b/linden/indra/newview/llfloaterwindlight.h index 70e76c5..130a9a7 100644 --- a/linden/indra/newview/llfloaterwindlight.h +++ b/linden/indra/newview/llfloaterwindlight.h @@ -131,6 +131,8 @@ public: /// turn off animated skies static void deactivateAnimator(); + static void selectTab(std::string tab_name); + private: // one instance on the inside static LLFloaterWindLight* sWindLight; diff --git a/linden/indra/newview/llwindlightremotectrl.cpp b/linden/indra/newview/llwindlightremotectrl.cpp index ae9a90a..f805763 100644 --- a/linden/indra/newview/llwindlightremotectrl.cpp +++ b/linden/indra/newview/llwindlightremotectrl.cpp @@ -35,6 +35,7 @@ #include "llbutton.h" #include "llcombobox.h" #include "llfloaterenvsettings.h" +#include "llfloaterwater.h" #include "llfloaterwindlight.h" #include "lloverlaybar.h" #include "lluictrlfactory.h" @@ -154,6 +155,11 @@ void LLWindlightRemoteCtrl::refreshPresets() // insert separator and add World menu options mPresetsCombo->addSeparator(ADD_BOTTOM); + mPresetsCombo->addSimpleElement(getString("atmosphere"), ADD_BOTTOM); + mPresetsCombo->addSimpleElement(getString("lighting"), ADD_BOTTOM); + mPresetsCombo->addSimpleElement(getString("clouds"), ADD_BOTTOM); + mPresetsCombo->addSimpleElement(getString("advanced_water"), ADD_BOTTOM); + mPresetsCombo->addSeparator(ADD_BOTTOM); mPresetsCombo->addSimpleElement(getString("sunrise"), ADD_BOTTOM); mPresetsCombo->addSimpleElement(getString("noon"), ADD_BOTTOM); mPresetsCombo->addSimpleElement(getString("sunset"), ADD_BOTTOM); @@ -191,7 +197,35 @@ void LLWindlightRemoteCtrl::onCommitPreset(LLUICtrl* ctrl, void* data) // check for World menu options; if none, apply preset std::string selected = self->mPresetsCombo->getSelectedValue().asString(); - if (selected == self->getString("sunrise")) + if (selected == self->getString("atmosphere")) + { + if (!LLFloaterWindLight::instance()->getVisible()) + { + LLFloaterWindLight::show(); + } + LLFloaterWindLight::instance()->selectTab("Atmosphere"); + } + else if (selected == self->getString("lighting")) + { + if (!LLFloaterWindLight::instance()->getVisible()) + { + LLFloaterWindLight::show(); + } + LLFloaterWindLight::instance()->selectTab("Lighting"); + } + else if (selected == self->getString("clouds")) + { + if (!LLFloaterWindLight::instance()->getVisible()) + { + LLFloaterWindLight::show(); + } + LLFloaterWindLight::instance()->selectTab("Clouds"); + } + else if (selected == self->getString("advanced_water")) + { + LLFloaterWater::show(); + } + else if (selected == self->getString("sunrise")) { // set the value, turn off animation LLWLParamManager::instance()->mAnimator.setDayTime(0.25); diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote.xml b/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote.xml index ead9ad7..8be72fc 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote.xml @@ -4,6 +4,18 @@ name="windlight_remote" use_bounding_rect="true" width="182"> + + Atmosphere + + + Lighting + + + Clouds + + + Advanced Water + Sunrise diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote_expanded.xml b/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote_expanded.xml index e7182fa..8c43682 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote_expanded.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_windlight_remote_expanded.xml @@ -16,6 +16,18 @@ m + + Atmosphere + + + Lighting + + + Clouds + + + Advanced Water + Sunrise -- cgit v1.1