Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_GMMenuTileComponent.c
Go to the documentation of this file.
2{
5
6 protected TextWidget m_wName;
8
13
14 protected bool m_bFocused;
15
16 //------------------------------------------------------------------------------------------------
17 override void HandlerAttached(Widget w)
18 {
19 super.HandlerAttached(w);
20
21 m_wName = TextWidget.Cast(w.FindAnyWidget("Name"));
22 m_wDescription = TextWidget.Cast(w.FindAnyWidget("Description"));
23
25 if (m_Play)
26 m_Play.m_OnActivated.Insert(OnPlay);
27
29 if (m_Continue)
30 m_Continue.m_OnActivated.Insert(OnContinue);
31
33 if (m_FindServer)
34 m_FindServer.m_OnActivated.Insert(OnFindServers);
35
37 if (m_Restart)
38 m_Restart.m_OnActivated.Insert(OnRestart);
39
41 }
42
43 //------------------------------------------------------------------------------------------------
44 override bool OnClick(Widget w, int x, int y, int button)
45 {
46 OnPlay();
47
48 return super.OnClick(w, x, y, button);
49 }
50
51 //------------------------------------------------------------------------------------------------
52 override bool OnFocus(Widget w, int x, int y)
53 {
55
56 m_bFocused = true;
57
58 return super.OnFocus(w, x, y);
59 }
60
61 //------------------------------------------------------------------------------------------------
62 override bool OnFocusLost(Widget w, int x, int y)
63 {
65
66 m_bFocused = false;
67
68 return super.OnFocusLost(w, x, y);
69 }
70
71 //------------------------------------------------------------------------------------------------
75 {
76 m_Item = item;
77 if (!m_Item)
78 return;
79
80 if (m_wName)
81 m_wName.SetText(m_Item.Name());
82
84 m_wDescription.SetText(m_Item.Description());
85
86 // Set image through SCR_ButtonImageComponent
87 m_Header = SCR_MissionHeader.Cast(MissionHeader.ReadMissionHeader(m_Item.Id()));
88
90 if (comp)
91 {
92 ResourceName texture = GetTexture();
93 if (!texture.IsEmpty())
94 comp.SetImage(texture);
95 }
96
98 }
99
100 //------------------------------------------------------------------------------------------------
103 {
104 if (!m_Header && m_Item)
105 return m_Item.Thumbnail().GetLocalScale(1920).Path();
106
107 if (!m_Header.m_sPreviewImage.IsEmpty())
108 return m_Header.m_sPreviewImage;
109
110 if (!m_Header.m_sIcon.IsEmpty())
111 return m_Header.m_sIcon;
112
113 return m_Header.m_sLoadingScreen;
114 }
115
116 //------------------------------------------------------------------------------------------------
117 protected void OnPlay()
118 {
120 return;
121
122 SCR_ScenarioUICommon.TryPlayScenario(m_Item);
123 SCR_MenuLoadingComponent.SaveLastMenu(ChimeraMenuPreset.EditorSelectionMenu);
124 }
125
126 //------------------------------------------------------------------------------------------------
127 protected void OnContinue()
128 {
129 SCR_ScenarioUICommon.LoadSave(m_Item, m_Header, ChimeraMenuPreset.EditorSelectionMenu);
130 SCR_ScenarioUICommon.TryPlayScenario(m_Item);
131 }
132
133 //------------------------------------------------------------------------------------------------
134 protected void OnRestart()
135 {
137 return;
138
139 SCR_ConfigurableDialogUi dialog = SCR_CommonDialogs.CreateDialog(SCR_ScenarioUICommon.DIALOG_RESTART);
140 dialog.m_OnConfirm.Insert(OnRestartConfirmed);
141 }
142
143 //------------------------------------------------------------------------------------------------
144 protected void OnRestartConfirmed()
145 {
146 SCR_ScenarioUICommon.TryPlayScenario(m_Item);
147 SCR_MenuLoadingComponent.SaveLastMenu(ChimeraMenuPreset.EditorSelectionMenu);
148 }
149
150 //------------------------------------------------------------------------------------------------
158
159 //------------------------------------------------------------------------------------------------
160 protected void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
161 {
163 }
164}
ChimeraMenuPreset
Menu presets.
SCR_ECommStatus
This class may become obsolete on BackendAPI update.
override bool OnClick(Widget w, int x, int y, int button)
override bool OnFocusLost(Widget w, int x, int y)
override void HandlerAttached(Widget w)
void OnCommStatusCheckFinished(SCR_ECommStatus status, float responseTime, float lastSuccessTime, float lastFailTime)
ref SCR_MissionHeader m_Header
void ShowMission(notnull MissionWorkshopItem item)
SCR_InputButtonComponent m_Restart
SCR_InputButtonComponent m_Play
SCR_InputButtonComponent m_Continue
override bool OnFocus(Widget w, int x, int y)
SCR_InputButtonComponent m_FindServer
static SCR_InputButtonComponent GetInputButtonComponent(string name, notnull Widget parent, bool searchAllChildren=true)
static void UpdateInputButtons(MissionWorkshopItem mission, array< SCR_InputButtonComponent > buttons, bool visible=true)
static bool CanJoin(MissionWorkshopItem mission)
static bool CanPlay(MissionWorkshopItem mission)
static ScriptInvokerCommStatus GetOnCommStatusCheckFinished()
static void TryOpenServerBrowserWithScenarioFilter(MissionWorkshopItem mission)