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_MineWeaponComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/ScriptWizard"
, description:
""
)]
2
class
SCR_MineWeaponComponentClass
:
WeaponComponentClass
3
{
4
}
5
6
class
SCR_MineWeaponComponent :
WeaponComponent
7
{
8
[
RplProp
(onRplName:
"OnFlagEntitySync"
)]
9
protected
RplId
m_FlagEntityId =
RplId
.Invalid();
10
11
protected
IEntity
m_FlagEntity;
12
13
//------------------------------------------------------------------------------------------------
14
bool
IsFlagged()
15
{
16
return
m_FlagEntity != null;
17
}
18
19
//------------------------------------------------------------------------------------------------
20
IEntity
GetFlagEntity
()
21
{
22
return
m_FlagEntity;
23
}
24
25
//------------------------------------------------------------------------------------------------
26
protected
void
OnFlagParentSlotChanged
(
InventoryStorageSlot
oldSlot,
InventoryStorageSlot
newSlot)
27
{
28
InventoryItemComponent
itemComponent =
InventoryItemComponent
.Cast(m_FlagEntity.
FindComponent
(
InventoryItemComponent
));
29
if
(itemComponent)
30
itemComponent.m_OnParentSlotChangedInvoker.Remove(
OnFlagParentSlotChanged
);
31
32
m_FlagEntity = null;
33
m_FlagEntityId =
RplId
.Invalid();
34
Replication
.BumpMe();
35
}
36
37
//------------------------------------------------------------------------------------------------
39
void
SetFlag
(
IEntity
flag)
40
{
41
if
(m_FlagEntity || !flag)
42
return
;
// This should never happen!
43
44
InventoryItemComponent
itemComponent =
InventoryItemComponent
.Cast(flag.
FindComponent
(
InventoryItemComponent
));
45
if
(itemComponent)
46
itemComponent.m_OnParentSlotChangedInvoker.Insert(
OnFlagParentSlotChanged
);
47
48
m_FlagEntity = flag;
49
50
RplComponent rpl = RplComponent.Cast(flag.
FindComponent
(RplComponent));
51
if
(rpl)
52
m_FlagEntityId = rpl.Id();
53
54
Replication
.BumpMe();
55
}
56
57
//------------------------------------------------------------------------------------------------
58
protected
void
OnFlagEntitySync
()
59
{
60
const
RplComponent rpl = RplComponent.Cast(
Replication
.FindItem(m_FlagEntityId));
61
if
(rpl)
62
m_FlagEntity = rpl.GetEntity();
63
else
64
m_FlagEntity = null;
65
}
66
}
RplProp
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
GetFlagEntity
IEntity GetFlagEntity()
Definition
SCR_FlagComponent.c:91
OnFlagEntitySync
void OnFlagEntitySync()
Definition
SCR_MineWeaponComponent.c:58
SetFlag
void SetFlag(IEntity flag)
Call only on server!
Definition
SCR_MineWeaponComponent.c:39
OnFlagParentSlotChanged
void OnFlagParentSlotChanged(InventoryStorageSlot oldSlot, InventoryStorageSlot newSlot)
Definition
SCR_MineWeaponComponent.c:26
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
InventoryItemComponent
Definition
InventoryItemComponent.c:13
InventoryStorageSlot
Definition
InventoryStorageSlot.c:13
Replication
Main replication API.
Definition
Replication.c:14
RplId
Replication item identifier.
Definition
RplId.c:14
SCR_MineWeaponComponentClass
Definition
SCR_MineWeaponComponent.c:3
WeaponComponentClass
Definition
WeaponComponentClass.c:13
WeaponComponent
Definition
WeaponComponent.c:13
scripts
Game
Weapon
SCR_MineWeaponComponent.c
Generated by
1.17.0