private void DoWorldGenInitialize()
    {
        SettingLevel currentQualitySetting  = CustomGameSettings.Instance.GetCurrentQualitySetting(CustomGameSettingConfigs.World);
        SettingLevel currentQualitySetting2 = CustomGameSettings.Instance.GetCurrentQualitySetting(CustomGameSettingConfigs.WorldgenSeed);

        seed = int.Parse(currentQualitySetting2.id);
        List <string> randomTraits = SettingsCache.GetRandomTraits(seed);

        worldGen = new WorldGen(currentQualitySetting.id, randomTraits);
        Vector2I worldsize = worldGen.Settings.world.worldsize;

        GridSettings.Reset(worldsize.x, worldsize.y);
        worldGen.Initialise(UpdateProgress, OnError, seed, seed, seed, seed);
        firstPassGeneration = true;
        worldGen.GenerateOfflineThreaded();
    }
Ejemplo n.º 2
0
    private List <AsteroidDescriptor> GenerateTraitDescriptors()
    {
        List <AsteroidDescriptor> list = new List <AsteroidDescriptor>();

        if (!world.disableWorldTraits)
        {
            List <string> randomTraits = SettingsCache.GetRandomTraits(seed);
            {
                foreach (string item in randomTraits)
                {
                    WorldTrait cachedTrait = SettingsCache.GetCachedTrait(item);
                    list.Add(new AsteroidDescriptor(string.Format("<color=#{1}>{0}</color>", Strings.Get(cachedTrait.name), cachedTrait.colorHex), Strings.Get(cachedTrait.description), null));
                }
                return(list);
            }
        }
        list.Add(new AsteroidDescriptor(WORLD_TRAITS.NO_TRAITS.NAME, WORLD_TRAITS.NO_TRAITS.DESCRIPTION, null));
        return(list);
    }