diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-05-26 23:09:30 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-05-26 23:09:30 +0300 |
commit | bbde07245bdcedd05bd37863d573c94c2af4c6f7 (patch) | |
tree | bb4025ca5146f35e3738585a46fe74c30220612a /indra | |
parent | ebfbf2a561a98e5af4dde319edb49a663e27de26 (diff) |
STORM-1285 WIP Connected "Create/Edit Water / Sky / Day Cycle" floaters (not functional) to the main menu.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/newview/llfloatereditdaycycle.cpp | 73 | ||||
-rw-r--r-- | indra/newview/llfloatereditdaycycle.h | 45 | ||||
-rw-r--r-- | indra/newview/llfloatereditsky.cpp | 73 | ||||
-rw-r--r-- | indra/newview/llfloatereditsky.h | 45 | ||||
-rw-r--r-- | indra/newview/llfloatereditwater.cpp | 73 | ||||
-rw-r--r-- | indra/newview/llfloatereditwater.h | 45 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml | 20 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml | 18 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_water_preset.xml | 17 |
12 files changed, 408 insertions, 19 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 097151d058..b0779bc4cf 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -176,6 +176,9 @@ set(viewer_SOURCE_FILES llfloaterdaycycle.cpp llfloaterdeleteenvpreset.cpp llfloaterdisplayname.cpp + llfloatereditdaycycle.cpp + llfloatereditsky.cpp + llfloatereditwater.cpp llfloaterenvsettings.cpp llfloaterenvironmentsettings.cpp llfloaterevent.cpp @@ -726,6 +729,9 @@ set(viewer_HEADER_FILES llfloaterdaycycle.h llfloaterdeleteenvpreset.h llfloaterdisplayname.h + llfloatereditdaycycle.h + llfloatereditsky.h + llfloatereditwater.h llfloaterenvsettings.h llfloaterenvironmentsettings.h llfloaterevent.h diff --git a/indra/newview/llfloatereditdaycycle.cpp b/indra/newview/llfloatereditdaycycle.cpp new file mode 100644 index 0000000000..6275b48203 --- /dev/null +++ b/indra/newview/llfloatereditdaycycle.cpp @@ -0,0 +1,73 @@ +/** + * @file llfloatereditdaycycle.cpp + * @brief Floater to create or edit a day cycle + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditdaycycle.h" + +// libs +#include "llbutton.h" + +// newview + +LLFloaterEditDayCycle::LLFloaterEditDayCycle(const LLSD &key) +: LLFloater(key) +{ +} + +// virtual +BOOL LLFloaterEditDayCycle::postBuild() +{ + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditDayCycle::onBtnCancel, this)); + + // Disable some non-functional controls. + getChildView("day_cycle_combo")->setEnabled(FALSE); + getChildView("save")->setEnabled(FALSE); + + return TRUE; +} + +// virtual +void LLFloaterEditDayCycle::onOpen(const LLSD& key) +{ + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(param == "edit"); +} + +void LLFloaterEditDayCycle::onBtnCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h new file mode 100644 index 0000000000..d1caa05888 --- /dev/null +++ b/indra/newview/llfloatereditdaycycle.h @@ -0,0 +1,45 @@ +/** + * @file llfloatereditdaycycle.h + * @brief Floater to create or edit a day cycle + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATEREDITDAYCYCLE_H +#define LL_LLFLOATEREDITDAYCYCLE_H + +#include "llfloater.h" + +class LLFloaterEditDayCycle : public LLFloater +{ + LOG_CLASS(LLFloaterEditDayCycle); + +public: + LLFloaterEditDayCycle(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void onBtnCancel(); +}; + +#endif // LL_LLFLOATEREDITDAYCYCLE_H diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp new file mode 100644 index 0000000000..312479951e --- /dev/null +++ b/indra/newview/llfloatereditsky.cpp @@ -0,0 +1,73 @@ +/** + * @file llfloatereditsky.h + * @brief Floater to create or edit a sky preset + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditsky.h" + +// libs +#include "llbutton.h" + +// newview + +LLFloaterEditSky::LLFloaterEditSky(const LLSD &key) +: LLFloater(key) +{ +} + +// virtual +BOOL LLFloaterEditSky::postBuild() +{ + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); + + // Disable some non-functional controls. + getChildView("sky_preset_combo")->setEnabled(FALSE); + getChildView("save")->setEnabled(FALSE); + + return TRUE; +} + +// virtual +void LLFloaterEditSky::onOpen(const LLSD& key) +{ + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(param == "edit"); +} + +void LLFloaterEditSky::onBtnCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloatereditsky.h b/indra/newview/llfloatereditsky.h new file mode 100644 index 0000000000..a78f049d84 --- /dev/null +++ b/indra/newview/llfloatereditsky.h @@ -0,0 +1,45 @@ +/** + * @file llfloatereditsky.h + * @brief Floater to create or edit a sky preset + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATEREDITSKY_H +#define LL_LLFLOATEREDITSKY_H + +#include "llfloater.h" + +class LLFloaterEditSky : public LLFloater +{ + LOG_CLASS(LLFloaterEditSky); + +public: + LLFloaterEditSky(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void onBtnCancel(); +}; + +#endif // LL_LLFLOATEREDITSKY_H diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp new file mode 100644 index 0000000000..4007c27066 --- /dev/null +++ b/indra/newview/llfloatereditwater.cpp @@ -0,0 +1,73 @@ +/** + * @file llfloatereditwater.cpp + * @brief Floater to create or edit a water preset + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatereditwater.h" + +// libs +#include "llbutton.h" + +// newview + +LLFloaterEditWater::LLFloaterEditWater(const LLSD &key) +: LLFloater(key) +{ +} + +// virtual +BOOL LLFloaterEditWater::postBuild() +{ + getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditWater::onBtnCancel, this)); + + // Disable some non-functional controls. + getChildView("water_preset_combo")->setEnabled(FALSE); + getChildView("save")->setEnabled(FALSE); + + return TRUE; +} + +// virtual +void LLFloaterEditWater::onOpen(const LLSD& key) +{ + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild<LLUICtrl>("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(param == "edit"); +} + +void LLFloaterEditWater::onBtnCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloatereditwater.h b/indra/newview/llfloatereditwater.h new file mode 100644 index 0000000000..a904555787 --- /dev/null +++ b/indra/newview/llfloatereditwater.h @@ -0,0 +1,45 @@ +/** + * @file llfloatereditwater.h + * @brief Floater to create or edit a water preset + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATEREDITWATER_H +#define LL_LLFLOATEREDITWATER_H + +#include "llfloater.h" + +class LLFloaterEditWater : public LLFloater +{ + LOG_CLASS(LLFloaterEditWater); + +public: + LLFloaterEditWater(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void onBtnCancel(); +}; + +#endif // LL_LLFLOATEREDITWATER_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index dfa6e2e5c8..d4464a2915 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -51,6 +51,9 @@ #include "llfloaterdaycycle.h" #include "llfloaterdeleteenvpreset.h" #include "llfloaterdisplayname.h" +#include "llfloatereditdaycycle.h" +#include "llfloatereditsky.h" +#include "llfloatereditwater.h" #include "llfloaterenvironmentsettings.h" #include "llfloaterevent.h" #include "llfloatersearch.h" @@ -161,6 +164,9 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("env_water", "floater_water.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWater>); LLFloaterReg::add("env_windlight", "floater_windlight_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterWindLight>); LLFloaterReg::add("env_delete_preset", "floater_delete_env_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeleteEnvPreset>); + LLFloaterReg::add("env_edit_sky", "floater_edit_sky_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditSky>); + LLFloaterReg::add("env_edit_water", "floater_edit_water_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditWater>); + LLFloaterReg::add("env_edit_day_cycle", "floater_edit_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditDayCycle>); LLFloaterReg::add("event", "floater_event.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEvent>); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 437bc4c598..f5b9b533a5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7627,9 +7627,11 @@ class LLWorldEnvPreset : public view_listener_t if (item == "new_water") { + LLFloaterReg::showInstance("env_edit_water", "new"); } else if (item == "edit_water") { + LLFloaterReg::showInstance("env_edit_water", "edit"); } else if (item == "delete_water") { @@ -7637,9 +7639,11 @@ class LLWorldEnvPreset : public view_listener_t } else if (item == "new_sky") { + LLFloaterReg::showInstance("env_edit_sky", "new"); } else if (item == "edit_sky") { + LLFloaterReg::showInstance("env_edit_sky", "edit"); } else if (item == "delete_sky") { @@ -7647,9 +7651,11 @@ class LLWorldEnvPreset : public view_listener_t } else if (item == "new_day_cycle") { + LLFloaterReg::showInstance("env_edit_day_cycle", "new"); } else if (item == "edit_day_cycle") { + LLFloaterReg::showInstance("env_edit_day_cycle", "edit"); } else if (item == "delete_day_cycle") { diff --git a/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml index e76059751e..7572efea05 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_day_cycle.xml @@ -3,17 +3,23 @@ legacy_header_height="18" height="450" layout="topleft" - name="Environment Editor Floater" - help_topic="environment_editor_floater" + name="Edit Day cycle" + help_topic="" save_rect="true" title="Edit Day Cycle" width="800"> + + <string name="title_new">Create a New Day Cycle</string> + <string name="title_edit">Edit Day Cycle</string> + <string name="hint_new">Name your day cycle, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your day cycle, adjust the controls below and click "Save".</string> + <text follows="top|left|right" height="10" layout="topleft" left="30" - name="info_string" + name="hint" top="25" width="700"> To edit your preset, adjust the controls then click "Save" @@ -24,7 +30,7 @@ height="10" layout="topleft" left="30" - name="info_string" + name="label" top_pad="25" width="120"> Preset Name: @@ -34,7 +40,7 @@ follows="top|left" layout="topleft" left_pad="10" - name="water_preset_combo" + name="day_cycle_combo" top_delta="-5" width="200"> <combo_box.item @@ -47,7 +53,7 @@ height="40" layout="topleft" left_pad="10" - name="info_string" + name="note" top_delta="0" width="405" wrap="true"> @@ -452,7 +458,7 @@ <check_box follows="top|left" height="10" - label="Make this preset my new water setting" + label="Make this my new day cycle" layout="topleft" left="330" name="new_water_preset_chb" diff --git a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml index 9d180a1f50..924ffebedc 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml @@ -3,17 +3,23 @@ legacy_header_height="18" height="375" layout="topleft" - name="Environment Editor Floater" - help_topic="environment_editor_floater" + name="Edit Sky Preset" + help_topic="" save_rect="true" title="Edit Sky Preset" width="900"> + + <string name="title_new">Create a New Sky Preset</string> + <string name="title_edit">Edit Sky Preset</string> + <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your sky preset, adjust the controls and click "Save".</string> + <text follows="top|left|right" height="10" layout="topleft" left="30" - name="info_string" + name="hint" top="25" width="700"> To edit your preset, adjust the controls then click "Save" @@ -24,7 +30,7 @@ height="10" layout="topleft" left="30" - name="info_string" + name="label" top_pad="25" width="120"> Preset Name: @@ -34,7 +40,7 @@ follows="top|left" layout="topleft" left_pad="10" - name="water_preset_combo" + name="sky_preset_combo" top_delta="-5" width="200"> <combo_box.item @@ -47,7 +53,7 @@ height="40" layout="topleft" left_pad="10" - name="info_string" + name="note" top_delta="0" width="405" wrap="true"> diff --git a/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml index a29c725ee9..cf4e224835 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_water_preset.xml @@ -3,18 +3,23 @@ legacy_header_height="18" height="450" layout="topleft" - name="Environment Editor Floater" - help_topic="environment_editor_floater" + name="Edit Water Preset" + help_topic="" save_rect="true" title="Edit Water Preset" width="900"> - + + <string name="title_new">Create a New Water Preset</string> + <string name="title_edit">Edit a Water Preset</string> + <string name="hint_new">Name your preset, adjust the controls to create it, and click "Save".</string> + <string name="hint_edit">To edit your water preset, adjust the controls and click "Save".</string> + <text follows="top|left|right" height="10" layout="topleft" left="30" - name="info_string" + name="hint" top="25" width="700"> To edit your preset, adjust the controls then click "Save" @@ -26,7 +31,7 @@ height="10" layout="topleft" left="30" - name="info_string" + name="label" top_pad="25" width="120"> Preset Name: @@ -51,7 +56,7 @@ height="40" layout="topleft" left_pad="10" - name="info_string" + name="note" top_delta="0" width="405" wrap="true"> |