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_CampaignMHQLockComponent.c
Go to the documentation of this file.
1
class
SCR_CampaignMHQLockComponentClass
:
SCR_BaseLockComponentClass
2
{
3
}
4
5
class
SCR_CampaignMHQLockComponent : SCR_BaseLockComponent
6
{
7
protected
SCR_CampaignMobileAssemblyComponent
m_MHQComponent
;
8
9
//------------------------------------------------------------------------------------------------
11
SCR_CampaignMobileAssemblyComponent
GetMHQComponent
()
12
{
13
if
(
m_MHQComponent
)
14
return
m_MHQComponent
;
15
16
SlotManagerComponent slotManager = SlotManagerComponent.Cast(
GetOwner
().FindComponent(SlotManagerComponent));
17
18
if
(!slotManager)
19
return
null;
20
21
array<EntitySlotInfo> slots = {};
22
slotManager.GetSlotInfos(slots);
23
24
foreach
(
EntitySlotInfo
slot : slots)
25
{
26
if
(!slot)
27
continue
;
28
29
IEntity
truckBed = slot.GetAttachedEntity();
30
31
if
(!truckBed)
32
continue
;
33
34
m_MHQComponent
= SCR_CampaignMobileAssemblyComponent.Cast(truckBed.
FindComponent
(SCR_CampaignMobileAssemblyComponent));
35
36
if
(
m_MHQComponent
)
37
break
;
38
}
39
40
return
m_MHQComponent
;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
LocalizedString
GetCannotPerformReason
(
IEntity
user)
45
{
46
SCR_CampaignMobileAssemblyComponent comp =
GetMHQComponent
();
47
48
if
(comp && comp.IsDeployed())
49
return
"#AR-Campaign_MobileAssemblyDeployed-UC"
;
50
else
51
return
super.GetCannotPerformReason(user);
52
}
53
54
//------------------------------------------------------------------------------------------------
55
override
bool
IsLocked
(
IEntity
user,
BaseCompartmentSlot
compartmentSlot)
56
{
57
if
(super.IsLocked(user, compartmentSlot))
58
return
true
;
59
60
SCR_CampaignMobileAssemblyComponent comp =
GetMHQComponent
();
61
62
if
(comp)
63
return
comp.IsDeployed();
64
65
return
false
;
66
}
67
}
GetCannotPerformReason
LocalizedString GetCannotPerformReason(IEntity user)
Definition
SCR_BaseLockComponent.c:35
IsLocked
bool IsLocked(IEntity user, BaseCompartmentSlot compartmentSlot)
Definition
SCR_BaseLockComponent.c:48
GetMHQComponent
SCR_CampaignMobileAssemblyComponent GetMHQComponent()
Definition
SCR_CampaignMHQLockComponent.c:11
m_MHQComponent
SCR_CampaignMHQLockComponentClass m_MHQComponent
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
EntitySlotInfo
Adds ability to attach an object to a slot.
Definition
EntitySlotInfo.c:9
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
LocalizedString
Definition
LocalizedString.c:22
SCR_BaseLockComponentClass
Definition
SCR_BaseLockComponent.c:3
SCR_CampaignMHQLockComponentClass
Definition
SCR_CampaignMHQLockComponent.c:2
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
scripts
Game
Components
SCR_CampaignMHQLockComponent.c
Generated by
1.17.0