private String getStoryboardContent(String BackgroundContent, String FailContent, String PassContent, String ForegroundContent) { String StoryboardContent = ""; StoryboardContent += "//Storyboard Layer 0 (Background)\n"; if (BackgroundContent != null) { StoryboardContent += Background.getContent(); } StoryboardContent += "//Storyboard Layer 1 (Fail)\n"; if (FailContent != null) { StoryboardContent += Fail.getContent(); } StoryboardContent += "//Storyboard Layer 2 (Pass)\n"; if (PassContent != null) { StoryboardContent += Pass.getContent(); } StoryboardContent += "//Storyboard Layer 3 (Foreground)\n"; if (ForegroundContent != null) { StoryboardContent += Foreground.getContent(); } StoryboardContent += "//Storyboard Sound Samples\n"; return(StoryboardContent); }
public void Export() { String FilePath = FolderPath + Mapset.getArtistName() + " - " + Mapset.getTitle() + " (" + Mapset.getCreator() + ").osb"; foreach (char c in new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars())) { if (c == '\\' || c == ':') { continue; } FilePath = FilePath.Replace(c.ToString(), ""); } // MAKING UP CONTENT String Content = ""; Content += "[Events]\n//Background and Video events\n"; Content += "//Storyboard Layer 0 (Background)\n"; if (Background.getContent() != null) { Content += Background.getContent(); } Content += "//Storyboard Layer 1 (Fail)\n"; if (Fail.getContent() != null) { Content += Fail.getContent(); } Content += "//Storyboard Layer 2 (Pass)\n"; if (Pass.getContent() != null) { Content += Pass.getContent(); } Content += "//Storyboard Layer 3 (Foreground)\n"; if (Foreground.getContent() != null) { Content += Foreground.getContent(); } Content += "//Storyboard Sound Samples\n"; System.IO.File.WriteAllText(FilePath, Content); foreach (Beatmap Beatmap in Mapset.getBeatmaps()) { Beatmap.Export(); } }
public void Export() { String ExportContent = ""; String FilePath = FolderPath + getProperty("Artist") + " - " + getProperty("Title") + " (" + getProperty("Creator") + ") [" + DifficultyName + "].osu"; foreach (char c in new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars())) { if (c == '\\' || c == ':') { continue; } FilePath = FilePath.Replace(c.ToString(), ""); } bool SBPart = false; for (int i = 0; i < Content.Length; i++) { String Line = Content[i]; if (Line == "//Storyboard Layer 0 (Background)") { SBPart = true; } else if (!SBPart) { ExportContent += Line + "\n"; } if (Line == "" && SBPart) { SBPart = false; String BackgroundContent = Background.getContent(), FailContent = Fail.getContent(), PassContent = Pass.getContent(), ForegroundContent = Foreground.getContent(); if (BackgroundContent == "" && FailContent == "" && PassContent == "" && ForegroundContent == "") { return; } ExportContent += getStoryboardContent(BackgroundContent, FailContent, PassContent, ForegroundContent); ExportContent += "\n"; } } System.IO.File.WriteAllText(FilePath, ExportContent.ToString()); }