Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerRestrictionZoneWarningComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/Misc", description: "")]
3 {
4 }
5 
6 class SCR_PlayerRestrictionZoneWarningComponent : ScriptComponent
7 {
9  protected bool m_bShowingWarning;
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  {
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 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_HUDManagerComponent
Definition: SCR_HUDManagerComponent.c:23
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
m_fWarningEffectStrenghtPerc
protected float m_fWarningEffectStrenghtPerc
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:10
m_bShowingWarning
protected bool m_bShowingWarning
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:9
RplRpc
SCR_AchievementsHandlerClass ScriptComponentClass RplRpc(RplChannel.Reliable, RplRcver.Owner)] void UnlockOnClient(AchievementId achievement)
Definition: SCR_AchievementsHandler.c:11
HideWarningOwner
protected void HideWarningOwner()
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:36
m_WarningHUD
SCR_PlayerRestrictionZoneWarningComponentClass m_WarningHUD
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:72
m_fWarningEffectStrenghtLookAtPerc
protected float m_fWarningEffectStrenghtLookAtPerc
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:11
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:51
ShowWarningOwner
protected void ShowWarningOwner(bool showWarning, ERestrictionZoneWarningType warningType, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:44
SCR_PlayerRestrictionZoneWarningComponentClass
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:2
ERestrictionZoneWarningType
ERestrictionZoneWarningType
Definition: ERestrictionZoneWarningType.c:4
SCR_RestrictionZoneWarningHUDComponent
Definition: SCR_RestrictionZoneWarningHUDComponent.c:1
ShowWarningServer
void ShowWarningServer(bool showWarning, ERestrictionZoneWarningType warningType, bool centerChanged, vector zoneCenter, float warningRadiusSq, float zoneRadiusSq)
Definition: SCR_PlayerRestrictionZoneWarningComponent.c:21
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180