Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SystemClockUIComponent.c
Go to the documentation of this file.
1// Script File
2
3
8{
9 //References
11
12
13 //======================== CLOCK UPDATE ========================\\
14 //Sets clock as System clock, Called every seconds
15 protected void OnSystemClockUpdate()
16 {
17 //Get time
18 int hour, minute, sec;
19 System.GetHourMinuteSecond(hour, minute, sec);
20
21 //Set text
23 }
24
25
26 //======================== ATTACH/DEATTACH HANDLER ========================\\
27 //On Init
28 override void HandlerAttached(Widget w)
29 {
31
32 //Add update each second for system clock
34 {
36 GetGame().GetCallqueue().CallLater(OnSystemClockUpdate, 1000, true);
37 }
38 else
39 {
40 Print("System Clock not attached to Text Widget!", LogLevel.ERROR);
41 }
42 }
43
44
45 //On Destroy
46 override void HandlerDeattached(Widget w)
47 {
48 //Remove every second update System Clock
50 {
51 GetGame().GetCallqueue().Remove(OnSystemClockUpdate);
52 }
53 }
54
55
56};
ArmaReforgerScripted GetGame()
Definition game.c:1398
static string GetTimeFormattingHoursMinutes(int hours, int minutes, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
override void HandlerDeattached(Widget w)
override void HandlerAttached(Widget w)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14