Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FactionTooltipDetail.c
Go to the documentation of this file.
3{
4 [Attribute("#AR-Editor_TooltipDetail_FactionUnassigned_Name")]
6
7 protected TextWidget m_Text;
9
10 //------------------------------------------------------------------------------------------------
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 {
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}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_FactionManager(IEntitySource src, IEntity parent)
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
override void UpdateDetail(SCR_EditableEntityComponent entity)
override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
SCR_FieldOfViewSettings Attribute