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_RejoinDialog.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
SCR_RejoinDialog
:
SCR_ErrorDialog
3
{
4
// Widget Names
5
const
string
WIDGET_TXT_TIMER =
"Timer"
;
6
const
string
WIDGET_LOADING =
"Loading"
;
7
8
// Widgets
9
protected
TextWidget
m_wTimer
;
10
protected
Widget
m_wLoading
;
11
12
protected
int
m_iTimer
;
13
14
// Invokers
15
protected
ref
ScriptInvoker<int>
Event_OnTimerChanged
;
16
17
//------------------------------------------------------------------------------------------------
18
protected
void
InvokeEventOnTimerChanged
(
int
arg0)
19
{
20
if
(
Event_OnTimerChanged
)
21
Event_OnTimerChanged
.Invoke(
this
, arg0);
22
}
23
24
//------------------------------------------------------------------------------------------------
25
ScriptInvoker
GetEventOnTimerChanged
()
26
{
27
if
(!
Event_OnTimerChanged
)
28
Event_OnTimerChanged
=
new
ScriptInvoker
();
29
30
return
Event_OnTimerChanged
;
31
}
32
33
//------------------------------------------------------------------------------------------------
34
// Dialog override functions
35
//------------------------------------------------------------------------------------------------
36
37
//------------------------------------------------------------------------------------------------
38
override
void
HandlerAttached
(
Widget
w)
39
{
40
super.HandlerAttached(w);
41
42
m_wTimer
=
TextWidget
.Cast(w.FindAnyWidget(WIDGET_TXT_TIMER));
43
m_wLoading
= w.FindAnyWidget(WIDGET_LOADING);
44
}
45
46
//------------------------------------------------------------------------------------------------
47
protected
void
DecreaseTime
()
48
{
49
m_iTimer
--;
50
if
(
m_iTimer
> 0)
51
GetGame
().GetCallqueue().CallLater(
DecreaseTime
, 1000);
52
53
InvokeEventOnTimerChanged
(
m_iTimer
);
54
}
55
56
//------------------------------------------------------------------------------------------------
57
// Public API
58
//------------------------------------------------------------------------------------------------
59
60
//------------------------------------------------------------------------------------------------
61
void
RunTimer
(
bool
run)
62
{
63
// Stop
64
GetGame
().GetCallqueue().Remove(
DecreaseTime
);
65
66
// Run next cycle
67
if
(run)
68
GetGame
().GetCallqueue().CallLater(
DecreaseTime
, 1000);
69
}
70
71
//------------------------------------------------------------------------------------------------
72
void
SetTimer
(
int
time)
73
{
74
m_iTimer
= time;
75
InvokeEventOnTimerChanged
(
m_iTimer
);
76
}
77
78
//------------------------------------------------------------------------------------------------
79
int
GetTimer
()
80
{
81
return
m_iTimer
;
82
}
83
84
//------------------------------------------------------------------------------------------------
85
void
ShowLoading
(
bool
show)
86
{
87
if
(
m_wLoading
)
88
m_wLoading
.SetVisible(show);
89
}
90
91
//------------------------------------------------------------------------------------------------
92
static
SCR_RejoinDialog
FindRejoinComponent
(notnull
Widget
w)
93
{
94
return
SCR_RejoinDialog
.Cast(w.FindHandler(
SCR_RejoinDialog
));
95
}
96
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
SCR_ErrorDialog
Definition
SCR_ErrorDialog.c:3
SCR_RejoinDialog
Definition
SCR_RejoinDialog.c:3
SCR_RejoinDialog::m_wTimer
TextWidget m_wTimer
Definition
SCR_RejoinDialog.c:9
SCR_RejoinDialog::RunTimer
void RunTimer(bool run)
Definition
SCR_RejoinDialog.c:61
SCR_RejoinDialog::GetEventOnTimerChanged
ScriptInvoker GetEventOnTimerChanged()
Definition
SCR_RejoinDialog.c:25
SCR_RejoinDialog::m_iTimer
int m_iTimer
Definition
SCR_RejoinDialog.c:12
SCR_RejoinDialog::ShowLoading
void ShowLoading(bool show)
Definition
SCR_RejoinDialog.c:85
SCR_RejoinDialog::FindRejoinComponent
static SCR_RejoinDialog FindRejoinComponent(notnull Widget w)
Definition
SCR_RejoinDialog.c:92
SCR_RejoinDialog::GetTimer
int GetTimer()
Definition
SCR_RejoinDialog.c:79
SCR_RejoinDialog::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_RejoinDialog.c:38
SCR_RejoinDialog::SetTimer
void SetTimer(int time)
Definition
SCR_RejoinDialog.c:72
SCR_RejoinDialog::m_wLoading
Widget m_wLoading
Definition
SCR_RejoinDialog.c:10
SCR_RejoinDialog::InvokeEventOnTimerChanged
void InvokeEventOnTimerChanged(int arg0)
Definition
SCR_RejoinDialog.c:18
SCR_RejoinDialog::DecreaseTime
void DecreaseTime()
Definition
SCR_RejoinDialog.c:47
SCR_RejoinDialog::Event_OnTimerChanged
ref ScriptInvoker< int > Event_OnTimerChanged
Definition
SCR_RejoinDialog.c:15
TextWidget
Definition
TextWidget.c:16
Widget
Definition
Widget.c:13
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
UI
Menu
Dialogs
SCR_RejoinDialog.c
Generated by
1.17.0