示例#1
0
    private static void PrintMaps()
    {
        if (!FirstTime)
        {
            return;
        }

        FirstTime = false;

        if (ConfigurationManager.GeneralConfig?.PrintAreaMap?.Value == true)
        {
            ImageBuilder
            .SetIds(MapManager.AreaMap)
            .Print("area_ids_map");
        }

        if (ConfigurationManager.GeneralConfig?.PrintBiomeMap?.Value == true)
        {
            ImageBuilder
            .SetBiomes(MapManager.AreaMap)
            .Print("biome_map");
        }

        if (ConfigurationManager.GeneralConfig?.PrintFantasticBeastsAndWhereToKillThem?.Value == true)
        {
            // TODO: Base on WorldSpawnerConfigurationCollection instead.

            //SpawnSystem config is only expected to have a single first layer, namely "WorldSpawner", so we just grab the first entry.
            var spawnSystemConfigs = SpawnSystemConfigurationManager
                                     .SpawnSystemConfig?
                                     .Subsections? //[*]
                                     .Values?
                                     .FirstOrDefault();

            foreach (var config in spawnSystemConfigs.Subsections.Values)
            {
                if (!config.Enabled.Value)
                {
                    continue;
                }

                var spawnMap = WorldSpawnerSpawnMapService.GetMapOfTemplatesActiveAreas(config.Index);

                if (spawnMap is null)
                {
                    continue;
                }

                ImageBuilder
                .SetGrayscaleBiomes(MapManager.AreaMap)
                .AddHeatZones(spawnMap)
                .Print($"spawn_map_{config.Index}_{config.PrefabName.Value}");
            }
        }
    }
示例#2
0
    public static void CommandPrintTemplateSpawnAreas(int templateIndex)
    {
        var spawnMap = WorldSpawnerSpawnMapService.GetMapOfTemplatesActiveAreas(templateIndex);

        var template = WorldSpawnTemplateManager.GetTemplate(templateIndex);

        if (spawnMap is null || template is null)
        {
            Console.instance.Print($"Unable to find template '{templateIndex}', skipping print.");
            return;
        }

        ImageBuilder
        .SetGrayscaleBiomes(MapManager.AreaMap)
        .AddHeatZones(spawnMap)
        .Print($"spawn_map_{templateIndex}_{template.PrefabName}");

        var debugFolder = Path.Combine(Paths.BepInExRootPath, ConfigurationManager.GeneralConfig?.DebugFileFolder?.Value ?? "Debug");

        Console.instance.Print("Printing map of spawn areas to: " + debugFolder);
    }