Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 
86 class 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;
94 
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 }
SCR_BaseHintCondition
Definition: SCR_BaseHintCondition.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_Info
protected ref SCR_HintUIInfo m_Info
Definition: SCR_BaseHintCondition.c:3
SCR_HintUIInfo
Definition: SCR_HintUIInfo.c:2
m_bInit
protected bool m_bInit
Definition: SCR_BaseHintCondition.c:5
_WB_GetCustomTitle
class SCR_BaseHintCondition _WB_GetCustomTitle(BaseContainer source, out string title)
Definition: SCR_BaseHintCondition.c:89
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
EHint
EHint
Definition: EHint.c:10
m_Owner
SCR_AIGroupUtilityComponentClass m_Owner
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468