Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
scriptconsoleweathertab.c
Go to the documentation of this file.
2 {
3  protected ref Timer m_RPCTimer = new Timer();
4  protected const int INTERPOLATION_MAX = 920;
5  protected const int DURATION_MAX = 920;
6 
7  // FOG
8  protected SliderWidget m_FogValueSetSlider;
9  protected SliderWidget m_FogValueGetSlider;
10 
11  protected TextWidget m_FogValueSetText;
12 
13  protected SliderWidget m_FogInterpolationTimeSlider;
14  protected SliderWidget m_FogDurationTimeSlider;
15 
16 
17  protected TextWidget m_FogInterpolationMaxText;
18  protected TextWidget m_FogDurationMaxText;
19 
20  protected EditBoxWidget m_FogValueEditbox;
21  protected EditBoxWidget m_FogInterpolationEditbox;
22  protected EditBoxWidget m_FogDurationEditbox;
23 
24  protected static float m_FogValue = -1;
25  protected static float m_FogInterpolationTimeValue;
26  protected static float m_FogDurationTimeValue = -1;
27 
28 
29  // OVERCAST
30  protected SliderWidget m_OvercastValueSetSlider;
31  protected SliderWidget m_OvercastValueGetSlider;
32 
33  protected TextWidget m_OvercastValueSetText;
34 
35  protected SliderWidget m_OvercastInterpolationTimeSlider;
36  protected SliderWidget m_OvercastDurationTimeSlider;
37 
38 
39  protected TextWidget m_OvercastInterpolationMaxText;
40  protected TextWidget m_OvercastDurationMaxText;
41 
42  protected EditBoxWidget m_OvercastValueEditbox;
43  protected EditBoxWidget m_OvercastInterpolationEditbox;
44  protected EditBoxWidget m_OvercastDurationEditbox;
45 
46  protected static float m_OvercastValue = -1;
47  protected static float m_OvercastInterpolationTimeValue;
48  protected static float m_OvercastDurationTimeValue = -1;
49 
50 
51  // Rain
52  protected SliderWidget m_RainValueSetSlider;
53  protected SliderWidget m_RainValueGetSlider;
54 
55  protected TextWidget m_RainValueSetText;
56 
57  protected SliderWidget m_RainInterpolationTimeSlider;
58  protected SliderWidget m_RainDurationTimeSlider;
59 
60 
61  protected TextWidget m_RainInterpolationMaxText;
62  protected TextWidget m_RainDurationMaxText;
63 
64  protected EditBoxWidget m_RainValueEditbox;
65  protected EditBoxWidget m_RainInterpolationEditbox;
66  protected EditBoxWidget m_RainDurationEditbox;
67 
68  protected static float m_RainValue = -1;
69  protected static float m_RainInterpolationTimeValue;
70  protected static float m_RainDurationTimeValue = -1;
71 
72 
73  // Other
74  protected ButtonWidget m_ResetButton;
75  protected ButtonWidget m_UpdateButton;
76  protected ButtonWidget m_ApplyButton;
77 
78  protected ButtonWidget m_CopyButton;
79  protected ButtonWidget m_PasteButton;
80 
81 
82 
84  {
85  // FOG
86  m_FogValue = m_FogValueSetSlider.GetCurrent() / 100;
87  m_FogInterpolationTimeValue = m_FogInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
88  m_FogDurationTimeValue = m_FogDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
89 
90  // OVERCAST
91  m_OvercastValue = m_OvercastValueSetSlider.GetCurrent() / 100;
92  m_OvercastInterpolationTimeValue = m_OvercastInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
93  m_OvercastDurationTimeValue = m_OvercastDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
94 
95  // Rain
96  m_RainValue = m_RainValueSetSlider.GetCurrent() / 100;
97  m_RainInterpolationTimeValue = m_RainInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
98  m_RainDurationTimeValue = m_RainDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
99  }
100 
101  void ScriptConsoleWeatherTab(Widget root, ScriptConsole console, Widget button, ScriptConsoleTabBase parent = null)
102  {
103  // FOG
104  m_FogValueSetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderFogValue"));
105  m_FogValueGetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderFogActualValue"));
106  m_FogValueSetText = TextWidget.Cast(root.FindAnyWidget("TextFogValueActual"));
107 
108  m_FogInterpolationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderFogTarget"));
109  m_FogDurationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderFogDuration"));
110 
111  m_FogInterpolationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxFogTarget"));
112  m_FogDurationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxFogDuration"));
113 
114  m_FogValueEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxFogValue"));
115  m_FogInterpolationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxFogTarget"));
116  m_FogDurationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxFogDuration"));
117 
118  // OVERCAST
119  m_OvercastValueSetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderOvercastValue"));
120  m_OvercastValueGetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderOvercastActualValue"));
121  m_OvercastValueSetText = TextWidget.Cast(root.FindAnyWidget("TextOvercastValueActual"));
122 
123  m_OvercastInterpolationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderOvercastTarget"));
124  m_OvercastDurationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderOvercastDuration"));
125 
126  m_OvercastInterpolationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxOvercastTarget"));
127  m_OvercastDurationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxOvercastDuration"));
128 
129  m_OvercastValueEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxOvercastValue"));
130  m_OvercastInterpolationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxOvercastTarget"));
131  m_OvercastDurationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxOvercastDuration"));
132 
133  // Rain
134  m_RainValueSetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderRainValue"));
135  m_RainValueGetSlider = SliderWidget.Cast(root.FindAnyWidget("SliderRainActualValue"));
136  m_RainValueSetText = TextWidget.Cast(root.FindAnyWidget("TextRainValueActual"));
137 
138  m_RainInterpolationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderRainTarget"));
139  m_RainDurationTimeSlider = SliderWidget.Cast(root.FindAnyWidget("SliderRainDuration"));
140 
141  m_RainInterpolationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxRainTarget"));
142  m_RainDurationMaxText = TextWidget.Cast(root.FindAnyWidget("TextMaxRainDuration"));
143 
144  m_RainValueEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxRainValue"));
145  m_RainInterpolationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxRainTarget"));
146  m_RainDurationEditbox = EditBoxWidget.Cast(root.FindAnyWidget("EditBoxRainDuration"));
147 
148  //Other
149  m_ResetButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonReset"));
150  m_UpdateButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonUpdate"));
151  m_ApplyButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonApply"));
152 
153  m_CopyButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonCopy"));
154  m_PasteButton = ButtonWidget.Cast(root.FindAnyWidget("ButtonPaste"));
155 
156 
157  InitValues();
158  }
159 
160  protected void ResetValues()
161  {
162  // FOG
163  m_FogValueEditbox.SetText("0");
164  m_FogDurationEditbox.SetText(DURATION_MAX.ToString());
165  m_FogInterpolationEditbox.SetText("0");
166 
167  // OVERCAST
168  m_OvercastValueEditbox.SetText("0");
169  m_OvercastDurationEditbox.SetText(DURATION_MAX.ToString());
170  m_OvercastInterpolationEditbox.SetText("0");
171 
172  // Rain
173  m_RainValueEditbox.SetText("0");
174  m_RainDurationEditbox.SetText(DURATION_MAX.ToString());
175  m_RainInterpolationEditbox.SetText("0");
176 
177  UpdateSliderValues();
178 
179  //FOG
180  m_FogValue = 0;
181  m_FogInterpolationTimeValue = 0;
182  m_FogDurationTimeValue = DURATION_MAX;
183 
184  // OVERCAST
185  m_OvercastValue = 0;
186  m_OvercastInterpolationTimeValue = 0;
187  m_OvercastDurationTimeValue = DURATION_MAX;
188 
189  //RAIN
190  m_RainValue = 0;
191  m_RainInterpolationTimeValue = 0;
192  m_RainDurationTimeValue = DURATION_MAX;
193 
194 
195  }
196 
197  protected void InitValues(bool forceCurrent = false)
198  {
199 
200  // FOG
201  float fogVal = m_FogValue;
202  if (forceCurrent || m_FogValue == -1)
203  {
204  fogVal = GetGame().GetWeather().GetFog().GetActual();
205  }
206  m_FogValueEditbox.SetText(fogVal.ToString());
207 
208  m_FogInterpolationEditbox.SetText(m_FogInterpolationTimeValue.ToString());
209 
210  if (m_FogDurationTimeValue == -1)
211  m_FogDurationTimeValue = DURATION_MAX;
212  m_FogDurationEditbox.SetText(m_FogDurationTimeValue.ToString());
213 
214  m_FogInterpolationMaxText.SetText(INTERPOLATION_MAX.ToString());
215  m_FogDurationMaxText.SetText(DURATION_MAX.ToString());
216 
217 
218  // OVERCAST
219  float overcastVal = m_OvercastValue;
220  if (forceCurrent || m_OvercastValue == -1)
221  {
222  overcastVal = GetGame().GetWeather().GetOvercast().GetActual();
223  }
224  m_OvercastValueEditbox.SetText(overcastVal.ToString());
225 
226  m_OvercastInterpolationEditbox.SetText(m_OvercastInterpolationTimeValue.ToString());
227 
228 
229  if (m_OvercastDurationTimeValue == -1)
230  m_OvercastDurationTimeValue = DURATION_MAX;
231  m_OvercastDurationEditbox.SetText(m_OvercastDurationTimeValue.ToString());
232 
233  m_OvercastInterpolationMaxText.SetText(INTERPOLATION_MAX.ToString());
234  m_OvercastDurationMaxText.SetText(DURATION_MAX.ToString());
235 
236  // RAIN
237  float rainVal = m_RainValue;
238  if (forceCurrent || m_RainValue == -1)
239  {
240  rainVal = GetGame().GetWeather().GetRain().GetActual();
241  }
242 
243  m_RainValueEditbox.SetText(rainVal.ToString());
244  m_RainInterpolationEditbox.SetText(m_RainInterpolationTimeValue.ToString());
245 
246  if (m_RainDurationTimeValue == -1)
247  m_RainDurationTimeValue = DURATION_MAX;
248  m_RainDurationEditbox.SetText(m_RainDurationTimeValue.ToString());
249 
250  m_RainInterpolationMaxText.SetText(INTERPOLATION_MAX.ToString());
251  m_RainDurationMaxText.SetText(DURATION_MAX.ToString());
252 
253  UpdateSliderValues();
254  }
255 
256  protected void PasteValues(string clipboard)
257  {
258  TStringArray values = new TStringArray();
259  clipboard.Split(" ", values);
260  if (values.Count() != 9)
261  return;
262  // FOG
263  m_FogValueEditbox.SetText(values.Get(0));
264  m_FogInterpolationEditbox.SetText(values.Get(1));
265  m_FogDurationEditbox.SetText(values.Get(2));
266  // OVERCAST
267  m_OvercastValueEditbox.SetText(values.Get(3));
268  m_OvercastInterpolationEditbox.SetText(values.Get(4));
269  m_OvercastDurationEditbox.SetText(values.Get(5));
270  // RAIN
271  m_RainValueEditbox.SetText(values.Get(6));
272  m_RainInterpolationEditbox.SetText(values.Get(7));
273  m_RainDurationEditbox.SetText(values.Get(8));
274  }
275 
276  protected string CopyValues()
277  {
278  string output;
279 
280  // FOG
281  output += m_FogValueEditbox.GetText();
282  output += " ";
283  output += m_FogInterpolationEditbox.GetText();
284  output += " ";
285  output += m_FogDurationEditbox.GetText();
286  output += " ";
287  // OVERCAST
288  output += m_OvercastValueEditbox.GetText();
289  output += " ";
290  output += m_OvercastInterpolationEditbox.GetText();
291  output += " ";
292  output += m_OvercastDurationEditbox.GetText();
293  output += " ";
294  // RAIN
295  output += m_RainValueEditbox.GetText();
296  output += " ";
297  output += m_RainInterpolationEditbox.GetText();
298  output += " ";
299  output += m_RainDurationEditbox.GetText();
300 
301  return output;
302  }
303 
304  override bool OnChange(Widget w, int x, int y, bool finished)
305  {
306  bool rmbDrag = (GetMouseState(MouseState.RIGHT) & MB_EVENT_CLICK);
307 
308  if (rmbDrag)
309  {
310  // first row
311  if (w == m_FogValueSetSlider)
312  {
313  m_OvercastValueSetSlider.SetCurrent(m_FogValueSetSlider.GetCurrent());
314  m_RainValueSetSlider.SetCurrent(m_FogValueSetSlider.GetCurrent());
315  }
316  else if (w == m_OvercastValueSetSlider)
317  {
318  m_FogValueSetSlider.SetCurrent(m_OvercastValueSetSlider.GetCurrent());
319  m_RainValueSetSlider.SetCurrent(m_OvercastValueSetSlider.GetCurrent());
320  }
321 
322  else if (w == m_RainValueSetSlider)
323  {
324  m_FogValueSetSlider.SetCurrent(m_RainValueSetSlider.GetCurrent());
325  m_OvercastValueSetSlider.SetCurrent(m_RainValueSetSlider.GetCurrent());
326  }
327  // second row
328  else if (w == m_FogInterpolationTimeSlider)
329  {
330  m_OvercastInterpolationTimeSlider.SetCurrent(m_FogInterpolationTimeSlider.GetCurrent());
331  m_RainInterpolationTimeSlider.SetCurrent(m_FogInterpolationTimeSlider.GetCurrent());
332  }
333  else if (w == m_OvercastInterpolationTimeSlider)
334  {
335  m_FogInterpolationTimeSlider.SetCurrent(m_OvercastInterpolationTimeSlider.GetCurrent());
336  m_RainInterpolationTimeSlider.SetCurrent(m_OvercastInterpolationTimeSlider.GetCurrent());
337  }
338 
339  else if (w == m_RainInterpolationTimeSlider)
340  {
341  m_OvercastInterpolationTimeSlider.SetCurrent(m_RainInterpolationTimeSlider.GetCurrent());
342  m_FogInterpolationTimeSlider.SetCurrent(m_RainInterpolationTimeSlider.GetCurrent());
343  }
344  // third row
345  else if (w == m_FogDurationTimeSlider)
346  {
347  m_RainDurationTimeSlider.SetCurrent(m_FogDurationTimeSlider.GetCurrent());
348  m_OvercastDurationTimeSlider.SetCurrent(m_FogDurationTimeSlider.GetCurrent());
349  }
350  else if (w == m_RainDurationTimeSlider)
351  {
352  m_FogDurationTimeSlider.SetCurrent(m_RainDurationTimeSlider.GetCurrent());
353  m_OvercastDurationTimeSlider.SetCurrent(m_RainDurationTimeSlider.GetCurrent());
354  }
355 
356  else if (w == m_OvercastDurationTimeSlider)
357  {
358  m_RainDurationTimeSlider.SetCurrent(m_OvercastDurationTimeSlider.GetCurrent());
359  m_FogDurationTimeSlider.SetCurrent(m_OvercastDurationTimeSlider.GetCurrent());
360  }
361 
362  }
363 
364 
365  SliderWidget slider = SliderWidget.Cast(w);
366  if (slider)
367  {
368  if (rmbDrag && !m_RPCTimer.IsRunning())
369  {
370  if (w == m_OvercastValueSetSlider || w == m_RainValueSetSlider || w == m_FogValueSetSlider)
371  m_RPCTimer.Run(0.25, this, "InvokeSendRPC");
372  }
373  UpdateEditboxValues();
374  return true;
375  }
376  EditBoxWidget box = EditBoxWidget.Cast(w);
377  if (box)
378  {
379  UpdateSliderValues();
380  return true;
381  }
382  return false;
383  }
384 
385  void UpdateSliderValues()
386  {
387  //fog
388  float editboxFogValue = m_FogValueEditbox.GetText().ToFloat();
389  m_FogValueSetSlider.SetCurrent(editboxFogValue * 100);
390 
391  float editboxFogInterpolation = m_FogInterpolationEditbox.GetText().ToFloat();
392  m_FogInterpolationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxFogInterpolation) * 100);
393 
394  float editboxFogDuration = m_FogDurationEditbox.GetText().ToFloat();
395  m_FogDurationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxFogDuration) * 100);
396 
397  //overcast
398  float editboxOvercastValue = m_OvercastValueEditbox.GetText().ToFloat();
399  m_OvercastValueSetSlider.SetCurrent(editboxOvercastValue * 100);
400 
401  float editboxOvercastInterpolation = m_OvercastInterpolationEditbox.GetText().ToFloat();
402  m_OvercastInterpolationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxOvercastInterpolation) * 100);
403 
404  float editboxOvercastDuration = m_OvercastDurationEditbox.GetText().ToFloat();
405  m_OvercastDurationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxOvercastDuration) * 100);
406 
407  //rain
408  float editboxRainValue = m_RainValueEditbox.GetText().ToFloat();
409  m_RainValueSetSlider.SetCurrent(editboxRainValue * 100);
410 
411  float editboxRainInterpolation = m_RainInterpolationEditbox.GetText().ToFloat();
412  m_RainInterpolationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxRainInterpolation) * 100);
413 
414  float editboxRainDuration = m_RainDurationEditbox.GetText().ToFloat();
415  m_RainDurationTimeSlider.SetCurrent(Math.InverseLerp(0,INTERPOLATION_MAX,editboxRainDuration) * 100);
416  }
417 
418  void UpdateEditboxValues()
419  {
420  //fog
421  m_FogInterpolationTimeValue = m_FogInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
422  m_FogInterpolationEditbox.SetText(m_FogInterpolationTimeValue.ToString());
423 
424  m_FogDurationTimeValue = m_FogDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
425  m_FogDurationEditbox.SetText(m_FogDurationTimeValue.ToString());
426 
427  m_FogValue = m_FogValueSetSlider.GetCurrent() / 100;
428  m_FogValueEditbox.SetText(m_FogValue.ToString());
429 
430  //overcast
431  m_OvercastInterpolationTimeValue = m_OvercastInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
432  m_OvercastInterpolationEditbox.SetText(m_OvercastInterpolationTimeValue.ToString());
433 
434  m_OvercastDurationTimeValue = m_OvercastDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
435  m_OvercastDurationEditbox.SetText(m_OvercastDurationTimeValue.ToString());
436 
437  m_OvercastValue = m_OvercastValueSetSlider.GetCurrent() / 100;
438  m_OvercastValueEditbox.SetText(m_OvercastValue.ToString());
439 
440  //rain
441  m_RainInterpolationTimeValue = m_RainInterpolationTimeSlider.GetCurrent() / 100 * INTERPOLATION_MAX;
442  m_RainInterpolationEditbox.SetText(m_RainInterpolationTimeValue.ToString());
443 
444  m_RainDurationTimeValue = m_RainDurationTimeSlider.GetCurrent() / 100 * DURATION_MAX;
445  m_RainDurationEditbox.SetText(m_RainDurationTimeValue.ToString());
446 
447  m_RainValue = m_RainValueSetSlider.GetCurrent() / 100;
448  m_RainValueEditbox.SetText(m_RainValue.ToString());
449  }
450 
451  override bool OnClick(Widget w, int x, int y, int button)
452  {
453  if (w == m_ApplyButton)
454  {
455  SendRPC(GetRPCDataNormal());
456  return true;
457  }
458  else if (w == m_UpdateButton)
459  {
460  InitValues(true);
461  return true;
462  }
463  else if (w == m_ResetButton)
464  {
465  ResetValues();
466  InitValues(true);
467  return true;
468  }
469  else if (w == m_CopyButton)
470  {
471  string output = CopyValues();
472  GetGame().CopyToClipboard(output);
473  return true;
474  }
475 
476  else if (w == m_PasteButton)
477  {
478  string input;
479  GetGame().CopyFromClipboard(input);
480  PasteValues(input);
481  UpdateSliderValues();
482  return true;
483  }
484 
485  return false;
486  }
487 
488 
489 
490  //RPC data where each value is strickly as shown in the UI on the sliders
491  protected DebugWeatherRPCData GetRPCDataNormal()
492  {
494  // FOG
495  data.m_FogValue = m_FogValueSetSlider.GetCurrent() / 100;
496  data.m_FogInterpolation = m_FogInterpolationTimeValue;
497  data.m_FogDuration = m_FogDurationTimeSlider.GetCurrent() / 100 * 960;
498 
499  // Rain
500  data.m_RainValue = m_RainValueSetSlider.GetCurrent() / 100;
501  data.m_RainInterpolation = m_RainInterpolationTimeValue;
502  data.m_RainDuration = m_RainDurationTimeSlider.GetCurrent() / 100 * 960;
503 
504  // OVERCAST
505  data.m_OvercastValue = m_OvercastValueSetSlider.GetCurrent() / 100;
506  data.m_OvercastInterpolation = m_OvercastInterpolationTimeValue;
507  data.m_OvercastDuration = m_OvercastDurationTimeSlider.GetCurrent() / 100 * 960;
508 
509  return data;
510  }
511 
512  //RPC data where the duration and interpolation times are forced(their slider values are ignored) to allow for immediate change and lasting effect
513  protected DebugWeatherRPCData GetRPCDataImmediate()
514  {
516  // FOG
517  data.m_FogValue = m_FogValueSetSlider.GetCurrent() / 100;
518  data.m_FogInterpolation = 0;
519  data.m_FogDuration = 960;
520 
521  // Rain
522  data.m_RainValue = m_RainValueSetSlider.GetCurrent() / 100;
523  data.m_RainInterpolation = 0;
524  data.m_RainDuration = 960;
525 
526  // OVERCAST
527  data.m_OvercastValue = m_OvercastValueSetSlider.GetCurrent() / 100;
528  data.m_OvercastInterpolation = 0;
529  data.m_OvercastDuration = 960;
530 
531  return data;
532  }
533 
534  protected void SendRPC(DebugWeatherRPCData data)
535  {
536  PlayerIdentity identity = null;
537  if (GetGame().GetPlayer())
538  {
539  identity = GetGame().GetPlayer().GetIdentity();
540  }
541 
542  GetGame().RPCSingleParam(null, ERPCs.DEV_SET_WEATHER, new Param1<DebugWeatherRPCData>(data), true, identity);
543  }
544 
545  protected void InvokeSendRPC()
546  {
547  SendRPC(GetRPCDataImmediate());
548  }
549 
550  override void Update(float timeslice)
551  {
552  super.Update(timeslice);
553  float overcast = GetGame().GetWeather().GetOvercast().GetActual();
554  m_OvercastValueGetSlider.SetCurrent(overcast * 100);
555  m_OvercastValueSetText.SetText(overcast.ToString());
556 
557  float fog = GetGame().GetWeather().GetFog().GetActual();
558  m_FogValueGetSlider.SetCurrent(fog * 100);
559  m_FogValueSetText.SetText(fog.ToString());
560 
561  float rain = GetGame().GetWeather().GetRain().GetActual();
562  m_RainValueGetSlider.SetCurrent(rain * 100);
563  m_RainValueSetText.SetText(rain.ToString());
564  }
565 }
GetGame
proto native CGame GetGame()
ScriptConsoleWeatherTab
Definition: scriptconsoleweathertab.c:1
TStringArray
array< string > TStringArray
Definition: enscript.c:685
EditBoxWidget
Definition: enwidgets.c:353
y
Icon y
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
MB_EVENT_CLICK
const int MB_EVENT_CLICK
Definition: pluginkeybinding.c:8
TextWidget
Definition: enwidgets.c:219
DebugWeatherRPCData
Definition: debugweatherrpcdata.c:1
GetMouseState
proto native int GetMouseState(MouseState index)
MouseState
MouseState
Definition: ensystem.c:310
array< string >
x
Icon x
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
ERPCs
ERPCs
Definition: erpcs.c:1
Timer
Definition: dayzplayerimplement.c:62
Widget
Definition: enwidgets.c:189
ScriptConsoleTabBase
Definition: scriptconsoletabbase.c:1
Math
Definition: enmath.c:6