Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ServerConfigSaveDialogComponent.c
Go to the documentation of this file.
2{
3 protected const int MIN_NAME_LENGTH = 5;
4
5 protected const string WIDGET_FILE_NAME = "FileName";
6 protected const string WIDGET_NAV_CONFIRM = "confirm";
7
10
11 //------------------------------------------------------------------------------------------------
12 override protected void Init(Widget root, SCR_ConfigurableDialogUiPreset preset, MenuBase proxyMenu)
13 {
14 super.Init(root, preset, proxyMenu);
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override void HandlerAttached(Widget w)
20 {
22 if (!m_FileName)
23 return;
24
25 m_FileName.m_OnChanged.Insert(OnFileNameChanged);
26
27 Widget focus = m_FileName.GetRootWidget();
28 if (focus)
29 GetGame().GetWorkspace().SetFocusedWidget(focus);
30 }
31
32 //------------------------------------------------------------------------------------------------
33 void SetFileNameText(string text)
34 {
35 if (!m_FileName)
36 return;
37
38 m_FileName.SetValue(text);
39 }
40
41 //------------------------------------------------------------------------------------------------
43 {
44 if (!m_FileName)
45 return "";
46
47 return m_FileName.GetValue();
48 }
49
50 //------------------------------------------------------------------------------------------------
52 protected void OnFileNameChanged(SCR_EditBoxComponent editBox, string text)
53 {
54 if (m_navConfirm)
55 m_navConfirm.SetEnabled(text.Length() >= MIN_NAME_LENGTH);
56 }
57}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_InputButtonComponent FindButton(string tag)
Returns a button with given tag.
static SCR_EditBoxComponent GetEditBoxComponent(string name, Widget parent, bool searchAllChildren=true)
void OnFileNameChanged(SCR_EditBoxComponent editBox, string text)
Allow name saving based on given text.
void Init(Widget root, SCR_ConfigurableDialogUiPreset preset, MenuBase proxyMenu)