Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SimpleEntryListDialog.c
Go to the documentation of this file.
1
4
5//------------------------------------------------------------------------------------------------
8{
9 protected ResourceName ADDON_LINE_LAYOUT = "{99668AEF3063A9F2}UI/layouts/Menus/Common/SimpleEntry.layout";
10
11 protected ref array<string> m_aNames = {};
12 protected ref array<SCR_SimpleEntryComponent> m_aLines = {};
13
14 //------------------------------------------------------------------------------------------------
16 {
17 VerticalLayoutWidget layout = VerticalLayoutWidget.Cast(GetRootWidget().FindAnyWidget("AddonList"));
18 if (!layout)
19 {
20 Print("SCR_SimpleEntryListDialog - can't create list due to missing list layout" , LogLevel.WARNING);
21 return;
22 }
23
24 // Create widgets
25 for (int i = 0, count = m_aNames.Count(); i < count; i++)
26 {
27 Widget w = GetGame().GetWorkspace().CreateWidgets(ADDON_LINE_LAYOUT, layout);
28
30 if (!comp)
31 continue;
32
33 comp.SetMessages(m_aNames[i], string.Empty);
34
35 m_aLines.Insert(comp);
36 }
37 }
38
39 //------------------------------------------------------------------------------------------------
40 static SCR_SimpleEntryListDialog CreateDialog(array<string> names, string preset, ResourceName dialogsConfig = "")
41 {
42 if (dialogsConfig == string.Empty)
43 dialogsConfig = SCR_WorkshopDialogs.DIALOGS_CONFIG;
44
45 SCR_SimpleEntryListDialog ListDialog = new SCR_SimpleEntryListDialog(names, "");
46 SCR_ConfigurableDialogUi.CreateFromPreset(dialogsConfig, preset, ListDialog);
47 return ListDialog;
48 }
49
50 //------------------------------------------------------------------------------------------------
52 protected void SCR_SimpleEntryListDialog(array<string> names, string preset)
53 {
54 m_aNames.InsertAll(names);
55
56 if (!preset.IsEmpty())
58 }
59};
ArmaReforgerScripted GetGame()
Definition game.c:1398
UI layouts Menus CleanSweep CleanSweepAreaSelection layout
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
void SetMessages(string left, string right)
override void OnMenuOpen(SCR_ConfigurableDialogUiPreset preset)
ref array< SCR_SimpleEntryComponent > m_aLines
ResourceName ADDON_LINE_LAYOUT
ref array< string > m_aNames
static SCR_SimpleEntryListDialog CreateDialog(array< string > names, string preset, ResourceName dialogsConfig="")
void SCR_SimpleEntryListDialog(array< string > names, string preset)
!!! Don't use the constructor! Use the Create... methods instead.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14