00001 00032 #ifndef LL_LLFLOATERDAYCYCLE_H 00033 #define LL_LLFLOATERDAYCYCLE_H 00034 00035 #include "llfloater.h" 00036 00037 #include <vector> 00038 #include "llwlparamset.h" 00039 #include "llwlanimator.h" 00040 00041 struct WLColorControl; 00042 struct WLFloatControl; 00043 00045 struct LLWLSkyKey 00046 { 00047 public: 00048 LLString presetName; 00049 F32 time; 00050 }; 00051 00054 class LLFloaterDayCycle : public LLFloater 00055 { 00056 public: 00057 00058 LLFloaterDayCycle(); 00059 virtual ~LLFloaterDayCycle(); 00060 00062 static void onClickHelp(void* data); 00063 void initHelpBtn(const char* name, const char* xml_alert); 00064 00066 void initCallbacks(void); 00067 00069 static LLFloaterDayCycle* instance(); 00070 00072 static void onTimeSliderMoved(LLUICtrl* ctrl, void* userData); 00073 00075 static void onKeyTimeMoved(LLUICtrl* ctrl, void* userData); 00076 00078 static void onKeyTimeChanged(LLUICtrl* ctrl, void* userData); 00079 00081 static void onKeyPresetChanged(LLUICtrl* ctrl, void* userData); 00082 00084 static void onRunAnimSky(void* userData); 00085 00087 static void onStopAnimSky(void* userData); 00088 00090 static void onTimeRateChanged(LLUICtrl* ctrl, void* userData); 00091 00093 static void onAddKey(void* userData); 00094 00096 void deletePreset(LLString& presetName); 00097 00099 static void onDeleteKey(void* userData); 00100 00102 static void onLoadDayCycle(void* userData); 00103 00105 static void onSaveDayCycle(void* userData); 00106 00108 static void onUseLindenTime(void* userData); 00109 00110 00112 00114 static void show(); 00115 00117 static bool isOpen(); 00118 00120 virtual void onClose(bool app_quitting); 00121 00123 static void syncMenu(); 00124 00125 // makes sure key slider has what's in day cycle 00126 static void syncSliderTrack(); 00127 00129 static void syncTrack(); 00130 00132 static void addSliderKey(F32 time, const LLString& presetName); 00133 00134 private: 00135 00136 // one instance on the inside 00137 static LLFloaterDayCycle* sDayCycle; 00138 00139 // map of sliders to parameters 00140 static std::map<LLString, LLWLSkyKey> sSliderToKey; 00141 00142 static const F32 sHoursPerDay; 00143 }; 00144 00145 00146 #endif