Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PersistentFactionDialog.c
Go to the documentation of this file.
2 {
3  protected int m_iRequestedFactionIndex;
4  //protected SCR_ButtonCheckerComponent m_Checker;
5 
6  //------------------------------------------------------------------------------------------------
7  static SCR_PersistentFactionDialog CreatePersistentFactionDialog(int factionIndex)
8  {
10  SCR_ConfigurableDialogUi.CreateFromPreset("{FC62FADA1444750B}Configs/DeployMenu/DeployMenuDialogPreset.conf", "PERSISTENT_FACTION", dialogUI);
11  dialogUI.m_iRequestedFactionIndex = factionIndex;
12 
13  return dialogUI;
14  }
15 
16  int GetRequestedFactionIndex()
17  {
18  return m_iRequestedFactionIndex;
19  }
20 
21  /*
22  todo@lk: uncomment once user settings saving works correctly on ds
23  override void HandlerAttached(Widget w)
24  {
25  super.HandlerAttached(w);
26 
27  Widget btn = w.FindAnyWidget("DontShowButton");
28  m_Checker = SCR_ButtonCheckerComponent.Cast(btn.FindHandler(SCR_ButtonCheckerComponent));
29  GetGame().GetInputManager().AddActionListener("MenuDeploy", EActionTrigger.PRESSED, Toggle);
30  }
31 
32  override void HandlerDeattached(Widget w)
33  {
34  super.HandlerDeattached(W);
35 
36  GetGame().GetInputManager().RemoveActionListener("MenuDeploy", EActionTrigger.PRESSED, Toggle);
37  }
38 
39  protected override void OnConfirm()
40  {
41  if (m_Checker.IsToggled())
42  {
43  UserSettings userSettings = GetGame().GetGameUserSettings();
44  if (userSettings)
45  {
46  BaseContainer container = userSettings.GetModule("SCR_DeployMenuSettings");
47  if (container)
48  {
49  container.Set("m_bShowPersistentFactionWarning", false);
50  GetGame().UserSettingsChanged();
51  GetGame().SaveUserSettings();
52  }
53  }
54  }
55 
56  super.OnConfirm();
57  }
58 
59  protected void Toggle()
60  {
61  m_Checker.SetToggled(!m_Checker.IsToggled());
62  }
63 
64  static bool CanCreateDialog()
65  {
66  UserSettings userSettings = GetGame().GetGameUserSettings();
67  if (!userSettings)
68  return false;
69 
70  bool showWarning;
71  BaseContainer container = userSettings.GetModule("SCR_DeployMenuSettings");
72  if (container)
73  container.Get("m_bShowPersistentFactionWarning", showWarning);
74 
75  return showWarning;
76  }
77  */
78 };
SCR_PersistentFactionDialog
Definition: SCR_PersistentFactionDialog.c:1
SCR_ConfigurableDialogUi
Definition: SCR_ConfigurableDialogUI.c:13