Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseHintCondition.c
Go to the documentation of this file.
1[BaseContainerProps(), SCR_BaseContainerHintCondition()]
3{
4 [Attribute()]
5 protected ref SCR_HintUIInfo m_Info;
6
7 protected bool m_bInit;
8 protected Managed m_Owner;
9
10 //------------------------------------------------------------------------------------------------
11 protected void Activate()
12 {
13 SCR_HintManagerComponent hintManager = SCR_HintManagerComponent.GetInstance();
14 if (!hintManager)
15 return;
16
17 if (!hintManager.WasShown(m_Info))
18 {
19 //--- Call with delay, so other invoker listeners which may have reacted to the same event have time to react first
20 GetGame().GetCallqueue().CallLater(SCR_HintManagerComponent.ShowHint, 1, false, m_Info, false, false);
21 }
22 else
23 {
24 ExitCondition(m_Owner, hintManager);
25 }
26 }
27
28 //------------------------------------------------------------------------------------------------
29 protected void Deactivate()
30 {
31 SCR_HintManagerComponent hintManager = SCR_HintManagerComponent.GetInstance();
32 if (!hintManager)
33 return;
34
35 hintManager.Hide(m_Info);
36
37 //--- Stop tracking
38 if (hintManager.WasShown(m_Info))
39 ExitCondition(m_Owner, hintManager);
40 }
41
42 //------------------------------------------------------------------------------------------------
46 void InitCondition(Managed owner, SCR_HintManagerComponent hintManager)
47 {
48 if (!hintManager.WasShown(m_Info))
49 {
50 m_bInit = true;
51 m_Owner = owner;
52 OnInitCondition(owner);
53 }
54 }
55
56 //------------------------------------------------------------------------------------------------
60 void ExitCondition(Managed owner, SCR_HintManagerComponent hintManager)
61 {
62 if (m_bInit)
63 {
64 m_bInit = false;
65 OnExitCondition(owner);
66 }
67 }
68
69 //------------------------------------------------------------------------------------------------
70 protected void OnInitCondition(Managed owner);
71
72 //------------------------------------------------------------------------------------------------
73 protected void OnExitCondition(Managed owner);
74
75 //------------------------------------------------------------------------------------------------
76 // constructor
78 {
79 if (m_Info && m_Info.GetType() == -1)
80 {
81 m_Info.Log("Cannot initialize hint condition, hint type is undefined! ", LogLevel.WARNING);
82 }
83 }
84}
85
86class SCR_BaseContainerHintCondition : BaseContainerCustomTitle
87{
88 //------------------------------------------------------------------------------------------------
89 override bool _WB_GetCustomTitle(BaseContainer source, out string title)
90 {
91 BaseContainer info = source.GetObject("m_Info");
92 if (!info)
93 return false;
95 EHint type;
96 info.Get("m_Type", type);
97 title = typename.EnumToString(EHint, type);
98
99 if (type == 0)
100 {
101 string name;
102 info.Get("Name", name);
103 title += string.Format(" (\"%1\")", name);
104 }
105
106 return true;
107 }
108}
EHint
Definition EHint.c:11
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EDamageType type
void OnExitCondition(Managed owner)
void ExitCondition(Managed owner, SCR_HintManagerComponent hintManager)
ref SCR_HintUIInfo m_Info
void OnInitCondition(Managed owner)
void InitCondition(Managed owner, SCR_HintManagerComponent hintManager)
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
class SCR_BaseManualCameraComponent _WB_GetCustomTitle(BaseContainer source, out string title)