Ejemplo n.º 1
0
        private void showCurrentServerInfo()
        {
            PresenceData component = Service.Get <CPDataEntityCollection>().GetComponent <PresenceData>(Service.Get <CPDataEntityCollection>().LocalPlayerHandle);

            currentWorldDefinition = Service.Get <ZoneTransitionService>().GetWorld(component.World);
            CurrentServer.LoadWorld(currentWorldDefinition, currentServer: true);
        }
        private void checkForLocalizationChange(WorldDefinition currentWorld)
        {
            Localizer localizer = Service.Get <Localizer>();

            if (currentWorld != null && localizer.Language != currentWorld.Language)
            {
                localizer.ChangeLanguage(currentWorld.Language);
            }
        }
 public void SetWorldsFromManifest(Manifest manifest)
 {
     Worlds.Clear();
     ScriptableObject[] assets = manifest.Assets;
     for (int i = 0; i < assets.Length; i++)
     {
         WorldDefinition item = (WorldDefinition)assets[i];
         Worlds.Add(item);
     }
 }
Ejemplo n.º 4
0
 private void loadWorldButton(WorldDefinition definition, Language selectedLanguage)
 {
     if (!worldButtons.ContainsKey(definition.WorldName))
     {
         GameObject gameObject = Object.Instantiate(buttonPrefab, ButtonParent, worldPositionStays: false);
         gameObject.SetActive(definition.Language == selectedLanguage);
         SettingsPanelServerListButton component = gameObject.GetComponent <SettingsPanelServerListButton>();
         bool currentServer = currentWorldDefinition.Equals(definition);
         component.LoadWorld(definition, currentServer);
         if (worldsWithFriends.Contains(definition.WorldName))
         {
             component.ShowFriendIndicator();
         }
         worldButtons.Add(definition.WorldName, component);
     }
 }
 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);
 }