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_PlayerRestrictionZoneWarningComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Misc"
, description:
""
)]
2
class
SCR_PlayerRestrictionZoneWarningComponentClass
:
ScriptComponentClass
3
{
4
}
5
6
class
SCR_PlayerRestrictionZoneWarningComponent :
ScriptComponent
7
{
8
protected
SCR_RestrictionZoneWarningHUDComponent
m_WarningHUD
;
9
protected
bool
m_bShowingWarning
;
10
protected
float
m_fWarningEffectStrenghtPerc
;
11
protected
float
m_fWarningEffectStrenghtLookAtPerc
;
12
13
//------------------------------------------------------------------------------------------------
21
void
ShowWarningServer
(
bool
showWarning,
ERestrictionZoneWarningType
warningType,
bool
centerChanged,
vector
zoneCenter,
float
warningRadiusSq,
float
zoneRadiusSq)
22
{
23
if
((
m_bShowingWarning
== showWarning && !centerChanged) || !
Replication
.IsServer())
24
return
;
25
26
m_bShowingWarning
= showWarning;
27
28
if
(showWarning)
29
Rpc
(
ShowWarningOwner
, showWarning, warningType, zoneCenter, warningRadiusSq, zoneRadiusSq);
30
else
31
Rpc
(
HideWarningOwner
);
32
}
33
34
//------------------------------------------------------------------------------------------------
35
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Owner)]
36
protected
void
HideWarningOwner
()
37
{
38
if
(
m_WarningHUD
)
39
m_WarningHUD
.ShowZoneWarning(
false
, -1,
vector
.Zero, -1, -1);
40
}
41
42
//------------------------------------------------------------------------------------------------
43
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Owner)]
44
protected
void
ShowWarningOwner
(
bool
showWarning,
ERestrictionZoneWarningType
warningType,
vector
zoneCenter,
float
warningRadiusSq,
float
zoneRadiusSq)
45
{
46
if
(
m_WarningHUD
)
47
m_WarningHUD
.ShowZoneWarning(showWarning, warningType, zoneCenter, warningRadiusSq, zoneRadiusSq);
48
}
49
50
//------------------------------------------------------------------------------------------------
51
override
void
EOnInit
(
IEntity
owner)
52
{
53
SCR_HUDManagerComponent
hudManager =
SCR_HUDManagerComponent
.Cast(owner.
FindComponent
(
SCR_HUDManagerComponent
));
54
if
(hudManager)
55
{
56
array<BaseInfoDisplay> infoDisplays =
new
array<BaseInfoDisplay>;
57
int
count = hudManager.GetInfoDisplays(infoDisplays);
58
59
for
(
int
i = 0; i < count; i++)
60
{
61
if
(infoDisplays[i].
Type
() ==
SCR_RestrictionZoneWarningHUDComponent
)
62
{
63
m_WarningHUD
=
SCR_RestrictionZoneWarningHUDComponent
.Cast(infoDisplays[i]);
64
if
(
m_WarningHUD
)
65
break
;
66
}
67
}
68
}
69
}
70
71
//------------------------------------------------------------------------------------------------
72
override
void
OnPostInit
(
IEntity
owner)
73
{
74
SetEventMask
(owner,
EntityEvent
.INIT);
75
}
76
}
ERestrictionZoneWarningType
ERestrictionZoneWarningType
Definition
ERestrictionZoneWarningType.c:5
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
ShowWarningServer
void ShowWarningServer(bool showWarning, ERestrictionZoneWarningType warningType, bool centerChanged, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:21
HideWarningOwner
void HideWarningOwner()
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:36
m_fWarningEffectStrenghtPerc
float m_fWarningEffectStrenghtPerc
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:10
m_bShowingWarning
bool m_bShowingWarning
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:9
m_WarningHUD
SCR_PlayerRestrictionZoneWarningComponentClass m_WarningHUD
ShowWarningOwner
void ShowWarningOwner(bool showWarning, ERestrictionZoneWarningType warningType, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:44
m_fWarningEffectStrenghtLookAtPerc
float m_fWarningEffectStrenghtLookAtPerc
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:11
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Type
int Type
Definition
ScriptCamera.c:17
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
GenericComponent::Rpc
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Replication
Main replication API.
Definition
Replication.c:14
SCR_HUDManagerComponent
Definition
SCR_HUDManagerComponent.c:24
SCR_PlayerRestrictionZoneWarningComponentClass
Definition
SCR_PlayerRestrictionZoneWarningComponent.c:3
SCR_RestrictionZoneWarningHUDComponent
Definition
SCR_RestrictionZoneWarningHUDComponent.c:2
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
vector
Definition
vector.c:13
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
Components
SCR_PlayerRestrictionZoneWarningComponent.c
Generated by
1.17.0