Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FactionTooltipDetail.c
Go to the documentation of this file.
3 {
4  [Attribute("#AR-Editor_TooltipDetail_FactionUnassigned_Name")]
5  protected LocalizedString m_sPlayerNoFactionName;
6 
7  protected TextWidget m_Text;
8  protected SCR_FactionManager m_FactionManager;
9 
10  //------------------------------------------------------------------------------------------------
11  override void UpdateDetail(SCR_EditableEntityComponent entity)
12  {
13  Faction faction = entity.GetFaction();
14 
15  if (!faction && m_FactionManager)
16  {
17  faction = m_FactionManager.GetPlayerFaction(entity.GetPlayerID());
18 
19  //Player has no faction assigned yet
20  if (!faction)
21  {
22  m_Text.SetText(m_sPlayerNoFactionName);
23  return;
24  }
25  }
26 
27  if (faction)
28  m_Text.SetText(faction.GetFactionName());
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
33  {
34  m_Text = TextWidget.Cast(widget);
35 
36  Faction faction = entity.GetFaction();
37  int playerID = -1;
38 
39  if (!faction)
40  {
41  playerID = entity.GetPlayerID();
42  m_FactionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
43  }
44 
45  return m_Text && (faction || (playerID > 0 && m_FactionManager));
46  }
47 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
BaseContainerCustomTitleField
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
Definition: SCR_KeyBindingMenuConfig.c:113
m_FactionManager
protected SCR_FactionManager m_FactionManager
Definition: SCR_NotificationSenderComponent.c:28
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EntityTooltipDetail
Definition: SCR_EntityTooltipDetail.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
Faction
Definition: Faction.c:12
SCR_FactionTooltipDetail
Definition: SCR_FactionTooltipDetail.c:2
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition: SCR_FactionManager.c:461
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