Example #1
0
 public void UpdateHud(bool showMyself = false)
 {
     if ((!Game.IsDedicated && !MyHud.MinimalHud) && !MyHud.CutsceneHud)
     {
         this.Clear();
         foreach (MyDataBroadcaster broadcaster in MyAntennaSystem.Static.GetAllRelayedBroadcasters(this, MySession.Static.LocalPlayerId, false, null))
         {
             bool       allowBlink    = broadcaster.CanBeUsedByPlayer(MySession.Static.LocalPlayerId);
             MyCubeGrid topMostParent = broadcaster.Entity.GetTopMostParent(null) as MyCubeGrid;
             if (topMostParent != null)
             {
                 MyGroups <MyCubeGrid, MyGridLogicalGroupData> .Group group = MyCubeGridGroups.Static.Logical.GetGroup(topMostParent);
                 if (group != null)
                 {
                     MyGridLogicalGroupData groupData = group.GroupData;
                     this.m_broadcastersInRange_TopGrids.Add(groupData);
                 }
             }
             if (broadcaster.ShowOnHud)
             {
                 foreach (MyHudEntityParams @params in broadcaster.GetHudParams(allowBlink))
                 {
                     if (this.m_entitiesOnHud.Contains(@params.EntityId))
                     {
                         continue;
                     }
                     this.m_entitiesOnHud.Add(@params.EntityId);
                     if (@params.BlinkingTime > 0f)
                     {
                         MyHud.HackingMarkers.RegisterMarker(@params.EntityId, @params);
                         continue;
                     }
                     if (!MyHud.HackingMarkers.MarkerEntities.ContainsKey(@params.EntityId))
                     {
                         MyHud.LocationMarkers.RegisterMarker(@params.EntityId, @params);
                     }
                 }
             }
         }
         if (MySession.Static.AdminSettings.HasFlag(AdminSettingsEnum.ShowPlayers))
         {
             using (IEnumerator <MyPlayer> enumerator3 = MySession.Static.Players.GetOnlinePlayers().GetEnumerator())
             {
                 while (enumerator3.MoveNext())
                 {
                     MyCharacter character = enumerator3.Current.Character;
                     if (character != null)
                     {
                         foreach (MyHudEntityParams params2 in character.GetHudParams(false))
                         {
                             if (!this.m_entitiesOnHud.Contains(params2.EntityId))
                             {
                                 this.m_entitiesOnHud.Add(params2.EntityId);
                                 MyHud.LocationMarkers.RegisterMarker(params2.EntityId, params2);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
 public bool HasAccessToLogicalGroup(MyGridLogicalGroupData group) =>
 this.m_broadcastersInRange_TopGrids.Contains(group);