private void addOtherPlayerIglooListing(DataEntityHandle handle, RoomPopulationScale scale)
 {
     if (!dataEntityCollection.TryGetComponent <IglooListingData>(handle, out var component))
     {
         component = dataEntityCollection.AddComponent <IglooListingData>(handle);
     }
     component.RoomPopulation = scale;
 }
        private void addOtherPlayerIglooListing(IglooListItem iglooListItem)
        {
            DataEntityHandle handle = PlayerDataEntityFactory.CreateRemotePlayerEntity(dataEntityCollection, iglooListItem.ownerData.name);

            if (!dataEntityCollection.TryGetComponent <IglooListingData>(handle, out var component))
            {
                component = dataEntityCollection.AddComponent <IglooListingData>(handle);
            }
            RoomPopulationScale roomPopulation = RoomPopulationScale.ZERO;

            if (iglooListItem.iglooPopulation.HasValue)
            {
                roomPopulation = iglooListItem.iglooPopulation.Value;
            }
            component.RoomPopulation = roomPopulation;
        }
 public void UpdatePopulationScale(RoomPopulationScale populationScale)
 {
     this.populationScale = populationScale;
     if (PopulationDisplay != null)
     {
         PopulationDisplay.UpdatePopulationDisplay(populationScale);
     }
     if (nameTint != null)
     {
         if (isWorldFull)
         {
             nameTint.SelectColor(1);
         }
         else
         {
             nameTint.SelectColor(0);
         }
     }
 }
Exemplo n.º 4
0
 private bool onWorldsFound(WorldServiceEvents.WorldsWithRoomPopulationReceivedEvent evt)
 {
     if (evt.WorldRoomPopulations.Count > 0)
     {
         foreach (WorldRoomPopulation worldRoomPopulation in evt.WorldRoomPopulations)
         {
             RoomPopulationScale           populationScaled = worldRoomPopulation.populationScaled;
             SettingsPanelServerListButton buttonForWorld   = getButtonForWorld(worldRoomPopulation.worldName);
             if (buttonForWorld != null)
             {
                 buttonForWorld.UpdatePopulationScale(populationScaled);
             }
             if (currentWorldDefinition.WorldName == worldRoomPopulation.worldName)
             {
                 CurrentServer.UpdatePopulationScale(populationScaled);
             }
         }
     }
     return(false);
 }
        public void UpdatePopulationDisplay(RoomPopulationScale populationScale)
        {
            int num = PopulationBarIcons.Length;

            for (int i = 0; i < num; i++)
            {
                if (i < (int)populationScale)
                {
                    PopulationBarIcons[i].SelectColor(0);
                }
                else
                {
                    PopulationBarIcons[i].SelectColor(1);
                }
            }
            if (FullIcon != null)
            {
                FullIcon.gameObject.SetActive((int)populationScale >= PopulationBarIcons.Length);
            }
        }
 public void LoadWorld(WorldDefinition definition, bool currentServer = false, RoomPopulationScale populationScale = RoomPopulationScale.ZERO)
 {
     World           = definition;
     NameText.text   = definition.WorldName;
     isCurrentServer = currentServer;
     if (currentServer && CurrentServerNameText != null)
     {
         CurrentServerNameText.text = definition.WorldName;
         CurrentServerNameText.gameObject.SetActive(value: true);
         if (NameText != null)
         {
             NameText.gameObject.SetActive(value: false);
         }
         if (Arrow != null)
         {
             Arrow.gameObject.SetActive(value: false);
         }
     }
     ShowFriendIndicator(setActive: false);
     UpdatePopulationScale(populationScale);
 }
 public WorldRoomPopulation(string worldName, RoomPopulationScale populationScaled)
 {
     this.worldName        = worldName;
     this.populationScaled = populationScaled;
 }
Exemplo n.º 8
0
 public RoomPopulation(RoomIdentifier identifier, RoomPopulationScale populationScaled)
 {
     this.identifier       = identifier;
     this.populationScaled = populationScaled;
 }