Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DeathGameOverManagerComponent.c
Go to the documentation of this file.
2[ComponentEditorProps(category: "GameScripted/GameMode", description: "")]
6
8{
9 [Attribute("{F94857313E410E60}UI/layouts/HUD/GameOver/EndScreen/EndScreen_Death.layout", params: "layout")]
10 protected ResourceName m_sDeathScreenGameOverOverwrite;
11
12 [Attribute("1", desc: "If true will pause the game when the player dies and game over is called")]
13 protected bool m_bPauseGameOnDeath;
14
15 //------------------------------------------------------------------------------------------------
16 override void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
17 {
18 if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_SINGLEPLAYER_DISABLE_GAMEOVER))
19 return;
20
21 if (!GetGameMode().IsMaster())
22 return;
23
24 if (SCR_PlayerController.GetLocalPlayerId() != instigatorContextData.GetVictimPlayerID())
25 return;
26
27 if (m_bPauseGameOnDeath)
28 {
29 ChimeraWorld world = GetGame().GetWorld();
30 if (world)
31 world.PauseGameTime(true);
32 }
33
34 SCR_GameOverScreenManagerComponent gameOverManager = SCR_GameOverScreenManagerComponent.Cast(GetGameMode().FindComponent(SCR_GameOverScreenManagerComponent));
35 if (gameOverManager)
36 gameOverManager.SetGameOverScreenOverWrite(m_sDeathScreenGameOverOverwrite);
37
38 GetGameMode().EndGameMode(SCR_GameModeEndData.CreateSimple(EGameOverTypes.DEATH_SCREEN_DEFAULT));
39 }
40
41 //------------------------------------------------------------------------------------------------
43 {
44 DiagMenu.RegisterMenu(SCR_DebugMenuID.DEBUGUI_SINGLEPLAYER, "Singleplayer", "");
45 DiagMenu.RegisterBool(SCR_DebugMenuID.DEBUGUI_SINGLEPLAYER_DISABLE_GAMEOVER, "", "Disable Game Over", "Singleplayer");
46 }
47}
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition DebugMenuID.c:4
EGameOverTypes
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameMode GetGameMode()
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void OnPlayerKilled(notnull SCR_InstigatorContextData instigatorContextData)
void SCR_DeathGameOverManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Diagnostic and developer menu system.
Definition DiagMenu.c:18
void EndGameMode(SCR_GameModeEndData endData)
Death gameover logic created for single player missions.
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
SCR_FieldOfViewSettings Attribute