Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AddonsExportDialog.c
Go to the documentation of this file.
2 {
3  protected ref SCR_AddonsExportDialogWidgets m_Widgets = new SCR_AddonsExportDialogWidgets();
4 
5  protected SCR_AddonsExportSubMenuComponent m_ExportSubMenu;
6 
7  //---------------------------------------------------------------------------------------------------
8  override void OnMenuOpen()
9  {
10  super.OnMenuOpen();
11 
12  m_Widgets.Init(GetRootWidget());
13 
14  // Button actions
15  m_Widgets.m_NavCopyComponent.m_OnActivated.Insert(OnClickCopy);
16  m_Widgets.m_TabViewRootComponent.GetOnChanged().Insert(OnTabChanged);
17 
18  GenerateModContent();
19  }
20 
21  //---------------------------------------------------------------------------------------------------
22  protected void OnClickCopy()
23  {
24  if (m_ExportSubMenu)
25  m_ExportSubMenu.CopyToClipboard();
26  }
27 
28  //---------------------------------------------------------------------------------------------------
29  protected void GenerateModContent()
30  {
31  // JSON
32  SCR_AddonsExportSubMenuComponent subMenu = SubMenuFromTab(m_Widgets.m_TabViewRootComponent, 0);
33  if (subMenu)
34  subMenu.GenerateJSONFormat();
35  }
36 
37  //---------------------------------------------------------------------------------------------------
38  protected void OnTabChanged(SCR_TabViewComponent tabView, Widget w, int id)
39  {
40  SCR_AddonsExportSubMenuComponent subMenu = SubMenuFromTab(tabView, id);
41 
42  if (!subMenu)
43  return;
44 
45  m_ExportSubMenu = subMenu;
46 
47  switch (id)
48  {
49  case 0:
50  {
51  subMenu.GenerateJSONFormat();
52  break;
53  }
54 
55  case 1:
56  {
57  subMenu.GenerateCLIFormat();
58  break;
59  }
60  }
61  }
62 
63  //---------------------------------------------------------------------------------------------------
64  protected SCR_AddonsExportSubMenuComponent SubMenuFromTab(SCR_TabViewComponent tabView, int id)
65  {
66  if (!tabView)
67  return null;
68 
69  SCR_TabViewContent content = tabView.GetEntryContent(id);
70  if (!content)
71  return null;
72 
73  Widget w = content.m_wTab;
74  if (!w)
75  return null;
76 
77  return SCR_AddonsExportSubMenuComponent.Cast(w.FindHandler(SCR_AddonsExportSubMenuComponent));
78  }
79 }
SCR_AddonsExportDialogWidgets
Definition: SCR_AddonsExportDialogWidgets.c:4
m_Widgets
ref SCR_VoNOverlay_ElementWidgets m_Widgets
Definition: SCR_VonDisplay.c:3
SCR_TabViewComponent
Definition: SCR_TabViewComponent.c:13
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
SCR_AddonExportDialog
Definition: SCR_AddonsExportDialog.c:1
DialogUI
Definition: DialogUI.c:1