public DefaultSkinConfiguration()
 {
     ComboColours.AddRange(new[]
     {
         new Color4(255, 192, 0, 255),
         new Color4(0, 202, 0, 255),
         new Color4(18, 124, 255, 255),
         new Color4(242, 24, 57, 255),
     });
 }
 public DefaultSkinConfiguration()
 {
     ComboColours.AddRange(new[]
     {
         new Color4(17, 136, 170, 255),
         new Color4(102, 136, 0, 255),
         new Color4(204, 102, 0, 255),
         new Color4(121, 9, 13, 255)
     });
 }
示例#3
0
 /// <summary>
 /// This method makes sure the SpecialColour objects in the colour sequences are the same objects as in the combo colours.
 /// With this the colours of the colour sequences update when the combo colours get changed.
 /// </summary>
 private void MatchComboColourReferences()
 {
     foreach (var colourPoint in ColourPoints)
     {
         for (int i = 0; i < colourPoint.ColourSequence.Count; i++)
         {
             colourPoint.ColourSequence[i] =
                 ComboColours.FirstOrDefault(o => o.Name == colourPoint.ColourSequence[i].Name) ??
                 colourPoint.ColourSequence[i];
         }
     }
 }
示例#4
0
        public DefaultSkinConfiguration()
        {
            HitCircleFont = "default";

            ComboColours.AddRange(new[]
            {
                new Color4(17, 136, 170, 255),
                new Color4(102, 136, 0, 255),
                new Color4(204, 102, 0, 255),
                new Color4(121, 9, 13, 255)
            });

            CursorExpand = true;
        }
示例#5
0
        public void ImportComboColoursFromBeatmap(string importPath)
        {
            try {
                var editor  = new BeatmapEditor(importPath);
                var beatmap = editor.Beatmap;

                ComboColours.Clear();
                for (int i = 0; i < beatmap.ComboColours.Count; i++)
                {
                    ComboColours.Add(new SpecialColour(beatmap.ComboColours[i].Color, $"Combo{i + 1}"));
                }
            }
            catch (Exception ex) {
                MessageBox.Show($"{ex.Message}{Environment.NewLine}{ex.StackTrace}", "Error");
            }
        }
        public void ImportComboColoursFromBeatmap(string importPath)
        {
            try {
                var editor  = new BeatmapEditor(importPath);
                var beatmap = editor.Beatmap;

                ComboColours.Clear();
                for (int i = 0; i < beatmap.ComboColours.Count; i++)
                {
                    ComboColours.Add(new SpecialColour(beatmap.ComboColours[i].Color, $"Combo{i + 1}"));
                }
            }
            catch (Exception ex) {
                ex.Show();
            }
        }
示例#7
0
        public void ImportColourHaxFromBeatmap(string importPath)
        {
            try {
                var editor  = new BeatmapEditor(importPath);
                var beatmap = editor.Beatmap;

                // Add default colours if there are no colours
                if (beatmap.ComboColours.Count == 0)
                {
                    beatmap.ComboColours.AddRange(ComboColour.GetDefaultComboColours());
                }

                ComboColours.Clear();
                for (int i = 0; i < beatmap.ComboColours.Count; i++)
                {
                    ComboColours.Add(new SpecialColour(beatmap.ComboColours[i].Color, $"Combo{i + 1}"));
                }

                // Remove all colour points since those are getting replaced
                ColourPoints.Clear();

                // Get all the hit objects which can colorhax. AKA new combos and not spinners
                var colorHaxObjects = beatmap.HitObjects.Where(o => o.ActualNewCombo && !o.IsSpinner).ToArray();

                // Get the array with all the lengths of sequences that are going to be checked
                var sequenceLengthChecks = Enumerable.Range(1, ComboColours.Count * 2 + 2).ToArray();

                int   sequenceStartIndex = 0;
                int[] lastNormalSequence = null;
                bool  lastBurst          = false;
                while (sequenceStartIndex < colorHaxObjects.Length)
                {
                    var firstComboHitObject = colorHaxObjects[sequenceStartIndex];

                    var bestSequence = GetBestSequenceAtIndex(
                        sequenceStartIndex,
                        3,
                        colorHaxObjects,
                        beatmap,
                        sequenceLengthChecks,
                        lastBurst,
                        lastNormalSequence
                        )?.Item1;

                    if (bestSequence == null)
                    {
                        lastBurst           = false;
                        sequenceStartIndex += 1;
                        continue;
                    }

                    var bestContribution = GetSequenceContribution(colorHaxObjects, sequenceStartIndex, bestSequence);

                    // Get the colours for every colour index. Using modulo to make sure the index is always in range.
                    var colourSequence = bestSequence.Select(o => ComboColours[MathHelper.Mod(o, ComboColours.Count)]);

                    // Add a new colour point
                    var mode = bestContribution == 1 &&
                               GetComboLength(beatmap.HitObjects, firstComboHitObject) <= MaxBurstLength
                        ? ColourPointMode.Burst
                        : ColourPointMode.Normal;

                    // To optimize on colour points, we dont add a new colour point if the previous point was a burst and
                    // the sequence before the burst is equivalent to this sequence
                    if (!(lastBurst && lastNormalSequence != null && IsSubSequence(bestSequence, lastNormalSequence) &&
                          (bestSequence.Length == lastNormalSequence.Length || bestContribution <= bestSequence.Length)))
                    {
                        ColourPoints.Add(GenerateNewColourPoint(firstComboHitObject.Time, colourSequence, mode));
                    }

                    lastBurst           = mode == ColourPointMode.Burst;
                    sequenceStartIndex += bestContribution;
                    lastNormalSequence  = mode == ColourPointMode.Burst ? lastNormalSequence : bestSequence;
                }
            }
            catch (Exception ex) {
                MessageBox.Show($"{ex.Message}{Environment.NewLine}{ex.StackTrace}", "Error");
            }
        }