Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AddonsExportDialog.c
Go to the documentation of this file.
2{
4
5 protected SCR_AddonsExportSubMenuComponent m_ExportSubMenu;
6
7 //---------------------------------------------------------------------------------------------------
8 override void OnMenuOpen()
9 {
10 super.OnMenuOpen();
11
13
14 // Button actions
15 m_Widgets.m_NavCopyComponent.m_OnActivated.Insert(OnClickCopy);
16 m_Widgets.m_TabViewRootComponent.GetOnChanged().Insert(OnTabChanged);
17
19 }
20
21 //---------------------------------------------------------------------------------------------------
22 protected void OnClickCopy()
23 {
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}
class RestAPIHelper< JsonApiStruct T > content
Widget GetRootWidget()
void OnTabChanged(SCR_TabViewComponent tabView, Widget w, int id)
SCR_AddonsExportSubMenuComponent m_ExportSubMenu
ref SCR_AddonsExportDialogWidgets m_Widgets
SCR_AddonsExportSubMenuComponent SubMenuFromTab(SCR_TabViewComponent tabView, int id)
SCR_TabViewContent GetEntryContent(int index)