Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PersistentFactionDialog.c
Go to the documentation of this file.
2{
4 protected const string dialogPresetConfig = "{FC62FADA1444750B}Configs/DeployMenu/DeployMenuDialogPreset.conf";
5 //protected SCR_ButtonCheckerComponent m_Checker;
6
7 //------------------------------------------------------------------------------------------------
9 {
11 SCR_ConfigurableDialogUi.CreateFromPreset(dialogPresetConfig, "PERSISTENT_FACTION", dialogUI);
12 dialogUI.m_iRequestedFactionIndex = factionIndex;
13
14 return dialogUI;
15 }
16
17 //------------------------------------------------------------------------------------------------
19 {
21 SCR_ConfigurableDialogUi.CreateFromPreset(dialogPresetConfig, "PERSISTENT_FACTION_CAMPAIGN_FIA", dialogUI);
22 dialogUI.m_iRequestedFactionIndex = factionIndex;
23
24 return dialogUI;
25 }
26
31
32 /*
33 todo@lk: uncomment once user settings saving works correctly on ds
34 override void HandlerAttached(Widget w)
35 {
36 super.HandlerAttached(w);
37
38 Widget btn = w.FindAnyWidget("DontShowButton");
39 m_Checker = SCR_ButtonCheckerComponent.Cast(btn.FindHandler(SCR_ButtonCheckerComponent));
40 GetGame().GetInputManager().AddActionListener("MenuDeploy", EActionTrigger.PRESSED, Toggle);
41 }
42
43 override void HandlerDeattached(Widget w)
44 {
45 super.HandlerDeattached(W);
46
47 GetGame().GetInputManager().RemoveActionListener("MenuDeploy", EActionTrigger.PRESSED, Toggle);
48 }
49
50 protected override void OnConfirm()
51 {
52 if (m_Checker.IsToggled())
53 {
54 UserSettings userSettings = GetGame().GetGameUserSettings();
55 if (userSettings)
56 {
57 BaseContainer container = userSettings.GetModule("SCR_DeployMenuSettings");
58 if (container)
59 {
60 container.Set("m_bShowPersistentFactionWarning", false);
61 GetGame().UserSettingsChanged();
62 GetGame().SaveUserSettings();
63 }
64 }
65 }
66
67 super.OnConfirm();
68 }
69
70 protected void Toggle()
71 {
72 m_Checker.SetToggled(!m_Checker.IsToggled());
73 }
74
75 static bool CanCreateDialog()
76 {
77 UserSettings userSettings = GetGame().GetGameUserSettings();
78 if (!userSettings)
79 return false;
80
81 bool showWarning;
82 BaseContainer container = userSettings.GetModule("SCR_DeployMenuSettings");
83 if (container)
84 container.Get("m_bShowPersistentFactionWarning", showWarning);
85
86 return showWarning;
87 }
88 */
89};
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
static SCR_PersistentFactionDialog CreatePersistentFactionDialog(int factionIndex)
static SCR_PersistentFactionDialog CreatePersistentFactionCampaignFIADialog(int factionIndex)