Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeathScreenUIComponent.c
Go to the documentation of this file.
2{
3 [Attribute("BackMainMenu")]
4 protected string m_sMainMenuButtonName;
5
6 [Attribute("RestartMissionButton")]
7 protected string m_sRestartButtonName;
8
9 [Attribute("LoadSaveButton")]
10 protected string m_sLoadSaveButtonName;
11
12 //------------------------------------------------------------------------------------------------
13 protected void ReturnToMenuPressed()
14 {
15 SCR_ConfigurableDialogUi dlg = SCR_CommonDialogs.CreateDialog("scenario_exit");
16 if (!dlg)
17 return;
18
20 }
21
22 //------------------------------------------------------------------------------------------------
24 {
26 GameStateTransitions.RequestGameplayEndTransition();
27 }
28
29 //------------------------------------------------------------------------------------------------
30 protected void RestartScenarioPressed()
31 {
32 SCR_ConfigurableDialogUi dlg = SCR_CommonDialogs.CreateDialog("scenario_restart");
33 if (!dlg)
34 return;
35
37 }
38
39 //------------------------------------------------------------------------------------------------
40 protected void RestartPopupConfirm()
41 {
43 GameStateTransitions.RequestScenarioRestart();
44 }
45
46 //------------------------------------------------------------------------------------------------
47 protected void LoadSavePressed()
48 {
49 SCR_ConfigurableDialogUi dlg = SCR_CommonDialogs.CreateDialog("scenario_load");
50 if (!dlg)
51 return;
52
53 dlg.m_OnConfirm.Insert(LoadPopupConfirm);
54 }
55
56 //------------------------------------------------------------------------------------------------
57 protected void LoadPopupConfirm()
58 {
60
61 auto manager = GetGame().GetSaveGameManager();
62 const SaveGame activeSave = manager.GetActiveSave();
63 if (activeSave)
64 {
65 manager.Load(activeSave);
66 return;
67 }
68
69 // Restart and stay on same playthrough
70 GameStateTransitions.RequestScenarioRestart();
71 }
72
73 //------------------------------------------------------------------------------------------------
74 protected void OnButtonPressed()
75 {
76 ChimeraWorld world = GetGame().GetWorld();
77 if (!world)
78 return;
79
80 if (world.IsGameTimePaused())
81 world.PauseGameTime(false);
82 }
83
84 //------------------------------------------------------------------------------------------------
85 override void HandlerAttached(Widget w)
86 {
87 super.HandlerAttached(w);
88
89 Widget returnToMenuBtn = m_wRoot.FindAnyWidget(m_sMainMenuButtonName);
90 if (returnToMenuBtn)
91 {
92 SCR_InputButtonComponent returnToMenuButton = SCR_InputButtonComponent.Cast(returnToMenuBtn.FindHandler(SCR_InputButtonComponent));
93 if (returnToMenuButton)
94 returnToMenuButton.m_OnActivated.Insert(ReturnToMenuPressed);
95 }
96
97 Widget restartBtn = m_wRoot.FindAnyWidget(m_sRestartButtonName);
98 if (restartBtn)
99 {
100 SCR_InputButtonComponent restartButton = SCR_InputButtonComponent.Cast(restartBtn.FindHandler(SCR_InputButtonComponent));
101 if (restartButton)
102 restartButton.m_OnActivated.Insert(RestartScenarioPressed);
103 }
104
105 Widget loadSaveBtn = m_wRoot.FindAnyWidget(m_sLoadSaveButtonName);
106 if (loadSaveBtn)
107 {
108 SCR_InputButtonComponent loadSaveButton = SCR_InputButtonComponent.Cast(loadSaveBtn.FindHandler(SCR_InputButtonComponent));
109 if (loadSaveButton)
110 loadSaveButton.m_OnActivated.Insert(LoadSavePressed);
111 }
112 }
113}
ArmaReforgerScripted GetGame()
Definition game.c:1398
override void HandlerAttached(Widget w)
SCR_FieldOfViewSettings Attribute