Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ServerHostingModSubMenu.c
Go to the documentation of this file.
1/*
2Server hosting dialog sub menu for setting up mods
3*/
4
6{
7 protected const string NAV_ENABLE_ALL = "#AR-ServerHosting_EnableAll";
8 protected const string NAV_DISABLE_ALL = "#AR-Workshop_DisableAll";
9
10 protected const string SORT_BTN_SORT_LABEL = "#AR-Editor_TooltipDetail_WaypointIndex_Name";
11 protected const string SORT_BTN_SORT_ACTION = "MenuFilter";
12 protected const string SORT_BTN_PLACE_LABEL = "#AR-Button_Confirm-UC";
13
14 // Attributes
15 [Attribute("{5CEB59FD637E20B9}UI/layouts/Menus/ContentBrowser/AddonManager/AddonListTab/AddonLineDSConfig.layout", UIWidgets.ResourceNamePicker, "Used layout for mod enabling", "layout")]
17
18 // Fields
20
23
24 protected ref array<ref Widget> m_aEnabled = {};
25 protected ref array<ref Widget> m_aDisabled = {};
26
27 // Navigation buttons
33
36
37 // Keep track of currently active addons and which line they are associated to
39
40 protected bool m_bIsSorting;
41
43
46
47 // --- Overrides ---
48 //------------------------------------------------------------------------------------------------
49 override void HandlerAttached(Widget w)
50 {
51 super.HandlerAttached(w);
52
53 m_Widgets.Init(w);
54
55 // Find scroll components
56 m_wDisableScroll = ScrollLayoutWidget.Cast(m_Widgets.m_wDisabledAddonsList.GetParent());
57 m_wEnableScroll = ScrollLayoutWidget.Cast(m_Widgets.m_wEnabledAddonsList.GetParent());
58
59 // Setup action all buttons
60 m_Widgets.m_ButtonEnableAllComponent0.m_OnClicked.Insert(OnEnableAllClicked);
61 m_Widgets.m_ButtonDisableAllComponent0.m_OnClicked.Insert(OnDisableAllClicked);
62
63 // Disable Delete All buttons
64 m_Widgets.m_wDeleteAllEnabled.SetVisible(false);
65 m_Widgets.m_wDeleteAllDisabled.SetVisible(false);
66
68
70 }
71
72 //------------------------------------------------------------------------------------------------
73 override void HandlerDeattached(Widget w)
74 {
75 super.HandlerDeattached(w);
77
79 }
80
81 //------------------------------------------------------------------------------------------------
82 override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
83 {
84 super.OnTabCreate(menuRoot, buttonsLayout, index);
85
86 m_NavWorkshop = CreateNavigationButton("MenuDownloadManager", "#AR-Workshop_WorkshopPageName", false);
87 if (m_NavWorkshop)
88 m_NavWorkshop.m_OnActivated.Insert(OnOpenWorkshopButton);
89
92 m_NavSelectSort.m_OnActivated.Insert(OnNavSelectSortActivate);
93
97
98 m_NavEnableAll = CreateNavigationButton(UIConstants.MENU_ACTION_ENABLE_ALL, NAV_ENABLE_ALL, true);
100 m_NavEnableAll.m_OnActivated.Insert(OnNavEnableAllActivated);
101
102 m_NavEnable = CreateNavigationButton(UIConstants.MENU_ACTION_ENABLE, SCR_WorkshopUiCommon.LABEL_ENABLE, true);
103 if (m_NavEnable)
104 m_NavEnable.m_OnActivated.Insert(OnNavEnableActivated);
105
107 }
108
109 //------------------------------------------------------------------------------------------------
110 override void OnTabShow()
111 {
112 // Focus fist entry next frame to ensure focus will happend
113 GetGame().GetCallqueue().Call(FocusFirstEntry);
114
116
119
120 super.OnTabShow();
121 }
122
123 //------------------------------------------------------------------------------------------------
124 override void OnTabHide()
125 {
126 super.OnTabHide();
127
129
130 ReleaseSort();
131 }
132
133 //------------------------------------------------------------------------------------------------
134 protected void UpdateWorkshopButton()
135 {
136 if (!m_NavWorkshop)
137 return;
138
140 }
141
142 //------------------------------------------------------------------------------------------------
143 protected void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
144 {
146 }
147
148 //------------------------------------------------------------------------------------------------
149 override void ShowNavigationButtons(bool show)
150 {
151 super.ShowNavigationButtons(show && !m_ActiveAddons.IsEmpty());
152 }
153
154 //------------------------------------------------------------------------------------------------
155 // Protected
156 //------------------------------------------------------------------------------------------------
157 //------------------------------------------------------------------------------------------------
158 protected void FocusFirstEntry()
159 {
160 if (!m_aDisabled.IsEmpty() && m_aDisabled[0])
161 GetGame().GetWorkspace().SetFocusedWidget(m_aDisabled[0]);
162 else if (!m_aEnabled.IsEmpty() && m_aEnabled[0])
163 GetGame().GetWorkspace().SetFocusedWidget(m_aEnabled[0]);
164 }
165
166 //------------------------------------------------------------------------------------------------
168 protected void CreateAddonList()
169 {
171 return;
172
173 array<ref SCR_WorkshopItem> addons = SCR_AddonManager.GetInstance().GetOfflineAddons();
174
175 foreach (int i, SCR_WorkshopItem addon : addons)
176 {
177 SCR_ERevisionAvailability availability = SCR_AddonManager.ItemAvailability(addon.Internal_GetWorkshopItem());
178
179 if (availability == SCR_ERevisionAvailability.ERA_AVAILABLE)
180 AddLineEntry(addon, i);
181 }
182 }
183
184 //------------------------------------------------------------------------------------------------
185 protected void AddLineEntry(SCR_WorkshopItem item, int id)
186 {
187 WorkshopItem workshopItem = item.GetWorkshopItem();
188 if (workshopItem)
189 {
190 if (WorldSaveItem.Cast(workshopItem))
191 return;
192 }
193
194 // Line setup
195 Widget w = GetGame().GetWorkspace().CreateWidgets(m_EntryLayout, m_Widgets.m_wDisabledAddonsList);
197 w.FindHandler(SCR_AddonLineDSConfigComponent));
198
199 if (!line)
200 return;
201
202 // Callbacks
203 line.GetOnEnableButton().Insert(OnAddonEnabled);
204 line.GetOnDisableButton().Insert(OnAddonDisabled);
205 line.GetOnSortConfirm().Insert(OnSortConfirm);
206 line.GetEventOnButtonUp().Insert(OnLineButtonUp);
208 line.GetOnFocus().Insert(OnLineFocus);
209 line.GetOnFocusLost().Insert(OnLineFocusLost);
211
212 line.Init(item);
213 m_aDisabled.Insert(w);
214 w.SetZOrder(id);
215
216 // Enable map
217 m_ActiveAddons.Insert(item, line);
218 }
219
220 //------------------------------------------------------------------------------------------------
221 protected int LastFocusedId(Widget line, bool enabled)
222 {
223 array<ref Widget> list = {};
224
225 if (enabled)
226 list = m_aDisabled;
227 else
228 list = m_aEnabled;
229
230 // Single entry?
231 if (list.Count() == 1)
232 return -1;
233
234 return list.Find(line);
235 }
236
237 //------------------------------------------------------------------------------------------------
239 protected Widget ClosestAddonLine(int lineId, bool enabled)
240 {
241 array<ref Widget> list = m_aDisabled;
242
243 if (enabled)
244 list = m_aEnabled;
245
246 // Not found || The only element in the list || The list has no elements
247 if (lineId < 0 || lineId > list.Count() || list.IsEmpty())
248 return null;
249
250 if (lineId == 0)
251 return list[0];
252
253 return list[lineId - 1];
254 }
255
256 //-------------------------------------------------------------------------------------------
258 {
259 for (int i = 0, count = m_ActiveAddons.Count(); i < count; i++)
260 {
262 if (!line)
263 continue;
264
265 SCR_WorkshopItem item = line.GetWorkshopItem();
266 if (!item)
267 return null;
268
269 if (id == item.GetId())
270 return line;
271 }
272
273 return null;
274 }
275
276 //------------------------------------------------------------------------------------------------
279 {
281 if (!downloadManager)
282 return;
283
284 array<ref SCR_WorkshopItemActionDownload> actions = downloadManager.GetDownloadQueue();
285 foreach (SCR_WorkshopItemActionDownload action : actions)
286 {
287 action.m_OnCompleted.Insert(OnDownloadComplete);
288 }
289 }
290
291 //------------------------------------------------------------------------------------------------
293 {
295 if (!downloadManager)
296 return;
297
298 array<ref SCR_WorkshopItemActionDownload> actions = downloadManager.GetDownloadQueue();
299 foreach (SCR_WorkshopItemActionDownload action : actions)
300 {
301 action.m_OnCompleted.Remove(OnDownloadComplete);
302 }
303 }
304
305 //------------------------------------------------------------------------------------------------
306 protected void UpdateNavigationButtons(SCR_AddonLineDSConfigComponent line, bool forceDisabled = false)
307 {
308 if (!line)
309 forceDisabled = true;
310
311 bool enabled = line && line.IsEnabled();
312
313 if (m_NavEnable)
314 {
315 bool issues = line && (!line.CanBeEnabled() && !enabled);
316
317 m_NavEnable.SetEnabled(!m_OrderedLine && !issues && !forceDisabled, false);
318
319 if (enabled)
320 m_NavEnable.SetLabel(SCR_WorkshopUiCommon.LABEL_DISABLE);
321 else
322 m_NavEnable.SetLabel(SCR_WorkshopUiCommon.LABEL_ENABLE);
323
324 if (issues)
325 m_NavEnable.SetTexture(UIConstants.ICONS_IMAGE_SET, SCR_WorkshopUiCommon.ICON_DEPENDENCIES, Color.FromInt(UIColors.WARNING_DISABLED.PackToInt()));
326 else
327 m_NavEnable.ResetTexture();
328 }
329
330 if (m_NavEnableAll)
331 {
332 m_NavEnableAll.SetEnabled(!m_OrderedLine && !forceDisabled, false);
333
334 if (enabled)
336 else
338 }
339
340 if (m_NavSelectSort)
341 m_NavSelectSort.SetEnabled(!forceDisabled && enabled, false);
342 }
343
344 //------------------------------------------------------------------------------------------------
345 // Callbacks
346 //------------------------------------------------------------------------------------------------
347 //------------------------------------------------------------------------------------------------
349 {
351 if (!line)
352 return;
353
354 SCR_WorkshopItem item = line.GetWorkshopItem();
355 if (!item)
356 return;
357
358 // Enable dependencies
359 array<ref SCR_WorkshopItem> dependencies = item.GetLatestDependencies();
360 dependencies.Insert(item);
361
362 int indexToFocus = m_aDisabled.Find(component.GetRootWidget());
363
364 EnableItems(true, dependencies, indexToFocus);
365 }
366
367 //------------------------------------------------------------------------------------------------
369 {
371 if (!line)
372 return;
373
374 SCR_WorkshopItem item = line.GetWorkshopItem();
375 if (!item)
376 return;
377
378 // Unselect dependent mods
379 array<ref SCR_WorkshopItem> dependent = item.GetDependentAddons();
380
381 // Add item
382 dependent.Insert(item);
383
384 int indexToFocus = m_aEnabled.Find(component.GetRootWidget());
385
386 EnableItems(false, dependent, indexToFocus);
387 }
388
389 //------------------------------------------------------------------------------------------------
390 protected void OnLineFocus(SCR_ScriptedWidgetComponent component)
391 {
393 if (!line)
394 return;
395
396 m_FocusedLine = line;
397
399 }
400
401 //------------------------------------------------------------------------------------------------
403 {
404 m_FocusedLine = null;
405
407 UpdateNavigationButtons(line, true);
408
409 // Prevent move between list when ordering
411 GetGame().GetCallqueue().Call(FocusLine, m_OrderedLine);
412 }
413
414 //----------------------------------------------------------------------------------------------
416 {
417 // Add mod to mod list
418 AddLineEntry(action.GetWorkshopItem(), m_aDisabled.Count());
419 action.m_OnCompleted.Remove(OnDownloadComplete);
420 }
421
422 //------------------------------------------------------------------------------------------------
430
431 //------------------------------------------------------------------------------------------------
433 protected void EnableItems(bool enable, array<ref SCR_WorkshopItem> items, int indexToFocus = -1)
434 {
435 if (items.IsEmpty())
436 return;
437
438 SCR_WorkshopItem item = items[0];
440
441 if (line)
442 {
443 Widget lineRoot = line.GetRootWidget();
444
445 // Enable
446 if (enable && !line.IsEnabled())
447 {
448 // Move to enabled
449 m_Widgets.m_wEnabledAddonsList.AddChild(lineRoot);
450 m_aEnabled.Insert(lineRoot);
451 m_aDisabled.RemoveItem(lineRoot);
452
453 lineRoot.SetZOrder(m_aEnabled.Count() - 1);
454 }
455 else if (!enable && line.IsEnabled())
456 {
457 // Move to disabled
458 m_Widgets.m_wDisabledAddonsList.AddChild(lineRoot);
459 m_aDisabled.Insert(lineRoot);
460 m_aEnabled.RemoveItem(lineRoot);
461
462 lineRoot.SetZOrder(m_aDisabled.Count() - 1);
463 }
464
465 line.SetWidgetEnabled(enable);
466 }
467
468 // Order disabled mods
469 foreach (int i, Widget disabled : m_aDisabled)
470 {
471 disabled.SetZOrder(i);
472 }
473
474 // Order enabled mods
475 foreach (int i, Widget enabled : m_aEnabled)
476 {
477 enabled.SetZOrder(i);
478
480 if (lineCmp)
481 lineCmp.SetOnBottom(i == m_aEnabled.Count() - 1);
482 }
483
484 // Call next, keep going
485 items.Remove(0);
486 if (!items.IsEmpty())
487 {
488 EnableItems(enable, items, indexToFocus);
489 return;
490 }
491
492 // On finished fix list scrolls
493 float x,y;
494 m_wDisableScroll.GetSliderPos(x, y);
495
496 if (y > 1)
497 m_wDisableScroll.SetSliderPos(0, 1);
498
499 m_wEnableScroll.GetSliderPos(x, y);
500
501 if (y > 1)
502 m_wEnableScroll.SetSliderPos(0, 1);
503
504 // Reset the focus effects if is to stay focused in the same line
505 if (m_FocusedLine && !indexToFocus)
507
508 if (indexToFocus >= 0)
509 {
510 Widget w = ClosestAddonLine(indexToFocus, !enable);
511 if (w)
512 GetGame().GetWorkspace().SetFocusedWidget(w)
513 }
514 }
515
516 //------------------------------------------------------------------------------------------------
517 protected void UpdateRequiredItems()
518 {
520
521 // Clear required flags
522 for (int i = 0, count = m_ActiveAddons.Count(); i < count; i++)
523 {
524 line = m_ActiveAddons.GetElement(i);
525 if (!line)
526 continue;
527
528 line.SetRequired(false);
529 }
530
531 // Find required owner addon
533 return;
534
535 line = FindLineByModId(m_SelectedScenario.GetOwnerId());
536 if (!line)
537 return;
538
539 SCR_WorkshopItem item = line.GetWorkshopItem();
540 if (!item)
541 return;
542
543 // Find required dependencies
544 array<ref SCR_WorkshopItem> dependencies = item.GetLatestDependencies();
545 dependencies.Insert(item);
546
547 foreach (SCR_WorkshopItem dependency : dependencies)
548 {
549 line = m_ActiveAddons.Get(dependency);
550 if (line)
551 line.SetRequired(true);
552 }
553
554 // Automatically enable required mods and update required flag
555 EnableItems(true, dependencies);
556 }
557
558 //------------------------------------------------------------------------------------------------
560 {
562 if (!line)
563 return;
564
565 // Check if not on top
566 int id = line.GetRootWidget().GetZOrder();
567
568 if (id == -1 || id == 0)
569 return;
570
571 // Enter sorting mode
572 if (!m_bIsSorting)
573 StartSort(line);
574
575 // Move up
576 m_aEnabled[id] = m_aEnabled[id-1];
577 m_aEnabled[id].SetZOrder(id);
578
579 m_aEnabled[id-1] = line.GetRootWidget();
580 m_aEnabled[id-1].SetZOrder(id-1);
581
582 // Set line is on bottom
583 if (id == m_aEnabled.Count() - 1)
584 {
586 if (otherLine)
587 otherLine.SetOnBottom(true);
588 }
589
590 line.SetOnBottom(false);
591 }
592
593 //------------------------------------------------------------------------------------------------
595 {
597 if (!line)
598 return;
599
600 // Check if not on bottom
601 int id = line.GetRootWidget().GetZOrder();
602
603 if (id == -1 || id >= m_aEnabled.Count() - 1)
604 return;
605
606 // Enter sorting mode
607 if (!m_bIsSorting)
608 StartSort(line);
609
610 // Move down
611 m_aEnabled[id] = m_aEnabled[id+1];
612 m_aEnabled[id].SetZOrder(id);
613
614 m_aEnabled[id+1] = line.GetRootWidget();
615 m_aEnabled[id+1].SetZOrder(id+1);
616
617 // Set line is on bottom
619 if (otherLine)
620 otherLine.SetOnBottom(false);
621
622 if (id + 1 == m_aEnabled.Count() - 1)
623 line.SetOnBottom(true);
624 }
625
626 //------------------------------------------------------------------------------------------------
628 {
630 if (line)
631 Sort(line);
632 }
633
634 //------------------------------------------------------------------------------------------------
635 protected void OnEnableAllClicked()
636 {
637 array<ref SCR_WorkshopItem> toEnable = {};
638 SCR_WorkshopItem item;
640
641 for (int i = 0, count = m_ActiveAddons.Count(); i < count; i++)
642 {
643 item = m_ActiveAddons.GetKey(i);
644 line = m_ActiveAddons.GetElement(i);
645 if (!item || !line || !line.CanBeEnabled())
646 continue;
647
648 toEnable.Insert(item);
649 }
650
651 EnableItems(true, toEnable);
652 }
653
654 //------------------------------------------------------------------------------------------------
655 protected void OnDisableAllClicked()
656 {
657 array<ref SCR_WorkshopItem> toDisable = {};
658
660 {
661 if (!line || line.IsItemRequired())
662 continue;
663
664 toDisable.Insert(item);
665 }
666
667 EnableItems(false, toDisable);
668 }
669
670 //------------------------------------------------------------------------------------------------
671 protected void OnOpenWorkshopButton()
672 {
675 }
676
677 //------------------------------------------------------------------------------------------------
678 protected void OnNavEnableActivated(SCR_InputButtonComponent button, string action)
679 {
680 if (!m_FocusedLine)
681 return;
682
683 bool enabled = m_FocusedLine.IsEnabled();
684
685 // TODO: temporary hacky fix for this method being called multiple times in a row. It's the only button posing this problem, and the invoker is bound only once...
686 GetGame().GetCallqueue().Call(SetLineEnabled, enabled);
687 }
688
689 //------------------------------------------------------------------------------------------------
690 protected void SetLineEnabled(bool enabled)
691 {
692 GetGame().GetCallqueue().Remove(SetLineEnabled);
693
694 if (enabled)
695 m_FocusedLine.OnDisableButton();
696 else
697 m_FocusedLine.OnEnableButton();
698 }
699
700 //------------------------------------------------------------------------------------------------
701 protected void OnNavEnableAllActivated()
702 {
703 if (!m_FocusedLine)
704 return;
705
706 if (m_FocusedLine.IsEnabled())
708 else
710 }
711
712 //------------------------------------------------------------------------------------------------
713 protected void OnNavSelectSortActivate(SCR_InputButtonComponent button, string action)
714 {
716 }
717
718 //------------------------------------------------------------------------------------------------
720 {
721 if (m_OrderedLine)
722 {
723 ReleaseSort();
724 return;
725 }
726
727 StartSort(line);
728 }
729
730 //------------------------------------------------------------------------------------------------
732 {
733 if (!line || !line.IsEnabled())
734 return;
735
736 m_OrderedLine = line;
737
738 m_OrderedLine.NotifySorting(true);
739
740 GetGame().GetInputManager().AddActionListener(UIConstants.MENU_ACTION_DOWN, EActionTrigger.DOWN, OnDownSort);
741 GetGame().GetInputManager().AddActionListener(UIConstants.MENU_ACTION_UP, EActionTrigger.DOWN, OnUpSort);
742
745
746 if (m_NavSelectSort)
747 {
748 // Place and stop ordering
750 m_NavSelectSort.SetAction(UIConstants.MENU_ACTION_SELECT);
751 }
752
753 if (m_NavEnable)
755
756 if (m_NavEnableAll)
758
759 // Panel buttons
760 m_Widgets.m_ButtonEnableAllComponent0.SetEnabled(false);
761 m_Widgets.m_ButtonDisableAllComponent0.SetEnabled(false);
762
763 m_bIsSorting = true;
764 }
765
766 //------------------------------------------------------------------------------------------------
767 protected void ReleaseSort()
768 {
769 if (!m_OrderedLine)
770 return;
771
772 m_OrderedLine.NotifySorting(false);
773 m_OrderedLine = null;
774
775 GetGame().GetInputManager().RemoveActionListener(UIConstants.MENU_ACTION_DOWN, EActionTrigger.DOWN, OnDownSort);
776 GetGame().GetInputManager().RemoveActionListener(UIConstants.MENU_ACTION_UP, EActionTrigger.DOWN, OnUpSort);
777
780
781 if (m_NavSelectSort)
782 {
783 // Start ordering
786 }
787
788 if (m_NavEnable)
790
791 if (m_NavEnableAll)
793
794 // Panel buttons
795 m_Widgets.m_ButtonEnableAllComponent0.SetEnabled(true);
796 m_Widgets.m_ButtonDisableAllComponent0.SetEnabled(true);
797
798 // Refocus
800
801 m_bIsSorting = false;
802 }
803
804 //------------------------------------------------------------------------------------------------
805 protected void OnDownSort()
806 {
807 if (!m_OrderedLine)
808 return;
809
811 GetGame().GetCallqueue().Call(FocusLine, m_OrderedLine);
812 }
813
814 //------------------------------------------------------------------------------------------------
815 protected void OnUpSort()
816 {
817 if (!m_OrderedLine)
818 return;
819
821 GetGame().GetCallqueue().Call(FocusLine, m_OrderedLine);
822 }
823
824 //------------------------------------------------------------------------------------------------
826 {
827 GetGame().GetWorkspace().SetFocusedWidget(line.GetRootWidget());
828 }
829
830 //------------------------------------------------------------------------------------------------
831 // API
832 //------------------------------------------------------------------------------------------------
833 //------------------------------------------------------------------------------------------------
836 {
837 array<ref DSMod> mods = config.game.mods;
838 array<ref SCR_WorkshopItem> items = {};
840
841 foreach (DSMod mod : mods)
842 {
843 line = FindLineByModId(mod.modId);
844 if (line)
845 {
846 // Do not restore corrupted mod
847 if (!line.CanBeEnabled())
848 continue;
849
850 items.Insert(line.GetWorkshopItem());
851 }
852 }
853
854 EnableItems(true, items);
855 }
856
857 //------------------------------------------------------------------------------------------------
858 // Enables necessary mods for the given scenario
860 {
861 m_SelectedScenario = scenario;
863 }
864
865 //------------------------------------------------------------------------------------------------
867 array<ref DSMod> SelectedModsList()
868 {
869 array<ref DSMod> mods = {};
870
871 foreach (Widget widget : m_aEnabled)
872 {
874 if (!line)
875 continue;
876
877 // Save all enabled
878 if (line.IsEnabled())
879 {
880 SCR_WorkshopItem item = line.GetWorkshopItem();
881 if (!item)
882 continue;
883
884 DSMod mod = new DSMod();
885
886 mod.modId = item.GetId();
887 mod.name = item.GetName();
888 mod.version = item.GetCurrentLocalRevision().GetVersion();
889
890 mods.Insert(mod);
891 }
892 }
893
894 return mods;
895 }
896
897 //------------------------------------------------------------------------------------------------
905
906 //------------------------------------------------------------------------------------------------
914}
AddonBuildInfoTool id
ArmaReforgerScripted GetGame()
Definition game.c:1398
void UpdateNavigationButtons()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
SCR_ECommStatus
This class may become obsolete on BackendAPI update.
SCR_EServerHostingDialogTabs
Definition Color.c:13
ScriptInvokerScriptedWidgetComponent GetOnSortConfirm()
ScriptInvokerScriptedWidgetComponent GetEventOnButtonDown()
ScriptInvokerScriptedWidgetComponent GetEventOnButtonUp()
ScriptInvokerScriptedWidgetComponent GetOnRequiredDisabled()
override void Init(SCR_WorkshopItem item)
array< ref SCR_WorkshopItem > GetOfflineAddons()
Returns array with all offline addons.
static SCR_ERevisionAvailability ItemAvailability(notnull WorkshopItem item)
static SCR_AddonManager GetInstance()
static SCR_DownloadManager GetInstance()
array< ref SCR_WorkshopItemActionDownload > GetDownloadQueue()
void EnableItems(bool enable, array< ref SCR_WorkshopItem > items, int indexToFocus=-1)
Enable/disable multiple addons recursively. This does NOT actually enable/disable the addon,...
void EnableModsFromDSConfig(notnull SCR_DSConfig config)
Fill all entries with values from given DS config.
SCR_InputButtonComponent m_NavSelectSort
void OnAddonEnabled(SCR_ScriptedWidgetComponent component)
void OnDownloadComplete(SCR_WorkshopItemAction action)
ref SCR_ServerHostingModsWidgets m_Widgets
int LastFocusedId(Widget line, bool enabled)
void CreateAddonList()
Add all offline mods to selection.
SCR_AddonLineDSConfigComponent m_FocusedLine
ref map< ref SCR_WorkshopItem, ref SCR_AddonLineDSConfigComponent > m_ActiveAddons
SCR_InputButtonComponent m_NavChangeSortOrder
array< ref DSMod > SelectedModsList()
Get all selected mods from addon entries.
void OnNavSelectSortActivate(SCR_InputButtonComponent button, string action)
void SetScenario(MissionWorkshopItem scenario)
override void HandlerDeattached(Widget w)
ScriptInvokerVoid GetEventOnWorkshopButtonActivate()
void AddLineEntry(SCR_WorkshopItem item, int id)
SCR_InputButtonComponent m_NavEnableAll
void FocusLine(SCR_AddonLineDSConfigComponent line)
override void ShowNavigationButtons(bool show)
SCR_AddonLineDSConfigComponent m_OrderedLine
void StartSort(SCR_AddonLineDSConfigComponent line)
Widget ClosestAddonLine(int lineId, bool enabled)
Return closest workshop item, first check down, then up if at the end of the list.
ref ScriptInvokerVoid m_OnWorkshopButtonActivate
void OnLineFocus(SCR_ScriptedWidgetComponent component)
void OnAddonDisabled(SCR_ScriptedWidgetComponent component)
override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
ref ScriptInvokerVoid m_OnRequestDefaultScenario
void Sort(SCR_AddonLineDSConfigComponent line)
void OnSortConfirm(SCR_ScriptedWidgetComponent component)
void SetupDownloadingCallbacks()
Setup callbacks for all running downloads.
void OnNavEnableActivated(SCR_InputButtonComponent button, string action)
SCR_AddonLineDSConfigComponent FindLineByModId(string id)
void OnLineButtonDown(SCR_ScriptedWidgetComponent component)
void OnLineFocusLost(SCR_ScriptedWidgetComponent component)
void UpdateNavigationButtons(SCR_AddonLineDSConfigComponent line, bool forceDisabled=false)
void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
void OnLineButtonUp(SCR_ScriptedWidgetComponent component)
void OnRequiredAddonDisabled(SCR_ScriptedWidgetComponent component)
static ScriptInvokerCommStatus GetOnCommStatusCheckFinished()
void FlagNavigationButtonVisibility(SCR_InputButtonComponent button, bool show)
SCR_InputButtonComponent CreateNavigationButton(string actionName, string label, bool rightFooter=false, bool show=true)
void RequestTabChange(int newTabIndex)
void SetNavigationButtonVisible(SCR_InputButtonComponent button, bool show, bool animate=false)
SCR_WorkshopItem GetWorkshopItem()
Revision GetCurrentLocalRevision()
Returns the revision which we currently have on the local storage.
array< ref SCR_WorkshopItem > GetLatestDependencies()
Returns array of dependencies.
array< ref SCR_WorkshopItem > GetDependentAddons()
Returns array of dependendent addons.
WorkshopItem GetWorkshopItem()
Use these only if absoulutely necessary to intarract with game API.
Workshop Item instance.
Definition Types.c:486
SCR_FieldOfViewSettings Attribute
EActionTrigger