Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseLockComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Components", description: "Base lock component.")]
2 class SCR_BaseLockComponentClass : ScriptComponentClass
3 {
4 }
5 
6 class SCR_BaseLockComponent : ScriptComponent
7 {
8  private SCR_VehicleSpawnProtectionComponent m_pVehicleSpawnProtection
9 
10  //------------------------------------------------------------------------------------------------
11  override void OnPostInit(IEntity owner)
12  {
13  SetEventMask(owner, EntityEvent.INIT);
14  }
15 
16  //------------------------------------------------------------------------------------------------
17  override void EOnInit(IEntity owner)
18  {
19  m_pVehicleSpawnProtection = SCR_VehicleSpawnProtectionComponent.Cast(owner.FindComponent(SCR_VehicleSpawnProtectionComponent));
20  ClearEventMask(owner, EntityEvent.INIT);
21  }
22 
23  //------------------------------------------------------------------------------------------------
27  {
28  if (user && m_pVehicleSpawnProtection)
29  return m_pVehicleSpawnProtection.GetReasonText(user);
30 
31  return string.Empty;
32  }
33 
34  //------------------------------------------------------------------------------------------------
39  bool IsLocked(IEntity user, BaseCompartmentSlot compartmentSlot)
40  {
41  if (!user || !compartmentSlot)
42  return false;
43 
44  if (m_pVehicleSpawnProtection)
45  return m_pVehicleSpawnProtection.IsProtected(user, compartmentSlot);
46 
47  return false;
48  }
49 }
SCR_BaseLockComponentClass
Definition: SCR_BaseLockComponent.c:2
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
OnPostInit
SCR_BaseLockComponentClass ScriptComponentClass OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_BaseLockComponent.c:11
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_BaseLockComponent.c:17
IsLocked
bool IsLocked(IEntity user, BaseCompartmentSlot compartmentSlot)
Definition: SCR_BaseLockComponent.c:39
GetCannotPerformReason
LocalizedString GetCannotPerformReason(IEntity user)
Definition: SCR_BaseLockComponent.c:26
LocalizedString
Definition: LocalizedString.c:21
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180