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_HintSequenceComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Misc"
, description:
""
)]
2
class
SCR_HintSequenceComponentClass
:
ScriptComponentClass
3
{
4
[
Attribute
()]
5
protected
ref
SCR_HintSequenceList
m_Sequence
;
6
7
//------------------------------------------------------------------------------------------------
9
SCR_HintSequenceList
GetSequence
()
10
{
11
return
m_Sequence
;
12
}
13
}
14
15
class
SCR_HintSequenceComponent :
ScriptComponent
16
{
17
protected
bool
m_bIsActive
;
18
protected
ref
ScriptInvoker
m_OnSequenceChange
=
new
ScriptInvoker
;
19
21
//--- Public functions
23
24
//------------------------------------------------------------------------------------------------
27
bool
StartSequence
()
28
{
29
SCR_HintSequenceComponentClass
prefabData =
SCR_HintSequenceComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
30
if
(!prefabData.
GetSequence
())
31
{
32
Debug
.Error(
"No sequence defined!"
);
33
return
false
;
34
}
35
36
SCR_HintManagerComponent hintManager = SCR_HintManagerComponent.GetInstance();
37
if
(!hintManager || !hintManager.Show(prefabData.
GetSequence
().
GetHint
(0), ignoreShown:
true
))
38
return
false
;
39
40
m_bIsActive
=
true
;
41
42
hintManager.GetOnHintShow().Insert(
OnHintShow
);
43
hintManager.GetOnHintHide().Insert(
OnHintHide
);
44
m_OnSequenceChange
.Invoke(
true
);
45
return
true
;
46
}
47
48
//------------------------------------------------------------------------------------------------
51
void
StopSequence
()
52
{
53
SCR_HintSequenceComponentClass
prefabData =
SCR_HintSequenceComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
54
SCR_HintManagerComponent hintManager = SCR_HintManagerComponent.GetInstance();
55
if
(hintManager && prefabData.
GetSequence
().
FindHint
(hintManager.GetCurrentHint()) != -1)
56
{
57
Clear
();
58
hintManager.Hide();
59
}
60
}
61
62
//------------------------------------------------------------------------------------------------
65
void
ToggleSequence
()
66
{
67
if
(
IsSequenceActive
())
68
StopSequence
();
69
else
70
StartSequence
();
71
}
72
73
//------------------------------------------------------------------------------------------------
76
bool
IsSequenceActive
()
77
{
78
return
m_bIsActive
;
79
}
80
81
//------------------------------------------------------------------------------------------------
84
ScriptInvoker
GetOnSequenceChange
()
85
{
86
return
m_OnSequenceChange
;
87
}
88
90
//--- Protected functions
92
93
//------------------------------------------------------------------------------------------------
94
protected
void
OnHintShow
(
SCR_HintUIInfo
info,
bool
isSilent)
95
{
96
//--- Interrupted by unrelated hint
97
SCR_HintSequenceComponentClass
prefabData =
SCR_HintSequenceComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
98
if
(prefabData.
GetSequence
().
FindHint
(info) == -1)
99
Clear
();
100
}
101
102
//------------------------------------------------------------------------------------------------
103
protected
void
OnHintHide
(
SCR_HintUIInfo
info,
bool
isSilent)
104
{
105
SCR_HintSequenceComponentClass
prefabData =
SCR_HintSequenceComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
106
int
index
= prefabData.
GetSequence
().
FindHint
(info);
107
if
(
index
>= 0 &&
index
< prefabData.
GetSequence
().
CountHints
() - 1)
108
{
109
SCR_HintManagerComponent.ShowHint(prefabData.
GetSequence
().
GetHint
(
index
+ 1), ignoreShown:
true
);
110
}
111
else
112
{
113
//--- Last hint, terminate
114
Clear
();
115
}
116
}
117
118
//------------------------------------------------------------------------------------------------
119
protected
void
Clear
()
120
{
121
m_bIsActive
=
false
;
122
123
SCR_HintManagerComponent hintManager = SCR_HintManagerComponent.GetInstance();
124
hintManager.GetOnHintShow().Remove(
OnHintShow
);
125
hintManager.GetOnHintHide().Remove(
OnHintHide
);
126
127
m_OnSequenceChange
.Invoke(
false
);
128
}
129
}
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
OnHintHide
void OnHintHide(SCR_HintUIInfo info, bool isSilent)
Definition
SCR_CampaignFeedbackComponent.c:2295
GetComponentData
SCR_CharacterSoundComponentClass GetComponentData()
Definition
SCR_CharacterSoundComponent.c:132
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
IsSequenceActive
bool IsSequenceActive()
Definition
SCR_HintSequenceComponent.c:76
m_bIsActive
SCR_HintSequenceComponentClass m_bIsActive
StopSequence
void StopSequence()
Definition
SCR_HintSequenceComponent.c:51
StartSequence
bool StartSequence()
Definition
SCR_HintSequenceComponent.c:27
GetOnSequenceChange
ScriptInvoker GetOnSequenceChange()
Definition
SCR_HintSequenceComponent.c:84
m_OnSequenceChange
ref ScriptInvoker m_OnSequenceChange
Definition
SCR_HintSequenceComponent.c:18
ToggleSequence
void ToggleSequence()
Definition
SCR_HintSequenceComponent.c:65
OnHintShow
void OnHintShow(SCR_HintUIInfo info, bool isSilent)
Definition
SCR_HintSequenceComponent.c:94
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Debug
Definition
Debug.c:13
SCR_HintSequenceComponentClass
Definition
SCR_HintSequenceComponent.c:3
SCR_HintSequenceComponentClass::m_Sequence
ref SCR_HintSequenceList m_Sequence
Definition
SCR_HintSequenceComponent.c:5
SCR_HintSequenceComponentClass::GetSequence
SCR_HintSequenceList GetSequence()
Definition
SCR_HintSequenceComponent.c:9
SCR_HintSequenceList
Definition
SCR_HintSequenceList.c:3
SCR_HintSequenceList::CountHints
int CountHints()
Definition
SCR_HintSequenceList.c:19
SCR_HintSequenceList::FindHint
int FindHint(SCR_HintUIInfo info)
Definition
SCR_HintSequenceList.c:11
SCR_HintSequenceList::GetHint
SCR_HintUIInfo GetHint(int index)
Definition
SCR_HintSequenceList.c:27
SCR_HintUIInfo
Definition
SCR_HintUIInfo.c:3
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
Clear
proto native void Clear()
Remove all calls from list.
Definition
SCR_HintSequenceComponent.c:119
ScriptInvoker
ScriptInvokerBase< func > ScriptInvoker
Definition
tools.c:134
scripts
Game
Components
Hints
SCR_HintSequenceComponent.c
Generated by
1.17.0