Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SettingsSubMenuBase.c
Go to the documentation of this file.
2 {
3  protected ref array<ref SCR_SettingsBindingBase> m_aSettingsBindings = {};
4  protected ScrollLayoutWidget m_wScroll;
5  protected bool m_bLoadingSettings;
6 
7  //------------------------------------------------------------------------------------------------
8  override void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout, int index)
9  {
10  super.OnTabCreate(menuRoot, buttonsLayout, index);
11  m_wScroll = ScrollLayoutWidget.Cast(m_wRoot.FindAnyWidget("ScrollLayout0"));
12  }
13 
14  //------------------------------------------------------------------------------------------------
15  override void OnTabHide()
16  {
17  super.OnTabHide();
18  GetGame().SaveUserSettings();
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  override void OnTabShow()
23  {
24  super.OnTabShow();
25 
26  if (m_wScroll)
27  m_wScroll.SetSliderPos(0, 0);
28  }
29 
30  //------------------------------------------------------------------------------------------------
31  protected void LoadSettings(bool forceLoadSettings = false, bool addEntryChangedEventHandler = true)
32  {
33  if (!m_wScroll)
34  return;
35 
36  m_bLoadingSettings = true;
37  foreach (SCR_SettingsBindingBase bind : m_aSettingsBindings)
38  {
39  bind.LoadEntry(m_wScroll, forceLoadSettings, addEntryChangedEventHandler);
40  if (addEntryChangedEventHandler)
41  bind.GetEntryChangedInvoker().Insert(OnMenuItemChanged);
42  }
43  m_bLoadingSettings = false;
44  }
45 
46  //------------------------------------------------------------------------------------------------
47  protected void OnMenuItemChanged(SCR_SettingsBindingBase binding)
48  {
49  GetGame().UserSettingsChanged();
50  }
51 };
SCR_SettingsBindingBase
Definition: SCR_SettingsBindingBase.c:1
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
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition: SCR_DestructionSynchronizationComponent.c:17
SCR_SettingsSubMenuBase
Definition: SCR_SettingsSubMenuBase.c:1