Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIStateTooltipDetail.c
Go to the documentation of this file.
3 {
4  [Attribute("")]
5  protected LocalizedString m_sFollowingOrderStateText;
6 
7  [Attribute("")]
8  protected LocalizedString m_sIdleStateText;
9 
10  [Attribute("")]
11  protected LocalizedString m_sAutonomousStateText;
12 
13  protected SCR_AIGroupInfoComponent m_GroupInfoComponent;
14  protected EGroupControlMode m_CurrentState;
15 
16  protected TextWidget m_Text;
17 
18  //protected TextWidget m_Text;
19  protected ProgressBarWidget m_Bar;
20 
21  //------------------------------------------------------------------------------------------------
22  override void UpdateDetail(SCR_EditableEntityComponent entity)
23  {
24  if (m_Text && m_GroupInfoComponent.GetGroupControlMode() != m_CurrentState)
25  SetAIStateText(m_GroupInfoComponent.GetGroupControlMode());
26  }
27 
28  //------------------------------------------------------------------------------------------------
29  protected void SetAIStateText(EGroupControlMode state)
30  {
31  m_CurrentState = state;
32 
33  if (m_CurrentState == EGroupControlMode.IDLE || m_CurrentState == EGroupControlMode.NONE)
34  {
35  m_Text.SetText(m_sIdleStateText);
36  return;
37  }
38  else if (m_CurrentState == EGroupControlMode.AUTONOMOUS)
39  {
40  m_Text.SetText(m_sAutonomousStateText);
41  return;
42  }
43  else if (m_CurrentState == EGroupControlMode.FOLLOWING_WAYPOINT)
44  {
45  m_Text.SetText(m_sFollowingOrderStateText);
46  return;
47  }
48  else
49  {
50  m_Text.SetText("DEBUG UNKNOWN STATE!");
51  Print(string.Format("AIStateTooltipDetail, EGroupControlMode %1 is an unsupported AI state", typename.EnumToString(EGroupControlMode, m_CurrentState)), LogLevel.NORMAL);
52  }
53  }
54 
55  //------------------------------------------------------------------------------------------------
56  override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
57  {
59  if (!group)
60  {
61  //If player return
62  if (entity.GetPlayerID() > 0)
63  return false;
64 
65  group = SCR_EditableGroupComponent.Cast(entity.GetParentEntity());
66 
67  if (!group)
68  return false;
69  }
70 
71  m_GroupInfoComponent = SCR_AIGroupInfoComponent.Cast(group.GetOwner().FindComponent(SCR_AIGroupInfoComponent));
72  if (!m_GroupInfoComponent)
73  return false;
74 
75  m_Text = TextWidget.Cast(widget);
76  if (!m_Text)
77  return false;
78 
79  SetAIStateText( m_GroupInfoComponent.GetGroupControlMode());
80 
81  return true;
82  }
83 }
SCR_EditableGroupComponent
void SCR_EditableGroupComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_EditableGroupComponent.c:703
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition: SCR_KeyBindingMenuConfig.c:113
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EntityTooltipDetail
Definition: SCR_EntityTooltipDetail.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_AIStateTooltipDetail
Definition: SCR_AIStateTooltipDetail.c:2
LocalizedString
Definition: LocalizedString.c:21
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