private bool onIgloosFromZoneIdsLoaded(IglooServiceEvents.IgloosFromZoneIdsLoaded evt) { List <DataEntityHandle> list = new List <DataEntityHandle>(Service.Get <CPDataEntityCollection>().GetEntitiesByType <ProfileData>()); for (int i = 0; i < evt.RoomPopulations.Count; i++) { RoomPopulation roomPopulation = evt.RoomPopulations[i]; DataEntityHandle handle = evt.Handles[i]; addOtherPlayerIglooListing(handle, roomPopulation.populationScaled); } return(false); }
public void UpdatePopulationBar(RoomPopulation population) { int populationScaled = (int)population.populationScaled; for (int i = 0; i < PopulationBarIcons.Length; i++) { if (i < populationScaled) { PopulationBarIcons[i].SelectColor(1); } else { PopulationBarIcons[i].SelectColor(0); } } }
protected override void setUpObject(RectTransform item, int poolIndex) { base.setUpObject(item, poolIndex); IglooListItem component = item.GetComponent <IglooListItem>(); DataEntityHandle handleFromPoolIndex = getHandleFromPoolIndex(poolIndex); if (dataEntityCollection.TryGetComponent <ProfileData>(handleFromPoolIndex, out var component2) && dataEntityCollection.TryGetComponent <IglooListingData>(handleFromPoolIndex, out var component3)) { RoomPopulation population = new RoomPopulation(new RoomIdentifier(), component3.RoomPopulation); component.SetPopulation(population, isFull: false, component2.HasPublicIgloo); } if (dataEntityCollection.TryGetComponent <MembershipData>(handleFromPoolIndex, out var _)) { AbstractPlayerListItem component5 = item.GetComponent <AbstractPlayerListItem>(); component5.SetMembershipType(getMembershipType(handleFromPoolIndex)); } }
public void UpdatePopulationBar() { RoomPopulation zonePopulation = GetComponentInParent <WorldMapController>().GetZonePopulation(zoneDefinition); int populationScaled = (int)zonePopulation.populationScaled; for (int i = 0; i < PopulationBarIcons.Length; i++) { if (i < populationScaled) { PopulationBarIcons[i].SelectColor(0); } else { PopulationBarIcons[i].SelectColor(1); } } }
public void SetPopulation(RoomPopulation population, bool isFull, bool publicIgloo) { if (isFull) { PopulationBar.SetActive(value: false); FullLabel.SetActive(value: true); setEnabled(isEnabled: false); } else { PopulationBar.SetActive(value: true); FullLabel.SetActive(value: false); if (!isInThisIgloo) { PlayerIconCanvasGroup.alpha = 1f; } } PrivateLabel.SetActive(!publicIgloo); UpdatePopulationBar(population); }
private void logTravelToZone() { RoomPopulation zonePopulation = GetComponentInParent <WorldMapController>().GetZonePopulation(zoneDefinition); Service.Get <ICPSwrveService>().Action("map_travel", zoneDefinition.ZoneName, zonePopulation.populationScaled.ToString()); }