11 protected int m_PlayerID;
13 const float SL_UPDATE_DELAY = 1;
14 const float ASPECT_RATIO_FLAG = 1.45;
15 const int SIZE_FLAG = 56;
17 bool m_bDoGroupTextUpdate;
18 protected bool m_bDoGroupSymbolUpdate;
25 void OnPlayerIdUpdate()
27 PlayerController pController =
GetGame().GetPlayerController();
31 if (m_PlayerID == pController.GetPlayerId())
32 SetLocalVisible(
false);
35 SetLocalVisible(
true);
49 if (!System.IsConsoleApp())
60 m_bDoGroupTextUpdate =
true;
76 m_Group = comp.GetPlayerGroup(m_PlayerID);
87 IEntity ent =
GetGame().GetPlayerManager().GetPlayerControlledEntity(m_PlayerID);
91 if (!charController.IsDead())
94 SetGlobalVisible(
true);
101 SetGlobalVisible(
false);
114 string company, platoon, squad, character, format;
115 m_Group.GetCallsigns(company, platoon, squad, character, format);
120 string flag =
m_Group.GetGroupFlag();
121 if (flag ==
string.Empty)
122 flag = faction.GetFlagName(0);
124 SetImage(faction.GetGroupFlagImageSet(), flag);
127 if (m_SquadLeaderWidgetComp)
128 m_SquadLeaderWidgetComp.SetImage(m_sImageset, m_sIconName, ASPECT_RATIO_FLAG, SIZE_FLAG);
131 m_bDoGroupSymbolUpdate =
false;
144 string customName =
m_Group.GetCustomName();
145 if (customName !=
string.Empty)
149 string company, platoon, squad, character, format;
150 m_Group.GetCallsigns(company, platoon, squad, character, format);
152 SetText(WidgetManager.Translate(format, company, platoon, squad, character));
155 if (m_SquadLeaderWidgetComp)
156 m_SquadLeaderWidgetComp.SetText(
m_sText);
158 m_bDoGroupTextUpdate =
false;
169 m_SquadLeaderWidgetComp.SetGroupActive(
true,
m_Group.GetFactionName());
171 m_SquadLeaderWidgetComp.SetGroupActive(
false);
178 m_bDoGroupTextUpdate =
true;
186 m_bDoGroupSymbolUpdate =
true;
194 super.OnMapLayerChanged(layerID);
196 if (m_SquadLeaderWidgetComp)
197 m_SquadLeaderWidgetComp.SetLayerID(layerID);
203 RplComponent rplComp = RplComponent.Cast(FindComponent(RplComponent));
204 if (rplComp.IsOwner())
206 IEntity ent =
GetGame().GetPlayerManager().GetPlayerControlledEntity(m_PlayerID);
213 if (!localFaction || localFaction.IsFactionEnemy(markerFaction))
216 super.OnCreateMarker();
218 m_bDoGroupSymbolUpdate =
true;
219 m_bDoGroupTextUpdate =
true;
244 if (m_bDoGroupSymbolUpdate)
247 if (m_bDoGroupTextUpdate)
250 if (m_SquadLeaderWidgetComp.m_bIsHovered)
251 m_SquadLeaderWidgetComp.UpdateGroupInfoPosition(m_iScreenX, m_iScreenY);
255 override protected void EOnInit(IEntity owner)
257 super.EOnInit(owner);