Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseLockComponent.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/Components", description: "Base lock component.")]
5
6class SCR_BaseLockComponent : ScriptComponent
7{
8 protected SCR_VehicleSpawnProtectionComponent m_pVehicleSpawnProtection;
9
10 [Attribute()]
11 protected bool m_bIsLocked;
12
13 //------------------------------------------------------------------------------------------------
14 void SetLocked(bool locked)
15 {
16 m_bIsLocked = locked;
17 }
18
19 //------------------------------------------------------------------------------------------------
20 override void OnPostInit(IEntity owner)
21 {
22 SetEventMask(owner, EntityEvent.INIT);
23 }
24
25 //------------------------------------------------------------------------------------------------
26 override void EOnInit(IEntity owner)
27 {
28 m_pVehicleSpawnProtection = SCR_VehicleSpawnProtectionComponent.Cast(owner.FindComponent(SCR_VehicleSpawnProtectionComponent));
29 ClearEventMask(owner, EntityEvent.INIT);
30 }
31
32 //------------------------------------------------------------------------------------------------
36 {
37 if (user && m_pVehicleSpawnProtection)
38 return m_pVehicleSpawnProtection.GetReasonText(user);
39
40 return string.Empty;
41 }
42
43 //------------------------------------------------------------------------------------------------
48 bool IsLocked(IEntity user, BaseCompartmentSlot compartmentSlot)
49 {
50 if (m_bIsLocked)
51 return true;
52
53 if (!user || !compartmentSlot)
54 return false;
55
57 return m_pVehicleSpawnProtection.IsProtected(user, compartmentSlot);
58
59 return false;
60 }
61}
void SetLocked(bool locked)
bool m_bIsLocked
SCR_BaseLockComponentClass m_pVehicleSpawnProtection
LocalizedString GetCannotPerformReason(IEntity user)
bool IsLocked(IEntity user, BaseCompartmentSlot compartmentSlot)
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
proto external int ClearEventMask(notnull IEntity owner, int mask)
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external Managed FindComponent(typename typeName)
void EOnInit(IEntity owner)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14