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_MenuSpawnLogic.c
Go to the documentation of this file.
1
[
BaseContainerProps
(
category
:
"Respawn"
)]
2
class
SCR_MenuSpawnLogic
: SCR_SpawnLogic
3
{
4
[
Attribute
(
""
, uiwidget:
UIWidgets
.EditBox,
category
:
"Respawn"
,
desc
:
"Default faction for players to spawn with or empty if none."
)]
5
protected
FactionKey
m_sForcedFaction
;
6
7
[
Attribute
(
"4"
,
desc
:
"Delay (in seconds) for opening deploy menu after death."
)]
8
protected
float
m_fDeployMenuOpenDelay
;
9
10
[
Attribute
(
"0"
,
desc
:
"Delay opening deploy menu until player has a spawn point available"
)]
11
protected
bool
m_bWaitForSpawnPoints
;
12
13
[
Attribute
(
"0"
,
desc
:
"If true, use a fade effect when deploy map is open"
)]
14
protected
bool
m_bUseFadeEffect
;
15
16
//------------------------------------------------------------------------------------------------
17
override
void
OnPlayerAuditSuccess_S
(
int
playerId)
18
{
19
super.OnPlayerAuditSuccess_S(playerId);
20
ExcuteInitialLoadOrSpawn_S(playerId);
21
}
22
23
//------------------------------------------------------------------------------------------------
24
override
protected
void
DoSpawn_S
(
int
playerId)
25
{
26
Faction
forcedFaction;
27
if
(
GetForcedFaction
(forcedFaction))
28
{
29
PlayerController pc =
GetGame
().GetPlayerManager().GetPlayerController(playerId);
30
SCR_PlayerFactionAffiliationComponent
playerFactionComp =
SCR_PlayerFactionAffiliationComponent
.Cast(pc.FindComponent(
SCR_PlayerFactionAffiliationComponent
));
31
if
(playerFactionComp)
32
playerFactionComp.
RequestFaction
(forcedFaction);
33
}
34
35
// Send a notification to registered client:
36
// Always ensure to hook OnLocalPlayer callbacks prior to sending such notification,
37
// otherwise the notification will be disregarded
38
GetPlayerRespawnComponent_S(playerId).NotifyReadyForSpawn_S();
39
}
40
41
//------------------------------------------------------------------------------------------------
42
override
void
OnPlayerEntityLost_S
(
int
playerId)
43
{
44
super.OnPlayerEntityLost_S(playerId);
45
GetPlayerRespawnComponent_S(playerId).NotifyReadyForSpawn_S();
46
}
47
48
//------------------------------------------------------------------------------------------------
49
protected
bool
GetForcedFaction
(out
Faction
faction)
50
{
51
if
(
m_sForcedFaction
.IsEmpty())
52
return
false
;
53
54
// Resolve Alias
55
SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(
GetGame
().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
56
if
(factionAliasComponent)
57
m_sForcedFaction
= factionAliasComponent.ResolveFactionAlias(
m_sForcedFaction
);
58
59
faction =
GetGame
().GetFactionManager().GetFactionByKey(
m_sForcedFaction
);
60
if
(!faction)
61
{
62
Print
(
string
.Format(
"Auto spawn logic did not find faction by name: %1"
,
m_sForcedFaction
),
LogLevel
.WARNING);
63
return
false
;
64
}
65
66
return
true
;
67
}
68
69
//------------------------------------------------------------------------------------------------
71
float
GetDeployMenuOpenDelay
()
72
{
73
return
m_fDeployMenuOpenDelay
;
74
}
75
76
//------------------------------------------------------------------------------------------------
77
bool
GetWaitForSpawnPoints
()
78
{
79
return
m_bWaitForSpawnPoints
;
80
}
81
82
//------------------------------------------------------------------------------------------------
83
bool
GetUseFadeEffect
()
84
{
85
return
m_bUseFadeEffect
;
86
}
87
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Faction
Definition
Faction.c:13
FactionKey
Definition
FactionKey.c:3
SCR_MenuSpawnLogic
Definition
SCR_MenuSpawnLogic.c:3
SCR_MenuSpawnLogic::GetDeployMenuOpenDelay
float GetDeployMenuOpenDelay()
Delay in seconds.
Definition
SCR_MenuSpawnLogic.c:71
SCR_MenuSpawnLogic::OnPlayerAuditSuccess_S
override void OnPlayerAuditSuccess_S(int playerId)
Definition
SCR_MenuSpawnLogic.c:17
SCR_MenuSpawnLogic::GetUseFadeEffect
bool GetUseFadeEffect()
Definition
SCR_MenuSpawnLogic.c:83
SCR_MenuSpawnLogic::DoSpawn_S
void DoSpawn_S(int playerId)
Definition
SCR_MenuSpawnLogic.c:24
SCR_MenuSpawnLogic::m_fDeployMenuOpenDelay
float m_fDeployMenuOpenDelay
Definition
SCR_MenuSpawnLogic.c:8
SCR_MenuSpawnLogic::OnPlayerEntityLost_S
override void OnPlayerEntityLost_S(int playerId)
Definition
SCR_MenuSpawnLogic.c:42
SCR_MenuSpawnLogic::GetWaitForSpawnPoints
bool GetWaitForSpawnPoints()
Definition
SCR_MenuSpawnLogic.c:77
SCR_MenuSpawnLogic::GetForcedFaction
bool GetForcedFaction(out Faction faction)
Definition
SCR_MenuSpawnLogic.c:49
SCR_MenuSpawnLogic::m_bUseFadeEffect
bool m_bUseFadeEffect
Definition
SCR_MenuSpawnLogic.c:14
SCR_MenuSpawnLogic::m_bWaitForSpawnPoints
bool m_bWaitForSpawnPoints
Definition
SCR_MenuSpawnLogic.c:11
SCR_MenuSpawnLogic::m_sForcedFaction
FactionKey m_sForcedFaction
Definition
SCR_MenuSpawnLogic.c:5
SCR_PlayerFactionAffiliationComponent
Definition
SCR_PlayerFactionAffiliationComponent.c:21
SCR_PlayerFactionAffiliationComponent::RequestFaction
bool RequestFaction(Faction faction)
Definition
SCR_PlayerFactionAffiliationComponent.c:168
UIWidgets
Definition
attributes.c:40
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Respawn
Logic
SCR_MenuSpawnLogic.c
Generated by
1.17.0