Beispiel #1
0
        private void CreateLevel(Level level, string exid, string path)
        {
            string settingsJson = JsonHelper.GenerateSettingsJson(level, exid);

            CreateFile(Path.Combine(path, FileStatics.SettingsJson), settingsJson);
            foreach (Chart chart in level.Charts)
            {
                CreateFile(Path.Combine(path, chart.SongPath ?? "base.ogg"));
                CreateFile(Path.Combine(path, chart.ImagePath ?? "base.jpg"));
                CreateFile(Path.Combine(path, chart.ChartPath ?? JsonUserInput.GetChartPathFromPresetGroup(chart.DifficultyGroup)));
                CreateFile(Path.Combine(path, chart.Background));
            }
        }
Beispiel #2
0
        public static (Chart chart, string json) GenerateChart(
            DifficultyGroup dg, string d, float constant,
            string song, string img, string bg,
            string name, string namer, string artist, string artistr,
            string bpm, string charter, string illust,
            string chartpath, string style
            )
        {
            Style s;

            switch (style.ToLower())
            {
            case "conflict":
                s = Style.Conflict;
                break;

            case "light":
            default:
                s = Style.Light;
                break;
            }

            Chart chart = new Chart
            {
                DifficultyGroup = dg,
                Difficulty      = new Difficulty(d),
                Constant        = constant,
                SongPath        = song ?? "base.ogg",
                ImagePath       = img ?? "base.jpg",
                Background      = bg ?? "bg.jpg",
                Name            = name,
                NameRomanized   = namer ?? name,
                Artist          = artist,
                ArtistRomanized = artistr ?? artist,
                Bpm             = bpm,
                Charter         = charter,
                Illustrator     = illust,
                ChartPath       = chartpath ?? JsonUserInput.GetChartPathFromPresetGroup(dg),
                Style           = s
            };

            return(chart, GetJson(chart));
        }