Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
AddonsToolsUI.c
Go to the documentation of this file.
1
7
enum
SCR_EModPresetsDialogTabs
8
{
9
PRESETS
,
10
EXPORT_JSON
,
11
EXPORT_CLI
12
}
13
14
class
AddonsToolsUI :
SCR_TabDialog
15
{
16
//------------------------------------------------------------------------------------------------
17
override
void
OnMenuOpen
(SCR_ConfigurableDialogUiPreset preset)
18
{
19
super.
OnMenuOpen
(preset);
20
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
31
EnableExportTabs
();
32
SCR_AddonManager.GetInstance().m_OnAddonsEnabledChanged.Insert(
EnableExportTabs
);
33
}
34
35
//------------------------------------------------------------------------------------------------
36
override
void
OnMenuClose
()
37
{
38
super.OnMenuClose();
39
40
SCR_AddonManager
.
GetInstance
().
m_OnAddonsEnabledChanged
.Remove(
EnableExportTabs
);
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
{
59
SCR_MenuToolsLib
.
GetEventOnAllMenuClosed
().Insert(
AllMenuClosed
);
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
{
74
SCR_MenuToolsLib
.
GetEventOnAllMenuClosed
().Remove(
AllMenuClosed
);
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
94
if
(
GetGame
().
IsPlatformGameConsole
())
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
EXPORT_JSON
Definition
AddonsToolsUI.c:19
AllMenuClosed
void AllMenuClosed()
Callback for when all additional menu are closed and top menu is main menu.
Definition
AddonsToolsUI.c:72
PRESETS
PRESETS
Definition
AddonsToolsUI.c:18
OnOpenWorkshopButton
void OnOpenWorkshopButton()
Definition
AddonsToolsUI.c:57
EnableExportTabs
void EnableExportTabs()
Enable export tabs only if player has enabled mods.
Definition
AddonsToolsUI.c:88
EXPORT_CLI
EXPORT_CLI
Definition
AddonsToolsUI.c:21
SCR_EModPresetsDialogTabs
SCR_EModPresetsDialogTabs
Definition
AddonsToolsUI.c:8
IsAddonManagerOpened
bool IsAddonManagerOpened()
Return true if workshop is opened on tab "Mod manager".
Definition
AddonsToolsUI.c:45
IsPlatformGameConsole
bool IsPlatformGameConsole()
Definition
game.c:1357
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetInputManager
InputManager GetInputManager()
Definition
SCR_BaseManualCameraComponent.c:205
OnMenuOpen
override void OnMenuOpen()
Definition
SCR_ProfileSuperMenu.c:12
SCR_AddonManager
Definition
SCR_AddonManager.c:80
SCR_AddonManager::m_OnAddonsEnabledChanged
ref ScriptInvoker m_OnAddonsEnabledChanged
Definition
SCR_AddonManager.c:105
SCR_AddonManager::GetInstance
static SCR_AddonManager GetInstance()
Definition
SCR_AddonManager.c:139
SCR_ConfigurableDialogUi::Close
void Close()
Definition
SCR_ConfigurableDialogUI.c:254
SCR_ConfigurableDialogUi::OnCancel
void OnCancel()
Definition
SCR_ConfigurableDialogUI.c:444
SCR_ConfigurableDialogUi::FindButton
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
Definition
SCR_ConfigurableDialogUI.c:419
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_InputButtonComponent::m_OnActivated
ref ScriptInvoker m_OnActivated
Definition
SCR_InputButtonComponent.c:153
SCR_MenuToolsLib
Definition
SCR_MenuToolsLib.c:6
SCR_MenuToolsLib::GetEventOnAllMenuClosed
static ScriptInvoker GetEventOnAllMenuClosed()
Definition
SCR_MenuToolsLib.c:25
SCR_MenuToolsLib::CloseAllMenus
static void CloseAllMenus(array< typename > menus)
Close all menus that are not of selected class.
Definition
SCR_MenuToolsLib.c:39
SCR_TabDialog
Definition
SCR_TabDialog.c:10
SCR_TabDialog::OnMenuClose
override void OnMenuClose()
Definition
SCR_TabDialog.c:56
SCR_TabDialog::OnMenuOpen
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
Definition
SCR_TabDialog.c:14
SCR_TabViewComponent
Definition
SCR_TabViewComponent.c:14
SCR_TabViewComponent::EnableTab
void EnableTab(int tabIndex, bool enable, bool animate=true)
Definition
SCR_TabViewComponent.c:767
SCR_TabViewComponent::SetPagingButtonsVisible
void SetPagingButtonsVisible(bool visible, bool animate=true)
Definition
SCR_TabViewComponent.c:913
SCR_TabViewComponent::SetTabVisible
void SetTabVisible(int tabIndex, bool visible, bool animate=true)
Definition
SCR_TabViewComponent.c:800
SCR_WorkshopListAddonsSubmenu
Definition
SCR_WorkshopListAddonsSubmenu.c:2
SCR_WorkshopUiCommon
Definition
SCR_WorkshopUiCommon.c:6
scripts
Game
UI
Menu
ContentBrowser
AddonManager
AddonsTools
AddonsToolsUI.c
Generated by
1.17.0