/// <summary>
        ///     Initializes a new instance of the <see cref="ManiaHelper"/> class.
        /// </summary>
        /// <param name="intralismBeatMap"> The intralism beatmap having data pulled from. </param>
        public ManiaHelper(IntralismBeatMap intralismBeatMap)
        {
            this.intralismBeatMap = intralismBeatMap;
            ManiaStoryboardHelper storyboardHelper = new(intralismBeatMap);

            this.Storyboard = storyboardHelper.Storyboard;

            this.ImagePaths.Add(this.BackgroundImage);
            this.ImagePaths.AddRange(storyboardHelper.SpritePaths !);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="EditorIntralismMap"/> class.
        /// </summary>
        /// <param name="beatMap"> An IntralismBeatMap that should be turned into a EditorIntralismMap. </param>
        public EditorIntralismMap(IntralismBeatMap beatMap)
        {
            this.Events          = beatMap.Events;
            this.Info            = beatMap.Info;
            this.Lives           = beatMap.Lives;
            this.Name            = beatMap.Name;
            this.Path            = beatMap.Path;
            this.Speed           = beatMap.Speed;
            this.ConfigVersion   = beatMap.ConfigVersion;
            this.EnvironmentType = beatMap.EnvironmentType;
            this.HandCount       = beatMap.HandCount;
            this.IconFile        = beatMap.IconFile;
            this.LevelResources  = beatMap.LevelResources;
            this.MaxLives        = beatMap.MaxLives;
            this.MusicFile       = beatMap.MusicFile;
            this.MusicTime       = beatMap.MusicTime;

            this.UncategorizedEvents = this.Events !.ToList();

            foreach (Event entry in this.UncategorizedEvents)
            {
                if (entry.IsEventOfType(EventType.SpawnObj))
                {
                    this.ArcSpawns.Add(entry);
                }
                else if (entry.IsEventOfType(EventType.SetPlayerDistance))
                {
                    this.Zooms.Add(entry);
                }
                else if (entry.IsEventOfType(EventType.SetSpeed))
                {
                    this.Speeds.Add(entry);
                }
                else if (!entry.IsEventOfType(EventType.SpawnObj) &&
                         !entry.IsEventOfType(EventType.SetSpeed) &&
                         !entry.IsEventOfType(EventType.SetPlayerDistance))
                {
                    this.StoryBoard.Add(entry);
                }
                else
                {
                    continue;
                }

                this.UncategorizedEvents.Remove(entry);
            }

            this.BuildEvents();
        }
        /// <summary>
        ///     Initializes a new instance of the <see cref="ManiaBeatMap"/> class.
        /// </summary>
        /// <param name="intralismBeatMap"> Creates a <see cref="ManiaBeatMap"/> from an <see cref="IntralismBeatMap"/>. </param>
        public ManiaBeatMap(IntralismBeatMap intralismBeatMap)
            : this()
        {
            this.Helper = new ManiaHelper(intralismBeatMap);

            this.GeneralSection.AudioFilename  = this.Helper.AudioFilename;
            this.GeneralSection.PreviewTime    = this.Helper.PreviewTime;
            this.MetadataSection.Title         = this.Helper.Title;
            this.MetadataSection.TitleUnicode  = this.Helper.Title;
            this.MetadataSection.Artist        = this.Helper.Artist;
            this.MetadataSection.ArtistUnicode = this.Helper.Artist;
            this.EventsSection.BackgroundImage = this.Helper.BackgroundImage;
            this.EventsSection.Storyboard      = this.Helper.Storyboard;
            this.HitObjects.AddRange(this.Helper.GetManiaHitObjects() !);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Reads intralism data and saves it as a mania beatmap.
        /// </summary>
        /// <param name="pathToBeatmapFile"> The path to a intralism "config.txt" file. </param>
        /// <param name="outputFolder"> The path to the osu mania beatmap output. </param>
        /// <param name="offset">The offset of the first note.</param>
        /// <returns> A <see cref="Task"/> representing the asynchronous operation. </returns>
        public static async Task AsyncConvertIntralismToMania(string pathToBeatmapFile, string outputFolder, int offset = 0)
        {
            IntralismBeatMap intralismBeatMap = IntralismBeatMap.ReadFromJsonFile(pathToBeatmapFile);
            ManiaBeatMap     maniaBeatMap     = new(intralismBeatMap);

            if (offset != 0)
            {
                foreach (HitObject hitObject in maniaBeatMap.HitObjects)
                {
                    hitObject.StartTime += offset;
                    hitObject.EndTime   += offset;
                }
            }

            string audioFileName = intralismBeatMap.MusicFile;

            await SaveFiles(pathToBeatmapFile, outputFolder, audioFileName, maniaBeatMap.Helper, maniaBeatMap);
        }
Ejemplo n.º 5
0
        private void DefaultViewTextBoxTextChanged(object sender, EventArgs e)
        {
            int lastCursorPosition = this.DefaultViewTextBox.SelectionStart;

            try
            {
                IntralismBeatMap intralismBeatMap =
                    JsonSerializer.Deserialize <IntralismBeatMap>(this.DefaultViewTextBox.Text !);

                this.loadedMap = new EditorIntralismMap(intralismBeatMap);
                this.UpdateTextBox();
            }
            catch (Exception e2)
            {
                Console.WriteLine(e2);
            }

            this.DefaultViewTextBox.SelectionStart = lastCursorPosition;
        }
Ejemplo n.º 6
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ManiaStoryboardHelper"/> class.
 /// </summary>
 /// <param name="intralismBeatMap"> An instance to be used. </param>
 public ManiaStoryboardHelper(IntralismBeatMap intralismBeatMap)
 {
     this.intralismBeatMap = intralismBeatMap;
     this.FillStoryboardAndSpritePaths();
 }