Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
ContentBrowserUI.c
Go to the documentation of this file.
9
11class ContentBrowserUI : SCR_SuperMenuBase
12{
14 static const float SMALL_DOWNLOAD_THRESHOLD = 50 * 1024 * 1024; // 50 Megabytes
15
17
18 //------------------------------------------------------------------------------------------------
19 static ContentBrowserUI Create()
20 {
21 MenuBase menuBase = GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.ContentBrowser);
22 ContentBrowserUI browser = ContentBrowserUI.Cast(menuBase);
23
24 return browser;
25 }
26
27 // --- Overrides ---
28 //------------------------------------------------------------------------------------------------
29 override void OnMenuOpen()
30 {
31 super.OnMenuOpen();
32
33 // Setup the 'back' nav button
34 m_NavBack = m_DynamicFooter.FindButton(UIConstants.BUTTON_BACK);
35 if (m_NavBack)
36 m_NavBack.m_OnActivated.Insert(Close);
37
38 // Hide news menu button (top right corner) on PS
39 if (GetGame().GetPlatformService().GetLocalPlatformKind() == PlatformKind.PSN)
40 {
41 Widget newsButton = GetRootWidget().FindAnyWidget("NewsButton");
42 if (newsButton)
43 {
44 newsButton.SetVisible(false);
45 newsButton.SetEnabled(false);
46 }
47 }
48 }
49
50 //------------------------------------------------------------------------------------------------
51 override void OnMenuShow()
52 {
53 super.OnMenuShow();
54
55 //SCR_AnalyticsApplication.GetInstance().OpenWorkshop();
56 }
57
58 //------------------------------------------------------------------------------------------------
59 override void OnMenuClose()
60 {
61 super.OnMenuClose();
62
63 // Restore server hosting
65 {
66 if (ServerHostingUI.GetTemporaryConfig())
67 {
68 GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.ServerBrowserMenu);
69 SCR_CommonDialogs.CreateServerHostingDialog();
70 }
71 }
72 }
73
74 //------------------------------------------------------------------------------------------------
75 override void OnMenuHide()
76 {
77 super.OnMenuHide();
78
79 //SCR_AnalyticsApplication.GetInstance().CloseWorkshop();
80 }
81
82 //------------------------------------------------------------------------------------------------
83 override void OnMenuUpdate(float tDelta)
84 {
85 super.OnMenuUpdate(tDelta);
86
87 m_fTimerLowFreqUpdate += tDelta;
89 {
92 }
93 }
94
95 //------------------------------------------------------------------------------------------------
97 protected void LowFreqUpdate()
98 {
100
101 if(!mgr)
102 return;
103
104 // Warning sign
105 // Show warning icon if there is any offline mod which has any issue
106 array<ref SCR_WorkshopItem> allAddons = mgr.GetAllAddons();
107 array<ref SCR_WorkshopItem> offlineAddons = SCR_AddonManager.SelectItemsBasic(allAddons, EWorkshopItemQuery.OFFLINE);
108
109 bool anyIssue;
110 foreach (SCR_WorkshopItem item : offlineAddons)
111 {
112 anyIssue =
113 item.GetAnyDependencyMissing() ||
114 item.GetAnyDependencyUpdateAvailable() ||
115 item.GetEnabledAndAnyDependencyDisabled() ||
116 item.GetUpdateAvailable();
117
118 if (anyIssue)
119 break;
120 }
121
122 m_SuperMenuComponent.GetTabView().ShowIcon(EWorkshopTabId.OFFLINE, anyIssue);
123 }
124
125 // --- Public ---
126 //-----------------------------------------------------------------------------------------------
128 {
129 return m_SuperMenuComponent.GetOpenedSubMenu();
130 }
131
132 //-----------------------------------------------------------------------------------------------
134 {
135 m_SuperMenuComponent.GetTabView().ShowTab(EWorkshopTabId.MOD_MANAGER);
136 }
137
138 // --- Debug ---
139 //------------------------------------------------------------------------------------------------
140 #ifdef WORKSHOP_DEBUG
141 static void _print(string str, LogLevel logLevel = LogLevel.DEBUG)
142 {
143 Print(string.Format("[Content Browser] %1", str), logLevel);
144 }
145 #endif
146}
override void OnMenuClose()
ChimeraMenuPreset
Menu presets.
float m_fTimerLowFreqUpdate
void OpenModManager()
void LowFreqUpdate()
Update non important UI elements.
SCR_SubMenuBase GetOpenedSubMenu()
EWorkshopTabId
@ MANW
@ MOD_MANAGER
@ GAME_SAVES
enum EWorkshopTabId m_NavBack
The super menu class for WORKSHOP content browser.
bool IsPlatformGameConsole()
Definition game.c:1357
ArmaReforgerScripted GetGame()
Definition game.c:1398
PlatformKind
Definition PlatformKind.c:8
EWorkshopItemQuery
void OnMenuUpdate(float tDelta)
override void OnMenuHide()
void _print(string s)
Widget GetRootWidget()
override void OnMenuShow()
override void OnMenuOpen()
enum SCR_EServicePointType OFFLINE
enum SCR_EServicePointType ONLINE
proto native void Close()
static array< ref SCR_WorkshopItem > SelectItemsBasic(array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query)
array< ref SCR_WorkshopItem > GetAllAddons()
Returns array with all addons currently in the system - online and offline.
static SCR_AddonManager GetInstance()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14