예제 #1
0
        public OsuPattern FromFileWithSave(string filePath, OsuPatternFileHandler fileHandler, string name,
                                           string filter = null, double filterStartTime = -1, double filterEndTime = -1)
        {
            OsuPattern osuPattern;

            if (!string.IsNullOrEmpty(filter) || filterStartTime != -1 || filterEndTime != -1)
            {
                osuPattern = FromFileFilter(filePath, out var patternBeatmap, name, filter, filterStartTime, filterEndTime);

                // Save the modified pattern beatmap in the colleciton folder
                var newFilePath = fileHandler.GetPatternPath(osuPattern.FileName);
                patternBeatmap.SaveWithFloatPrecision = true;
                Editor.SaveFile(newFilePath, patternBeatmap.GetLines());
            }
            else
            {
                osuPattern = FromFile(filePath, name);

                // Save the pattern in the collection folder by copying
                var newFilePath = fileHandler.GetPatternPath(osuPattern.FileName);
                File.Copy(filePath, newFilePath, false);
            }

            return(osuPattern);
        }
예제 #2
0
        public OsuPattern FromSelectedWithSave(Beatmap beatmap, OsuPatternFileHandler fileHandler, string name)
        {
            var osuPattern = FromSelected(beatmap, out var patternBeatmap, name);

            patternBeatmap.SaveWithFloatPrecision = true;
            Editor.SaveFile(fileHandler.GetPatternPath(osuPattern.FileName), patternBeatmap.GetLines());

            return(osuPattern);
        }
예제 #3
0
        public OsuPattern FromSelectedWithSave(Beatmap beatmap, string name, OsuPatternFileHandler fileHandler)
        {
            var osuPattern = FromSelected(beatmap, name, out var patternBeatmap);

            // Could possibly be saved async
            patternBeatmap.SaveWithFloatPrecision = true;
            Editor.SaveFile(fileHandler.GetPatternPath(osuPattern.FileName), patternBeatmap.GetLines());

            return(osuPattern);
        }
예제 #4
0
        public OsuPattern FromObjectsWithSave(List <HitObject> hitObjects, List <TimingPoint> timingPoints, OsuPatternFileHandler fileHandler,
                                              string name, TimingPoint firstUnInheritedTimingPoint = null, double globalSv = 1.4, GameMode gameMode = GameMode.Standard)
        {
            var osuPattern = FromObjects(hitObjects, timingPoints, out var patternBeatmap, name,
                                         firstUnInheritedTimingPoint, globalSv, gameMode);

            patternBeatmap.SaveWithFloatPrecision = true;
            Editor.SaveFile(fileHandler.GetPatternPath(osuPattern.FileName), patternBeatmap.GetLines());

            return(osuPattern);
        }