Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HostButtonComponent.c
Go to the documentation of this file.
1 
6 class SCR_HostButtonComponent : ScriptedWidgetComponent
7 {
9  MissionWorkshopItem m_Scenario;
10 
11  //------------------------------------------------------------------------------------------------
12  override void HandlerAttached(Widget w)
13  {
14  m_Button = SCR_ButtonBaseComponent.Cast(w.FindHandler(SCR_ButtonBaseComponent));
15 
16  // Invokers actions
17  m_Button.m_OnClicked.Insert(OnClicked);
18  }
19 
20  //------------------------------------------------------------------------------------------------
21  protected void OnClicked(SCR_ButtonBaseComponent button)
22  {
23  // Open hosting menu
24  ServerHostingUI dialog = SCR_CommonDialogs.CreateServerHostingDialog();
25 
26  if (m_Scenario && dialog)
27  dialog.SelectScenario(m_Scenario);
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  void SetScenario(MissionWorkshopItem scenario)
32  {
33  m_Scenario = scenario;
34  }
35 
36  //------------------------------------------------------------------------------------------------
37  static SCR_HostButtonComponent FindComponent(Widget w)
38  {
39  return SCR_HostButtonComponent.Cast(w.FindHandler(SCR_HostButtonComponent));
40  }
41 };
SCR_CommonDialogs
Definition: CommonDialogs.c:5
SCR_HostButtonComponent
Definition: SCR_HostButtonComponent.c:6
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition: SCR_ButtonBaseComponent.c:3
m_Scenario
SCR_ExitGameWhileDownloadingDialog m_Scenario