From 0b770d122595547b9a766cef2b4864f926ae28d6 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Fri, 26 May 2017 23:55:34 -0500 Subject: [PATCH 01/28] Allow for variables in storyboards --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index cb1d9d2fcd..78ef60748f 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Globalization; using System.IO; using OpenTK.Graphics; @@ -31,6 +32,8 @@ namespace osu.Game.Beatmaps.Formats private ConvertHitObjectParser parser; + private Dictionary variables = new Dictionary(); + private LegacySampleBank defaultSampleBank; private int defaultSampleVolume = 100; @@ -56,6 +59,7 @@ namespace osu.Game.Beatmaps.Formats TimingPoints, Colours, HitObjects, + Variables, } private void handleGeneral(Beatmap beatmap, string key, string val) @@ -391,7 +395,7 @@ namespace osu.Game.Beatmaps.Formats } string val = line, key = null; - if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects) + if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects && section != Section.Variables) { key = val.Remove(val.IndexOf(':')).Trim(); val = val.Substring(val.IndexOf(':') + 1).Trim(); @@ -411,6 +415,13 @@ namespace osu.Game.Beatmaps.Formats handleDifficulty(beatmap, key, val); break; case Section.Events: + string[] valSplit = val.Split(','); + for (int i = 0; i < valSplit.Length; i++) + { + if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) + valSplit[i] = variables[valSplit[i]]; + } + val = string.Join(",", valSplit); handleEvents(beatmap, val); break; case Section.TimingPoints: @@ -426,6 +437,11 @@ namespace osu.Game.Beatmaps.Formats beatmap.HitObjects.Add(obj); break; + case Section.Variables: + key = val.Remove(val.IndexOf('=')).Trim(); + val = val.Substring(val.IndexOf('=') + 1).Trim(); + variables[key] = val; + break; } } } From a523dfc3884c920ee3ea1bfba5496eabb17c6b6d Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sat, 27 May 2017 00:13:46 -0500 Subject: [PATCH 02/28] Allow variables of variables Some storyboards like to do tricky stuff --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 78ef60748f..6716af371c 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps.Formats private ConvertHitObjectParser parser; - private Dictionary variables = new Dictionary(); + private readonly Dictionary variables = new Dictionary(); private LegacySampleBank defaultSampleBank; private int defaultSampleVolume = 100; @@ -415,13 +415,16 @@ namespace osu.Game.Beatmaps.Formats handleDifficulty(beatmap, key, val); break; case Section.Events: - string[] valSplit = val.Split(','); - for (int i = 0; i < valSplit.Length; i++) + do { - if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) - valSplit[i] = variables[valSplit[i]]; - } - val = string.Join(",", valSplit); + string[] valSplit = val.Split(','); + for (int i = 0; i < valSplit.Length; i++) + { + if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) + valSplit[i] = variables[valSplit[i]]; + } + val = string.Join(",", valSplit); + } while (val.IndexOf('$') != -1); handleEvents(beatmap, val); break; case Section.TimingPoints: From e46e1d96a7b382df862869a60bc997f27b90ecaf Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sat, 27 May 2017 00:20:19 -0500 Subject: [PATCH 03/28] Move logic to handleEvent --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 6716af371c..2045293a58 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -208,6 +208,17 @@ namespace osu.Game.Beatmaps.Formats private void handleEvents(Beatmap beatmap, string val) { + do + { + string[] valSplit = val.Split(','); + for (int i = 0; i < valSplit.Length; i++) + { + if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) + valSplit[i] = variables[valSplit[i]]; + } + val = string.Join(",", valSplit); + } while (val.IndexOf('$') != -1); + string[] split = val.Split(','); EventType type; @@ -415,16 +426,6 @@ namespace osu.Game.Beatmaps.Formats handleDifficulty(beatmap, key, val); break; case Section.Events: - do - { - string[] valSplit = val.Split(','); - for (int i = 0; i < valSplit.Length; i++) - { - if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) - valSplit[i] = variables[valSplit[i]]; - } - val = string.Join(",", valSplit); - } while (val.IndexOf('$') != -1); handleEvents(beatmap, val); break; case Section.TimingPoints: From 0175b9192793f02a0f77bee202488af20f2f1b37 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 30 May 2017 19:52:21 +0900 Subject: [PATCH 04/28] Cleanups. --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 76 ++++++++++++------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index e2884dc5e2..8856d58d37 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -10,6 +10,7 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Legacy; using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Beatmaps.ControlPoints; +using System.Linq; namespace osu.Game.Beatmaps.Formats { @@ -206,18 +207,29 @@ namespace osu.Game.Beatmaps.Formats } } + /// + /// Decodes any beatmap variables present in a string value. + /// + /// The value which contains variables. + private void decodeVariables(ref string val) + { + while (val.IndexOf('$') >= 0) + { + string[] split = val.Split(','); + for (int i = 0; i < split.Length; i++) + { + var item = split[i]; + if (item.StartsWith("$") && variables.ContainsKey(item)) + item = variables[item]; + } + + val = string.Join(",", split); + } + } + private void handleEvents(Beatmap beatmap, string val) { - do - { - string[] valSplit = val.Split(','); - for (int i = 0; i < valSplit.Length; i++) - { - if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) - valSplit[i] = variables[valSplit[i]]; - } - val = string.Join(",", valSplit); - } while (val.IndexOf('$') != -1); + decodeVariables(ref val); string[] split = val.Split(','); @@ -405,46 +417,56 @@ namespace osu.Game.Beatmaps.Formats continue; } - string val = line, key = null; - if (section != Section.Events && section != Section.TimingPoints && section != Section.HitObjects && section != Section.Variables) - { - key = val.Remove(val.IndexOf(':')).Trim(); - val = val.Substring(val.IndexOf(':') + 1).Trim(); - } + string key = null, value = null; + switch (section) { case Section.General: - handleGeneral(beatmap, key, val); + case Section.Editor: + case Section.Metadata: + case Section.Difficulty: + case Section.Colours: + key = line.Remove(line.IndexOf(':')).Trim(); + value = line.Substring(line.IndexOf(':') + 1).Trim(); + break; + case Section.Variables: + key = line.Remove(line.IndexOf('=')).Trim(); + value = line.Substring(line.IndexOf('=') + 1).Trim(); + break; + } + + switch (section) + { + case Section.General: + handleGeneral(beatmap, key, value); break; case Section.Editor: - handleEditor(beatmap, key, val); + handleEditor(beatmap, key, value); break; case Section.Metadata: - handleMetadata(beatmap, key, val); + handleMetadata(beatmap, key, value); break; case Section.Difficulty: - handleDifficulty(beatmap, key, val); + handleDifficulty(beatmap, key, value); break; case Section.Events: - handleEvents(beatmap, val); + handleEvents(beatmap, line); break; case Section.TimingPoints: - handleTimingPoints(beatmap, val); + handleTimingPoints(beatmap, line); break; case Section.Colours: - handleColours(beatmap, key, val, ref hasCustomColours); + handleColours(beatmap, key, value, ref hasCustomColours); break; case Section.HitObjects: - var obj = parser.Parse(val); + var obj = parser.Parse(line); if (obj != null) beatmap.HitObjects.Add(obj); break; case Section.Variables: - key = val.Remove(val.IndexOf('=')).Trim(); - val = val.Substring(val.IndexOf('=') + 1).Trim(); - variables[key] = val; + variables[key] = value; break; } } From 93a33be596d59561def6e1318a861c335b928c54 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 30 May 2017 19:52:43 +0900 Subject: [PATCH 05/28] val -> value, val -> line (in cases where a key is not used). --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 8856d58d37..600dc1cfea 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -63,34 +63,34 @@ namespace osu.Game.Beatmaps.Formats Variables, } - private void handleGeneral(Beatmap beatmap, string key, string val) + private void handleGeneral(Beatmap beatmap, string key, string value) { var metadata = beatmap.BeatmapInfo.Metadata; switch (key) { case @"AudioFilename": - metadata.AudioFile = val; + metadata.AudioFile = value; break; case @"AudioLeadIn": - beatmap.BeatmapInfo.AudioLeadIn = int.Parse(val); + beatmap.BeatmapInfo.AudioLeadIn = int.Parse(value); break; case @"PreviewTime": - metadata.PreviewTime = int.Parse(val); + metadata.PreviewTime = int.Parse(value); break; case @"Countdown": - beatmap.BeatmapInfo.Countdown = int.Parse(val) == 1; + beatmap.BeatmapInfo.Countdown = int.Parse(value) == 1; break; case @"SampleSet": - defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), val); + defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), value); break; case @"SampleVolume": - defaultSampleVolume = int.Parse(val); + defaultSampleVolume = int.Parse(value); break; case @"StackLeniency": - beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.StackLeniency = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"Mode": - beatmap.BeatmapInfo.RulesetID = int.Parse(val); + beatmap.BeatmapInfo.RulesetID = int.Parse(value); switch (beatmap.BeatmapInfo.RulesetID) { @@ -109,113 +109,113 @@ namespace osu.Game.Beatmaps.Formats } break; case @"LetterboxInBreaks": - beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; + beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(value) == 1; break; case @"SpecialStyle": - beatmap.BeatmapInfo.SpecialStyle = int.Parse(val) == 1; + beatmap.BeatmapInfo.SpecialStyle = int.Parse(value) == 1; break; case @"WidescreenStoryboard": - beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(val) == 1; + beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(value) == 1; break; } } - private void handleEditor(Beatmap beatmap, string key, string val) + private void handleEditor(Beatmap beatmap, string key, string value) { switch (key) { case @"Bookmarks": - beatmap.BeatmapInfo.StoredBookmarks = val; + beatmap.BeatmapInfo.StoredBookmarks = value; break; case @"DistanceSpacing": - beatmap.BeatmapInfo.DistanceSpacing = double.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.DistanceSpacing = double.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"BeatDivisor": - beatmap.BeatmapInfo.BeatDivisor = int.Parse(val); + beatmap.BeatmapInfo.BeatDivisor = int.Parse(value); break; case @"GridSize": - beatmap.BeatmapInfo.GridSize = int.Parse(val); + beatmap.BeatmapInfo.GridSize = int.Parse(value); break; case @"TimelineZoom": - beatmap.BeatmapInfo.TimelineZoom = double.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.TimelineZoom = double.Parse(value, NumberFormatInfo.InvariantInfo); break; } } - private void handleMetadata(Beatmap beatmap, string key, string val) + private void handleMetadata(Beatmap beatmap, string key, string value) { var metadata = beatmap.BeatmapInfo.Metadata; switch (key) { case @"Title": - metadata.Title = val; + metadata.Title = value; break; case @"TitleUnicode": - metadata.TitleUnicode = val; + metadata.TitleUnicode = value; break; case @"Artist": - metadata.Artist = val; + metadata.Artist = value; break; case @"ArtistUnicode": - metadata.ArtistUnicode = val; + metadata.ArtistUnicode = value; break; case @"Creator": - metadata.Author = val; + metadata.Author = value; break; case @"Version": - beatmap.BeatmapInfo.Version = val; + beatmap.BeatmapInfo.Version = value; break; case @"Source": - beatmap.BeatmapInfo.Metadata.Source = val; + beatmap.BeatmapInfo.Metadata.Source = value; break; case @"Tags": - beatmap.BeatmapInfo.Metadata.Tags = val; + beatmap.BeatmapInfo.Metadata.Tags = value; break; case @"BeatmapID": - beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(val); + beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(value); break; case @"BeatmapSetID": - beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(val); - metadata.OnlineBeatmapSetID = int.Parse(val); + beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(value); + metadata.OnlineBeatmapSetID = int.Parse(value); break; } } - private void handleDifficulty(Beatmap beatmap, string key, string val) + private void handleDifficulty(Beatmap beatmap, string key, string value) { var difficulty = beatmap.BeatmapInfo.Difficulty; switch (key) { case @"HPDrainRate": - difficulty.DrainRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.DrainRate = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"CircleSize": - difficulty.CircleSize = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.CircleSize = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"OverallDifficulty": - difficulty.OverallDifficulty = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.OverallDifficulty = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"ApproachRate": - difficulty.ApproachRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.ApproachRate = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"SliderMultiplier": - difficulty.SliderMultiplier = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.SliderMultiplier = float.Parse(value, NumberFormatInfo.InvariantInfo); break; case @"SliderTickRate": - difficulty.SliderTickRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.SliderTickRate = float.Parse(value, NumberFormatInfo.InvariantInfo); break; } } /// - /// Decodes any beatmap variables present in a string value. + /// Decodes any beatmap variables present in a line into their real values. /// - /// The value which contains variables. - private void decodeVariables(ref string val) + /// The line which may contains variables. + private void decodeVariables(ref string line) { - while (val.IndexOf('$') >= 0) + while (line.IndexOf('$') >= 0) { - string[] split = val.Split(','); + string[] split = line.Split(','); for (int i = 0; i < split.Length; i++) { var item = split[i]; @@ -223,15 +223,15 @@ namespace osu.Game.Beatmaps.Formats item = variables[item]; } - val = string.Join(",", split); + line = string.Join(",", split); } } - private void handleEvents(Beatmap beatmap, string val) + private void handleEvents(Beatmap beatmap, string line) { - decodeVariables(ref val); + decodeVariables(ref line); - string[] split = val.Split(','); + string[] split = line.Split(','); EventType type; if (!Enum.TryParse(split[0], out type)) @@ -263,9 +263,9 @@ namespace osu.Game.Beatmaps.Formats } } - private void handleTimingPoints(Beatmap beatmap, string val) + private void handleTimingPoints(Beatmap beatmap, string line) { - string[] split = val.Split(','); + string[] split = line.Split(','); double time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo); double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo); @@ -348,12 +348,12 @@ namespace osu.Game.Beatmaps.Formats } } - private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours) + private void handleColours(Beatmap beatmap, string key, string value, ref bool hasCustomColours) { - string[] split = val.Split(','); + string[] split = value.Split(','); if (split.Length != 3) - throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}"); + throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {value}"); byte r, g, b; if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b)) From 0728aea6a4f70acdc23774f1167a22eb934652be Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 30 May 2017 20:26:39 +0900 Subject: [PATCH 06/28] Fixes + cleanup. --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 600dc1cfea..e9f6c66630 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -10,7 +10,6 @@ using osu.Game.Beatmaps.Timing; using osu.Game.Beatmaps.Legacy; using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Beatmaps.ControlPoints; -using System.Linq; namespace osu.Game.Beatmaps.Formats { @@ -220,7 +219,7 @@ namespace osu.Game.Beatmaps.Formats { var item = split[i]; if (item.StartsWith("$") && variables.ContainsKey(item)) - item = variables[item]; + split[i] = variables[item]; } line = string.Join(",", split); From 5b5c2e47178606980ade4ba4f5a69aad96ce6d2c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 30 May 2017 20:37:30 +0900 Subject: [PATCH 07/28] Back to using val... --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index e9f6c66630..23f6c869ea 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -62,34 +62,34 @@ namespace osu.Game.Beatmaps.Formats Variables, } - private void handleGeneral(Beatmap beatmap, string key, string value) + private void handleGeneral(Beatmap beatmap, string key, string val) { var metadata = beatmap.BeatmapInfo.Metadata; switch (key) { case @"AudioFilename": - metadata.AudioFile = value; + metadata.AudioFile = val; break; case @"AudioLeadIn": - beatmap.BeatmapInfo.AudioLeadIn = int.Parse(value); + beatmap.BeatmapInfo.AudioLeadIn = int.Parse(val); break; case @"PreviewTime": - metadata.PreviewTime = int.Parse(value); + metadata.PreviewTime = int.Parse(val); break; case @"Countdown": - beatmap.BeatmapInfo.Countdown = int.Parse(value) == 1; + beatmap.BeatmapInfo.Countdown = int.Parse(val) == 1; break; case @"SampleSet": - defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), value); + defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), val); break; case @"SampleVolume": - defaultSampleVolume = int.Parse(value); + defaultSampleVolume = int.Parse(val); break; case @"StackLeniency": - beatmap.BeatmapInfo.StackLeniency = float.Parse(value, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"Mode": - beatmap.BeatmapInfo.RulesetID = int.Parse(value); + beatmap.BeatmapInfo.RulesetID = int.Parse(val); switch (beatmap.BeatmapInfo.RulesetID) { @@ -108,100 +108,100 @@ namespace osu.Game.Beatmaps.Formats } break; case @"LetterboxInBreaks": - beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(value) == 1; + beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; break; case @"SpecialStyle": - beatmap.BeatmapInfo.SpecialStyle = int.Parse(value) == 1; + beatmap.BeatmapInfo.SpecialStyle = int.Parse(val) == 1; break; case @"WidescreenStoryboard": - beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(value) == 1; + beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(val) == 1; break; } } - private void handleEditor(Beatmap beatmap, string key, string value) + private void handleEditor(Beatmap beatmap, string key, string val) { switch (key) { case @"Bookmarks": - beatmap.BeatmapInfo.StoredBookmarks = value; + beatmap.BeatmapInfo.StoredBookmarks = val; break; case @"DistanceSpacing": - beatmap.BeatmapInfo.DistanceSpacing = double.Parse(value, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.DistanceSpacing = double.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"BeatDivisor": - beatmap.BeatmapInfo.BeatDivisor = int.Parse(value); + beatmap.BeatmapInfo.BeatDivisor = int.Parse(val); break; case @"GridSize": - beatmap.BeatmapInfo.GridSize = int.Parse(value); + beatmap.BeatmapInfo.GridSize = int.Parse(val); break; case @"TimelineZoom": - beatmap.BeatmapInfo.TimelineZoom = double.Parse(value, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.TimelineZoom = double.Parse(val, NumberFormatInfo.InvariantInfo); break; } } - private void handleMetadata(Beatmap beatmap, string key, string value) + private void handleMetadata(Beatmap beatmap, string key, string val) { var metadata = beatmap.BeatmapInfo.Metadata; switch (key) { case @"Title": - metadata.Title = value; + metadata.Title = val; break; case @"TitleUnicode": - metadata.TitleUnicode = value; + metadata.TitleUnicode = val; break; case @"Artist": - metadata.Artist = value; + metadata.Artist = val; break; case @"ArtistUnicode": - metadata.ArtistUnicode = value; + metadata.ArtistUnicode = val; break; case @"Creator": - metadata.Author = value; + metadata.Author = val; break; case @"Version": - beatmap.BeatmapInfo.Version = value; + beatmap.BeatmapInfo.Version = val; break; case @"Source": - beatmap.BeatmapInfo.Metadata.Source = value; + beatmap.BeatmapInfo.Metadata.Source = val; break; case @"Tags": - beatmap.BeatmapInfo.Metadata.Tags = value; + beatmap.BeatmapInfo.Metadata.Tags = val; break; case @"BeatmapID": - beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(value); + beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(val); break; case @"BeatmapSetID": - beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(value); - metadata.OnlineBeatmapSetID = int.Parse(value); + beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(val); + metadata.OnlineBeatmapSetID = int.Parse(val); break; } } - private void handleDifficulty(Beatmap beatmap, string key, string value) + private void handleDifficulty(Beatmap beatmap, string key, string val) { var difficulty = beatmap.BeatmapInfo.Difficulty; switch (key) { case @"HPDrainRate": - difficulty.DrainRate = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.DrainRate = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"CircleSize": - difficulty.CircleSize = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.CircleSize = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"OverallDifficulty": - difficulty.OverallDifficulty = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.OverallDifficulty = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"ApproachRate": - difficulty.ApproachRate = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.ApproachRate = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"SliderMultiplier": - difficulty.SliderMultiplier = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.SliderMultiplier = float.Parse(val, NumberFormatInfo.InvariantInfo); break; case @"SliderTickRate": - difficulty.SliderTickRate = float.Parse(value, NumberFormatInfo.InvariantInfo); + difficulty.SliderTickRate = float.Parse(val, NumberFormatInfo.InvariantInfo); break; } } @@ -347,12 +347,12 @@ namespace osu.Game.Beatmaps.Formats } } - private void handleColours(Beatmap beatmap, string key, string value, ref bool hasCustomColours) + private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours) { - string[] split = value.Split(','); + string[] split = val.Split(','); if (split.Length != 3) - throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {value}"); + throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}"); byte r, g, b; if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b)) @@ -416,7 +416,7 @@ namespace osu.Game.Beatmaps.Formats continue; } - string key = null, value = null; + string key = null, val = null; switch (section) { @@ -426,27 +426,27 @@ namespace osu.Game.Beatmaps.Formats case Section.Difficulty: case Section.Colours: key = line.Remove(line.IndexOf(':')).Trim(); - value = line.Substring(line.IndexOf(':') + 1).Trim(); + val = line.Substring(line.IndexOf(':') + 1).Trim(); break; case Section.Variables: key = line.Remove(line.IndexOf('=')).Trim(); - value = line.Substring(line.IndexOf('=') + 1).Trim(); + val = line.Substring(line.IndexOf('=') + 1).Trim(); break; } switch (section) { case Section.General: - handleGeneral(beatmap, key, value); + handleGeneral(beatmap, key, val); break; case Section.Editor: - handleEditor(beatmap, key, value); + handleEditor(beatmap, key, val); break; case Section.Metadata: - handleMetadata(beatmap, key, value); + handleMetadata(beatmap, key, val); break; case Section.Difficulty: - handleDifficulty(beatmap, key, value); + handleDifficulty(beatmap, key, val); break; case Section.Events: handleEvents(beatmap, line); @@ -455,7 +455,7 @@ namespace osu.Game.Beatmaps.Formats handleTimingPoints(beatmap, line); break; case Section.Colours: - handleColours(beatmap, key, value, ref hasCustomColours); + handleColours(beatmap, key, val, ref hasCustomColours); break; case Section.HitObjects: var obj = parser.Parse(line); @@ -465,7 +465,7 @@ namespace osu.Game.Beatmaps.Formats break; case Section.Variables: - variables[key] = value; + variables[key] = val; break; } } From 223c75327ffa75ca678eb6f6e656bc1b9280cb65 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 30 May 2017 20:59:46 +0900 Subject: [PATCH 08/28] Remove key/val in favor of local variables + method call. --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 145 +++++++++--------- 1 file changed, 76 insertions(+), 69 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index 23f6c869ea..4c540fa8cf 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -62,34 +62,36 @@ namespace osu.Game.Beatmaps.Formats Variables, } - private void handleGeneral(Beatmap beatmap, string key, string val) + private void handleGeneral(Beatmap beatmap, string line) { + var pair = splitKeyVal(line, ':'); + var metadata = beatmap.BeatmapInfo.Metadata; - switch (key) + switch (pair.Key) { case @"AudioFilename": - metadata.AudioFile = val; + metadata.AudioFile = pair.Value; break; case @"AudioLeadIn": - beatmap.BeatmapInfo.AudioLeadIn = int.Parse(val); + beatmap.BeatmapInfo.AudioLeadIn = int.Parse(pair.Value); break; case @"PreviewTime": - metadata.PreviewTime = int.Parse(val); + metadata.PreviewTime = int.Parse(pair.Value); break; case @"Countdown": - beatmap.BeatmapInfo.Countdown = int.Parse(val) == 1; + beatmap.BeatmapInfo.Countdown = int.Parse(pair.Value) == 1; break; case @"SampleSet": - defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), val); + defaultSampleBank = (LegacySampleBank)Enum.Parse(typeof(LegacySampleBank), pair.Value); break; case @"SampleVolume": - defaultSampleVolume = int.Parse(val); + defaultSampleVolume = int.Parse(pair.Value); break; case @"StackLeniency": - beatmap.BeatmapInfo.StackLeniency = float.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.StackLeniency = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"Mode": - beatmap.BeatmapInfo.RulesetID = int.Parse(val); + beatmap.BeatmapInfo.RulesetID = int.Parse(pair.Value); switch (beatmap.BeatmapInfo.RulesetID) { @@ -108,100 +110,106 @@ namespace osu.Game.Beatmaps.Formats } break; case @"LetterboxInBreaks": - beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(val) == 1; + beatmap.BeatmapInfo.LetterboxInBreaks = int.Parse(pair.Value) == 1; break; case @"SpecialStyle": - beatmap.BeatmapInfo.SpecialStyle = int.Parse(val) == 1; + beatmap.BeatmapInfo.SpecialStyle = int.Parse(pair.Value) == 1; break; case @"WidescreenStoryboard": - beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(val) == 1; + beatmap.BeatmapInfo.WidescreenStoryboard = int.Parse(pair.Value) == 1; break; } } - private void handleEditor(Beatmap beatmap, string key, string val) + private void handleEditor(Beatmap beatmap, string line) { - switch (key) + var pair = splitKeyVal(line, ':'); + + switch (pair.Key) { case @"Bookmarks": - beatmap.BeatmapInfo.StoredBookmarks = val; + beatmap.BeatmapInfo.StoredBookmarks = pair.Value; break; case @"DistanceSpacing": - beatmap.BeatmapInfo.DistanceSpacing = double.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.DistanceSpacing = double.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"BeatDivisor": - beatmap.BeatmapInfo.BeatDivisor = int.Parse(val); + beatmap.BeatmapInfo.BeatDivisor = int.Parse(pair.Value); break; case @"GridSize": - beatmap.BeatmapInfo.GridSize = int.Parse(val); + beatmap.BeatmapInfo.GridSize = int.Parse(pair.Value); break; case @"TimelineZoom": - beatmap.BeatmapInfo.TimelineZoom = double.Parse(val, NumberFormatInfo.InvariantInfo); + beatmap.BeatmapInfo.TimelineZoom = double.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; } } - private void handleMetadata(Beatmap beatmap, string key, string val) + private void handleMetadata(Beatmap beatmap, string line) { + var pair = splitKeyVal(line, ':'); + var metadata = beatmap.BeatmapInfo.Metadata; - switch (key) + switch (pair.Key) { case @"Title": - metadata.Title = val; + metadata.Title = pair.Value; break; case @"TitleUnicode": - metadata.TitleUnicode = val; + metadata.TitleUnicode = pair.Value; break; case @"Artist": - metadata.Artist = val; + metadata.Artist = pair.Value; break; case @"ArtistUnicode": - metadata.ArtistUnicode = val; + metadata.ArtistUnicode = pair.Value; break; case @"Creator": - metadata.Author = val; + metadata.Author = pair.Value; break; case @"Version": - beatmap.BeatmapInfo.Version = val; + beatmap.BeatmapInfo.Version = pair.Value; break; case @"Source": - beatmap.BeatmapInfo.Metadata.Source = val; + beatmap.BeatmapInfo.Metadata.Source = pair.Value; break; case @"Tags": - beatmap.BeatmapInfo.Metadata.Tags = val; + beatmap.BeatmapInfo.Metadata.Tags = pair.Value; break; case @"BeatmapID": - beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(val); + beatmap.BeatmapInfo.OnlineBeatmapID = int.Parse(pair.Value); break; case @"BeatmapSetID": - beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(val); - metadata.OnlineBeatmapSetID = int.Parse(val); + beatmap.BeatmapInfo.OnlineBeatmapSetID = int.Parse(pair.Value); + metadata.OnlineBeatmapSetID = int.Parse(pair.Value); break; } } - private void handleDifficulty(Beatmap beatmap, string key, string val) + private void handleDifficulty(Beatmap beatmap, string line) { + var pair = splitKeyVal(line, ':'); + var difficulty = beatmap.BeatmapInfo.Difficulty; - switch (key) + switch (pair.Key) { case @"HPDrainRate": - difficulty.DrainRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.DrainRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"CircleSize": - difficulty.CircleSize = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.CircleSize = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"OverallDifficulty": - difficulty.OverallDifficulty = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.OverallDifficulty = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"ApproachRate": - difficulty.ApproachRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.ApproachRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"SliderMultiplier": - difficulty.SliderMultiplier = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.SliderMultiplier = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; case @"SliderTickRate": - difficulty.SliderTickRate = float.Parse(val, NumberFormatInfo.InvariantInfo); + difficulty.SliderTickRate = float.Parse(pair.Value, NumberFormatInfo.InvariantInfo); break; } } @@ -347,12 +355,14 @@ namespace osu.Game.Beatmaps.Formats } } - private void handleColours(Beatmap beatmap, string key, string val, ref bool hasCustomColours) + private void handleColours(Beatmap beatmap, string line, ref bool hasCustomColours) { - string[] split = val.Split(','); + var pair = splitKeyVal(line, ':'); + + string[] split = pair.Value.Split(','); if (split.Length != 3) - throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {val}"); + throw new InvalidOperationException($@"Color specified in incorrect format (should be R,G,B): {pair.Value}"); byte r, g, b; if (!byte.TryParse(split[0], out r) || !byte.TryParse(split[1], out g) || !byte.TryParse(split[2], out b)) @@ -365,7 +375,7 @@ namespace osu.Game.Beatmaps.Formats } // Note: the combo index specified in the beatmap is discarded - if (key.StartsWith(@"Combo")) + if (pair.Key.StartsWith(@"Combo")) { beatmap.ComboColors.Add(new Color4 { @@ -377,6 +387,12 @@ namespace osu.Game.Beatmaps.Formats } } + private void handleVariables(string line) + { + var pair = splitKeyVal(line, '='); + variables[pair.Key] = pair.Value; + } + protected override Beatmap ParseFile(StreamReader stream) { return new LegacyBeatmap(base.ParseFile(stream)); @@ -416,37 +432,19 @@ namespace osu.Game.Beatmaps.Formats continue; } - string key = null, val = null; - switch (section) { case Section.General: - case Section.Editor: - case Section.Metadata: - case Section.Difficulty: - case Section.Colours: - key = line.Remove(line.IndexOf(':')).Trim(); - val = line.Substring(line.IndexOf(':') + 1).Trim(); - break; - case Section.Variables: - key = line.Remove(line.IndexOf('=')).Trim(); - val = line.Substring(line.IndexOf('=') + 1).Trim(); - break; - } - - switch (section) - { - case Section.General: - handleGeneral(beatmap, key, val); + handleGeneral(beatmap, line); break; case Section.Editor: - handleEditor(beatmap, key, val); + handleEditor(beatmap, line); break; case Section.Metadata: - handleMetadata(beatmap, key, val); + handleMetadata(beatmap, line); break; case Section.Difficulty: - handleDifficulty(beatmap, key, val); + handleDifficulty(beatmap, line); break; case Section.Events: handleEvents(beatmap, line); @@ -455,7 +453,7 @@ namespace osu.Game.Beatmaps.Formats handleTimingPoints(beatmap, line); break; case Section.Colours: - handleColours(beatmap, key, val, ref hasCustomColours); + handleColours(beatmap, line, ref hasCustomColours); break; case Section.HitObjects: var obj = parser.Parse(line); @@ -465,7 +463,7 @@ namespace osu.Game.Beatmaps.Formats break; case Section.Variables: - variables[key] = val; + handleVariables(line); break; } } @@ -474,6 +472,15 @@ namespace osu.Game.Beatmaps.Formats hitObject.ApplyDefaults(beatmap.ControlPointInfo, beatmap.BeatmapInfo.Difficulty); } + private KeyValuePair splitKeyVal(string line, char separator) + { + return new KeyValuePair + ( + line.Remove(line.IndexOf(separator)).Trim(), + line.Substring(line.IndexOf(separator) + 1).Trim() + ); + } + internal enum LegacySampleBank { None = 0, From ecc0d0b11c14073f9f7a675cc4825aaeac861d7c Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Tue, 30 May 2017 12:49:06 -0400 Subject: [PATCH 09/28] Daycore mod --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Catch/Mods/CatchMod.cs | 5 +++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 5 +++++ osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 5 +++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs | 5 +++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 9 ++++++++- osu.Game/Rulesets/Mods/ModDaycore.cs | 25 ++++++++++++++++++++++++ osu.Game/Rulesets/Mods/ModHalfTime.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 11 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 osu.Game/Rulesets/Mods/ModDaycore.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 53449fd5f5..df212f7df7 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Catch { new CatchModEasy(), new CatchModNoFail(), - new CatchModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new CatchModHalfTime(), + new CatchModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs index 64a0c51b72..b0880d7e1d 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs @@ -32,6 +32,11 @@ namespace osu.Game.Rulesets.Catch.Mods } + public class CatchModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class CatchModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.06; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 30d1846746..0af8825208 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -27,7 +27,14 @@ namespace osu.Game.Rulesets.Mania { new ManiaModEasy(), new ManiaModNoFail(), - new ManiaModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new ManiaModHalfTime(), + new ManiaModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index b402d3a010..f64f96e6c2 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Mania.Mods } + public class ManiaModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class ManiaModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.0; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index cc06946d38..3b0cfc1ef1 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -39,6 +39,11 @@ namespace osu.Game.Rulesets.Osu.Mods public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); } + public class OsuModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class OsuModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.12; diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index af4a099e0d..bfed889b36 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -46,7 +46,14 @@ namespace osu.Game.Rulesets.Osu { new OsuModEasy(), new OsuModNoFail(), - new OsuModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new OsuModHalfTime(), + new OsuModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs index 8b7a099b9a..abaa8c1bc1 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs @@ -37,6 +37,11 @@ namespace osu.Game.Rulesets.Taiko.Mods } + public class TaikoModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class TaikoModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.12; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 7c169f820b..303d936fb9 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Taiko { new TaikoModEasy(), new TaikoModNoFail(), - new TaikoModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new TaikoModHalfTime(), + new TaikoModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs new file mode 100644 index 0000000000..2853a7372f --- /dev/null +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Audio; +using osu.Framework.Timing; +using osu.Game.Graphics; + +namespace osu.Game.Rulesets.Mods +{ + public abstract class ModDaycore : ModHalfTime + { + public override string Name => "Daycore"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; + public override string Description => "whoaaaaa"; + + public override void ApplyToClock(IAdjustableClock clock) + { + var pitchAdjust = clock as IHasPitchAdjust; + if (pitchAdjust != null) + pitchAdjust.PitchAdjust = 0.75; + else + base.ApplyToClock(clock); + } + } +} \ No newline at end of file diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index 207a6ec2a1..14aede0809 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 1.12; - public void ApplyToClock(IAdjustableClock clock) + public virtual void ApplyToClock(IAdjustableClock clock) { clock.Rate = 0.75; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0ec0624978..09b7784d47 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -125,6 +125,7 @@ + From cb5fcf2572856d449eadcff83af7008d7bb237a7 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Tue, 30 May 2017 13:27:10 -0400 Subject: [PATCH 10/28] change mania multiplier --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index f64f96e6c2..f44ad6fd60 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModDaycore : ModDaycore { - public override double ScoreMultiplier => 0.5; + public override double ScoreMultiplier => 0.3; } public class ManiaModDoubleTime : ModDoubleTime From 4fd7405fb86ab52d0d2bb5c30cb6c5d78f670b31 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 31 May 2017 01:57:32 -0300 Subject: [PATCH 11/28] Fix user dropdown menu item chevron alignment --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 5 +++-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 14483f3bfb..481430c9cb 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - new OsuSpriteText { + Text = new OsuSpriteText { Text = text, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -85,6 +85,7 @@ namespace osu.Game.Graphics.UserInterface private Color4? accentColour; protected readonly TextAwesome Chevron; + protected readonly OsuSpriteText Text; protected override void FormatForeground(bool hover = false) { @@ -170,4 +171,4 @@ namespace osu.Game.Graphics.UserInterface } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 00ca50927e..022fdb3a3c 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -338,8 +338,8 @@ namespace osu.Game.Overlays.Settings.Sections.General { public UserDropdownMenuItem(string text, UserAction current) : base(text, current) { - Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = UserDropdownHeader.LABEL_LEFT_MARGIN, Right = 5 }; - Chevron.Margin = new MarginPadding { Left = 2, Right = 3 }; + Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 }; + Text.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; CornerRadius = 5; } } From cd5734319144ad61cd161863dc684d87cdb1ede7 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 31 May 2017 02:03:13 -0300 Subject: [PATCH 12/28] Text -> Label --- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 481430c9cb..6dadd63ac4 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, }, - Text = new OsuSpriteText { + Label = new OsuSpriteText { Text = text, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, @@ -85,7 +85,7 @@ namespace osu.Game.Graphics.UserInterface private Color4? accentColour; protected readonly TextAwesome Chevron; - protected readonly OsuSpriteText Text; + protected readonly OsuSpriteText Label; protected override void FormatForeground(bool hover = false) { diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 022fdb3a3c..f336566680 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -339,7 +339,7 @@ namespace osu.Game.Overlays.Settings.Sections.General public UserDropdownMenuItem(string text, UserAction current) : base(text, current) { Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 }; - Text.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; + Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 }; CornerRadius = 5; } } From 0f59645e171413b017b3a0fc3bc6a5afd00c85a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 May 2017 15:51:21 +0900 Subject: [PATCH 13/28] Increase timeout in TestImportOverIPC Has been failing CI randomly, so let's increase the timeout a bit. --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 0e456941a1..7fb01cedc0 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -56,7 +56,7 @@ namespace osu.Game.Tests.Beatmaps.IO Assert.IsTrue(File.Exists(temp)); var importer = new BeatmapIPCChannel(client); - if (!importer.ImportAsync(temp).Wait(5000)) + if (!importer.ImportAsync(temp).Wait(10000)) Assert.Fail(@"IPC took too long to send"); ensureLoaded(host); From 1dd85b598612e6487ac3edec0a72a52a1bcafb1b Mon Sep 17 00:00:00 2001 From: Patrick Andersson Date: Wed, 31 May 2017 18:41:15 +0200 Subject: [PATCH 14/28] Add alternative for random beatmap selection "Never repeat" will not repeat until all songs have been seen by repeatedly pressing F2/Random button --- osu.Game/Configuration/OsuConfigManager.cs | 3 +++ osu.Game/Configuration/SelectionRandomType.cs | 15 +++++++++++ .../Sections/Gameplay/SongSelectSettings.cs | 5 ++++ osu.Game/Screens/Select/BeatmapCarousel.cs | 25 +++++++++++++++++-- osu.Game/osu.Game.csproj | 1 + 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 osu.Game/Configuration/SelectionRandomType.cs diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 8f177d6b56..6ec827e881 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -20,6 +20,8 @@ namespace osu.Game.Configuration Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10); Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10); + Set(OsuSetting.SelectionRandomType, SelectionRandomType.Random); + Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); // Online settings @@ -102,6 +104,7 @@ namespace osu.Game.Configuration SaveUsername, DisplayStarsMinimum, DisplayStarsMaximum, + SelectionRandomType, SnakingInSliders, SnakingOutSliders, ShowFpsDisplay, diff --git a/osu.Game/Configuration/SelectionRandomType.cs b/osu.Game/Configuration/SelectionRandomType.cs new file mode 100644 index 0000000000..a2cd3ba7e8 --- /dev/null +++ b/osu.Game/Configuration/SelectionRandomType.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel; + +namespace osu.Game.Configuration +{ + public enum SelectionRandomType + { + [Description("Random")] + Random, + [Description("Never repeat")] + RandomPermutation + } +} diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 7626911627..62801b2ef6 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -27,6 +27,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay LabelText = "up to", Bindable = config.GetBindable(OsuSetting.DisplayStarsMaximum) }, + new SettingsEnumDropdown + { + LabelText = "Random beatmap selection", + Bindable = config.GetBindable(OsuSetting.SelectionRandomType), + }, }; } diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 130642b9c7..33aca5a96b 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Beatmaps.Drawables; +using osu.Game.Configuration; using osu.Framework.Input; using OpenTK.Input; using System.Collections; @@ -17,6 +18,7 @@ using System.Diagnostics; using System.Threading.Tasks; using osu.Framework.Allocation; using osu.Framework.Threading; +using osu.Framework.Configuration; namespace osu.Game.Screens.Select { @@ -70,6 +72,9 @@ namespace osu.Game.Screens.Select private readonly List groups = new List(); + private Bindable randomType; + private HashSet seenGroups = new HashSet(); + private readonly List panels = new List(); private BeatmapGroup selectedGroup; @@ -171,7 +176,22 @@ namespace osu.Game.Screens.Select if (visibleGroups.Count < 1) return; - BeatmapGroup group = visibleGroups[RNG.Next(visibleGroups.Count)]; + BeatmapGroup group; + if (randomType == SelectionRandomType.RandomPermutation) + { + List notSeenGroups = visibleGroups.Except(seenGroups).ToList(); + if (!notSeenGroups.Any()) + { + seenGroups.Clear(); + notSeenGroups = visibleGroups; + } + + group = notSeenGroups[RNG.Next(notSeenGroups.Count())]; + seenGroups.Add(group); + } + else + group = visibleGroups[RNG.Next(visibleGroups.Count)]; + BeatmapPanel panel = group.BeatmapPanels[RNG.Next(group.BeatmapPanels.Count)]; selectGroup(group, panel); @@ -239,9 +259,10 @@ namespace osu.Game.Screens.Select } [BackgroundDependencyLoader(permitNulls: true)] - private void load(BeatmapDatabase database) + private void load(BeatmapDatabase database, OsuConfigManager config) { this.database = database; + randomType = config.GetBindable(OsuSetting.SelectionRandomType); } private void addGroup(BeatmapGroup group) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0ec0624978..b58e2f8c41 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -74,6 +74,7 @@ + From 9592e9778bea75cfad8865d2ee969f83bc115191 Mon Sep 17 00:00:00 2001 From: Patrick Andersson Date: Wed, 31 May 2017 20:31:05 +0200 Subject: [PATCH 15/28] Trim whitespace --- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 33aca5a96b..2c7fde968e 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -181,7 +181,7 @@ namespace osu.Game.Screens.Select { List notSeenGroups = visibleGroups.Except(seenGroups).ToList(); if (!notSeenGroups.Any()) - { + { seenGroups.Clear(); notSeenGroups = visibleGroups; } From a3945bb11d289709088a3f78fe07bd809167eb51 Mon Sep 17 00:00:00 2001 From: Patrick Andersson Date: Wed, 31 May 2017 22:04:29 +0200 Subject: [PATCH 16/28] Added suggestions by code inspector --- osu.Game/Screens/Select/BeatmapCarousel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 2c7fde968e..7db9803804 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -73,7 +73,7 @@ namespace osu.Game.Screens.Select private readonly List groups = new List(); private Bindable randomType; - private HashSet seenGroups = new HashSet(); + private readonly HashSet seenGroups = new HashSet(); private readonly List panels = new List(); @@ -186,7 +186,7 @@ namespace osu.Game.Screens.Select notSeenGroups = visibleGroups; } - group = notSeenGroups[RNG.Next(notSeenGroups.Count())]; + group = notSeenGroups[RNG.Next(notSeenGroups.Count)]; seenGroups.Add(group); } else From 94294e4b45edf63be1884b7b86ed02a9038625bf Mon Sep 17 00:00:00 2001 From: Patrick Andersson Date: Thu, 1 Jun 2017 08:54:48 +0200 Subject: [PATCH 17/28] Changed default selection type and added suggestions from PR feedback --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- osu.Game/Configuration/SelectionRandomType.cs | 8 ++++---- osu.Game/Screens/Select/BeatmapCarousel.cs | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 6ec827e881..8b2a06ad0b 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -20,7 +20,7 @@ namespace osu.Game.Configuration Set(OsuSetting.DisplayStarsMinimum, 0.0, 0, 10); Set(OsuSetting.DisplayStarsMaximum, 10.0, 0, 10); - Set(OsuSetting.SelectionRandomType, SelectionRandomType.Random); + Set(OsuSetting.SelectionRandomType, SelectionRandomType.RandomPermutation); Set(OsuSetting.ChatDisplayHeight, ChatOverlay.DEFAULT_HEIGHT, 0.2, 1); diff --git a/osu.Game/Configuration/SelectionRandomType.cs b/osu.Game/Configuration/SelectionRandomType.cs index a2cd3ba7e8..298ee71e36 100644 --- a/osu.Game/Configuration/SelectionRandomType.cs +++ b/osu.Game/Configuration/SelectionRandomType.cs @@ -7,9 +7,9 @@ namespace osu.Game.Configuration { public enum SelectionRandomType { - [Description("Random")] - Random, [Description("Never repeat")] - RandomPermutation + RandomPermutation, + [Description("Random")] + Random } -} +} \ No newline at end of file diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 7db9803804..26820fc388 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -73,7 +73,7 @@ namespace osu.Game.Screens.Select private readonly List groups = new List(); private Bindable randomType; - private readonly HashSet seenGroups = new HashSet(); + private readonly List seenGroups = new List(); private readonly List panels = new List(); @@ -172,25 +172,25 @@ namespace osu.Game.Screens.Select public void SelectRandom() { - List visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden).ToList(); - if (visibleGroups.Count < 1) + IEnumerable visibleGroups = groups.Where(selectGroup => selectGroup.State != BeatmapGroupState.Hidden); + if (!visibleGroups.Any()) return; BeatmapGroup group; if (randomType == SelectionRandomType.RandomPermutation) { - List notSeenGroups = visibleGroups.Except(seenGroups).ToList(); + IEnumerable notSeenGroups = visibleGroups.Except(seenGroups); if (!notSeenGroups.Any()) { seenGroups.Clear(); notSeenGroups = visibleGroups; } - group = notSeenGroups[RNG.Next(notSeenGroups.Count)]; + group = notSeenGroups.ElementAt(RNG.Next(notSeenGroups.Count())); seenGroups.Add(group); } else - group = visibleGroups[RNG.Next(visibleGroups.Count)]; + group = visibleGroups.ElementAt(RNG.Next(visibleGroups.Count())); BeatmapPanel panel = group.BeatmapPanels[RNG.Next(group.BeatmapPanels.Count)]; From 5b80c8ac49628e892c892d1e87892c422a143a81 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Jun 2017 18:29:34 +0900 Subject: [PATCH 18/28] Load initial channel content asynchronously Quite often, the first time loading a chat channel will be loading font characters (textures) that were previously never displayed. This stops the game from stuttering in such a scenario. --- osu.Game/Overlays/Chat/DrawableChannel.cs | 13 +++++++---- osu.Game/Overlays/ChatOverlay.cs | 28 +++++++++++++++-------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index 50c849f00e..0cd6b8dd3a 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Online.Chat; @@ -43,11 +44,15 @@ namespace osu.Game.Overlays.Chat channel.NewMessagesArrived += newMessagesArrived; } + [BackgroundDependencyLoader] + private void load() + { + newMessagesArrived(Channel.Messages); + } + protected override void LoadComplete() { base.LoadComplete(); - - newMessagesArrived(Channel.Messages); scrollToEnd(); } @@ -59,13 +64,13 @@ namespace osu.Game.Overlays.Chat private void newMessagesArrived(IEnumerable newMessages) { - if (!IsLoaded) return; - var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY)); //up to last Channel.MAX_HISTORY messages flow.Add(displayMessages.Select(m => new ChatLine(m))); + if (!IsLoaded) return; + if (scroll.IsScrolledToEnd(10) || !flow.Children.Any()) scrollToEnd(); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a9970e5e95..f81c0ea922 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -266,20 +266,30 @@ namespace osu.Game.Overlays if (channelTabs.ChannelSelectorActive) return; - if (currentChannel != null) - currentChannelContainer.Clear(false); - currentChannel = value; + inputTextBox.Current.Disabled = currentChannel.ReadOnly; + channelTabs.Current.Value = value; + var loaded = loadedChannels.Find(d => d.Channel == value); if (loaded == null) - loadedChannels.Add(loaded = new DrawableChannel(currentChannel)); + { + currentChannelContainer.FadeOut(500, EasingTypes.OutQuint); - inputTextBox.Current.Disabled = currentChannel.ReadOnly; - - currentChannelContainer.Add(loaded); - - channelTabs.Current.Value = value; + loaded = new DrawableChannel(currentChannel); + loadedChannels.Add(loaded); + LoadComponentAsync(loaded, l => + { + currentChannelContainer.Clear(false); + currentChannelContainer.Add(l); + currentChannelContainer.FadeIn(500, EasingTypes.OutQuint); + }); + } + else + { + currentChannelContainer.Clear(false); + currentChannelContainer.Add(loaded); + } } } From a43890ffb40f3b7876c6d062d505e68ecaef522e Mon Sep 17 00:00:00 2001 From: Jorolf Date: Sat, 3 Jun 2017 14:50:35 +0200 Subject: [PATCH 19/28] update osu to use the framework's TooltipContainer --- .../Tests/TestCaseTooltip.cs | 1 + .../Graphics/Cursor/OsuTooltipContainer.cs | 97 +++++++++++ osu.Game/Graphics/Cursor/TooltipContainer.cs | 157 ------------------ osu.Game/Graphics/IHasTooltip.cs | 15 -- .../Graphics/UserInterface/OsuSliderBar.cs | 1 + osu.Game/OsuGameBase.cs | 2 +- osu.Game/Overlays/Mods/ModButton.cs | 2 +- osu.Game/osu.Game.csproj | 3 +- 8 files changed, 102 insertions(+), 176 deletions(-) create mode 100644 osu.Game/Graphics/Cursor/OsuTooltipContainer.cs delete mode 100644 osu.Game/Graphics/Cursor/TooltipContainer.cs delete mode 100644 osu.Game/Graphics/IHasTooltip.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs index c536672314..bc3a48fcab 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs @@ -9,6 +9,7 @@ using osu.Game.Graphics.UserInterface; using osu.Framework.Configuration; using OpenTK; using osu.Game.Graphics; +using osu.Framework.Graphics.Cursor; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs new file mode 100644 index 0000000000..902e92e880 --- /dev/null +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Input; +using osu.Framework.Threading; +using osu.Game.Graphics.Sprites; +using System.Linq; + +namespace osu.Game.Graphics.Cursor +{ + public class OsuTooltipContainer : TooltipContainer + { + protected override Tooltip CreateTooltip() => new OsuTooltip(); + + public OsuTooltipContainer(CursorContainer cursor) : base(cursor) + { + } + + public class OsuTooltip : Tooltip + { + private readonly Box background; + private readonly OsuSpriteText text; + + public override string TooltipText + { + set + { + if (value == text.Text) return; + + text.Text = value; + if (Alpha > 0) + { + AutoSizeDuration = 250; + background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint); + } + else + AutoSizeDuration = 0; + } + } + + private const float text_size = 16; + + public OsuTooltip() + { + AutoSizeEasing = EasingTypes.OutQuint; + + CornerRadius = 5; + Masking = true; + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(40), + Radius = 5, + }; + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.9f, + }, + text = new OsuSpriteText + { + TextSize = text_size, + Padding = new MarginPadding(5), + Font = @"Exo2.0-Regular", + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + background.Colour = colour.Gray3; + } + + protected override void PopIn() + { + FadeIn(500, EasingTypes.OutQuint); + } + + protected override void PopOut() + { + using (BeginDelayedSequence(150)) + FadeOut(500, EasingTypes.OutQuint); + } + } + } +} diff --git a/osu.Game/Graphics/Cursor/TooltipContainer.cs b/osu.Game/Graphics/Cursor/TooltipContainer.cs deleted file mode 100644 index c5b8382816..0000000000 --- a/osu.Game/Graphics/Cursor/TooltipContainer.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; -using osu.Framework.Threading; -using osu.Game.Graphics.Sprites; -using System.Linq; - -namespace osu.Game.Graphics.Cursor -{ - public class TooltipContainer : Container - { - private readonly CursorContainer cursor; - private readonly Tooltip tooltip; - - private ScheduledDelegate findTooltipTask; - private UserInputManager inputManager; - - private const int default_appear_delay = 220; - - private IHasTooltip currentlyDisplayed; - - public TooltipContainer(CursorContainer cursor) - { - this.cursor = cursor; - AlwaysPresent = true; - RelativeSizeAxes = Axes.Both; - Add(tooltip = new Tooltip { Alpha = 0 }); - } - - [BackgroundDependencyLoader] - private void load(UserInputManager input) - { - inputManager = input; - } - - protected override void Update() - { - if (tooltip.IsPresent) - { - if (currentlyDisplayed != null) - tooltip.TooltipText = currentlyDisplayed.TooltipText; - - //update the position of the displayed tooltip. - tooltip.Position = ToLocalSpace(cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre) + new Vector2(10); - } - } - - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) - { - updateTooltipState(state); - return base.OnMouseUp(state, args); - } - - protected override bool OnMouseMove(InputState state) - { - updateTooltipState(state); - return base.OnMouseMove(state); - } - - private void updateTooltipState(InputState state) - { - if (currentlyDisplayed?.Hovering != true) - { - if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed) - { - tooltip.Delay(150); - tooltip.FadeOut(500, EasingTypes.OutQuint); - currentlyDisplayed = null; - } - - findTooltipTask?.Cancel(); - findTooltipTask = Scheduler.AddDelayed(delegate - { - var tooltipTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(); - - if (tooltipTarget == null) return; - - tooltip.TooltipText = tooltipTarget.TooltipText; - tooltip.FadeIn(500, EasingTypes.OutQuint); - - currentlyDisplayed = tooltipTarget; - }, (1 - tooltip.Alpha) * default_appear_delay); - } - } - - public class Tooltip : Container - { - private readonly Box background; - private readonly OsuSpriteText text; - - public string TooltipText - { - set - { - if (value == text.Text) return; - - text.Text = value; - if (Alpha > 0) - { - AutoSizeDuration = 250; - background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint); - } - else - AutoSizeDuration = 0; - } - } - - public override bool HandleInput => false; - - private const float text_size = 16; - - public Tooltip() - { - AutoSizeEasing = EasingTypes.OutQuint; - AutoSizeAxes = Axes.Both; - - CornerRadius = 5; - Masking = true; - EdgeEffect = new EdgeEffect - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(40), - Radius = 5, - }; - Children = new Drawable[] - { - background = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0.9f, - }, - text = new OsuSpriteText - { - TextSize = text_size, - Padding = new MarginPadding(5), - Font = @"Exo2.0-Regular", - } - }; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colour) - { - background.Colour = colour.Gray3; - } - } - } -} diff --git a/osu.Game/Graphics/IHasTooltip.cs b/osu.Game/Graphics/IHasTooltip.cs deleted file mode 100644 index dd51d68c41..0000000000 --- a/osu.Game/Graphics/IHasTooltip.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics; - -namespace osu.Game.Graphics -{ - public interface IHasTooltip : IDrawable - { - /// - /// Tooltip that shows when hovering the drawable - /// - string TooltipText { get; } - } -} diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 6cf7b2dfa5..c8be085b51 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 2c39a82245..b228b6485a 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -158,7 +158,7 @@ namespace osu.Game Children = new Drawable[] { Cursor = new MenuCursor(), - new TooltipContainer(Cursor) { Depth = -1 }, + new OsuTooltipContainer(Cursor) { Depth = -1 }, } }, } diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index f7df67b66d..dd135e43ef 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using System; using System.Linq; -using osu.Game.Graphics; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b58e2f8c41..6b3b4d01ba 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -105,7 +105,6 @@ - @@ -118,7 +117,7 @@ - + From 50158a1cd2b95f33319b9515e70cc9bd78364cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 16:34:00 +0200 Subject: [PATCH 20/28] Fix incorrect proportions of menu cursor --- osu-framework | 2 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu-framework b/osu-framework index e5f0cf73c1..8e1aa80d64 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e5f0cf73c1e0bbcbd04194bf175d73af47fc850a +Subproject commit 8e1aa80d64094f9c2590278b990ba17c2fb38f0b diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index b48ab879a6..82ae424ab0 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -93,6 +93,7 @@ namespace osu.Game.Graphics.Cursor { private Container cursorContainer; private Bindable cursorScale; + private const float base_scale = 0.15f; public Sprite AdditiveLayer; @@ -108,17 +109,15 @@ namespace osu.Game.Graphics.Cursor { cursorContainer = new Container { - Size = new Vector2(32), + AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Sprite { - FillMode = FillMode.Fit, Texture = textures.Get(@"Cursor/menu-cursor"), }, AdditiveLayer = new Sprite { - FillMode = FillMode.Fit, BlendingMode = BlendingMode.Additive, Colour = colour.Pink, Alpha = 0, @@ -129,7 +128,7 @@ namespace osu.Game.Graphics.Cursor }; cursorScale = config.GetBindable(OsuSetting.MenuCursorSize); - cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale); + cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale); cursorScale.TriggerChange(); } } From b2bbf65e39df25328ce642108f70b0cf37f12069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:01:21 +0200 Subject: [PATCH 21/28] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8e1aa80d64..c76d8b811b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8e1aa80d64094f9c2590278b990ba17c2fb38f0b +Subproject commit c76d8b811b93d0c0862f342ebbab70a461006e13 From 9c6ce230bca4a6c131b3cd849cb888c610b7c85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:17:56 +0200 Subject: [PATCH 22/28] Fix compile error --- osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs index 2b52b06abc..89b4a90010 100644 --- a/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs +++ b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs @@ -11,6 +11,6 @@ namespace osu.Game.Graphics.Containers public class ReverseDepthFillFlowContainer : FillFlowContainer where T : Drawable { protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); - protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); } } From 3daae480d22ef7620a67e45d9c9cfbf3b919c040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:28:34 +0200 Subject: [PATCH 23/28] Remove TestCaseTooltip --- .../Tests/TestCaseTooltip.cs | 93 ------------------- .../osu.Desktop.VisualTests.csproj | 1 - 2 files changed, 94 deletions(-) delete mode 100644 osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs deleted file mode 100644 index bc3a48fcab..0000000000 --- a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Testing; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Framework.Configuration; -using OpenTK; -using osu.Game.Graphics; -using osu.Framework.Graphics.Cursor; - -namespace osu.Desktop.VisualTests.Tests -{ - internal class TestCaseTooltip : TestCase - { - public override string Description => "tests tooltips on various elements"; - - public override void Reset() - { - base.Reset(); - OsuSliderBar slider; - OsuSliderBar sliderDouble; - - const float width = 400; - - Children = new Drawable[] - { - new FillFlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 10), - Children = new Drawable[] - { - new TooltipTextContainer("text with a tooltip"), - new TooltipTextContainer("more text with another tooltip"), - new TooltipTextbox - { - Text = "a textbox with a tooltip", - Size = new Vector2(width,30), - }, - slider = new OsuSliderBar - { - Width = width, - }, - sliderDouble = new OsuSliderBar - { - Width = width, - }, - }, - }, - }; - - slider.Current.BindTo(new BindableInt(5) - { - MaxValue = 10, - MinValue = 0 - }); - - sliderDouble.Current.BindTo(new BindableDouble(0.5) - { - MaxValue = 1, - MinValue = 0 - }); - } - - private class TooltipTextContainer : Container, IHasTooltip - { - private readonly OsuSpriteText text; - - public string TooltipText => text.Text; - - public TooltipTextContainer(string tooltipText) - { - AutoSizeAxes = Axes.Both; - Children = new[] - { - text = new OsuSpriteText - { - Text = tooltipText, - } - }; - } - } - - private class TooltipTextbox : OsuTextBox, IHasTooltip - { - public string TooltipText => Text; - } - } -} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 5a532d7234..850c38cc24 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -208,7 +208,6 @@ - From 2c5979ea8ae954a3bfcbf70dd4c56bfff614d69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:29:20 +0200 Subject: [PATCH 24/28] Remove unnecessary usings --- osu.Game/Graphics/Cursor/OsuTooltipContainer.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs index 902e92e880..46addf5ac2 100644 --- a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; @@ -9,10 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; -using osu.Framework.Threading; using osu.Game.Graphics.Sprites; -using System.Linq; namespace osu.Game.Graphics.Cursor { From 8cd2f509efc095d0b9a3c34bb8b7152764840a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:33:24 +0200 Subject: [PATCH 25/28] Move skip button into its own test, because it is no longer two-layered --- .../Tests/TestCaseSkipButton.cs | 21 +++++++++++++++++++ .../Tests/TestCaseTwoLayerButton.cs | 4 +--- .../osu.Desktop.VisualTests.csproj | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs new file mode 100644 index 0000000000..c9244516eb --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Testing; +using osu.Game.Graphics.UserInterface; +using osu.Game.Screens.Play; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseSkipButton : TestCase + { + public override string Description => @"Skip skip skippediskip"; + + public override void Reset() + { + base.Reset(); + + Add(new SkipButton(Clock.CurrentTime + 5000)); + } + } +} diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs b/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs index ba17cfc3d8..2decb4c469 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTwoLayerButton.cs @@ -3,20 +3,18 @@ using osu.Framework.Testing; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests { internal class TestCaseTwoLayerButton : TestCase { - public override string Description => @"Back and skip and what not"; + public override string Description => @"Mostly back button"; public override void Reset() { base.Reset(); Add(new BackButton()); - Add(new SkipButton(Clock.CurrentTime + 5000)); } } } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 5a532d7234..8b4edb3192 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -203,6 +203,7 @@ + From d498a4a0224d3dfc476fa777284294293d24b5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:45:44 +0200 Subject: [PATCH 26/28] Trim whitespace --- osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs index c9244516eb..04ff794dd8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs @@ -14,7 +14,6 @@ namespace osu.Desktop.VisualTests.Tests public override void Reset() { base.Reset(); - Add(new SkipButton(Clock.CurrentTime + 5000)); } } From 0afb188cde87ea1975d327653b1a4b791c943d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 20:05:37 +0200 Subject: [PATCH 27/28] Remove unused using --- osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs index 04ff794dd8..fb5be719c1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseSkipButton.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Testing; -using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play; namespace osu.Desktop.VisualTests.Tests From 52bb2df69b402510c5b57b0d731f64c5aea18132 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 5 Jun 2017 09:40:22 +0900 Subject: [PATCH 28/28] Change to fa_question for now, pending flyte redesign. --- osu.Game/Rulesets/Mods/ModDaycore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index 2853a7372f..3e878d7104 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModDaycore : ModHalfTime { public override string Name => "Daycore"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; + public override FontAwesome Icon => FontAwesome.fa_question; public override string Description => "whoaaaaa"; public override void ApplyToClock(IAdjustableClock clock)