Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_GMMenu.c
Go to the documentation of this file.
1
2
class
SCR_GMMenu
:
ChimeraMenuBase
3
{
4
protected
const
ResourceName
TILES_LAYOUT
=
"{818240FE79AF0D49}UI/layouts/Menus/GMMenu/MainMenuTile_VerticalLarge.layout"
;
5
protected
const
ResourceName
CONFIG
=
"{CA59D3A983A1BBAB}Configs/GMMenu/GMMenuEntries.conf"
;
6
7
protected
SCR_GalleryComponent
m_Gallery
;
8
protected
WorkshopApi
m_WorkshopAPI
;
9
protected
SCR_GMMenuTileComponent
m_CurrentTile
;
10
11
//------------------------------------------------------------------------------------------------
12
override
void
OnMenuOpen
()
13
{
14
super.OnMenuOpen();
15
m_Gallery
=
SCR_GalleryComponent
.
GetGalleryComponent
(
"Gallery"
,
GetRootWidget
());
16
m_WorkshopAPI
=
GetGame
().GetBackendApi().GetWorkshop();
17
18
SCR_InputButtonComponent
back =
SCR_InputButtonComponent
.
GetInputButtonComponent
(
UIConstants
.BUTTON_BACK, GetRootWidget());
19
if
(back)
20
back.
m_OnActivated
.Insert(
OnBack
);
21
22
bool
disableContent =
GetGame
().GetGameInstallStatus() != 1.0;
23
PrepareTiles
(disableContent);
24
25
if
(
m_Gallery
)
26
m_Gallery
.SetFocusedItem(0,
true
);
27
}
28
29
//------------------------------------------------------------------------------------------------
30
override
void
OnMenuFocusGained
()
31
{
32
if
(
m_CurrentTile
)
33
GetGame
().GetWorkspace().SetFocusedWidget(
m_CurrentTile
.GetRootWidget());
34
35
super.OnMenuFocusGained();
36
}
37
38
//------------------------------------------------------------------------------------------------
39
protected
void
PrepareTiles
(
bool
isContentDisabled =
false
)
40
{
41
Resource
resource =
BaseContainerTools
.LoadContainer(
CONFIG
);
42
if
(!resource)
43
return
;
44
45
BaseContainer
container = resource.GetResource().ToBaseContainer();
46
SCR_GMMenuConfiguration
menuConf =
SCR_GMMenuConfiguration
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(container));
47
if
(!menuConf)
48
return
;
49
50
Widget
root =
GetRootWidget
().FindAnyWidget(
"ScenariosHorizontalLayout"
);
51
52
array<ResourceName> missions = menuConf.
GetScenarios
();
53
54
foreach
(
ResourceName
mission : missions)
55
{
56
Widget
w =
GetGame
().GetWorkspace().CreateWidgets(
TILES_LAYOUT
, root);
57
if
(!w)
58
continue
;
59
60
SCR_MainMenuTileComponent
tile =
SCR_MainMenuTileComponent
.Cast(w.GetChildren().FindHandler(
SCR_MainMenuTileComponent
));
61
if
(!tile)
62
continue
;
63
64
tile.
ShowMission
(
SCR_ScenarioUICommon
.
GetInGameScenario
(mission));
65
if
(isContentDisabled)
66
tile.
DisableTile
();
67
}
68
69
Widget
focusWidget = root.GetChildren().GetChildren();
70
if
(focusWidget)
71
GetGame
().GetWorkspace().SetFocusedWidget(focusWidget);
72
}
73
74
//------------------------------------------------------------------------------------------------
75
protected
void
OnBack
()
76
{
77
Close
();
78
}
79
80
//------------------------------------------------------------------------------------------------
81
protected
void
OnTileFocused
(
SCR_GMMenuTileComponent
tile)
82
{
83
m_CurrentTile
= tile;
84
}
85
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetRootWidget
Widget GetRootWidget()
Definition
SCR_ModularButtonComponent.c:189
Close
proto native void Close()
Definition
SCR_WorkshopDialogs.c:77
BaseContainer
Definition
BaseContainer.c:13
BaseContainerTools
Definition
BaseContainerTools.c:13
ChimeraMenuBase
Constant variables used in various menus.
Definition
ChimeraMenuBase.c:72
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_GMMenuConfiguration
Definition
SCR_GMMenuConfiguration.c:3
SCR_GMMenuConfiguration::GetScenarios
array< ResourceName > GetScenarios()
Definition
SCR_GMMenuConfiguration.c:8
SCR_GMMenu
Definition
SCR_GMMenu.c:3
SCR_GMMenu::PrepareTiles
void PrepareTiles(bool isContentDisabled=false)
Definition
SCR_GMMenu.c:39
SCR_GMMenu::m_CurrentTile
SCR_GMMenuTileComponent m_CurrentTile
Definition
SCR_GMMenu.c:9
SCR_GMMenu::OnMenuOpen
override void OnMenuOpen()
Definition
SCR_GMMenu.c:12
SCR_GMMenu::OnMenuFocusGained
override void OnMenuFocusGained()
Definition
SCR_GMMenu.c:30
SCR_GMMenu::TILES_LAYOUT
const ResourceName TILES_LAYOUT
Definition
SCR_GMMenu.c:4
SCR_GMMenu::OnTileFocused
void OnTileFocused(SCR_GMMenuTileComponent tile)
Definition
SCR_GMMenu.c:81
SCR_GMMenu::OnBack
void OnBack()
Definition
SCR_GMMenu.c:75
SCR_GMMenu::m_WorkshopAPI
WorkshopApi m_WorkshopAPI
Definition
SCR_GMMenu.c:8
SCR_GMMenu::CONFIG
const ResourceName CONFIG
Definition
SCR_GMMenu.c:5
SCR_GMMenu::m_Gallery
SCR_GalleryComponent m_Gallery
Definition
SCR_GMMenu.c:7
SCR_GMMenuTileComponent
Definition
SCR_GMMenuTileComponent.c:2
SCR_GalleryComponent
Definition
SCR_GalleryComponent.c:2
SCR_GalleryComponent::GetGalleryComponent
static SCR_GalleryComponent GetGalleryComponent(string name, Widget parent, bool searchAllChildren=true)
Definition
SCR_GalleryComponent.c:460
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_InputButtonComponent::m_OnActivated
ref ScriptInvoker m_OnActivated
Definition
SCR_InputButtonComponent.c:153
SCR_InputButtonComponent::GetInputButtonComponent
static SCR_InputButtonComponent GetInputButtonComponent(string name, notnull Widget parent, bool searchAllChildren=true)
Definition
SCR_InputButtonComponent.c:1212
SCR_MainMenuTileComponent
Definition
SCR_MainMenuTileComponent.c:2
SCR_MainMenuTileComponent::ShowMission
void ShowMission(notnull MissionWorkshopItem item, bool showRecommended=false)
Definition
SCR_MainMenuTileComponent.c:165
SCR_MainMenuTileComponent::DisableTile
void DisableTile()
Definition
SCR_MainMenuTileComponent.c:103
SCR_ScenarioUICommon
Definition
SCR_ScenarioUICommon.c:5
SCR_ScenarioUICommon::GetInGameScenario
static MissionWorkshopItem GetInGameScenario(ResourceName resource)
Definition
SCR_ScenarioUICommon.c:245
UIConstants
Definition
Constants.c:151
Widget
Definition
Widget.c:13
WorkshopApi
Workshop Api instance.
Definition
WorkshopApi.c:14
scripts
Game
UI
Menu
GMMenu
SCR_GMMenu.c
Generated by
1.17.0