Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
WelcomeDialog.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
WelcomeDialogUI
:
DialogUI
3
{
4
protected
string
m_sHeaderName
=
"Title"
;
5
protected
string
m_sTextName
=
"Text"
;
6
protected
string
m_sSelectionHintName
=
"SelectionHint"
;
7
protected
string
m_sPreviousName
=
"Previous"
;
8
protected
string
m_sNextName
=
"Next"
;
9
protected
string
m_sLinksName
=
"Links"
;
10
11
protected
TextWidget
m_wText
;
12
protected
Widget
m_wHeader
;
13
protected
Widget
m_wLinks
;
14
protected
ref array<ref Widget>
m_wLinkButtons
=
new
array<ref Widget>;
15
protected
Widget
m_wLastFocusedLinkButton
;
16
protected
SCR_SelectionHintComponent
m_SelectionHint
;
17
protected
SCR_InputButtonComponent
m_Previous
;
18
protected
SCR_InputButtonComponent
m_Next
;
19
20
protected
int
m_iCurrentIndex
;
21
protected
int
m_iMaxIndex
;
22
protected
ref array<string>
m_aPageTexts
=
23
{
24
"#ar-welcomescreen_text_01"
,
25
"#ar-welcomescreen_text_02"
,
26
"#ar-welcomescreen_text_03"
,
27
"#ar-welcomescreen_text_04"
,
28
"#ar-welcomescreen_text_05"
,
29
"#ar-welcomescreen_text_06"
,
30
"#ar-welcomescreen_text_07"
31
};
32
33
protected
ref array<string>
m_aPageTextsPS
=
34
{
35
"#ar-welcomescreen_text_01"
,
36
"#ar-welcomescreen_text_02"
,
37
"#ar-welcomescreen_text_03"
,
38
"#ar-welcomescreen_text_06"
39
};
40
41
//------------------------------------------------------------------------------------------------
42
override
void
OnMenuOpen
()
43
{
44
super.OnMenuOpen();
45
46
if
(
System
.GetPlatform() ==
EPlatform
.PS5 ||
System
.GetPlatform() ==
EPlatform
.PS4 ||
System
.GetPlatform() ==
EPlatform
.PS5_PRO)
47
m_aPageTexts
=
m_aPageTextsPS
;
48
49
m_iMaxIndex
=
m_aPageTexts
.Count() - 1;
50
Widget
w =
GetRootWidget
();
51
m_wText
=
TextWidget
.Cast(w.FindAnyWidget(
m_sTextName
));
52
m_wHeader
= w.FindAnyWidget(
m_sHeaderName
);
53
54
m_wLinks
= w.FindAnyWidget(
m_sLinksName
);
55
if
(
m_wLinks
)
56
SCR_WidgetHelper
.GetAllChildren(
m_wLinks
,
m_wLinkButtons
);
57
58
if
(!
m_wLinkButtons
.IsEmpty())
59
{
60
SCR_ButtonTextComponent
buttonComp;
61
foreach
(
Widget
linkButton :
m_wLinkButtons
)
62
{
63
buttonComp =
SCR_ButtonTextComponent
.Cast(linkButton.FindHandler(
SCR_ButtonTextComponent
));
64
if
(!buttonComp)
65
continue
;
66
67
buttonComp.m_OnFocus.Insert(
OnLinkButtonFocus
);
68
}
69
}
70
71
m_Previous
=
SCR_InputButtonComponent
.
GetInputButtonComponent
(
m_sPreviousName
, w);
72
if
(
m_Previous
)
73
m_Previous
.m_OnActivated.Insert(
OnPrevious
);
74
75
m_Next
=
SCR_InputButtonComponent
.
GetInputButtonComponent
(
m_sNextName
, w);
76
if
(
m_Next
)
77
m_Next
.m_OnActivated.Insert(
OnNext
);
78
79
Widget
hint = w.FindAnyWidget(
m_sSelectionHintName
);
80
if
(hint)
81
{
82
m_SelectionHint
=
SCR_SelectionHintComponent
.Cast(hint.FindHandler(
SCR_SelectionHintComponent
));
83
if
(
m_SelectionHint
)
84
{
85
m_SelectionHint
.SetItemCount(
m_aPageTexts
.Count(),
false
);
86
m_SelectionHint
.SetCurrentItem(
m_iCurrentIndex
,
false
);
87
}
88
}
89
90
ShowIndex
(0);
91
}
92
93
//------------------------------------------------------------------------------------------------
94
override
void
OnMenuUpdate
(
float
tDelta)
95
{
96
super.OnMenuUpdate(tDelta);
97
98
GetGame
().GetInputManager().ActivateContext(
"InteractableDialogContext"
);
99
}
100
101
//------------------------------------------------------------------------------------------------
102
override
void
OnConfirm
()
103
{
105
if
(!
m_wLastFocusedLinkButton
||
GetGame
().
GetInputManager
().GetLastUsedInputDevice() != EInputDeviceType.MOUSE)
106
return
;
107
108
SCR_BrowserLinkComponent
linkComp =
SCR_BrowserLinkComponent
.Cast(
m_wLastFocusedLinkButton
.FindHandler(
SCR_BrowserLinkComponent
));
109
linkComp.
OpenBrowser
();
110
}
111
112
//------------------------------------------------------------------------------------------------
113
protected
void
OnPrevious
()
114
{
115
ShowIndex
(
m_iCurrentIndex
- 1);
116
}
117
118
//------------------------------------------------------------------------------------------------
119
protected
void
OnNext
()
120
{
121
ShowIndex
(
m_iCurrentIndex
+ 1);
122
}
123
124
//------------------------------------------------------------------------------------------------
125
protected
void
OnLinkButtonFocus
(
Widget
linkButton)
126
{
127
SCR_BrowserLinkComponent
linkComp =
SCR_BrowserLinkComponent
.Cast(linkButton.FindHandler(
SCR_BrowserLinkComponent
));
128
129
m_wLastFocusedLinkButton
= linkButton;
130
}
131
132
//------------------------------------------------------------------------------------------------
133
protected
void
ShowIndex
(
int
index
)
134
{
135
if
(
index < 0 || index >
m_iMaxIndex
)
136
return
;
137
138
m_iCurrentIndex
=
index
;
139
140
if
(
m_wLinks
)
141
m_wLinks
.SetVisible(
index
==
m_iMaxIndex
);
142
143
if
(
index
==
m_iMaxIndex
&& !
m_wLinkButtons
.IsEmpty())
144
{
146
if
(!
m_wLastFocusedLinkButton
)
147
m_wLastFocusedLinkButton
=
m_wLinkButtons
[0];
148
GetGame
().GetWorkspace().SetFocusedWidget(
m_wLastFocusedLinkButton
);
149
150
/*
151
if (m_Confirm)
152
//m_Confirm.SetVisible(true);
153
*/
154
}
155
else
156
{
157
/*
158
if (m_Confirm)
159
m_Confirm.SetVisible(false);
160
*/
161
163
GetGame
().GetWorkspace().SetFocusedWidget(null);
164
}
165
166
if
(
m_Previous
)
167
m_Previous
.SetEnabled(
index
!= 0);
168
169
if
(
m_Next
)
170
m_Next
.SetEnabled(
index
!=
m_iMaxIndex
);
171
172
if
(
m_wText
)
173
m_wText
.SetTextFormat(
m_aPageTexts
[
index
]);
174
175
if
(
m_SelectionHint
)
176
m_SelectionHint
.SetCurrentItem(
index
);
177
}
178
179
};
180
181
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:205
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
GetRootWidget
Widget GetRootWidget()
Definition
SCR_ModularButtonComponent.c:189
DialogUI
Definition
DialogUI.c:2
SCR_BrowserLinkComponent
Definition
SCR_BrowserLinkComponent.c:2
SCR_BrowserLinkComponent::OpenBrowser
bool OpenBrowser()
Definition
SCR_BrowserLinkComponent.c:46
SCR_ButtonTextComponent
Definition
SCR_ButtonTextComponent.c:3
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_InputButtonComponent::GetInputButtonComponent
static SCR_InputButtonComponent GetInputButtonComponent(string name, notnull Widget parent, bool searchAllChildren=true)
Definition
SCR_InputButtonComponent.c:1212
SCR_SelectionHintComponent
Definition
SCR_SelectionHintComponent.c:3
SCR_WidgetHelper
Definition
SCR_WidgetHelper.c:2
System
Definition
System.c:13
TextWidget
Definition
TextWidget.c:16
WelcomeDialogUI
Definition
WelcomeDialog.c:3
WelcomeDialogUI::ShowIndex
void ShowIndex(int index)
Definition
WelcomeDialog.c:133
WelcomeDialogUI::m_sSelectionHintName
string m_sSelectionHintName
Definition
WelcomeDialog.c:6
WelcomeDialogUI::OnLinkButtonFocus
void OnLinkButtonFocus(Widget linkButton)
Definition
WelcomeDialog.c:125
WelcomeDialogUI::m_sPreviousName
string m_sPreviousName
Definition
WelcomeDialog.c:7
WelcomeDialogUI::m_sNextName
string m_sNextName
Definition
WelcomeDialog.c:8
WelcomeDialogUI::m_wLastFocusedLinkButton
Widget m_wLastFocusedLinkButton
Definition
WelcomeDialog.c:15
WelcomeDialogUI::OnMenuOpen
override void OnMenuOpen()
Definition
WelcomeDialog.c:42
WelcomeDialogUI::m_iMaxIndex
int m_iMaxIndex
Definition
WelcomeDialog.c:21
WelcomeDialogUI::m_wText
TextWidget m_wText
Definition
WelcomeDialog.c:11
WelcomeDialogUI::m_wLinks
Widget m_wLinks
Definition
WelcomeDialog.c:13
WelcomeDialogUI::m_sHeaderName
string m_sHeaderName
Definition
WelcomeDialog.c:4
WelcomeDialogUI::OnNext
void OnNext()
Definition
WelcomeDialog.c:119
WelcomeDialogUI::OnMenuUpdate
override void OnMenuUpdate(float tDelta)
Definition
WelcomeDialog.c:94
WelcomeDialogUI::m_SelectionHint
SCR_SelectionHintComponent m_SelectionHint
Definition
WelcomeDialog.c:16
WelcomeDialogUI::m_Previous
SCR_InputButtonComponent m_Previous
Definition
WelcomeDialog.c:17
WelcomeDialogUI::m_sTextName
string m_sTextName
Definition
WelcomeDialog.c:5
WelcomeDialogUI::OnConfirm
override void OnConfirm()
Definition
WelcomeDialog.c:102
WelcomeDialogUI::m_wLinkButtons
ref array< ref Widget > m_wLinkButtons
Definition
WelcomeDialog.c:14
WelcomeDialogUI::m_sLinksName
string m_sLinksName
Definition
WelcomeDialog.c:9
WelcomeDialogUI::m_aPageTexts
ref array< string > m_aPageTexts
Definition
WelcomeDialog.c:22
WelcomeDialogUI::OnPrevious
void OnPrevious()
Definition
WelcomeDialog.c:113
WelcomeDialogUI::m_wHeader
Widget m_wHeader
Definition
WelcomeDialog.c:12
WelcomeDialogUI::m_iCurrentIndex
int m_iCurrentIndex
Definition
WelcomeDialog.c:20
WelcomeDialogUI::m_Next
SCR_InputButtonComponent m_Next
Definition
WelcomeDialog.c:18
WelcomeDialogUI::m_aPageTextsPS
ref array< string > m_aPageTextsPS
Definition
WelcomeDialog.c:33
Widget
Definition
Widget.c:13
EPlatform
EPlatform
Definition
EPlatform.c:13
scripts
Game
UI
Menu
Dialogs
WelcomeDialog.c
Generated by
1.17.0