From bbde07245bdcedd05bd37863d573c94c2af4c6f7 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 26 May 2011 23:09:30 +0300 Subject: STORM-1285 WIP Connected "Create/Edit Water / Sky / Day Cycle" floaters (not functional) to the main menu. --- indra/newview/llfloatereditdaycycle.h | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 indra/newview/llfloatereditdaycycle.h (limited to 'indra/newview/llfloatereditdaycycle.h') 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 -- cgit v1.2.3 From 657e434fd59139436e8b97e5ecd01ca686e82269 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 30 May 2011 22:34:56 +0300 Subject: STORM-1253 WIP New day cycle editor. Done: * Creating new local day cycles. * Editing existing local day cycles. * Deleting day cycles. To do: * Editing region day cycle, dealing with skies in region scope. * Handle teleport while editing a day cycle. * Update UI when a day cycle or sky preset gets deleted. * Make the time ctrl increase/decrease consistently. --- indra/newview/llfloatereditdaycycle.h | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index d1caa05888..742608712b 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -29,6 +29,16 @@ #include "llfloater.h" +#include "llwlparammanager.h" // for LLWLParamKey + +class LLCheckBoxCtrl; +class LLComboBox; +class LLLineEditor; +class LLMultiSliderCtrl; +class LLTimeCtrl; + +/// Menu for all of windlight's functionality. +/// Menuing system for adjusting the atmospheric settings of the world. class LLFloaterEditDayCycle : public LLFloater { LOG_CLASS(LLFloaterEditDayCycle); @@ -38,8 +48,78 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void draw(); + +private: + + /// sync the time slider with day cycle structure + void syncTimeSlider(); + + // makes sure key slider has what's in day cycle + void loadTrack(); + + /// makes sure day cycle data structure has what's in menu + void applyTrack(); + + /// refresh the sky presets combobox + void refreshSkyPresetsList(); + + /// refresh the day cycle combobox + void refreshDayCyclesList(); + + /// add a slider to the track + void addSliderKey(F32 time, LLWLParamKey keyframe); + void initCallbacks(); + LLWLParamKey getSelectedDayCycle(); + void deletePreset(LLWLParamKey keyframe); + bool isNewDay() const; + void dumpTrack(); + void enableEditing(bool enable); + void reset(); + + void onTimeSliderMoved(); /// time slider moved + void onKeyTimeMoved(); /// a key frame moved + void onKeyTimeChanged(); /// a key frame's time changed + void onKeyPresetChanged(); /// sky preset selected + void onAddKey(); /// new key added on slider + void onDeleteKey(); /// a key frame deleted + + void onDayCycleNameEdited(); + void onDayCycleSelected(); + void onBtnSave(); void onBtnCancel(); + + bool onSaveAnswer(const LLSD& notification, const LLSD& response); + void onSaveConfirmed(); + + static std::string getRegionName(); + + /// convenience class for holding keyframes mapped to sliders + struct SliderKey + { + public: + SliderKey(LLWLParamKey kf, F32 t) : keyframe(kf), time(t) {} + SliderKey() : keyframe(), time(0.f) {} // Don't use this default constructor + + LLWLParamKey keyframe; + F32 time; + }; + + static const F32 sHoursPerDay; + + LLLineEditor* mDayCycleNameEditor; + LLComboBox* mDayCyclesCombo; + LLMultiSliderCtrl* mTimeSlider; + LLMultiSliderCtrl* mKeysSlider; + LLComboBox* mSkyPresetsCombo; + LLTimeCtrl* mTimeCtrl; + LLCheckBoxCtrl* mMakeDefaultCheckBox; + LLButton* mSaveButton; + + // map of sliders to parameters + std::map mSliderToKey; }; #endif // LL_LLFLOATEREDITDAYCYCLE_H -- cgit v1.2.3 From 778088b74c19773646a50b5c0aa40015f2b242f3 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 31 May 2011 22:36:26 +0300 Subject: STORM-1253 WIP Implemented editing region day cycle. --- indra/newview/llfloatereditdaycycle.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index 742608712b..0a2ba32dfe 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -78,6 +78,10 @@ private: void dumpTrack(); void enableEditing(bool enable); void reset(); + void saveRegionDayCycle(); + + void setApplyProgress(bool started); + bool getApplyProgress() const; void onTimeSliderMoved(); /// time slider moved void onKeyTimeMoved(); /// a key frame moved @@ -86,6 +90,11 @@ private: void onAddKey(); /// new key added on slider void onDeleteKey(); /// a key frame deleted + void onRegionSettingsChange(); + void onRegionChange(); + void onRegionSettingsApplied(bool success); + void onRegionInfoUpdate(); + void onDayCycleNameEdited(); void onDayCycleSelected(); void onBtnSave(); @@ -95,6 +104,7 @@ private: void onSaveConfirmed(); static std::string getRegionName(); + static bool canEditRegionSettings(); /// convenience class for holding keyframes mapped to sliders struct SliderKey -- cgit v1.2.3 From 995a006b58f2be1d7236b32be3570b6d7250013b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 1 Jun 2011 18:26:36 +0300 Subject: STORM-1253 WIP Update UI when a day cycle gets added or deleted. --- indra/newview/llfloatereditdaycycle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index 0a2ba32dfe..3b467b2939 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -103,6 +103,8 @@ private: bool onSaveAnswer(const LLSD& notification, const LLSD& response); void onSaveConfirmed(); + void onDayCycleListChange(); + static std::string getRegionName(); static bool canEditRegionSettings(); -- cgit v1.2.3 From 9f4779e09997e70246c3c0c5f831bf55d4ed6a4f Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 6 Jun 2011 23:46:35 +0300 Subject: STORM-1255 WIP Made the check for region permissions reusable. --- indra/newview/llfloatereditdaycycle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index 3b467b2939..6dc7333039 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -106,7 +106,6 @@ private: void onDayCycleListChange(); static std::string getRegionName(); - static bool canEditRegionSettings(); /// convenience class for holding keyframes mapped to sliders struct SliderKey -- cgit v1.2.3 From 0a2406b494bed489da02f27852d916790b412ab5 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Jun 2011 13:53:15 +0300 Subject: STORM-1255 WIP Changed a comment and a warning message. --- indra/newview/llfloatereditdaycycle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index 6dc7333039..c6137ba432 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -37,8 +37,9 @@ class LLLineEditor; class LLMultiSliderCtrl; class LLTimeCtrl; -/// Menu for all of windlight's functionality. -/// Menuing system for adjusting the atmospheric settings of the world. +/** + * Floater for creating or editing a day cycle. + */ class LLFloaterEditDayCycle : public LLFloater { LOG_CLASS(LLFloaterEditDayCycle); -- cgit v1.2.3 From 7151a4e6b02f02155387fc595034a42aebd7ec9c Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Jun 2011 17:41:26 +0300 Subject: STORM-1255 WIP Consistency pass on sky presets removal. * Update all related floaters when a sky preset gets removed. * Don't allow removing skies referenced by (local) day cycles. * Other minor fixes. --- indra/newview/llfloatereditdaycycle.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index c6137ba432..a27bc69792 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -105,6 +105,7 @@ private: void onSaveConfirmed(); void onDayCycleListChange(); + void onSkyPresetListChange(); static std::string getRegionName(); -- cgit v1.2.3 From b68a4fdcd7f4f2f8599e9336714d2d0a2b8fd259 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Jun 2011 18:46:36 +0300 Subject: STORM-1255 Removed dead code. --- indra/newview/llfloatereditdaycycle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloatereditdaycycle.h') diff --git a/indra/newview/llfloatereditdaycycle.h b/indra/newview/llfloatereditdaycycle.h index a27bc69792..e6e4fe39c1 100644 --- a/indra/newview/llfloatereditdaycycle.h +++ b/indra/newview/llfloatereditdaycycle.h @@ -74,7 +74,6 @@ private: void initCallbacks(); LLWLParamKey getSelectedDayCycle(); - void deletePreset(LLWLParamKey keyframe); bool isNewDay() const; void dumpTrack(); void enableEditing(bool enable); -- cgit v1.2.3