Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FactionHintTooltipDetail.c
Go to the documentation of this file.
3 {
4  [Attribute("Text")]
5  protected string m_sTextWidgetName;
6 
7  [Attribute("Seperator")]
8  protected string m_sSeperatorWidgetName;
9 
10  [Attribute("160")]
11  protected int m_iSeperatorAlpha;
12 
13  [Attribute("#AR-Editor_TooltipDetail_FactionTasks_Hint")]
14  protected LocalizedString m_TaskHintText;
15 
16  [Attribute("#AR-Editor_TooltipDetail_FactionSpawnPoint_Hint")]
17  protected LocalizedString m_SpawnPointHintText;
18 
19  protected RichTextWidget m_Text;
20  protected ImageWidget m_Seperator;
21  protected Widget m_self;
22 
23  //------------------------------------------------------------------------------------------------
24  override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
25  {
26  m_self = widget;
27 
28  SCR_BaseTaskManager taskManager = GetTaskManager();
29  if (!taskManager)
30  return false;
31 
32  m_Text = RichTextWidget.Cast(widget.FindAnyWidget(m_sTextWidgetName));
33  if (!m_Text)
34  return false;
35 
36  m_Text.SetText(string.Empty);
37 
38  SCR_DelegateFactionManagerComponent m_DelegateFactionManager = SCR_DelegateFactionManagerComponent.GetInstance();
39  if (!m_DelegateFactionManager)
40  return false;
41 
42  Faction faction = entity.GetFaction();
43  if (!faction)
44  return false;
45 
46  SCR_EditableFactionComponent editableFaction = m_DelegateFactionManager.GetFactionDelegate(faction);
47  if (!editableFaction)
48  return false;
49 
50  int spawnPointCount = editableFaction.GetFactionSpawnPointCount();
51  int taskCount = editableFaction.GetFactionTasksCount();
52 
53  m_Seperator = ImageWidget.Cast(widget.FindAnyWidget(m_sSeperatorWidgetName));
54  if (m_Seperator)
55  {
56  Color factionColor = faction.GetFactionColor();
57  m_Seperator.SetColor(new Color(factionColor.R(), factionColor.G(), factionColor.B(), m_iSeperatorAlpha));
58  }
59 
60  if (taskCount == 0)
61  m_Text.SetText(m_TaskHintText);
62 
63  if (spawnPointCount == 0)
64  {
65  if (taskCount == 0)
66  m_Text.SetText(m_Text.GetText() + "<br/><br/>");
67 
68  m_Text.SetText(m_Text.GetText() + m_SpawnPointHintText);
69  }
70 
71  return taskCount == 0 || spawnPointCount == 0;
72  }
73 }
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition: SCR_KeyBindingMenuConfig.c:113
Attribute
typedef Attribute
Post-process effect of scripted camera.
GetTaskManager
SCR_BaseTaskManager GetTaskManager()
Definition: SCR_BaseTaskManager.c:7
SCR_BaseTaskManager
Definition: SCR_BaseTaskManager.c:25
SCR_EntityTooltipDetail
Definition: SCR_EntityTooltipDetail.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
Faction
Definition: Faction.c:12
SCR_DelegateFactionManagerComponent
Definition: SCR_DelegateFactionManagerComponent.c:15
LocalizedString
Definition: LocalizedString.c:21
SCR_FactionHintTooltipDetail
Definition: SCR_FactionHintTooltipDetail.c:2
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