Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_WorkshopUiCommon.c
Go to the documentation of this file.
1 /*
2 Common functions related to Workshop UI.
3 */
4 
6 {
7  const float IMAGE_SIZE_RATIO = 16.0 / 9.0;
8 
9  static const ResourceName DIALOGS_CONFIG = "{26F075E5D30629E5}Configs/ContentBrowser/ContentBrowserDialogs.conf";
10 
11  // Time interval which is considered 'instant' enough that we don't need to show the loading overlay
12  static const float NO_LOADING_OVERLAY_DURATION_MS = 500;
13 
14  // Default addon thumbnail if it wasn't resolved
15  static const ResourceName ADDON_DEFAULT_THUMBNAIL = "{04EB797EBF59CDEF}UI/Textures/Workshop/AddonThumbnails/workshop_defaultFallback_UI.edds";
16  static const ResourceName SCENARIO_SP_DEFAULT_THUMBNAIL = "{17D65C6D78C7722C}UI/Textures/Workshop/AddonThumbnails/workshop_scenarios_UI.edds";
17  static const ResourceName SCENARIO_MP_DEFAULT_THUMBNAIL = "{62A03BAAAED612E8}UI/Textures/Workshop/AddonThumbnails/workshop_mpScenarios_UI.edds";
18 
19  // Map which maps addon tags to icon names
20  static const ResourceName ADDON_TYPE_FILTER_CATEGORY_CONFIG = "{A557E41062372854}Configs/ContentBrowser/Filters/category_type.conf";
21  static ref map<string, string> s_sAddonTagImageMap;
22 
23  // Map which maps addon tags to default pictures
24  static ref map<string, ResourceName> s_sAddonTagDefaultThumbnailMap;
25 
26  static const string WIDGET_LIST = "AddonList";
27 
28  // --- Revision availability ---
29  // Short messages
30  static const string MESSAGE_MOD_NOT_AVAILABLE = "#AR-Workshop_State_NotAvailable"; // Fallback
31  static const string MESSAGE_MOD_NOT_AVAILABLE_REMOVED = "#AR-Workshop_State_Removed";
32  static const string MESSAGE_MOD_NOT_AVAILABLE_INCOMPATIBLE = "#AR-Workshop_State_Incompatible";
33  static const string MESSAGE_MOD_AVAILABLE_WHEN_UPDATED = "#AR-Workshop_State_UpdateRequired";
34  static const string MESSAGE_MOD_DOWNLOAD_NOT_FINISHED = "#AR-Workshop_State_DownloadNotFinished";
35 
36  // Verbose messages
37  static const string MESSAGE_VERBOSE_MOD_NOT_AVAILABLE = "#AR-Workshop_State_NotAvailableDesc"; // Fallback
38  static const string MESSAGE_VERBOSE_MOD_NOT_AVAILABLE_REMOVED = "#AR-Workshop_State_RemovedDesc";
39  static const string MESSAGE_VERBOSE_MOD_NOT_AVAILABLE_INCOMPATIBLE = "#AR-Workshop_State_IncompatibleDesc";
40  static const string MESSAGE_VERBOSE_MOD_AVAILABLE_WHEN_UPDATED = "#AR-Workshop_State_UpdateRequiredDesc";
41  static const string MESSAGE_VERBOSE_MOD_DOWNLOAD_NOT_FINISHED = "#AR-Workshop_State_DownloadNotFinishedDesc";
42 
43  // Icons
44  static const string ICON_MOD_NOT_AVAILABLE = "not-available"; // Fallback
45  static const string ICON_MOD_NOT_AVAILABLE_REMOVED = "cancelCircle";
46  static const string ICON_MOD_NOT_AVAILABLE_INCOMPATIBLE = "incompatible";
47  static const string ICON_MOD_AVAILABLE_WHEN_UPDATED = "available-when-updated";
48  static const string ICON_MOD_DOWNLOAD_NOT_FINISHED = "downloading";
49 
50  //------------------------------------------------------------------------------------------------
51  // P U B L I C M E T H O D S
52  //------------------------------------------------------------------------------------------------
53 
54  // --- Init ---
55  //------------------------------------------------------------------------------------------------
57  static void OnGameStart()
58  {
59  SCR_AddonManager mgr = SCR_AddonManager.GetInstance();
60  mgr.m_OnAddonsChecked.Remove(SCR_WorkshopUiCommon.Callback_OnAddonsChecked);
61  mgr.m_OnAddonsChecked.Insert(SCR_WorkshopUiCommon.Callback_OnAddonsChecked);
62 
63  InitAddonTagMaps();
64  }
65 
66  //---------------------------------------------------------------------------------------------
68  static void TryOpenWorkshop()
69  {
70  SCR_AddonManager mgr = SCR_AddonManager.GetInstance();
71  if (mgr.GetUgcPrivilege())
72  ContentBrowserUI.Create();
73  else
74  {
75  mgr.m_OnUgcPrivilegeResult.Insert(OnTryOpenWorkshopUgcPrivilegeResult);
76  mgr.NegotiateUgcPrivilegeAsync();
77  }
78  }
79 
80  //---------------------------------------------------------------------------------------------
81  protected static void OnTryOpenWorkshopUgcPrivilegeResult(bool result)
82  {
83  SCR_AddonManager mgr = SCR_AddonManager.GetInstance();
84  mgr.m_OnUgcPrivilegeResult.Remove(OnTryOpenWorkshopUgcPrivilegeResult);
85  if (result)
86  ContentBrowserUI.Create();
87  }
88 
89  //---------------------------------------------------------------------------------------------
90  static SCR_ConfigurableDialogUi CreateDialog(string presetName)
91  {
92  return SCR_ConfigurableDialogUi.CreateFromPreset(DIALOGS_CONFIG, presetName);
93  }
94 
95  //---------------------------------------------------------------------------------------------
97  static string GetTagImage(string tag)
98  {
99  tag.ToLower();
100  return s_sAddonTagImageMap.Get(tag);
101  }
102 
103  //---------------------------------------------------------------------------------------------
104  static ResourceName GetDefaultAddonThumbnail(notnull SCR_WorkshopItem item)
105  {
106  array<WorkshopTag> tagObjs = {};
107 
108  WorkshopItem internalItem = item.GetWorkshopItem();
109 
110  if (!internalItem || !s_sAddonTagDefaultThumbnailMap)
111  return ADDON_DEFAULT_THUMBNAIL;
112 
113  // Iterate all tags, return first found default iamge
114  internalItem.GetTags(tagObjs);
115  foreach (WorkshopTag tagObj : tagObjs)
116  {
117  string tagStr = tagObj.Name();
118  tagStr.ToLower();
119 
120  if (s_sAddonTagDefaultThumbnailMap.Contains(tagStr))
121  return s_sAddonTagDefaultThumbnailMap.Get(tagStr);
122  }
123 
124  return ADDON_DEFAULT_THUMBNAIL;
125  }
126 
127  //------------------------------------------------------------------------------------------------
128  static bool GetConnectionState()
129  {
130  auto backend = GetGame().GetBackendApi();
131  bool connected = backend.IsActive() && backend.IsAuthenticated();
132  return connected;
133  }
134 
135  //------------------------------------------------------------------------------------------------
137  static int GetPreferedTileImageWidth()
138  {
139  const float scale = 260.0/1920.0; // Estimated tile width is ~260 px
140  float w, h;
141  GetGame().GetWorkspace().GetScreenSize(w, h);
142  int widthInt = scale*w;
143  return widthInt;
144  }
145 
146  //------------------------------------------------------------------------------------------------
147  // S C E N A R I O S T A R T I N G
148 
149  //------------------------------------------------------------------------------------------------
151  static void TryPlayScenario(notnull MissionWorkshopItem scenario)
152  {
153  int nCompleted, nTotal;
154 
155  SCR_DownloadManager mgr = SCR_DownloadManager.GetInstance();
156  if (mgr)
157  mgr.GetDownloadQueueState(nCompleted, nTotal);
158 
159  if (nTotal > 0)
160  SCR_StartScenarioWhileDownloadingDialog.CreateDialog(scenario);
161  else
162  scenario.Play();
163  }
164 
165  //------------------------------------------------------------------------------------------------
167  static void TryHostScenario(notnull MissionWorkshopItem scenario, notnull SCR_DSConfig config)
168  {
169  int nCompleted, nTotal;
170 
171  SCR_DownloadManager mgr = SCR_DownloadManager.GetInstance();
172  if (mgr)
173  mgr.GetDownloadQueueState(nCompleted, nTotal);
174 
175  if (nTotal > 0)
176  SCR_HostScenarioWhileDownloadingDialog.CreateDialog(scenario, config);
177  else
178  scenario.Host(config);
179  }
180 
181  //------------------------------------------------------------------------------------------------
182  // A D D O N S T A T E S A N D A C T I O N S
183 
184  //---------------------------------------------------------------------------------------------
187  static void OnEnableAddonButton(SCR_WorkshopItem item)
188  {
189  if (!item)
190  return;
191 
192  if (!item.GetOffline() || item.GetRestricted())
193  return;
194 
195  bool newEnabled = !item.GetEnabled();
196  SetAddonEnabled(item, newEnabled);
197  }
198 
199  //---------------------------------------------------------------------------------------------
202  static void OnEnableAddonToggleButton(SCR_WorkshopItem item, SCR_ModularButtonComponent buttonComp)
203  {
204  if (!item)
205  return;
206 
207  if (!item.GetOffline() || item.GetRestricted())
208  return;
209 
210  // Button was clicked and it is now toggled or not, and this directly sets addon state
211  bool newEnabled = buttonComp.GetToggled();
212  SetAddonEnabled(item, newEnabled);
213  }
214 
215  //---------------------------------------------------------------------------------------------
217  static void OnUnsubscribeAddonButton(SCR_WorkshopItem item)
218  {
219  // Check if some addons depend on this
220  array<ref SCR_WorkshopItem> offlineAndDependent = SCR_AddonManager.SelectItemsAnd(
221  item.GetDependentAddons(),
222  EWorkshopItemQuery.OFFLINE);
223 
224  if (!offlineAndDependent.IsEmpty())
225  SCR_DeleteAddonDependentAddonsDetected.Create(offlineAndDependent, item); // Some addons depend on this, show a special confirmation
226  else
227  SCR_DeleteAddonDialog.CreateDeleteAddon(item); // Show a standard confirmation for addon deletion
228  }
229 
230  //---------------------------------------------------------------------------------------------
232  static bool GetHighestPriorityProblemDescription(SCR_WorkshopItem item, out string descriptionShort, out bool critical)
233  {
234  // Not downloaded yet - no problem
235  if (!item.GetOffline())
236  return false;
237 
238  EWorkshopItemProblem problem = item.GetHighestPriorityProblem();
239 
240  switch (problem)
241  {
242  case EWorkshopItemProblem.DEPENDENCY_MISSING:
243  descriptionShort = "#AR-Workshop_State_MissingDependencies";
244  critical = true;
245  return true;
246 
247  case EWorkshopItemProblem.DEPENDENCY_DISABLED:
248  descriptionShort = "#AR-Workshop_State_MustEnableDependencies";
249  critical = true;
250  return true;
251 
252  case EWorkshopItemProblem.UPDATE_AVAILABLE:
253  descriptionShort = "#AR-Workshop_State_UpdateAvailable";
254  critical = false;
255  return true;
256 
257  case EWorkshopItemProblem.DEPENDENCY_OUTDATED:
258  descriptionShort = "#AR-Workshop_State_DependencyUpdateAvailable";
259  critical = false;
260  return true;
261 
262  default:
263  descriptionShort = string.Empty;
264  critical = false;
265  return false;
266  }
267 
268  descriptionShort = string.Empty;
269  critical = false;
270 
271  return false;
272  }
273 
274  //---------------------------------------------------------------------------------------------
276  static string GetPrimaryActionName(SCR_WorkshopItem item)
277  {
278  bool downloading = item.GetDownloadAction() != null || item.GetDependencyCompositeAction() != null;
279 
280  EWorkshopItemProblem problem = item.GetHighestPriorityProblem();
281 
282  if (!downloading)
283  {
284  if (!item.GetOffline())
285  return "#AR-Workshop_ButtonDownload";
286  else
287  {
288  switch (problem)
289  {
290  case EWorkshopItemProblem.DEPENDENCY_MISSING: return "#AR-Workshop_ButtonDownloadDependencies";
291  case EWorkshopItemProblem.DEPENDENCY_DISABLED: return "#AR-Workshop_ButtonEnableDependencies";
292  case EWorkshopItemProblem.UPDATE_AVAILABLE: return "#AR-Workshop_ButtonUpdate";
293  case EWorkshopItemProblem.DEPENDENCY_OUTDATED: return "#AR-Workshop_ButtonUpdateDependencies";
294  default: return string.Empty;
295  }
296  }
297  }
298  else
299  {
300  // Downloading
301  return "#AR-Workshop_ButtonCancel";
302  }
303 
304  return string.Empty;
305  }
306 
307  //---------------------------------------------------------------------------------------------
309  static string GetRestrictedAddonStateText(SCR_WorkshopItem item)
310  {
311  if (!item.GetRestricted())
312  return string.Empty;
313 
314  if (item.GetReportedByMe())
315  return "#AR-Workshop_State_Reported";
316  else if (item.GetBlocked())
317  return "#AR-Workshop_State_Banned";
318  else
319  return "#AR-Workshop_State_Restricted";
320  }
321 
322  protected static ref ScriptInvoker<> m_OnDownloadConfirmDisplayed = new ScriptInvoker<>();
323 
324  //------------------------------------------------------------------------------------------------
325  static ScriptInvoker GetOnDownloadConfirmDisplayed()
326  {
327  return m_OnDownloadConfirmDisplayed;
328  }
329 
330  //---------------------------------------------------------------------------------------------
333  static void ExecutePrimaryAction(notnull SCR_WorkshopItem item, out SCR_WorkshopDownloadSequence dlRequest)
334  {
335  bool downloading = item.GetDownloadAction() != null || item.GetDependencyCompositeAction() != null;
336 
337  // Paused -- todo
338 
339  // Perform action according to problem
340  EWorkshopItemProblem problem = item.GetHighestPriorityProblem();
341 
342  if (!downloading)
343  {
344  if (!item.GetOffline())
345  {
346  dlRequest = SCR_WorkshopDownloadSequence.Create(item, item.GetLatestRevision(), dlRequest);
347  dlRequest.GetOnDownloadConfirmDisplayed().Remove(OnDownloadConfirmDisplayed);
348  dlRequest.GetOnDownloadConfirmDisplayed().Insert(OnDownloadConfirmDisplayed);
349  return;
350  }
351  else
352  {
353  switch (problem)
354  {
355  // Start download/update of whatever is possible to download or update
356  case EWorkshopItemProblem.DEPENDENCY_MISSING:
357  case EWorkshopItemProblem.UPDATE_AVAILABLE:
358  case EWorkshopItemProblem.DEPENDENCY_OUTDATED:
359  {
360  dlRequest = SCR_WorkshopDownloadSequence.Create(item, item.GetLatestRevision(), dlRequest);
361  dlRequest.GetOnDownloadConfirmDisplayed().Remove(OnDownloadConfirmDisplayed);
362  dlRequest.GetOnDownloadConfirmDisplayed().Insert(OnDownloadConfirmDisplayed);
363  return;
364  }
365 
366  case EWorkshopItemProblem.DEPENDENCY_DISABLED:
367  {
368  item.SetDependenciesEnabled(true);
369  return;
370  }
371  }
372  }
373  }
374  else
375  {
376  // Aggregate all actions of this item and create a dialog to confirm disabling all current downloads
377  SCR_WorkshopItemActionDownload actionThisItem = item.GetDownloadAction();
378  SCR_WorkshopItemActionComposite actionDependenciesThisItem = item.GetDependencyCompositeAction();
379 
380  array<ref SCR_WorkshopItemActionDownload> actionsToCancel = {};
381 
382  if (actionThisItem)
383  actionsToCancel.Insert(actionThisItem);
384 
385  if (actionDependenciesThisItem)
386  {
387  array<ref SCR_WorkshopItemAction> dependencyActions = actionDependenciesThisItem.GetActions();
388  foreach (auto a : dependencyActions)
389  {
391  if (downloadAction)
392  actionsToCancel.Insert(downloadAction);
393  }
394  }
395 
396  // Create a dialog
397  new SCR_CancelDownloadConfirmationDialog(actionsToCancel);
398 
399  return;
400  }
401 
402  return;
403  }
404 
405  //---------------------------------------------------------------------------------------------
406  protected static void OnDownloadConfirmDisplayed(SCR_DownloadSequence downloadSequence, SCR_DownloadConfirmationDialog confirmDialog)
407  {
408  if (m_OnDownloadConfirmDisplayed)
409  m_OnDownloadConfirmDisplayed.Invoke(downloadSequence, confirmDialog);
410  }
411 
412  // --- Revision Error messages ---
413  //------------------------------------------------------------------------------------------------
414  static string GetRevisionAvailabilityErrorMessage(WorkshopItem item)
415  {
416  if (!item)
417  return MESSAGE_MOD_NOT_AVAILABLE;
418 
419  return GetRevisionAvailabilityErrorMessage(SCR_AddonManager.ItemAvailability(item));
420  }
421 
422  //------------------------------------------------------------------------------------------------
423  static string GetRevisionAvailabilityErrorMessage(SCR_ERevisionAvailability state)
424  {
425  switch (state)
426  {
427  case SCR_ERevisionAvailability.ERA_AVAILABLE: return string.Empty;
428  case SCR_ERevisionAvailability.ERA_UNKNOWN_AVAILABILITY: return MESSAGE_MOD_NOT_AVAILABLE;
429  case SCR_ERevisionAvailability.ERA_DELETED: return MESSAGE_MOD_NOT_AVAILABLE_REMOVED;
430  case SCR_ERevisionAvailability.ERA_OBSOLETE: return MESSAGE_MOD_NOT_AVAILABLE_INCOMPATIBLE;
431  case SCR_ERevisionAvailability.ERA_COMPATIBLE_UPDATE_AVAILABLE: return MESSAGE_MOD_AVAILABLE_WHEN_UPDATED;
432  case SCR_ERevisionAvailability.ERA_DOWNLOAD_NOT_FINISHED: return MESSAGE_MOD_DOWNLOAD_NOT_FINISHED;
433  }
434 
435  return MESSAGE_MOD_NOT_AVAILABLE;
436  }
437 
438  //------------------------------------------------------------------------------------------------
439  static string GetRevisionAvailabilityErrorMessageVerbose(WorkshopItem item)
440  {
441  if (!item)
442  return MESSAGE_VERBOSE_MOD_NOT_AVAILABLE;
443 
444  return GetRevisionAvailabilityErrorMessageVerbose(SCR_AddonManager.ItemAvailability(item));
445  }
446 
447  //------------------------------------------------------------------------------------------------
448  static string GetRevisionAvailabilityErrorMessageVerbose(SCR_ERevisionAvailability state)
449  {
450  switch (state)
451  {
452  case SCR_ERevisionAvailability.ERA_AVAILABLE: return string.Empty;
453  case SCR_ERevisionAvailability.ERA_UNKNOWN_AVAILABILITY: return MESSAGE_VERBOSE_MOD_NOT_AVAILABLE;
454  case SCR_ERevisionAvailability.ERA_DELETED: return MESSAGE_VERBOSE_MOD_NOT_AVAILABLE_REMOVED;
455  case SCR_ERevisionAvailability.ERA_OBSOLETE: return MESSAGE_VERBOSE_MOD_NOT_AVAILABLE_INCOMPATIBLE;
456  case SCR_ERevisionAvailability.ERA_COMPATIBLE_UPDATE_AVAILABLE: return MESSAGE_VERBOSE_MOD_AVAILABLE_WHEN_UPDATED;
457  case SCR_ERevisionAvailability.ERA_DOWNLOAD_NOT_FINISHED: return MESSAGE_VERBOSE_MOD_DOWNLOAD_NOT_FINISHED;
458  }
459 
460  return MESSAGE_VERBOSE_MOD_NOT_AVAILABLE;
461  }
462 
463  //------------------------------------------------------------------------------------------------
464  static string GetRevisionAvailabilityErrorTexture(WorkshopItem item)
465  {
466  if (!item)
467  return ICON_MOD_NOT_AVAILABLE;
468 
469  return GetRevisionAvailabilityErrorTexture(SCR_AddonManager.ItemAvailability(item));
470  }
471 
472  //------------------------------------------------------------------------------------------------
473  static string GetRevisionAvailabilityErrorTexture(SCR_ERevisionAvailability state)
474  {
475  switch (state)
476  {
477  case SCR_ERevisionAvailability.ERA_AVAILABLE: return string.Empty;
478  case SCR_ERevisionAvailability.ERA_UNKNOWN_AVAILABILITY: return ICON_MOD_NOT_AVAILABLE;
479  case SCR_ERevisionAvailability.ERA_DELETED: return ICON_MOD_NOT_AVAILABLE_REMOVED;
480  case SCR_ERevisionAvailability.ERA_OBSOLETE: return ICON_MOD_NOT_AVAILABLE_INCOMPATIBLE;
481  case SCR_ERevisionAvailability.ERA_COMPATIBLE_UPDATE_AVAILABLE: return ICON_MOD_AVAILABLE_WHEN_UPDATED;
482  case SCR_ERevisionAvailability.ERA_DOWNLOAD_NOT_FINISHED: return ICON_MOD_DOWNLOAD_NOT_FINISHED;
483  }
484 
485  return ICON_MOD_NOT_AVAILABLE;
486  }
487 
488  //------------------------------------------------------------------------------------------------
489  // S T R I N G F O R M A T T I N G
490 
491  //------------------------------------------------------------------------------------------------
493  static string FormatVersion(string version)
494  {
495  return string.Format("v. %1", version);
496  }
497 
498  //------------------------------------------------------------------------------------------------
500  static string GetReportTypeString(EWorkshopReportType eReportType)
501  {
502  const int REPORT_REASONS_COUNT = EWorkshopReportType.EWREPORT_OTHER + 1;
503  const string REPORT_REASONS[REPORT_REASONS_COUNT] =
504  {
505  "#AR-Workshop_Report_InappropiateContent",
506  "#AR-Workshop_Report_OffensiveLanguage",
507  "#AR-Workshop_Report_Missleading_NonFunctional",
508  "#AR-Workshop_Report_Spam",
509  "#AR-Workshop_Report_Scam",
510  "#AR-Workshop_Report_Malicious",
511  "#AR-Workshop_Report_IPInfringement",
512  "#AR-Workshop_Report_Other"
513  };
514 
515  int reportType = eReportType;
516 
517  if (reportType < 0 || reportType >= REPORT_REASONS_COUNT)
518  return string.Empty;
519 
520  return REPORT_REASONS[reportType];
521  }
522 
523  //------------------------------------------------------------------------------------------------
524  // P R O T E C T E D M E T H O D S
525  //------------------------------------------------------------------------------------------------
526 
527  //------------------------------------------------------------------------------------------------
529  protected static void Callback_OnAddonsChecked()
530  {
531  array<string> bannedAddons = {};
532  GetGame().GetBackendApi().GetWorkshop().GetBannedItems(bannedAddons);
533 
534  if (bannedAddons.IsEmpty())
535  return;
536 
537  new SCR_BannedAddonsDetectedDialog(bannedAddons);
538  }
539 
540  //---------------------------------------------------------------------------------------------
542  protected static void SetAddonEnabled(SCR_WorkshopItem item, bool newEnabled)
543  {
544  item.SetEnabled(newEnabled);
545 
546  if (newEnabled)
547  {
548  // Auto enable dependencies too
549  item.SetDependenciesEnabled(true);
550  }
551  else
552  {
553  // Check if some addons depend on this
554  array<ref SCR_WorkshopItem> offlineAndEnabled = SCR_AddonManager.SelectItemsAnd(
555  item.GetDependentAddons(),
556  EWorkshopItemQuery.OFFLINE | EWorkshopItemQuery.ENABLED);
557 
558  if (!offlineAndEnabled.IsEmpty())
559  {
560  SCR_DisableDependentAddonsDialog.CreateDisableDependentAddons(offlineAndEnabled, item);
561  }
562  }
563  }
564 
565  //---------------------------------------------------------------------------------------------
566  protected static void InitAddonTagMaps()
567  {
568  s_sAddonTagImageMap = new map<string, string>;
569  s_sAddonTagDefaultThumbnailMap = new map<string, ResourceName>;
570 
571  // Load addon type config
572  SCR_FilterCategory cat = SCR_ConfigHelperT<SCR_FilterCategory>.GetConfigObject(ADDON_TYPE_FILTER_CATEGORY_CONFIG);
573  if (!cat)
574  return;
575 
576  foreach (SCR_FilterEntry filter : cat.GetFilters())
577  {
578  string internalName = filter.m_sInternalName;
579  internalName.ToLower();
580  s_sAddonTagImageMap.Insert(internalName, filter.m_sImageName);
581 
583  if (filterTag)
584  {
585  if (!filterTag.m_sDefaultThumbnail.IsEmpty())
586  s_sAddonTagDefaultThumbnailMap.Insert(internalName, filterTag.m_sDefaultThumbnail);
587  }
588  }
589  }
590 }
591 
592 //------------------------------------------------------------------------------------------------
596 {
597  protected ref SCR_WorkshopItem m_Item;
598 
599 
600  //------------------------------------------------------------------------------------------------
601  static SCR_DeleteAddonDialog CreateUnsubscribeAddon(SCR_WorkshopItem item)
602  {
603  return new SCR_DeleteAddonDialog(item, "unsubscribe");
604  }
605 
606 
607  //------------------------------------------------------------------------------------------------
608  static SCR_DeleteAddonDialog CreateDeleteAddon(SCR_WorkshopItem item)
609  {
610  return new SCR_DeleteAddonDialog(item, "delete");
611  }
612 
613 
614  //------------------------------------------------------------------------------------------------
615  private void SCR_DeleteAddonDialog(SCR_WorkshopItem item, string preset)
616  {
617  m_Item = item;
618  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, preset, this);
619  }
620 
621 
622  //------------------------------------------------------------------------------------------------
623  override void OnConfirm()
624  {
625  // Clear preset name
626  if (m_Item.GetEnabled())
627  SCR_AddonManager.GetInstance().GetPresetStorage().ClearUsedPreset();
628 
629  if (m_Item.GetSubscribed())
630  m_Item.SetSubscribed(false);
631 
632  m_Item.DeleteLocally();
633 
634  Close();
635  }
636 };
637 
638 //------------------------------------------------------------------------------------------------
639 // Confirmation dialog for unsubscribing multiple addons.
640 // On confirm it deletes local data and unsubscribes the addons.
641 // TODO: centralize handling of deletion, this should not be done by a dialog
642 // TODO: show a list of selcted mods
644 {
645  protected ref array<SCR_WorkshopItem> m_aItems = {};
646 
647  //------------------------------------------------------------------------------------------------
648  static SCR_DeleteAddonsListDialog CreateDialog(array<SCR_WorkshopItem> items)
649  {
650  return new SCR_DeleteAddonsListDialog(items);
651  }
652 
653  //------------------------------------------------------------------------------------------------
654  private void SCR_DeleteAddonsListDialog(array<SCR_WorkshopItem> items)
655  {
656  m_aItems = items;
657  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, "deleteAll", this);
658  }
659 
660  //------------------------------------------------------------------------------------------------
661  override void OnConfirm()
662  {
663  foreach (SCR_WorkshopItem item : m_aItems)
664  {
665  if (item.GetEnabled())
666  SCR_AddonManager.GetInstance().GetPresetStorage().ClearUsedPreset();
667 
668  if (item.GetSubscribed())
669  item.SetSubscribed(false);
670 
671  item.DeleteLocally();
672  }
673 
674  Close();
675  }
676 }
677 
678 //------------------------------------------------------------------------------------------------
681 {
682  ref array<ref SCR_WorkshopItemActionDownload> m_aActions;
683 
684  protected const ResourceName DOWNLOAD_LINE_LAYOUT = "{1C5D2CC10D7A1BC3}UI/layouts/Menus/ContentBrowser/DownloadManager/DownloadManager_AddonDownloadLineNonInteractive.layout";
685 
686  //------------------------------------------------------------------------------------------------
687  void SCR_CancelDownloadConfirmationDialog(array<ref SCR_WorkshopItemActionDownload> actionsToCancel)
688  {
689  m_aActions = {};
690 
691  foreach (SCR_WorkshopItemActionDownload action : actionsToCancel)
692  {
693  m_aActions.Insert(action);
694  }
695 
696  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, "cancel_download_confirmation", this);
697  }
698 
699  //------------------------------------------------------------------------------------------------
701  {
702  VerticalLayoutWidget layout = VerticalLayoutWidget.Cast(GetContentLayoutRoot(GetRootWidget()).FindAnyWidget(SCR_WorkshopUiCommon.WIDGET_LIST));
703 
704  // Create widgets for downloads
705  foreach (SCR_WorkshopItemActionDownload action : m_aActions)
706  {
707  Widget w = GetGame().GetWorkspace().CreateWidgets(DOWNLOAD_LINE_LAYOUT, layout);
709  comp.InitForCancelDownloadAction(action);
710  }
711  }
712 
713  //------------------------------------------------------------------------------------------------
714  override void OnConfirm()
715  {
716  foreach (SCR_WorkshopItemActionDownload action : m_aActions)
717  {
718  action.Cancel();
719  }
720  this.Close();
721  }
722 };
723 
724 
725 //------------------------------------------------------------------------------------------------
728 {
729  protected ref array<ref SCR_WorkshopItemActionDownload> m_aActions = {};
730  protected ref array<SCR_DownloadManager_AddonDownloadLine> m_aLineCompents = {};
731 
732  protected static const string TAG_ALL = "server_download_all_cancel";
733  protected static const string TAG_REQUIRED = "server_download_required";
734  protected static const string TAG_UNRELATED = "server_download_unrelated_cancel";
735 
736  protected const ResourceName DOWNLOAD_LINE_LAYOUT = "{1C5D2CC10D7A1BC3}UI/layouts/Menus/ContentBrowser/DownloadManager/DownloadManager_AddonDownloadLineNonInteractive.layout";
737 
738  //------------------------------------------------------------------------------------------------
739  static SCR_ServerJoinDownloadsConfirmationDialog Create(array<ref SCR_WorkshopItemActionDownload> actions, SCR_EJoinDownloadsConfirmationDialogType type)
740  {
741  string tag;
742 
743  switch (type)
744  {
746  tag = TAG_ALL;
747  break;
748 
750  tag = TAG_REQUIRED;
751  break;
752 
754  tag = TAG_UNRELATED;
755  break;
756  }
757 
758  return new SCR_ServerJoinDownloadsConfirmationDialog(tag, actions);
759  }
760 
761  //------------------------------------------------------------------------------------------------
762  void SCR_ServerJoinDownloadsConfirmationDialog(string tag, array<ref SCR_WorkshopItemActionDownload> actions)
763  {
764  foreach (SCR_WorkshopItemActionDownload action : actions)
765  {
766  m_aActions.Insert(action);
767  }
768 
769  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, tag, this);
770  }
771 
772  //------------------------------------------------------------------------------------------------
773  override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
774  {
775  VerticalLayoutWidget layout = VerticalLayoutWidget.Cast(GetContentLayoutRoot(GetRootWidget()).FindAnyWidget(SCR_WorkshopUiCommon.WIDGET_LIST));
776 
777  // Create widgets for downloads
778  foreach (SCR_WorkshopItemActionDownload action : m_aActions)
779  {
780  Widget w = GetGame().GetWorkspace().CreateWidgets(DOWNLOAD_LINE_LAYOUT, layout);
782  comp.InitForServerDownloadAction(action);
783 
784  m_aLineCompents.Insert(comp);
785  }
786 
787  super.OnMenuOpen(preset);
788  }
789 };
790 
791 
792 //------------------------------------------------------------------------------------------------
795 {
796  ref array<string> m_aItemNames = {};
797 
798  //------------------------------------------------------------------------------------------------
799  void SCR_BannedAddonsDetectedDialog(array<string> items)
800  {
801  m_aItemNames.Copy(items);
802 
803  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, "banned_addons_detected", this);
804  }
805 
806 
807  //------------------------------------------------------------------------------------------------
808  override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
809  {
810  string message = "#AR-Workshop_Baned_Item";
811  for (int i = 0; i < m_aItemNames.Count(); i++)
812  message = message + "\n- " + m_aItemNames[i];
813 
814  this.SetMessage(message);
815  }
816 };
817 
818 //------------------------------------------------------------------------------------------------
821 {
822  ref array<ref SCR_WorkshopItem> m_aItems = {};
823  protected ref array<SCR_DownloadManager_AddonDownloadLine> m_aDownloadLines = {};
824 
825  protected ResourceName ADDON_LINE_LAYOUT = "{BB5AEDDA3C4134FD}UI/layouts/Menus/ContentBrowser/DownloadManager/DownloadManager_AddonDownloadLineConfirmation.layout";
826 
827  //------------------------------------------------------------------------------------------------
829  void SCR_AddonListDialog(array<ref SCR_WorkshopItem> items, string preset)
830  {
831  foreach (auto i : items)
832  m_aItems.Insert(i);
833 
834  if (!preset.IsEmpty())
835  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, preset, this);
836  }
837 
838  //------------------------------------------------------------------------------------------------
839  override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
840  {
841  VerticalLayoutWidget layout = VerticalLayoutWidget.Cast(GetContentLayoutRoot(GetRootWidget()).FindAnyWidget(SCR_WorkshopUiCommon.WIDGET_LIST));
842 
843  // Create widgets
844  foreach (SCR_WorkshopItem item : m_aItems)
845  {
846  Widget w = GetGame().GetWorkspace().CreateWidgets(ADDON_LINE_LAYOUT, layout);
847 
849  comp.InitForWorkshopItem(item, null, false);
850 
851  m_aDownloadLines.Insert(comp);
852  }
853  }
854 
855  //------------------------------------------------------------------------------------------------
856  static SCR_AddonListDialog CreateItemsList(array<ref SCR_WorkshopItem> items, string preset, ResourceName dialogsConfig = "")
857  {
858  if (dialogsConfig == "")
859  dialogsConfig = SCR_WorkshopUiCommon.DIALOGS_CONFIG;
860 
861  SCR_AddonListDialog addonListDialog = new SCR_AddonListDialog(items, "");
862  SCR_ConfigurableDialogUi.CreateFromPreset(dialogsConfig, preset, addonListDialog);
863  return addonListDialog;
864  }
865 
866  //------------------------------------------------------------------------------------------------
868  static SCR_AddonListDialog CreateRestrictedAddonsDownload(array<ref SCR_WorkshopItem> items)
869  {
870  return DisplayRestrictedAddonsList(items, "error_restricted_dependencies_download", "error_reported_dependencies_download");
871  }
872 
873  //------------------------------------------------------------------------------------------------
875  static SCR_AddonListDialog CreateRestrictedAddonsJoinServer(array<ref SCR_WorkshopItem> items)
876  {
877  return DisplayRestrictedAddonsList(items, "error_restricted_addons_join_server", "error_reported_addons_join_server");
878  }
879 
880  //------------------------------------------------------------------------------------------------
882  static SCR_AddonListDialog DisplayRestrictedAddonsList(array<ref SCR_WorkshopItem> items, string tagBlocked, string tagReported)
883  {
884  // Banned specific
885  array <ref SCR_WorkshopItem> banned = SCR_AddonManager.SelectItemsOr(items, EWorkshopItemQuery.BLOCKED);
886 
887  if (!banned.IsEmpty())
888  return new SCR_AddonListDialog(banned, tagBlocked);
889 
890  // Reported
891  array <ref SCR_WorkshopItem> reported = SCR_AddonManager.SelectItemsOr(items, EWorkshopItemQuery.REPORTED_BY_ME | EWorkshopItemQuery.AUTHOR_BLOCKED);
892  return new SCR_ReportedAddonsDialog(reported, tagReported);
893  }
894 
895  //------------------------------------------------------------------------------------------------
897  static SCR_AddonListDialog CreateFailedToStartWithMods(array<ref SCR_WorkshopItem> items)
898  {
899  return new SCR_AddonListDialog(items, "error_failed_to_start_with_mods");
900  }
901 
902  //------------------------------------------------------------------------------------------------
903  array<SCR_DownloadManager_AddonDownloadLine> GetDonwloadLines()
904  {
905  return m_aDownloadLines;
906  }
907 };
908 
909 
910 //------------------------------------------------------------------------------------------------
913 {
914  // New value of enabled state of addons.
915  protected bool m_bNewEnabledValue;
916 
917  //------------------------------------------------------------------------------------------------
918  override void OnConfirm()
919  {
920  super.OnConfirm();
921 
922  foreach (SCR_WorkshopItem item : m_aItems)
923  {
924  if (item.GetOffline())
925  {
926  item.SetEnabled(m_bNewEnabledValue);
927  }
928  }
929  }
930 };
931 
932 //------------------------------------------------------------------------------------------------
935 {
936  protected ref SCR_WorkshopItem m_Dependency;
937 
938  //------------------------------------------------------------------------------------------------
939  void SCR_DisableDependentAddonsDialog(array<ref SCR_WorkshopItem> items, string preset, SCR_WorkshopItem dependency)
940  {
941  m_Dependency = dependency;
942  m_bNewEnabledValue = false; // When confirmed, addons will be disabled
943  }
944 
945  //------------------------------------------------------------------------------------------------
946  static SCR_DisableDependentAddonsDialog CreateDisableDependentAddons(array<ref SCR_WorkshopItem> items, SCR_WorkshopItem dependency)
947  {
948  return new SCR_DisableDependentAddonsDialog(items, "disable_dependent_addons", dependency);
949  }
950 
951  //------------------------------------------------------------------------------------------------
952  override void OnConfirm()
953  {
954  // Disable the dependency too
955  m_Dependency.SetEnabled(false);
956 
957  super.OnConfirm();
958  }
959 
960  //------------------------------------------------------------------------------------------------
961  override void OnCancel()
962  {
963  // Enable back the dependency
964  m_Dependency.SetEnabled(true);
965 
966  super.OnCancel();
967  }
968 };
969 
970 
971 //------------------------------------------------------------------------------------------------
974 {
975  // Widget names
976  protected const string WIDGET_TXT_TYPE_MSG = "TxtTypeMsg";
977  protected const string WIDGET_TXT_COMMENT = "TxtComment";
978 
979  // Widgets
980  protected TextWidget m_wTxtTypeMsg;
981  protected TextWidget m_wTxtComment;
982 
983  protected ref SCR_WorkshopItem m_Item;
984  protected bool m_bAuthorReport = false;
985  protected ref SCR_WorkshopItemActionCancelReport m_Action;
986  protected SCR_LoadingOverlayDialog m_LoadingOverlayDlg;
987 
988  //------------------------------------------------------------------------------------------------
989  void SCR_CancelMyReportDialog(SCR_WorkshopItem item, bool authorReport = false)
990  {
991  m_Item = item;
992  m_bAuthorReport = authorReport;
993  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopUiCommon.DIALOGS_CONFIG, "cancel_report", this);
994  }
995 
996  //------------------------------------------------------------------------------------------------
997  override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
998  {
999  // Get reports
1000  string reportDescription;
1001  EWorkshopReportType reportType;
1002 
1003  if (!m_bAuthorReport)
1004  m_Item.GetReport(reportType, reportDescription);
1005 
1006  string reportTypeStr = SCR_WorkshopUiCommon.GetReportTypeString(reportType);
1007 
1008  // Find widgets
1009  m_wTxtTypeMsg = TextWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_TXT_TYPE_MSG));
1010  m_wTxtComment = TextWidget.Cast(m_wRoot.FindAnyWidget(WIDGET_TXT_COMMENT));
1011 
1012  // Display report details
1013  if (!m_bAuthorReport)
1014  SetMessage("#AR-Workshop_CancelReportDescription");
1015 
1016  m_wTxtTypeMsg.SetText(reportTypeStr);
1017  m_wTxtComment.SetText(reportDescription);
1018  }
1019 
1020  //------------------------------------------------------------------------------------------------
1021  override void OnConfirm()
1022  {
1023  m_LoadingOverlayDlg = SCR_LoadingOverlayDialog.Create();
1024 
1025  m_Action = m_Item.CancelReport();
1026  m_Action.m_OnCompleted.Insert(Callback_OnSuccess);
1027  m_Action.m_OnFailed.Insert(Callback_OnFailed);
1028  m_Action.Activate();
1029 
1030  m_OnConfirm.Invoke(this);
1031  }
1032 
1033  //------------------------------------------------------------------------------------------------
1034  void Callback_OnSuccess()
1035  {
1036  m_LoadingOverlayDlg.CloseAnimated();
1037  Close();
1038  }
1039 
1040  //------------------------------------------------------------------------------------------------
1041  void Callback_OnFailed()
1042  {
1043  m_LoadingOverlayDlg.CloseAnimated();
1044  Close();
1045  }
1046 
1047  //------------------------------------------------------------------------------------------------
1048  SCR_WorkshopItemActionCancelReport GetWorkshopItemAction()
1049  {
1050  return m_Action;
1051  }
1052 };
1053 
1054 //------------------------------------------------------------------------------------------------
1057 {
1058  protected ref SCR_WorkshopItem m_Item;
1059 
1060  //------------------------------------------------------------------------------------------------
1061  static SCR_DeleteAddonDependentAddonsDetected Create(array<ref SCR_WorkshopItem> items, SCR_WorkshopItem item)
1062  {
1063  SCR_DeleteAddonDependentAddonsDetected dlg = new SCR_DeleteAddonDependentAddonsDetected(items, "delete_dependent_addons_detected", item);
1064  return dlg;
1065  }
1066 
1067  //------------------------------------------------------------------------------------------------
1068  protected void SCR_DeleteAddonDependentAddonsDetected(array<ref SCR_WorkshopItem> items, string preset, SCR_WorkshopItem item)
1069  {
1070  m_Item = item;
1071  }
1072 
1073  //------------------------------------------------------------------------------------------------
1075  override void OnConfirm()
1076  {
1077  if (m_Item.GetSubscribed())
1078  m_Item.SetSubscribed(false);
1079 
1080  m_Item.DeleteLocally();
1081 
1082  foreach (SCR_WorkshopItem item : m_aItems)
1083  {
1084  if (item.GetEnabled())
1085  item.SetEnabled(false);
1086  }
1087 
1088  this.Close();
1089  }
1090 };
1091 
1092 //------------------------------------------------------------------------------------------------
1094 class SCR_WorkshopItemBackendImageComponent : SCR_BackendImageComponent
1095 {
1096  protected ref SCR_WorkshopItem m_Item;
1097 
1098  protected const string LOADING_BACKGROUND_IMAGE = "{75455009AFED376B}UI/Textures/Workshop/AddonThumbnails/workshop_loading_UI.edds";
1099 
1100  //----------------------------------------------------------------------------------
1102  void SetWorkshopItemAndImage(SCR_WorkshopItem item, BackendImage image)
1103  {
1104  m_Item = item;
1105 
1106  SetImage(image);
1107  }
1108 
1109  //----------------------------------------------------------------------------------
1110  override void ShowDefaultImage()
1111  {
1112  ResourceName img;
1113  if (m_Item)
1114  img = SCR_WorkshopUiCommon.GetDefaultAddonThumbnail(m_Item);
1115  else
1116  img = SCR_WorkshopUiCommon.ADDON_DEFAULT_THUMBNAIL;
1117  ShowImage(img);
1118  }
1119 
1120  //----------------------------------------------------------------------------------
1121  override void ShowLoadingImage(string fallbackImage)
1122  {
1123  if (!m_wImage)
1124  return;
1125 
1126  if (fallbackImage.IsEmpty())
1127  {
1128  // Custom behavior when there is no fallback image
1129  // Show custom image
1131 
1132  if (m_LoadingOverlay)
1133  m_LoadingOverlay.SetShown(true);
1134  }
1135  else
1136  super.ShowLoadingImage(fallbackImage); // Default behavior
1137  }
1138 }
1139 
1140 //------------------------------------------------------------------------------------------------
1142 class SCR_ScenarioBackendImageComponent : SCR_BackendImageComponent
1143 {
1144  protected ref MissionWorkshopItem m_Scenario;
1145 
1146  protected const string LOADING_BACKGROUND_IMAGE = SCR_WorkshopUiCommon.SCENARIO_SP_DEFAULT_THUMBNAIL;
1147 
1148  //----------------------------------------------------------------------------------
1150  void SetScenarioAndImage(MissionWorkshopItem scenario, BackendImage image)
1151  {
1152  m_Scenario = scenario;
1153 
1154  SetImage(image);
1155  }
1156 
1157  //----------------------------------------------------------------------------------
1158  override void ShowDefaultImage()
1159  {
1160  // Later we can choose default image based on scenario type, player count...
1161  ShowImage(SCR_WorkshopUiCommon.SCENARIO_SP_DEFAULT_THUMBNAIL);
1162  }
1163 
1164  //----------------------------------------------------------------------------------
1165  override void ShowLoadingImage(string fallbackImage)
1166  {
1167  if (!m_wImage)
1168  return;
1169 
1170  if (fallbackImage.IsEmpty())
1171  {
1172  // Custom behavior when there is no fallback image
1173  // Show custom image
1174  if (m_bShowLoadingImage)
1176 
1177  if (m_LoadingOverlay)
1178  m_LoadingOverlay.SetShown(true);
1179  }
1180  else
1181  super.ShowLoadingImage(fallbackImage); // Default behavior
1182  }
1183 }
ShowImage
protected void ShowImage(string imagePath)
Definition: SCR_BackendImageComponent.c:284
EWorkshopItemProblem
EWorkshopItemProblem
Definition: SCR_WorkshopItem.c:11
SCR_ERevisionAvailability
SCR_ERevisionAvailability
Definition: SCR_AddonManager.c:1090
SCR_DeleteAddonDialog
private void SCR_DeleteAddonDialog(SCR_WorkshopItem item, string preset)
Definition: SCR_WorkshopUiCommon.c:615
OnMenuOpen
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
Definition: SCR_WorkshopUiCommon.c:700
DOWNLOAD_LINE_LAYOUT
const protected ResourceName DOWNLOAD_LINE_LAYOUT
Definition: SCR_WorkshopUiCommon.c:684
SCR_FilterEntry
Definition: SCR_FilterSet.c:9
SetImage
void SetImage(BackendImage image)
image can be null
Definition: SCR_BackendImageComponent.c:36
SetMessage
bool SetMessage(string message)
Definition: SCR_BrowserHoverTooltipComponent.c:255
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
LOADING_BACKGROUND_IMAGE
const protected string LOADING_BACKGROUND_IMAGE
Definition: SCR_WorkshopUiCommon.c:1146
SCR_DownloadSequence
Definition: SCR_DownloadSequence.c:19
SCR_WorkshopDownloadSequence
Definition: SCR_WorkshopDownloadSequence.c:9
m_Item
NewsFeedItem m_Item
Definition: SCR_NewsSubMenu.c:2
ShowLoadingImage
override void ShowLoadingImage(string fallbackImage)
Definition: SCR_WorkshopUiCommon.c:1165
SCR_DeleteAddonDependentAddonsDetected
This dialog is shown when we want to delete an addon but some other downloaded addons depend on it.
Definition: SCR_WorkshopUiCommon.c:1056
SCR_DownloadConfirmationDialog
Dialog for confirming multiple downloads in workshop.
Definition: SCR_DownloadConfirmationDialog.c:3
m_aActions
ref SCR_SortedArray< SCR_BaseEditorAction > m_aActions
Definition: SCR_BaseActionsEditorComponent.c:8
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_FilterCategory
Definition: SCR_FilterSet.c:65
SCR_WorkshopItemActionDownload
Definition: SCR_WorkshopItemActionDownload.c:9
SCR_CancelDownloadConfirmationDialog
void SCR_CancelDownloadConfirmationDialog(array< ref SCR_WorkshopItemActionDownload > actionsToCancel)
Definition: SCR_WorkshopUiCommon.c:687
m_Scenario
SCR_WorkshopItemBackendImageComponent m_Scenario
Same as SCR_BackendImageComponent, but implements default image based on scenario.
SCR_WorkshopItem
Definition: SCR_WorkshopItem.c:21
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
SCR_SetAddonsEnabledDialog
When confirmed, provided addons will be enabled or disabled.
Definition: SCR_WorkshopUiCommon.c:912
SetScenarioAndImage
void SetScenarioAndImage(MissionWorkshopItem scenario, BackendImage image)
Sets reference to workshop item. Call this, then call SetImage as usual.
Definition: SCR_WorkshopUiCommon.c:1150
m_bShowLoadingImage
protected bool m_bShowLoadingImage
Definition: SCR_BackendImageComponent.c:239
SCR_ServerJoinDownloadsConfirmationDialog
Dialog to cancel downloads during to server joining.
Definition: SCR_WorkshopUiCommon.c:727
m_LoadingOverlay
protected SCR_LoadingOverlay m_LoadingOverlay
Definition: SCR_BackendImageComponent.c:250
SCR_CancelMyReportDialog
Dialog which sends a request to delete user's report.
Definition: SCR_WorkshopUiCommon.c:973
SCR_WorkshopItemActionCancelReport
Action for canceling report of an item.
Definition: WorkshopItemActions.c:199
SCR_DSConfig
Definition: SCR_DSConfig.c:5
SCR_DeleteAddonsListDialog
Definition: SCR_WorkshopUiCommon.c:643
SCR_ConfigurableDialogUiPreset
Configuration for a dialog.
Definition: SCR_ConfigurableDialogUI.c:809
SCR_WorkshopItemBackendImageComponent
Same as SCR_BackendImageComponent, but implements default image based on tag of Workshop Item.
Definition: SCR_WorkshopUiCommon.c:1094
SCR_LoadingOverlayDialog
Definition: SCR_LoadingOverlayDialog.c:5
m_Item
class SCR_WorkshopUiCommon m_Item
ShowDefaultImage
override void ShowDefaultImage()
Definition: SCR_WorkshopUiCommon.c:1158
layout
UI layouts HUD CampaignMP CampaignMainHUD layout
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:20
SCR_ReportedAddonsDialog
Show list of reported mods and provide option to cancel reports.
Definition: SCR_ReportedAddonsDialog.c:3
SCR_ContentBrowserFilterTag
Definition: ContentBrowserFilters.c:8
m_wImage
protected ImageWidget m_wImage
Definition: SCR_BackendImageComponent.c:248
SCR_ConfigurableDialogUi
Definition: SCR_ConfigurableDialogUI.c:13
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
SCR_AddonManager
Definition: SCR_AddonManager.c:72
SCR_DisableDependentAddonsDialog
Dialog which is used when an addon is disabled but some dependent addons depend on it.
Definition: SCR_WorkshopUiCommon.c:934
SCR_WorkshopUiCommon
Definition: SCR_WorkshopUiCommon.c:5
m_aActions
SCR_DeleteAddonsListDialog m_aActions
Dialog to cancel downloads.
SCR_EJoinDownloadsConfirmationDialogType
SCR_EJoinDownloadsConfirmationDialogType
Enum for confirmation dialogs that guide the player through the download processes required to join t...
Definition: SCR_ServerBrowserDialogManager.c:663
SCR_AddonListDialog
Shows a list of addons and some text.
Definition: SCR_WorkshopUiCommon.c:820
SCR_WorkshopItemActionComposite
Composite action which includes multiple subactions.
Definition: SCR_WorkshopItemAction.c:408
SCR_DownloadManager
Definition: SCR_DownloadManager.c:20
SCR_DownloadManager_AddonDownloadLine
Definition: SCR_DownloadManager_AddonDownloadLine.c:5
EWorkshopItemQuery
EWorkshopItemQuery
Definition: SCR_AddonManager.c:34
SCR_HostScenarioWhileDownloadingDialog
Definition: CommonDialogs.c:143
SCR_BannedAddonsDetectedDialog
Dialog which lists names of all banned addons.
Definition: SCR_WorkshopUiCommon.c:794
OnConfirm
override void OnConfirm()
Definition: SCR_WorkshopUiCommon.c:623