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_SaveLoadEntryComponent.c
Go to the documentation of this file.
1
void
ScriptInvokerButtonMethod
(
SCR_InputButtonComponent
button,
string
actionName);
2
typedef
func
ScriptInvokerButtonMethod
;
3
typedef
ScriptInvokerBase<ScriptInvokerButtonMethod>
ScriptInvokerButton
;
4
5
class
SCR_SaveLoadEntryComponent
:
SCR_ListMenuEntryComponent
6
{
7
protected
ref
SCR_Save_EntryWidgets
m_Widgets
=
new
SCR_Save_EntryWidgets
();
8
9
protected
ref
ScriptInvokerButton
m_OnSave
;
10
protected
ref
ScriptInvokerButton
m_OnLoad
;
11
protected
ref
ScriptInvokerButton
m_OnDelete
;
12
13
protected
bool
m_bCanSave
;
14
protected
bool
m_bCanLoad
;
15
protected
bool
m_bCanDelete
;
16
17
protected
string
m_sFileName
;
18
protected
string
m_sDisplayName
;
19
20
protected
SaveGame
m_Save
;
21
22
protected
bool
m_bHasIssue
;
23
protected
bool
m_bIsFocused
;
24
protected
bool
m_bIsDownloaded
;
25
26
//------------------------------------------------------------------------------------------------
27
protected
void
OnInputDeviceChange
(EInputDeviceType oldDevice, EInputDeviceType newDevice)
28
{
29
if
(newDevice != EInputDeviceType.MOUSE &&
m_bIsFocused
)
30
UpdateAllWidgets
(
true
);
31
}
32
33
//------------------------------------------------------------------------------------------------
34
override
bool
OnFocus
(
Widget
w,
int
x,
int
y)
35
{
36
bool
result = super.OnFocus(w, x, y);
37
38
UpdateAllWidgets
(
true
);
39
40
return
result;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
bool
OnFocusLost
(
Widget
w,
int
x,
int
y)
45
{
46
bool
result = super.OnFocusLost(w, x, y);
47
48
UpdateAllWidgets
(
false
);
49
50
return
result;
51
}
52
53
//------------------------------------------------------------------------------------------------
55
protected
void
UpdateAllWidgets
(
bool
visibility)
56
{
57
m_bIsFocused
= visibility;
58
59
if
(visibility)
60
visibility =
GetGame
().GetInputManager().GetLastUsedInputDevice() == EInputDeviceType.MOUSE;
61
62
m_Widgets
.m_SaveButtonComponent0.SetVisible(visibility &&
m_bCanSave
);
63
m_Widgets
.m_LoadButtonComponent0.SetVisible(visibility &&
m_bCanLoad
);
64
m_Widgets
.m_DeleteButtonComponent0.SetVisible(visibility &&
m_bCanDelete
);
65
}
66
67
//------------------------------------------------------------------------------------------------
68
protected
void
OnClickSave
()
69
{
70
if
(
m_OnSave
)
71
m_OnSave
.Invoke(null,
""
);
72
}
73
74
//------------------------------------------------------------------------------------------------
75
protected
void
OnClickLoad
()
76
{
77
if
(
m_OnLoad
)
78
m_OnLoad
.Invoke(null,
""
);
79
}
80
81
//------------------------------------------------------------------------------------------------
82
protected
void
OnClickDelete
()
83
{
84
if
(
m_OnDelete
)
85
m_OnDelete
.Invoke(null,
""
);
86
}
87
88
//------------------------------------------------------------------------------------------------
89
// --- Setters ---
90
//------------------------------------------------------------------------------------------------
91
92
//------------------------------------------------------------------------------------------------
93
void
SetCanSave
(
bool
state)
94
{
95
m_bCanSave
= state;
96
}
97
98
//------------------------------------------------------------------------------------------------
99
void
SetCanLoad
(
bool
state)
100
{
101
m_bCanLoad
= state;
102
}
103
104
//------------------------------------------------------------------------------------------------
105
void
SetCanDelete
(
bool
state)
106
{
107
m_bCanDelete
= state;
108
}
109
110
//------------------------------------------------------------------------------------------------
111
void
SetScenarioDataVisible
(
bool
state)
112
{
113
//m_Widgets.m_wScenarioInfoList.SetVisibile(state);
114
}
115
116
//------------------------------------------------------------------------------------------------
117
void
SetScenarioName
(
string
name)
118
{
119
//m_Widgets.m_wScenarioName.SetText(name);
120
}
121
122
//------------------------------------------------------------------------------------------------
123
void
SetScenarioIcon
(
Color
imageColor,
string
icon)
124
{
125
//m_Widgets.m_wScenarioImage.LoadImageTexture(0, icon);
126
//m_Widgets.m_wScenarioImage.SetColor(imageColor);
127
}
128
129
//------------------------------------------------------------------------------------------------
130
void
SetDateTime
(
string
date,
string
time)
131
{
132
m_Widgets
.m_wPreviewDate.SetText(date);
133
m_Widgets
.m_wPreviewTime.SetText(time);
134
}
135
136
//------------------------------------------------------------------------------------------------
137
void
SetVersion
(
string
version,
bool
isVersionCompatible)
138
{
139
m_Widgets
.m_wEntryVersion.SetText(version);
140
141
if
(!isVersionCompatible)
142
m_Widgets
.m_wEntryVersion.SetColor(
UIColors
.WARNING);
143
}
144
145
//------------------------------------------------------------------------------------------------
146
void
SetIsWarning
()
147
{
148
m_bHasIssue
=
true
;
149
m_Widgets
.m_wSaveImage.SetColor(
UIColors
.WARNING);
150
}
151
152
//------------------------------------------------------------------------------------------------
153
void
SetIsDownloaded
(
bool
state)
154
{
155
m_bIsDownloaded
= state;
156
}
157
158
//------------------------------------------------------------------------------------------------
159
void
SetSaveData
(
SaveGame
saveData)
160
{
161
m_Save
= saveData;
162
}
163
164
//------------------------------------------------------------------------------------------------
165
void
SetSaveIcon
(
Color
imageColor,
string
icon)
166
{
167
m_Widgets
.m_wSaveImage.LoadImageFromSet(0,
UIConstants
.ICONS_IMAGE_SET, icon);
168
m_Widgets
.m_wSaveImage.SetColor(imageColor);
169
}
170
171
//------------------------------------------------------------------------------------------------
172
void
SetFileName
(
string
name)
173
{
174
m_sFileName
= name;
175
}
176
177
//------------------------------------------------------------------------------------------------
178
void
SetDisplayName
(
string
name)
179
{
180
m_sDisplayName
= name;
181
m_Widgets
.m_wEntryName.SetText(name);
182
}
183
184
//------------------------------------------------------------------------------------------------
185
// --- Getters ---
186
//------------------------------------------------------------------------------------------------
187
188
//------------------------------------------------------------------------------------------------
189
bool
CanOverrideSave
()
190
{
191
return
m_bCanSave
;
192
}
193
194
//------------------------------------------------------------------------------------------------
195
bool
CanLoadSave
()
196
{
197
return
m_bCanLoad
;
198
}
199
200
//------------------------------------------------------------------------------------------------
201
bool
CanDeleteSave
()
202
{
203
return
m_bCanDelete
;
204
}
205
206
//------------------------------------------------------------------------------------------------
207
bool
IsError
()
208
{
209
return
m_bHasIssue
;
210
}
211
212
//------------------------------------------------------------------------------------------------
213
bool
IsDownloaded
()
214
{
215
return
m_bIsDownloaded
;
216
}
217
218
//------------------------------------------------------------------------------------------------
219
SaveGame
GetSaveData
()
220
{
221
return
m_Save
;
222
}
223
224
//------------------------------------------------------------------------------------------------
225
string
GetFileName
()
226
{
227
return
m_sFileName
;
228
}
229
230
//------------------------------------------------------------------------------------------------
231
string
GetDisplayName
()
232
{
233
return
m_sDisplayName
;
234
}
235
236
//------------------------------------------------------------------------------------------------
237
ImageWidget
GetSaveIcon
()
238
{
239
return
m_Widgets
.m_wSaveImage;
240
}
241
242
//------------------------------------------------------------------------------------------------
243
// --- Invokers ---
244
//------------------------------------------------------------------------------------------------
245
246
//------------------------------------------------------------------------------------------------
247
ScriptInvokerButton
GetOnDeleteSave
()
248
{
249
if
(!
m_OnDelete
)
250
m_OnDelete
=
new
ScriptInvokerButton
();
251
252
return
m_OnDelete
;
253
}
254
255
// --- Invokers ---
256
//------------------------------------------------------------------------------------------------
257
ScriptInvokerButton
GetOnLoadSave
()
258
{
259
if
(!
m_OnLoad
)
260
m_OnLoad
=
new
ScriptInvokerButton
();
261
262
return
m_OnLoad
;
263
}
264
265
//------------------------------------------------------------------------------------------------
266
ScriptInvokerButton
GetOnOverrideSave
()
267
{
268
if
(!
m_OnSave
)
269
m_OnSave
=
new
ScriptInvokerButton
();
270
271
return
m_OnSave
;
272
}
273
274
//------------------------------------------------------------------------------------------------
275
override
void
HandlerAttached
(
Widget
w)
276
{
277
if
(
SCR_Global
.
IsEditMode
())
278
return
;
279
280
m_Widgets
.Init(w);
281
282
m_Widgets
.m_SaveButtonComponent0.SetVisible(
false
);
283
m_Widgets
.m_LoadButtonComponent0.SetVisible(
false
);
284
m_Widgets
.m_DeleteButtonComponent0.SetVisible(
false
);
285
286
m_Widgets
.m_SaveButtonComponent0.m_OnClicked.Insert(
OnClickSave
);
287
m_Widgets
.m_LoadButtonComponent0.m_OnClicked.Insert(
OnClickLoad
);
288
m_Widgets
.m_DeleteButtonComponent0.m_OnClicked.Insert(
OnClickDelete
);
289
290
GetGame
().OnInputDeviceUserChangedInvoker().Insert(
OnInputDeviceChange
);
291
292
UpdateAllWidgets
(
false
);
293
294
super.HandlerAttached(w);
295
}
296
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
func
func
Definition
SCR_AIThreatSystem.c:6
ScriptInvokerButtonMethod
func ScriptInvokerButtonMethod
Definition
SCR_SaveLoadEntryComponent.c:2
ScriptInvokerButton
ScriptInvokerBase< ScriptInvokerButtonMethod > ScriptInvokerButton
Definition
SCR_SaveLoadEntryComponent.c:3
Color
Definition
Color.c:13
ImageWidget
Definition
ImageWidget.c:13
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_ListMenuEntryComponent
Definition
SCR_ListMenuEntryComponent.c:6
SCR_Save_EntryWidgets
Definition
SCR_Save_EntryWidgets.c:4
SCR_SaveLoadEntryComponent
Definition
SCR_SaveLoadEntryComponent.c:6
SCR_SaveLoadEntryComponent::m_bCanDelete
bool m_bCanDelete
Definition
SCR_SaveLoadEntryComponent.c:15
SCR_SaveLoadEntryComponent::SetIsDownloaded
void SetIsDownloaded(bool state)
Definition
SCR_SaveLoadEntryComponent.c:153
SCR_SaveLoadEntryComponent::IsError
bool IsError()
Definition
SCR_SaveLoadEntryComponent.c:207
SCR_SaveLoadEntryComponent::SetCanLoad
void SetCanLoad(bool state)
Definition
SCR_SaveLoadEntryComponent.c:99
SCR_SaveLoadEntryComponent::SetSaveData
void SetSaveData(SaveGame saveData)
Definition
SCR_SaveLoadEntryComponent.c:159
SCR_SaveLoadEntryComponent::SetIsWarning
void SetIsWarning()
Definition
SCR_SaveLoadEntryComponent.c:146
SCR_SaveLoadEntryComponent::m_bCanSave
bool m_bCanSave
Definition
SCR_SaveLoadEntryComponent.c:13
SCR_SaveLoadEntryComponent::CanDeleteSave
bool CanDeleteSave()
Definition
SCR_SaveLoadEntryComponent.c:201
SCR_SaveLoadEntryComponent::GetOnDeleteSave
ScriptInvokerButton GetOnDeleteSave()
Definition
SCR_SaveLoadEntryComponent.c:247
SCR_SaveLoadEntryComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_SaveLoadEntryComponent.c:275
SCR_SaveLoadEntryComponent::SetCanDelete
void SetCanDelete(bool state)
Definition
SCR_SaveLoadEntryComponent.c:105
SCR_SaveLoadEntryComponent::m_bIsFocused
bool m_bIsFocused
Definition
SCR_SaveLoadEntryComponent.c:23
SCR_SaveLoadEntryComponent::SetDisplayName
void SetDisplayName(string name)
Definition
SCR_SaveLoadEntryComponent.c:178
SCR_SaveLoadEntryComponent::m_Save
SaveGame m_Save
Definition
SCR_SaveLoadEntryComponent.c:20
SCR_SaveLoadEntryComponent::IsDownloaded
bool IsDownloaded()
Definition
SCR_SaveLoadEntryComponent.c:213
SCR_SaveLoadEntryComponent::SetScenarioName
void SetScenarioName(string name)
Definition
SCR_SaveLoadEntryComponent.c:117
SCR_SaveLoadEntryComponent::OnClickDelete
void OnClickDelete()
Definition
SCR_SaveLoadEntryComponent.c:82
SCR_SaveLoadEntryComponent::m_OnLoad
ref ScriptInvokerButton m_OnLoad
Definition
SCR_SaveLoadEntryComponent.c:10
SCR_SaveLoadEntryComponent::m_OnDelete
ref ScriptInvokerButton m_OnDelete
Definition
SCR_SaveLoadEntryComponent.c:11
SCR_SaveLoadEntryComponent::GetOnOverrideSave
ScriptInvokerButton GetOnOverrideSave()
Definition
SCR_SaveLoadEntryComponent.c:266
SCR_SaveLoadEntryComponent::GetOnLoadSave
ScriptInvokerButton GetOnLoadSave()
Definition
SCR_SaveLoadEntryComponent.c:257
SCR_SaveLoadEntryComponent::SetSaveIcon
void SetSaveIcon(Color imageColor, string icon)
Definition
SCR_SaveLoadEntryComponent.c:165
SCR_SaveLoadEntryComponent::m_bIsDownloaded
bool m_bIsDownloaded
Definition
SCR_SaveLoadEntryComponent.c:24
SCR_SaveLoadEntryComponent::GetSaveIcon
ImageWidget GetSaveIcon()
Definition
SCR_SaveLoadEntryComponent.c:237
SCR_SaveLoadEntryComponent::OnClickSave
void OnClickSave()
Definition
SCR_SaveLoadEntryComponent.c:68
SCR_SaveLoadEntryComponent::m_sFileName
string m_sFileName
Definition
SCR_SaveLoadEntryComponent.c:17
SCR_SaveLoadEntryComponent::m_bHasIssue
bool m_bHasIssue
Definition
SCR_SaveLoadEntryComponent.c:22
SCR_SaveLoadEntryComponent::m_sDisplayName
string m_sDisplayName
Definition
SCR_SaveLoadEntryComponent.c:18
SCR_SaveLoadEntryComponent::UpdateAllWidgets
void UpdateAllWidgets(bool visibility)
Update visual state of line.
Definition
SCR_SaveLoadEntryComponent.c:55
SCR_SaveLoadEntryComponent::GetDisplayName
string GetDisplayName()
Definition
SCR_SaveLoadEntryComponent.c:231
SCR_SaveLoadEntryComponent::SetVersion
void SetVersion(string version, bool isVersionCompatible)
Definition
SCR_SaveLoadEntryComponent.c:137
SCR_SaveLoadEntryComponent::OnFocusLost
override bool OnFocusLost(Widget w, int x, int y)
Definition
SCR_SaveLoadEntryComponent.c:44
SCR_SaveLoadEntryComponent::CanOverrideSave
bool CanOverrideSave()
Definition
SCR_SaveLoadEntryComponent.c:189
SCR_SaveLoadEntryComponent::m_Widgets
ref SCR_Save_EntryWidgets m_Widgets
Definition
SCR_SaveLoadEntryComponent.c:7
SCR_SaveLoadEntryComponent::OnInputDeviceChange
void OnInputDeviceChange(EInputDeviceType oldDevice, EInputDeviceType newDevice)
Definition
SCR_SaveLoadEntryComponent.c:27
SCR_SaveLoadEntryComponent::m_OnSave
ref ScriptInvokerButton m_OnSave
Definition
SCR_SaveLoadEntryComponent.c:9
SCR_SaveLoadEntryComponent::SetCanSave
void SetCanSave(bool state)
Definition
SCR_SaveLoadEntryComponent.c:93
SCR_SaveLoadEntryComponent::SetDateTime
void SetDateTime(string date, string time)
Definition
SCR_SaveLoadEntryComponent.c:130
SCR_SaveLoadEntryComponent::SetScenarioDataVisible
void SetScenarioDataVisible(bool state)
Definition
SCR_SaveLoadEntryComponent.c:111
SCR_SaveLoadEntryComponent::OnFocus
override bool OnFocus(Widget w, int x, int y)
Definition
SCR_SaveLoadEntryComponent.c:34
SCR_SaveLoadEntryComponent::SetScenarioIcon
void SetScenarioIcon(Color imageColor, string icon)
Definition
SCR_SaveLoadEntryComponent.c:123
SCR_SaveLoadEntryComponent::m_bCanLoad
bool m_bCanLoad
Definition
SCR_SaveLoadEntryComponent.c:14
SCR_SaveLoadEntryComponent::OnClickLoad
void OnClickLoad()
Definition
SCR_SaveLoadEntryComponent.c:75
SCR_SaveLoadEntryComponent::GetFileName
string GetFileName()
Definition
SCR_SaveLoadEntryComponent.c:225
SCR_SaveLoadEntryComponent::GetSaveData
SaveGame GetSaveData()
Definition
SCR_SaveLoadEntryComponent.c:219
SCR_SaveLoadEntryComponent::SetFileName
void SetFileName(string name)
Definition
SCR_SaveLoadEntryComponent.c:172
SCR_SaveLoadEntryComponent::CanLoadSave
bool CanLoadSave()
Definition
SCR_SaveLoadEntryComponent.c:195
SaveGame
Definition
SaveGame.c:13
UIColors
Definition
Constants.c:17
UIConstants
Definition
Constants.c:151
Widget
Definition
Widget.c:13
scripts
Game
Editor
UI
Components
Save
SCR_SaveLoadEntryComponent.c
Generated by
1.17.0