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_ServerJoinDownloadsConfirmationDialog.c
Go to the documentation of this file.
1
2
class
SCR_ServerJoinDownloadsConfirmationDialog
:
SCR_ConfigurableDialogUi
3
{
4
protected
static
const
string
TAG_ALL
=
"server_download_all_cancel"
;
5
protected
static
const
string
TAG_REQUIRED
=
"server_download_required"
;
6
protected
static
const
string
TAG_UNRELATED
=
"server_download_unrelated_cancel"
;
7
8
protected
const
ResourceName
DOWNLOAD_LINE_LAYOUT
=
"{1C5D2CC10D7A1BC3}UI/layouts/Menus/ContentBrowser/DownloadManager/DownloadManager_AddonDownloadLineNonInteractive.layout"
;
9
10
protected
const
string
BUTTON_RETRY
=
"Retry"
;
11
12
protected
Widget
m_ListWrapper
;
13
14
protected
ref array<ref SCR_WorkshopItemActionDownload>
m_aActions
= {};
15
protected
SCR_InputButtonComponent
m_Retry
;
16
17
//------------------------------------------------------------------------------------------------
18
static
SCR_ServerJoinDownloadsConfirmationDialog
Create
(array<ref SCR_WorkshopItemActionDownload> actions,
SCR_EJoinDownloadsConfirmationDialogType
type
)
19
{
20
string
tag;
21
22
switch
(
type
)
23
{
24
case
SCR_EJoinDownloadsConfirmationDialogType
.ALL:
25
tag =
TAG_ALL
;
26
break
;
27
28
case
SCR_EJoinDownloadsConfirmationDialogType
.REQUIRED:
29
tag =
TAG_REQUIRED
;
30
break
;
31
32
case
SCR_EJoinDownloadsConfirmationDialogType
.UNRELATED:
33
tag =
TAG_UNRELATED
;
34
break
;
35
}
36
37
SCR_ServerJoinDownloadsConfirmationDialog
dialog =
new
SCR_ServerJoinDownloadsConfirmationDialog
();
38
SCR_ConfigurableDialogUi
.
CreateFromPreset
(
SCR_WorkshopDialogs
.DIALOGS_CONFIG, tag, dialog);
39
dialog.
Setup
(actions);
40
41
return
dialog;
42
}
43
44
//------------------------------------------------------------------------------------------------
45
override
void
OnMenuOpen
(
SCR_ConfigurableDialogUiPreset
preset)
46
{
47
m_ListWrapper
=
GetContentLayoutRoot
().FindAnyWidget(
SCR_WorkshopDialogs
.WIDGET_LIST);
48
49
super.OnMenuOpen(preset);
50
51
// Retry button
52
m_Retry
=
FindButton
(
BUTTON_RETRY
);
53
if
(
m_Retry
)
54
m_Retry
.m_OnActivated.Insert(
RetryActions
);
55
}
56
57
//------------------------------------------------------------------------------------------------
58
void
Setup
(array<ref SCR_WorkshopItemActionDownload> actions)
59
{
60
if
(!
m_ListWrapper
)
61
return
;
62
63
// --- Cleanup ---
64
// Remove old widgets
65
SCR_WidgetHelper
.RemoveAllChildren(
m_ListWrapper
);
66
67
// Release old actions
68
foreach
(
SCR_WorkshopItemActionDownload
action : actions)
69
{
70
action.m_OnActivated.Remove(
UpdateRetryButton
);
71
action.m_OnFailed.Remove(
UpdateRetryButton
);
72
action.m_OnCompleted.Remove(
UpdateRetryButton
);
73
}
74
75
// --- Initialize new ---
76
m_aActions
= actions;
77
78
foreach
(
SCR_WorkshopItemActionDownload
action :
m_aActions
)
79
{
80
Widget
w =
GetGame
().GetWorkspace().CreateWidgets(
DOWNLOAD_LINE_LAYOUT
,
m_ListWrapper
);
81
SCR_DownloadManager_AddonDownloadLine
comp =
SCR_DownloadManager_AddonDownloadLine
.Cast(w.FindHandler(
SCR_DownloadManager_AddonDownloadLine
));
82
comp.
InitForServerDownloadAction
(action);
83
84
action.m_OnActivated.Insert(
UpdateRetryButton
);
85
action.m_OnFailed.Insert(
UpdateRetryButton
);
86
action.m_OnCompleted.Insert(
UpdateRetryButton
);
87
}
88
89
UpdateRetryButton
();
90
}
91
92
//------------------------------------------------------------------------------------------------
93
protected
void
UpdateRetryButton
()
94
{
95
if
(!
m_Retry
)
96
return
;
97
98
bool
visible;
99
100
foreach
(
SCR_WorkshopItemActionDownload
action :
m_aActions
)
101
{
102
visible = action.IsFailed();
103
if
(visible)
104
break
;
105
}
106
107
m_Retry
.SetVisible(visible,
false
);
108
}
109
110
//------------------------------------------------------------------------------------------------
111
protected
void
RetryActions
()
112
{
113
array<ref SCR_WorkshopItemActionDownload> newActions = {};
114
115
foreach
(
SCR_WorkshopItemActionDownload
action :
m_aActions
)
116
{
117
if
(action.IsFailed())
118
newActions.Insert(action.RetryDownload());
119
else
120
newActions.Insert(action);
121
}
122
123
Setup
(newActions);
124
}
125
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
type
EDamageType type
Definition
SCR_DestructibleTreeV2.c:32
SCR_EJoinDownloadsConfirmationDialogType
SCR_EJoinDownloadsConfirmationDialogType
Enum for confirmation dialogs that guide the player through the download processes required to join t...
Definition
SCR_ServerBrowserDialogManager.c:544
ResourceName
Definition
ResourceName.c:13
SCR_ConfigurableDialogUi
Definition
SCR_ConfigurableDialogUI.c:17
SCR_ConfigurableDialogUi::CreateFromPreset
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
Definition
SCR_ConfigurableDialogUI.c:94
SCR_ConfigurableDialogUi::GetContentLayoutRoot
Widget GetContentLayoutRoot()
Returns the root of the content layout.
Definition
SCR_ConfigurableDialogUI.c:241
SCR_ConfigurableDialogUi::FindButton
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
Definition
SCR_ConfigurableDialogUI.c:419
SCR_ConfigurableDialogUiPreset
Configuration for a dialog.
Definition
SCR_ConfigurableDialogUI.c:764
SCR_DownloadManager_AddonDownloadLine
Definition
SCR_DownloadManager_AddonDownloadLine.c:9
SCR_DownloadManager_AddonDownloadLine::InitForServerDownloadAction
void InitForServerDownloadAction(SCR_WorkshopItemActionDownload action)
Initializes the line in non-interactive mode, shows basic data about a download relating to joining s...
Definition
SCR_DownloadManager_AddonDownloadLine.c:80
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_ServerJoinDownloadsConfirmationDialog
Dialog to cancel downloads during to server joining.
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:3
SCR_ServerJoinDownloadsConfirmationDialog::OnMenuOpen
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:45
SCR_ServerJoinDownloadsConfirmationDialog::Create
static SCR_ServerJoinDownloadsConfirmationDialog Create(array< ref SCR_WorkshopItemActionDownload > actions, SCR_EJoinDownloadsConfirmationDialogType type)
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:18
SCR_ServerJoinDownloadsConfirmationDialog::TAG_ALL
static const string TAG_ALL
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:4
SCR_ServerJoinDownloadsConfirmationDialog::BUTTON_RETRY
const string BUTTON_RETRY
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:10
SCR_ServerJoinDownloadsConfirmationDialog::m_ListWrapper
Widget m_ListWrapper
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:12
SCR_ServerJoinDownloadsConfirmationDialog::DOWNLOAD_LINE_LAYOUT
const ResourceName DOWNLOAD_LINE_LAYOUT
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:8
SCR_ServerJoinDownloadsConfirmationDialog::Setup
void Setup(array< ref SCR_WorkshopItemActionDownload > actions)
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:58
SCR_ServerJoinDownloadsConfirmationDialog::m_aActions
ref array< ref SCR_WorkshopItemActionDownload > m_aActions
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:14
SCR_ServerJoinDownloadsConfirmationDialog::UpdateRetryButton
void UpdateRetryButton()
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:93
SCR_ServerJoinDownloadsConfirmationDialog::m_Retry
SCR_InputButtonComponent m_Retry
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:15
SCR_ServerJoinDownloadsConfirmationDialog::RetryActions
void RetryActions()
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:111
SCR_ServerJoinDownloadsConfirmationDialog::TAG_REQUIRED
static const string TAG_REQUIRED
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:5
SCR_ServerJoinDownloadsConfirmationDialog::TAG_UNRELATED
static const string TAG_UNRELATED
Definition
SCR_ServerJoinDownloadsConfirmationDialog.c:6
SCR_WidgetHelper
Definition
SCR_WidgetHelper.c:2
SCR_WorkshopDialogs
Definition
SCR_WorkshopDialogs.c:7
SCR_WorkshopItemActionDownload
Definition
SCR_WorkshopItemActionDownload.c:10
Widget
Definition
Widget.c:13
Setup
@ Setup
Definition
TestStage.c:15
scripts
Game
UI
Menu
ContentBrowser
Common
Dialogs
SCR_ServerJoinDownloadsConfirmationDialog.c
Generated by
1.17.0