Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_DeathScreenUIComponent.c
Go to the documentation of this file.
1
class
SCR_DeathScreenUIComponent
:
SCR_ScriptedWidgetComponent
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
19
dlg.
m_OnConfirm
.Insert(
BackToMainMenuPopupConfirm
);
20
}
21
22
//------------------------------------------------------------------------------------------------
23
protected
void
BackToMainMenuPopupConfirm
()
24
{
25
OnButtonPressed
();
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
36
dlg.
m_OnConfirm
.Insert(
RestartPopupConfirm
);
37
}
38
39
//------------------------------------------------------------------------------------------------
40
protected
void
RestartPopupConfirm
()
41
{
42
OnButtonPressed
();
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
{
59
OnButtonPressed
();
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
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ChimeraWorld
Definition
ChimeraWorld.c:13
GameStateTransitions
Definition
GameStateTransitions.c:13
SCR_CommonDialogs
Definition
CommonDialogs.c:6
SCR_ConfigurableDialogUi
Definition
SCR_ConfigurableDialogUI.c:17
SCR_ConfigurableDialogUi::m_OnConfirm
ref ScriptInvoker m_OnConfirm
Definition
SCR_ConfigurableDialogUI.c:47
SCR_DeathScreenUIComponent
Definition
SCR_DeathScreenUIComponent.c:2
SCR_DeathScreenUIComponent::LoadPopupConfirm
void LoadPopupConfirm()
Definition
SCR_DeathScreenUIComponent.c:57
SCR_DeathScreenUIComponent::m_sLoadSaveButtonName
string m_sLoadSaveButtonName
Definition
SCR_DeathScreenUIComponent.c:10
SCR_DeathScreenUIComponent::m_sRestartButtonName
string m_sRestartButtonName
Definition
SCR_DeathScreenUIComponent.c:7
SCR_DeathScreenUIComponent::m_sMainMenuButtonName
string m_sMainMenuButtonName
Definition
SCR_DeathScreenUIComponent.c:4
SCR_DeathScreenUIComponent::LoadSavePressed
void LoadSavePressed()
Definition
SCR_DeathScreenUIComponent.c:47
SCR_DeathScreenUIComponent::BackToMainMenuPopupConfirm
void BackToMainMenuPopupConfirm()
Definition
SCR_DeathScreenUIComponent.c:23
SCR_DeathScreenUIComponent::HandlerAttached
override void HandlerAttached(Widget w)
Definition
SCR_DeathScreenUIComponent.c:85
SCR_DeathScreenUIComponent::OnButtonPressed
void OnButtonPressed()
Definition
SCR_DeathScreenUIComponent.c:74
SCR_DeathScreenUIComponent::RestartScenarioPressed
void RestartScenarioPressed()
Definition
SCR_DeathScreenUIComponent.c:30
SCR_DeathScreenUIComponent::ReturnToMenuPressed
void ReturnToMenuPressed()
Definition
SCR_DeathScreenUIComponent.c:13
SCR_DeathScreenUIComponent::RestartPopupConfirm
void RestartPopupConfirm()
Definition
SCR_DeathScreenUIComponent.c:40
SCR_InputButtonComponent
Definition
SCR_InputButtonComponent.c:2
SCR_InputButtonComponent::m_OnActivated
ref ScriptInvoker m_OnActivated
Definition
SCR_InputButtonComponent.c:153
SCR_ScriptedWidgetComponent
Definition
SCR_ScriptedWidgetComponent.c:8
SCR_ScriptedWidgetComponent::m_wRoot
Widget m_wRoot
Definition
SCR_ScriptedWidgetComponent.c:9
SaveGame
Definition
SaveGame.c:13
Widget
Definition
Widget.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
GameOverScreen
SCR_DeathScreenUIComponent.c
Generated by
1.17.0