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_ClockHandComponent.c
Go to the documentation of this file.
1
#define ENABLE_BASE_DESTRUCTION
2
[
EntityEditorProps
(
category
:
"Components/SCR_ClockHandComponentClass"
, description:
"Component handlinng move of clock hands."
)]
3
class
SCR_ClockHandComponentClass
:
ScriptComponentClass
4
{
5
}
6
7
class
SCR_ClockHandComponent :
ScriptComponent
8
{
9
private
TimeAndWeatherManagerEntity
m_TimeManager
;
10
private
SignalsManagerComponent
m_SignalManager
;
11
private
SCR_DestructionMultiPhaseComponent m_MultiPhaseDestComp;
12
private
int
m_iClockSignalIndex;
13
14
//------------------------------------------------------------------------------------------------
15
override
void
OnPostInit
(
IEntity
owner)
16
{
17
SetEventMask
(owner,
EntityEvent
.INIT);
18
}
19
20
//------------------------------------------------------------------------------------------------
21
override
void
EOnInit
(
IEntity
owner)
22
{
23
ChimeraWorld world = ChimeraWorld.CastFrom(owner.
GetWorld
());
24
if
(!world)
25
return
;
26
27
m_TimeManager
= world.GetTimeAndWeatherManager();
28
if
(!
m_TimeManager
)
29
return
;
30
31
m_SignalManager
= SignalsManagerComponent.Cast(owner.
FindComponent
(SignalsManagerComponent));
32
if
(!
m_SignalManager
)
33
return
;
34
35
m_iClockSignalIndex =
m_SignalManager
.AddOrFindSignal(
"ClockHand"
);
36
m_MultiPhaseDestComp = SCR_DestructionMultiPhaseComponent.Cast(owner.
FindComponent
(SCR_DestructionMultiPhaseComponent));
37
38
if
(m_iClockSignalIndex != -1)
39
GetGame
().GetCallqueue().CallLater(ClockHandStep, 1000,
true
);
40
41
ClearEventMask
(owner,
EntityEvent
.INIT);
42
}
43
44
//------------------------------------------------------------------------------------------------
46
void
ClockHandStep()
47
{
48
#ifdef ENABLE_BASE_DESTRUCTION
49
if
(m_MultiPhaseDestComp && m_MultiPhaseDestComp.GetDestroyed())
50
GetGame
().GetCallqueue().Remove(ClockHandStep);
51
#endif
52
53
m_SignalManager
.SetSignalValue(m_iClockSignalIndex,
m_TimeManager
.GetTimeOfTheDay());
54
}
55
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_TimeManager
SCR_ClockHandComponentClass m_TimeManager
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
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
m_SignalManager
SignalsManagerComponent m_SignalManager
Definition
SCR_WristwatchComponent.c:55
IEntity
enum EVehicleType IEntity
GenericComponent::ClearEventMask
proto external int ClearEventMask(notnull IEntity owner, int mask)
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetWorld
proto external BaseWorld GetWorld()
SCR_ClockHandComponentClass
Definition
SCR_ClockHandComponent.c:4
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
SignalsManagerComponent
Definition
SignalsManagerComponent.c:13
TimeAndWeatherManagerEntity
Definition
TimeAndWeatherManagerEntity.c:26
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
Components
SCR_ClockHandComponent.c
Generated by
1.17.0