Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_HintSequenceComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
3{
4 [Attribute()]
6
7 //------------------------------------------------------------------------------------------------
13}
14
15class SCR_HintSequenceComponent : ScriptComponent
16{
17 protected bool m_bIsActive;
19
21 //--- Public functions
23
24 //------------------------------------------------------------------------------------------------
28 {
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 //------------------------------------------------------------------------------------------------
52 {
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 //------------------------------------------------------------------------------------------------
66 {
67 if (IsSequenceActive())
69 else
71 }
72
73 //------------------------------------------------------------------------------------------------
77 {
78 return m_bIsActive;
79 }
80
81 //------------------------------------------------------------------------------------------------
88
90 //--- Protected functions
92
93 //------------------------------------------------------------------------------------------------
94 protected void OnHintShow(SCR_HintUIInfo info, bool isSilent)
95 {
96 //--- Interrupted by unrelated hint
98 if (prefabData.GetSequence().FindHint(info) == -1)
99 Clear();
100 }
101
102 //------------------------------------------------------------------------------------------------
103 protected void OnHintHide(SCR_HintUIInfo info, bool isSilent)
104 {
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}
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void OnHintHide(SCR_HintUIInfo info, bool isSilent)
SCR_CharacterSoundComponentClass GetComponentData()
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
bool IsSequenceActive()
SCR_HintSequenceComponentClass m_bIsActive
void StopSequence()
bool StartSequence()
ScriptInvoker GetOnSequenceChange()
ref ScriptInvoker m_OnSequenceChange
void ToggleSequence()
void OnHintShow(SCR_HintUIInfo info, bool isSilent)
Definition Debug.c:13
int FindHint(SCR_HintUIInfo info)
SCR_HintUIInfo GetHint(int index)
proto external GenericEntity GetOwner()
Get owner entity.
SCR_FieldOfViewSettings Attribute
proto native void Clear()
Remove all calls from list.
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134