5 protected const ResourceName DOWNLOAD_LINE_LAYOUT =
"{BB5AEDDA3C4134FD}UI/layouts/Menus/ContentBrowser/DownloadManager/DownloadManager_AddonDownloadLineConfirmation.layout";
34 foreach (
auto i : dependencies)
49 dialog.m_bDownloadMainItem =
false;
50 dialog.m_bSubscribeToAddons = subscribeToAddons;
51 dialog.m_aDependencies =
new array<ref SCR_WorkshopItem>;
52 dialog.m_aDependencyVersions =
new array<ref Revision>;
54 foreach (Tuple2<SCR_WorkshopItem, ref Revision> i : addonsAndVersions)
56 dialog.m_aDependencies.Insert(i.param1);
57 dialog.m_aDependencyVersions.Insert(i.param2);
100 if (confirmAlternativeButton)
106 if (confirmAlternativeButton)
107 confirmAlternativeButton.SetVisible(
false);
112 confirmButton.
SetLabel(
"#AR-Workshop_Dialog_ConfirmDownload_ButtonDownload");
120 if (confirmAlternativeButton)
121 confirmAlternativeButton.SetVisible(
false);
125 m_Widgets.m_OtherAddonsMessage.SetVisible(
false);
136 if (versionDifferences.IsEmpty())
147 Revision rev = item.GetDependency().GetRevision();
148 item.SetItemTargetRevision(rev);
156 m_Widgets.m_LoadingOverlayComponent.SetShown(
true);
157 m_Widgets.m_AddonContentVertical.SetVisible(
false);
168 m_Widgets.m_LoadingOverlayComponent.SetShown(
false);
169 m_Widgets.m_AddonContentVertical.SetVisible(
true);
177 m_Widgets.m_TotalAddonSizeText.SetText(totalSizeStr);
193 revision = dependency.GetRevision();
219 int vDifCount = versionDifferences.Count();
220 bool hasDifference = vDifCount > 0;
223 m_Widgets.m_UpdateAddonsList.SetVisible(hasDifference);
224 m_Widgets.m_UpdateAddonsMessage.SetVisible(hasDifference);
235 m_Widgets.m_UpdateAddonsMessage.SetTextFormat(
"#AR-Workshop_Dialog_ConfirmDownload_VersionDifferences", vDifCount);
248 m_Widgets.m_OtherAddonsMessage.SetVisible(
true);
249 m_Widgets.m_OtherAddonsMessage.SetTextFormat(
250 "#AR-Workshop_Dialog_ConfirmDownload_DependenciesWillBeDownloaded",
259 m_Widgets.m_OtherAddonsMessage.SetVisible(
false);
275 if (dep.IsDownloadRunning())
285 action = dep.Download(targetVersion);
287 action = dep.DownloadLatestVersion();
301 m_Item.SetSubscribed(
true);
305 dependency.SetSubscribed(
true);
326 m_Item.SetSubscribed(
true);
336 array<ref SCR_WorkshopItemAction> a = {};
ArmaReforgerScripted GetGame()
static array< ref SCR_WorkshopItem > SelectItemsBasic(array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query)
static array< ref SCR_WorkshopItem > SelectItemsAnd(array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query)
ScriptInvokerBase< ScriptInvoker_AddonPatchSizeLoad > GetOnAllPatchSizeLoaded()
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
Widget GetContentLayoutRoot()
Returns the root of the content layout.
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
Configuration for a dialog.
Dialog for confirming multiple downloads in workshop.
ref array< ref SCR_WorkshopItemAction > m_aCreatedActions
ref array< ref Revision > m_aDependencyVersions
static void SetupDownloadDialogAddons(notnull out SCR_DownloadConfirmationDialog dialog, notnull array< ref Tuple2< SCR_WorkshopItem, ref Revision > > addonsAndVersions, bool subscribeToAddons)
void CreateAddonWidget(notnull SCR_WorkshopItem dep, Widget listRoot)
Create and setup addon widget text and verions.
array< ref SCR_WorkshopItemAction > GetActions()
Returns the internal array with created download actions.
void LoadAddonPatchSizes()
static SCR_DownloadConfirmationDialog CreateForAddonAndDependencies(notnull SCR_WorkshopItem mainItem, bool downloadMainItem, notnull array< ref SCR_WorkshopItem > dependencies, bool subscribeToAddons)
static SCR_DownloadConfirmationDialog CreateForAddons(notnull array< ref Tuple2< SCR_WorkshopItem, ref Revision > > addonsAndVersions, bool subscribeToAddons)
Download addons with specific versions.
bool m_bSubscribeToAddons
const ResourceName DOWNLOAD_LINE_LAYOUT
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
void SetStyleDownloadAddons()
Hides all explanation text.
void SetStyleDownloadAddonsWithDependencies()
Sets text: "%1 dependencies will be downloaded:" over the dependencies list.
override void OnConfirm()
void OnAllPatchSizeLoaded(SCR_AddonPatchSizeLoader loader, bool allLoaded)
void OnConfirmAlternative()
This is only valid when we can download the main addon.
ref SCR_DownloadConfirmationDialogContentWidgets m_Widgets
ref SCR_AddonPatchSizeLoader m_Loader
ref array< ref SCR_WorkshopItem > m_aDependencies
ref SCR_WorkshopItem m_Item
ref ScriptInvoker m_OnDownloadConfirmed
void InitForWorkshopItem(SCR_WorkshopItem item, Revision versionTo=null, bool showVersionAndSize=true)
Initializes the line in passive mode. It will just show basic information once.
static float GetTotalSizeBytes(array< ref SCR_WorkshopItem > arrayIn, SCR_WorkshopItem extraItem=null)
static SCR_DownloadManager GetInstance()
array< ref SCR_WorkshopItemAction > DownloadLatestWithDependencies(notnull SCR_WorkshopItem mainItem, bool downloadMainItem, array< ref SCR_WorkshopItem > dependencies)