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_EditableDecalComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/Editor (Editables)"
, description:
""
)]
2
class
SCR_EditableDecalComponentClass
:
SCR_EditableEntityComponentClass
3
{
4
}
5
7
18
class
SCR_EditableDecalComponent :
SCR_EditableEntityComponent
19
{
20
protected
DecalEntity
m_Decal
;
21
protected
vector
m_vDecalTransform
[4];
22
protected
float
m_vDecalScale
;
23
24
//------------------------------------------------------------------------------------------------
25
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Broadcast)]
26
override
protected
void
SetTransformBroadcast
(
vector
transform[4])
27
{
28
super.SetTransformBroadcast(transform);
29
30
if
(
m_Decal
)
31
{
32
//--- Create a new decal and delete the previous one, because moving existing decals is not possible
33
EntitySpawnParams
spawnParams =
new
EntitySpawnParams
();
34
spawnParams.Parent =
GetOwner
();
35
spawnParams.TransformMode = ETransformMode.LOCAL;
36
spawnParams.Transform =
m_vDecalTransform
;
37
spawnParams.Scale =
m_vDecalScale
;
38
39
EntityPrefabData
decalPrefabData =
m_Decal
.GetPrefabData();
40
ResourceName
decalPrefab =
SCR_BaseContainerTools
.GetPrefabResourceName(decalPrefabData.GetPrefab());
41
DecalEntity newDecal = DecalEntity.Cast(
GetGame
().SpawnEntityPrefab(
Resource
.Load(decalPrefab),
GetOwner
().GetWorld(), spawnParams));
42
43
delete
m_Decal
;
44
m_Decal
= newDecal;
45
}
46
}
47
48
//------------------------------------------------------------------------------------------------
49
override
void
EOnInit
(
IEntity
owner)
50
{
51
m_Decal
= DecalEntity.Cast(owner.
GetChildren
());
52
if
(
m_Decal
)
53
{
54
m_Decal
.GetLocalTransform(
m_vDecalTransform
);
55
m_vDecalScale
= owner.
GetWorldTransformAxis
(0).Length() /
m_Decal
.GetScale();
56
}
57
else
58
{
59
Log
(
"No child of type DecalEntity found!"
,
true
,
LogLevel
.WARNING);
60
}
61
}
62
63
//------------------------------------------------------------------------------------------------
64
override
void
OnPostInit
(
IEntity
owner)
65
{
66
super.OnPostInit(owner);
67
SetEventMask
(owner,
EntityEvent
.INIT);
68
owner.
SetFlags
(
EntityFlags
.NO_LINK |
EntityFlags
.NO_TREE);
69
owner.
ClearFlags
(
EntityFlags
.TRACEABLE);
70
}
71
72
//------------------------------------------------------------------------------------------------
73
override
void
OnDelete
(
IEntity
owner)
74
{
75
super.OnDelete(owner);
76
delete
m_Decal
;
77
}
78
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
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
m_vDecalScale
float m_vDecalScale
Definition
SCR_EditableDecalComponent.c:22
m_vDecalTransform
vector m_vDecalTransform[4]
Definition
SCR_EditableDecalComponent.c:21
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Log
override void Log()
Definition
SCR_VotingBase.c:117
EntityPrefabData
Definition
EntityPrefabData.c:19
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
IEntity
Definition
IEntity.c:13
IEntity::GetWorldTransformAxis
proto external vector GetWorldTransformAxis(int axis)
See IEntity::GetTransformAxis.
IEntity::GetChildren
proto external IEntity GetChildren()
IEntity::SetFlags
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
IEntity::ClearFlags
proto external EntityFlags ClearFlags(EntityFlags flags, bool recursively=false)
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BaseContainerTools
Definition
SCR_BaseContainerTools.c:4
SCR_EditableDecalComponentClass
Definition
SCR_EditableDecalComponent.c:3
SCR_EditableEntityComponentClass
Definition
SCR_EditableEntityComponentClass.c:3
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditableEntityComponent::SetTransformBroadcast
void SetTransformBroadcast(vector transform[4])
Definition
SCR_EditableEntityComponent.c:751
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
vector
Definition
vector.c:13
EntitySpawnParams
void EntitySpawnParams()
Definition
gameLib.c:130
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
m_Decal
SCR_EditableDecalComponentClass m_Decal
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
EntityFlags
EntityFlags
Various entity flags.
Definition
EntityFlags.c:14
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
OnDelete
@ OnDelete
Definition
SndComponentCallbacks.c:16
scripts
Game
Editor
Components
EditableEntity
SCR_EditableDecalComponent.c
Generated by
1.17.0