Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeleteAddonsListDialog.c
Go to the documentation of this file.
1// Confirmation dialog for unsubscribing multiple addons.
2// On confirm it deletes local data and unsubscribes the addons.
3// TODO: centralize handling of deletion, this should not be done by a dialog
4// TODO: show a list of selcted mods
5class SCR_DeleteAddonsListDialog : SCR_ConfigurableDialogUi
6{
7 protected ref array<SCR_WorkshopItem> m_aItems = {};
8
9 //------------------------------------------------------------------------------------------------
10 static SCR_DeleteAddonsListDialog CreateDialog(array<SCR_WorkshopItem> items)
11 {
12 return new SCR_DeleteAddonsListDialog(items);
13 }
14
15 //------------------------------------------------------------------------------------------------
16 private void SCR_DeleteAddonsListDialog(array<SCR_WorkshopItem> items)
17 {
18 m_aItems = items;
19 SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopDialogs.DIALOGS_CONFIG, "deleteAll", this);
20 }
21
22 //------------------------------------------------------------------------------------------------
23 override void OnConfirm()
24 {
25 foreach (SCR_WorkshopItem item : m_aItems)
26 {
27 if (item.GetEnabled())
28 SCR_AddonManager.GetInstance().GetPresetStorage().ClearUsedPreset();
29
30 if (item.GetSubscribed())
31 item.SetSubscribed(false);
32
33 item.DeleteLocally();
34 }
35
36 super.OnConfirm();
37 }
38}
ref array< ref SCR_MenuNavigationItem > m_aItems
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
static SCR_DeleteAddonsListDialog CreateDialog(array< SCR_WorkshopItem > items)
ref array< SCR_WorkshopItem > m_aItems