Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
AddonsToolsUI.c
Go to the documentation of this file.
13
14class AddonsToolsUI : SCR_TabDialog
15{
16 //------------------------------------------------------------------------------------------------
17 override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
18 {
19 super.OnMenuOpen(preset);
21 // Setup workshop button
22 SCR_InputButtonComponent workshopButton = FindButton("NavOpenWorkshop");
23
24 if (workshopButton)
25 {
26 workshopButton.SetVisible(!IsAddonManagerOpened());
27 workshopButton.m_OnActivated.Insert(OnOpenWorkshopButton);
28 }
29
30 // Mod enabled callback
32 SCR_AddonManager.GetInstance().m_OnAddonsEnabledChanged.Insert(EnableExportTabs);
33 }
34
35 //------------------------------------------------------------------------------------------------
36 override void OnMenuClose()
37 {
38 super.OnMenuClose();
39
41 }
42
43 //------------------------------------------------------------------------------------------------
45 protected bool IsAddonManagerOpened()
46 {
47 // Workshop opened
48 ContentBrowserUI workshopUI = ContentBrowserUI.Cast(GetGame().GetMenuManager().GetTopMenu());
49
50 if (!workshopUI)
51 return false;
52
53 return SCR_WorkshopListAddonsSubmenu.Cast(workshopUI.GetOpenedSubMenu());
54 }
55
56 //------------------------------------------------------------------------------------------------
57 protected void OnOpenWorkshopButton()
58 {
60 SCR_MenuToolsLib.CloseAllMenus({MainMenuUI, ContentBrowserUI});
61 }
62
63 //------------------------------------------------------------------------------------------------
64 override protected void OnCancel()
65 {
66 if (!GetGame().GetInputManager().IsContextActive("MenuTextEditContext"))
67 super.OnCancel();
68 }
69
70 //------------------------------------------------------------------------------------------------
72 protected void AllMenuClosed()
73 {
75 Close();
76
77 ContentBrowserUI workshopUI = ContentBrowserUI.Cast(GetGame().GetMenuManager().GetTopMenu());
78 if (!workshopUI)
79 SCR_WorkshopUiCommon.TryOpenWorkshop();
80
81 // Open tab
82 if (workshopUI)
83 workshopUI.OpenModManager();
84 }
85
86 //------------------------------------------------------------------------------------------------
88 protected void EnableExportTabs()
89 {
90 SCR_TabViewComponent tabView = m_SuperMenuComponent.GetTabView();
91 if (!tabView)
92 return;
93
95 {
96 tabView.SetTabVisible(SCR_EModPresetsDialogTabs.EXPORT_JSON, false, false);
97 tabView.SetTabVisible(SCR_EModPresetsDialogTabs.EXPORT_CLI, false, false);
98 tabView.SetPagingButtonsVisible(false, false);
99 return;
100 }
101
102 bool enable = (SCR_AddonManager.GetInstance().CountOfEnabledAddons() > 0);
103
104 tabView.EnableTab(SCR_EModPresetsDialogTabs.EXPORT_JSON, enable);
105 tabView.EnableTab(SCR_EModPresetsDialogTabs.EXPORT_CLI, enable);
106 }
107}
EXPORT_JSON
void AllMenuClosed()
Callback for when all additional menu are closed and top menu is main menu.
PRESETS
void OnOpenWorkshopButton()
void EnableExportTabs()
Enable export tabs only if player has enabled mods.
EXPORT_CLI
SCR_EModPresetsDialogTabs
bool IsAddonManagerOpened()
Return true if workshop is opened on tab "Mod manager".
bool IsPlatformGameConsole()
Definition game.c:1357
ArmaReforgerScripted GetGame()
Definition game.c:1398
InputManager GetInputManager()
override void OnMenuOpen()
ref ScriptInvoker m_OnAddonsEnabledChanged
static SCR_AddonManager GetInstance()
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
static ScriptInvoker GetEventOnAllMenuClosed()
static void CloseAllMenus(array< typename > menus)
Close all menus that are not of selected class.
override void OnMenuClose()
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
void EnableTab(int tabIndex, bool enable, bool animate=true)
void SetPagingButtonsVisible(bool visible, bool animate=true)
void SetTabVisible(int tabIndex, bool visible, bool animate=true)