diff options
Diffstat (limited to 'linden/indra/newview/llfloaterdaycycle.h')
-rw-r--r-- | linden/indra/newview/llfloaterdaycycle.h | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/linden/indra/newview/llfloaterdaycycle.h b/linden/indra/newview/llfloaterdaycycle.h new file mode 100644 index 0000000..edddbb5 --- /dev/null +++ b/linden/indra/newview/llfloaterdaycycle.h | |||
@@ -0,0 +1,146 @@ | |||
1 | /** | ||
2 | * @file llfloaterdaycycle.h | ||
3 | * @brief LLFloaterDayCycle class definition | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2007-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #ifndef LL_LLFLOATERDAYCYCLE_H | ||
33 | #define LL_LLFLOATERDAYCYCLE_H | ||
34 | |||
35 | #include "llfloater.h" | ||
36 | |||
37 | #include <vector> | ||
38 | #include "llwlparamset.h" | ||
39 | #include "llwlanimator.h" | ||
40 | |||
41 | struct WLColorControl; | ||
42 | struct WLFloatControl; | ||
43 | |||
44 | /// convenience class for holding keys mapped to sliders | ||
45 | struct LLWLSkyKey | ||
46 | { | ||
47 | public: | ||
48 | LLString presetName; | ||
49 | F32 time; | ||
50 | }; | ||
51 | |||
52 | /// Menu for all of windlight's functionality. | ||
53 | /// Menuing system for adjusting the atmospheric settings of the world. | ||
54 | class LLFloaterDayCycle : public LLFloater | ||
55 | { | ||
56 | public: | ||
57 | |||
58 | LLFloaterDayCycle(); | ||
59 | virtual ~LLFloaterDayCycle(); | ||
60 | |||
61 | /// help button stuff | ||
62 | static void onClickHelp(void* data); | ||
63 | void initHelpBtn(const char* name, const char* xml_alert); | ||
64 | |||
65 | /// initialize all | ||
66 | void initCallbacks(void); | ||
67 | |||
68 | /// one and one instance only | ||
69 | static LLFloaterDayCycle* instance(); | ||
70 | |||
71 | /// on time slider moved | ||
72 | static void onTimeSliderMoved(LLUICtrl* ctrl, void* userData); | ||
73 | |||
74 | /// what happens when you move the key frame | ||
75 | static void onKeyTimeMoved(LLUICtrl* ctrl, void* userData); | ||
76 | |||
77 | /// what happens when you change the key frame's time | ||
78 | static void onKeyTimeChanged(LLUICtrl* ctrl, void* userData); | ||
79 | |||
80 | /// if you change the combo box, change the frame | ||
81 | static void onKeyPresetChanged(LLUICtrl* ctrl, void* userData); | ||
82 | |||
83 | /// run this when user says to run the sky animation | ||
84 | static void onRunAnimSky(void* userData); | ||
85 | |||
86 | /// run this when user says to stop the sky animation | ||
87 | static void onStopAnimSky(void* userData); | ||
88 | |||
89 | /// if you change the combo box, change the frame | ||
90 | static void onTimeRateChanged(LLUICtrl* ctrl, void* userData); | ||
91 | |||
92 | /// add a new key on slider | ||
93 | static void onAddKey(void* userData); | ||
94 | |||
95 | /// delete any and all reference to a preset | ||
96 | void deletePreset(LLString& presetName); | ||
97 | |||
98 | /// delete a key frame | ||
99 | static void onDeleteKey(void* userData); | ||
100 | |||
101 | /// button to load day | ||
102 | static void onLoadDayCycle(void* userData); | ||
103 | |||
104 | /// button to save day | ||
105 | static void onSaveDayCycle(void* userData); | ||
106 | |||
107 | /// toggle for Linden time | ||
108 | static void onUseLindenTime(void* userData); | ||
109 | |||
110 | |||
111 | //// menu management | ||
112 | |||
113 | /// show off our menu | ||
114 | static void show(); | ||
115 | |||
116 | /// return if the menu exists or not | ||
117 | static bool isOpen(); | ||
118 | |||
119 | /// stuff to do on exit | ||
120 | virtual void onClose(bool app_quitting); | ||
121 | |||
122 | /// sync up sliders with day cycle structure | ||
123 | static void syncMenu(); | ||
124 | |||
125 | // makes sure key slider has what's in day cycle | ||
126 | static void syncSliderTrack(); | ||
127 | |||
128 | /// makes sure day cycle data structure has what's in menu | ||
129 | static void syncTrack(); | ||
130 | |||
131 | /// add a slider to the track | ||
132 | static void addSliderKey(F32 time, const LLString& presetName); | ||
133 | |||
134 | private: | ||
135 | |||
136 | // one instance on the inside | ||
137 | static LLFloaterDayCycle* sDayCycle; | ||
138 | |||
139 | // map of sliders to parameters | ||
140 | static std::map<LLString, LLWLSkyKey> sSliderToKey; | ||
141 | |||
142 | static const F32 sHoursPerDay; | ||
143 | }; | ||
144 | |||
145 | |||
146 | #endif | ||