Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ProfileSubMenu.c
Go to the documentation of this file.
2 {
3  [Attribute("EditName")]
4  protected string m_sNameButtonName;
5 
6  [Attribute("EditPicture")]
7  protected string m_sPictureButtonName;
8 
9  protected DialogUI m_OpenedDialog;
10 
11  //------------------------------------------------------------------------------------------------
12  override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
13  {
14  super.OnTabCreate(menuRoot, buttonsLayout, index);
15 
16  SCR_ButtonBaseComponent name = SCR_ButtonBaseComponent.GetButtonBase(m_sNameButtonName, m_wRoot);
17  if (name)
18  name.m_OnClicked.Insert(OnNameClicked);
19 
20  SCR_ButtonBaseComponent picture = SCR_ButtonBaseComponent.GetButtonBase(m_sPictureButtonName, m_wRoot);
21  if (picture)
22  picture.m_OnClicked.Insert(OnPictureClicked);
23  }
24 
25  //------------------------------------------------------------------------------------------------
26  void OnNameClicked()
27  {
28  m_OpenedDialog = DialogUI.Cast(GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.ProfileDialog));
29  if (!m_OpenedDialog)
30  return;
31 
32  //m_OpenedDialog.m_OnConfirm.Insert(OnProfileChanged);
33 
34  SCR_EditBoxComponent edit = SCR_EditBoxComponent.GetEditBoxComponent("ProfileName", m_OpenedDialog.GetRootWidget());
35  if (!edit)
36  return;
37 
38  string name = SCR_Global.GetProfileName();
39  edit.SetValue(name);
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  void OnProfileChanged()
44  {
45  if (!m_OpenedDialog)
46  return;
47 
48  SCR_EditBoxComponent edit = SCR_EditBoxComponent.GetEditBoxComponent("ProfileName", m_OpenedDialog.GetRootWidget());
49  if (edit)
50  {
51  string name = edit.GetValue();
52  // TODO: Future feature of custom name
53  }
54 
55  m_OpenedDialog.CloseAnimated();
56  }
57 
58  //------------------------------------------------------------------------------------------------
59  void OnPictureClicked()
60  {
61  // TODO: Implement when image change is possible
62  }
63 };
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_SubMenuBase
Definition: SCR_SubMenuBase.c:6
SCR_ProfileEditSubMenu
Definition: SCR_ProfileSubMenu.c:1
Attribute
SCR_ProfileEditSubMenu Attribute
Post-process effect of scripted camera.
DialogUI
Definition: DialogUI.c:1
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition: SCR_ButtonBaseComponent.c:3
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_Global
Definition: Functions.c:6
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition: ChimeraMenuBase.c:3
SCR_EditBoxComponent
Definition: SCR_EditBoxComponent.c:8