Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
AddonManagerDialogs.c
Go to the documentation of this file.
2 {
3  const string DIALOGS_CONFIG = "{F96E0133AC81125A}UI/Dialogs.conf";
4 }
5 
7 {
8  string m_sText;
9 
11  {
12  m_sText = text;
13  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopAddonManagerDialogs.DIALOGS_CONFIG, "copy_to_clipboard", this);
14  TextWidget tw = TextWidget.Cast(GetRootWidget().FindAnyWidget("MessageInScroll"));
15  tw.SetText(text);
16  }
17 
18  override void OnConfirm()
19  {
20  System.ExportToClipboard(m_sText);
21  }
22 }
23 
24 // Basic error dialog with a message
26 {
27  void SCR_WorkshopErrorDialog(string message)
28  {
29  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopAddonManagerDialogs.DIALOGS_CONFIG, "error", this);
30  SetMessage(message);
31  }
32 }
33 
34 
35 
36 // Dialog which also stores reference to addon preset
38 {
39  // "preset" term is used both in WEXT and Configurable Dialogs, it's a bit confusing
40 
41  // We store ptr to preset which we are going to delete/create,
42  // when ok btn is presset we will use it
43  ref SCR_WorkshopAddonPreset m_Preset;
44  string m_sPresetName;
45 
46  void SCR_WorkshopPresetConfirmDialog(SCR_WorkshopAddonPreset preset, string presetName, string dlgPreset)
47  {
48  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopAddonManagerDialogs.DIALOGS_CONFIG, dlgPreset, this);
49  m_Preset = preset;
50  m_sPresetName = presetName;
51  }
52 
53  static SCR_WorkshopPresetConfirmDialog CreateDeletePresetDialog(string presetName)
54  {
55  return new SCR_WorkshopPresetConfirmDialog(null, presetName, "delete_preset");
56  }
57 
58  static SCR_WorkshopPresetConfirmDialog CreateOverridePresetDialog(SCR_WorkshopAddonPreset preset)
59  {
60  return new SCR_WorkshopPresetConfirmDialog(preset, preset.GetName(), "override_preset");
61  }
62 }
63 
64 // Dialog which shows error and lists addons which we failed to load in a preset
66 {
67  protected SCR_DownloadConfirmationDialog m_Dialog;
68 
69  void SCR_WorkshopErrorPresetLoadDialog(array<ref SCR_WorkshopAddonPresetAddonMeta> notFoundAddons)
70  {
71  SCR_ConfigurableDialogUi.CreateFromPreset(SCR_WorkshopAddonManagerDialogs.DIALOGS_CONFIG, "error_preset_load", this);
72 
73  TextWidget scrollMessage = TextWidget.Cast(GetRootWidget().FindAnyWidget("ScrollMessage"));
74 
75  if (scrollMessage)
76  {
77  string msg = "";
78 
79  foreach (SCR_WorkshopAddonPresetAddonMeta meta : notFoundAddons)
80  {
81  msg = msg + string.Format("%1 %2\n", meta.GetGuid(), meta.GetName());
82  }
83 
84  scrollMessage.SetVisible(true);
85  scrollMessage.SetText(msg);
86  }
87  }
88 
89  protected int m_iDownloading;
90 
91 
92  //---------------------------------------------------------------------------------------------------
93  protected void OnModDownloaded(SCR_WorkshopItemAction action)
94  {
95  //array<ref SCR_WorkshopItem> items = m_ModManager.GetRoomItemsToUpdate();
96  m_iDownloading--;
97 
98  // Invoke on all downloaded
99  /*if (m_iDownloadedCount == items.Count())
100  m_OnDownloadComplete.Invoke(m_JoinRoom);*/
101 
102  if (m_iDownloading > 0)
103  return;
104 
105 
106  // Stop listening when completed
107  //action.m_OnChanged.Remove(OnDownloadActionChange);
108  action.m_OnCompleted.Remove(OnModDownloaded);
109  }
110 }
SCR_WorkshopPresetConfirmDialog
void SCR_WorkshopPresetConfirmDialog(SCR_WorkshopAddonPreset preset, string presetName, string dlgPreset)
Definition: AddonManagerDialogs.c:46
OnConfirm
override void OnConfirm()
Definition: AddonManagerDialogs.c:18
SetMessage
bool SetMessage(string message)
Definition: SCR_BrowserHoverTooltipComponent.c:255
SCR_DownloadConfirmationDialog
Dialog for confirming multiple downloads in workshop.
Definition: SCR_DownloadConfirmationDialog.c:3
SCR_WorkshopAddonPresetAddonMeta
Meta data of one addon.
Definition: SCR_WorkshopAddonManagerStorage.c:3
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
SCR_WorkshopErrorDialog
Definition: AddonManagerDialogs.c:25
SCR_WorkshopDialogCopyToClipboard
void SCR_WorkshopDialogCopyToClipboard(string text)
Definition: AddonManagerDialogs.c:10
m_sPresetName
string m_sPresetName
Definition: AddonManagerDialogs.c:44
SCR_WorkshopItemAction
Definition: SCR_WorkshopItemAction.c:16
m_Preset
SCR_WorkshopErrorDialog m_Preset
SCR_ConfigurableDialogUi
Definition: SCR_ConfigurableDialogUI.c:13
m_sText
class SCR_WorkshopAddonManagerDialogs m_sText
SCR_WorkshopErrorPresetLoadDialog
Definition: AddonManagerDialogs.c:65
SCR_WorkshopAddonManagerDialogs
Definition: AddonManagerDialogs.c:1