11 private static const int m_DaysInMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
100 PluginSceneManager
editor;
102 if (
w == m_BtnCancel)
104 GetGame().GetWorld().SetDate(m_OrigYear, m_OrigMonth, m_OrigDay, m_OrigHour, m_OrigMinute);
107 weather.GetOvercast().Set(m_OrigOvercast, 0, 1000);
108 weather.GetRain().Set(m_OrigRain, 0, 1000);
109 weather.GetFog().Set(m_OrigFog, 0, 1000);
110 weather.SetWindSpeed(m_OrigWindForce);
115 else if (
w == m_BtnSceneNew)
121 else if (
w == m_BtnSceneLoad)
123 if (m_LstListScenes.GetSelectedRow() != -1)
125 m_LstListScenes.GetItemText(m_LstListScenes.GetSelectedRow(), 0,
scene_name);
134 else if (
w == m_BtnSceneRename)
136 m_LstListScenes.GetItemText(m_LstListScenes.GetSelectedRow(), 0,
scene_name);
138 UIPopupScriptSceneRename
popup_rename = UIPopupScriptSceneRename.Cast(
PopupOpen(SceneEditorMenu.POPUP_ID_SCENE_RENAME,
NULL));
143 else if (
w == m_BtnSceneDuplicate)
145 if (m_LstListScenes.GetSelectedRow() != -1)
147 m_LstListScenes.GetItemText(m_LstListScenes.GetSelectedRow(), 0,
scene_name);
156 else if (
w == m_BtnSceneDelete)
158 if (m_LstListScenes.GetSelectedRow() != -1)
160 m_LstListScenes.GetItemText(m_LstListScenes.GetSelectedRow(), 0,
scene_name);
167 UIPopupScriptSceneDelete
popup_delete = UIPopupScriptSceneDelete.Cast(
PopupOpen(SceneEditorMenu.POPUP_ID_SCENE_DELETE,
NULL));
173 popup_notify.SetLabelText(
"You cant delete current loaded scene!");
180 else if (
w == m_BtnSave)
193 editor.SetWeather(m_CurrOvercast, m_CurrRain, m_CurrFog, m_CurrWindForce);
194 editor.SetDate(m_CurrYear, m_CurrMonth, m_CurrDay, m_CurrHour, m_CurrMinute);
207 if (
w == m_SldStartTime)
217 GetGame().GetWorld().SetDate(m_CurrYear, m_CurrMonth, m_CurrDay, m_CurrHour, m_CurrMinute);
221 else if (
w == m_SldStartDay)
227 for (
int i = 0;
i < 12;
i++)
229 int days = m_DaysInMonth[
i];
242 GetGame().GetWorld().SetDate(m_CurrYear, m_CurrMonth, m_CurrDay, m_CurrHour, m_CurrMinute);
246 else if (
w == m_SldOvercast)
248 m_CurrOvercast = m_SldOvercast.GetCurrent() * 0.01;
249 GetGame().GetWeather().GetOvercast().Set(m_CurrOvercast, 0, 1000);
255 else if (
w == m_SldRain)
257 m_CurrRain = m_SldRain.GetCurrent() * 0.01;
258 GetGame().GetWeather().GetRain().Set(m_CurrRain, 0, 1000);
264 else if (
w == m_SldFog)
266 m_CurrFog = m_SldFog.GetCurrent() * 0.01;
267 GetGame().GetWeather().GetFog().Set(m_CurrFog, 0, 1000);
273 else if (
w == m_SldWindForce)
275 float wind_slider = m_SldWindForce.GetCurrent() * 0.01;
277 GetGame().GetWeather().SetWindSpeed(m_CurrWindForce);