Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SystemClockUIComponent.c
Go to the documentation of this file.
1
// Script File
2
3
7
class
SCR_SystemClockUIComponent
:
ScriptedWidgetComponent
8
{
9
//References
10
protected
TextWidget
m_ClockTimeText
;
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
22
m_ClockTimeText
.SetText(
SCR_FormatHelper
.
GetTimeFormattingHoursMinutes
(hour, minute));
23
}
24
25
26
//======================== ATTACH/DEATTACH HANDLER ========================\\
27
//On Init
28
override
void
HandlerAttached
(
Widget
w)
29
{
30
m_ClockTimeText
=
TextWidget
.Cast(w);
31
32
//Add update each second for system clock
33
if
(
m_ClockTimeText
)
34
{
35
OnSystemClockUpdate
();
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
49
if
(
m_ClockTimeText
)
50
{
51
GetGame
().GetCallqueue().Remove(
OnSystemClockUpdate
);
52
}
53
}
54
55
56
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_FormatHelper
Definition
SCR_FormatHelper.c:2
SCR_FormatHelper::GetTimeFormattingHoursMinutes
static string GetTimeFormattingHoursMinutes(int hours, int minutes, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
Definition
SCR_FormatHelper.c:220
SCR_SystemClockUIComponent
Definition
SCR_SystemClockUIComponent.c:8
SCR_SystemClockUIComponent::HandlerDeattached
override void HandlerDeattached(Widget w)
Definition
SCR_SystemClockUIComponent.c:46
SCR_SystemClockUIComponent::m_ClockTimeText
TextWidget m_ClockTimeText
Definition
SCR_SystemClockUIComponent.c:10
SCR_SystemClockUIComponent::OnSystemClockUpdate
void OnSystemClockUpdate()
Definition
SCR_SystemClockUIComponent.c:15
SCR_SystemClockUIComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_SystemClockUIComponent.c:28
ScriptedWidgetComponent
Definition
ScriptedWidgetComponent.c:13
System
Definition
System.c:13
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
scripts
Game
UI
Components
SCR_SystemClockUIComponent.c
Generated by
1.17.0