From 01bea3bada24b6540631dfe7eadb695c93dc33a6 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 10:56:48 +0100 Subject: [PATCH 001/628] Re-implemented message formatting (mostly taken from osu-stable code) --- osu.Game/Online/Chat/MessageFormatter.cs | 169 +++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 osu.Game/Online/Chat/MessageFormatter.cs diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs new file mode 100644 index 0000000000..df77b5d058 --- /dev/null +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace osu.Game.Online.Chat +{ + public static class MessageFormatter + { + // [[Performance Points]] -> wiki:Performance Points (https://osu.ppy.sh/wiki/Performance_Points) + private static Regex wikiRegex = new Regex(@"\[\[([^\]]+)\]\]"); + + // (test)[https://osu.ppy.sh/b/1234] -> test (https://osu.ppy.sh/b/1234) + private static Regex oldLinkRegex = new Regex(@"\(([^\)]*)\)\[([a-z]+://[^ ]+)\]"); + + // [https://osu.ppy.sh/b/1234 Beatmap [Hard] (poop)] -> Beatmap [hard] (poop) (https://osu.ppy.sh/b/1234) + private static Regex newLinkRegex = new Regex(@"\[([a-z]+://[^ ]+) ([^\[\]]*(((?\[)[^\[\]]*)+((?\])[^\[\]]*)+)*(?(open)(?!)))\]"); + + // advanced, RFC-compatible regular expression that matches any possible URL, *but* allows certain invalid characters that are widely used + // This is in the format (, [optional]): + // http[s]://.[:port][/path][?query][#fragment] + private static Regex advancedLinkRegex = new Regex(@"(?\([^)]*)?" + + @"(?https?:\/\/" + + @"(?(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z][a-z0-9-]*[a-z0-9]" + // domain, TLD + @"(?::\d+)?)" + // port + @"(?(?:(?:\/+(?:[a-z0-9$_\.\+!\*\',;:\(\)@&~=-]|%[0-9a-f]{2})*)*" + // path + @"(?:\?(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?" + // query + @"(?:#(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?)", // fragment + RegexOptions.IgnoreCase); + + // 00:00:000 (1,2,3) - test + private static Regex timeRegex = new Regex(@"\d\d:\d\d:\d\d\d? [^-]*"); + + // #osu + private static Regex channelRegex = new Regex(@"#[a-zA-Z]+[a-zA-Z0-9]+"); + + // Unicode emojis + private static Regex emojiRegex = new Regex(@"(\uD83D[\uDC00-\uDE4F])"); + + private static void handleMatches(Regex regex, string display, string link, MessageFormatterResult result, int startIndex = 0) + { + int captureOffset = 0; + foreach (Match m in regex.Matches(result.Text, startIndex)) + { + var index = m.Index - captureOffset; + + var displayText = string.Format(display, + m.Groups[0], + m.Groups.Count > 1 ? m.Groups[1].Value : "", + m.Groups.Count > 2 ? m.Groups[2].Value : "").Trim(); + + var linkText = string.Format(link, + m.Groups[0], + m.Groups.Count > 1 ? m.Groups[1].Value : "", + m.Groups.Count > 2 ? m.Groups[2].Value : "").Trim(); + + var testText = string.Format(link, m.Groups).Trim(); + + if (displayText.Length == 0 || linkText.Length == 0) continue; + + // Check for encapsulated links + if (result.Links.Find(l => (l.Index <= index && l.Index + l.Length >= index + m.Length) || index <= l.Index && index + m.Length >= l.Index + l.Length) == null) + { + result.Text = result.Text.Remove(index, m.Length).Insert(index, displayText); + + //since we just changed the line display text, offset any already processed links. + result.Links.ForEach(l => l.Index -= l.Index > index ? m.Length - displayText.Length : 0); + + result.Links.Add(new Link(linkText, index, displayText.Length)); + + //adjust the offset for processing the current matches group. + captureOffset += (m.Length - displayText.Length); + } + } + } + + private static void handleAdvanced(Regex regex, MessageFormatterResult result, int startIndex = 0) + { + foreach (Match m in regex.Matches(result.Text, startIndex)) + { + var index = m.Index; + var prefix = m.Groups["paren"].Value; + var link = m.Groups["link"].Value; + var indexLength = link.Length; + + if (!String.IsNullOrEmpty(prefix)) + { + index += prefix.Length; + if (link.EndsWith(")")) + { + indexLength = indexLength - 1; + link = link.Remove(link.Length - 1); + } + } + + result.Links.Add(new Link(link, index, indexLength)); + } + } + + private static MessageFormatterResult format(string toFormat, int startIndex = 0, int space = 3) + { + var result = new MessageFormatterResult(toFormat); + + // handle the [link display] format + handleMatches(newLinkRegex, "{2}", "{1}", result, startIndex); + + // handle the ()[] link format + handleMatches(oldLinkRegex, "{1}", "{2}", result, startIndex); + + // handle wiki links + handleMatches(wikiRegex, "wiki:{1}", "https://osu.ppy.sh/wiki/{1}", result, startIndex); + + // handle bare links + handleAdvanced(advancedLinkRegex, result, startIndex); + + // handle editor times + handleMatches(timeRegex, "{0}", "osu://edit/{0}", result, startIndex); + + // handle channels + handleMatches(channelRegex, "{0}", "osu://chan/{0}", result, startIndex); + + var empty = ""; + while (space-- > 0) + empty += "\0"; + + handleMatches(emojiRegex, empty, "{0}", result, startIndex); + + return result; + } + + public static FormattedMessage FormatMessage(Message inputMessage) + { + var result = format(inputMessage.Content); + + FormattedMessage formatted = inputMessage as FormattedMessage; + formatted.Content = result.Text; + formatted.Links = result.Links; + return formatted; + } + + public class MessageFormatterResult + { + public List Links = new List(); + public string Text; + public string OriginalText; + + public MessageFormatterResult(string text) + { + OriginalText = Text = text; + } + } + + public class Link + { + public string Url; + public int Index; + public int Length; + + public Link(string url, int startIndex, int length) + { + Url = url; + Index = startIndex; + Length = length; + } + } + } +} From f5f287bed57949df1a429e2f4889e613c27ca353 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 20:25:02 +0100 Subject: [PATCH 002/628] Rolled back the idea that there should be a separate class for formatted messages --- osu.Game/Online/Chat/Message.cs | 4 ++++ osu.Game/Online/Chat/MessageFormatter.cs | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 79b5c4fc1a..355abfda59 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -2,6 +2,8 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using Newtonsoft.Json; using osu.Game.Users; @@ -40,6 +42,8 @@ namespace osu.Game.Online.Chat { } + public List Links; + public Message(long? id) { Id = id; diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index df77b5d058..a712cb1f2b 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -56,8 +59,6 @@ namespace osu.Game.Online.Chat m.Groups.Count > 1 ? m.Groups[1].Value : "", m.Groups.Count > 2 ? m.Groups[2].Value : "").Trim(); - var testText = string.Format(link, m.Groups).Trim(); - if (displayText.Length == 0 || linkText.Length == 0) continue; // Check for encapsulated links @@ -130,11 +131,11 @@ namespace osu.Game.Online.Chat return result; } - public static FormattedMessage FormatMessage(Message inputMessage) + public static Message FormatMessage(Message inputMessage) { var result = format(inputMessage.Content); + var formatted = inputMessage; - FormattedMessage formatted = inputMessage as FormattedMessage; formatted.Content = result.Text; formatted.Links = result.Links; return formatted; From 1f1c7dd70fb12bf2b2d80bb8956d4a9935f08537 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 20:26:51 +0100 Subject: [PATCH 003/628] Moved LinkFlowContainer out of ProfileHeader to make it available for other uses too (e.g. chat) and renamed it to LinkTextFlowContainer bc it can contain both links and text, not only one --- .../Containers/OsuLinkTextFlowContainer.cs | 44 +++++++++++++ osu.Game/Overlays/Profile/ProfileHeader.cs | 61 +++---------------- 2 files changed, 54 insertions(+), 51 deletions(-) create mode 100644 osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs new file mode 100644 index 0000000000..b5490d42f9 --- /dev/null +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Input; +using osu.Game.Graphics.Sprites; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Graphics.Containers +{ + public class OsuLinkTextFlowContainer : OsuLinkTextFlowContainer + { + public OsuLinkTextFlowContainer(Action defaultCreationParameters = null) + : base(defaultCreationParameters) + { + } + } + + public class OsuLinkTextFlowContainer : OsuTextFlowContainer + where T : OsuLinkSpriteText, new() + { + public override bool HandleInput => true; + + public OsuLinkTextFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) + { + } + + protected override SpriteText CreateSpriteText() => new T(); + + public void AddLink(string text, string url, Action creationParameters = null) + { + AddText(text, link => + { + ((T)link).Url = url; + creationParameters?.Invoke(link); + }); + } + } +} diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index c7bc5c1d93..af3e97db27 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -25,7 +25,7 @@ namespace osu.Game.Overlays.Profile public class ProfileHeader : Container { private readonly OsuTextFlowContainer infoTextLeft; - private readonly LinkFlowContainer infoTextRight; + private readonly OsuLinkTextFlowContainer infoTextRight; private readonly FillFlowContainer scoreText, scoreNumberText; private readonly Container coverContainer, chartContainer, supporterTag; @@ -119,7 +119,7 @@ namespace osu.Game.Overlays.Profile } } }, - new LinkFlowContainer.ProfileLink(user) + new ProfileLink(user) { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, @@ -160,7 +160,7 @@ namespace osu.Game.Overlays.Profile ParagraphSpacing = 0.8f, LineSpacing = 0.2f }, - infoTextRight = new LinkFlowContainer(t => + infoTextRight = new OsuLinkTextFlowContainer(t => { t.TextSize = 14; t.Font = @"Exo2.0-RegularItalic"; @@ -488,57 +488,16 @@ namespace osu.Game.Overlays.Profile } } - private class LinkFlowContainer : OsuTextFlowContainer + private class ProfileLink : OsuLinkSpriteText, IHasTooltip { - public override bool HandleInput => true; + public string TooltipText => "View Profile in Browser"; - public LinkFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) + public ProfileLink(User user) { - } - - protected override SpriteText CreateSpriteText() => new LinkText(); - - public void AddLink(string text, string url) => AddText(text, link => ((LinkText)link).Url = url); - - public class LinkText : OsuSpriteText - { - private readonly OsuHoverContainer content; - - public override bool HandleInput => content.Action != null; - - protected override Container Content => content ?? (Container)this; - - protected override IEnumerable FlowingChildren => Children; - - public string Url - { - set - { - if(value != null) - content.Action = () => Process.Start(value); - } - } - - public LinkText() - { - AddInternal(content = new OsuHoverContainer - { - AutoSizeAxes = Axes.Both, - }); - } - } - - public class ProfileLink : LinkText, IHasTooltip - { - public string TooltipText => "View Profile in Browser"; - - public ProfileLink(User user) - { - Text = user.Username; - Url = $@"https://osu.ppy.sh/users/{user.Id}"; - Font = @"Exo2.0-RegularItalic"; - TextSize = 30; - } + Text = user.Username; + Url = $@"https://osu.ppy.sh/users/{user.Id}"; + Font = @"Exo2.0-RegularItalic"; + TextSize = 30; } } } From 86302716a6047f69d3e793592ae4c000be57e46e Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 20:32:08 +0100 Subject: [PATCH 004/628] Also moved LinkText to its own file so the chat could reuse it (ProfileHeader's private class ProfileLink also still inherits from this, though) --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs new file mode 100644 index 0000000000..111ba6a49a --- /dev/null +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -0,0 +1,55 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input; +using osu.Game.Graphics.Containers; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Graphics.Sprites +{ + public class OsuLinkSpriteText : OsuSpriteText + { + private readonly OsuHoverContainer content; + + public override bool HandleInput => content.Action != null; + + protected override Container Content => content ?? (Container)this; + + protected override IEnumerable FlowingChildren => Children; + + private string url; + + public string Url + { + get + { + return url; + } + set + { + if (value != null) + { + url = value; + content.Action = () => Process.Start(value); + } + } + } + + public OsuLinkSpriteText() + { + AddInternal(content = new OsuHoverContainer + { + AutoSizeAxes = Axes.Both, + }); + } + } +} From 152eb83c42c4abc3f6608830e8f0514fbaaa0e0d Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 20:33:27 +0100 Subject: [PATCH 005/628] Added new class for chat lines, that colour the messages after formatting. URLs will become blue, and on hover (also defined here) be turned yellow-ish --- osu.Game/Online/Chat/ChatLinkSpriteText.cs | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 osu.Game/Online/Chat/ChatLinkSpriteText.cs diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLinkSpriteText.cs new file mode 100644 index 0000000000..a47ee7cbb3 --- /dev/null +++ b/osu.Game/Online/Chat/ChatLinkSpriteText.cs @@ -0,0 +1,63 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Online.Chat +{ + public class ChatLinkSpriteText : OsuLinkSpriteText + { + private Color4 hoverColour; + private Color4 urlColour; + + protected override bool OnHover(InputState state) + { + var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url && !Equals(child)); + + var hoverResult = base.OnHover(state); + + if (!otherSpritesWithSameLink.Any(sprite => sprite.IsHovered)) + foreach (ChatLinkSpriteText sprite in otherSpritesWithSameLink) + sprite.TriggerOnHover(state); + + Content.FadeColour(hoverColour, 500, Easing.OutQuint); + + return hoverResult; + } + + protected override void OnHoverLost(InputState state) + { + var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url); + + if (spritesWithSameLink.Any(sprite => sprite.IsHovered)) + { + // We have to do this so this sprite does not fade its colour back + Content.FadeColour(hoverColour, 500, Easing.OutQuint); + return; + } + + foreach (ChatLinkSpriteText sprite in spritesWithSameLink) + sprite.Content.FadeColour(urlColour, 500, Easing.OutQuint); + + base.OnHoverLost(state); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + hoverColour = colours.Yellow; + urlColour = colours.Blue; + } + } +} From 78ff5d81d3cc9a5f253327f8a61b9bfba108ca29 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 21:03:41 +0100 Subject: [PATCH 006/628] Fixed casting --- osu.Game/Online/Chat/ChatLinkSpriteText.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLinkSpriteText.cs index a47ee7cbb3..a1856af6b0 100644 --- a/osu.Game/Online/Chat/ChatLinkSpriteText.cs +++ b/osu.Game/Online/Chat/ChatLinkSpriteText.cs @@ -23,7 +23,8 @@ namespace osu.Game.Online.Chat protected override bool OnHover(InputState state) { - var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url && !Equals(child)); + // Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link + var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url && !Equals(child)); var hoverResult = base.OnHover(state); @@ -38,7 +39,7 @@ namespace osu.Game.Online.Chat protected override void OnHoverLost(InputState state) { - var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url); + var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url); if (spritesWithSameLink.Any(sprite => sprite.IsHovered)) { From 7f1f886406450b146c415c862343f3a54174a9c4 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 21:04:24 +0100 Subject: [PATCH 007/628] implemented method formatting into chat. Also added all necessary files to the .csproj --- osu.Game/Overlays/Chat/ChatLine.cs | 42 +++++++++++++++++++++++------- osu.Game/osu.Game.csproj | 4 +++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 32f933ff42..0e1d383f2a 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -67,12 +67,13 @@ namespace osu.Game.Overlays.Chat private const float text_size = 20; private Color4 customUsernameColour; + private Color4 urlColour; private OsuSpriteText timestamp; public ChatLine(Message message) { - Message = message; + Message = MessageFormatter.FormatMessage(message); RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -82,7 +83,7 @@ namespace osu.Game.Overlays.Chat private Message message; private OsuSpriteText username; - private OsuTextFlowContainer contentFlow; + private OsuLinkTextFlowContainer contentFlow; public Message Message { @@ -104,6 +105,7 @@ namespace osu.Game.Overlays.Chat private void load(OsuColour colours) { customUsernameColour = colours.ChatBlue; + urlColour = colours.Blue; } private bool senderHasBackground => !string.IsNullOrEmpty(message.Sender.Colour); @@ -187,7 +189,7 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new OsuTextFlowContainer(t => { t.TextSize = text_size; }) + contentFlow = new OsuLinkTextFlowContainer(t => { t.TextSize = text_size; }) { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -210,16 +212,38 @@ namespace osu.Game.Overlays.Chat timestamp.Text = $@"{message.Timestamp.LocalDateTime:HH:mm:ss}"; username.Text = $@"{message.Sender.Username}" + (senderHasBackground ? "" : ":"); - if (message.IsAction) + contentFlow.Clear(); + + if (message.Links == null || message.Links.Count == 0) { - contentFlow.Clear(); - contentFlow.AddText("[", sprite => sprite.Padding = new MarginPadding { Right = action_padding }); - contentFlow.AddText(message.Content, sprite => sprite.Font = @"Exo2.0-MediumItalic"); - contentFlow.AddText("]", sprite => sprite.Padding = new MarginPadding { Left = action_padding }); + contentFlow.AddText(message.Content, sprite => + { + if (message.IsAction) + sprite.Font = @"Exo2.0-MediumItalic"; + }); + + return; } else - contentFlow.Text = message.Content; + { + int prevIndex = 0; + foreach (var link in message.Links) + { + contentFlow.AddText(message.Content.Substring(prevIndex, link.Index - prevIndex)); + prevIndex = link.Index + link.Length; + contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => + { + if (message.IsAction) + sprite.Font = @"Exo2.0-MediumItalic"; + sprite.Colour = urlColour; + }); + } + + // Add text after the last link + var lastLink = message.Links[message.Links.Count - 1]; + contentFlow.AddText(message.Content.Substring(lastLink.Index + lastLink.Length)); + } } private class MessageSender : OsuClickableContainer, IHasContextMenu diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f814cbb3d3..665acd2102 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -268,6 +268,8 @@ + + @@ -286,6 +288,8 @@ + + From ade7311c152caed05ec6904ca4c1622fbe402789 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 1 Dec 2017 21:31:12 +0100 Subject: [PATCH 008/628] Updated implementation to be based around a "LinkId" (atm the position of the link, anything unique to a link inside its message will be fine), which does not allow matching (OnHover related) between different links --- osu.Game/Online/Chat/ChatLinkSpriteText.cs | 6 ++++-- osu.Game/Overlays/Chat/ChatLine.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLinkSpriteText.cs index a1856af6b0..560579a007 100644 --- a/osu.Game/Online/Chat/ChatLinkSpriteText.cs +++ b/osu.Game/Online/Chat/ChatLinkSpriteText.cs @@ -18,13 +18,15 @@ namespace osu.Game.Online.Chat { public class ChatLinkSpriteText : OsuLinkSpriteText { + public int LinkId; + private Color4 hoverColour; private Color4 urlColour; protected override bool OnHover(InputState state) { // Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link - var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url && !Equals(child)); + var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLinkSpriteText)?.LinkId == LinkId && !Equals(child)); var hoverResult = base.OnHover(state); @@ -39,7 +41,7 @@ namespace osu.Game.Online.Chat protected override void OnHoverLost(InputState state) { - var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as OsuLinkSpriteText)?.Url == Url); + var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLinkSpriteText)?.LinkId == LinkId); if (spritesWithSameLink.Any(sprite => sprite.IsHovered)) { diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 0e1d383f2a..3ebf5cf513 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -237,6 +237,8 @@ namespace osu.Game.Overlays.Chat if (message.IsAction) sprite.Font = @"Exo2.0-MediumItalic"; sprite.Colour = urlColour; + // We want to use something that is unique to every formatted link, so I just use the position of the link + ((ChatLinkSpriteText)sprite).LinkId = prevIndex; }); } From d22a9df1400d8416b9ae173b517b82e7c3a8395a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Dec 2017 09:47:20 +0100 Subject: [PATCH 009/628] Added new request for getting the beatmapset from only a difficulty map ID --- .../Online/API/Requests/GetBeatmapRequest.cs | 21 +++++++++++++++++++ osu.Game/Overlays/BeatmapSetOverlay.cs | 14 +++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 osu.Game/Online/API/Requests/GetBeatmapRequest.cs diff --git a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs new file mode 100644 index 0000000000..7a72402c1e --- /dev/null +++ b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs @@ -0,0 +1,21 @@ +using osu.Game.Beatmaps; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace osu.Game.Online.API.Requests +{ + public class GetBeatmapRequest : APIRequest + { + private readonly int beatmapId; + + public GetBeatmapRequest(int beatmapId) + { + this.beatmapId = beatmapId; + } + + protected override string Target => $@"beatmaps/{beatmapId}"; + } +} diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 0d658b346e..17fbe907ca 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -139,6 +139,20 @@ namespace osu.Game.Overlays return true; } + public void ShowBeatmap(int beatmapId) + { + var req = new GetBeatmapRequest(beatmapId); + req.Success += res => + { + if (!res.OnlineBeatmapSetID.HasValue) + return; + + ShowBeatmapSet(res.OnlineBeatmapSetID.Value); + }; + + api.Queue(req); + } + public void ShowBeatmapSet(int beatmapSetId) { // todo: display the overlay while we are loading here. we need to support setting BeatmapSet to null for this to work. From 0aced859087138736fa1606ad8c6af53f4dcb8b4 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Dec 2017 09:47:59 +0100 Subject: [PATCH 010/628] Changed the LinkID to the link's own Index instead of the previous one (just makes more sense imo) --- osu.Game/Overlays/Chat/ChatLine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 3ebf5cf513..bf5855c45b 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -238,7 +238,7 @@ namespace osu.Game.Overlays.Chat sprite.Font = @"Exo2.0-MediumItalic"; sprite.Colour = urlColour; // We want to use something that is unique to every formatted link, so I just use the position of the link - ((ChatLinkSpriteText)sprite).LinkId = prevIndex; + ((ChatLinkSpriteText)sprite).LinkId = link.Index; }); } From 6d9dcc66913d1118b5070ce0b973d95e78bbea79 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Dec 2017 09:48:55 +0100 Subject: [PATCH 011/628] Added all files to the .csproj and also introduced basic action filtering when you set the URL on an OsuLinkSpriteText object --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 45 ++++++++++++++++++- osu.Game/osu.Game.csproj | 1 + 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 111ba6a49a..f41bca62ec 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using osu.Game.Graphics.Containers; +using osu.Game.Overlays; using System; using System.Collections.Generic; using System.Diagnostics; @@ -20,6 +21,8 @@ namespace osu.Game.Graphics.Sprites { private readonly OsuHoverContainer content; + private BeatmapSetOverlay beatmapSetOverlay; + public override bool HandleInput => content.Action != null; protected override Container Content => content ?? (Container)this; @@ -39,7 +42,7 @@ namespace osu.Game.Graphics.Sprites if (value != null) { url = value; - content.Action = () => Process.Start(value); + loadAction(); } } } @@ -51,5 +54,45 @@ namespace osu.Game.Graphics.Sprites AutoSizeAxes = Axes.Both, }); } + + [BackgroundDependencyLoader] + private void load(BeatmapSetOverlay beatmapSetOverlay) + { + this.beatmapSetOverlay = beatmapSetOverlay; + } + + private void loadAction() + { + if (Url == null || String.IsNullOrEmpty(Url)) + return; + + var url = Url; + + if (url.StartsWith("https://")) url = url.Substring(8); + else if (url.StartsWith("http://")) url = url.Substring(7); + else content.Action = () => Process.Start(Url); + + if (url.StartsWith("osu.ppy.sh/")) + { + url = url.Substring(11); + if (url.StartsWith("s") || url.StartsWith("beatmapsets")) + content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); + else if (url.StartsWith("b") || url.StartsWith("beatmaps")) + content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); + // else if (url.StartsWith("d")) Maybe later + } + } + + private int getIdFromUrl(string url) + { + var lastSlashIndex = url.LastIndexOf('/'); + if (lastSlashIndex == url.Length) + { + url = url.Substring(url.Length - 1); + lastSlashIndex = url.LastIndexOf('/'); + } + + return int.Parse(url.Substring(lastSlashIndex + 1)); + } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a2d8a4bbe4..24ca01a3ad 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -286,6 +286,7 @@ 20171119065731_AddBeatmapOnlineIDUniqueConstraint.cs + From efe6245e533cf514dbb6c715aa148f3f8f5a0e17 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Dec 2017 10:42:38 +0100 Subject: [PATCH 012/628] Fixed a bug where Drawable.Width could potentially be set to NaN (0/0) by checking if last variable > 0. --- osu.Game/Overlays/BeatmapSet/PreviewButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs index 52edd1714f..ef248c02d3 100644 --- a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs @@ -80,7 +80,7 @@ namespace osu.Game.Overlays.BeatmapSet { base.Update(); - if (Playing.Value && preview != null) + if (Playing.Value && preview != null && preview.Length > 0) { progress.Width = (float)(preview.CurrentTime / preview.Length); } From 7f029a382b5da0b6c10f6d832554686b4a458968 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Dec 2017 10:43:19 +0100 Subject: [PATCH 013/628] Made the Chat testcase include a beatmapsetoverlay so links can be clicked from in there. Also had to implement private DI to make it work --- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 85ee224a5e..38f5a7cbe0 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -2,7 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; +using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; +using osu.Game.Online.API; using osu.Game.Overlays; namespace osu.Game.Tests.Visual @@ -10,12 +12,26 @@ namespace osu.Game.Tests.Visual [Description("Testing chat api and overlay")] internal class TestCaseChatDisplay : OsuTestCase { + private BeatmapSetOverlay beatmapSetOverlay; + + private DependencyContainer dependencies; + + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); + public TestCaseChatDisplay() { Add(new ChatOverlay { State = Visibility.Visible }); + + Add(beatmapSetOverlay = new BeatmapSetOverlay()); + } + + [BackgroundDependencyLoader] + private void load() + { + dependencies.Cache(beatmapSetOverlay); } } } From 735dbddd17ff76cedba34f3fa71b51328de3acc1 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 06:52:57 +0100 Subject: [PATCH 014/628] Changed URL detection to be more reliable and generally work better --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index f41bca62ec..e39131fa1c 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; using osu.Game.Overlays; using System; @@ -68,30 +69,40 @@ namespace osu.Game.Graphics.Sprites var url = Url; - if (url.StartsWith("https://")) url = url.Substring(8); - else if (url.StartsWith("http://")) url = url.Substring(7); - else content.Action = () => Process.Start(Url); - - if (url.StartsWith("osu.ppy.sh/")) + if (url.StartsWith("http://") || url.StartsWith("https://")) { - url = url.Substring(11); - if (url.StartsWith("s") || url.StartsWith("beatmapsets")) + var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); + if (osuUrlIndex == -1) + { + content.Action = () => Process.Start(url); + return; + } + + url = url.Substring(osuUrlIndex + 11); + if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); - else if (url.StartsWith("b") || url.StartsWith("beatmaps")) + else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); - // else if (url.StartsWith("d")) Maybe later } + else + content.Action = () => Process.Start(url); } private int getIdFromUrl(string url) { var lastSlashIndex = url.LastIndexOf('/'); + // Remove possible trailing slash if (lastSlashIndex == url.Length) { - url = url.Substring(url.Length - 1); + url = url.Substring(0, url.Length - 1); lastSlashIndex = url.LastIndexOf('/'); } + var lastQuestionMarkIndex = url.LastIndexOf('?'); + // Filter out possible queries like mode specifications (e.g. /b/252238?m=0) + if (lastQuestionMarkIndex > lastSlashIndex) + url = url.Substring(0, lastQuestionMarkIndex); + return int.Parse(url.Substring(lastSlashIndex + 1)); } } From c574cc43087063bdea99f77224591067e074b124 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 11:16:34 +0100 Subject: [PATCH 015/628] Removed unnecessary "using" statements --- osu.Game/Online/Chat/ChatLinkSpriteText.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLinkSpriteText.cs index 560579a007..4b87894a0c 100644 --- a/osu.Game/Online/Chat/ChatLinkSpriteText.cs +++ b/osu.Game/Online/Chat/ChatLinkSpriteText.cs @@ -8,11 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace osu.Game.Online.Chat { From 2d270a1cfefcf049adada74d3d280a002668a213 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 20:45:30 +0100 Subject: [PATCH 016/628] Added ability to open other channels from chat links. --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 31 +++++++++++++++++-- osu.Game/Overlays/ChatOverlay.cs | 5 +++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index e39131fa1c..2105008ef3 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -20,6 +20,8 @@ namespace osu.Game.Graphics.Sprites { public class OsuLinkSpriteText : OsuSpriteText { + private ChatOverlay chat; + private readonly OsuHoverContainer content; private BeatmapSetOverlay beatmapSetOverlay; @@ -57,9 +59,10 @@ namespace osu.Game.Graphics.Sprites } [BackgroundDependencyLoader] - private void load(BeatmapSetOverlay beatmapSetOverlay) + private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) { this.beatmapSetOverlay = beatmapSetOverlay; + this.chat = chat; } private void loadAction() @@ -69,7 +72,31 @@ namespace osu.Game.Graphics.Sprites var url = Url; - if (url.StartsWith("http://") || url.StartsWith("https://")) + // Client-internal stuff + if (url.StartsWith("osu://")) + { + var firstPath = url.Substring(6, 5); + url = url.Substring(11); + + if (firstPath == "chan/") + { + var nextSlashIndex = url.IndexOf('/'); + var channelName = url.Substring(0, nextSlashIndex != -1 ? nextSlashIndex - 1 : url.Length - 1); + + var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == channelName); + + if (foundChannel != null) + chat.OpenChannel(foundChannel); + } + else if (firstPath == "edit/") + { + // Open editor here, then goto specified time + // how to push new screen from here? we'll see + } + else + throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} ({firstPath})."); + } + else if (url.StartsWith("http://") || url.StartsWith("https://")) { var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); if (osuUrlIndex == -1) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 9f40a08ad2..9e3e60a988 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -60,6 +60,7 @@ namespace osu.Game.Overlays public Bindable ChatHeight { get; set; } + public List AvailableChannels { get; private set; } private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; @@ -190,6 +191,8 @@ namespace osu.Game.Overlays private double startDragChatHeight; private bool isDragging; + public void OpenChannel(Channel channel) => addChannel(channel); + protected override bool OnDragStart(InputState state) { isDragging = tabsArea.IsHovered; @@ -300,6 +303,8 @@ namespace osu.Game.Overlays ListChannelsRequest req = new ListChannelsRequest(); req.Success += delegate (List channels) { + AvailableChannels = channels; + Scheduler.Add(delegate { addChannel(channels.Find(c => c.Name == @"#lazer")); From 3f336b8e61aad47b03bedeaef7045a2166fc8f48 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 21:02:05 +0100 Subject: [PATCH 017/628] Made the style a bit better, fixed a bug or two --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 9 +++++---- osu.Game/Overlays/Chat/ChatLine.cs | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 2105008ef3..080f1c1f83 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -81,17 +81,18 @@ namespace osu.Game.Graphics.Sprites if (firstPath == "chan/") { var nextSlashIndex = url.IndexOf('/'); - var channelName = url.Substring(0, nextSlashIndex != -1 ? nextSlashIndex - 1 : url.Length - 1); + var channelName = nextSlashIndex != -1 ? url.Remove(nextSlashIndex) : url; var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == channelName); if (foundChannel != null) - chat.OpenChannel(foundChannel); + content.Action = () => chat.OpenChannel(foundChannel); } else if (firstPath == "edit/") { // Open editor here, then goto specified time // how to push new screen from here? we'll see + content.Action = () => new Framework.Screens.Screen().Push(new Screens.Edit.Editor()); } else throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} ({firstPath})."); @@ -121,14 +122,14 @@ namespace osu.Game.Graphics.Sprites // Remove possible trailing slash if (lastSlashIndex == url.Length) { - url = url.Substring(0, url.Length - 1); + url = url.Remove(url.Length - 1); lastSlashIndex = url.LastIndexOf('/'); } var lastQuestionMarkIndex = url.LastIndexOf('?'); // Filter out possible queries like mode specifications (e.g. /b/252238?m=0) if (lastQuestionMarkIndex > lastSlashIndex) - url = url.Substring(0, lastQuestionMarkIndex); + url = url.Remove(lastQuestionMarkIndex); return int.Parse(url.Substring(lastSlashIndex + 1)); } diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index bf5855c45b..fda23ca679 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -236,6 +236,8 @@ namespace osu.Game.Overlays.Chat { if (message.IsAction) sprite.Font = @"Exo2.0-MediumItalic"; + + // TODO: Somehow check (if channel link) that this is a real channel sprite.Colour = urlColour; // We want to use something that is unique to every formatted link, so I just use the position of the link ((ChatLinkSpriteText)sprite).LinkId = link.Index; From a839d0e91dbef1616624972174b91baf512c2361 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 23:55:00 +0100 Subject: [PATCH 018/628] LoadComponent before assigning URL to ensure dependency loading --- osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs index b5490d42f9..821d1bd0ce 100644 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -36,7 +36,7 @@ namespace osu.Game.Graphics.Containers { AddText(text, link => { - ((T)link).Url = url; + LoadComponentAsync(link, d => ((T)d).Url = url); creationParameters?.Invoke(link); }); } From bf97f8b1b1edc3715bc428f862fcc621cbf6b228 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 3 Dec 2017 23:55:34 +0100 Subject: [PATCH 019/628] Added osu.ppy.sh/ss (screenshot) URL handling and calculate ID at assignment so it's not on click anymore --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 080f1c1f83..2199800d64 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -107,10 +107,13 @@ namespace osu.Game.Graphics.Sprites } url = url.Substring(osuUrlIndex + 11); + var id = getIdFromUrl(url); if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) - content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); + content.Action = () => beatmapSetOverlay.ShowBeatmapSet(id); else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) - content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); + content.Action = () => beatmapSetOverlay.ShowBeatmap(id); + else if (url.StartsWith("ss/")) + content.Action = () => Process.Start($"https://osu.ppy.sh/{url}"); } else content.Action = () => Process.Start(url); From dcdc186a53dba35d7992910c0f7a3731ede4b077 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:27:14 +0100 Subject: [PATCH 020/628] Added chatoverlay caching to testcase so test still works (chat needs to be injected so channels can be opened) --- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 38f5a7cbe0..e23531f46a 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -13,6 +13,7 @@ namespace osu.Game.Tests.Visual internal class TestCaseChatDisplay : OsuTestCase { private BeatmapSetOverlay beatmapSetOverlay; + private readonly ChatOverlay chat; private DependencyContainer dependencies; @@ -20,10 +21,12 @@ namespace osu.Game.Tests.Visual public TestCaseChatDisplay() { - Add(new ChatOverlay + chat = new ChatOverlay { State = Visibility.Visible - }); + }; + + Add(chat); Add(beatmapSetOverlay = new BeatmapSetOverlay()); } @@ -31,6 +34,7 @@ namespace osu.Game.Tests.Visual [BackgroundDependencyLoader] private void load() { + dependencies.Cache(chat); dependencies.Cache(beatmapSetOverlay); } } From 319f43e209e1d5b872c0e17d5a39b115dd1dbcbc Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:29:56 +0100 Subject: [PATCH 021/628] Added "getIdFromUrl" call back to content.action because performance impact is small and no unnecessary id calculations are done --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 2199800d64..ddce36c77d 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -107,12 +107,11 @@ namespace osu.Game.Graphics.Sprites } url = url.Substring(osuUrlIndex + 11); - var id = getIdFromUrl(url); if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) - content.Action = () => beatmapSetOverlay.ShowBeatmapSet(id); + content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) - content.Action = () => beatmapSetOverlay.ShowBeatmap(id); - else if (url.StartsWith("ss/")) + content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); + else content.Action = () => Process.Start($"https://osu.ppy.sh/{url}"); } else From cf96323980c102881cd5de31259d8402a3d6df30 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:33:42 +0100 Subject: [PATCH 022/628] Added new OsuLinkSpriteText.TextColour property that sets the internal content (OsuHoverContainer)'s colour instead of the whole container, so that text colour is always changed through that (e.g. link colouring, link hover fade). Implemented it to be used when adding text to an OsuLinkTextFlowContainer. --- .../Containers/OsuLinkTextFlowContainer.cs | 19 +++++++++++++++++++ .../Graphics/Sprites/OsuLinkSpriteText.cs | 7 +++++++ osu.Game/Overlays/Chat/ChatLine.cs | 6 ++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs index 821d1bd0ce..559b3eef17 100644 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; @@ -32,6 +34,12 @@ namespace osu.Game.Graphics.Containers protected override SpriteText CreateSpriteText() => new T(); + /// + /// The colour for normal text (links ignore this). This should be set before text is added. + /// Default is white. + /// + public ColourInfo? TextColour; + public void AddLink(string text, string url, Action creationParameters = null) { AddText(text, link => @@ -40,5 +48,16 @@ namespace osu.Game.Graphics.Containers creationParameters?.Invoke(link); }); } + + public IEnumerable AddText(string text, Action creationParameters = null) + { + return base.AddText(text, sprite => + { + if (TextColour.HasValue) + ((OsuLinkSpriteText)sprite).TextColour = TextColour.Value; + + creationParameters?.Invoke(sprite); + }); + } } } diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index ddce36c77d..3727b79322 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -4,6 +4,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using osu.Game.Beatmaps; @@ -58,6 +59,12 @@ namespace osu.Game.Graphics.Sprites }); } + public ColourInfo TextColour + { + get { return Content.Colour; } + set { Content.Colour = value; } + } + [BackgroundDependencyLoader] private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) { diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index fda23ca679..b6da2fbbce 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -198,7 +198,7 @@ namespace osu.Game.Overlays.Chat } }; if (message.IsAction && senderHasBackground) - contentFlow.Colour = OsuColour.FromHex(message.Sender.Colour); + contentFlow.TextColour = OsuColour.FromHex(message.Sender.Colour); updateMessageContent(); FinishTransforms(true); @@ -237,9 +237,7 @@ namespace osu.Game.Overlays.Chat if (message.IsAction) sprite.Font = @"Exo2.0-MediumItalic"; - // TODO: Somehow check (if channel link) that this is a real channel - sprite.Colour = urlColour; - // We want to use something that is unique to every formatted link, so I just use the position of the link + // We want to use something that is unique to every formatted link PER MESSAGE ((ChatLinkSpriteText)sprite).LinkId = link.Index; }); } From fd13bacf4ad9a4ac32ee29701e2faee32e4f7a26 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:34:16 +0100 Subject: [PATCH 023/628] Made default link ID -1 (if no link is present) because linkId is currently being set to link.index which can be 0. --- osu.Game/Online/Chat/ChatLinkSpriteText.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLinkSpriteText.cs index 4b87894a0c..adbdd9ed0c 100644 --- a/osu.Game/Online/Chat/ChatLinkSpriteText.cs +++ b/osu.Game/Online/Chat/ChatLinkSpriteText.cs @@ -14,7 +14,7 @@ namespace osu.Game.Online.Chat { public class ChatLinkSpriteText : OsuLinkSpriteText { - public int LinkId; + public int LinkId = -1; private Color4 hoverColour; private Color4 urlColour; @@ -57,6 +57,8 @@ namespace osu.Game.Online.Chat { hoverColour = colours.Yellow; urlColour = colours.Blue; + if (LinkId != -1) + Content.Colour = urlColour; } } } From 9b866d2248e197f8d5279a70fb6727eb302b3bfc Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:46:07 +0100 Subject: [PATCH 024/628] Made it so the link ID is always added before loading the SpriteTexts (fixed weird bug where some sprites would be white instead of blue). Also improved XML doc on TextColour --- osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs index 559b3eef17..ebb4cca0e0 100644 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers protected override SpriteText CreateSpriteText() => new T(); /// - /// The colour for normal text (links ignore this). This should be set before text is added. + /// The colour for normal text (links ignore this). Will only be used for new text elements. /// Default is white. /// public ColourInfo? TextColour; @@ -44,8 +44,8 @@ namespace osu.Game.Graphics.Containers { AddText(text, link => { - LoadComponentAsync(link, d => ((T)d).Url = url); creationParameters?.Invoke(link); + LoadComponentAsync(link, d => ((T)d).Url = url); }); } From bb138ccaf710f17658ced90490ba65e430941297 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:55:57 +0100 Subject: [PATCH 025/628] Added licence header and removed unnecessary whitespace --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 2 +- osu.Game/Online/API/Requests/GetBeatmapRequest.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 3727b79322..17f7cf88d5 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -118,7 +118,7 @@ namespace osu.Game.Graphics.Sprites content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); - else + else content.Action = () => Process.Start($"https://osu.ppy.sh/{url}"); } else diff --git a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs index 7a72402c1e..1df695c795 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs @@ -1,4 +1,7 @@ -using osu.Game.Beatmaps; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; using System; using System.Collections.Generic; using System.Linq; From 63a6a8b669fdbb2d75fc61ae2599e1b9cef807a8 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 19:31:48 +0100 Subject: [PATCH 026/628] Fixed messages sent by yourself not being formatted --- osu.Game/Overlays/Chat/ChatLine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index b6da2fbbce..5703c437e6 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Chat public ChatLine(Message message) { - Message = MessageFormatter.FormatMessage(message); + Message = message; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Chat { if (message == value) return; - message = value; + message = MessageFormatter.FormatMessage(value); if (!IsLoaded) return; From b04ddba2a0b6062b90e5bc45dc7eb52a075d2c20 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 6 Dec 2017 10:27:30 +0100 Subject: [PATCH 027/628] Added basic "on click" actions to the in-chat links --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 102 ++++++++++++------ .../Online/API/Requests/GetUserRequest.cs | 11 +- 2 files changed, 82 insertions(+), 31 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 17f7cf88d5..da11bc5043 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -7,9 +7,13 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using osu.Framework.Screens; using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; using osu.Game.Overlays; +using osu.Game.Screens.Edit; using System; using System.Collections.Generic; using System.Diagnostics; @@ -25,6 +29,7 @@ namespace osu.Game.Graphics.Sprites private readonly OsuHoverContainer content; + private APIAccess api; private BeatmapSetOverlay beatmapSetOverlay; public override bool HandleInput => content.Action != null; @@ -43,10 +48,10 @@ namespace osu.Game.Graphics.Sprites } set { - if (value != null) + if (!string.IsNullOrEmpty(value)) { url = value; - loadAction(); + content.Action = onClickAction; } } } @@ -66,63 +71,100 @@ namespace osu.Game.Graphics.Sprites } [BackgroundDependencyLoader] - private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) + private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) { + this.api = api; this.beatmapSetOverlay = beatmapSetOverlay; this.chat = chat; } - private void loadAction() + private void onClickAction() { - if (Url == null || String.IsNullOrEmpty(Url)) - return; - var url = Url; - // Client-internal stuff if (url.StartsWith("osu://")) { - var firstPath = url.Substring(6, 5); - url = url.Substring(11); + url = url.Substring(6); + var args = url.Split('/'); - if (firstPath == "chan/") + switch (args[0]) { - var nextSlashIndex = url.IndexOf('/'); - var channelName = nextSlashIndex != -1 ? url.Remove(nextSlashIndex) : url; + case "chan": + var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); - var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == channelName); + if (foundChannel == null) + TextColour = Color4.White; + else + chat.OpenChannel(foundChannel); - if (foundChannel != null) - content.Action = () => chat.OpenChannel(foundChannel); - } - else if (firstPath == "edit/") - { - // Open editor here, then goto specified time - // how to push new screen from here? we'll see - content.Action = () => new Framework.Screens.Screen().Push(new Screens.Edit.Editor()); - } - else - throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} ({firstPath})."); + break; + case "edit": + // TODO: Change screen to editor + break; + case "b": + if (args.Length > 1 && int.TryParse(args[1], out int mapId)) + beatmapSetOverlay.ShowBeatmap(mapId); + + break; + case "s": + case "dl": + if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) + beatmapSetOverlay.ShowBeatmapSet(mapSetId); + + break; + case "spectate": + GetUserRequest req; + if (int.TryParse(args[1], out int userId)) + req = new GetUserRequest(userId); + else + // Get by username instead + req = new GetUserRequest(args[1]); + + req.Success += user => + { + // TODO: Open spectator screen and start spectating + + }; + // api.Queue(req); + + break; + default: + throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]})."); + } + } + else if (url.StartsWith("osump://")) + { + url = url.Substring(8); + if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) + return; + + // TODO: Join the specified multiplayer lobby here with multiId } else if (url.StartsWith("http://") || url.StartsWith("https://")) { var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); if (osuUrlIndex == -1) { - content.Action = () => Process.Start(url); + Process.Start(url); return; } url = url.Substring(osuUrlIndex + 11); if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) - content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url)); + { + var id = getIdFromUrl(url); + beatmapSetOverlay.ShowBeatmapSet(id); + } else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) - content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url)); + { + var id = getIdFromUrl(url); + beatmapSetOverlay.ShowBeatmap(id); + } else - content.Action = () => Process.Start($"https://osu.ppy.sh/{url}"); + Process.Start($"https://osu.ppy.sh/{url}"); } else - content.Action = () => Process.Start(url); + Process.Start(url); } private int getIdFromUrl(string url) diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 2e3e7b01c8..47038b8ccb 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -8,12 +8,21 @@ namespace osu.Game.Online.API.Requests public class GetUserRequest : APIRequest { private long? userId; + private string userName; + /// The user's ID. public GetUserRequest(long? userId = null) { this.userId = userId; } - protected override string Target => userId.HasValue ? $@"users/{userId}" : @"me"; + /// The user's username. + public GetUserRequest(string userName) + { + this.userName = userName; + } + + // Prefer ID over name + protected override string Target => userId.HasValue ? $@"users/{userId}" : ((!string.IsNullOrEmpty(userName)) ? $@"users/{userName}" : @"me"); } } From 94eb853d3d14d69155709f13c105adcf0fed669a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 6 Dec 2017 16:41:57 +0100 Subject: [PATCH 028/628] Added centralised handling for some chat links --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 5 ++-- osu.Game/OsuGame.cs | 28 +++++++++++++++++++ osu.Game/Overlays/ChatOverlay.cs | 5 +++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index da11bc5043..75b3f281d0 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -99,7 +99,7 @@ namespace osu.Game.Graphics.Sprites break; case "edit": - // TODO: Change screen to editor + chat.Game.LoadEditorTimestamp(); break; case "b": if (args.Length > 1 && int.TryParse(args[1], out int mapId)) @@ -126,6 +126,7 @@ namespace osu.Game.Graphics.Sprites }; // api.Queue(req); + chat.Game.LoadSpectatorScreen(); break; default: @@ -138,7 +139,7 @@ namespace osu.Game.Graphics.Sprites if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) return; - // TODO: Join the specified multiplayer lobby here with multiId + chat.Game.LoadMultiplayerLobby(); } else if (url.StartsWith("http://") || url.StartsWith("https://")) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4745733bd9..900a55293d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -115,6 +115,34 @@ namespace osu.Game private ScheduledDelegate scoreLoad; + // TODO: Implement this properly as soon as the Editor is done + internal void LoadEditorTimestamp() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but this is not fully implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + + internal void LoadSpectatorScreen() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but spectating is not implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + + internal void LoadMultiplayerLobby() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but the multiplayer lobby is not implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + protected void LoadScore(Score s) { scoreLoad?.Cancel(); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 9e3e60a988..eaf58cde5e 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -41,6 +41,8 @@ namespace osu.Game.Overlays private readonly FocusedTextBox textbox; + public OsuGame Game; + private APIAccess api; private const int transition_length = 500; @@ -271,8 +273,9 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, OsuConfigManager config, OsuColour colours) + private void load(APIAccess api, OsuConfigManager config, OsuColour colours, OsuGame game) { + Game = game; this.api = api; api.Register(this); From 7bf25bdd4dfdfe0980b492ec8486d2b6ed0d2337 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:23:57 +0100 Subject: [PATCH 029/628] Changed it so the ":" character does not appear after usernames when the displayed message is an action (e.g. /np). Just makes more sense imo --- osu.Game/Overlays/Chat/ChatLine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 5703c437e6..ba88a9ac77 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -210,7 +210,7 @@ namespace osu.Game.Overlays.Chat timestamp.FadeTo(message is LocalEchoMessage ? 0 : 1, 500, Easing.OutQuint); timestamp.Text = $@"{message.Timestamp.LocalDateTime:HH:mm:ss}"; - username.Text = $@"{message.Sender.Username}" + (senderHasBackground ? "" : ":"); + username.Text = $@"{message.Sender.Username}" + (senderHasBackground || message.IsAction ? "" : ":"); contentFlow.Clear(); From 541c25e99538c458c2f772decc077ff18fad0c04 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:28:12 +0100 Subject: [PATCH 030/628] Renamed ChatLinkSpriteText to ChatLink for convenience --- .../Online/Chat/{ChatLinkSpriteText.cs => ChatLink.cs} | 10 +++++----- osu.Game/Overlays/Chat/ChatLine.cs | 6 +++--- osu.Game/osu.Game.csproj | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game/Online/Chat/{ChatLinkSpriteText.cs => ChatLink.cs} (80%) diff --git a/osu.Game/Online/Chat/ChatLinkSpriteText.cs b/osu.Game/Online/Chat/ChatLink.cs similarity index 80% rename from osu.Game/Online/Chat/ChatLinkSpriteText.cs rename to osu.Game/Online/Chat/ChatLink.cs index adbdd9ed0c..e375ace1a0 100644 --- a/osu.Game/Online/Chat/ChatLinkSpriteText.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -12,7 +12,7 @@ using System.Linq; namespace osu.Game.Online.Chat { - public class ChatLinkSpriteText : OsuLinkSpriteText + public class ChatLink : OsuLinkSpriteText { public int LinkId = -1; @@ -22,12 +22,12 @@ namespace osu.Game.Online.Chat protected override bool OnHover(InputState state) { // Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link - var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLinkSpriteText)?.LinkId == LinkId && !Equals(child)); + var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !Equals(child)); var hoverResult = base.OnHover(state); if (!otherSpritesWithSameLink.Any(sprite => sprite.IsHovered)) - foreach (ChatLinkSpriteText sprite in otherSpritesWithSameLink) + foreach (ChatLink sprite in otherSpritesWithSameLink) sprite.TriggerOnHover(state); Content.FadeColour(hoverColour, 500, Easing.OutQuint); @@ -37,7 +37,7 @@ namespace osu.Game.Online.Chat protected override void OnHoverLost(InputState state) { - var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLinkSpriteText)?.LinkId == LinkId); + var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId); if (spritesWithSameLink.Any(sprite => sprite.IsHovered)) { @@ -46,7 +46,7 @@ namespace osu.Game.Online.Chat return; } - foreach (ChatLinkSpriteText sprite in spritesWithSameLink) + foreach (ChatLink sprite in spritesWithSameLink) sprite.Content.FadeColour(urlColour, 500, Easing.OutQuint); base.OnHoverLost(state); diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index ba88a9ac77..475a49b12e 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -83,7 +83,7 @@ namespace osu.Game.Overlays.Chat private Message message; private OsuSpriteText username; - private OsuLinkTextFlowContainer contentFlow; + private OsuLinkTextFlowContainer contentFlow; public Message Message { @@ -189,7 +189,7 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new OsuLinkTextFlowContainer(t => { t.TextSize = text_size; }) + contentFlow = new OsuLinkTextFlowContainer(t => { t.TextSize = text_size; }) { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -238,7 +238,7 @@ namespace osu.Game.Overlays.Chat sprite.Font = @"Exo2.0-MediumItalic"; // We want to use something that is unique to every formatted link PER MESSAGE - ((ChatLinkSpriteText)sprite).LinkId = link.Index; + ((ChatLink)sprite).LinkId = link.Index; }); } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 24ca01a3ad..d1941fb046 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -289,7 +289,7 @@ - + From 65afbd5c1b9957603769d631ad2d3c89470e510c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:29:33 +0100 Subject: [PATCH 031/628] Added new test case for URL parsing / link display in chat --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 112 ++++++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 113 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseChatLink.cs diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs new file mode 100644 index 0000000000..a2e73a56fb --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -0,0 +1,112 @@ +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Online.Chat; +using osu.Game.Overlays; +using osu.Game.Overlays.Chat; +using osu.Game.Users; +using System; +using System.Linq; + +namespace osu.Game.Tests.Visual +{ + class TestCaseChatLink : OsuTestCase + { + private readonly BeatmapSetOverlay beatmapSetOverlay; + private readonly ChatOverlay chat; + + private DependencyContainer dependencies; + + private readonly ChatLineContainer textContainer; + private ChatLine[] testSprites; + + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); + + public TestCaseChatLink() + { + chat = new ChatOverlay(); + Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MaxValue }); + + Add(textContainer = new ChatLineContainer + { + Padding = new MarginPadding { Left = 20, Right = 20 }, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + }); + + testSprites = new[] + { + new ChatLine(new DummyMessage("Test!")), + new ChatLine(new DummyMessage("osu.ppy.sh!")), + new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), + new ChatLine(new DummyMessage("https://osu.ppy.sh!")), + new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")), + new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")), + new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), + new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true)), + }; + } + + [BackgroundDependencyLoader] + private void load() + { + dependencies.Cache(chat); + dependencies.Cache(beatmapSetOverlay); + + textContainer.AddRange(testSprites); + } + + private class DummyMessage : Message + { + private static long messageCounter = 0; + private static User sender = new User + { + Username = @"Somebody", + Id = 1, + Country = new Country { FullName = @"Alien" }, + CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg", + JoinDate = DateTimeOffset.Now.AddDays(-1), + LastVisit = DateTimeOffset.Now, + Age = 1, + ProfileOrder = new[] { "me" }, + CountryRank = 1, + Statistics = new UserStatistics + { + Rank = 2148, + PP = 4567.89m + }, + RankHistory = new User.RankHistoryData + { + Mode = @"osu", + Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray() + } + }; + + public new long Id = 42; + public new TargetType TargetType = TargetType.Channel; + public new int TargetId = 1; + public new bool IsAction; + public new DateTimeOffset Timestamp = DateTimeOffset.Now; + + public DummyMessage(string text, bool isAction = false) + : base(messageCounter++) + { + Content = text; + IsAction = isAction; + Sender = sender; + } + } + + private class ChatLineContainer : FillFlowContainer + { + protected override int Compare(Drawable x, Drawable y) + { + var xC = (ChatLine)x; + var yC = (ChatLine)y; + + return xC.Message.CompareTo(yC.Message); + } + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index b4242052d5..1fc58593ed 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -121,6 +121,7 @@ + From 006ac44e117e6d732aa56e42b61062c882dc825e Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:29:54 +0100 Subject: [PATCH 032/628] Fixed up style in the ChatDisplay test --- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index e23531f46a..092f92530b 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -12,7 +12,7 @@ namespace osu.Game.Tests.Visual [Description("Testing chat api and overlay")] internal class TestCaseChatDisplay : OsuTestCase { - private BeatmapSetOverlay beatmapSetOverlay; + private readonly BeatmapSetOverlay beatmapSetOverlay; private readonly ChatOverlay chat; private DependencyContainer dependencies; @@ -21,12 +21,10 @@ namespace osu.Game.Tests.Visual public TestCaseChatDisplay() { - chat = new ChatOverlay + Add(chat = new ChatOverlay { State = Visibility.Visible - }; - - Add(chat); + }); Add(beatmapSetOverlay = new BeatmapSetOverlay()); } From ec8b5c246576e3a72ef84f7779ee963e13178484 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:31:02 +0100 Subject: [PATCH 033/628] Permitted nulls in ChatOverlay.load() so that in testing, no "OsuGame" instance is required. Also added null checks to the links' on click actions --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 12 +++++------- osu.Game/Overlays/ChatOverlay.cs | 6 +++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 75b3f281d0..d99562092d 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -99,7 +99,7 @@ namespace osu.Game.Graphics.Sprites break; case "edit": - chat.Game.LoadEditorTimestamp(); + chat.Game?.LoadEditorTimestamp(); break; case "b": if (args.Length > 1 && int.TryParse(args[1], out int mapId)) @@ -122,16 +122,14 @@ namespace osu.Game.Graphics.Sprites req.Success += user => { - // TODO: Open spectator screen and start spectating - + chat.Game?.LoadSpectatorScreen(); }; - // api.Queue(req); - chat.Game.LoadSpectatorScreen(); + api.Queue(req); break; default: throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]})."); - } + } } else if (url.StartsWith("osump://")) { @@ -139,7 +137,7 @@ namespace osu.Game.Graphics.Sprites if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) return; - chat.Game.LoadMultiplayerLobby(); + chat.Game?.LoadMultiplayerLobby(); } else if (url.StartsWith("http://") || url.StartsWith("https://")) { diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index eaf58cde5e..c09908ca1d 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -41,6 +41,9 @@ namespace osu.Game.Overlays private readonly FocusedTextBox textbox; + /// + /// The current OsuGame instance. Will be null for Tests. + /// public OsuGame Game; private APIAccess api; @@ -272,9 +275,10 @@ namespace osu.Game.Overlays base.PopOut(); } - [BackgroundDependencyLoader] + [BackgroundDependencyLoader(true)] private void load(APIAccess api, OsuConfigManager config, OsuColour colours, OsuGame game) { + // game will be null in testing, so some links will not work Game = game; this.api = api; api.Register(this); From 1b971c01e663d0cc5a2e9fb1bd52a0efbd79d547 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 10:31:44 +0100 Subject: [PATCH 034/628] Fixed a bug where links would be out of order in their List which would cause the game to crash --- osu.Game/Online/Chat/MessageFormatter.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index a712cb1f2b..5853d50c1f 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -137,6 +137,9 @@ namespace osu.Game.Online.Chat var formatted = inputMessage; formatted.Content = result.Text; + + // Sometimes, regex matches are not in order + result.Links.Sort(); formatted.Links = result.Links; return formatted; } @@ -153,7 +156,7 @@ namespace osu.Game.Online.Chat } } - public class Link + public class Link : IComparable { public string Url; public int Index; @@ -165,6 +168,8 @@ namespace osu.Game.Online.Chat Index = startIndex; Length = length; } + + public int CompareTo(Link otherLink) => Index > otherLink.Index ? 1 : -1; } } } From f3f3d1d0fc96ec45a78f99b0c7b5c5fbbf642422 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 11:11:43 +0100 Subject: [PATCH 035/628] Various test fixes --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index a2e73a56fb..a37d431760 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual private DependencyContainer dependencies; - private readonly ChatLineContainer textContainer; + private readonly TestChatLineContainer textContainer; private ChatLine[] testSprites; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); @@ -25,9 +25,9 @@ namespace osu.Game.Tests.Visual public TestCaseChatLink() { chat = new ChatOverlay(); - Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MaxValue }); + Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MinValue }); - Add(textContainer = new ChatLineContainer + Add(textContainer = new TestChatLineContainer { Padding = new MarginPadding { Left = 20, Right = 20 }, RelativeSizeAxes = Axes.X, @@ -39,11 +39,15 @@ namespace osu.Game.Tests.Visual { new ChatLine(new DummyMessage("Test!")), new ChatLine(new DummyMessage("osu.ppy.sh!")), - new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), + new ChatLine(new DummyMessage("http://lookatmy.horse/")), new ChatLine(new DummyMessage("https://osu.ppy.sh!")), new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")), + // TODO: Remove prefix and add tooltips with links new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")), - new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), + new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")), + new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")), + new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), + new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true)), }; } @@ -86,7 +90,6 @@ namespace osu.Game.Tests.Visual public new long Id = 42; public new TargetType TargetType = TargetType.Channel; public new int TargetId = 1; - public new bool IsAction; public new DateTimeOffset Timestamp = DateTimeOffset.Now; public DummyMessage(string text, bool isAction = false) @@ -98,7 +101,7 @@ namespace osu.Game.Tests.Visual } } - private class ChatLineContainer : FillFlowContainer + private class TestChatLineContainer : FillFlowContainer { protected override int Compare(Drawable x, Drawable y) { From bd11124e6dcaacec6d035a089573e5934647a599 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 11:12:12 +0100 Subject: [PATCH 036/628] Removed unnecessary copy (pass-by-reference anyways) --- osu.Game/Online/Chat/MessageFormatter.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 5853d50c1f..43bfa36fed 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -134,14 +134,13 @@ namespace osu.Game.Online.Chat public static Message FormatMessage(Message inputMessage) { var result = format(inputMessage.Content); - var formatted = inputMessage; - formatted.Content = result.Text; + inputMessage.Content = result.Text; // Sometimes, regex matches are not in order result.Links.Sort(); - formatted.Links = result.Links; - return formatted; + inputMessage.Links = result.Links; + return inputMessage; } public class MessageFormatterResult From 8a88040ef50fa47401a799e8cae198906946a779 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 11:12:21 +0100 Subject: [PATCH 037/628] Added tooltip to links --- osu.Game/Online/Chat/ChatLink.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index e375ace1a0..9fb557492c 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -5,6 +5,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -12,13 +13,15 @@ using System.Linq; namespace osu.Game.Online.Chat { - public class ChatLink : OsuLinkSpriteText + public class ChatLink : OsuLinkSpriteText, IHasTooltip { public int LinkId = -1; private Color4 hoverColour; private Color4 urlColour; + public string TooltipText => LinkId != -1 ? Url : null; + protected override bool OnHover(InputState state) { // Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link From f4f1291919ac2255726098b938471277df0967b8 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 11:23:31 +0100 Subject: [PATCH 038/628] Removed "wiki:" prefix from wiki links (links are visible on tooltips so this is unnecessary now) --- osu.Game/Online/Chat/MessageFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 43bfa36fed..f3b6bc93f7 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -111,7 +111,7 @@ namespace osu.Game.Online.Chat handleMatches(oldLinkRegex, "{1}", "{2}", result, startIndex); // handle wiki links - handleMatches(wikiRegex, "wiki:{1}", "https://osu.ppy.sh/wiki/{1}", result, startIndex); + handleMatches(wikiRegex, "{1}", "https://osu.ppy.sh/wiki/{1}", result, startIndex); // handle bare links handleAdvanced(advancedLinkRegex, result, startIndex); From a8599a1b75c59f39ee7e329d5a5f70f8e1fda2c7 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 13:12:36 +0100 Subject: [PATCH 039/628] Implemented new interface which allows parent containers to decide on whether a "OnHover" sound should be played. --- osu.Game/Graphics/Containers/OsuClickableContainer.cs | 4 +++- osu.Game/Graphics/UserInterface/HoverSounds.cs | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 8df533ad6e..2cae413de8 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Graphics.Containers { - public class OsuClickableContainer : ClickableContainer + public class OsuClickableContainer : ClickableContainer, IHasHoverSounds { private readonly HoverSampleSet sampleSet; @@ -16,6 +16,8 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; + public bool ShouldPlayHoverSound => true; + public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal) { this.sampleSet = sampleSet; diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index 24dbe37567..ea452650b4 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -9,6 +9,7 @@ using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using static osu.Game.Online.Chat.ChatLink; namespace osu.Game.Graphics.UserInterface { @@ -30,7 +31,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { - sampleHover?.Play(); + if ((Parent as IHasHoverSounds).ShouldPlayHoverSound) sampleHover?.Play(); return base.OnHover(state); } @@ -50,4 +51,9 @@ namespace osu.Game.Graphics.UserInterface [Description("-softer")] Soft } + + public interface IHasHoverSounds + { + bool ShouldPlayHoverSound { get; } + } } From 8ba66015f4a837182a1e6591810e47bbc544c2d9 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 13:17:40 +0100 Subject: [PATCH 040/628] Implemented the new IHasHoverSounds interface in a private "ChatHoverContainer" class which is now used for ChatLink instances. Also moved the overhead for finding all sprites in the same line that reference the same URL to the LoadComplete (used to be every hover, now only once). --- osu.Game/Online/Chat/ChatLink.cs | 42 +++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 9fb557492c..a5af3bfb3d 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -8,7 +8,11 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Chat; +using System.Collections.Generic; using System.Linq; namespace osu.Game.Online.Chat @@ -20,17 +24,34 @@ namespace osu.Game.Online.Chat private Color4 hoverColour; private Color4 urlColour; + private readonly ChatHoverContainer content; + + protected IEnumerable SameLinkSprites { get; private set; } + + protected override Container Content => content ?? base.Content; + public string TooltipText => LinkId != -1 ? Url : null; + public ChatLink() + { + AddInternal(content = new ChatHoverContainer + { + AutoSizeAxes = Axes.Both, + }); + + OnLoadComplete = d => + { + // All sprites in the same chatline that represent the same URL + SameLinkSprites = (d.Parent as Container).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !d.Equals(child)).Cast(); + }; + } + protected override bool OnHover(InputState state) { - // Every word is one sprite in chat (for word wrap) so we need to find all other sprites that display the same link - var otherSpritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !Equals(child)); - var hoverResult = base.OnHover(state); - if (!otherSpritesWithSameLink.Any(sprite => sprite.IsHovered)) - foreach (ChatLink sprite in otherSpritesWithSameLink) + if (!SameLinkSprites.Any(sprite => sprite.IsHovered)) + foreach (ChatLink sprite in SameLinkSprites) sprite.TriggerOnHover(state); Content.FadeColour(hoverColour, 500, Easing.OutQuint); @@ -40,16 +61,14 @@ namespace osu.Game.Online.Chat protected override void OnHoverLost(InputState state) { - var spritesWithSameLink = ((Container)Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId); - - if (spritesWithSameLink.Any(sprite => sprite.IsHovered)) + if (SameLinkSprites.Any(sprite => sprite.IsHovered)) { // We have to do this so this sprite does not fade its colour back Content.FadeColour(hoverColour, 500, Easing.OutQuint); return; } - foreach (ChatLink sprite in spritesWithSameLink) + foreach (ChatLink sprite in SameLinkSprites) sprite.Content.FadeColour(urlColour, 500, Easing.OutQuint); base.OnHoverLost(state); @@ -63,5 +82,10 @@ namespace osu.Game.Online.Chat if (LinkId != -1) Content.Colour = urlColour; } + + private class ChatHoverContainer : OsuHoverContainer, IHasHoverSounds + { + public bool ShouldPlayHoverSound => ((ChatLink)Parent).SameLinkSprites.All(sprite => !sprite.IsHovered); + } } } From 07660a660027139230461279eb44c573c958f023 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 13:17:51 +0100 Subject: [PATCH 041/628] Added licence header to the new test case --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index a37d431760..239ba33c26 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -1,4 +1,7 @@ -using osu.Framework.Allocation; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Online.Chat; @@ -83,10 +86,10 @@ namespace osu.Game.Tests.Visual RankHistory = new User.RankHistoryData { Mode = @"osu", - Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray() + Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray(), } }; - + public new long Id = 42; public new TargetType TargetType = TargetType.Channel; public new int TargetId = 1; From 5ded6e877c27717c6e0621af8a3c3aa15063e574 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 13:49:44 +0100 Subject: [PATCH 042/628] Added some tooltip text handling. Also fixed a bug caused by SameLinkSprites where "this" is actually supposed to be included by just adding a manual function call. --- osu.Game/Online/Chat/ChatLink.cs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index a5af3bfb3d..bfee170fd1 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -12,6 +12,7 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Chat; +using System; using System.Collections.Generic; using System.Linq; @@ -26,11 +27,29 @@ namespace osu.Game.Online.Chat private readonly ChatHoverContainer content; + /// + /// Every other sprite in the containing ChatLine that represents the same link. + /// protected IEnumerable SameLinkSprites { get; private set; } protected override Container Content => content ?? base.Content; - public string TooltipText => LinkId != -1 ? Url : null; + public string TooltipText + { + get + { + if (LinkId == -1 || Url == Text) + return null; + + if (Url.StartsWith("osu://chan/")) + return "Switch to channel " + Url.Substring(11); + + if (Url.StartsWith("osu://edit/") && TimeSpan.TryParse(Url.Substring(11).Split(' ')[0], out TimeSpan editorTimeStamp)) + return "Go to " + editorTimeStamp.ToString(); + + return Url; + } + } public ChatLink() { @@ -68,6 +87,8 @@ namespace osu.Game.Online.Chat return; } + Content.FadeColour(urlColour, 500, Easing.OutQuint); + foreach (ChatLink sprite in SameLinkSprites) sprite.Content.FadeColour(urlColour, 500, Easing.OutQuint); From ca40db2b97836d1a6ecabebe14a37cbdbea3d556 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 13:57:29 +0100 Subject: [PATCH 043/628] Fixed a bug where the hover wouldn't work correctly due to OsuLinkSpriteText assigning Action to a private property. --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index d99562092d..ad5045ff10 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -51,7 +51,12 @@ namespace osu.Game.Graphics.Sprites if (!string.IsNullOrEmpty(value)) { url = value; + content.Action = onClickAction; + + // For inheriting classes + if (Content is OsuHoverContainer hover) + hover.Action = onClickAction; } } } From 2129d6cede8ec2ffdfc30ded337afacd36eda80d Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:23:43 +0100 Subject: [PATCH 044/628] Renamed the "on click" method to OnClick() and moved most of the implementation to ChatLink. Also fixed the tooltip text up --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 125 +---------------- osu.Game/Online/Chat/ChatLink.cs | 130 +++++++++++++++++- 2 files changed, 127 insertions(+), 128 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index ad5045ff10..cc19a50f24 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -25,13 +25,8 @@ namespace osu.Game.Graphics.Sprites { public class OsuLinkSpriteText : OsuSpriteText { - private ChatOverlay chat; - private readonly OsuHoverContainer content; - private APIAccess api; - private BeatmapSetOverlay beatmapSetOverlay; - public override bool HandleInput => content.Action != null; protected override Container Content => content ?? (Container)this; @@ -52,11 +47,7 @@ namespace osu.Game.Graphics.Sprites { url = value; - content.Action = onClickAction; - - // For inheriting classes - if (Content is OsuHoverContainer hover) - hover.Action = onClickAction; + content.Action = OnClick; } } } @@ -75,118 +66,6 @@ namespace osu.Game.Graphics.Sprites set { Content.Colour = value; } } - [BackgroundDependencyLoader] - private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) - { - this.api = api; - this.beatmapSetOverlay = beatmapSetOverlay; - this.chat = chat; - } - - private void onClickAction() - { - var url = Url; - - if (url.StartsWith("osu://")) - { - url = url.Substring(6); - var args = url.Split('/'); - - switch (args[0]) - { - case "chan": - var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); - - if (foundChannel == null) - TextColour = Color4.White; - else - chat.OpenChannel(foundChannel); - - break; - case "edit": - chat.Game?.LoadEditorTimestamp(); - break; - case "b": - if (args.Length > 1 && int.TryParse(args[1], out int mapId)) - beatmapSetOverlay.ShowBeatmap(mapId); - - break; - case "s": - case "dl": - if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) - beatmapSetOverlay.ShowBeatmapSet(mapSetId); - - break; - case "spectate": - GetUserRequest req; - if (int.TryParse(args[1], out int userId)) - req = new GetUserRequest(userId); - else - // Get by username instead - req = new GetUserRequest(args[1]); - - req.Success += user => - { - chat.Game?.LoadSpectatorScreen(); - }; - api.Queue(req); - - break; - default: - throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]})."); - } - } - else if (url.StartsWith("osump://")) - { - url = url.Substring(8); - if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) - return; - - chat.Game?.LoadMultiplayerLobby(); - } - else if (url.StartsWith("http://") || url.StartsWith("https://")) - { - var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); - if (osuUrlIndex == -1) - { - Process.Start(url); - return; - } - - url = url.Substring(osuUrlIndex + 11); - if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) - { - var id = getIdFromUrl(url); - beatmapSetOverlay.ShowBeatmapSet(id); - } - else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) - { - var id = getIdFromUrl(url); - beatmapSetOverlay.ShowBeatmap(id); - } - else - Process.Start($"https://osu.ppy.sh/{url}"); - } - else - Process.Start(url); - } - - private int getIdFromUrl(string url) - { - var lastSlashIndex = url.LastIndexOf('/'); - // Remove possible trailing slash - if (lastSlashIndex == url.Length) - { - url = url.Remove(url.Length - 1); - lastSlashIndex = url.LastIndexOf('/'); - } - - var lastQuestionMarkIndex = url.LastIndexOf('?'); - // Filter out possible queries like mode specifications (e.g. /b/252238?m=0) - if (lastQuestionMarkIndex > lastSlashIndex) - url = url.Remove(lastQuestionMarkIndex); - - return int.Parse(url.Substring(lastSlashIndex + 1)); - } + protected virtual void OnClick() => Process.Start(Url); } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index bfee170fd1..4aa182b994 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -11,9 +11,13 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using osu.Game.Online.API; +using osu.Game.Online.API.Requests; +using osu.Game.Overlays; using osu.Game.Overlays.Chat; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; namespace osu.Game.Online.Chat @@ -22,6 +26,10 @@ namespace osu.Game.Online.Chat { public int LinkId = -1; + private APIAccess api; + private BeatmapSetOverlay beatmapSetOverlay; + private ChatOverlay chat; + private Color4 hoverColour; private Color4 urlColour; @@ -34,6 +42,107 @@ namespace osu.Game.Online.Chat protected override Container Content => content ?? base.Content; + protected override void OnClick() + { + var url = Url; + + if (url.StartsWith("osu://")) + { + url = url.Substring(6); + var args = url.Split('/'); + + switch (args[0]) + { + case "chan": + var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); + + if (foundChannel == null) + throw new ArgumentException($"Unknown channel name ({args[1]})."); + else + chat.OpenChannel(foundChannel); + + break; + case "edit": + chat.Game?.LoadEditorTimestamp(); + break; + case "b": + if (args.Length > 1 && int.TryParse(args[1], out int mapId)) + beatmapSetOverlay.ShowBeatmap(mapId); + + break; + case "s": + case "dl": + if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) + beatmapSetOverlay.ShowBeatmapSet(mapSetId); + + break; + case "spectate": + GetUserRequest req; + if (int.TryParse(args[1], out int userId)) + req = new GetUserRequest(userId); + else + // Get by username instead + req = new GetUserRequest(args[1]); + + req.Success += user => + { + chat.Game?.LoadSpectatorScreen(); + }; + api.Queue(req); + + break; + default: + throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]})."); + } + } + else if (url.StartsWith("osump://")) + { + url = url.Substring(8); + if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) + return; + + chat.Game?.LoadMultiplayerLobby(); + } + else if (url.StartsWith("http://") || url.StartsWith("https://") && url.IndexOf("osu.ppy.sh/") != -1) + { + var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); + + url = url.Substring(osuUrlIndex + 11); + if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) + { + var id = getIdFromUrl(url); + beatmapSetOverlay.ShowBeatmapSet(id); + } + else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) + { + var id = getIdFromUrl(url); + beatmapSetOverlay.ShowBeatmap(id); + } + else + base.OnClick(); + } + else + base.OnClick(); + } + + private int getIdFromUrl(string url) + { + var lastSlashIndex = url.LastIndexOf('/'); + // Remove possible trailing slash + if (lastSlashIndex == url.Length) + { + url = url.Remove(url.Length - 1); + lastSlashIndex = url.LastIndexOf('/'); + } + + var lastQuestionMarkIndex = url.LastIndexOf('?'); + // Filter out possible queries like mode specifications (e.g. /b/252238?m=0) + if (lastQuestionMarkIndex > lastSlashIndex) + url = url.Remove(lastQuestionMarkIndex); + + return int.Parse(url.Substring(lastSlashIndex + 1)); + } + public string TooltipText { get @@ -41,11 +150,18 @@ namespace osu.Game.Online.Chat if (LinkId == -1 || Url == Text) return null; - if (Url.StartsWith("osu://chan/")) - return "Switch to channel " + Url.Substring(11); + if (Url.StartsWith("osu://")) + { + var args = Url.Substring(6).Split('/'); - if (Url.StartsWith("osu://edit/") && TimeSpan.TryParse(Url.Substring(11).Split(' ')[0], out TimeSpan editorTimeStamp)) - return "Go to " + editorTimeStamp.ToString(); + if (args.Length < 2) + return Url; + + if (args[0] == "chan") + return "Switch to channel " + args[1]; + if (args[0] == "edit") + return "Go to " + args[1].Remove(9).TrimEnd(); + } return Url; } @@ -96,8 +212,12 @@ namespace osu.Game.Online.Chat } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuColour colours) { + this.api = api; + this.beatmapSetOverlay = beatmapSetOverlay; + this.chat = chat; + hoverColour = colours.Yellow; urlColour = colours.Blue; if (LinkId != -1) From 18eabd35f6633c1234944529a85e18d8f6e562a7 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:25:30 +0100 Subject: [PATCH 045/628] Set an empty list as default for AvailableChannels (mostly so that tests don't break, but also so that if no connection exists, the links don't break) --- osu.Game/Overlays/ChatOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index c09908ca1d..61e37b6e2f 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -65,7 +65,7 @@ namespace osu.Game.Overlays public Bindable ChatHeight { get; set; } - public List AvailableChannels { get; private set; } + public List AvailableChannels { get; private set; } = new List(); private readonly Container channelSelectionContainer; private readonly ChannelSelectionOverlay channelSelection; From d90eb2cdce7386926b58439e65cb24ceacc8f904 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:26:28 +0100 Subject: [PATCH 046/628] Moved "Does this channel exist" check to ChatLine so that if a #name does not exist as a channel, it does not get added as a link (and does not contain a URL or anything else to prevent jankiness) --- osu.Game/Overlays/Chat/ChatLine.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 475a49b12e..db7c255eb4 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -102,8 +102,9 @@ namespace osu.Game.Overlays.Chat } [BackgroundDependencyLoader(true)] - private void load(OsuColour colours) + private void load(OsuColour colours, ChatOverlay chat) { + this.chat = chat; customUsernameColour = colours.ChatBlue; urlColour = colours.Blue; } @@ -204,6 +205,8 @@ namespace osu.Game.Overlays.Chat FinishTransforms(true); } + private ChatOverlay chat; + private void updateMessageContent() { this.FadeTo(message is LocalEchoMessage ? 0.4f : 1.0f, 500, Easing.OutQuint); @@ -232,6 +235,17 @@ namespace osu.Game.Overlays.Chat contentFlow.AddText(message.Content.Substring(prevIndex, link.Index - prevIndex)); prevIndex = link.Index + link.Length; + // If a channel doesn't exist, add it as normal text instead + if (link.Url.StartsWith("osu://chan/")) + { + var channelName = link.Url.Substring(11).Split('/')[0]; + if (chat.AvailableChannels.TrueForAll(c => c.Name != channelName)) + { + contentFlow.AddText(message.Content.Substring(link.Index, link.Length)); + continue; + } + } + contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => { if (message.IsAction) From 334cb3dd10150be74171aa08033754437c8588da Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:26:50 +0100 Subject: [PATCH 047/628] Removed TODO and added another test line --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 239ba33c26..8371298d28 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -40,18 +40,19 @@ namespace osu.Game.Tests.Visual testSprites = new[] { + new ChatLine(new DummyMessage("Test!")), new ChatLine(new DummyMessage("osu.ppy.sh!")), new ChatLine(new DummyMessage("http://lookatmy.horse/")), new ChatLine(new DummyMessage("https://osu.ppy.sh!")), new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")), - // TODO: Remove prefix and add tooltips with links new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")), new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")), new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")), new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true)), + new ChatLine(new DummyMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")), }; } From 2ceb073b5dce2a885f341fec23e0467318cabf8a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:30:15 +0100 Subject: [PATCH 048/628] Renamed OnClick to OnLinkClicked to (what should be) obvious reasons --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 4 ++-- osu.Game/Online/Chat/ChatLink.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index cc19a50f24..24a6f4b667 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -47,7 +47,7 @@ namespace osu.Game.Graphics.Sprites { url = value; - content.Action = OnClick; + content.Action = OnLinkClicked; } } } @@ -66,6 +66,6 @@ namespace osu.Game.Graphics.Sprites set { Content.Colour = value; } } - protected virtual void OnClick() => Process.Start(Url); + protected virtual void OnLinkClicked() => Process.Start(Url); } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 4aa182b994..0fbe9820f7 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -42,7 +42,7 @@ namespace osu.Game.Online.Chat protected override Container Content => content ?? base.Content; - protected override void OnClick() + protected override void OnLinkClicked() { var url = Url; @@ -119,10 +119,10 @@ namespace osu.Game.Online.Chat beatmapSetOverlay.ShowBeatmap(id); } else - base.OnClick(); + base.OnLinkClicked(); } else - base.OnClick(); + base.OnLinkClicked(); } private int getIdFromUrl(string url) From 465f92af073a136fa6a534eed93e4a7d9980b3e9 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:31:02 +0100 Subject: [PATCH 049/628] Removed unnecessary whitespace --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 8371298d28..bed404bfc0 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -40,7 +40,6 @@ namespace osu.Game.Tests.Visual testSprites = new[] { - new ChatLine(new DummyMessage("Test!")), new ChatLine(new DummyMessage("osu.ppy.sh!")), new ChatLine(new DummyMessage("http://lookatmy.horse/")), From 772bba27be0608fc04f2bda6cf49ca8e411fdecd Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:41:46 +0100 Subject: [PATCH 050/628] Small style changes --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 4 ++-- osu.Game/Overlays/Chat/ChatLine.cs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index bed404bfc0..1b6556e836 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -66,8 +66,8 @@ namespace osu.Game.Tests.Visual private class DummyMessage : Message { - private static long messageCounter = 0; - private static User sender = new User + private static long messageCounter; + private readonly static User sender = new User { Username = @"Somebody", Id = 1, diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index db7c255eb4..963fee5aa9 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -256,7 +256,6 @@ namespace osu.Game.Overlays.Chat }); } - // Add text after the last link var lastLink = message.Links[message.Links.Count - 1]; contentFlow.AddText(message.Content.Substring(lastLink.Index + lastLink.Length)); } From ce9b003e9a76e7044d5cc6ce318ffb9336107a4e Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:52:43 +0100 Subject: [PATCH 051/628] Reverted GetUserRequest because spectating is not implemented yet, and thus the additions are not needed (yet) --- osu.Game/Online/API/Requests/GetUserRequest.cs | 9 +-------- osu.Game/Online/Chat/ChatLink.cs | 3 +-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 47038b8ccb..3fbfd6bf51 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -8,7 +8,6 @@ namespace osu.Game.Online.API.Requests public class GetUserRequest : APIRequest { private long? userId; - private string userName; /// The user's ID. public GetUserRequest(long? userId = null) @@ -16,13 +15,7 @@ namespace osu.Game.Online.API.Requests this.userId = userId; } - /// The user's username. - public GetUserRequest(string userName) - { - this.userName = userName; - } - // Prefer ID over name - protected override string Target => userId.HasValue ? $@"users/{userId}" : ((!string.IsNullOrEmpty(userName)) ? $@"users/{userName}" : @"me"); + protected override string Target => userId.HasValue ? $@"users/{userId}" : @"me"; } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 0fbe9820f7..2f0f3c0329 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -81,8 +81,7 @@ namespace osu.Game.Online.Chat if (int.TryParse(args[1], out int userId)) req = new GetUserRequest(userId); else - // Get by username instead - req = new GetUserRequest(args[1]); + return; req.Success += user => { From 6b0b518fd2207000b2fda761aa0ed543c30f7581 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 16:58:16 +0100 Subject: [PATCH 052/628] *ahem* REVERTED the changes to GetUserRequest because they're not needed (yet) --- osu.Game/Online/API/Requests/GetUserRequest.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 3fbfd6bf51..2e3e7b01c8 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -9,13 +9,11 @@ namespace osu.Game.Online.API.Requests { private long? userId; - /// The user's ID. public GetUserRequest(long? userId = null) { this.userId = userId; } - // Prefer ID over name protected override string Target => userId.HasValue ? $@"users/{userId}" : @"me"; } } From e05618a415ee44f641400ea1f074f3bc2c4cfc92 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:36:56 +0100 Subject: [PATCH 053/628] Removed unnecessary "using" directives --- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 1 - .../Graphics/Containers/OsuLinkTextFlowContainer.cs | 6 ------ osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 13 ------------- osu.Game/Online/API/Requests/GetBeatmapRequest.cs | 5 ----- osu.Game/Online/Chat/Message.cs | 1 - osu.Game/Overlays/Profile/ProfileHeader.cs | 2 -- 6 files changed, 28 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 092f92530b..3105d1c91b 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -4,7 +4,6 @@ using System.ComponentModel; using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; -using osu.Game.Online.API; using osu.Game.Overlays; namespace osu.Game.Tests.Visual diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs index ebb4cca0e0..382d2d73f4 100644 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -1,17 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; using osu.Game.Graphics.Sprites; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace osu.Game.Graphics.Containers { diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 24a6f4b667..771903c8f3 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -1,25 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; -using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; -using osu.Framework.Input; -using osu.Framework.Screens; -using osu.Game.Beatmaps; using osu.Game.Graphics.Containers; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; -using osu.Game.Overlays; -using osu.Game.Screens.Edit; -using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace osu.Game.Graphics.Sprites { diff --git a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs index 1df695c795..76d67e7afc 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs @@ -2,11 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace osu.Game.Online.API.Requests { diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 355abfda59..ac14d3a88f 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Collections; using System.Collections.Generic; using System.ComponentModel; using Newtonsoft.Json; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index af3e97db27..52038ce810 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -16,8 +16,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using System.Diagnostics; -using System.Collections.Generic; using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Profile From 908553ffafc164149ddd48c626dd491961bb4d2d Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:38:03 +0100 Subject: [PATCH 054/628] Added parameter for LoadMultiplayerLobby (CI warning for unused int) --- osu.Game/Online/Chat/ChatLink.cs | 10 ++++------ osu.Game/OsuGame.cs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 2f0f3c0329..b9e13e3464 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -14,10 +14,8 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays; -using osu.Game.Overlays.Chat; using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; namespace osu.Game.Online.Chat @@ -100,11 +98,11 @@ namespace osu.Game.Online.Chat if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) return; - chat.Game?.LoadMultiplayerLobby(); + chat.Game?.LoadMultiplayerLobby(multiId); } - else if (url.StartsWith("http://") || url.StartsWith("https://") && url.IndexOf("osu.ppy.sh/") != -1) + else if (url.StartsWith("http://") || url.StartsWith("https://") && url.IndexOf("osu.ppy.sh/", StringComparison.InvariantCultureIgnoreCase) != -1) { - var osuUrlIndex = url.IndexOf("osu.ppy.sh/"); + var osuUrlIndex = url.IndexOf("osu.ppy.sh/", StringComparison.InvariantCultureIgnoreCase); url = url.Substring(osuUrlIndex + 11); if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) @@ -176,7 +174,7 @@ namespace osu.Game.Online.Chat OnLoadComplete = d => { // All sprites in the same chatline that represent the same URL - SameLinkSprites = (d.Parent as Container).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !d.Equals(child)).Cast(); + SameLinkSprites = ((Container)d.Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !d.Equals(child)).Cast(); }; } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 900a55293d..00c8736f44 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -134,7 +134,7 @@ namespace osu.Game }); } - internal void LoadMultiplayerLobby() + internal void LoadMultiplayerLobby(int lobbyId) { notificationOverlay.Post(new SimpleNotification { From 34a37935e35e20769307a1717dcfe61c232596a7 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:38:59 +0100 Subject: [PATCH 055/628] Removed unused property and unnecessary return statement (CI) --- osu.Game/Overlays/Chat/ChatLine.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 963fee5aa9..5fbfed5a67 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -67,7 +67,6 @@ namespace osu.Game.Overlays.Chat private const float text_size = 20; private Color4 customUsernameColour; - private Color4 urlColour; private OsuSpriteText timestamp; @@ -106,7 +105,6 @@ namespace osu.Game.Overlays.Chat { this.chat = chat; customUsernameColour = colours.ChatBlue; - urlColour = colours.Blue; } private bool senderHasBackground => !string.IsNullOrEmpty(message.Sender.Colour); @@ -224,8 +222,6 @@ namespace osu.Game.Overlays.Chat if (message.IsAction) sprite.Font = @"Exo2.0-MediumItalic"; }); - - return; } else { From c950d1359acb9528335f15d6db5987ea188c0f04 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:39:13 +0100 Subject: [PATCH 056/628] various CI adjustments --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 1b6556e836..6a36411407 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -13,7 +13,7 @@ using System.Linq; namespace osu.Game.Tests.Visual { - class TestCaseChatLink : OsuTestCase + internal class TestCaseChatLink : OsuTestCase { private readonly BeatmapSetOverlay beatmapSetOverlay; private readonly ChatOverlay chat; @@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual private DependencyContainer dependencies; private readonly TestChatLineContainer textContainer; - private ChatLine[] testSprites; + private readonly ChatLine[] testSprites; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); @@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual private class DummyMessage : Message { private static long messageCounter; - private readonly static User sender = new User + private static readonly User sender = new User { Username = @"Somebody", Id = 1, @@ -90,9 +90,6 @@ namespace osu.Game.Tests.Visual } }; - public new long Id = 42; - public new TargetType TargetType = TargetType.Channel; - public new int TargetId = 1; public new DateTimeOffset Timestamp = DateTimeOffset.Now; public DummyMessage(string text, bool isAction = false) From c5a7f5b16321f030669a7d956504ecfbf33ebf55 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:39:39 +0100 Subject: [PATCH 057/628] Renamed the static variables and made them readonly, aswell as other small adjustments (CI) --- osu.Game/Online/Chat/MessageFormatter.cs | 35 +++++++++++------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index f3b6bc93f7..81551b08f4 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -3,28 +3,25 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; namespace osu.Game.Online.Chat { public static class MessageFormatter { // [[Performance Points]] -> wiki:Performance Points (https://osu.ppy.sh/wiki/Performance_Points) - private static Regex wikiRegex = new Regex(@"\[\[([^\]]+)\]\]"); + private static readonly Regex wiki_regex = new Regex(@"\[\[([^\]]+)\]\]"); // (test)[https://osu.ppy.sh/b/1234] -> test (https://osu.ppy.sh/b/1234) - private static Regex oldLinkRegex = new Regex(@"\(([^\)]*)\)\[([a-z]+://[^ ]+)\]"); + private static readonly Regex old_link_regex = new Regex(@"\(([^\)]*)\)\[([a-z]+://[^ ]+)\]"); // [https://osu.ppy.sh/b/1234 Beatmap [Hard] (poop)] -> Beatmap [hard] (poop) (https://osu.ppy.sh/b/1234) - private static Regex newLinkRegex = new Regex(@"\[([a-z]+://[^ ]+) ([^\[\]]*(((?\[)[^\[\]]*)+((?\])[^\[\]]*)+)*(?(open)(?!)))\]"); + private static readonly Regex new_link_regex = new Regex(@"\[([a-z]+://[^ ]+) ([^\[\]]*(((?\[)[^\[\]]*)+((?\])[^\[\]]*)+)*(?(open)(?!)))\]"); // advanced, RFC-compatible regular expression that matches any possible URL, *but* allows certain invalid characters that are widely used // This is in the format (, [optional]): // http[s]://.[:port][/path][?query][#fragment] - private static Regex advancedLinkRegex = new Regex(@"(?\([^)]*)?" + + private static readonly Regex advanced_link_regex = new Regex(@"(?\([^)]*)?" + @"(?https?:\/\/" + @"(?(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z][a-z0-9-]*[a-z0-9]" + // domain, TLD @"(?::\d+)?)" + // port @@ -34,13 +31,13 @@ namespace osu.Game.Online.Chat RegexOptions.IgnoreCase); // 00:00:000 (1,2,3) - test - private static Regex timeRegex = new Regex(@"\d\d:\d\d:\d\d\d? [^-]*"); + private static readonly Regex time_regex = new Regex(@"\d\d:\d\d:\d\d\d? [^-]*"); // #osu - private static Regex channelRegex = new Regex(@"#[a-zA-Z]+[a-zA-Z0-9]+"); + private static readonly Regex channel_regex = new Regex(@"#[a-zA-Z]+[a-zA-Z0-9]+"); // Unicode emojis - private static Regex emojiRegex = new Regex(@"(\uD83D[\uDC00-\uDE4F])"); + private static readonly Regex emoji_regex = new Regex(@"(\uD83D[\uDC00-\uDE4F])"); private static void handleMatches(Regex regex, string display, string link, MessageFormatterResult result, int startIndex = 0) { @@ -62,7 +59,7 @@ namespace osu.Game.Online.Chat if (displayText.Length == 0 || linkText.Length == 0) continue; // Check for encapsulated links - if (result.Links.Find(l => (l.Index <= index && l.Index + l.Length >= index + m.Length) || index <= l.Index && index + m.Length >= l.Index + l.Length) == null) + if (result.Links.Find(l => l.Index <= index && l.Index + l.Length >= index + m.Length || index <= l.Index && index + m.Length >= l.Index + l.Length) == null) { result.Text = result.Text.Remove(index, m.Length).Insert(index, displayText); @@ -72,7 +69,7 @@ namespace osu.Game.Online.Chat result.Links.Add(new Link(linkText, index, displayText.Length)); //adjust the offset for processing the current matches group. - captureOffset += (m.Length - displayText.Length); + captureOffset += m.Length - displayText.Length; } } } @@ -105,28 +102,28 @@ namespace osu.Game.Online.Chat var result = new MessageFormatterResult(toFormat); // handle the [link display] format - handleMatches(newLinkRegex, "{2}", "{1}", result, startIndex); + handleMatches(new_link_regex, "{2}", "{1}", result, startIndex); // handle the ()[] link format - handleMatches(oldLinkRegex, "{1}", "{2}", result, startIndex); + handleMatches(old_link_regex, "{1}", "{2}", result, startIndex); // handle wiki links - handleMatches(wikiRegex, "{1}", "https://osu.ppy.sh/wiki/{1}", result, startIndex); + handleMatches(wiki_regex, "{1}", "https://osu.ppy.sh/wiki/{1}", result, startIndex); // handle bare links - handleAdvanced(advancedLinkRegex, result, startIndex); + handleAdvanced(advanced_link_regex, result, startIndex); // handle editor times - handleMatches(timeRegex, "{0}", "osu://edit/{0}", result, startIndex); + handleMatches(time_regex, "{0}", "osu://edit/{0}", result, startIndex); // handle channels - handleMatches(channelRegex, "{0}", "osu://chan/{0}", result, startIndex); + handleMatches(channel_regex, "{0}", "osu://chan/{0}", result, startIndex); var empty = ""; while (space-- > 0) empty += "\0"; - handleMatches(emojiRegex, empty, "{0}", result, startIndex); + handleMatches(emoji_regex, empty, "{0}", result, startIndex); return result; } From 68255095a65a5e63e1b8988e71a8817a3a45c00e Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:52:40 +0100 Subject: [PATCH 058/628] Renamed the IHasHoverSounds interface to ICanDisableHoverSounds and made it so that if the interface is not implemented, it is just ignored (samples will always be played). If it is implemented, the ShouldPlayHoverSound bool is decisive of whether sounds are played or not --- .../Graphics/Containers/OsuClickableContainer.cs | 4 +--- osu.Game/Graphics/UserInterface/HoverSounds.cs | 12 ++++++++---- osu.Game/Online/Chat/ChatLink.cs | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 2cae413de8..8df533ad6e 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Graphics.Containers { - public class OsuClickableContainer : ClickableContainer, IHasHoverSounds + public class OsuClickableContainer : ClickableContainer { private readonly HoverSampleSet sampleSet; @@ -16,8 +16,6 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; - public bool ShouldPlayHoverSound => true; - public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal) { this.sampleSet = sampleSet; diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index ea452650b4..ccdb5a50e0 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -9,7 +9,6 @@ using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; -using static osu.Game.Online.Chat.ChatLink; namespace osu.Game.Graphics.UserInterface { @@ -20,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface public class HoverSounds : CompositeDrawable { private SampleChannel sampleHover; - + protected readonly HoverSampleSet SampleSet; public HoverSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) @@ -31,7 +30,8 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { - if ((Parent as IHasHoverSounds).ShouldPlayHoverSound) sampleHover?.Play(); + // If Parent does not implement the interface, still play the sample + if ((Parent as ICanDisableHoverSounds)?.ShouldPlayHoverSound != false) sampleHover?.Play(); return base.OnHover(state); } @@ -52,7 +52,11 @@ namespace osu.Game.Graphics.UserInterface Soft } - public interface IHasHoverSounds + /// + /// Classes implementing this interface can choose whether or not the HoverSounds should be played. + /// If this is not implemented, the sounds will always be played when OnHover is triggered. + /// + public interface ICanDisableHoverSounds { bool ShouldPlayHoverSound { get; } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index b9e13e3464..42f5ea3e16 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -221,7 +221,7 @@ namespace osu.Game.Online.Chat Content.Colour = urlColour; } - private class ChatHoverContainer : OsuHoverContainer, IHasHoverSounds + private class ChatHoverContainer : OsuHoverContainer, ICanDisableHoverSounds { public bool ShouldPlayHoverSound => ((ChatLink)Parent).SameLinkSprites.All(sprite => !sprite.IsHovered); } From 5546b8c3160f2f9c7b38a543ae56e5bd20101655 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 19:55:29 +0100 Subject: [PATCH 059/628] Trimmed whitespace (CI) --- osu.Game/Graphics/UserInterface/HoverSounds.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index ccdb5a50e0..43adea49dd 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -19,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface public class HoverSounds : CompositeDrawable { private SampleChannel sampleHover; - + protected readonly HoverSampleSet SampleSet; public HoverSounds(HoverSampleSet sampleSet = HoverSampleSet.Normal) From 2568ac1bf78b613849abb708af049bb803c68bd1 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 10:42:05 +0100 Subject: [PATCH 060/628] Fixed small merging mistake --- osu.Game/osu.Game.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ed371f6c39..683035f3a4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -294,7 +294,6 @@ - @@ -861,4 +860,4 @@ - + \ No newline at end of file From 13bc50ad56251c5cece3c7da8c6bea3c37ca9d02 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 10:42:36 +0100 Subject: [PATCH 061/628] Removed ICanDisableHoverSounds interface --- osu.Game/Graphics/UserInterface/HoverSounds.cs | 12 +----------- osu.Game/Online/Chat/ChatLink.cs | 9 ++++----- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index 43adea49dd..24dbe37567 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -30,8 +30,7 @@ namespace osu.Game.Graphics.UserInterface protected override bool OnHover(InputState state) { - // If Parent does not implement the interface, still play the sample - if ((Parent as ICanDisableHoverSounds)?.ShouldPlayHoverSound != false) sampleHover?.Play(); + sampleHover?.Play(); return base.OnHover(state); } @@ -51,13 +50,4 @@ namespace osu.Game.Graphics.UserInterface [Description("-softer")] Soft } - - /// - /// Classes implementing this interface can choose whether or not the HoverSounds should be played. - /// If this is not implemented, the sounds will always be played when OnHover is triggered. - /// - public interface ICanDisableHoverSounds - { - bool ShouldPlayHoverSound { get; } - } } diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 42f5ea3e16..83b1429993 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -4,6 +4,7 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; @@ -180,15 +181,13 @@ namespace osu.Game.Online.Chat protected override bool OnHover(InputState state) { - var hoverResult = base.OnHover(state); - if (!SameLinkSprites.Any(sprite => sprite.IsHovered)) foreach (ChatLink sprite in SameLinkSprites) sprite.TriggerOnHover(state); Content.FadeColour(hoverColour, 500, Easing.OutQuint); - return hoverResult; + return true; } protected override void OnHoverLost(InputState state) @@ -221,9 +220,9 @@ namespace osu.Game.Online.Chat Content.Colour = urlColour; } - private class ChatHoverContainer : OsuHoverContainer, ICanDisableHoverSounds + private class ChatHoverContainer : OsuHoverContainer { - public bool ShouldPlayHoverSound => ((ChatLink)Parent).SameLinkSprites.All(sprite => !sprite.IsHovered); + } } } From 4d475f1c1bcfa420ead2ea077c4e191f09d3806b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 11:05:32 +0100 Subject: [PATCH 062/628] Changed it so ChatLinks handle hover and click sounds themselves --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 15 ++++++----- osu.Game/Online/Chat/ChatLink.cs | 25 +++++++++++++------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 771903c8f3..21b62ee37e 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -4,6 +4,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; +using osu.Framework.Input; using osu.Game.Graphics.Containers; using System.Collections.Generic; using System.Diagnostics; @@ -12,7 +13,7 @@ namespace osu.Game.Graphics.Sprites { public class OsuLinkSpriteText : OsuSpriteText { - private readonly OsuHoverContainer content; + private readonly OsuClickableContainer content; public override bool HandleInput => content.Action != null; @@ -20,6 +21,12 @@ namespace osu.Game.Graphics.Sprites protected override IEnumerable FlowingChildren => Children; + protected override bool OnClick(InputState state) + { + OnLinkClicked(); + return true; + } + private string url; public string Url @@ -31,17 +38,13 @@ namespace osu.Game.Graphics.Sprites set { if (!string.IsNullOrEmpty(value)) - { url = value; - - content.Action = OnLinkClicked; - } } } public OsuLinkSpriteText() { - AddInternal(content = new OsuHoverContainer + AddInternal(content = new OsuClickableContainer { AutoSizeAxes = Axes.Both, }); diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 83b1429993..08a3184034 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -32,7 +32,8 @@ namespace osu.Game.Online.Chat private Color4 hoverColour; private Color4 urlColour; - private readonly ChatHoverContainer content; + private readonly Container content; + private readonly HoverClickSounds hoverClickSounds; /// /// Every other sprite in the containing ChatLine that represents the same link. @@ -41,6 +42,12 @@ namespace osu.Game.Online.Chat protected override Container Content => content ?? base.Content; + protected override bool OnClick(InputState state) + { + hoverClickSounds.TriggerOnClick(state); + return base.OnClick(state); + } + protected override void OnLinkClicked() { var url = Url; @@ -167,7 +174,9 @@ namespace osu.Game.Online.Chat public ChatLink() { - AddInternal(content = new ChatHoverContainer + hoverClickSounds = new HoverClickSounds(); + + AddInternal(content = new Container { AutoSizeAxes = Axes.Both, }); @@ -182,8 +191,12 @@ namespace osu.Game.Online.Chat protected override bool OnHover(InputState state) { if (!SameLinkSprites.Any(sprite => sprite.IsHovered)) + { + hoverClickSounds.TriggerOnHover(state); + foreach (ChatLink sprite in SameLinkSprites) sprite.TriggerOnHover(state); + } Content.FadeColour(hoverColour, 500, Easing.OutQuint); @@ -210,6 +223,9 @@ namespace osu.Game.Online.Chat [BackgroundDependencyLoader] private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuColour colours) { + // Should be ok, inexpensive operation + LoadComponentAsync(hoverClickSounds); + this.api = api; this.beatmapSetOverlay = beatmapSetOverlay; this.chat = chat; @@ -219,10 +235,5 @@ namespace osu.Game.Online.Chat if (LinkId != -1) Content.Colour = urlColour; } - - private class ChatHoverContainer : OsuHoverContainer - { - - } } } From bb0a32b55509e1c6b43b18db57c5ced2b216d3d8 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 11:28:16 +0100 Subject: [PATCH 063/628] Removed private OsuHoverContainer "content" from OsuLinkSpriteText for more customization. --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 16 +--------------- osu.Game/Overlays/Profile/ProfileHeader.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 21b62ee37e..cc40ac2214 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -13,18 +13,12 @@ namespace osu.Game.Graphics.Sprites { public class OsuLinkSpriteText : OsuSpriteText { - private readonly OsuClickableContainer content; - - public override bool HandleInput => content.Action != null; - - protected override Container Content => content ?? (Container)this; - protected override IEnumerable FlowingChildren => Children; protected override bool OnClick(InputState state) { OnLinkClicked(); - return true; + return base.OnClick(state); } private string url; @@ -42,14 +36,6 @@ namespace osu.Game.Graphics.Sprites } } - public OsuLinkSpriteText() - { - AddInternal(content = new OsuClickableContainer - { - AutoSizeAxes = Axes.Both, - }); - } - public ColourInfo TextColour { get { return Content.Colour; } diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 3954330d33..7bdd09e2e0 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -17,6 +17,7 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; using osu.Framework.Graphics.Cursor; +using osu.Framework.Input; namespace osu.Game.Overlays.Profile { @@ -490,8 +491,20 @@ namespace osu.Game.Overlays.Profile { public string TooltipText => "View Profile in Browser"; + private readonly OsuHoverContainer content; + + protected override Container Content => content ?? (Container)this; + + public override bool HandleInput => true; + public ProfileLink(User user) { + AddInternal(content = new OsuHoverContainer + { + Action = OnLinkClicked, + AutoSizeAxes = Axes.Both, + }); + Text = user.Username; Url = $@"https://osu.ppy.sh/users/{user.Id}"; Font = @"Exo2.0-RegularItalic"; From 63698895a51302da1fa3e0509c5688d77c3352eb Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 11:40:04 +0100 Subject: [PATCH 064/628] Removed unnecessary container and fixed "HandleInput" for ChatLinks --- osu.Game/Online/Chat/ChatLink.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 08a3184034..90d2e46f62 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -23,6 +23,10 @@ namespace osu.Game.Online.Chat { public class ChatLink : OsuLinkSpriteText, IHasTooltip { + /// + /// Identifier unique to every link in a message. + /// A value of -1 means that this instance does not contain a link. + /// public int LinkId = -1; private APIAccess api; @@ -32,7 +36,6 @@ namespace osu.Game.Online.Chat private Color4 hoverColour; private Color4 urlColour; - private readonly Container content; private readonly HoverClickSounds hoverClickSounds; /// @@ -40,7 +43,7 @@ namespace osu.Game.Online.Chat /// protected IEnumerable SameLinkSprites { get; private set; } - protected override Container Content => content ?? base.Content; + public override bool HandleInput => LinkId != -1; protected override bool OnClick(InputState state) { @@ -176,11 +179,6 @@ namespace osu.Game.Online.Chat { hoverClickSounds = new HoverClickSounds(); - AddInternal(content = new Container - { - AutoSizeAxes = Axes.Both, - }); - OnLoadComplete = d => { // All sprites in the same chatline that represent the same URL From 8a02507d441adcc814921295c61e7e7b37242ff0 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 12:40:37 +0100 Subject: [PATCH 065/628] Let regex handle "getIdFromUrl" --- osu.Game/Online/Chat/ChatLink.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 90d2e46f62..acea78586b 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -18,6 +18,7 @@ using osu.Game.Overlays; using System; using System.Collections.Generic; using System.Linq; +using System.Text.RegularExpressions; namespace osu.Game.Online.Chat { @@ -133,23 +134,7 @@ namespace osu.Game.Online.Chat base.OnLinkClicked(); } - private int getIdFromUrl(string url) - { - var lastSlashIndex = url.LastIndexOf('/'); - // Remove possible trailing slash - if (lastSlashIndex == url.Length) - { - url = url.Remove(url.Length - 1); - lastSlashIndex = url.LastIndexOf('/'); - } - - var lastQuestionMarkIndex = url.LastIndexOf('?'); - // Filter out possible queries like mode specifications (e.g. /b/252238?m=0) - if (lastQuestionMarkIndex > lastSlashIndex) - url = url.Remove(lastQuestionMarkIndex); - - return int.Parse(url.Substring(lastSlashIndex + 1)); - } + private int getIdFromUrl(string url) => int.Parse(Regex.Match(url, @"\/(\d+)\/?").Groups[1].Value); public string TooltipText { From bfa9beb7b2d5bea4e2439ca4cb015d6a2cdab5c0 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 13:43:47 +0100 Subject: [PATCH 066/628] Switched to regex to handle most of the decision on what to do on click. Also updated the getIdFromUrl method to adapt to the changes --- osu.Game/Online/Chat/ChatLink.cs | 155 +++++++++++++++++-------------- 1 file changed, 87 insertions(+), 68 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index acea78586b..d251580812 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -54,87 +54,106 @@ namespace osu.Game.Online.Chat protected override void OnLinkClicked() { - var url = Url; - - if (url.StartsWith("osu://")) + var urlMatch = Regex.Matches(Url, @"^(?osu(?:mp)?|https?):\/\/(?.*)")[0]; + if (urlMatch.Success) { - url = url.Substring(6); - var args = url.Split('/'); + var args = urlMatch.Groups["content"].Value.Split('/'); - switch (args[0]) + switch (urlMatch.Groups["protocol"].Value) { - case "chan": - var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); - - if (foundChannel == null) - throw new ArgumentException($"Unknown channel name ({args[1]})."); - else - chat.OpenChannel(foundChannel); - - break; - case "edit": - chat.Game?.LoadEditorTimestamp(); - break; - case "b": - if (args.Length > 1 && int.TryParse(args[1], out int mapId)) - beatmapSetOverlay.ShowBeatmap(mapId); - - break; - case "s": - case "dl": - if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) - beatmapSetOverlay.ShowBeatmapSet(mapSetId); - - break; - case "spectate": - GetUserRequest req; - if (int.TryParse(args[1], out int userId)) - req = new GetUserRequest(userId); - else - return; - - req.Success += user => + case "osu": + if (args.Length == 1) { - chat.Game?.LoadSpectatorScreen(); - }; - api.Queue(req); + base.OnLinkClicked(); + break; + } + switch (args[0]) + { + case "chan": + var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); + + if (foundChannel == null) + throw new ArgumentException($"Unknown channel name ({args[1]})."); + else + chat.OpenChannel(foundChannel); + + break; + case "edit": + chat.Game?.LoadEditorTimestamp(); + break; + case "b": + if (args.Length > 1 && int.TryParse(args[1], out int mapId)) + beatmapSetOverlay.ShowBeatmap(mapId); + + break; + case "s": + case "dl": + if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) + beatmapSetOverlay.ShowBeatmapSet(mapSetId); + + break; + case "spectate": + GetUserRequest req; + if (int.TryParse(args[1], out int userId)) + req = new GetUserRequest(userId); + else + return; + + req.Success += user => + { + chat.Game?.LoadSpectatorScreen(); + }; + api.Queue(req); + + break; + default: + throw new ArgumentException($"Unknown osu:// link at {nameof(ChatLink)} ({urlMatch.Groups["content"].Value})."); + } + + break; + case "osump": + if (args.Length > 1 && int.TryParse(args[1], out int multiId)) + chat.Game?.LoadMultiplayerLobby(multiId); + + break; + case "http": + case "https": + if (args[0] == "osu.ppy.sh" && args.Length > 2) + { + switch (args[1]) + { + case "b": + case "beatmaps": + beatmapSetOverlay.ShowBeatmap(getId(args[2])); + break; + case "s": + case "beatmapsets": + case "d": + beatmapSetOverlay.ShowBeatmapSet(getId(args[2])); + break; + default: + base.OnLinkClicked(); + break; + } + } + else + base.OnLinkClicked(); break; default: - throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]})."); + base.OnLinkClicked(); + break; } } - else if (url.StartsWith("osump://")) - { - url = url.Substring(8); - if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) - return; - - chat.Game?.LoadMultiplayerLobby(multiId); - } - else if (url.StartsWith("http://") || url.StartsWith("https://") && url.IndexOf("osu.ppy.sh/", StringComparison.InvariantCultureIgnoreCase) != -1) - { - var osuUrlIndex = url.IndexOf("osu.ppy.sh/", StringComparison.InvariantCultureIgnoreCase); - - url = url.Substring(osuUrlIndex + 11); - if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/")) - { - var id = getIdFromUrl(url); - beatmapSetOverlay.ShowBeatmapSet(id); - } - else if (url.StartsWith("b/") || url.StartsWith("beatmaps/")) - { - var id = getIdFromUrl(url); - beatmapSetOverlay.ShowBeatmap(id); - } - else - base.OnLinkClicked(); - } else base.OnLinkClicked(); } - private int getIdFromUrl(string url) => int.Parse(Regex.Match(url, @"\/(\d+)\/?").Groups[1].Value); + private int getId(string input) + { + var index = input.IndexOf('#'); + return int.Parse(index > 0 ? input.Remove(index) : input); + } public string TooltipText { From d0b7c92b463c1e536caa232732c4f5a000c5a88b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 11 Dec 2017 13:46:23 +0100 Subject: [PATCH 067/628] Removed unnecessary usings. --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 2 -- osu.Game/Online/Chat/ChatLink.cs | 2 -- osu.Game/Overlays/Profile/ProfileHeader.cs | 1 - 3 files changed, 5 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index cc40ac2214..15c607b593 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -3,9 +3,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Containers; using osu.Framework.Input; -using osu.Game.Graphics.Containers; using System.Collections.Generic; using System.Diagnostics; diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index d251580812..917de7bd70 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -4,12 +4,10 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 7bdd09e2e0..26352b756d 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -17,7 +17,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; using osu.Framework.Graphics.Cursor; -using osu.Framework.Input; namespace osu.Game.Overlays.Profile { From 4f8bec8dfc30603841aa026a4127ccb1b0a18aea Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 19 Dec 2017 19:35:42 +0100 Subject: [PATCH 068/628] Removed makeshift fix that has already been addressed elsewhere. --- osu.Game/Overlays/BeatmapSet/PreviewButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs index ef248c02d3..52edd1714f 100644 --- a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs @@ -80,7 +80,7 @@ namespace osu.Game.Overlays.BeatmapSet { base.Update(); - if (Playing.Value && preview != null && preview.Length > 0) + if (Playing.Value && preview != null) { progress.Width = (float)(preview.CurrentTime / preview.Length); } From 270d81f8169c5a84347cd93c10d96858ecc1a56f Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 19 Dec 2017 19:37:43 +0100 Subject: [PATCH 069/628] Made the Link's OnClick() Method return true --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 15c607b593..e76b1781c4 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -16,7 +16,7 @@ namespace osu.Game.Graphics.Sprites protected override bool OnClick(InputState state) { OnLinkClicked(); - return base.OnClick(state); + return true; } private string url; From fc0b97065cd4d8e8e13460d55e67805ecec7e69e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 20 Dec 2017 15:54:13 +0900 Subject: [PATCH 070/628] Move hover sound/container to base implementation --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 11 +++++++++++ osu.Game/Overlays/Profile/ProfileHeader.cs | 6 ------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index e76b1781c4..897df39d0c 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -6,6 +6,8 @@ using osu.Framework.Graphics.Colour; using osu.Framework.Input; using System.Collections.Generic; using System.Diagnostics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Containers; namespace osu.Game.Graphics.Sprites { @@ -13,6 +15,15 @@ namespace osu.Game.Graphics.Sprites { protected override IEnumerable FlowingChildren => Children; + protected override Container Content => content; + + private readonly Container content; + + public OsuLinkSpriteText() + { + AddInternal(content = new OsuHoverContainer { AutoSizeAxes = Axes.Both }); + } + protected override bool OnClick(InputState state) { OnLinkClicked(); diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index dcf7d844a2..aa3e6ea90c 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -490,16 +490,10 @@ namespace osu.Game.Overlays.Profile { public string TooltipText => "View Profile in Browser"; - private readonly OsuHoverContainer content; - - protected override Container Content => content; - public override bool HandleInput => true; public ProfileLink(User user) { - AddInternal(content = new OsuHoverContainer { AutoSizeAxes = Axes.Both }); - Text = user.Username; Url = $@"https://osu.ppy.sh/users/{user.Id}"; Font = @"Exo2.0-RegularItalic"; From f00676e6ee8121a6344bd04f3b4814711319429b Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 24 Dec 2017 20:25:23 +0100 Subject: [PATCH 071/628] initial commit to allow filtering / selecting different tabs / etc still wip tho bleh bleh --- osu.Game/Overlays/Social/FilterControl.cs | 2 +- osu.Game/Overlays/Social/Header.cs | 4 +- osu.Game/Overlays/SocialOverlay.cs | 167 +++++++++++++++------- 3 files changed, 119 insertions(+), 54 deletions(-) diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index cf4097643e..03acd9bf13 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Social public enum SocialSortCriteria { Rank, - //Location, + Location, //[Description("Time Zone")] //TimeZone, //[Description("World Map")] diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index 2674854327..e15b16085b 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -55,8 +55,8 @@ namespace osu.Game.Overlays.Social { [Description("Online Players")] OnlinePlayers, - //[Description("Online Friends")] - //OnlineFriends, + [Description("Online Friends")] + OnlineFriends, //[Description("Online Team Members")] //OnlineTeamMembers, //[Description("Chat Channels")] diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 954a838461..84469c5e40 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -9,19 +9,23 @@ using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; -using osu.Game.Graphics.Cursor; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays.SearchableList; using osu.Game.Overlays.Social; using osu.Game.Users; +using osu.Framework.Configuration; +using osu.Framework.Threading; +using System.Threading.Tasks; namespace osu.Game.Overlays { - public class SocialOverlay : SearchableListOverlay, IOnlineComponent + public class SocialOverlay : SearchableListOverlay { - private readonly FillFlowContainer panelFlow; + private APIAccess api; + + private FillFlowContainer panels; protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b"); protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"672b51"); @@ -30,28 +34,19 @@ namespace osu.Game.Overlays protected override SearchableListHeader CreateHeader() => new Header(); protected override SearchableListFilterControl CreateFilterControl() => new FilterControl(); - private IEnumerable users; private readonly LoadingAnimation loading; + private IEnumerable users; + public IEnumerable Users { get { return users; } set { - if (users?.Equals(value) ?? false) return; - users = value; + if (users?.Equals(value) ?? false) + return; - if (users == null) - panelFlow.Clear(); - else - { - panelFlow.ChildrenEnumerable = users.Select(u => - { - var p = new UserPanel(u) { Width = 300 }; - p.Status.BindTo(u.Status); - return p; - }); - } + users = value?.ToList(); } } @@ -62,59 +57,129 @@ namespace osu.Game.Overlays ThirdWaveColour = OsuColour.FromHex(@"9b2b6e"); FourthWaveColour = OsuColour.FromHex(@"6d214d"); - ScrollFlow.Children = new[] + Add(loading = new LoadingAnimation()); + + Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels; + + // TODO sort our list in some way (either locally or with API call) + //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += rankStatus => Scheduler.AddOnce(updateSearch); + + Header.Tabs.Current.ValueChanged += tab => { - new OsuContextMenuContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Child = panelFlow = new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Margin = new MarginPadding { Top = 20 }, - Spacing = new Vector2(10f), - } - }, + currentQuery.Value = string.Empty; + Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; + Scheduler.AddOnce(updateSearch); }; - Add(loading = new LoadingAnimation()); + currentQuery.ValueChanged += v => + { + queryChangedDebounce?.Cancel(); + + if (string.IsNullOrEmpty(v)) + Scheduler.AddOnce(updateSearch); + else + { + Users = null; + queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); + } + }; + + currentQuery.BindTo(Filter.Search.Current); + + Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); + + Scheduler.AddOnce(updateSearch); // so it displays something once it's first opened } [BackgroundDependencyLoader] private void load(APIAccess api) { - if (Users == null) - reloadUsers(api); + this.api = api; } - private void reloadUsers(APIAccess api) + private void recreatePanels(PanelDisplayStyle displayStyle) { - Users = null; + if (Users == null) + return; - // no this is not the correct data source, but it's something. - var request = new GetUsersRequest(); - request.Success += res => + if (panels != null) { - Users = res.Select(e => e.User); - loading.Hide(); + panels.FadeOut(200); + panels.Expire(); + panels = null; + } + + var newPanels = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Spacing = new Vector2(10f), + Margin = new MarginPadding { Top = 10 }, + ChildrenEnumerable = Users.Select(u => + { + UserPanel panel = new UserPanel(u); + switch (displayStyle) + { + case PanelDisplayStyle.Grid: + panel.Width = 300; + break; + default: + panel.RelativeSizeAxes = Axes.X; + break; + } + panel.Status.BindTo(u.Status); + return panel; + }) }; - api.Queue(request); - loading.Show(); + LoadComponentAsync(newPanels, p => + { + if (panels != null) + ScrollFlow.Remove(panels); + + ScrollFlow.Add(panels = newPanels); + }); } - public void APIStateChanged(APIAccess api, APIState state) + private GetUsersRequest getUsersRequest; + + private readonly Bindable currentQuery = new Bindable(); + + private ScheduledDelegate queryChangedDebounce; + + private void updateSearch() { - switch (state) + queryChangedDebounce?.Cancel(); + + if (!IsLoaded) + return; + + Users = null; + loading.Hide(); + getUsersRequest?.Cancel(); + + if (api == null || api.State == APIState.Offline) + return; + + getUsersRequest = new GetUsersRequest(); // TODO filter/sort values?!? + + getUsersRequest.Success += response => { - case APIState.Online: - reloadUsers(api); - break; - default: - Users = null; - break; - } + Task.Run(() => + { + var newUsers = response.Select(r => r.User); + + Schedule(() => + { + Users = newUsers; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + loading.Hide(); + }); + }); + }; + + loading.Show(); + api.Queue(getUsersRequest); } } From e2a1b18a2c32108f386422366c737377021d4978 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 25 Dec 2017 14:17:35 +0100 Subject: [PATCH 072/628] fix selecting different tab causing filter to change by itself and minor cleanup --- osu.Game/Overlays/SocialOverlay.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 84469c5e40..39b644e469 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -64,12 +64,7 @@ namespace osu.Game.Overlays // TODO sort our list in some way (either locally or with API call) //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += rankStatus => Scheduler.AddOnce(updateSearch); - Header.Tabs.Current.ValueChanged += tab => - { - currentQuery.Value = string.Empty; - Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; - Scheduler.AddOnce(updateSearch); - }; + Header.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); currentQuery.ValueChanged += v => { @@ -86,7 +81,7 @@ namespace osu.Game.Overlays currentQuery.BindTo(Filter.Search.Current); - Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); + Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); Scheduler.AddOnce(updateSearch); // so it displays something once it's first opened } @@ -99,9 +94,6 @@ namespace osu.Game.Overlays private void recreatePanels(PanelDisplayStyle displayStyle) { - if (Users == null) - return; - if (panels != null) { panels.FadeOut(200); @@ -109,6 +101,9 @@ namespace osu.Game.Overlays panels = null; } + if (Users == null) + return; + var newPanels = new FillFlowContainer { RelativeSizeAxes = Axes.X, From 0fe78bee6ec1e81c17764982ab90e5a530196395 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 25 Dec 2017 16:11:50 +0100 Subject: [PATCH 073/628] center user panels --- osu.Game/Overlays/SocialOverlay.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 39b644e469..051cf5d6d2 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -112,7 +112,11 @@ namespace osu.Game.Overlays Margin = new MarginPadding { Top = 10 }, ChildrenEnumerable = Users.Select(u => { - UserPanel panel = new UserPanel(u); + UserPanel panel = new UserPanel(u) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre + }; switch (displayStyle) { case PanelDisplayStyle.Grid: From 025d3941a284041be125c522ae4430199e9fc693 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 25 Dec 2017 19:43:35 +0100 Subject: [PATCH 074/628] Fixed problems introduced by the merge --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 2 +- osu.Game/OsuGame.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 6a36411407..b8e400aa60 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -13,7 +13,7 @@ using System.Linq; namespace osu.Game.Tests.Visual { - internal class TestCaseChatLink : OsuTestCase + public class TestCaseChatLink : OsuTestCase { private readonly BeatmapSetOverlay beatmapSetOverlay; private readonly ChatOverlay chat; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 3dcff9f66f..66d2347f47 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -118,7 +118,7 @@ namespace osu.Game // TODO: Implement this properly as soon as the Editor is done internal void LoadEditorTimestamp() { - notificationOverlay.Post(new SimpleNotification + notifications.Post(new SimpleNotification { Text = @"Sorry, but this is not fully implemented yet!", Icon = FontAwesome.fa_life_saver, @@ -127,7 +127,7 @@ namespace osu.Game internal void LoadSpectatorScreen() { - notificationOverlay.Post(new SimpleNotification + notifications.Post(new SimpleNotification { Text = @"Sorry, but spectating is not implemented yet!", Icon = FontAwesome.fa_life_saver, @@ -136,7 +136,7 @@ namespace osu.Game internal void LoadMultiplayerLobby(int lobbyId) { - notificationOverlay.Post(new SimpleNotification + notifications.Post(new SimpleNotification { Text = @"Sorry, but the multiplayer lobby is not implemented yet!", Icon = FontAwesome.fa_life_saver, From 962e4d7c8afeb9c0d66086466049848324db313e Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 25 Dec 2017 20:46:04 +0100 Subject: [PATCH 075/628] Removed LinkId and word wrapping (for now). Also reimplemented the OsuHoverContainer properly --- .../Graphics/Containers/OsuHoverContainer.cs | 4 +- .../Containers/OsuLinkTextFlowContainer.cs | 3 + .../Graphics/Sprites/OsuLinkSpriteText.cs | 21 ++--- osu.Game/Online/Chat/ChatLink.cs | 88 ++----------------- osu.Game/Overlays/Chat/ChatLine.cs | 7 +- 5 files changed, 26 insertions(+), 97 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index 3f82ad2179..77b6b3773e 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -11,6 +11,7 @@ namespace osu.Game.Graphics.Containers public class OsuHoverContainer : OsuClickableContainer { private Color4 hoverColour; + private Color4 unhoverColour; protected override bool OnHover(InputState state) { @@ -20,7 +21,7 @@ namespace osu.Game.Graphics.Containers protected override void OnHoverLost(InputState state) { - this.FadeColour(Color4.White, 500, Easing.OutQuint); + this.FadeColour(unhoverColour, 500, Easing.OutQuint); base.OnHoverLost(state); } @@ -28,6 +29,7 @@ namespace osu.Game.Graphics.Containers private void load(OsuColour colours) { hoverColour = colours.Yellow; + unhoverColour = Colour; } } } diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs index 382d2d73f4..bc23d128f2 100644 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs @@ -36,6 +36,9 @@ namespace osu.Game.Graphics.Containers public void AddLink(string text, string url, Action creationParameters = null) { + // TODO: Remove this and get word wrapping working + text = text.Replace(' ', '_'); + AddText(text, link => { creationParameters?.Invoke(link); diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 897df39d0c..dc49ff4daf 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -21,23 +21,18 @@ namespace osu.Game.Graphics.Sprites public OsuLinkSpriteText() { - AddInternal(content = new OsuHoverContainer { AutoSizeAxes = Axes.Both }); - } - - protected override bool OnClick(InputState state) - { - OnLinkClicked(); - return true; + AddInternal(content = new OsuHoverContainer + { + AutoSizeAxes = Axes.Both, + Action = OnLinkClicked, + }); } private string url; public string Url { - get - { - return url; - } + get => url; set { if (!string.IsNullOrEmpty(value)) @@ -47,8 +42,8 @@ namespace osu.Game.Graphics.Sprites public ColourInfo TextColour { - get { return Content.Colour; } - set { Content.Colour = value; } + get => Content.Colour; + set => Content.Colour = value; } protected virtual void OnLinkClicked() => Process.Start(Url); diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 917de7bd70..43a9792e52 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; @@ -22,33 +23,11 @@ namespace osu.Game.Online.Chat { public class ChatLink : OsuLinkSpriteText, IHasTooltip { - /// - /// Identifier unique to every link in a message. - /// A value of -1 means that this instance does not contain a link. - /// - public int LinkId = -1; - private APIAccess api; private BeatmapSetOverlay beatmapSetOverlay; private ChatOverlay chat; - private Color4 hoverColour; - private Color4 urlColour; - - private readonly HoverClickSounds hoverClickSounds; - - /// - /// Every other sprite in the containing ChatLine that represents the same link. - /// - protected IEnumerable SameLinkSprites { get; private set; } - - public override bool HandleInput => LinkId != -1; - - protected override bool OnClick(InputState state) - { - hoverClickSounds.TriggerOnClick(state); - return base.OnClick(state); - } + public override bool HandleInput => !string.IsNullOrEmpty(Url); protected override void OnLinkClicked() { @@ -145,19 +124,19 @@ namespace osu.Game.Online.Chat } else base.OnLinkClicked(); - } - private int getId(string input) - { - var index = input.IndexOf('#'); - return int.Parse(index > 0 ? input.Remove(index) : input); + int getId(string input) + { + var index = input.IndexOf('#'); + return int.Parse(index > 0 ? input.Remove(index) : input); + } } public string TooltipText { get { - if (LinkId == -1 || Url == Text) + if (Url == Text) return null; if (Url.StartsWith("osu://")) @@ -177,63 +156,12 @@ namespace osu.Game.Online.Chat } } - public ChatLink() - { - hoverClickSounds = new HoverClickSounds(); - - OnLoadComplete = d => - { - // All sprites in the same chatline that represent the same URL - SameLinkSprites = ((Container)d.Parent).Children.Where(child => (child as ChatLink)?.LinkId == LinkId && !d.Equals(child)).Cast(); - }; - } - - protected override bool OnHover(InputState state) - { - if (!SameLinkSprites.Any(sprite => sprite.IsHovered)) - { - hoverClickSounds.TriggerOnHover(state); - - foreach (ChatLink sprite in SameLinkSprites) - sprite.TriggerOnHover(state); - } - - Content.FadeColour(hoverColour, 500, Easing.OutQuint); - - return true; - } - - protected override void OnHoverLost(InputState state) - { - if (SameLinkSprites.Any(sprite => sprite.IsHovered)) - { - // We have to do this so this sprite does not fade its colour back - Content.FadeColour(hoverColour, 500, Easing.OutQuint); - return; - } - - Content.FadeColour(urlColour, 500, Easing.OutQuint); - - foreach (ChatLink sprite in SameLinkSprites) - sprite.Content.FadeColour(urlColour, 500, Easing.OutQuint); - - base.OnHoverLost(state); - } - [BackgroundDependencyLoader] private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuColour colours) { - // Should be ok, inexpensive operation - LoadComponentAsync(hoverClickSounds); - this.api = api; this.beatmapSetOverlay = beatmapSetOverlay; this.chat = chat; - - hoverColour = colours.Yellow; - urlColour = colours.Blue; - if (LinkId != -1) - Content.Colour = urlColour; } } } diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 5fbfed5a67..b86b138012 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -104,6 +104,7 @@ namespace osu.Game.Overlays.Chat private void load(OsuColour colours, ChatOverlay chat) { this.chat = chat; + urlColour = colours.Blue; customUsernameColour = colours.ChatBlue; } @@ -204,6 +205,7 @@ namespace osu.Game.Overlays.Chat } private ChatOverlay chat; + private Color4 urlColour; private void updateMessageContent() { @@ -244,11 +246,10 @@ namespace osu.Game.Overlays.Chat contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => { + ((OsuLinkSpriteText)sprite).TextColour = urlColour; + if (message.IsAction) sprite.Font = @"Exo2.0-MediumItalic"; - - // We want to use something that is unique to every formatted link PER MESSAGE - ((ChatLink)sprite).LinkId = link.Index; }); } From 7c49becc83709d3676c088eb148073d5539a8882 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 25 Dec 2017 20:56:20 +0100 Subject: [PATCH 076/628] CI adjustments --- osu.Game/Online/Chat/ChatLink.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index 43a9792e52..ccf146286b 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -1,22 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Graphics; using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; -using osu.Framework.Input; -using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Overlays; using System; -using System.Collections.Generic; -using System.Linq; using System.Text.RegularExpressions; namespace osu.Game.Online.Chat @@ -157,7 +148,7 @@ namespace osu.Game.Online.Chat } [BackgroundDependencyLoader] - private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuColour colours) + private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) { this.api = api; this.beatmapSetOverlay = beatmapSetOverlay; From cbfef7052e2615390c0750d175e58c0b5ab8ed69 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 25 Dec 2017 21:02:48 +0100 Subject: [PATCH 077/628] further CI adjustments --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index dc49ff4daf..ccf7c80d07 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; -using osu.Framework.Input; using System.Collections.Generic; using System.Diagnostics; using osu.Framework.Graphics.Containers; From 044e4d0acddffaffc1055f9042eaacea365e4b0b Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Mon, 25 Dec 2017 19:11:49 -0600 Subject: [PATCH 078/628] Add blur to background in Player --- osu.Game/Configuration/OsuConfigManager.cs | 2 ++ .../Sections/Gameplay/GeneralSettings.cs | 6 ++++++ osu.Game/Screens/Play/Player.cs | 20 ++++++++++++------- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index f4c7bdb586..d359a0a2d6 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -65,6 +65,7 @@ namespace osu.Game.Configuration // Gameplay Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01); + Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01); Set(OsuSetting.ShowInterface, true); Set(OsuSetting.KeyOverlay, false); @@ -90,6 +91,7 @@ namespace osu.Game.Configuration GameplayCursorSize, AutoCursorSize, DimLevel, + BlurLevel, ShowStoryboard, KeyOverlay, FloatingComments, diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 8ec6af5cd0..95d127a55f 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -22,6 +22,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay Bindable = config.GetBindable(OsuSetting.DimLevel), KeyboardStep = 0.1f }, + new SettingsSlider + { + LabelText = "Background blur", + Bindable = config.GetBindable(OsuSetting.BlurLevel), + KeyboardStep = 0.1f + }, new SettingsCheckbox { LabelText = "Show score overlay", diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 340fc39d52..8430acbc73 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -65,6 +65,7 @@ namespace osu.Game.Screens.Play #region User Settings private Bindable dimLevel; + private Bindable blurLevel; private Bindable showStoryboard; private Bindable mouseWheelDisabled; private Bindable userAudioOffset; @@ -74,7 +75,7 @@ namespace osu.Game.Screens.Play #endregion private BreakOverlay breakOverlay; - private Container storyboardContainer; + private BufferedContainer storyboardContainer; private DrawableStoryboard storyboard; private HUDOverlay hudOverlay; @@ -88,6 +89,7 @@ namespace osu.Game.Screens.Play this.api = api; dimLevel = config.GetBindable(OsuSetting.DimLevel); + blurLevel = config.GetBindable(OsuSetting.BlurLevel); showStoryboard = config.GetBindable(OsuSetting.ShowStoryboard); mouseWheelDisabled = config.GetBindable(OsuSetting.MouseDisableWheel); @@ -147,7 +149,7 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { - storyboardContainer = new Container + storyboardContainer = new BufferedContainer { RelativeSizeAxes = Axes.Both, Clock = offsetClock, @@ -309,9 +311,9 @@ namespace osu.Game.Screens.Play if (!loadedSuccessfully) return; - (Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1000, Easing.OutQuint); + dimLevel.ValueChanged += backgroundLevel_ValueChanged; + blurLevel.ValueChanged += backgroundLevel_ValueChanged; - dimLevel.ValueChanged += dimLevel_ValueChanged; showStoryboard.ValueChanged += showStoryboard_ValueChanged; updateBackgroundElements(); @@ -368,7 +370,7 @@ namespace osu.Game.Screens.Play return true; } - private void dimLevel_ValueChanged(double newValue) + private void backgroundLevel_ValueChanged(double newValue) => updateBackgroundElements(); private void showStoryboard_ValueChanged(bool newValue) @@ -377,6 +379,7 @@ namespace osu.Game.Screens.Play private void updateBackgroundElements() { var opacity = 1 - (float)dimLevel; + var blur = new Vector2((float)blurLevel.Value * 25); if (showStoryboard && storyboard == null) initializeStoryboard(true); @@ -385,14 +388,17 @@ namespace osu.Game.Screens.Play var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable; storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800); - storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0); + storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, 800, Easing.OutQuint); + storyboardContainer.BlurTo(blur, 800, Easing.OutQuint); Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, 800, Easing.OutQuint); + (Background as BackgroundScreenBeatmap)?.BlurTo(blur, 800, Easing.OutQuint); } private void fadeOut() { - dimLevel.ValueChanged -= dimLevel_ValueChanged; + dimLevel.ValueChanged -= backgroundLevel_ValueChanged; + blurLevel.ValueChanged -= backgroundLevel_ValueChanged; showStoryboard.ValueChanged -= showStoryboard_ValueChanged; const float fade_out_duration = 250; From bc90793b1c59da7ca83bb9a5ca4b6ae1fcd62c72 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Mon, 25 Dec 2017 19:18:57 -0600 Subject: [PATCH 079/628] Trim whitespace --- osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 95d127a55f..0808c18b6f 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay LabelText = "Background blur", Bindable = config.GetBindable(OsuSetting.BlurLevel), KeyboardStep = 0.1f - }, + }, new SettingsCheckbox { LabelText = "Show score overlay", From c4f5754f947bbe13fd639fa547c3a58bf403ac9b Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 27 Dec 2017 02:14:45 +0100 Subject: [PATCH 080/628] Fixed only the links being italics for /me messages --- osu.Game/Overlays/Chat/ChatLine.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index b86b138012..435399b670 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -189,7 +189,12 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new OsuLinkTextFlowContainer(t => { t.TextSize = text_size; }) + contentFlow = new OsuLinkTextFlowContainer(t => + { + if (Message.IsAction) + t.Font = "Exo2.0-MediumItalic"; + t.TextSize = text_size; + }) { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, @@ -218,13 +223,7 @@ namespace osu.Game.Overlays.Chat contentFlow.Clear(); if (message.Links == null || message.Links.Count == 0) - { - contentFlow.AddText(message.Content, sprite => - { - if (message.IsAction) - sprite.Font = @"Exo2.0-MediumItalic"; - }); - } + contentFlow.AddText(message.Content); else { int prevIndex = 0; @@ -247,9 +246,6 @@ namespace osu.Game.Overlays.Chat contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => { ((OsuLinkSpriteText)sprite).TextColour = urlColour; - - if (message.IsAction) - sprite.Font = @"Exo2.0-MediumItalic"; }); } From d21ef14f750e9f0145412299752a6cff0aa39b9c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 27 Dec 2017 17:14:08 +0100 Subject: [PATCH 081/628] Better style; removed initial sprites --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 37 ++++++++++++----------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index b8e400aa60..ca102963cb 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -21,7 +21,6 @@ namespace osu.Game.Tests.Visual private DependencyContainer dependencies; private readonly TestChatLineContainer textContainer; - private readonly ChatLine[] testSprites; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); @@ -38,21 +37,25 @@ namespace osu.Game.Tests.Visual Direction = FillDirection.Vertical, }); - testSprites = new[] - { - new ChatLine(new DummyMessage("Test!")), - new ChatLine(new DummyMessage("osu.ppy.sh!")), - new ChatLine(new DummyMessage("http://lookatmy.horse/")), - new ChatLine(new DummyMessage("https://osu.ppy.sh!")), - new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")), - new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")), - new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")), - new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")), - new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), - new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), - new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true)), - new ChatLine(new DummyMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present).")), - }; + testAddLinks(); + } + + private void testAddLinks() + { + int msgCounter = 0; + void addMessage(string text, bool isAction = false) => AddStep($"Add message #{++msgCounter}", () => textContainer.Add(new ChatLine(new DummyMessage(text, isAction)))); + + addMessage("Test!"); + addMessage("osu.ppy.sh!"); + addMessage("https://osu.ppy.sh!"); + addMessage("00:12:345 (1,2) - Test?"); + addMessage("Wiki link for tasty [[Performance Points]]"); + addMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)"); + addMessage("[https://osu.ppy.sh/home New site] (new link format)"); + addMessage("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]"); + addMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true); + addMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true); + addMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); } [BackgroundDependencyLoader] @@ -60,8 +63,6 @@ namespace osu.Game.Tests.Visual { dependencies.Cache(chat); dependencies.Cache(beatmapSetOverlay); - - textContainer.AddRange(testSprites); } private class DummyMessage : Message From 4681a0c47b3118a202fec27afeb4cf576607d123 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 27 Dec 2017 21:06:48 +0100 Subject: [PATCH 082/628] handle chat == null gracefully and remove link from message if channel not found --- osu.Game/Overlays/Chat/ChatLine.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 435399b670..455fbaace7 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -15,6 +15,7 @@ using osu.Game.Users; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; +using System.Collections.Generic; namespace osu.Game.Overlays.Chat { @@ -227,6 +228,8 @@ namespace osu.Game.Overlays.Chat else { int prevIndex = 0; + List linksToRemove = new List(); + foreach (var link in message.Links) { contentFlow.AddText(message.Content.Substring(prevIndex, link.Index - prevIndex)); @@ -236,8 +239,9 @@ namespace osu.Game.Overlays.Chat if (link.Url.StartsWith("osu://chan/")) { var channelName = link.Url.Substring(11).Split('/')[0]; - if (chat.AvailableChannels.TrueForAll(c => c.Name != channelName)) + if (chat?.AvailableChannels.TrueForAll(c => c.Name != channelName) != false) { + linksToRemove.Add(link); contentFlow.AddText(message.Content.Substring(link.Index, link.Length)); continue; } @@ -245,10 +249,13 @@ namespace osu.Game.Overlays.Chat contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => { - ((OsuLinkSpriteText)sprite).TextColour = urlColour; + ((ChatLink)sprite).TextColour = urlColour; }); } + foreach (var link in linksToRemove) + message.Links.Remove(link); + var lastLink = message.Links[message.Links.Count - 1]; contentFlow.AddText(message.Content.Substring(lastLink.Index + lastLink.Length)); } From 54a11e24b7455859963ba4db0726e8c9c26cd921 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 27 Dec 2017 21:13:32 +0100 Subject: [PATCH 083/628] Fixed links being removed too early --- osu.Game/Overlays/Chat/ChatLine.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 455fbaace7..aecfa27a66 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -253,11 +253,11 @@ namespace osu.Game.Overlays.Chat }); } - foreach (var link in linksToRemove) - message.Links.Remove(link); - var lastLink = message.Links[message.Links.Count - 1]; contentFlow.AddText(message.Content.Substring(lastLink.Index + lastLink.Length)); + + foreach (var link in linksToRemove) + message.Links.Remove(link); } } From 128603a99f26d5aea4e91838373fae22a55e09e1 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 28 Dec 2017 01:12:13 +0100 Subject: [PATCH 084/628] Added more and fixed the old automated tests --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 98 ++++++++++++++++++----- osu.Game/Overlays/Chat/ChatLine.cs | 3 + 2 files changed, 83 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index ca102963cb..15a5e12546 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Game.Online.Chat; using osu.Game.Overlays; @@ -37,25 +39,75 @@ namespace osu.Game.Tests.Visual Direction = FillDirection.Vertical, }); - testAddLinks(); + testLinksGeneral(); + testAddingLinks(); + testEcho(); } - private void testAddLinks() - { - int msgCounter = 0; - void addMessage(string text, bool isAction = false) => AddStep($"Add message #{++msgCounter}", () => textContainer.Add(new ChatLine(new DummyMessage(text, isAction)))); + private void clear() => AddStep("clear messages", textContainer.Clear); - addMessage("Test!"); - addMessage("osu.ppy.sh!"); - addMessage("https://osu.ppy.sh!"); - addMessage("00:12:345 (1,2) - Test?"); - addMessage("Wiki link for tasty [[Performance Points]]"); - addMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)"); - addMessage("[https://osu.ppy.sh/home New site] (new link format)"); - addMessage("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]"); - addMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true); - addMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true); - addMessage("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); + private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false) + { + var newLine = new ChatLine(new DummyMessage(text, isAction)); + textContainer.Add(newLine); + + AddAssert($"check msg having {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); + // todo: tidy this lambda up + AddAssert("check link(s) displaying", () => newLine.ContentFlow.Any() + && newLine.ContentFlow + .Cast() + .All(sprite => sprite.HandleInput && !sprite.TextColour.Equals((SRGBColour)Color4.White) + || !sprite.HandleInput && sprite.TextColour.Equals((SRGBColour)Color4.White))); + } + + private void testLinksGeneral() + { + addMessageWithChecks("test!"); + addMessageWithChecks("osu.ppy.sh!"); + addMessageWithChecks("https://osu.ppy.sh!", 1); + addMessageWithChecks("00:12:345 (1,2) - Test?", 1); + addMessageWithChecks("Wiki link for tasty [[Performance Points]]", 1); + addMessageWithChecks("(osu forums)[https://osu.ppy.sh/forum] (old link format)", 1); + addMessageWithChecks("[https://osu.ppy.sh/home New site] (new link format)", 1); + addMessageWithChecks("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", 1); + addMessageWithChecks("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", 1, true); + addMessageWithChecks("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", 1, true); + addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/home multiple links] https://osu.ppy.sh/home", 3); + // note that there's 0 links here (they get removed if a channel is not found) + addMessageWithChecks("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); + } + + private void testAddingLinks() + { + const int count = 5; + + for (int i = 1; i <= count; i++) + AddStep($"add long msg #{i}", () => textContainer.Add(new ChatLine(new DummyMessage("alright let's just put a really long text here to see if it loads in correctly rather than adding the text sprites individually after the chat line appearing!")))); + + clear(); + } + + private void testEcho() + { + int echoCounter = 0; + + addEchoWithWait("sent!", "received!"); + addEchoWithWait("https://osu.ppy.sh/home", null, 500); + addEchoWithWait("[https://osu.ppy.sh/forum let's try multiple words too!]"); + addEchoWithWait("(long loading times! clickable while loading?)[https://osu.ppy.sh/home]", null, 5000); + + void addEchoWithWait(string text, string completeText = null, double delay = 250) + { + var newLine = new ChatLine(new DummyEchoMessage(text)); + + AddStep($"send msg #{++echoCounter} after {delay}ms", () => + { + textContainer.Add(newLine); + Scheduler.AddDelayed(() => newLine.Message = new DummyMessage(completeText ?? text), delay); + }); + + AddUntilStep(() => textContainer.All(line => line.Message is DummyMessage), $"wait for msg #{echoCounter}"); + } } [BackgroundDependencyLoader] @@ -65,10 +117,20 @@ namespace osu.Game.Tests.Visual dependencies.Cache(beatmapSetOverlay); } + private class DummyEchoMessage : LocalEchoMessage + { + public DummyEchoMessage(string text) + { + Content = text; + Timestamp = DateTimeOffset.Now; + Sender = DummyMessage.TEST_SENDER; + } + } + private class DummyMessage : Message { private static long messageCounter; - private static readonly User sender = new User + internal static readonly User TEST_SENDER = new User { Username = @"Somebody", Id = 1, @@ -98,7 +160,7 @@ namespace osu.Game.Tests.Visual { Content = text; IsAction = isAction; - Sender = sender; + Sender = TEST_SENDER; } } diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index aecfa27a66..26759825ee 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -101,6 +101,9 @@ namespace osu.Game.Overlays.Chat } } + // this is only used for testing + public OsuTextFlowContainer ContentFlow => contentFlow; + [BackgroundDependencyLoader(true)] private void load(OsuColour colours, ChatOverlay chat) { From 28da60cc3853491b737014362ab9eebce00e1ab2 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 28 Dec 2017 22:40:23 +0900 Subject: [PATCH 085/628] https://github.com/ppy/osu/issues/716 1. split the playfield columns by ManiaModKeyCoop 2. can chaneg the key number by ManiaKeyMod --- .../Mods/ManiaModGravity.cs | 6 +- .../Tests/TestCaseManiaPlayfield.cs | 6 +- osu.Game.Rulesets.Mania/UI/Column.cs | 4 +- .../UI/ManiaColumnGroup.cs | 213 ++++++++++++++++ osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 230 ++++++------------ .../UI/ManiaRulesetContainer.cs | 30 ++- .../osu.Game.Rulesets.Mania.csproj | 1 + 7 files changed, 325 insertions(+), 165 deletions(-) create mode 100644 osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index 70270af6c9..dc80cea562 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -35,9 +35,9 @@ namespace osu.Game.Rulesets.Mania.Mods } // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (DrawableBarLine barLine in rulesetContainer.BarLines) + foreach (BarLine barLine in rulesetContainer.BarLines) { - var controlPoint = rulesetContainer.CreateControlPointAt(barLine.HitObject.StartTime); + var controlPoint = rulesetContainer.CreateControlPointAt(barLine.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now controlPoint.TimingPoint.BeatLength = 1000; @@ -45,4 +45,4 @@ namespace osu.Game.Rulesets.Mania.Mods } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 1932038411..88727df405 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -83,11 +83,11 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(cols) + inputManager.Add(playfield = new ManiaPlayfield(cols, false) { Anchor = Anchor.Centre, Origin = Anchor.Centre, - SpecialColumnPosition = specialPos + //SpecialColumnPosition = specialPos }); playfield.Inverted.Value = inverted; @@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(4) + inputManager.Add(playfield = new ManiaPlayfield(4,false) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 2d553f8639..6140452bb3 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Hit target + hit objects", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = ManiaPlayfield.HIT_TARGET_POSITION }, + Padding = new MarginPadding { Top = ManiaColumnGroup.HIT_TARGET_POSITION }, Children = new Drawable[] { new Container @@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key", RelativeSizeAxes = Axes.X, - Height = ManiaPlayfield.HIT_TARGET_POSITION, + Height = ManiaColumnGroup.HIT_TARGET_POSITION, Children = new Drawable[] { new Box diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs new file mode 100644 index 0000000000..a37fa913bc --- /dev/null +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs @@ -0,0 +1,213 @@ +using System; +using System.Collections.Generic; +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Game.Graphics; +using osu.Framework.Allocation; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.Timing; + +namespace osu.Game.Rulesets.Mania.UI +{ + /// + /// controls that from up to down + /// + internal class ManiaColumnGroup : ScrollingPlayfield + { + public const float HIT_TARGET_POSITION = 50; + + private SpecialColumnPosition specialColumnPosition; + + /// + /// The style to use for the special column. + /// + public SpecialColumnPosition SpecialColumnPosition + { + get { return specialColumnPosition; } + set + { + if (IsLoaded) + throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield."); + specialColumnPosition = value; + } + } + + private readonly FillFlowContainer columns; + public IEnumerable Columns => columns.Children; + + protected override Container Content => content; + private readonly Container content; + + private readonly Container judgements; + public Container Judgements => judgements; + + private readonly Container topLevelContainer; + public Container TopLevelContainer => topLevelContainer; + + private List normalColumnColours = new List(); + private Color4 specialColumnColour; + + public int ColumnCount { get; protected set; } + + public ManiaColumnGroup(int columnCount) : base(Axes.Y) + { + ColumnCount = columnCount; + Name = "Playfield elements"; + Anchor = Anchor.TopCentre; + Origin = Anchor.TopCentre; + //RelativeSizeAxes = Axes.Y; + //AutoSizeAxes = Axes.X; + InternalChildren = new Drawable[] + { + new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Children = new Drawable[] + { + new Container + { + Name = "Columns mask", + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Masking = true, + Children = new Drawable[] + { + new Box + { + Name = "Background", + RelativeSizeAxes = Axes.Both, + Colour = new Color4(0,0,0,0.8f) + }, + columns = new FillFlowContainer + { + Name = "Columns", + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Direction = FillDirection.Horizontal, + Padding = new MarginPadding { Left = 1, Right = 1 }, + Spacing = new Vector2(1, 0) + }, + } + }, + new Container + { + Name = "Barlines mask", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Width = 1366, // Bar lines should only be masked on the vertical axis + BypassAutoSizeAxes = Axes.Both, + Masking = true, + Child = content = new Container + { + Name = "Bar lines", + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.Y, + Padding = new MarginPadding { Top = HIT_TARGET_POSITION } + } + }, + judgements = new Container + { + Anchor = Anchor.TopCentre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Y = HIT_TARGET_POSITION + 150, + BypassAutoSizeAxes = Axes.Both + }, + topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } + } + } + + }; + } + + /// + /// Whether the column index is a special column for this playfield. + /// + /// The 0-based column index. + /// Whether the column is a special column. + private bool isSpecialColumn(int column) + { + switch (SpecialColumnPosition) + { + default: + case SpecialColumnPosition.Normal: + return ColumnCount % 2 == 1 && column == ColumnCount / 2; + case SpecialColumnPosition.Left: + return column == 0; + case SpecialColumnPosition.Right: + return column == ColumnCount - 1; + } + } + + public void AddColumn(Column c) + { + c.VisibleTimeRange.BindTo(VisibleTimeRange); + topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); + columns.Add(c); + } + + public void AddJudgement(Judgement judgement) + { + judgements.Clear(); + judgements.Add(new DrawableManiaJudgement(judgement) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + normalColumnColours = new List + { + colours.RedDark, + colours.GreenDark + }; + + specialColumnColour = colours.BlueDark; + + // Set the special column + colour + key + foreach (var column in Columns) + { + if (!column.IsSpecial) + continue; + + column.AccentColour = specialColumnColour; + } + + var nonSpecialColumns = Columns.Where(c => !c.IsSpecial).ToList(); + + // We'll set the colours of the non-special columns in a separate loop, because the non-special + // column colours are mirrored across their centre and special styles mess with this + for (int i = 0; i < Math.Ceiling(nonSpecialColumns.Count / 2f); i++) + { + Color4 colour = normalColumnColours[i % normalColumnColours.Count]; + nonSpecialColumns[i].AccentColour = colour; + nonSpecialColumns[nonSpecialColumns.Count - 1 - i].AccentColour = colour; + } + } + + + protected override void Update() + { + // Due to masking differences, it is not possible to get the width of the columns container automatically + // While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually + content.Width = columns.Width; + } + } +} diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 6c164a34f0..ffa74b6ba9 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -17,48 +17,43 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Judgements; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Beatmaps.ControlPoints; +using osu.Framework.MathUtils; +using osu.Framework.Extensions.IEnumerableExtensions; namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : ScrollingPlayfield { - public const float HIT_TARGET_POSITION = 50; - private SpecialColumnPosition specialColumnPosition; /// - /// The style to use for the special column. + /// list mania column group /// - public SpecialColumnPosition SpecialColumnPosition - { - get { return specialColumnPosition; } - set - { - if (IsLoaded) - throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield."); - specialColumnPosition = value; - } - } + FillFlowContainer ListColumnGroup = new FillFlowContainer(); /// /// Whether this playfield should be inverted. This flips everything inside the playfield. /// public readonly Bindable Inverted = new Bindable(true); - private readonly FlowContainer columns; - public IEnumerable Columns => columns.Children; - - protected override Container Content => content; - private readonly Container content; - - private List normalColumnColours = new List(); - private Color4 specialColumnColour; - - private readonly Container judgements; + public List Columns + { + get + { + var list = new List(); + foreach (var single in ListColumnGroup) + { + list.AddRange(single.Columns); + } + return list; + } + } private readonly int columnCount; - public ManiaPlayfield(int columnCount) - : base(Axes.Y) + public ManiaPlayfield(int columnCount,bool coop): base(Axes.Y) { this.columnCount = columnCount; @@ -67,172 +62,103 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.Value = true; - Container topLevelContainer; InternalChildren = new Drawable[] { - new Container + ListColumnGroup=new FillFlowContainer() { - Name = "Playfield elements", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Direction= FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Children = new Drawable[] - { - new Container - { - Name = "Columns mask", - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Masking = true, - Children = new Drawable[] - { - new Box - { - Name = "Background", - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black - }, - columns = new FillFlowContainer - { - Name = "Columns", - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Direction = FillDirection.Horizontal, - Padding = new MarginPadding { Left = 1, Right = 1 }, - Spacing = new Vector2(1, 0) - }, - } - }, - new Container - { - Name = "Barlines mask", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - Width = 1366, // Bar lines should only be masked on the vertical axis - BypassAutoSizeAxes = Axes.Both, - Masking = true, - Child = content = new Container - { - Name = "Bar lines", - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - Padding = new MarginPadding { Top = HIT_TARGET_POSITION } - } - }, - judgements = new Container - { - Anchor = Anchor.TopCentre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Y = HIT_TARGET_POSITION + 150, - BypassAutoSizeAxes = Axes.Both - }, - topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } - } + Anchor= Anchor.Centre, + Origin= Anchor.Centre, + Spacing=new Vector2(400), } }; + int numberOfGroup = 1; + if (coop) + numberOfGroup = 2; + + for (int i = 0; i < numberOfGroup; i ++) + { + var group = new ManiaColumnGroup(columnCount / numberOfGroup) + { + + }; + ListColumnGroup.Add(group); + } + + + foreach (var single in ListColumnGroup) + { + single.VisibleTimeRange.BindTo(this.VisibleTimeRange); + AddNested(single); + } + var currentAction = ManiaAction.Key1; for (int i = 0; i < columnCount; i++) { var c = new Column(); - c.VisibleTimeRange.BindTo(VisibleTimeRange); + //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; + c.Action = currentAction++; + /* c.IsSpecial = isSpecialColumn(i); - c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; - topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); - columns.Add(c); + */ + getFallDownControlContainerByActualColumn(i).AddColumn(c); AddNested(c); } Inverted.ValueChanged += invertedChanged; Inverted.TriggerChange(); + } private void invertedChanged(bool newValue) { Scale = new Vector2(1, newValue ? -1 : 1); - judgements.Scale = Scale; - } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - normalColumnColours = new List + //judgements.Scale = Scale; + foreach (var single in ListColumnGroup) { - colours.RedDark, - colours.GreenDark - }; - - specialColumnColour = colours.BlueDark; - - // Set the special column + colour + key - foreach (var column in Columns) - { - if (!column.IsSpecial) - continue; - - column.AccentColour = specialColumnColour; - } - - var nonSpecialColumns = Columns.Where(c => !c.IsSpecial).ToList(); - - // We'll set the colours of the non-special columns in a separate loop, because the non-special - // column colours are mirrored across their centre and special styles mess with this - for (int i = 0; i < Math.Ceiling(nonSpecialColumns.Count / 2f); i++) - { - Color4 colour = normalColumnColours[i % normalColumnColours.Count]; - nonSpecialColumns[i].AccentColour = colour; - nonSpecialColumns[nonSpecialColumns.Count - 1 - i].AccentColour = colour; + single.Judgements.Scale = Scale; } } public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { var maniaObject = (ManiaHitObject)judgedObject.HitObject; - columns[maniaObject.Column].OnJudgement(judgedObject, judgement); + int column = maniaObject.Column; + Columns[maniaObject.Column].OnJudgement(judgedObject, judgement); - judgements.Clear(); - judgements.Add(new DrawableManiaJudgement(judgement) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }); - } - - /// - /// Whether the column index is a special column for this playfield. - /// - /// The 0-based column index. - /// Whether the column is a special column. - private bool isSpecialColumn(int column) - { - switch (SpecialColumnPosition) - { - default: - case SpecialColumnPosition.Normal: - return columnCount % 2 == 1 && column == columnCount / 2; - case SpecialColumnPosition.Left: - return column == 0; - case SpecialColumnPosition.Right: - return column == columnCount - 1; - } + getFallDownControlContainerByActualColumn(column).AddJudgement(judgement); } public override void Add(DrawableHitObject h) => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); - public void Add(DrawableBarLine barline) => HitObjects.Add(barline); - - protected override void Update() + public void Add(BarLine barline) { - // Due to masking differences, it is not possible to get the width of the columns container automatically - // While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually - content.Width = columns.Width; + //HitObjects.Add(new DrawableBarLine(barline)); + foreach (var single in ListColumnGroup) + { + single.HitObjects.Add(new DrawableBarLine(barline)); + } + } + + private ManiaColumnGroup getFallDownControlContainerByActualColumn(int actualColumn) + { + int sum = 0; + foreach (var single in ListColumnGroup) + { + sum = sum + single.ColumnCount; + if (sum > actualColumn) + { + return single; + } + } + + return null; } } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 61446a31b6..7ea9382314 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -24,6 +24,7 @@ using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.Mania.Mods; namespace osu.Game.Rulesets.Mania.UI { @@ -35,7 +36,12 @@ namespace osu.Game.Rulesets.Mania.UI /// public int AvailableColumns { get; private set; } - public IEnumerable BarLines; + /// + /// Co-op + /// + public bool Coop { get; set; } = false; + + public IEnumerable BarLines; public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) : base(ruleset, beatmap, isForCurrentRuleset) @@ -44,7 +50,7 @@ namespace osu.Game.Rulesets.Mania.UI double lastObjectTime = (Objects.LastOrDefault() as IHasEndTime)?.EndTime ?? Objects.LastOrDefault()?.StartTime ?? double.MaxValue; var timingPoints = Beatmap.ControlPointInfo.TimingPoints; - var barLines = new List(); + var barLines = new List(); for (int i = 0; i < timingPoints.Count; i++) { @@ -56,12 +62,12 @@ namespace osu.Game.Rulesets.Mania.UI int index = 0; for (double t = timingPoints[i].Time; Precision.DefinitelyBigger(endTime, t); t += point.BeatLength, index++) { - barLines.Add(new DrawableBarLine(new BarLine + barLines.Add(new BarLine { StartTime = t, ControlPoint = point, BeatIndex = index - })); + }); } } @@ -74,7 +80,7 @@ namespace osu.Game.Rulesets.Mania.UI BarLines.ForEach(Playfield.Add); } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(AvailableColumns) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(AvailableColumns, Coop) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -101,6 +107,20 @@ namespace osu.Game.Rulesets.Mania.UI AvailableColumns = Math.Max(4, Math.Min((int)Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty) + 1, 7)); } + //get mods to change column and coop + foreach (var single in this.WorkingBeatmap.Mods.Value) + { + if (single is ManiaKeyMod maniaKeyMod) + { + AvailableColumns = maniaKeyMod.KeyCount; + } + if (single is ManiaModKeyCoop) + { + Coop = true; + AvailableColumns = AvailableColumns * 2; + } + } + return new ManiaBeatmapConverter(IsForCurrentRuleset, AvailableColumns); } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index bdd6656ed9..564af6e454 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -92,6 +92,7 @@ + From cfc4c39255e6e4c475691ba01cee0c121aa8a74b Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 28 Dec 2017 22:57:41 +0900 Subject: [PATCH 086/628] Fixed the alert from AppVeyor. maybe. --- osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs | 9 ++++++--- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 5 +---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs index a37fa913bc..fa4820f996 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Collections.Generic; using OpenTK; using OpenTK.Graphics; @@ -41,14 +44,14 @@ namespace osu.Game.Rulesets.Mania.UI } } - private readonly FillFlowContainer columns; public IEnumerable Columns => columns.Children; + private readonly FillFlowContainer columns; protected override Container Content => content; private readonly Container content; - private readonly Container judgements; public Container Judgements => judgements; + private readonly Container judgements; private readonly Container topLevelContainer; public Container TopLevelContainer => topLevelContainer; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index ffa74b6ba9..7658638b5a 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -80,10 +80,7 @@ namespace osu.Game.Rulesets.Mania.UI for (int i = 0; i < numberOfGroup; i ++) { - var group = new ManiaColumnGroup(columnCount / numberOfGroup) - { - - }; + var group = new ManiaColumnGroup(columnCount / numberOfGroup); ListColumnGroup.Add(group); } From a322c15bbd5dac9bff9f89e86eda797e709f2c53 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 28 Dec 2017 23:15:12 +0900 Subject: [PATCH 087/628] =?UTF-8?q?after=20resharper=20:=20(=20.=20?= =?UTF-8?q?=E8=A3=9D=E4=B8=8AResharper=EF=BC=8C=E5=BE=9E=E6=AD=A4VS?= =?UTF-8?q?=E7=9A=84=E9=80=9F=E5=BA=A6=E4=B8=80=E7=89=87=E9=BB=91=E6=9A=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/DrawableManiaJudgement.cs | 2 +- .../UI/ManiaColumnGroup.cs | 19 +++----- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 46 ++++++++----------- .../UI/ManiaRulesetContainer.cs | 6 +-- 4 files changed, 29 insertions(+), 44 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs index 08478cef33..6a8e904537 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mania.UI internal class DrawableManiaJudgement : DrawableJudgement { public DrawableManiaJudgement(Judgement judgement) - : base(judgement) + : base(judgement) { JudgementText.TextSize = 25; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs index fa4820f996..952deef6e8 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs @@ -3,21 +3,16 @@ using System; using System.Collections.Generic; -using OpenTK; -using OpenTK.Graphics; +using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using osu.Game.Graphics; -using osu.Framework.Allocation; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.UI; -using osu.Game.Rulesets.Timing; +using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Rulesets.Mania.UI { @@ -61,7 +56,8 @@ namespace osu.Game.Rulesets.Mania.UI public int ColumnCount { get; protected set; } - public ManiaColumnGroup(int columnCount) : base(Axes.Y) + public ManiaColumnGroup(int columnCount) + : base(Axes.Y) { ColumnCount = columnCount; Name = "Playfield elements"; @@ -91,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Background", RelativeSizeAxes = Axes.Both, - Colour = new Color4(0,0,0,0.8f) + Colour = new Color4(0, 0, 0, 0.8f) }, columns = new FillFlowContainer { @@ -133,7 +129,6 @@ namespace osu.Game.Rulesets.Mania.UI topLevelContainer = new Container { RelativeSizeAxes = Axes.Both } } } - }; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 7658638b5a..d47d3b4299 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -1,33 +1,23 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Configuration; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Objects.Drawables; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Graphics.Containers; -using System; -using osu.Game.Graphics; -using osu.Framework.Allocation; -using System.Linq; -using System.Collections.Generic; -using osu.Framework.Configuration; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Mania.Objects.Drawables; -using osu.Framework.Graphics.Shapes; -using osu.Game.Rulesets.Judgements; -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Objects.Types; -using osu.Game.Beatmaps.ControlPoints; -using osu.Framework.MathUtils; -using osu.Framework.Extensions.IEnumerableExtensions; namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : ScrollingPlayfield { - /// /// list mania column group /// @@ -53,7 +43,8 @@ namespace osu.Game.Rulesets.Mania.UI private readonly int columnCount; - public ManiaPlayfield(int columnCount,bool coop): base(Axes.Y) + public ManiaPlayfield(int columnCount, bool coop) + : base(Axes.Y) { this.columnCount = columnCount; @@ -64,13 +55,13 @@ namespace osu.Game.Rulesets.Mania.UI InternalChildren = new Drawable[] { - ListColumnGroup=new FillFlowContainer() + ListColumnGroup = new FillFlowContainer() { - Direction= FillDirection.Horizontal, + Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, - Anchor= Anchor.Centre, - Origin= Anchor.Centre, - Spacing=new Vector2(400), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Spacing = new Vector2(400), } }; @@ -78,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.UI if (coop) numberOfGroup = 2; - for (int i = 0; i < numberOfGroup; i ++) + for (int i = 0; i < numberOfGroup; i++) { var group = new ManiaColumnGroup(columnCount / numberOfGroup); ListColumnGroup.Add(group); @@ -87,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.UI foreach (var single in ListColumnGroup) { - single.VisibleTimeRange.BindTo(this.VisibleTimeRange); + single.VisibleTimeRange.BindTo(VisibleTimeRange); AddNested(single); } @@ -109,7 +100,6 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.ValueChanged += invertedChanged; Inverted.TriggerChange(); - } private void invertedChanged(bool newValue) @@ -141,7 +131,7 @@ namespace osu.Game.Rulesets.Mania.UI { single.HitObjects.Add(new DrawableBarLine(barline)); } - } + } private ManiaColumnGroup getFallDownControlContainerByActualColumn(int actualColumn) { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 7ea9382314..4bed527cbc 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.Linq; -using OpenTK; using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; @@ -13,6 +12,7 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Replays; @@ -24,7 +24,7 @@ using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; -using osu.Game.Rulesets.Mania.Mods; +using OpenTK; namespace osu.Game.Rulesets.Mania.UI { @@ -108,7 +108,7 @@ namespace osu.Game.Rulesets.Mania.UI } //get mods to change column and coop - foreach (var single in this.WorkingBeatmap.Mods.Value) + foreach (var single in WorkingBeatmap.Mods.Value) { if (single is ManiaKeyMod maniaKeyMod) { From 9faa5fb199f1209d5c91927b8209cf23f497f1cd Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 28 Dec 2017 23:40:02 +0900 Subject: [PATCH 088/628] pray --- .../Mods/ManiaModGravity.cs | 1 - .../Tests/TestCaseManiaPlayfield.cs | 3 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 43 ++++++++++++------- .../UI/ManiaRulesetContainer.cs | 2 +- 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index dc80cea562..6e5290e277 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Mods; using osu.Game.Graphics; using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.Mania.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Mods { diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 88727df405..7b13f1f7fc 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -5,7 +5,6 @@ using System; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Rulesets.Mania.Judgements; @@ -87,7 +86,7 @@ namespace osu.Game.Rulesets.Mania.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - //SpecialColumnPosition = specialPos + SpecialColumnPosition = specialPos }); playfield.Inverted.Value = inverted; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index d47d3b4299..e9b5b835ef 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -21,19 +21,34 @@ namespace osu.Game.Rulesets.Mania.UI /// /// list mania column group /// - FillFlowContainer ListColumnGroup = new FillFlowContainer(); + private FillFlowContainer listColumnGroup; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. /// public readonly Bindable Inverted = new Bindable(true); + /// + /// The style to use for the special column. + /// + public SpecialColumnPosition SpecialColumnPosition + { + get => listColumnGroup.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + set + { + foreach (var singleGroup in listColumnGroup) + { + singleGroup.SpecialColumnPosition = value; + } + } + } + public List Columns { get { var list = new List(); - foreach (var single in ListColumnGroup) + foreach (var single in listColumnGroup) { list.AddRange(single.Columns); } @@ -41,13 +56,9 @@ namespace osu.Game.Rulesets.Mania.UI } } - private readonly int columnCount; - public ManiaPlayfield(int columnCount, bool coop) : base(Axes.Y) { - this.columnCount = columnCount; - if (columnCount <= 0) throw new ArgumentException("Can't have zero or fewer columns."); @@ -55,7 +66,7 @@ namespace osu.Game.Rulesets.Mania.UI InternalChildren = new Drawable[] { - ListColumnGroup = new FillFlowContainer() + listColumnGroup = new FillFlowContainer { Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, @@ -72,11 +83,11 @@ namespace osu.Game.Rulesets.Mania.UI for (int i = 0; i < numberOfGroup; i++) { var group = new ManiaColumnGroup(columnCount / numberOfGroup); - ListColumnGroup.Add(group); + listColumnGroup.Add(group); } - foreach (var single in ListColumnGroup) + foreach (var single in listColumnGroup) { single.VisibleTimeRange.BindTo(VisibleTimeRange); AddNested(single); @@ -85,9 +96,11 @@ namespace osu.Game.Rulesets.Mania.UI var currentAction = ManiaAction.Key1; for (int i = 0; i < columnCount; i++) { - var c = new Column(); - //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; - c.Action = currentAction++; + var c = new Column + { + //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; + Action = currentAction++ + }; /* c.IsSpecial = isSpecialColumn(i); @@ -107,7 +120,7 @@ namespace osu.Game.Rulesets.Mania.UI Scale = new Vector2(1, newValue ? -1 : 1); //judgements.Scale = Scale; - foreach (var single in ListColumnGroup) + foreach (var single in listColumnGroup) { single.Judgements.Scale = Scale; } @@ -127,7 +140,7 @@ namespace osu.Game.Rulesets.Mania.UI public void Add(BarLine barline) { //HitObjects.Add(new DrawableBarLine(barline)); - foreach (var single in ListColumnGroup) + foreach (var single in listColumnGroup) { single.HitObjects.Add(new DrawableBarLine(barline)); } @@ -136,7 +149,7 @@ namespace osu.Game.Rulesets.Mania.UI private ManiaColumnGroup getFallDownControlContainerByActualColumn(int actualColumn) { int sum = 0; - foreach (var single in ListColumnGroup) + foreach (var single in listColumnGroup) { sum = sum + single.ColumnCount; if (sum > actualColumn) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 4bed527cbc..ccaed69312 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// Co-op /// - public bool Coop { get; set; } = false; + public bool Coop { get; set; } public IEnumerable BarLines; From 7b94a710e3bb9d3221c7c900e44971293ff6e73f Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 28 Dec 2017 23:55:06 +0900 Subject: [PATCH 089/628] Appveyor Chan, Please --- osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs | 3 +-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs index 952deef6e8..1e88b240b5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs @@ -49,12 +49,11 @@ namespace osu.Game.Rulesets.Mania.UI private readonly Container judgements; private readonly Container topLevelContainer; - public Container TopLevelContainer => topLevelContainer; private List normalColumnColours = new List(); private Color4 specialColumnColour; - public int ColumnCount { get; protected set; } + public readonly int ColumnCount; public ManiaColumnGroup(int columnCount) : base(Axes.Y) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index e9b5b835ef..a5c5979057 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// list mania column group /// - private FillFlowContainer listColumnGroup; + private readonly FillFlowContainer listColumnGroup; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. From 66f076815f8fa82e4938e369cdb81e7118989a45 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 28 Dec 2017 19:32:06 +0100 Subject: [PATCH 090/628] query friends endpoint to fetch friendlist --- .../Online/API/Requests/GetFriendsRequest.cs | 13 +++++ osu.Game/Overlays/Social/FilterControl.cs | 2 +- osu.Game/Overlays/SocialOverlay.cs | 58 ++++++++++++------- osu.Game/osu.Game.csproj | 1 + 4 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 osu.Game/Online/API/Requests/GetFriendsRequest.cs diff --git a/osu.Game/Online/API/Requests/GetFriendsRequest.cs b/osu.Game/Online/API/Requests/GetFriendsRequest.cs new file mode 100644 index 0000000000..a06471fd74 --- /dev/null +++ b/osu.Game/Online/API/Requests/GetFriendsRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Users; + +namespace osu.Game.Online.API.Requests +{ + public class GetFriendsRequest : APIRequest> + { + protected override string Target => @"friends"; + } +} diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index 03acd9bf13..cf4097643e 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Social public enum SocialSortCriteria { Rank, - Location, + //Location, //[Description("Time Zone")] //TimeZone, //[Description("World Map")] diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 051cf5d6d2..3d62775c84 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -64,7 +64,7 @@ namespace osu.Game.Overlays // TODO sort our list in some way (either locally or with API call) //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += rankStatus => Scheduler.AddOnce(updateSearch); - Header.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); + Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch); currentQuery.ValueChanged += v => { @@ -81,7 +81,7 @@ namespace osu.Game.Overlays currentQuery.BindTo(Filter.Search.Current); - Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch); + Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); Scheduler.AddOnce(updateSearch); // so it displays something once it's first opened } @@ -141,6 +141,7 @@ namespace osu.Game.Overlays } private GetUsersRequest getUsersRequest; + private GetFriendsRequest getFriendsRequest; private readonly Bindable currentQuery = new Bindable(); @@ -155,33 +156,50 @@ namespace osu.Game.Overlays Users = null; loading.Hide(); - getUsersRequest?.Cancel(); + clearRequests(); if (api == null || api.State == APIState.Offline) return; - getUsersRequest = new GetUsersRequest(); // TODO filter/sort values?!? - - getUsersRequest.Success += response => + switch (Header.Tabs.Current.Value) { - Task.Run(() => - { - var newUsers = response.Select(r => r.User); - - Schedule(() => - { - Users = newUsers; - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); - loading.Hide(); - }); - }); - }; - + case SocialTab.OnlinePlayers: + getUsersRequest = new GetUsersRequest(); // TODO filter??? + getUsersRequest.Success += response => finishRequest(response.Select(r => r.User)); + queueRequest(getUsersRequest); + break; + case SocialTab.OnlineFriends: + getFriendsRequest = new GetFriendsRequest(); // TODO filter??? + getFriendsRequest.Success += finishRequest; + queueRequest(getFriendsRequest); + break; + } loading.Show(); - api.Queue(getUsersRequest); } + + private void clearRequests() + { + getUsersRequest?.Cancel(); + getFriendsRequest?.Cancel(); + } + + private void finishRequest(IEnumerable newUsers) + { + Task.Run(() => + { + Schedule(() => + { + Users = newUsers; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + loading.Hide(); + }); + }); + } + + private void queueRequest(APIRequest request) => api.Queue(request); } + public enum SortDirection { Descending, diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 94678106bf..29deea5771 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -268,6 +268,7 @@ + From 53cd47a192cfc051279c358c5f4d52864e98cc56 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 28 Dec 2017 19:34:49 +0100 Subject: [PATCH 091/628] Updated submodule osu-resources --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 4287ee8043..e01f71160f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 4287ee8043fb1419017359bc3a5db5dc06bc643f +Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 From 7ecc693e3492296ace03aa0e37d271e3b92349ac Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 28 Dec 2017 19:35:29 +0100 Subject: [PATCH 092/628] Updated submodule osu-framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 08f85f9bf9..10cae790c6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 08f85f9bf9a7376aec8dfcde8c7c96d267d8c295 +Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6 From 7454633f63e48cf5618b143366f76912db1ba143 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 28 Dec 2017 20:11:21 +0100 Subject: [PATCH 093/628] Refactor and general tidying up --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 13 ++-- .../Containers/OsuLinkFlowContainer.cs | 59 ++++++++++++++++++ .../Containers/OsuLinkTextFlowContainer.cs | 60 ------------------- ...{OsuLinkSpriteText.cs => OsuSpriteLink.cs} | 4 +- osu.Game/Online/Chat/ChatLink.cs | 22 +++---- osu.Game/Overlays/Chat/ChatLine.cs | 10 ++-- osu.Game/Overlays/Profile/ProfileHeader.cs | 6 +- osu.Game/osu.Game.csproj | 4 +- 8 files changed, 89 insertions(+), 89 deletions(-) create mode 100644 osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs delete mode 100644 osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs rename osu.Game/Graphics/Sprites/{OsuLinkSpriteText.cs => OsuSpriteLink.cs} (90%) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 15a5e12546..31544c9364 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Containers; using osu.Game.Online.Chat; using osu.Game.Overlays; using osu.Game.Overlays.Chat; @@ -51,13 +52,11 @@ namespace osu.Game.Tests.Visual var newLine = new ChatLine(new DummyMessage(text, isAction)); textContainer.Add(newLine); - AddAssert($"check msg having {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); - // todo: tidy this lambda up - AddAssert("check link(s) displaying", () => newLine.ContentFlow.Any() - && newLine.ContentFlow - .Cast() - .All(sprite => sprite.HandleInput && !sprite.TextColour.Equals((SRGBColour)Color4.White) - || !sprite.HandleInput && sprite.TextColour.Equals((SRGBColour)Color4.White))); + AddAssert($"msg #{textContainer.Count} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); + AddAssert($"msg #{textContainer.Count} shows link(s)", () => newLine.ContentFlow.Any() && isShowingLinks(newLine.ContentFlow)); + + bool isShowingLinks(OsuTextFlowContainer c) => c.Cast().All(sprite => sprite.HandleInput && !sprite.TextColour.Equals((SRGBColour)Color4.White) + || !sprite.HandleInput && sprite.TextColour.Equals((SRGBColour)Color4.White)); } private void testLinksGeneral() diff --git a/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs new file mode 100644 index 0000000000..5f318668a2 --- /dev/null +++ b/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Graphics.Colour; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; +using System; +using System.Collections.Generic; + +namespace osu.Game.Graphics.Containers +{ + public class OsuLinkFlowContainer : OsuLinkFlowContainer + { + public OsuLinkFlowContainer(Action defaultCreationParameters = null) + : base(defaultCreationParameters) + { + } + } + + public class OsuLinkFlowContainer : OsuTextFlowContainer + where T : OsuSpriteLink, new() + { + public override bool HandleInput => true; + + public OsuLinkFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) + { + } + + protected override SpriteText CreateSpriteText() => new T(); + + /// + /// The colour for text (links override this). Will only be used for new text elements. + /// + public ColourInfo TextColour = Color4.White; + + public IEnumerable AddLink(string text, string url, Action creationParameters = null) + { + // TODO: Remove this and get word wrapping working + text = text.Replace(' ', '_'); + + return AddText(text, link => + { + creationParameters?.Invoke(link); + ((T)link).Url = url; + }); + } + + public new IEnumerable AddText(string text, Action creationParameters = null) + { + return base.AddText(text, sprite => + { + ((OsuSpriteLink)sprite).TextColour = TextColour; + + creationParameters?.Invoke(sprite); + }); + } + } +} diff --git a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs deleted file mode 100644 index bc23d128f2..0000000000 --- a/osu.Game/Graphics/Containers/OsuLinkTextFlowContainer.cs +++ /dev/null @@ -1,60 +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.Colour; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics.Sprites; -using System; -using System.Collections.Generic; - -namespace osu.Game.Graphics.Containers -{ - public class OsuLinkTextFlowContainer : OsuLinkTextFlowContainer - { - public OsuLinkTextFlowContainer(Action defaultCreationParameters = null) - : base(defaultCreationParameters) - { - } - } - - public class OsuLinkTextFlowContainer : OsuTextFlowContainer - where T : OsuLinkSpriteText, new() - { - public override bool HandleInput => true; - - public OsuLinkTextFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) - { - } - - protected override SpriteText CreateSpriteText() => new T(); - - /// - /// The colour for normal text (links ignore this). Will only be used for new text elements. - /// Default is white. - /// - public ColourInfo? TextColour; - - public void AddLink(string text, string url, Action creationParameters = null) - { - // TODO: Remove this and get word wrapping working - text = text.Replace(' ', '_'); - - AddText(text, link => - { - creationParameters?.Invoke(link); - LoadComponentAsync(link, d => ((T)d).Url = url); - }); - } - - public IEnumerable AddText(string text, Action creationParameters = null) - { - return base.AddText(text, sprite => - { - if (TextColour.HasValue) - ((OsuLinkSpriteText)sprite).TextColour = TextColour.Value; - - creationParameters?.Invoke(sprite); - }); - } - } -} diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs similarity index 90% rename from osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs rename to osu.Game/Graphics/Sprites/OsuSpriteLink.cs index ccf7c80d07..e42337dff3 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs @@ -10,7 +10,7 @@ using osu.Game.Graphics.Containers; namespace osu.Game.Graphics.Sprites { - public class OsuLinkSpriteText : OsuSpriteText + public class OsuSpriteLink : OsuSpriteText { protected override IEnumerable FlowingChildren => Children; @@ -18,7 +18,7 @@ namespace osu.Game.Graphics.Sprites private readonly Container content; - public OsuLinkSpriteText() + public OsuSpriteLink() { AddInternal(content = new OsuHoverContainer { diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index ccf146286b..aa5a0e100b 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -12,7 +12,7 @@ using System.Text.RegularExpressions; namespace osu.Game.Online.Chat { - public class ChatLink : OsuLinkSpriteText, IHasTooltip + public class ChatLink : OsuSpriteLink, IHasTooltip { private APIAccess api; private BeatmapSetOverlay beatmapSetOverlay; @@ -20,9 +20,13 @@ namespace osu.Game.Online.Chat public override bool HandleInput => !string.IsNullOrEmpty(Url); + // 'protocol' -> 'https', 'http', 'osu', 'osump' etc. + // 'content' -> everything after '://' + private Match getUrlMatch() => Regex.Match(Url, @"^(?osu(?:mp)?|https?):\/\/(?.*)"); + protected override void OnLinkClicked() { - var urlMatch = Regex.Matches(Url, @"^(?osu(?:mp)?|https?):\/\/(?.*)")[0]; + var urlMatch = getUrlMatch(); if (urlMatch.Success) { var args = urlMatch.Groups["content"].Value.Split('/'); @@ -41,11 +45,8 @@ namespace osu.Game.Online.Chat case "chan": var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); - if (foundChannel == null) - throw new ArgumentException($"Unknown channel name ({args[1]})."); - else - chat.OpenChannel(foundChannel); - + // links should be filtered out by now if a channel doesn't exist + chat.OpenChannel(foundChannel ?? throw new ArgumentException($"Unknown channel name ({args[1]}).")); break; case "edit": chat.Game?.LoadEditorTimestamp(); @@ -130,9 +131,10 @@ namespace osu.Game.Online.Chat if (Url == Text) return null; - if (Url.StartsWith("osu://")) + var urlMatch = getUrlMatch(); + if (urlMatch.Success && urlMatch.Groups["protocol"].Value == "osu") { - var args = Url.Substring(6).Split('/'); + var args = urlMatch.Groups["content"].Value.Split('/'); if (args.Length < 2) return Url; @@ -140,7 +142,7 @@ namespace osu.Game.Online.Chat if (args[0] == "chan") return "Switch to channel " + args[1]; if (args[0] == "edit") - return "Go to " + args[1].Remove(9).TrimEnd(); + return "Go to " + args[1]; } return Url; diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 26759825ee..add0bb1fd8 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -83,7 +83,10 @@ namespace osu.Game.Overlays.Chat private Message message; private OsuSpriteText username; - private OsuLinkTextFlowContainer contentFlow; + private OsuLinkFlowContainer contentFlow; + + // this is only used for testing + public OsuTextFlowContainer ContentFlow => contentFlow; public Message Message { @@ -101,9 +104,6 @@ namespace osu.Game.Overlays.Chat } } - // this is only used for testing - public OsuTextFlowContainer ContentFlow => contentFlow; - [BackgroundDependencyLoader(true)] private void load(OsuColour colours, ChatOverlay chat) { @@ -193,7 +193,7 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new OsuLinkTextFlowContainer(t => + contentFlow = new OsuLinkFlowContainer(t => { if (Message.IsAction) t.Font = "Exo2.0-MediumItalic"; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 2a682aa654..f1efbbc54a 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Profile public class ProfileHeader : Container { private readonly OsuTextFlowContainer infoTextLeft; - private readonly OsuLinkTextFlowContainer infoTextRight; + private readonly OsuLinkFlowContainer infoTextRight; private readonly FillFlowContainer scoreText, scoreNumberText; private readonly RankGraph rankGraph; @@ -142,7 +142,7 @@ namespace osu.Game.Overlays.Profile ParagraphSpacing = 0.8f, LineSpacing = 0.2f }, - infoTextRight = new OsuLinkTextFlowContainer(t => + infoTextRight = new OsuLinkFlowContainer(t => { t.TextSize = 14; t.Font = @"Exo2.0-RegularItalic"; @@ -473,7 +473,7 @@ namespace osu.Game.Overlays.Profile } } - private class ProfileLink : OsuLinkSpriteText, IHasTooltip + private class ProfileLink : OsuSpriteLink, IHasTooltip { public string TooltipText => "View Profile in Browser"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index bc7df963da..d32c458ccf 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -270,8 +270,8 @@ - - + + From 3845c7ac7de3f17ea64aa225037915f71280baf4 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Thu, 28 Dec 2017 14:31:34 -0600 Subject: [PATCH 094/628] Remove bluring of storyboard --- osu.Game/Screens/Play/Player.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 8430acbc73..8b94f41686 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -75,7 +75,7 @@ namespace osu.Game.Screens.Play #endregion private BreakOverlay breakOverlay; - private BufferedContainer storyboardContainer; + private Container storyboardContainer; private DrawableStoryboard storyboard; private HUDOverlay hudOverlay; @@ -149,7 +149,7 @@ namespace osu.Game.Screens.Play Children = new Drawable[] { - storyboardContainer = new BufferedContainer + storyboardContainer = new Container { RelativeSizeAxes = Axes.Both, Clock = offsetClock, @@ -389,7 +389,6 @@ namespace osu.Game.Screens.Play storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800); storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, 800, Easing.OutQuint); - storyboardContainer.BlurTo(blur, 800, Easing.OutQuint); Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, 800, Easing.OutQuint); (Background as BackgroundScreenBeatmap)?.BlurTo(blur, 800, Easing.OutQuint); From ae79be7b513ea30ce8eeb8385806b9e7b8a54ed2 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 28 Dec 2017 21:45:58 +0100 Subject: [PATCH 095/628] small style fixes plus new assert in test --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 5 ++++- .../Graphics/Containers/OsuLinkFlowContainer.cs | 6 +++--- osu.Game/Graphics/Sprites/OsuSpriteLink.cs | 2 +- osu.Game/Overlays/Chat/ChatLine.cs | 14 +++++++------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 31544c9364..1ad297d1f9 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -53,7 +53,10 @@ namespace osu.Game.Tests.Visual textContainer.Add(newLine); AddAssert($"msg #{textContainer.Count} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); - AddAssert($"msg #{textContainer.Count} shows link(s)", () => newLine.ContentFlow.Any() && isShowingLinks(newLine.ContentFlow)); + AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic(newLine.ContentFlow)); + AddAssert($"msg #{textContainer.Count} shows link(s)", () => isShowingLinks(newLine.ContentFlow)); + + bool isItalic(OsuTextFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); bool isShowingLinks(OsuTextFlowContainer c) => c.Cast().All(sprite => sprite.HandleInput && !sprite.TextColour.Equals((SRGBColour)Color4.White) || !sprite.HandleInput && sprite.TextColour.Equals((SRGBColour)Color4.White)); diff --git a/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs index 5f318668a2..48910a04ca 100644 --- a/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs @@ -23,7 +23,8 @@ namespace osu.Game.Graphics.Containers { public override bool HandleInput => true; - public OsuLinkFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) + public OsuLinkFlowContainer(Action defaultCreationParameters = null) + : base(defaultCreationParameters) { } @@ -41,8 +42,8 @@ namespace osu.Game.Graphics.Containers return AddText(text, link => { + ((OsuSpriteLink)link).Url = url; creationParameters?.Invoke(link); - ((T)link).Url = url; }); } @@ -51,7 +52,6 @@ namespace osu.Game.Graphics.Containers return base.AddText(text, sprite => { ((OsuSpriteLink)sprite).TextColour = TextColour; - creationParameters?.Invoke(sprite); }); } diff --git a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs index e42337dff3..1c2a219b53 100644 --- a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs @@ -16,7 +16,7 @@ namespace osu.Game.Graphics.Sprites protected override Container Content => content; - private readonly Container content; + private readonly OsuHoverContainer content; public OsuSpriteLink() { diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index add0bb1fd8..e877a35a75 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -85,7 +85,6 @@ namespace osu.Game.Overlays.Chat private OsuSpriteText username; private OsuLinkFlowContainer contentFlow; - // this is only used for testing public OsuTextFlowContainer ContentFlow => contentFlow; public Message Message @@ -196,7 +195,7 @@ namespace osu.Game.Overlays.Chat contentFlow = new OsuLinkFlowContainer(t => { if (Message.IsAction) - t.Font = "Exo2.0-MediumItalic"; + t.Font = @"Exo2.0-MediumItalic"; t.TextSize = text_size; }) { @@ -230,18 +229,19 @@ namespace osu.Game.Overlays.Chat contentFlow.AddText(message.Content); else { - int prevIndex = 0; + int lastLinkEndIndex = 0; List linksToRemove = new List(); foreach (var link in message.Links) { - contentFlow.AddText(message.Content.Substring(prevIndex, link.Index - prevIndex)); - prevIndex = link.Index + link.Length; + contentFlow.AddText(message.Content.Substring(lastLinkEndIndex, link.Index - lastLinkEndIndex)); + lastLinkEndIndex = link.Index + link.Length; + const string channelPrefix = "osu://chan/"; // If a channel doesn't exist, add it as normal text instead - if (link.Url.StartsWith("osu://chan/")) + if (link.Url.StartsWith(channelPrefix)) { - var channelName = link.Url.Substring(11).Split('/')[0]; + var channelName = link.Url.Substring(channelPrefix.Length).Split('/')[0]; if (chat?.AvailableChannels.TrueForAll(c => c.Name != channelName) != false) { linksToRemove.Add(link); From d66d741af27be7978ab4a25d1fdffcaf524d6070 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 28 Dec 2017 22:11:10 +0100 Subject: [PATCH 096/628] fixed constant naming --- osu.Game/Overlays/Chat/ChatLine.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index e877a35a75..ebfdadd553 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -237,11 +237,11 @@ namespace osu.Game.Overlays.Chat contentFlow.AddText(message.Content.Substring(lastLinkEndIndex, link.Index - lastLinkEndIndex)); lastLinkEndIndex = link.Index + link.Length; - const string channelPrefix = "osu://chan/"; + const string channel_link_prefix = "osu://chan/"; // If a channel doesn't exist, add it as normal text instead - if (link.Url.StartsWith(channelPrefix)) + if (link.Url.StartsWith(channel_link_prefix)) { - var channelName = link.Url.Substring(channelPrefix.Length).Split('/')[0]; + var channelName = link.Url.Substring(channel_link_prefix.Length).Split('/')[0]; if (chat?.AvailableChannels.TrueForAll(c => c.Name != channelName) != false) { linksToRemove.Add(link); From df62ca14b7f67007216e0d1726342cd7d2da57ee Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Fri, 29 Dec 2017 23:41:36 -0600 Subject: [PATCH 097/628] Don't unbind when not necessary --- osu.Game/Screens/Play/Player.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 8b94f41686..5346de2bb7 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -311,10 +311,9 @@ namespace osu.Game.Screens.Play if (!loadedSuccessfully) return; - dimLevel.ValueChanged += backgroundLevel_ValueChanged; - blurLevel.ValueChanged += backgroundLevel_ValueChanged; - - showStoryboard.ValueChanged += showStoryboard_ValueChanged; + dimLevel.ValueChanged += value => updateBackgroundElements(); + blurLevel.ValueChanged += value => updateBackgroundElements(); + showStoryboard.ValueChanged += value => updateBackgroundElements(); updateBackgroundElements(); Content.Alpha = 0; @@ -370,12 +369,6 @@ namespace osu.Game.Screens.Play return true; } - private void backgroundLevel_ValueChanged(double newValue) - => updateBackgroundElements(); - - private void showStoryboard_ValueChanged(bool newValue) - => updateBackgroundElements(); - private void updateBackgroundElements() { var opacity = 1 - (float)dimLevel; @@ -396,10 +389,6 @@ namespace osu.Game.Screens.Play private void fadeOut() { - dimLevel.ValueChanged -= backgroundLevel_ValueChanged; - blurLevel.ValueChanged -= backgroundLevel_ValueChanged; - showStoryboard.ValueChanged -= showStoryboard_ValueChanged; - const float fade_out_duration = 250; RulesetContainer?.FadeOut(fade_out_duration); From 8a02900c014be3b2117fef243aa099e0d7deff14 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 11:33:06 +0100 Subject: [PATCH 098/628] changed titles from social tabs --- osu.Game/Overlays/Social/Header.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index e15b16085b..94368d9786 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -53,9 +53,9 @@ namespace osu.Game.Overlays.Social public enum SocialTab { - [Description("Online Players")] + [Description("Players")] OnlinePlayers, - [Description("Online Friends")] + [Description("Friends")] OnlineFriends, //[Description("Online Team Members")] //OnlineTeamMembers, From 72af5bf67242133655655777e487e3f9ae1521e1 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 11:51:49 +0100 Subject: [PATCH 099/628] simplify socialoverlay user request structure --- osu.Game/Overlays/SocialOverlay.cs | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 3d62775c84..219672b76d 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -140,8 +140,7 @@ namespace osu.Game.Overlays }); } - private GetUsersRequest getUsersRequest; - private GetFriendsRequest getFriendsRequest; + private APIRequest getUsersRequest; private readonly Bindable currentQuery = new Bindable(); @@ -156,7 +155,7 @@ namespace osu.Game.Overlays Users = null; loading.Hide(); - clearRequests(); + getUsersRequest?.Cancel(); if (api == null || api.State == APIState.Offline) return; @@ -165,24 +164,17 @@ namespace osu.Game.Overlays { case SocialTab.OnlinePlayers: getUsersRequest = new GetUsersRequest(); // TODO filter??? - getUsersRequest.Success += response => finishRequest(response.Select(r => r.User)); - queueRequest(getUsersRequest); + ((GetUsersRequest)getUsersRequest).Success += response => finishRequest(response.Select(r => r.User)); break; case SocialTab.OnlineFriends: - getFriendsRequest = new GetFriendsRequest(); // TODO filter??? - getFriendsRequest.Success += finishRequest; - queueRequest(getFriendsRequest); + getUsersRequest = new GetFriendsRequest(); // TODO filter??? + ((GetFriendsRequest)getUsersRequest).Success += finishRequest; break; } + api.Queue(getUsersRequest); loading.Show(); } - private void clearRequests() - { - getUsersRequest?.Cancel(); - getFriendsRequest?.Cancel(); - } - private void finishRequest(IEnumerable newUsers) { Task.Run(() => @@ -195,11 +187,8 @@ namespace osu.Game.Overlays }); }); } - - private void queueRequest(APIRequest request) => api.Queue(request); } - public enum SortDirection { Descending, From d37ba2c9a4b51853de432cba3f1d1992f8a7001c Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 11:54:03 +0100 Subject: [PATCH 100/628] disable searching/filtering with textbox it doesn't do anything except from creating unnecessary requests for now --- osu.Game/Overlays/SocialOverlay.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 219672b76d..a65e2f9e77 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -66,18 +66,18 @@ namespace osu.Game.Overlays Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch); - currentQuery.ValueChanged += v => - { - queryChangedDebounce?.Cancel(); + //currentQuery.ValueChanged += v => + //{ + // queryChangedDebounce?.Cancel(); - if (string.IsNullOrEmpty(v)) - Scheduler.AddOnce(updateSearch); - else - { - Users = null; - queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); - } - }; + // if (string.IsNullOrEmpty(v)) + // Scheduler.AddOnce(updateSearch); + // else + // { + // Users = null; + // queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); + // } + //}; currentQuery.BindTo(Filter.Search.Current); From 760d2aff4bdbd73f33ac10a9ed0858048657220f Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 12:56:18 +0100 Subject: [PATCH 101/628] readd IOnlineComponent to be able to react to APIState changes --- osu.Game/Overlays/SocialOverlay.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index a65e2f9e77..3dafecc6df 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -21,7 +21,7 @@ using System.Threading.Tasks; namespace osu.Game.Overlays { - public class SocialOverlay : SearchableListOverlay + public class SocialOverlay : SearchableListOverlay, IOnlineComponent { private APIAccess api; @@ -90,6 +90,7 @@ namespace osu.Game.Overlays private void load(APIAccess api) { this.api = api; + api.Register(this); } private void recreatePanels(PanelDisplayStyle displayStyle) @@ -187,6 +188,20 @@ namespace osu.Game.Overlays }); }); } + + public void APIStateChanged(APIAccess api, APIState state) + { + switch (state) + { + case APIState.Online: + Scheduler.AddOnce(updateSearch); + break; + default: + Users = null; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + break; + } + } } public enum SortDirection From f03e064c430479080fc2dc70d37e4050505584a5 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 30 Dec 2017 12:57:32 +0100 Subject: [PATCH 102/628] remove unnecessary update --- osu.Game/Overlays/SocialOverlay.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 3dafecc6df..d2f56f4061 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -82,8 +82,6 @@ namespace osu.Game.Overlays currentQuery.BindTo(Filter.Search.Current); Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); - - Scheduler.AddOnce(updateSearch); // so it displays something once it's first opened } [BackgroundDependencyLoader] From e7721d71f3a650ebb06072bb9c7006d1553e8dc8 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 31 Dec 2017 00:51:47 +0100 Subject: [PATCH 103/628] Changed chat link implementation according to review --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 57 +++--- .../Graphics/Containers/ChatFlowContainer.cs | 61 +++++++ .../Containers/OsuLinkFlowContainer.cs | 59 ------- osu.Game/Graphics/Sprites/OsuSpriteLink.cs | 2 + .../Online/API/Requests/GetBeatmapRequest.cs | 19 -- osu.Game/Online/Chat/ChatLink.cs | 163 +++++------------- osu.Game/Online/Chat/Message.cs | 2 +- osu.Game/Online/Chat/MessageFormatter.cs | 115 ++++++++++-- osu.Game/OsuGame.cs | 2 +- osu.Game/Overlays/BeatmapSetOverlay.cs | 14 -- osu.Game/Overlays/Chat/ChatLine.cs | 25 ++- osu.Game/Overlays/ChatOverlay.cs | 11 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 18 +- osu.Game/osu.Game.csproj | 5 +- 14 files changed, 272 insertions(+), 281 deletions(-) create mode 100644 osu.Game/Graphics/Containers/ChatFlowContainer.cs delete mode 100644 osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs delete mode 100644 osu.Game/Online/API/Requests/GetBeatmapRequest.cs diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 1ad297d1f9..9f8c3ce146 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -6,6 +6,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; +using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online.Chat; using osu.Game.Overlays; @@ -47,19 +48,32 @@ namespace osu.Game.Tests.Visual private void clear() => AddStep("clear messages", textContainer.Clear); - private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false) + private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false, bool isImportant = false) { - var newLine = new ChatLine(new DummyMessage(text, isAction)); + var newLine = new ChatLine(new DummyMessage(text, isAction, isImportant)); textContainer.Add(newLine); AddAssert($"msg #{textContainer.Count} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic(newLine.ContentFlow)); - AddAssert($"msg #{textContainer.Count} shows link(s)", () => isShowingLinks(newLine.ContentFlow)); + AddAssert($"msg #{textContainer.Count} shows link(s)", isShowingLinks); - bool isItalic(OsuTextFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); + bool isItalic(ChatFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); - bool isShowingLinks(OsuTextFlowContainer c) => c.Cast().All(sprite => sprite.HandleInput && !sprite.TextColour.Equals((SRGBColour)Color4.White) - || !sprite.HandleInput && sprite.TextColour.Equals((SRGBColour)Color4.White)); + bool isShowingLinks() + { + SRGBColour textColour = Color4.White; + bool hasBackground = !string.IsNullOrEmpty(newLine.Message.Sender.Colour); + + if (isAction && hasBackground) + textColour = OsuColour.FromHex(newLine.Message.Sender.Colour); + + return newLine.ContentFlow + .Cast() + .All(sprite => sprite.HandleInput && !sprite.TextColour.Equals(textColour) + || !sprite.HandleInput && sprite.TextColour.Equals(textColour) + // if someone with a background uses /me with a link, the usual link colour is overridden + || isAction && hasBackground && sprite.HandleInput && !sprite.TextColour.Equals((ColourInfo)Color4.White)); + } } private void testLinksGeneral() @@ -77,6 +91,9 @@ namespace osu.Game.Tests.Visual addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/home multiple links] https://osu.ppy.sh/home", 3); // note that there's 0 links here (they get removed if a channel is not found) addMessageWithChecks("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); + addMessageWithChecks("I am important!", 0, false, true); + addMessageWithChecks("feels important", 0, true, true); + addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true); } private void testAddingLinks() @@ -132,37 +149,27 @@ namespace osu.Game.Tests.Visual private class DummyMessage : Message { private static long messageCounter; + internal static readonly User TEST_SENDER_BACKGROUND = new User + { + Username = @"i-am-important", + Id = 42, + Colour = "#250cc9", + }; + internal static readonly User TEST_SENDER = new User { Username = @"Somebody", Id = 1, - Country = new Country { FullName = @"Alien" }, - CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg", - JoinDate = DateTimeOffset.Now.AddDays(-1), - LastVisit = DateTimeOffset.Now, - Age = 1, - ProfileOrder = new[] { "me" }, - CountryRank = 1, - Statistics = new UserStatistics - { - Rank = 2148, - PP = 4567.89m - }, - RankHistory = new User.RankHistoryData - { - Mode = @"osu", - Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray(), - } }; public new DateTimeOffset Timestamp = DateTimeOffset.Now; - public DummyMessage(string text, bool isAction = false) + public DummyMessage(string text, bool isAction = false, bool isImportant = false) : base(messageCounter++) { Content = text; IsAction = isAction; - Sender = TEST_SENDER; + Sender = isImportant ? TEST_SENDER_BACKGROUND : TEST_SENDER; } } diff --git a/osu.Game/Graphics/Containers/ChatFlowContainer.cs b/osu.Game/Graphics/Containers/ChatFlowContainer.cs new file mode 100644 index 0000000000..6fd06aef7c --- /dev/null +++ b/osu.Game/Graphics/Containers/ChatFlowContainer.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics.Colour; +using osu.Game.Online.Chat; +using System; + +namespace osu.Game.Graphics.Containers +{ + public class ChatFlowContainer : OsuTextFlowContainer + { + private readonly Action defaultCreationParameters; + private ColourInfo urlColour; + + public ChatFlowContainer(Action defaultCreationParameters = null) + { + this.defaultCreationParameters = defaultCreationParameters; + } + + public override bool HandleInput => true; + + public void AddLink(string text, string url, LinkAction linkType, string linkArgument) + { + var chatSprite = new ChatLink + { + Text = text, + Url = url, + TextColour = urlColour, + LinkAction = linkType, + LinkArgument = linkArgument, + }; + + defaultCreationParameters?.Invoke(chatSprite); + + AddInternal(chatSprite); + } + + public void AddText(string text, Action creationParameters = null) + { + foreach (var word in SplitWords(text)) + { + if (string.IsNullOrEmpty(word)) + continue; + + var chatSprite = new ChatLink { Text = word }; + + defaultCreationParameters?.Invoke(chatSprite); + creationParameters?.Invoke(chatSprite); + + AddInternal(chatSprite); + } + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + urlColour = colours.Blue; + } + } +} diff --git a/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs b/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs deleted file mode 100644 index 48910a04ca..0000000000 --- a/osu.Game/Graphics/Containers/OsuLinkFlowContainer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK.Graphics; -using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics.Sprites; -using System; -using System.Collections.Generic; - -namespace osu.Game.Graphics.Containers -{ - public class OsuLinkFlowContainer : OsuLinkFlowContainer - { - public OsuLinkFlowContainer(Action defaultCreationParameters = null) - : base(defaultCreationParameters) - { - } - } - - public class OsuLinkFlowContainer : OsuTextFlowContainer - where T : OsuSpriteLink, new() - { - public override bool HandleInput => true; - - public OsuLinkFlowContainer(Action defaultCreationParameters = null) - : base(defaultCreationParameters) - { - } - - protected override SpriteText CreateSpriteText() => new T(); - - /// - /// The colour for text (links override this). Will only be used for new text elements. - /// - public ColourInfo TextColour = Color4.White; - - public IEnumerable AddLink(string text, string url, Action creationParameters = null) - { - // TODO: Remove this and get word wrapping working - text = text.Replace(' ', '_'); - - return AddText(text, link => - { - ((OsuSpriteLink)link).Url = url; - creationParameters?.Invoke(link); - }); - } - - public new IEnumerable AddText(string text, Action creationParameters = null) - { - return base.AddText(text, sprite => - { - ((OsuSpriteLink)sprite).TextColour = TextColour; - creationParameters?.Invoke(sprite); - }); - } - } -} diff --git a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs index 1c2a219b53..9fc24651db 100644 --- a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs @@ -12,6 +12,8 @@ namespace osu.Game.Graphics.Sprites { public class OsuSpriteLink : OsuSpriteText { + public override bool HandleInput => !string.IsNullOrEmpty(Url); + protected override IEnumerable FlowingChildren => Children; protected override Container Content => content; diff --git a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapRequest.cs deleted file mode 100644 index 76d67e7afc..0000000000 --- a/osu.Game/Online/API/Requests/GetBeatmapRequest.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; - -namespace osu.Game.Online.API.Requests -{ - public class GetBeatmapRequest : APIRequest - { - private readonly int beatmapId; - - public GetBeatmapRequest(int beatmapId) - { - this.beatmapId = beatmapId; - } - - protected override string Target => $@"beatmaps/{beatmapId}"; - } -} diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index aa5a0e100b..f38eade682 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -4,123 +4,57 @@ using osu.Framework.Allocation; using osu.Framework.Graphics.Cursor; using osu.Game.Graphics.Sprites; -using osu.Game.Online.API; -using osu.Game.Online.API.Requests; using osu.Game.Overlays; using System; -using System.Text.RegularExpressions; namespace osu.Game.Online.Chat { public class ChatLink : OsuSpriteLink, IHasTooltip { - private APIAccess api; private BeatmapSetOverlay beatmapSetOverlay; private ChatOverlay chat; + private OsuGame game; - public override bool HandleInput => !string.IsNullOrEmpty(Url); + /// + /// The type of action executed on clicking this link. + /// + public LinkAction LinkAction { get; set; } - // 'protocol' -> 'https', 'http', 'osu', 'osump' etc. - // 'content' -> everything after '://' - private Match getUrlMatch() => Regex.Match(Url, @"^(?osu(?:mp)?|https?):\/\/(?.*)"); + /// + /// The argument necessary for the action specified by to execute. + /// Usually a part of the URL. + /// + public string LinkArgument { get; set; } protected override void OnLinkClicked() { - var urlMatch = getUrlMatch(); - if (urlMatch.Success) + switch (LinkAction) { - var args = urlMatch.Groups["content"].Value.Split('/'); - - switch (urlMatch.Groups["protocol"].Value) - { - case "osu": - if (args.Length == 1) - { - base.OnLinkClicked(); - break; - } - - switch (args[0]) - { - case "chan": - var foundChannel = chat.AvailableChannels.Find(channel => channel.Name == args[1]); - - // links should be filtered out by now if a channel doesn't exist - chat.OpenChannel(foundChannel ?? throw new ArgumentException($"Unknown channel name ({args[1]}).")); - break; - case "edit": - chat.Game?.LoadEditorTimestamp(); - break; - case "b": - if (args.Length > 1 && int.TryParse(args[1], out int mapId)) - beatmapSetOverlay.ShowBeatmap(mapId); - - break; - case "s": - case "dl": - if (args.Length > 1 && int.TryParse(args[1], out int mapSetId)) - beatmapSetOverlay.ShowBeatmapSet(mapSetId); - - break; - case "spectate": - GetUserRequest req; - if (int.TryParse(args[1], out int userId)) - req = new GetUserRequest(userId); - else - return; - - req.Success += user => - { - chat.Game?.LoadSpectatorScreen(); - }; - api.Queue(req); - - break; - default: - throw new ArgumentException($"Unknown osu:// link at {nameof(ChatLink)} ({urlMatch.Groups["content"].Value})."); - } - - break; - case "osump": - if (args.Length > 1 && int.TryParse(args[1], out int multiId)) - chat.Game?.LoadMultiplayerLobby(multiId); - - break; - case "http": - case "https": - if (args[0] == "osu.ppy.sh" && args.Length > 2) - { - switch (args[1]) - { - case "b": - case "beatmaps": - beatmapSetOverlay.ShowBeatmap(getId(args[2])); - break; - case "s": - case "beatmapsets": - case "d": - beatmapSetOverlay.ShowBeatmapSet(getId(args[2])); - break; - default: - base.OnLinkClicked(); - break; - } - } - else - base.OnLinkClicked(); - break; - default: - base.OnLinkClicked(); - break; - } - } - else - base.OnLinkClicked(); - - int getId(string input) - { - var index = input.IndexOf('#'); - return int.Parse(index > 0 ? input.Remove(index) : input); + case LinkAction.OpenBeatmap: + // todo: implement this when overlay.ShowBeatmap(id) exists + break; + case LinkAction.OpenBeatmapSet: + if (int.TryParse(LinkArgument, out int setId)) + beatmapSetOverlay.ShowBeatmapSet(setId); + break; + case LinkAction.OpenChannel: + chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == LinkArgument)); + break; + case LinkAction.OpenEditorTimestamp: + game?.LoadEditorTimestamp(); + break; + case LinkAction.JoinMultiplayerMatch: + if (int.TryParse(LinkArgument, out int matchId)) + game?.JoinMultiplayerMatch(matchId); + break; + case LinkAction.Spectate: + // todo: implement this when spectating exists + break; + case LinkAction.External: + base.OnLinkClicked(); + break; + default: + throw new NotImplementedException($"This {nameof(Chat.LinkAction)} ({LinkAction.ToString()}) is missing an associated action."); } } @@ -131,30 +65,25 @@ namespace osu.Game.Online.Chat if (Url == Text) return null; - var urlMatch = getUrlMatch(); - if (urlMatch.Success && urlMatch.Groups["protocol"].Value == "osu") + switch (LinkAction) { - var args = urlMatch.Groups["content"].Value.Split('/'); - - if (args.Length < 2) + case LinkAction.OpenChannel: + return "Switch to channel " + LinkArgument; + case LinkAction.OpenEditorTimestamp: + return "Go to " + LinkArgument; + default: return Url; - - if (args[0] == "chan") - return "Switch to channel " + args[1]; - if (args[0] == "edit") - return "Go to " + args[1]; } - - return Url; } } - [BackgroundDependencyLoader] - private void load(APIAccess api, BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat) + [BackgroundDependencyLoader(true)] + private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuGame game) { - this.api = api; this.beatmapSetOverlay = beatmapSetOverlay; this.chat = chat; + // this will be null in tests + this.game = game; } } } diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index ac14d3a88f..cda55ad269 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -41,7 +41,7 @@ namespace osu.Game.Online.Chat { } - public List Links; + public List Links; public Message(long? id) { diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 81551b08f4..eadab8840f 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -39,7 +39,7 @@ namespace osu.Game.Online.Chat // Unicode emojis private static readonly Regex emoji_regex = new Regex(@"(\uD83D[\uDC00-\uDE4F])"); - private static void handleMatches(Regex regex, string display, string link, MessageFormatterResult result, int startIndex = 0) + private static void handleMatches(Regex regex, string display, string link, MessageFormatterResult result, int startIndex = 0, LinkAction? linkActionOverride = null) { int captureOffset = 0; foreach (Match m in regex.Matches(result.Text, startIndex)) @@ -66,7 +66,8 @@ namespace osu.Game.Online.Chat //since we just changed the line display text, offset any already processed links. result.Links.ForEach(l => l.Index -= l.Index > index ? m.Length - displayText.Length : 0); - result.Links.Add(new Link(linkText, index, displayText.Length)); + var details = getLinkDetails(link); + result.Links.Add(new Link(linkText, index, displayText.Length, linkActionOverride ?? details.linkType, details.linkArgument)); //adjust the offset for processing the current matches group. captureOffset += m.Length - displayText.Length; @@ -93,7 +94,70 @@ namespace osu.Game.Online.Chat } } - result.Links.Add(new Link(link, index, indexLength)); + var details = getLinkDetails(link); + result.Links.Add(new Link(link, index, indexLength, details.linkType, details.linkArgument)); + } + } + + private static (LinkAction linkType, string linkArgument) getLinkDetails(string url) + { + var args = url.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + args[0] = args[0].TrimEnd(':'); + + switch (args[0]) + { + case "http": + case "https": + // length > 3 since all these links need another argument to work + if (args.Length > 3 && (args[1] == "osu.ppy.sh" || args[1] == "new.ppy.sh")) + { + switch (args[2]) + { + case "b": + case "beatmaps": + return (LinkAction.OpenBeatmap, args[3]); + case "s": + case "beatmapsets": + case "d": + return (LinkAction.External, args[3]); + } + } + + return (LinkAction.External, null); + case "osu": + // every internal link also needs some kind of argument + if (args.Length < 3) + return (LinkAction.External, null); + + LinkAction linkType; + switch (args[1]) + { + case "chan": + linkType = LinkAction.OpenChannel; + break; + case "edit": + linkType = LinkAction.OpenEditorTimestamp; + break; + case "b": + linkType = LinkAction.OpenBeatmap; + break; + case "s": + case "dl": + linkType = LinkAction.OpenBeatmapSet; + break; + case "spectate": + linkType = LinkAction.Spectate; + break; + default: + linkType = LinkAction.External; + break; + } + + return (linkType, args[2]); + case "osump": + return (LinkAction.JoinMultiplayerMatch, args[1]); + default: + return (LinkAction.External, null); } } @@ -114,10 +178,10 @@ namespace osu.Game.Online.Chat handleAdvanced(advanced_link_regex, result, startIndex); // handle editor times - handleMatches(time_regex, "{0}", "osu://edit/{0}", result, startIndex); + handleMatches(time_regex, "{0}", "osu://edit/{0}", result, startIndex, LinkAction.OpenEditorTimestamp); // handle channels - handleMatches(channel_regex, "{0}", "osu://chan/{0}", result, startIndex); + handleMatches(channel_regex, "{0}", "osu://chan/{0}", result, startIndex, LinkAction.OpenChannel); var empty = ""; while (space-- > 0) @@ -151,21 +215,36 @@ namespace osu.Game.Online.Chat OriginalText = Text = text; } } + } - public class Link : IComparable + public enum LinkAction + { + External, + OpenBeatmap, + OpenBeatmapSet, + OpenChannel, + OpenEditorTimestamp, + JoinMultiplayerMatch, + Spectate, + } + + public class Link : IComparable + { + public string Url; + public int Index; + public int Length; + public LinkAction Action; + public string Argument; + + public Link(string url, int startIndex, int length, LinkAction action, string argument) { - public string Url; - public int Index; - public int Length; - - public Link(string url, int startIndex, int length) - { - Url = url; - Index = startIndex; - Length = length; - } - - public int CompareTo(Link otherLink) => Index > otherLink.Index ? 1 : -1; + Url = url; + Index = startIndex; + Length = length; + Action = action; + Argument = argument; } + + public int CompareTo(Link otherLink) => Index > otherLink.Index ? 1 : -1; } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 66d2347f47..5c26e3acab 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -134,7 +134,7 @@ namespace osu.Game }); } - internal void LoadMultiplayerLobby(int lobbyId) + internal void JoinMultiplayerMatch(int matchId) { notifications.Post(new SimpleNotification { diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 1481523bc9..0a88f586b5 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -139,20 +139,6 @@ namespace osu.Game.Overlays return true; } - public void ShowBeatmap(int beatmapId) - { - var req = new GetBeatmapRequest(beatmapId); - req.Success += res => - { - if (!res.OnlineBeatmapSetID.HasValue) - return; - - ShowBeatmapSet(res.OnlineBeatmapSetID.Value); - }; - - api.Queue(req); - } - public void ShowBeatmapSet(int beatmapSetId) { // todo: display the overlay while we are loading here. we need to support setting BeatmapSet to null for this to work. diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index ebfdadd553..8d2c1895bb 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -83,13 +83,13 @@ namespace osu.Game.Overlays.Chat private Message message; private OsuSpriteText username; - private OsuLinkFlowContainer contentFlow; + private ChatFlowContainer contentFlow; - public OsuTextFlowContainer ContentFlow => contentFlow; + public ChatFlowContainer ContentFlow => contentFlow; public Message Message { - get { return message; } + get => message; set { if (message == value) return; @@ -107,7 +107,6 @@ namespace osu.Game.Overlays.Chat private void load(OsuColour colours, ChatOverlay chat) { this.chat = chat; - urlColour = colours.Blue; customUsernameColour = colours.ChatBlue; } @@ -192,10 +191,16 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new OsuLinkFlowContainer(t => + contentFlow = new ChatFlowContainer(t => { if (Message.IsAction) + { t.Font = @"Exo2.0-MediumItalic"; + + if (senderHasBackground) + t.TextColour = OsuColour.FromHex(message.Sender.Colour); + } + t.TextSize = text_size; }) { @@ -205,15 +210,12 @@ namespace osu.Game.Overlays.Chat } } }; - if (message.IsAction && senderHasBackground) - contentFlow.TextColour = OsuColour.FromHex(message.Sender.Colour); updateMessageContent(); FinishTransforms(true); } private ChatOverlay chat; - private Color4 urlColour; private void updateMessageContent() { @@ -230,7 +232,7 @@ namespace osu.Game.Overlays.Chat else { int lastLinkEndIndex = 0; - List linksToRemove = new List(); + List linksToRemove = new List(); foreach (var link in message.Links) { @@ -250,10 +252,7 @@ namespace osu.Game.Overlays.Chat } } - contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, sprite => - { - ((ChatLink)sprite).TextColour = urlColour; - }); + contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, link.Action, link.Argument); } var lastLink = message.Links[message.Links.Count - 1]; diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 61e37b6e2f..86e4cba9bd 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -41,11 +41,6 @@ namespace osu.Game.Overlays private readonly FocusedTextBox textbox; - /// - /// The current OsuGame instance. Will be null for Tests. - /// - public OsuGame Game; - private APIAccess api; private const int transition_length = 500; @@ -275,11 +270,9 @@ namespace osu.Game.Overlays base.PopOut(); } - [BackgroundDependencyLoader(true)] - private void load(APIAccess api, OsuConfigManager config, OsuColour colours, OsuGame game) + [BackgroundDependencyLoader] + private void load(APIAccess api, OsuConfigManager config, OsuColour colours) { - // game will be null in testing, so some links will not work - Game = game; this.api = api; api.Register(this); diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index f1efbbc54a..a931df78af 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Profile public class ProfileHeader : Container { private readonly OsuTextFlowContainer infoTextLeft; - private readonly OsuLinkFlowContainer infoTextRight; + private readonly LinkFlowContainer infoTextRight; private readonly FillFlowContainer scoreText, scoreNumberText; private readonly RankGraph rankGraph; @@ -142,7 +142,7 @@ namespace osu.Game.Overlays.Profile ParagraphSpacing = 0.8f, LineSpacing = 0.2f }, - infoTextRight = new OsuLinkFlowContainer(t => + infoTextRight = new LinkFlowContainer(t => { t.TextSize = 14; t.Font = @"Exo2.0-RegularItalic"; @@ -473,6 +473,20 @@ namespace osu.Game.Overlays.Profile } } + private class LinkFlowContainer : OsuTextFlowContainer + { + public override bool HandleInput => true; + + public LinkFlowContainer(Action defaultCreationParameters = null) + : base(defaultCreationParameters) + { + } + + protected override SpriteText CreateSpriteText() => new OsuSpriteLink(); + + public void AddLink(string text, string url) => AddText(text, sprite => ((OsuSpriteLink)sprite).Url = url); + } + private class ProfileLink : OsuSpriteLink, IHasTooltip { public string TooltipText => "View Profile in Browser"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index d32c458ccf..37f94cf4f7 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -268,9 +268,10 @@ + + - @@ -293,7 +294,6 @@ 20171209034410_AddRulesetInfoShortName.cs - @@ -441,7 +441,6 @@ - From d032790e192a66c9ef0e72269584e0bcb9e2c7da Mon Sep 17 00:00:00 2001 From: Endrik Tombak Date: Sun, 31 Dec 2017 03:10:54 +0200 Subject: [PATCH 104/628] Doesn't allow randomizer to select invisible maps --- osu.Game/Screens/Select/BeatmapCarousel.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index b343998e11..95b025f91e 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -231,8 +231,8 @@ namespace osu.Game.Screens.Select public void SelectNextRandom() { - var visible = beatmapSets.Where(s => !s.Filtered).ToList(); - if (!visible.Any()) + var visibleSets = beatmapSets.Where(s => !s.Filtered).ToList(); + if (!visibleSets.Any()) return; if (selectedBeatmap != null) @@ -249,20 +249,21 @@ namespace osu.Game.Screens.Select if (RandomAlgorithm == RandomSelectAlgorithm.RandomPermutation) { - var notYetVisitedSets = visible.Except(previouslyVisitedRandomSets).ToList(); + var notYetVisitedSets = visibleSets.Except(previouslyVisitedRandomSets).ToList(); if (!notYetVisitedSets.Any()) { previouslyVisitedRandomSets.Clear(); - notYetVisitedSets = visible; + notYetVisitedSets = visibleSets; } set = notYetVisitedSets.ElementAt(RNG.Next(notYetVisitedSets.Count)); previouslyVisitedRandomSets.Add(set); } else - set = visible.ElementAt(RNG.Next(visible.Count)); + set = visibleSets.ElementAt(RNG.Next(visibleSets.Count)); - select(set.Beatmaps.Skip(RNG.Next(set.Beatmaps.Count())).FirstOrDefault()); + var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered).ToList(); + select(visibleBeatmaps.Skip(RNG.Next(visibleBeatmaps.Count())).FirstOrDefault()); } public void SelectPreviousRandom() From 987a6403da0744c925330f31e3efd253c11fb84c Mon Sep 17 00:00:00 2001 From: Endrik Tombak Date: Sun, 31 Dec 2017 03:25:43 +0200 Subject: [PATCH 105/628] Faster count for AppVeyor --- 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 95b025f91e..adaaddaf78 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -263,7 +263,7 @@ namespace osu.Game.Screens.Select set = visibleSets.ElementAt(RNG.Next(visibleSets.Count)); var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered).ToList(); - select(visibleBeatmaps.Skip(RNG.Next(visibleBeatmaps.Count())).FirstOrDefault()); + select(visibleBeatmaps.Skip(RNG.Next(visibleBeatmaps.Count)).FirstOrDefault()); } public void SelectPreviousRandom() From 5abf93038b1d1deeb58a77ebcf5bb2b6943c600e Mon Sep 17 00:00:00 2001 From: Endrik Tombak Date: Sun, 31 Dec 2017 14:47:27 +0200 Subject: [PATCH 106/628] Reset only visible sets for more randomized feel --- 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 adaaddaf78..b3db33401b 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -252,7 +252,7 @@ namespace osu.Game.Screens.Select var notYetVisitedSets = visibleSets.Except(previouslyVisitedRandomSets).ToList(); if (!notYetVisitedSets.Any()) { - previouslyVisitedRandomSets.Clear(); + previouslyVisitedRandomSets.RemoveAll(s => visibleSets.Contains(s)); notYetVisitedSets = visibleSets; } From 3ba5dce052224276e96ca5de1cc8c731e0f434ff Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Sun, 31 Dec 2017 11:15:14 -0500 Subject: [PATCH 107/628] new Approach to approach rate --- .../Beatmaps/OsuBeatmapProcessor.cs | 5 ++++- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 8 +++----- .../Drawables/Connections/FollowPointRenderer.cs | 8 ++++---- .../Objects/Drawables/DrawableHitCircle.cs | 6 +++--- .../Objects/Drawables/DrawableOsuHitObject.cs | 13 ++++++------- .../Objects/Drawables/DrawableSpinner.cs | 4 ++-- .../Objects/Drawables/Pieces/SliderBody.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 10 ++++++++++ osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs | 15 ++++++++------- 9 files changed, 41 insertions(+), 30 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index 31b374f71d..e8742d24a6 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -37,7 +37,6 @@ namespace osu.Game.Rulesets.Osu.Beatmaps private void applyStacking(Beatmap beatmap) { const int stack_distance = 3; - float stackThreshold = DrawableOsuHitObject.TIME_PREEMPT * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; // Reset stacking for (int i = 0; i <= beatmap.HitObjects.Count - 1; i++) @@ -58,6 +57,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps continue; double endTime = (stackBaseObject as IHasEndTime)?.EndTime ?? stackBaseObject.StartTime; + float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; if (objectN.StartTime - endTime > stackThreshold) //We are no longer within stacking range of the next object. @@ -112,6 +112,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps if (objectN is Spinner) continue; double endTime = (objectN as IHasEndTime)?.EndTime ?? objectN.StartTime; + float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; if (objectI.StartTime - endTime > stackThreshold) //We are no longer within stacking range of the previous object. @@ -165,6 +166,8 @@ namespace osu.Game.Rulesets.Osu.Beatmaps OsuHitObject objectN = beatmap.HitObjects[n]; if (objectN is Spinner) continue; + float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; + if (objectI.StartTime - objectN.StartTime > stackThreshold) //We are no longer within stacking range of the previous object. break; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 7b1f80f439..dd01ef9af7 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -36,14 +36,12 @@ namespace osu.Game.Rulesets.Osu.Mods private const double fade_in_duration_multiplier = 0.4; private const double fade_out_duration_multiplier = 0.3; - private float preEmpt => DrawableOsuHitObject.TIME_PREEMPT; - public void ApplyToDrawableHitObjects(IEnumerable drawables) { foreach (var d in drawables.OfType()) { d.ApplyCustomUpdateState += ApplyHiddenState; - d.FadeInDuration = preEmpt * fade_in_duration_multiplier; + d.FadeInDuration = d.HitObject.TimePreempt * fade_in_duration_multiplier; } } @@ -52,8 +50,8 @@ namespace osu.Game.Rulesets.Osu.Mods if (!(drawable is DrawableOsuHitObject d)) return; - var fadeOutStartTime = d.HitObject.StartTime - preEmpt + d.FadeInDuration; - var fadeOutDuration = preEmpt * fade_out_duration_multiplier; + var fadeOutStartTime = d.HitObject.StartTime - d.HitObject.TimePreempt + d.FadeInDuration; + var fadeOutDuration = d.HitObject.TimePreempt * fade_out_duration_multiplier; // new duration from completed fade in to end (before fading out) var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index fca9187047..60ee10193f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -96,12 +96,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections using (fp.BeginAbsoluteSequence(fadeInTime)) { - fp.FadeIn(DrawableOsuHitObject.TIME_FADEIN); - fp.ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, Easing.Out); + fp.FadeIn(currHitObject.TimeFadein); + fp.ScaleTo(1, currHitObject.TimeFadein, Easing.Out); - fp.MoveTo(pointEndPosition, DrawableOsuHitObject.TIME_FADEIN, Easing.Out); + fp.MoveTo(pointEndPosition, currHitObject.TimeFadein, Easing.Out); - fp.Delay(fadeOutTime - fadeInTime).FadeOut(DrawableOsuHitObject.TIME_FADEIN); + fp.Delay(fadeOutTime - fadeInTime).FadeOut(currHitObject.TimeFadein); } fp.Expire(true); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 6220bbd120..bb405ea7fd 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -88,8 +88,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdatePreemptState(); - ApproachCircle.FadeIn(Math.Min(FadeInDuration * 2, TIME_PREEMPT)); - ApproachCircle.ScaleTo(1.1f, TIME_PREEMPT); + ApproachCircle.FadeIn(Math.Min(FadeInDuration * 2, HitObject.TimePreempt)); + ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt); } protected override void UpdateCurrentState(ArmedState state) @@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables switch (state) { case ArmedState.Idle: - this.Delay(TIME_PREEMPT).FadeOut(500); + this.Delay(HitObject.TimePreempt).FadeOut(500); Expire(true); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index f5f0300ae1..1a8ec68df2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -10,26 +10,25 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableOsuHitObject : DrawableHitObject { - public const float TIME_PREEMPT = 600; - public const float TIME_FADEIN = 400; - /// /// The number of milliseconds used to fade in. /// - public virtual double FadeInDuration { get; set; } = TIME_FADEIN; + public virtual double FadeInDuration { get; set; } - public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - TIME_PREEMPT; + public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - HitObject.TimePreempt; protected DrawableOsuHitObject(OsuHitObject hitObject) : base(hitObject) { + FadeInDuration = hitObject.TimeFadein; + AccentColour = HitObject.ComboColour; Alpha = 0; } protected sealed override void UpdateState(ArmedState state) { - double transformTime = HitObject.StartTime - TIME_PREEMPT; + double transformTime = HitObject.StartTime - HitObject.TimePreempt; base.ApplyTransformsAt(transformTime, true); base.ClearTransformsAfter(transformTime, true); @@ -38,7 +37,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { UpdatePreemptState(); - using (BeginDelayedSequence(TIME_PREEMPT + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true)) + using (BeginDelayedSequence(HitObject.TimePreempt + (Judgements.FirstOrDefault()?.TimeOffset ?? 0), true)) UpdateCurrentState(state); } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 5351ad50c4..e471ad4e9b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -191,14 +191,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables base.UpdatePreemptState(); circleContainer.ScaleTo(spinner.Scale * 0.3f); - circleContainer.ScaleTo(spinner.Scale, TIME_PREEMPT / 1.4f, Easing.OutQuint); + circleContainer.ScaleTo(spinner.Scale, HitObject.TimePreempt / 1.4f, Easing.OutQuint); Disc.RotateTo(-720); symbol.RotateTo(-720); mainContainer .ScaleTo(0) - .ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, TIME_PREEMPT - 150, Easing.OutQuint) + .ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, HitObject.TimePreempt - 150, Easing.OutQuint) .Then() .ScaleTo(1, 500, Easing.OutQuint); } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 75c2c15084..4914ec07c0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces public void UpdateProgress(double progress, int repeat) { double start = 0; - double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - DrawableOsuHitObject.TIME_PREEMPT)) / DrawableOsuHitObject.TIME_FADEIN, 0, 1) : 1; + double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - slider.TimePreempt)) / slider.TimeFadein, 0, 1) : 1; if (repeat >= slider.RepeatCount - 1) { diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index a3a6527b31..0a96d6367a 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -20,6 +20,9 @@ namespace osu.Game.Rulesets.Osu.Objects private const double hit_window_100 = 80; private const double hit_window_300 = 30; + public float TimePreempt = 600; + public float TimeFadein = 400; + public Vector2 Position { get; set; } public float X => Position.X; public float Y => Position.Y; @@ -72,6 +75,13 @@ namespace osu.Game.Rulesets.Osu.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + if (difficulty.ApproachRate >= 5) + TimePreempt = 1200 - (difficulty.ApproachRate - 5) * 150; + else + TimePreempt = 1800 - difficulty.ApproachRate * 120; + TimeFadein = TimePreempt / 3; + + Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } } diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs index ba774e887f..a4c345f96c 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs @@ -9,6 +9,7 @@ using osu.Game.Rulesets.Osu.Objects.Drawables; using System; using System.Diagnostics; using osu.Framework.Graphics; +using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; @@ -133,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Replays // Do some nice easing for cursor movements if (Frames.Count > 0) { - moveToHitObject(h.StartTime, startPosition, h.Radius, easing); + moveToHitObject(h, startPosition, easing); } // Add frames to click the hitobject @@ -191,12 +192,12 @@ namespace osu.Game.Rulesets.Osu.Replays } } - private void moveToHitObject(double targetTime, Vector2 targetPos, double hitObjectRadius, Easing easing) + private void moveToHitObject(OsuHitObject h, Vector2 targetPos, Easing easing) { ReplayFrame lastFrame = Frames[Frames.Count - 1]; // Wait until Auto could "see and react" to the next note. - double waitTime = targetTime - Math.Max(0.0, DrawableOsuHitObject.TIME_PREEMPT - reactionTime); + double waitTime = h.StartTime - Math.Max(0.0, h.TimePreempt - reactionTime); if (waitTime > lastFrame.Time) { lastFrame = new ReplayFrame(waitTime, lastFrame.MouseX, lastFrame.MouseY, lastFrame.ButtonState); @@ -205,17 +206,17 @@ namespace osu.Game.Rulesets.Osu.Replays Vector2 lastPosition = lastFrame.Position; - double timeDifference = ApplyModsToTime(targetTime - lastFrame.Time); + double timeDifference = ApplyModsToTime(h.StartTime - lastFrame.Time); // Only "snap" to hitcircles if they are far enough apart. As the time between hitcircles gets shorter the snapping threshold goes up. if (timeDifference > 0 && // Sanity checks - ((lastPosition - targetPos).Length > hitObjectRadius * (1.5 + 100.0 / timeDifference) || // Either the distance is big enough + ((lastPosition - targetPos).Length > h.Radius * (1.5 + 100.0 / timeDifference) || // Either the distance is big enough timeDifference >= 266)) // ... or the beats are slow enough to tap anyway. { // Perform eased movement - for (double time = lastFrame.Time + FrameDelay; time < targetTime; time += FrameDelay) + for (double time = lastFrame.Time + FrameDelay; time < h.StartTime; time += FrameDelay) { - Vector2 currentPosition = Interpolation.ValueAt(time, lastPosition, targetPos, lastFrame.Time, targetTime, easing); + Vector2 currentPosition = Interpolation.ValueAt(time, lastPosition, targetPos, lastFrame.Time, h.StartTime, easing); AddFrameToReplay(new ReplayFrame((int)time, currentPosition.X, currentPosition.Y, lastFrame.ButtonState)); } From 064758b96d9eac2bd9be26be6ff6ea84e52594ee Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Sun, 31 Dec 2017 11:30:58 -0500 Subject: [PATCH 108/628] fixes --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs | 1 - osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 4 ++-- .../Objects/Drawables/DrawableHitCircle.cs | 2 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 9 +-------- .../Objects/Drawables/DrawableSlider.cs | 10 ++-------- .../Objects/Drawables/DrawableSpinner.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs | 2 -- 8 files changed, 8 insertions(+), 24 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index e8742d24a6..8ed6573d41 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -5,7 +5,6 @@ using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Objects; -using osu.Game.Rulesets.Osu.Objects.Drawables; namespace osu.Game.Rulesets.Osu.Beatmaps { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index dd01ef9af7..ba21cd8a10 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.Mods foreach (var d in drawables.OfType()) { d.ApplyCustomUpdateState += ApplyHiddenState; - d.FadeInDuration = d.HitObject.TimePreempt * fade_in_duration_multiplier; + d.HitObject.TimeFadein = d.HitObject.TimePreempt * (float)fade_in_duration_multiplier; } } @@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Mods if (!(drawable is DrawableOsuHitObject d)) return; - var fadeOutStartTime = d.HitObject.StartTime - d.HitObject.TimePreempt + d.FadeInDuration; + var fadeOutStartTime = d.HitObject.StartTime - d.HitObject.TimePreempt + d.HitObject.TimeFadein; var fadeOutDuration = d.HitObject.TimePreempt * fade_out_duration_multiplier; // new duration from completed fade in to end (before fading out) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index bb405ea7fd..6ecfd82e89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdatePreemptState(); - ApproachCircle.FadeIn(Math.Min(FadeInDuration * 2, HitObject.TimePreempt)); + ApproachCircle.FadeIn(Math.Min(HitObject.TimeFadein * 2, HitObject.TimePreempt)); ApproachCircle.ScaleTo(1.1f, HitObject.TimePreempt); } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index 1a8ec68df2..788ca43a0d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -10,18 +10,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableOsuHitObject : DrawableHitObject { - /// - /// The number of milliseconds used to fade in. - /// - public virtual double FadeInDuration { get; set; } - public override bool IsPresent => base.IsPresent || State.Value == ArmedState.Idle && Time.Current >= HitObject.StartTime - HitObject.TimePreempt; protected DrawableOsuHitObject(OsuHitObject hitObject) : base(hitObject) { - FadeInDuration = hitObject.TimeFadein; - AccentColour = HitObject.ComboColour; Alpha = 0; } @@ -42,7 +35,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - protected virtual void UpdatePreemptState() => this.FadeIn(FadeInDuration); + protected virtual void UpdatePreemptState() => this.FadeIn(HitObject.TimeFadein); protected virtual void UpdateCurrentState(ArmedState state) { diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 5a8bcae277..f604ca6ccd 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var tick in s.NestedHitObjects.OfType()) { var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2); + var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); var fadeOutTime = repeatStartTime + repeatDuration; var drawableTick = new DrawableSliderTick(tick) @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var repeatPoint in s.NestedHitObjects.OfType()) { var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? FadeInDuration : FadeInDuration / 2); + var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); var fadeOutTime = repeatStartTime + repeatDuration; var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) @@ -106,12 +106,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private int currentRepeat; public bool Tracking; - public override double FadeInDuration - { - get { return base.FadeInDuration; } - set { InitialCircle.FadeInDuration = base.FadeInDuration = value; } - } - protected override void Update() { base.Update(); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index e471ad4e9b..1e2ec0a112 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -167,7 +167,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { Disc.Tracking = OsuActionInputManager.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton); if (!spmCounter.IsPresent && Disc.Tracking) - spmCounter.FadeIn(FadeInDuration); + spmCounter.FadeIn(HitObject.TimeFadein); base.Update(); } diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 0a96d6367a..1c0f64322f 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = 1200 - (difficulty.ApproachRate - 5) * 150; else TimePreempt = 1800 - difficulty.ApproachRate * 120; - TimeFadein = TimePreempt / 3; + TimeFadein = TimePreempt * 0.66f; Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs index a4c345f96c..29820883e9 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs @@ -5,11 +5,9 @@ using OpenTK; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.Objects; -using osu.Game.Rulesets.Osu.Objects.Drawables; using System; using System.Diagnostics; using osu.Framework.Graphics; -using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; From 1502fde1b047580e83fbc3713615e5b744a9c9a7 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Sun, 31 Dec 2017 12:04:31 -0500 Subject: [PATCH 109/628] fix slider start circles --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index f604ca6ccd..c7034bc5be 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -58,7 +58,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Scale = s.Scale, ComboColour = s.ComboColour, Samples = s.Samples, - SampleControlPoint = s.SampleControlPoint + SampleControlPoint = s.SampleControlPoint, + TimePreempt = s.TimePreempt, + TimeFadein = s.TimeFadein }) }; From 8957d82c894e38a598dc600edf96cffc013a33f9 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 1 Jan 2018 13:54:59 +0100 Subject: [PATCH 110/628] Updated submodule osu-framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 10cae790c6..6134dafccb 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6 +Subproject commit 6134dafccb3368dac96d837537325c04b89fb8ee From 1df79c2f1b984018f4b4e7a14bdda4f85b5e45ff Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Mon, 1 Jan 2018 10:30:09 -0500 Subject: [PATCH 111/628] Move stackThreshold up where possible --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index 8ed6573d41..ed19381243 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -99,6 +99,8 @@ namespace osu.Game.Rulesets.Osu.Beatmaps OsuHitObject objectI = beatmap.HitObjects[i]; if (objectI.StackHeight != 0 || objectI is Spinner) continue; + float stackThreshold = objectI.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; + /* If this object is a hitcircle, then we enter this "special" case. * It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider. * Any other case is handled by the "is Slider" code below this. @@ -111,7 +113,6 @@ namespace osu.Game.Rulesets.Osu.Beatmaps if (objectN is Spinner) continue; double endTime = (objectN as IHasEndTime)?.EndTime ?? objectN.StartTime; - float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; if (objectI.StartTime - endTime > stackThreshold) //We are no longer within stacking range of the previous object. @@ -165,8 +166,6 @@ namespace osu.Game.Rulesets.Osu.Beatmaps OsuHitObject objectN = beatmap.HitObjects[n]; if (objectN is Spinner) continue; - float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; - if (objectI.StartTime - objectN.StartTime > stackThreshold) //We are no longer within stacking range of the previous object. break; From e0beefdfd5b81113da47d6a005156693a6e094b0 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Mon, 1 Jan 2018 10:30:55 -0500 Subject: [PATCH 112/628] make this a float --- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index ba21cd8a10..8bd3c5f92d 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; public override double ScoreMultiplier => 1.06; - private const double fade_in_duration_multiplier = 0.4; + private const float fade_in_duration_multiplier = 0.4f; private const double fade_out_duration_multiplier = 0.3; public void ApplyToDrawableHitObjects(IEnumerable drawables) @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Osu.Mods foreach (var d in drawables.OfType()) { d.ApplyCustomUpdateState += ApplyHiddenState; - d.HitObject.TimeFadein = d.HitObject.TimePreempt * (float)fade_in_duration_multiplier; + d.HitObject.TimeFadein = d.HitObject.TimePreempt * fade_in_duration_multiplier; } } From a00f92dcb459eb1354bd691b0f1e4c13151e5cc0 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 2 Jan 2018 17:18:49 +0100 Subject: [PATCH 113/628] change unnecessary cast --- osu.Game/Overlays/SocialOverlay.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index d2f56f4061..024e3aee73 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -162,15 +162,16 @@ namespace osu.Game.Overlays switch (Header.Tabs.Current.Value) { case SocialTab.OnlinePlayers: - getUsersRequest = new GetUsersRequest(); // TODO filter??? - ((GetUsersRequest)getUsersRequest).Success += response => finishRequest(response.Select(r => r.User)); + var userRequest = new GetUsersRequest(); // TODO filter??? + userRequest.Success += response => finishRequest(response.Select(r => r.User)); + api.Queue(getUsersRequest = userRequest); break; case SocialTab.OnlineFriends: - getUsersRequest = new GetFriendsRequest(); // TODO filter??? - ((GetFriendsRequest)getUsersRequest).Success += finishRequest; + var friendRequest = new GetFriendsRequest(); // TODO filter??? + friendRequest.Success += finishRequest; + api.Queue(getUsersRequest = friendRequest); break; } - api.Queue(getUsersRequest); loading.Show(); } From 313dfd4d46a9b05d72cbaab2679baebe6b3cc616 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 2 Jan 2018 17:22:12 +0100 Subject: [PATCH 114/628] remove unnecessary task + rename method --- osu.Game/Overlays/SocialOverlay.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 024e3aee73..b72fddc908 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -163,28 +163,25 @@ namespace osu.Game.Overlays { case SocialTab.OnlinePlayers: var userRequest = new GetUsersRequest(); // TODO filter??? - userRequest.Success += response => finishRequest(response.Select(r => r.User)); + userRequest.Success += response => updateUsers(response.Select(r => r.User)); api.Queue(getUsersRequest = userRequest); break; case SocialTab.OnlineFriends: var friendRequest = new GetFriendsRequest(); // TODO filter??? - friendRequest.Success += finishRequest; + friendRequest.Success += updateUsers; api.Queue(getUsersRequest = friendRequest); break; } loading.Show(); } - private void finishRequest(IEnumerable newUsers) + private void updateUsers(IEnumerable newUsers) { - Task.Run(() => + Schedule(() => { - Schedule(() => - { - Users = newUsers; - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); - loading.Hide(); - }); + Users = newUsers; + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + loading.Hide(); }); } From 52c2ba49cf32415b875f3b62f32ffd0258b7cbe8 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 2 Jan 2018 17:42:44 +0100 Subject: [PATCH 115/628] make loading indicator more visible by deleting panels preemptively --- osu.Game/Overlays/SocialOverlay.cs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index b72fddc908..d9cbdf37c8 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -93,12 +93,7 @@ namespace osu.Game.Overlays private void recreatePanels(PanelDisplayStyle displayStyle) { - if (panels != null) - { - panels.FadeOut(200); - panels.Expire(); - panels = null; - } + clearPanels(); if (Users == null) return; @@ -139,6 +134,15 @@ namespace osu.Game.Overlays }); } + private void clearPanels() + { + if (panels != null) + { + panels.Expire(); + panels = null; + } + } + private APIRequest getUsersRequest; private readonly Bindable currentQuery = new Bindable(); @@ -153,10 +157,11 @@ namespace osu.Game.Overlays return; Users = null; + clearPanels(); loading.Hide(); getUsersRequest?.Cancel(); - if (api == null || api.State == APIState.Offline) + if (api?.IsLoggedIn == false) return; switch (Header.Tabs.Current.Value) @@ -180,8 +185,8 @@ namespace osu.Game.Overlays Schedule(() => { Users = newUsers; - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); loading.Hide(); + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); }); } From 699902234b395294f36dea482568ff1c1ac3507e Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 2 Jan 2018 17:58:11 +0100 Subject: [PATCH 116/628] remove unused code --- osu.Game/Overlays/SocialOverlay.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index d9cbdf37c8..979ce2c851 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -15,9 +15,6 @@ using osu.Game.Online.API.Requests; using osu.Game.Overlays.SearchableList; using osu.Game.Overlays.Social; using osu.Game.Users; -using osu.Framework.Configuration; -using osu.Framework.Threading; -using System.Threading.Tasks; namespace osu.Game.Overlays { @@ -79,7 +76,7 @@ namespace osu.Game.Overlays // } //}; - currentQuery.BindTo(Filter.Search.Current); + //currentQuery.BindTo(Filter.Search.Current); Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); } @@ -145,13 +142,13 @@ namespace osu.Game.Overlays private APIRequest getUsersRequest; - private readonly Bindable currentQuery = new Bindable(); + //private readonly Bindable currentQuery = new Bindable(); - private ScheduledDelegate queryChangedDebounce; + //private ScheduledDelegate queryChangedDebounce; private void updateSearch() { - queryChangedDebounce?.Cancel(); + //queryChangedDebounce?.Cancel(); if (!IsLoaded) return; From c92345cf214cf42798cc6c57a7ab10ab5801bc56 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 31 Dec 2017 22:09:07 +0900 Subject: [PATCH 117/628] Give fruit a border From 31865b4d9668952551d6c14a012b563366083d13 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 15:12:27 +0900 Subject: [PATCH 118/628] Rename conflicting variable --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index 31b374f71d..6328d88758 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count; } - obj.ComboIndex = comboIndex++; + obj.IndexInCurrentCombo = comboIndex++; obj.ComboColour = beatmap.ComboColors[colourIndex]; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 72ca9b37a8..b350cd1656 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }, number = new NumberPiece { - Text = (HitObject.ComboIndex + 1).ToString(), + Text = (HitObject.IndexInCurrentCombo + 1).ToString(), }, ring = new RingPiece(), flash = new FlashPiece(), diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 5a8bcae277..6217418293 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { StartTime = s.StartTime, Position = s.StackedPosition, - ComboIndex = s.ComboIndex, + IndexInCurrentCombo = s.IndexInCurrentCombo, Scale = s.Scale, ComboColour = s.ComboColour, Samples = s.Samples, diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index a3a6527b31..5b32f4525c 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Objects public Color4 ComboColour { get; set; } = Color4.Gray; public virtual bool NewCombo { get; set; } - public int ComboIndex { get; set; } + public int IndexInCurrentCombo { get; set; } public double HitWindowFor(HitResult result) { From 02131d75d4e14cf653fef363eca677b62e86bead Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 16:31:57 +0900 Subject: [PATCH 119/628] Let fruits know what index they are in the beatmap to draw a visual representation --- .../Beatmaps/CatchBeatmapProcessor.cs | 6 ++---- osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs | 14 +++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index 9901dbde18..bed15ef74a 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps if (beatmap.ComboColors.Count == 0) return; - int comboIndex = 0; + int index = 0; int colourIndex = 0; CatchHitObject lastObj = null; @@ -31,12 +31,10 @@ namespace osu.Game.Rulesets.Catch.Beatmaps if (obj.NewCombo) { if (lastObj != null) lastObj.LastInCombo = true; - - comboIndex = 0; colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count; } - obj.ComboIndex = comboIndex++; + obj.IndexInBeatmap = index++; obj.ComboColour = beatmap.ComboColors[colourIndex]; lastObj = obj; diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index 9952e85c70..bda9f70032 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -16,7 +16,10 @@ namespace osu.Game.Rulesets.Catch.Objects public float X { get; set; } public Color4 ComboColour { get; set; } = Color4.Gray; - public int ComboIndex { get; set; } + + public int IndexInBeatmap { get; set; } + + public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4); public virtual bool NewCombo { get; set; } @@ -44,4 +47,13 @@ namespace osu.Game.Rulesets.Catch.Objects Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5; } } + + public enum FruitVisualRepresentation + { + Pear, + Grape, + Apple, + Orange, + Banana // banananananannaanana + } } From fd34b36e1a4ee837731ba462811e51f682b2d991 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 16:32:09 +0900 Subject: [PATCH 120/628] Add fruit drawable testcase --- .../Tests/TestCaseFruitObjects.cs | 65 +++++++++++++++++++ .../osu.Game.Rulesets.Catch.csproj | 1 + 2 files changed, 66 insertions(+) create mode 100644 osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs new file mode 100644 index 0000000000..45a6c1c808 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -0,0 +1,65 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Tests.Visual; +using OpenTK; + +namespace osu.Game.Rulesets.Catch.Tests +{ + public class TestCaseFruitObjects : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(CatchHitObject), + typeof(Fruit), + typeof(DrawableCatchHitObject), + typeof(DrawableFruit), + }; + + public TestCaseFruitObjects() + { + Add(new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] + { + createDrawable(0), + createDrawable(1), + }, + new Drawable[] + { + createDrawable(2), + createDrawable(3), + }, + } + }); + } + + protected override void Update() + { + base.Update(); + } + + private DrawableFruit createDrawable(int index) => new DrawableFruit(new Fruit + { + StartTime = 1000000, + IndexInBeatmap = index + }) + { + Anchor = Anchor.Centre, + RelativePositionAxes = Axes.Both, + Position = Vector2.Zero, + Alpha = 1, + LifetimeStart = double.NegativeInfinity, + LifetimeEnd = double.PositiveInfinity, + }; + } +} diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 16c909e063..b15f05bb09 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -64,6 +64,7 @@ + From cf1f84cc323d87362228a324981839677c9d9d7e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 31 Dec 2017 22:09:07 +0900 Subject: [PATCH 121/628] Give fruit a border --- .../Objects/Drawable/DrawableFruit.cs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 9f46bbd3a4..dbb0ca71cc 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -4,15 +4,19 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.MathUtils; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using OpenTK; using OpenTK.Graphics; +using System; namespace osu.Game.Rulesets.Catch.Objects.Drawable { public class DrawableFruit : DrawableCatchHitObject { + private Circle border; + public DrawableFruit(Fruit h) : base(h) { @@ -69,7 +73,25 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AccentColour = AccentColour, }, } - } + }, + border = new Circle + { + Size = new Vector2(Pulp.PULP_SIZE * 3.5f), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + BorderColour = AccentColour, + BorderThickness = 3, + Children = new Framework.Graphics.Drawable[] + { + new Box + { + AlwaysPresent = true, + Colour = AccentColour, + Alpha = 0, + RelativeSizeAxes = Axes.Both + } + } + }, }; if (HitObject.HyperDash) @@ -86,5 +108,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable }); } } + + protected override void Update() + { + base.Update(); + border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 1000, 0, 1); + } } } From 921ca6956d1ec892df11debdf31d23590540f72a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 18:26:54 +0900 Subject: [PATCH 122/628] Improve fruit visuals --- .../Objects/CatchHitObject.cs | 38 ++- .../Objects/Drawable/DrawableDroplet.cs | 4 +- .../Objects/Drawable/DrawableFruit.cs | 234 ++++++++++++++---- .../Objects/Drawable/Pieces/Pulp.cs | 11 +- .../Tests/TestCaseFruitObjects.cs | 18 +- 5 files changed, 235 insertions(+), 70 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index bda9f70032..f36459dc76 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects; @@ -15,7 +16,36 @@ namespace osu.Game.Rulesets.Catch.Objects public float X { get; set; } - public Color4 ComboColour { get; set; } = Color4.Gray; + public Color4 ComboColour + { + get + { + switch (VisualRepresentation) + { + default: + case FruitVisualRepresentation.Triforce: + return new Color4(17, 136, 170, 255); + case FruitVisualRepresentation.Grape: + return new Color4(204, 102, 0, 255); + case FruitVisualRepresentation.DPad: + return new Color4(121, 9, 13, 255); + case FruitVisualRepresentation.Pineapple: + return new Color4(102, 136, 0, 255); + case FruitVisualRepresentation.Banana: + switch (RNG.Next(0, 3)) + { + default: + return new Color4(255, 240, 0, 255); + case 1: + return new Color4(255, 192, 0, 255); + case 2: + return new Color4(214, 221, 28, 255); + } + } + } + + set { } + } public int IndexInBeatmap { get; set; } @@ -50,10 +80,10 @@ namespace osu.Game.Rulesets.Catch.Objects public enum FruitVisualRepresentation { - Pear, + Triforce, Grape, - Apple, - Orange, + DPad, + Pineapple, Banana // banananananannaanana } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs index 2b2a8e7f8d..9fdc4f9cd7 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs @@ -14,9 +14,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable : base(h) { Origin = Anchor.Centre; - - Size = new Vector2(Pulp.PULP_SIZE); - + Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS); AccentColour = h.ComboColour; Masking = false; } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index dbb0ca71cc..e1b2b23f71 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.MathUtils; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using OpenTK; using OpenTK.Graphics; -using System; namespace osu.Game.Rulesets.Catch.Objects.Drawable { @@ -22,65 +22,33 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { Origin = Anchor.Centre; - Size = new Vector2(Pulp.PULP_SIZE * 2.2f, Pulp.PULP_SIZE * 2.8f); + Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS); AccentColour = HitObject.ComboColour; Masking = false; - Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; + //Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; } [BackgroundDependencyLoader] private void load() { - Children = new Framework.Graphics.Drawable[] + Children = new[] { - //todo: share this more - new BufferedContainer - { - RelativeSizeAxes = Axes.Both, - CacheDrawnFrameBuffer = true, - Children = new Framework.Graphics.Drawable[] - { - new Pulp - { - RelativePositionAxes = Axes.Both, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - AccentColour = AccentColour, - Scale = new Vector2(0.6f), - }, - new Pulp - { - RelativePositionAxes = Axes.Both, - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - AccentColour = AccentColour, - Y = -0.08f - }, - new Pulp - { - RelativePositionAxes = Axes.Both, - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - AccentColour = AccentColour, - Y = -0.08f - }, - new Pulp - { - RelativePositionAxes = Axes.Both, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - AccentColour = AccentColour, - }, - } - }, + createPulp(HitObject.VisualRepresentation), border = new Circle { - Size = new Vector2(Pulp.PULP_SIZE * 3.5f), + EdgeEffect = new EdgeEffectParameters + { + Hollow = true, + Type = EdgeEffectType.Glow, + Radius = 4, + Colour = AccentColour.Darken(1).Opacity(0.8f) + }, + Size = new Vector2(Height * 1.5f), Anchor = Anchor.Centre, Origin = Anchor.Centre, - BorderColour = AccentColour, - BorderThickness = 3, + BorderColour = Color4.White, + BorderThickness = 2.5f, Children = new Framework.Graphics.Drawable[] { new Box @@ -104,11 +72,179 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AccentColour = Color4.Red, Blending = BlendingMode.Additive, Alpha = 0.5f, - Scale = new Vector2(2) + Scale = new Vector2(1.333f) }); } } + private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation representation) + { + const float large_pulp_3 = 13f; + const float distance_from_centre_3 = 0.23f; + + const float large_pulp_4 = large_pulp_3 * 0.925f; + const float distance_from_centre_4 = distance_from_centre_3 / 0.925f; + + const float small_pulp = large_pulp_3 / 2; + + Vector2 positionAt(float angle, float distance) => new Vector2( + distance * (float)Math.Sin(angle * Math.PI / 180), + distance * (float)Math.Cos(angle * Math.PI / 180)); + + switch (representation) + { + default: + return new Container { }; + case FruitVisualRepresentation.DPad: + return new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Framework.Graphics.Drawable[] + { + new Pulp + { + Anchor = Anchor.TopCentre, + Origin = Anchor.BottomCentre, + AccentColour = AccentColour, + Size = new Vector2(small_pulp), + Y = 0.05f, + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(0, distance_from_centre_4), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(90, distance_from_centre_4), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(180, distance_from_centre_4), + }, + new Pulp + { + Size = new Vector2(large_pulp_4), + AccentColour = AccentColour, + Position = positionAt(270, distance_from_centre_4), + }, + } + }; + case FruitVisualRepresentation.Pineapple: + return new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Framework.Graphics.Drawable[] + { + new Pulp + { + Anchor = Anchor.TopCentre, + Origin = Anchor.BottomCentre, + AccentColour = AccentColour, + Size = new Vector2(small_pulp), + Y = 0.1f, + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(45, distance_from_centre_4), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(135, distance_from_centre_4), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4), + Position = positionAt(225, distance_from_centre_4), + }, + new Pulp + { + Size = new Vector2(large_pulp_4), + AccentColour = AccentColour, + Position = positionAt(315, distance_from_centre_4), + }, + } + }; + case FruitVisualRepresentation.Triforce: + return new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Framework.Graphics.Drawable[] + { + new Pulp + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + AccentColour = AccentColour, + Size = new Vector2(small_pulp), + Y = -0.1f, + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_3), + Position = positionAt(60, distance_from_centre_3), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_3), + Position = positionAt(180, distance_from_centre_3), + }, + new Pulp + { + Size = new Vector2(large_pulp_3), + AccentColour = AccentColour, + Position = positionAt(300, distance_from_centre_3), + }, + } + }; + case FruitVisualRepresentation.Grape: + return new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Framework.Graphics.Drawable[] + { + new Pulp + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + AccentColour = AccentColour, + Size = new Vector2(small_pulp), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_3), + Position = positionAt(0, distance_from_centre_3), + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_3), + Position = positionAt(120, distance_from_centre_3), + }, + new Pulp + { + Size = new Vector2(large_pulp_3), + AccentColour = AccentColour, + Position = positionAt(240, distance_from_centre_3), + }, + } + }; + } + } + protected override void Update() { base.Update(); diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs index 2de266b3f0..22f64c61a0 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs @@ -6,18 +6,17 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; -using OpenTK; using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces { public class Pulp : Circle, IHasAccentColour { - public const float PULP_SIZE = (float)CatchHitObject.OBJECT_RADIUS / 2.2f; - public Pulp() { - Size = new Vector2(PULP_SIZE); + RelativePositionAxes = Axes.Both; + Anchor = Anchor.Centre; + Origin = Anchor.Centre; Blending = BlendingMode.Additive; Colour = Color4.White.Opacity(0.9f); @@ -34,8 +33,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, - Radius = 5, - Colour = accentColour.Lighten(100), + Radius = 8, + Colour = accentColour.Darken(0.2f).Opacity(0.75f) }; } } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index 45a6c1c808..975795863f 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using osu.Game.Tests.Visual; using OpenTK; @@ -18,8 +19,11 @@ namespace osu.Game.Rulesets.Catch.Tests { typeof(CatchHitObject), typeof(Fruit), + typeof(Droplet), typeof(DrawableCatchHitObject), typeof(DrawableFruit), + typeof(DrawableDroplet), + typeof(Pulp), }; public TestCaseFruitObjects() @@ -33,25 +37,23 @@ namespace osu.Game.Rulesets.Catch.Tests { createDrawable(0), createDrawable(1), + createDrawable(2), }, new Drawable[] { - createDrawable(2), createDrawable(3), + createDrawable(4), + createDrawable(5), }, } }); } - protected override void Update() - { - base.Update(); - } - private DrawableFruit createDrawable(int index) => new DrawableFruit(new Fruit { - StartTime = 1000000, - IndexInBeatmap = index + StartTime = 1000000000000, + IndexInBeatmap = index, + Scale = 1.5f, }) { Anchor = Anchor.Centre, From b137c3b2caa021c656e9af88b2c6d13dac26501d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 18:35:43 +0900 Subject: [PATCH 123/628] Adjust ticks size --- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs index 9fdc4f9cd7..73c91c0130 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable : base(h) { Origin = Anchor.Centre; - Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS); + Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 4; AccentColour = h.ComboColour; Masking = false; } @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Child = new Pulp { AccentColour = AccentColour, - Scale = new Vector2(0.8f), + Size = Size }; } } From bd171926d64f3eab42ae26d10d63df9ed57e0955 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Jan 2018 18:44:25 +0900 Subject: [PATCH 124/628] Remove AvailableColumns from ManiaRulesetContainer Also restructures with the addition of a ManiaBeatmap which holds definitions for "groups" of columns. At the moment these are empty save for a "Column" property, but can be expanded in the future, maybe. --- .../Beatmaps/GroupDefinition.cs | 18 ++++++ .../Beatmaps/ManiaBeatmap.cs | 33 ++++++++++ .../Beatmaps/ManiaBeatmapConverter.cs | 45 +++++++++----- .../Legacy/DistanceObjectPatternGenerator.cs | 61 +++++++++---------- .../Legacy/EndTimeObjectPatternGenerator.cs | 13 ++-- .../Legacy/HitObjectPatternGenerator.cs | 39 ++++++------ .../Patterns/Legacy/PatternGenerator.cs | 13 ++-- .../Beatmaps/Patterns/PatternGenerator.cs | 16 ++--- .../ManiaDifficultyCalculator.cs | 3 +- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 2 +- .../UI/ManiaRulesetContainer.cs | 31 ++-------- .../osu.Game.Rulesets.Mania.csproj | 2 + osu.Game/Beatmaps/BeatmapConverter.cs | 17 ++++-- 13 files changed, 167 insertions(+), 126 deletions(-) create mode 100644 osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs create mode 100644 osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs diff --git a/osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs b/osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs new file mode 100644 index 0000000000..bef8cc2a41 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs @@ -0,0 +1,18 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mania.UI; + +namespace osu.Game.Rulesets.Mania.Beatmaps +{ + /// + /// Defines properties for each grouping of s in a . + /// + public struct GroupDefinition + { + /// + /// The number of s which this grouping contains. + /// + public int Columns; + } +} diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs new file mode 100644 index 0000000000..b4f3386ff4 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -0,0 +1,33 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.UI; + +namespace osu.Game.Rulesets.Mania.Beatmaps +{ + public class ManiaBeatmap : Beatmap + { + /// + /// The definitions for each grouping in a . + /// + public readonly List Groups = new List(); + + /// + /// Total number of columns represented by all groups in this . + /// + public int TotalColumns => Groups.Sum(g => g.Columns); + + /// + /// Creates a new . + /// + /// The initial grouping of columns. + public ManiaBeatmap(GroupDefinition initialGroup) + { + Groups.Add(initialGroup); + } + } +} diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 407d4db143..d68364c05d 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -3,6 +3,7 @@ using osu.Game.Rulesets.Mania.Objects; using System; +using System.Linq; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; @@ -24,24 +25,36 @@ namespace osu.Game.Rulesets.Mania.Beatmaps protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; + public int TargetColumns; + public readonly bool IsForCurrentRuleset; + private Pattern lastPattern = new Pattern(); private FastRandom random; - private Beatmap beatmap; - private readonly int availableColumns; - private readonly bool isForCurrentRuleset; + private ManiaBeatmap beatmap; - public ManiaBeatmapConverter(bool isForCurrentRuleset, int availableColumns) + public ManiaBeatmapConverter(bool isForCurrentRuleset, Beatmap original) { - if (availableColumns <= 0) throw new ArgumentOutOfRangeException(nameof(availableColumns)); + IsForCurrentRuleset = isForCurrentRuleset; - this.isForCurrentRuleset = isForCurrentRuleset; - this.availableColumns = availableColumns; + if (isForCurrentRuleset) + TargetColumns = (int)Math.Max(1, Math.Round(original.BeatmapInfo.BaseDifficulty.CircleSize)); + else + { + float percentSliderOrSpinner = (float)original.HitObjects.Count(h => h is IHasEndTime) / original.HitObjects.Count; + if (percentSliderOrSpinner < 0.2) + TargetColumns = 7; + else if (percentSliderOrSpinner < 0.3 || Math.Round(original.BeatmapInfo.BaseDifficulty.CircleSize) >= 5) + TargetColumns = Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 5 ? 7 : 6; + else if (percentSliderOrSpinner > 0.6) + TargetColumns = Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 4 ? 5 : 4; + else + TargetColumns = Math.Max(4, Math.Min((int)Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) + 1, 7)); + } } protected override Beatmap ConvertBeatmap(Beatmap original) { - beatmap = original; BeatmapDifficulty difficulty = original.BeatmapInfo.BaseDifficulty; @@ -51,6 +64,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps return base.ConvertBeatmap(original); } + protected override Beatmap CreateBeatmap() => beatmap = new ManiaBeatmap(new GroupDefinition { Columns = TargetColumns }); + protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { var maniaOriginal = original as ManiaHitObject; @@ -60,7 +75,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps yield break; } - var objects = isForCurrentRuleset ? generateSpecific(original) : generateConverted(original); + var objects = IsForCurrentRuleset ? generateSpecific(original) : generateConverted(original); if (objects == null) yield break; @@ -96,7 +111,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// The hit objects generated. private IEnumerable generateSpecific(HitObject original) { - var generator = new SpecificBeatmapPatternGenerator(random, original, beatmap, availableColumns, lastPattern); + var generator = new SpecificBeatmapPatternGenerator(random, original, beatmap, lastPattern); Pattern newPattern = generator.Generate(); lastPattern = newPattern; @@ -120,14 +135,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps Patterns.PatternGenerator conversion = null; if (distanceData != null) - conversion = new DistanceObjectPatternGenerator(random, original, beatmap, availableColumns, lastPattern); + conversion = new DistanceObjectPatternGenerator(random, original, beatmap, lastPattern); else if (endTimeData != null) - conversion = new EndTimeObjectPatternGenerator(random, original, beatmap, availableColumns); + conversion = new EndTimeObjectPatternGenerator(random, original, beatmap); else if (positionData != null) { computeDensity(original.StartTime); - conversion = new HitObjectPatternGenerator(random, original, beatmap, availableColumns, lastPattern, lastTime, lastPosition, density, lastStair); + conversion = new HitObjectPatternGenerator(random, original, beatmap, lastPattern, lastTime, lastPosition, density, lastStair); recordNote(original.StartTime, positionData.Position); } @@ -149,8 +164,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// private class SpecificBeatmapPatternGenerator : Patterns.Legacy.PatternGenerator { - public SpecificBeatmapPatternGenerator(FastRandom random, HitObject hitObject, Beatmap beatmap, int availableColumns, Pattern previousPattern) - : base(random, hitObject, beatmap, availableColumns, previousPattern) + public SpecificBeatmapPatternGenerator(FastRandom random, HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern) + : base(random, hitObject, beatmap, previousPattern) { } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index 8251dea5f7..48a1f132c4 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Game.Audio; -using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.MathUtils; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -30,8 +29,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy private PatternType convertType; - public DistanceObjectPatternGenerator(FastRandom random, HitObject hitObject, Beatmap beatmap, int availableColumns, Pattern previousPattern) - : base(random, hitObject, beatmap, availableColumns, previousPattern) + public DistanceObjectPatternGenerator(FastRandom random, HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern) + : base(random, hitObject, beatmap, previousPattern) { convertType = PatternType.None; if (Beatmap.ControlPointInfo.EffectPointAt(hitObject.StartTime).KiaiMode) @@ -79,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (duration >= 4000) return generateNRandomNotes(HitObject.StartTime, 0.23, 0, 0); - if (segmentDuration > 400 && repeatCount < AvailableColumns - 1 - RandomStart) + if (segmentDuration > 400 && repeatCount < TotalColumns - 1 - RandomStart) return generateTiledHoldNotes(HitObject.StartTime); return generateHoldAndNormalNotes(HitObject.StartTime); @@ -87,7 +86,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (segmentDuration <= 110) { - if (PreviousPattern.ColumnWithObjects < AvailableColumns) + if (PreviousPattern.ColumnWithObjects < TotalColumns) convertType |= PatternType.ForceNotStack; else convertType &= ~PatternType.ForceNotStack; @@ -135,12 +134,12 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); - int usableColumns = AvailableColumns - RandomStart - PreviousPattern.ColumnWithObjects; - int nextColumn = Random.Next(RandomStart, AvailableColumns); + int usableColumns = TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects; + int nextColumn = Random.Next(RandomStart, TotalColumns); for (int i = 0; i < Math.Min(usableColumns, noteCount); i++) { while (pattern.ColumnHasObject(nextColumn) || PreviousPattern.ColumnHasObject(nextColumn)) //find available column - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); addToPattern(pattern, nextColumn, startTime, endTime); } @@ -148,7 +147,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy for (int i = 0; i < noteCount - usableColumns; i++) { while (pattern.ColumnHasObject(nextColumn)) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); addToPattern(pattern, nextColumn, startTime, endTime); } @@ -172,10 +171,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); - if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < AvailableColumns) + if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < TotalColumns) { while (PreviousPattern.ColumnHasObject(nextColumn)) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); } int lastColumn = nextColumn; @@ -183,7 +182,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy { addToPattern(pattern, nextColumn, startTime, startTime); while (nextColumn == lastColumn) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); lastColumn = nextColumn; startTime += segmentDuration; @@ -221,7 +220,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy // Check if we're at the borders of the stage, and invert the pattern if so if (increasing) { - if (column >= AvailableColumns - 1) + if (column >= TotalColumns - 1) { increasing = false; column--; @@ -259,8 +258,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); - bool legacy = AvailableColumns >= 4 && AvailableColumns <= 8; - int interval = Random.Next(1, AvailableColumns - (legacy ? 1 : 0)); + bool legacy = TotalColumns >= 4 && TotalColumns <= 8; + int interval = Random.Next(1, TotalColumns - (legacy ? 1 : 0)); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); for (int i = 0; i <= repeatCount; i++) @@ -268,15 +267,15 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy addToPattern(pattern, nextColumn, startTime, startTime); nextColumn += interval; - if (nextColumn >= AvailableColumns - RandomStart) - nextColumn = nextColumn - AvailableColumns - RandomStart + (legacy ? 1 : 0); + if (nextColumn >= TotalColumns - RandomStart) + nextColumn = nextColumn - TotalColumns - RandomStart + (legacy ? 1 : 0); nextColumn += RandomStart; // If we're in 2K, let's not add many consecutive doubles - if (AvailableColumns > 2) + if (TotalColumns > 2) addToPattern(pattern, nextColumn, startTime, startTime); - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); startTime += segmentDuration; } @@ -298,7 +297,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy // □ - □ □ // ■ - ■ ■ - switch (AvailableColumns) + switch (TotalColumns) { case 2: p2 = 0; @@ -351,19 +350,19 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); - int columnRepeat = Math.Min(repeatCount, AvailableColumns); + int columnRepeat = Math.Min(repeatCount, TotalColumns); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); - if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < AvailableColumns) + if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < TotalColumns) { while (PreviousPattern.ColumnHasObject(nextColumn)) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); } for (int i = 0; i < columnRepeat; i++) { while (pattern.ColumnHasObject(nextColumn)) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); addToPattern(pattern, nextColumn, startTime, endTime); startTime += segmentDuration; @@ -388,10 +387,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); int holdColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); - if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < AvailableColumns) + if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < TotalColumns) { while (PreviousPattern.ColumnHasObject(holdColumn)) - holdColumn = Random.Next(RandomStart, AvailableColumns); + holdColumn = Random.Next(RandomStart, TotalColumns); } // Create the hold note @@ -401,13 +400,13 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (ConversionDifficulty > 6.5) noteCount = GetRandomNoteCount(0.63, 0); else if (ConversionDifficulty > 4) - noteCount = GetRandomNoteCount(AvailableColumns < 6 ? 0.12 : 0.45, 0); + noteCount = GetRandomNoteCount(TotalColumns < 6 ? 0.12 : 0.45, 0); else if (ConversionDifficulty > 2.5) - noteCount = GetRandomNoteCount(AvailableColumns < 6 ? 0 : 0.24, 0); - noteCount = Math.Min(AvailableColumns - 1, noteCount); + noteCount = GetRandomNoteCount(TotalColumns < 6 ? 0 : 0.24, 0); + noteCount = Math.Min(TotalColumns - 1, noteCount); bool ignoreHead = !sampleInfoListAt(startTime).Any(s => s.Name == SampleInfo.HIT_WHISTLE || s.Name == SampleInfo.HIT_FINISH || s.Name == SampleInfo.HIT_CLAP); - int nextColumn = Random.Next(RandomStart, AvailableColumns); + int nextColumn = Random.Next(RandomStart, TotalColumns); var rowPattern = new Pattern(); for (int i = 0; i <= repeatCount; i++) @@ -417,7 +416,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy for (int j = 0; j < noteCount; j++) { while (rowPattern.ColumnHasObject(nextColumn) || nextColumn == holdColumn) - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); addToPattern(rowPattern, nextColumn, startTime, startTime); } } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs index 8e832960df..f47238d749 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.MathUtils; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -16,8 +15,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy { private readonly double endTime; - public EndTimeObjectPatternGenerator(FastRandom random, HitObject hitObject, Beatmap beatmap, int availableColumns) - : base(random, hitObject, beatmap, availableColumns, new Pattern()) + public EndTimeObjectPatternGenerator(FastRandom random, HitObject hitObject, ManiaBeatmap beatmap) + : base(random, hitObject, beatmap, new Pattern()) { var endtimeData = HitObject as IHasEndTime; @@ -30,14 +29,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy bool generateHold = endTime - HitObject.StartTime >= 100; - if (AvailableColumns == 8) + if (TotalColumns == 8) { if (HitObject.Samples.Any(s => s.Name == SampleInfo.HIT_FINISH) && endTime - HitObject.StartTime < 1000) addToPattern(pattern, 0, generateHold); else addToPattern(pattern, getNextRandomColumn(RandomStart), generateHold); } - else if (AvailableColumns > 0) + else if (TotalColumns > 0) addToPattern(pattern, getNextRandomColumn(0), generateHold); return pattern; @@ -50,10 +49,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy /// A random column after . private int getNextRandomColumn(int start) { - int nextColumn = Random.Next(start, AvailableColumns); + int nextColumn = Random.Next(start, TotalColumns); while (PreviousPattern.ColumnHasObject(nextColumn)) - nextColumn = Random.Next(start, AvailableColumns); + nextColumn = Random.Next(start, TotalColumns); return nextColumn; } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs index 077b926635..dd5959675c 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs @@ -5,7 +5,6 @@ using System; using System.Linq; using OpenTK; using osu.Game.Audio; -using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.MathUtils; using osu.Game.Rulesets.Mania.Objects; @@ -20,8 +19,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy private readonly PatternType convertType; - public HitObjectPatternGenerator(FastRandom random, HitObject hitObject, Beatmap beatmap, int availableColumns, Pattern previousPattern, double previousTime, Vector2 previousPosition, double density, PatternType lastStair) - : base(random, hitObject, beatmap, availableColumns, previousPattern) + public HitObjectPatternGenerator(FastRandom random, HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern, double previousTime, Vector2 previousPosition, double density, PatternType lastStair) + : base(random, hitObject, beatmap, previousPattern) { if (previousTime > hitObject.StartTime) throw new ArgumentOutOfRangeException(nameof(previousTime)); if (density < 0) throw new ArgumentOutOfRangeException(nameof(density)); @@ -88,23 +87,23 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy // Generate a new pattern by copying the last hit objects in reverse-column order var pattern = new Pattern(); - for (int i = RandomStart; i < AvailableColumns; i++) + for (int i = RandomStart; i < TotalColumns; i++) if (PreviousPattern.ColumnHasObject(i)) - addToPattern(pattern, RandomStart + AvailableColumns - i - 1); + addToPattern(pattern, RandomStart + TotalColumns - i - 1); return pattern; } if ((convertType & PatternType.Cycle) > 0 && PreviousPattern.HitObjects.Count() == 1 // If we convert to 7K + 1, let's not overload the special key - && (AvailableColumns != 8 || lastColumn != 0) + && (TotalColumns != 8 || lastColumn != 0) // Make sure the last column was not the centre column - && (AvailableColumns % 2 == 0 || lastColumn != AvailableColumns / 2)) + && (TotalColumns % 2 == 0 || lastColumn != TotalColumns / 2)) { // Generate a new pattern by cycling backwards (similar to Reverse but for only one hit object) var pattern = new Pattern(); - int column = RandomStart + AvailableColumns - lastColumn - 1; + int column = RandomStart + TotalColumns - lastColumn - 1; addToPattern(pattern, column); return pattern; @@ -115,7 +114,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy // Generate a new pattern by placing on the already filled columns var pattern = new Pattern(); - for (int i = RandomStart; i < AvailableColumns; i++) + for (int i = RandomStart; i < TotalColumns; i++) if (PreviousPattern.ColumnHasObject(i)) addToPattern(pattern, i); @@ -128,7 +127,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); int targetColumn = lastColumn + 1; - if (targetColumn == AvailableColumns) + if (targetColumn == TotalColumns) { targetColumn = RandomStart; StairType = PatternType.ReverseStair; @@ -146,7 +145,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy int targetColumn = lastColumn - 1; if (targetColumn == RandomStart - 1) { - targetColumn = AvailableColumns - 1; + targetColumn = TotalColumns - 1; StairType = PatternType.Stair; } @@ -206,7 +205,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy bool allowStacking = (convertType & PatternType.ForceNotStack) == 0; if (!allowStacking) - noteCount = Math.Min(noteCount, AvailableColumns - RandomStart - PreviousPattern.ColumnWithObjects); + noteCount = Math.Min(noteCount, TotalColumns - RandomStart - PreviousPattern.ColumnWithObjects); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); for (int i = 0; i < noteCount; i++) @@ -216,11 +215,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if ((convertType & PatternType.Gathered) > 0) { nextColumn++; - if (nextColumn == AvailableColumns) + if (nextColumn == TotalColumns) nextColumn = RandomStart; } else - nextColumn = Random.Next(RandomStart, AvailableColumns); + nextColumn = Random.Next(RandomStart, TotalColumns); } addToPattern(pattern, nextColumn); @@ -268,7 +267,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy bool addToCentre; int noteCount = getRandomNoteCountMirrored(centreProbability, p2, p3, out addToCentre); - int columnLimit = (AvailableColumns % 2 == 0 ? AvailableColumns : AvailableColumns - 1) / 2; + int columnLimit = (TotalColumns % 2 == 0 ? TotalColumns : TotalColumns - 1) / 2; int nextColumn = Random.Next(RandomStart, columnLimit); for (int i = 0; i < noteCount; i++) { @@ -278,11 +277,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy // Add normal note addToPattern(pattern, nextColumn); // Add mirrored note - addToPattern(pattern, RandomStart + AvailableColumns - nextColumn - 1); + addToPattern(pattern, RandomStart + TotalColumns - nextColumn - 1); } if (addToCentre) - addToPattern(pattern, AvailableColumns / 2); + addToPattern(pattern, TotalColumns / 2); if (RandomStart > 0 && hasSpecialColumn) addToPattern(pattern, 0); @@ -300,7 +299,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy /// The amount of notes to be generated. private int getRandomNoteCount(double p2, double p3, double p4, double p5) { - switch (AvailableColumns) + switch (TotalColumns) { case 2: p2 = 0; @@ -348,7 +347,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if ((convertType & PatternType.ForceNotStack) > 0) return getRandomNoteCount(p2 / 2, p2, (p2 + p3) / 2, p3); - switch (AvailableColumns) + switch (TotalColumns) { case 2: centreProbability = 0; @@ -379,7 +378,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy double centreVal = Random.NextDouble(); int noteCount = GetRandomNoteCount(p2, p3); - addToCentre = AvailableColumns % 2 != 0 && noteCount != 3 && centreVal > 1 - centreProbability; + addToCentre = TotalColumns % 2 != 0 && noteCount != 3 && centreVal > 1 - centreProbability; return noteCount; } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs index c38680c3a5..d92a036bf1 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs @@ -25,16 +25,15 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy /// protected readonly FastRandom Random; - protected PatternGenerator(FastRandom random, HitObject hitObject, Beatmap beatmap, int availableColumns, Pattern previousPattern) - : base(hitObject, beatmap, availableColumns, previousPattern) + protected PatternGenerator(FastRandom random, HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern) + : base(hitObject, beatmap, previousPattern) { if (random == null) throw new ArgumentNullException(nameof(random)); if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); - if (availableColumns <= 0) throw new ArgumentOutOfRangeException(nameof(availableColumns)); if (previousPattern == null) throw new ArgumentNullException(nameof(previousPattern)); Random = random; - RandomStart = AvailableColumns == 8 ? 1 : 0; + RandomStart = TotalColumns == 8 ? 1 : 0; } /// @@ -45,14 +44,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy /// The column. protected int GetColumn(float position, bool allowSpecial = false) { - if (allowSpecial && AvailableColumns == 8) + if (allowSpecial && TotalColumns == 8) { const float local_x_divisor = 512f / 7; return MathHelper.Clamp((int)Math.Floor(position / local_x_divisor), 0, 6) + 1; } - float localXDivisor = 512f / AvailableColumns; - return MathHelper.Clamp((int)Math.Floor(position / localXDivisor), 0, AvailableColumns - 1); + float localXDivisor = 512f / TotalColumns; + return MathHelper.Clamp((int)Math.Floor(position / localXDivisor), 0, TotalColumns - 1); } /// diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs index ef321232c8..79609ba545 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Game.Beatmaps; using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns @@ -12,11 +11,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns /// internal abstract class PatternGenerator { - /// - /// The number of columns available to create the pattern. - /// - protected readonly int AvailableColumns; - /// /// The last pattern. /// @@ -30,19 +24,21 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns /// /// The beatmap which is a part of. /// - protected readonly Beatmap Beatmap; + protected readonly ManiaBeatmap Beatmap; - protected PatternGenerator(HitObject hitObject, Beatmap beatmap, int availableColumns, Pattern previousPattern) + protected readonly int TotalColumns; + + protected PatternGenerator(HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern) { if (hitObject == null) throw new ArgumentNullException(nameof(hitObject)); if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); - if (availableColumns <= 0) throw new ArgumentOutOfRangeException(nameof(availableColumns)); if (previousPattern == null) throw new ArgumentNullException(nameof(previousPattern)); HitObject = hitObject; Beatmap = beatmap; - AvailableColumns = availableColumns; PreviousPattern = previousPattern; + + TotalColumns = Beatmap.TotalColumns; } /// diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index e0763284a6..eb0e801067 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -5,7 +5,6 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using System.Collections.Generic; -using System; namespace osu.Game.Rulesets.Mania { @@ -18,6 +17,6 @@ namespace osu.Game.Rulesets.Mania public override double Calculate(Dictionary categoryDifficulty = null) => 0; - protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new ManiaBeatmapConverter(true, (int)Math.Max(1, Math.Round(beatmap.BeatmapInfo.BaseDifficulty.CircleSize))); + protected override BeatmapConverter CreateBeatmapConverter(Beatmap beatmap) => new ManiaBeatmapConverter(true, beatmap); } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index 61e11f7610..b641eedd48 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Mania.Mods public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) { - int availableColumns = ((ManiaRulesetContainer)rulesetContainer).AvailableColumns; + int availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 61446a31b6..91ebd08838 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.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 System; using System.Collections.Generic; using System.Linq; using OpenTK; @@ -29,11 +28,7 @@ namespace osu.Game.Rulesets.Mania.UI { public class ManiaRulesetContainer : ScrollingRulesetContainer { - /// - /// The number of columns which the should display, and which - /// the beatmap converter will attempt to convert beatmaps to use. - /// - public int AvailableColumns { get; private set; } + public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; public IEnumerable BarLines; @@ -74,7 +69,7 @@ namespace osu.Game.Rulesets.Mania.UI BarLines.ForEach(Playfield.Add); } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(AvailableColumns) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.TotalColumns) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -82,27 +77,9 @@ namespace osu.Game.Rulesets.Mania.UI public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this); - public override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, AvailableColumns); + public override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Beatmap.TotalColumns); - protected override BeatmapConverter CreateBeatmapConverter() - { - if (IsForCurrentRuleset) - AvailableColumns = (int)Math.Max(1, Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.CircleSize)); - else - { - float percentSliderOrSpinner = (float)WorkingBeatmap.Beatmap.HitObjects.Count(h => h is IHasEndTime) / WorkingBeatmap.Beatmap.HitObjects.Count; - if (percentSliderOrSpinner < 0.2) - AvailableColumns = 7; - else if (percentSliderOrSpinner < 0.3 || Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.CircleSize) >= 5) - AvailableColumns = Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 5 ? 7 : 6; - else if (percentSliderOrSpinner > 0.6) - AvailableColumns = Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 4 ? 5 : 4; - else - AvailableColumns = Math.Max(4, Math.Min((int)Math.Round(WorkingBeatmap.BeatmapInfo.BaseDifficulty.OverallDifficulty) + 1, 7)); - } - - return new ManiaBeatmapConverter(IsForCurrentRuleset, AvailableColumns); - } + protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(IsForCurrentRuleset, WorkingBeatmap.Beatmap); protected override DrawableHitObject GetVisualRepresentation(ManiaHitObject h) { diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 3393774a9c..359e0c5bc2 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -48,6 +48,8 @@ + + diff --git a/osu.Game/Beatmaps/BeatmapConverter.cs b/osu.Game/Beatmaps/BeatmapConverter.cs index e087eebbfe..924d454ae2 100644 --- a/osu.Game/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Beatmaps/BeatmapConverter.cs @@ -39,12 +39,12 @@ namespace osu.Game.Beatmaps /// The converted Beatmap. protected virtual Beatmap ConvertBeatmap(Beatmap original) { - return new Beatmap - { - BeatmapInfo = original.BeatmapInfo, - ControlPointInfo = original.ControlPointInfo, - HitObjects = original.HitObjects.SelectMany(h => convert(h, original)).ToList() - }; + var beatmap = CreateBeatmap(); + beatmap.BeatmapInfo = original.BeatmapInfo; + beatmap.ControlPointInfo = original.ControlPointInfo; + beatmap.HitObjects = original.HitObjects.SelectMany(h => convert(h, original)).ToList(); + + return beatmap; } /// @@ -78,6 +78,11 @@ namespace osu.Game.Beatmaps /// protected abstract IEnumerable ValidConversionTypes { get; } + /// + /// Creates the that will be returned by this . + /// + protected virtual Beatmap CreateBeatmap() => new Beatmap(); + /// /// Performs the conversion of a hit object. /// This method is generally executed sequentially for all objects in a beatmap. From 6d253fd33ceb1e17db2f9bb54bb6487e33ef25d2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Jan 2018 18:58:43 +0900 Subject: [PATCH 125/628] Add a way to adjust the conversion process with mods --- .../Mods/IApplicableToBeatmapConverter.cs | 22 +++++++++++++++++++ osu.Game/Rulesets/UI/RulesetContainer.cs | 4 ++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 27 insertions(+) create mode 100644 osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs diff --git a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs new file mode 100644 index 0000000000..8b4aee4f38 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// Interface for a that applies changes to a . + /// + /// The type of converted . + public interface IApplicableToBeatmapConverter + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter); + } +} diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 40a37c689b..0329725392 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -176,6 +176,10 @@ namespace osu.Game.Rulesets.UI if (!converter.CanConvert(workingBeatmap.Beatmap)) throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can not be converted for the current ruleset (converter: {converter})."); + // Apply conversion adjustments before converting + foreach (var mod in Mods.OfType>()) + mod.ApplyToBeatmapConverter(converter); + // Convert the beatmap Beatmap = converter.Convert(workingBeatmap.Beatmap); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 519e214495..f87f664199 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -313,6 +313,7 @@ + From b68daaeb4be607ed72f3439ce9be3f7726ce8d87 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Jan 2018 19:13:42 +0900 Subject: [PATCH 126/628] Group -> Stage --- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs | 14 +++++++------- .../Beatmaps/ManiaBeatmapConverter.cs | 2 +- .../{GroupDefinition.cs => StageDefinition.cs} | 6 +++--- .../osu.Game.Rulesets.Mania.csproj | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) rename osu.Game.Rulesets.Mania/Beatmaps/{GroupDefinition.cs => StageDefinition.cs} (60%) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs index b4f3386ff4..b0be34dde2 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -12,22 +12,22 @@ namespace osu.Game.Rulesets.Mania.Beatmaps public class ManiaBeatmap : Beatmap { /// - /// The definitions for each grouping in a . + /// The definitions for each stage in a . /// - public readonly List Groups = new List(); + public readonly List Stages = new List(); /// - /// Total number of columns represented by all groups in this . + /// Total number of columns represented by all stages in this . /// - public int TotalColumns => Groups.Sum(g => g.Columns); + public int TotalColumns => Stages.Sum(g => g.Columns); /// /// Creates a new . /// - /// The initial grouping of columns. - public ManiaBeatmap(GroupDefinition initialGroup) + /// The initial stage. + public ManiaBeatmap(StageDefinition initialStage) { - Groups.Add(initialGroup); + Stages.Add(initialStage); } } } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index d68364c05d..755e0e7563 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps return base.ConvertBeatmap(original); } - protected override Beatmap CreateBeatmap() => beatmap = new ManiaBeatmap(new GroupDefinition { Columns = TargetColumns }); + protected override Beatmap CreateBeatmap() => beatmap = new ManiaBeatmap(new StageDefinition { Columns = TargetColumns }); protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { diff --git a/osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs b/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs similarity index 60% rename from osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs rename to osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs index bef8cc2a41..48450b51bd 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/GroupDefinition.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs @@ -6,12 +6,12 @@ using osu.Game.Rulesets.Mania.UI; namespace osu.Game.Rulesets.Mania.Beatmaps { /// - /// Defines properties for each grouping of s in a . + /// Defines properties for each stage in a . /// - public struct GroupDefinition + public struct StageDefinition { /// - /// The number of s which this grouping contains. + /// The number of s which this stage contains. /// public int Columns; } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 359e0c5bc2..e9a572835b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -48,7 +48,7 @@ - + From 4ee845fea8ea3c9113ed60868ea873e035770d13 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 18:38:29 +0900 Subject: [PATCH 127/628] Adjust border thickness and fade out rate of border --- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index e1b2b23f71..40f58fd5ea 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -42,13 +42,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Hollow = true, Type = EdgeEffectType.Glow, Radius = 4, - Colour = AccentColour.Darken(1).Opacity(0.8f) + Colour = AccentColour.Darken(1).Opacity(0.6f) }, Size = new Vector2(Height * 1.5f), Anchor = Anchor.Centre, Origin = Anchor.Centre, BorderColour = Color4.White, - BorderThickness = 2.5f, + BorderThickness = 4f, Children = new Framework.Graphics.Drawable[] { new Box @@ -248,7 +248,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected override void Update() { base.Update(); - border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 1000, 0, 1); + + border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 500, 0, 1); } } } From 9bde8d3da1055c11e67b1670f71d0fd9247da929 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 20:52:01 +0900 Subject: [PATCH 128/628] Move combo colouring to test case --- .../Objects/CatchHitObject.cs | 32 +--------- .../Tests/TestCaseFruitObjects.cs | 59 +++++++++++++++---- 2 files changed, 48 insertions(+), 43 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index f36459dc76..e5f8ad5402 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.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 osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Objects; @@ -16,36 +15,7 @@ namespace osu.Game.Rulesets.Catch.Objects public float X { get; set; } - public Color4 ComboColour - { - get - { - switch (VisualRepresentation) - { - default: - case FruitVisualRepresentation.Triforce: - return new Color4(17, 136, 170, 255); - case FruitVisualRepresentation.Grape: - return new Color4(204, 102, 0, 255); - case FruitVisualRepresentation.DPad: - return new Color4(121, 9, 13, 255); - case FruitVisualRepresentation.Pineapple: - return new Color4(102, 136, 0, 255); - case FruitVisualRepresentation.Banana: - switch (RNG.Next(0, 3)) - { - default: - return new Color4(255, 240, 0, 255); - case 1: - return new Color4(255, 192, 0, 255); - case 2: - return new Color4(214, 221, 28, 255); - } - } - } - - set { } - } + public Color4 ComboColour { get; set; } public int IndexInBeatmap { get; set; } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index 975795863f..0b7bc3b186 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -5,11 +5,13 @@ using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.MathUtils; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using osu.Game.Tests.Visual; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Tests { @@ -49,19 +51,52 @@ namespace osu.Game.Rulesets.Catch.Tests }); } - private DrawableFruit createDrawable(int index) => new DrawableFruit(new Fruit + private DrawableFruit createDrawable(int index) { - StartTime = 1000000000000, - IndexInBeatmap = index, - Scale = 1.5f, - }) + var fruit = new Fruit + { + StartTime = 1000000000000, + IndexInBeatmap = index, + Scale = 1.5f, + }; + + fruit.ComboColour = colourForRrepesentation(fruit.VisualRepresentation); + + return new DrawableFruit(fruit) + { + Anchor = Anchor.Centre, + RelativePositionAxes = Axes.Both, + Position = Vector2.Zero, + Alpha = 1, + LifetimeStart = double.NegativeInfinity, + LifetimeEnd = double.PositiveInfinity, + }; + } + + private Color4 colourForRrepesentation(FruitVisualRepresentation representation) { - Anchor = Anchor.Centre, - RelativePositionAxes = Axes.Both, - Position = Vector2.Zero, - Alpha = 1, - LifetimeStart = double.NegativeInfinity, - LifetimeEnd = double.PositiveInfinity, - }; + switch (representation) + { + default: + case FruitVisualRepresentation.Triforce: + return new Color4(17, 136, 170, 255); + case FruitVisualRepresentation.Grape: + return new Color4(204, 102, 0, 255); + case FruitVisualRepresentation.DPad: + return new Color4(121, 9, 13, 255); + case FruitVisualRepresentation.Pineapple: + return new Color4(102, 136, 0, 255); + case FruitVisualRepresentation.Banana: + switch (RNG.Next(0, 3)) + { + default: + return new Color4(255, 240, 0, 255); + case 1: + return new Color4(255, 192, 0, 255); + case 2: + return new Color4(214, 221, 28, 255); + } + } + } } } From b03cbaca7749008a639a95c30dfb56a3ead92327 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 20:52:11 +0900 Subject: [PATCH 129/628] Add back random rotation --- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 40f58fd5ea..df8ce2a43e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -7,6 +7,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.MathUtils; using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces; using OpenTK; using OpenTK.Graphics; @@ -26,7 +27,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AccentColour = HitObject.ComboColour; Masking = false; - //Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; + Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; } [BackgroundDependencyLoader] From 3c0631852108bd4a9e019c2a4d2596516fddf539 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 20:55:52 +0900 Subject: [PATCH 130/628] Improve the look of hyperdash fruit --- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index df8ce2a43e..92d38f1f60 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -40,10 +40,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { EdgeEffect = new EdgeEffectParameters { - Hollow = true, + Hollow = !HitObject.HyperDash, Type = EdgeEffectType.Glow, Radius = 4, - Colour = AccentColour.Darken(1).Opacity(0.6f) + Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f) }, Size = new Vector2(Height * 1.5f), Anchor = Anchor.Centre, @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable switch (representation) { default: - return new Container { }; + return new Container(); case FruitVisualRepresentation.DPad: return new Container { From a4d05e5102884c867385aa438abd32ba77509aab Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Jan 2018 21:26:36 +0900 Subject: [PATCH 131/628] Implement interface on ManiaKeyMod for now --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index b641eedd48..bc88f8cf18 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Mania.Mods } } - public abstract class ManiaKeyMod : Mod + public abstract class ManiaKeyMod : Mod, IApplicableToBeatmapConverter { // TODO: implement using the IApplicable interface. Haven't done so yet because KeyCount isn't even hooked up at the moment. @@ -111,6 +111,11 @@ namespace osu.Game.Rulesets.Mania.Mods public abstract int KeyCount { get; } public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier public override bool Ranked => true; + + public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) + { + throw new NotImplementedException(); + } } public class ManiaModKey1 : ManiaKeyMod From 333e1867ab195ee73c0528b2aa3805c1b316c30d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Jan 2018 20:45:32 +0900 Subject: [PATCH 132/628] Implement osu!mania keymods ScoreMultiplier not currently working - that's a more involved change that requires the aforementioned "BeatmapAttributes" changes. --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index bc88f8cf18..f43f37808c 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -8,6 +8,7 @@ using System.Linq; using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.MathUtils; using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Replays; using osu.Game.Rulesets.Mania.UI; @@ -103,10 +104,8 @@ namespace osu.Game.Rulesets.Mania.Mods } } - public abstract class ManiaKeyMod : Mod, IApplicableToBeatmapConverter + public abstract class ManiaKeyMod : Mod, IApplicableMod, IApplicableToBeatmapConverter { - // TODO: implement using the IApplicable interface. Haven't done so yet because KeyCount isn't even hooked up at the moment. - public override string ShortenedName => Name; public abstract int KeyCount { get; } public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier @@ -114,7 +113,13 @@ namespace osu.Game.Rulesets.Mania.Mods public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) { - throw new NotImplementedException(); + var mbc = (ManiaBeatmapConverter)beatmapConverter; + + // Although this can work, for now let's not allow keymods for mania-specific beatmaps + if (mbc.IsForCurrentRuleset) + return; + + mbc.TargetColumns = KeyCount; } } From 843e9c53c0cda8146b2622dafa49e6ebd738197f Mon Sep 17 00:00:00 2001 From: Endrik Tombak Date: Wed, 3 Jan 2018 15:38:43 +0200 Subject: [PATCH 133/628] Add test cases for new randomizer behaviour --- .../Visual/TestCaseBeatmapCarousel.cs | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index c09b987407..8a0bd31678 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -128,6 +128,20 @@ namespace osu.Game.Tests.Visual selectedSets.Pop(); }); + private bool selectedBeatmapVisible() + { + var currentlySelected = carousel.Items.FirstOrDefault(s => s.Item is CarouselBeatmap && s.Item.State == CarouselItemState.Selected); + if (currentlySelected == null) + return true; + return !currentlySelected.Item.Filtered; + } + + private void checkInvisibleDifficultiesUnselectable() + { + nextRandom(); + AddAssert("Selection is visible", selectedBeatmapVisible); + } + /// /// Test keyboard traversal /// @@ -222,6 +236,15 @@ namespace osu.Game.Tests.Visual nextRandom(); AddAssert("ensure repeat", () => selectedSets.Contains(carousel.SelectedBeatmapSet)); + + AddStep("Add set with 100 difficulties", () => carousel.UpdateBeatmapSet(createTestBeatmapSetWith100Difficulties(set_count + 1))); + AddStep("Filter Extra", () => carousel.Filter(new FilterCriteria { SearchText = "Extra 10" }, false)); + checkInvisibleDifficultiesUnselectable(); + checkInvisibleDifficultiesUnselectable(); + checkInvisibleDifficultiesUnselectable(); + checkInvisibleDifficultiesUnselectable(); + checkInvisibleDifficultiesUnselectable(); + AddStep("Un-filter", () => carousel.Filter(new FilterCriteria(), false)); } /// @@ -384,6 +407,40 @@ namespace osu.Game.Tests.Visual }; } + private BeatmapSetInfo createTestBeatmapSetWith100Difficulties(int i) + { + var toReturn = new BeatmapSetInfo + { + ID = i, + OnlineBeatmapSetID = i, + Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(), + Metadata = new BeatmapMetadata + { + OnlineBeatmapSetID = i, + // Create random metadata, then we can check if sorting works based on these + Artist = $"peppy{i.ToString().PadLeft(6, '0')}", + Title = $"test set #{i}!", + AuthorString = string.Concat(Enumerable.Repeat((char)('z' - Math.Min(25, i - 1)), 5)) + }, + Beatmaps = new List(), + }; + for (int b = 1; b < 101; b++) + { + toReturn.Beatmaps.Add(new BeatmapInfo + { + OnlineBeatmapID = b * 10, + Path = $"extra{b}.osu", + Version = $"Extra {b}", + StarDifficulty = 2, + BaseDifficulty = new BeatmapDifficulty + { + OverallDifficulty = 3.5f, + } + }); + } + return toReturn; + } + private class TestBeatmapCarousel : BeatmapCarousel { public new List Items => base.Items; From 5326f71ed9b776a6ab152aac5670628367102720 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Wed, 3 Jan 2018 22:58:08 +0900 Subject: [PATCH 134/628] fix some error that smoogipoo says --- .../Tests/TestCaseManiaPlayfield.cs | 14 +++- osu.Game.Rulesets.Mania/UI/Column.cs | 4 +- ...aniaColumnGroup.cs => ManiaColumnStage.cs} | 6 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 78 ++++++++----------- .../UI/ManiaRulesetContainer.cs | 7 +- .../osu.Game.Rulesets.Mania.csproj | 2 +- 6 files changed, 52 insertions(+), 59 deletions(-) rename osu.Game.Rulesets.Mania/UI/{ManiaColumnGroup.cs => ManiaColumnStage.cs} (95%) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index e9e5d98fb8..defe1a6ba6 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -2,11 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Timing; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; @@ -82,7 +84,11 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(cols, false) + var stages = new List() + { + new StageDefinition() { Columns = cols }, + }; + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -104,7 +110,11 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - inputManager.Add(playfield = new ManiaPlayfield(4,false) + var stages = new List() + { + new StageDefinition() { Columns = 4 }, + }; + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 6140452bb3..f9535bd58c 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Hit target + hit objects", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = ManiaColumnGroup.HIT_TARGET_POSITION }, + Padding = new MarginPadding { Top = ManiaColumnStage.HIT_TARGET_POSITION }, Children = new Drawable[] { new Container @@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key", RelativeSizeAxes = Axes.X, - Height = ManiaColumnGroup.HIT_TARGET_POSITION, + Height = ManiaColumnStage.HIT_TARGET_POSITION, Children = new Drawable[] { new Box diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs similarity index 95% rename from osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs rename to osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs index 1e88b240b5..c0ee3536ff 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnGroup.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs @@ -17,9 +17,9 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Mania.UI { /// - /// controls that from up to down + /// A collection of s. /// - internal class ManiaColumnGroup : ScrollingPlayfield + internal class ManiaColumnStage : ScrollingPlayfield { public const float HIT_TARGET_POSITION = 50; @@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Mania.UI public readonly int ColumnCount; - public ManiaColumnGroup(int columnCount) + public ManiaColumnStage(int columnCount) : base(Axes.Y) { ColumnCount = columnCount; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index a5c5979057..8003738562 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -8,6 +8,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables; @@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// list mania column group /// - private readonly FillFlowContainer listColumnGroup; + private readonly FillFlowContainer listColumnStages; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. @@ -33,10 +34,10 @@ namespace osu.Game.Rulesets.Mania.UI /// public SpecialColumnPosition SpecialColumnPosition { - get => listColumnGroup.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; set { - foreach (var singleGroup in listColumnGroup) + foreach (var singleGroup in listColumnStages) { singleGroup.SpecialColumnPosition = value; } @@ -48,25 +49,25 @@ namespace osu.Game.Rulesets.Mania.UI get { var list = new List(); - foreach (var single in listColumnGroup) + foreach (var stage in listColumnStages) { - list.AddRange(single.Columns); + list.AddRange(stage.Columns); } return list; } } - public ManiaPlayfield(int columnCount, bool coop) + public ManiaPlayfield(List stages) : base(Axes.Y) { - if (columnCount <= 0) + if (stages.Count <= 0) throw new ArgumentException("Can't have zero or fewer columns."); Inverted.Value = true; InternalChildren = new Drawable[] { - listColumnGroup = new FillFlowContainer + listColumnStages = new FillFlowContainer { Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, @@ -76,39 +77,27 @@ namespace osu.Game.Rulesets.Mania.UI } }; - int numberOfGroup = 1; - if (coop) - numberOfGroup = 2; - - for (int i = 0; i < numberOfGroup; i++) - { - var group = new ManiaColumnGroup(columnCount / numberOfGroup); - listColumnGroup.Add(group); - } - - - foreach (var single in listColumnGroup) - { - single.VisibleTimeRange.BindTo(VisibleTimeRange); - AddNested(single); - } - var currentAction = ManiaAction.Key1; - for (int i = 0; i < columnCount; i++) - { - var c = new Column - { - //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; - Action = currentAction++ - }; - /* - c.IsSpecial = isSpecialColumn(i); - topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); - columns.Add(c); - */ - getFallDownControlContainerByActualColumn(i).AddColumn(c); - AddNested(c); + foreach (var stage in stages) + { + var group = new ManiaColumnStage(stage.Columns); + group.VisibleTimeRange.BindTo(VisibleTimeRange); + + listColumnStages.Add(group); + AddNested(group); + + for (int i = 0; i < stage.Columns; i++) + { + var c = new Column + { + //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; + Action = currentAction++ + }; + + group.AddColumn(c); + AddNested(c); + } } Inverted.ValueChanged += invertedChanged; @@ -120,7 +109,7 @@ namespace osu.Game.Rulesets.Mania.UI Scale = new Vector2(1, newValue ? -1 : 1); //judgements.Scale = Scale; - foreach (var single in listColumnGroup) + foreach (var single in listColumnStages) { single.Judgements.Scale = Scale; } @@ -130,7 +119,7 @@ namespace osu.Game.Rulesets.Mania.UI { var maniaObject = (ManiaHitObject)judgedObject.HitObject; int column = maniaObject.Column; - Columns[maniaObject.Column].OnJudgement(judgedObject, judgement); + Columns[column].OnJudgement(judgedObject, judgement); getFallDownControlContainerByActualColumn(column).AddJudgement(judgement); } @@ -139,17 +128,16 @@ namespace osu.Game.Rulesets.Mania.UI public void Add(BarLine barline) { - //HitObjects.Add(new DrawableBarLine(barline)); - foreach (var single in listColumnGroup) + foreach (var single in listColumnStages) { single.HitObjects.Add(new DrawableBarLine(barline)); } } - private ManiaColumnGroup getFallDownControlContainerByActualColumn(int actualColumn) + private ManiaColumnStage getFallDownControlContainerByActualColumn(int actualColumn) { int sum = 0; - foreach (var single in listColumnGroup) + foreach (var single in listColumnStages) { sum = sum + single.ColumnCount; if (sum > actualColumn) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 53fd60b58f..ef611bb591 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -31,11 +31,6 @@ namespace osu.Game.Rulesets.Mania.UI { public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; - /// - /// Co-op - /// - public bool Coop { get; set; } - public IEnumerable BarLines; public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset) @@ -75,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.UI BarLines.ForEach(Playfield.Add); } - protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.TotalColumns) + protected sealed override Playfield CreatePlayfield() => new ManiaPlayfield(Beatmap.Stages) { Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index ca94a9eb7e..1a8211b719 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -94,7 +94,7 @@ - + From 1a8471bc3744c62c5f118af7faade21c13c6c13b Mon Sep 17 00:00:00 2001 From: Endrik Tombak Date: Wed, 3 Jan 2018 15:58:09 +0200 Subject: [PATCH 135/628] Replace not Filtered with Visible --- osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index 8a0bd31678..c6581c0f34 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -133,7 +133,7 @@ namespace osu.Game.Tests.Visual var currentlySelected = carousel.Items.FirstOrDefault(s => s.Item is CarouselBeatmap && s.Item.State == CarouselItemState.Selected); if (currentlySelected == null) return true; - return !currentlySelected.Item.Filtered; + return currentlySelected.Item.Visible; } private void checkInvisibleDifficultiesUnselectable() From a855a21ccbf6a054911b337e12243b1e63ca2f90 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Wed, 3 Jan 2018 23:04:51 +0900 Subject: [PATCH 136/628] group -> stage --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 8003738562..66e866af38 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mania.UI public class ManiaPlayfield : ScrollingPlayfield { /// - /// list mania column group + /// list mania column stages /// private readonly FillFlowContainer listColumnStages; @@ -37,9 +37,9 @@ namespace osu.Game.Rulesets.Mania.UI get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; set { - foreach (var singleGroup in listColumnStages) + foreach (var singleStage in listColumnStages) { - singleGroup.SpecialColumnPosition = value; + singleStage.SpecialColumnPosition = value; } } } @@ -81,11 +81,11 @@ namespace osu.Game.Rulesets.Mania.UI foreach (var stage in stages) { - var group = new ManiaColumnStage(stage.Columns); - group.VisibleTimeRange.BindTo(VisibleTimeRange); + var drawableStage = new ManiaColumnStage(stage.Columns); + drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - listColumnStages.Add(group); - AddNested(group); + listColumnStages.Add(drawableStage); + AddNested(drawableStage); for (int i = 0; i < stage.Columns; i++) { @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Mania.UI Action = currentAction++ }; - group.AddColumn(c); + drawableStage.AddColumn(c); AddNested(c); } } @@ -108,7 +108,6 @@ namespace osu.Game.Rulesets.Mania.UI { Scale = new Vector2(1, newValue ? -1 : 1); - //judgements.Scale = Scale; foreach (var single in listColumnStages) { single.Judgements.Scale = Scale; From aadafae8cbc4f4403d2d732b970f968e52659aee Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Wed, 3 Jan 2018 23:47:05 +0900 Subject: [PATCH 137/628] 1. fix TestCaseManiaHitObjects broken 2. add (4+4) (2+4+2) (1+8+1) column stages step in TestCaseManiaPlayfield --- .../Tests/TestCaseManiaHitObjects.cs | 2 +- .../Tests/TestCaseManiaPlayfield.cs | 48 ++++++++++++++++--- .../UI/ManiaRulesetContainer.cs | 1 - 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 03886f5784..48974b4bb8 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote(), ManiaAction.Key1) + new DrawableHoldNote(new HoldNote(){Duration = 1000}, ManiaAction.Key1) { Y = 5000, Height = 1000, diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index defe1a6ba6..c77a0cd2a9 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -41,6 +41,36 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right)); AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal)); AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal)); + AddStep("4 + 4 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 4 }, + new StageDefinition() { Columns = 4 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("2 + 4 + 2 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 2 }, + new StageDefinition() { Columns = 4 }, + new StageDefinition() { Columns = 2 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("1 + 1 + 8 columns", () => + { + var stages = new List() + { + new StageDefinition() { Columns = 1 }, + new StageDefinition() { Columns = 8 }, + new StageDefinition() { Columns = 1 }, + }; + createPlayfield(stages, SpecialColumnPosition.Normal); + }); + AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left)); AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right)); AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true)); @@ -78,16 +108,22 @@ namespace osu.Game.Rulesets.Mania.Tests private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false) { - Clear(); - - var inputManager = new ManiaInputManager(maniaRuleset, cols) { RelativeSizeAxes = Axes.Both }; - Add(inputManager); - - ManiaPlayfield playfield; var stages = new List() { new StageDefinition() { Columns = cols }, }; + return createPlayfield(stages, specialPos, inverted); + } + + private ManiaPlayfield createPlayfield(List stages, SpecialColumnPosition specialPos, bool inverted = false) + { + Clear(); + + var inputManager = new ManiaInputManager(maniaRuleset, stages.Sum(g => g.Columns)) { RelativeSizeAxes = Axes.Both }; + Add(inputManager); + + ManiaPlayfield playfield; + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index ef611bb591..26db5aa5b0 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -11,7 +11,6 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Beatmaps; -using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Replays; From 409664e4dc99887ff72fe6ec63ef89b4b770985b Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Wed, 3 Jan 2018 23:50:52 +0900 Subject: [PATCH 138/628] White space needs to be trimmed --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index c77a0cd2a9..37161a7d3d 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right)); AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal)); AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal)); - AddStep("4 + 4 columns", () => + AddStep("4 + 4 columns", () => { var stages = new List() { From 23f3cb646799637e4bea2fb1beaf1342baec515d Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Wed, 3 Jan 2018 10:01:28 -0500 Subject: [PATCH 139/628] address review --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 1c0f64322f..feffb1ccf2 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -75,11 +75,8 @@ namespace osu.Game.Rulesets.Osu.Objects { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - if (difficulty.ApproachRate >= 5) - TimePreempt = 1200 - (difficulty.ApproachRate - 5) * 150; - else - TimePreempt = 1800 - difficulty.ApproachRate * 120; - TimeFadein = TimePreempt * 0.66f; + TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); + TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; From 94f81a178433484be6fdd5abaa4e271808e622e6 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Wed, 3 Jan 2018 10:04:36 -0500 Subject: [PATCH 140/628] fix --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index 7ed8854665..df5cb18a02 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -190,15 +190,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { base.UpdatePreemptState(); - circleContainer.ScaleTo(spinner.Scale * 0.3f); - circleContainer.ScaleTo(spinner.Scale, HitObject.TimePreempt / 1.4f, Easing.OutQuint); + circleContainer.ScaleTo(Spinner.Scale * 0.3f); + circleContainer.ScaleTo(Spinner.Scale, HitObject.TimePreempt / 1.4f, Easing.OutQuint); Disc.RotateTo(-720); symbol.RotateTo(-720); mainContainer .ScaleTo(0) - .ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, HitObject.TimePreempt - 150, Easing.OutQuint) + .ScaleTo(Spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, HitObject.TimePreempt - 150, Easing.OutQuint) .Then() .ScaleTo(1, 500, Easing.OutQuint); } From 0e361aefebba2fc1d44d56313c7fc4b258a14756 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 17:52:11 +0100 Subject: [PATCH 141/628] added new tabs and sort criteria --- osu.Game/Overlays/Social/FilterControl.cs | 2 ++ osu.Game/Overlays/Social/Header.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index cf4097643e..a4d623892d 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -21,7 +21,9 @@ namespace osu.Game.Overlays.Social public enum SocialSortCriteria { + Relevance, Rank, + Name, //Location, //[Description("Time Zone")] //TimeZone, diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index 94368d9786..7dd8222b0b 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -18,6 +18,7 @@ namespace osu.Game.Overlays.Social protected override Color4 BackgroundColour => OsuColour.FromHex(@"38202e"); protected override float TabStripWidth => 438; + protected override SocialTab DefaultTab => SocialTab.OnlinePlayers; protected override FontAwesome Icon => FontAwesome.fa_users; @@ -53,10 +54,11 @@ namespace osu.Game.Overlays.Social public enum SocialTab { + Search, [Description("Players")] - OnlinePlayers, + OnlinePlayers = SocialSortCriteria.Rank, [Description("Friends")] - OnlineFriends, + OnlineFriends = SocialSortCriteria.Name, //[Description("Online Team Members")] //OnlineTeamMembers, //[Description("Chat Channels")] From 988f6ac90128845153b30976b84f4dd62396898a Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 17:53:50 +0100 Subject: [PATCH 142/628] fix SortDirection default to descending when retrieved data is ascending --- osu.Game.Tests/Visual/TestCaseSocial.cs | 9 +++++++++ osu.Game/Overlays/SocialOverlay.cs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs index ff0707c8ab..3f418174c7 100644 --- a/osu.Game.Tests/Visual/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/TestCaseSocial.cs @@ -1,13 +1,22 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; using osu.Game.Overlays; +using osu.Game.Overlays.Social; using osu.Game.Users; namespace osu.Game.Tests.Visual { public class TestCaseSocial : OsuTestCase { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(FilterControl), + typeof(SocialOverlay) + }; + public TestCaseSocial() { SocialOverlay s = new SocialOverlay diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 979ce2c851..a0c4c2b18f 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -204,7 +204,7 @@ namespace osu.Game.Overlays public enum SortDirection { - Descending, Ascending, + Descending } } From 9d29adce27c5501bc89afbf7e1dcc7c64dee1281 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 17:54:20 +0100 Subject: [PATCH 143/628] bring social tab+filter behaviour closer to direct --- osu.Game/Overlays/SocialOverlay.cs | 65 ++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index a0c4c2b18f..c4ed14022e 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays public class SocialOverlay : SearchableListOverlay, IOnlineComponent { private APIAccess api; - + private readonly LoadingAnimation loading; private FillFlowContainer panels; protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b"); @@ -31,10 +31,7 @@ namespace osu.Game.Overlays protected override SearchableListHeader CreateHeader() => new Header(); protected override SearchableListFilterControl CreateFilterControl() => new FilterControl(); - private readonly LoadingAnimation loading; - private IEnumerable users; - public IEnumerable Users { get { return users; } @@ -56,12 +53,38 @@ namespace osu.Game.Overlays Add(loading = new LoadingAnimation()); + Filter.Search.Current.ValueChanged += text => + { + if (text != string.Empty) + { + Header.Tabs.Current.Value = SocialTab.Search; + + if (Filter.Tabs.Current.Value == SocialSortCriteria.Rank) + Filter.Tabs.Current.Value = SocialSortCriteria.Relevance; + } + else + { + Header.Tabs.Current.Value = SocialTab.OnlinePlayers; + + if (Filter.Tabs.Current.Value == SocialSortCriteria.Relevance) + Filter.Tabs.Current.Value = SocialSortCriteria.Rank; + } + }; + Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels; // TODO sort our list in some way (either locally or with API call) - //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += rankStatus => Scheduler.AddOnce(updateSearch); + //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch); - Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch); + Header.Tabs.Current.ValueChanged += tab => + { + if (tab != SocialTab.Search) + { + //currentQuery.Value = string.Empty; + Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; + Scheduler.AddOnce(updateSearch); + } + }; //currentQuery.ValueChanged += v => //{ @@ -70,15 +93,18 @@ namespace osu.Game.Overlays // if (string.IsNullOrEmpty(v)) // Scheduler.AddOnce(updateSearch); // else - // { - // Users = null; // queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); - // } //}; //currentQuery.BindTo(Filter.Search.Current); - Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); + Filter.Tabs.Current.ValueChanged += sortCriteria => + { + if (Header.Tabs.Current.Value != SocialTab.Search && sortCriteria != (SocialSortCriteria)Header.Tabs.Current.Value) + Header.Tabs.Current.Value = SocialTab.Search; + + Scheduler.AddOnce(updateSearch); + }; } [BackgroundDependencyLoader] @@ -122,19 +148,14 @@ namespace osu.Game.Overlays }) }; - LoadComponentAsync(newPanels, p => - { - if (panels != null) - ScrollFlow.Remove(panels); - - ScrollFlow.Add(panels = newPanels); - }); + LoadComponentAsync(newPanels, p => ScrollFlow.Add(panels = newPanels)); } private void clearPanels() { if (panels != null) { + ScrollFlow.Remove(panels); panels.Expire(); panels = null; } @@ -163,16 +184,16 @@ namespace osu.Game.Overlays switch (Header.Tabs.Current.Value) { - case SocialTab.OnlinePlayers: - var userRequest = new GetUsersRequest(); // TODO filter??? - userRequest.Success += response => updateUsers(response.Select(r => r.User)); - api.Queue(getUsersRequest = userRequest); - break; case SocialTab.OnlineFriends: var friendRequest = new GetFriendsRequest(); // TODO filter??? friendRequest.Success += updateUsers; api.Queue(getUsersRequest = friendRequest); break; + default: + var userRequest = new GetUsersRequest(); // TODO filter??? + userRequest.Success += response => updateUsers(response.Select(r => r.User)); + api.Queue(getUsersRequest = userRequest); + break; } loading.Show(); } From 9b70578af621783aabe280495047d12a11021d65 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 3 Jan 2018 19:01:10 +0100 Subject: [PATCH 144/628] enabled Location as filter tab forgot it QQ --- osu.Game/Overlays/Social/FilterControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index a4d623892d..bb60aaac51 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Social Relevance, Rank, Name, - //Location, + Location, //[Description("Time Zone")] //TimeZone, //[Description("World Map")] From 5f1d360a69cae565db6783ef6402a87eb255cccb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 15:21:33 +0900 Subject: [PATCH 145/628] Fix incorrect file header --- osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index 0b7bc3b186..e7ad7135df 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; From 996a72b279f9355046b13ba836831f82633e78ca Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 15:25:12 +0900 Subject: [PATCH 146/628] Degrade yearin header --- osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index e7ad7135df..92d96e3135 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . +// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; From 5253ee5c0872dc52ddf6c579c6775b9960ee3447 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 15:34:57 +0900 Subject: [PATCH 147/628] Ignore ruleset test --- osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index 92d96e3135..c4fea5ff75 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using NUnit.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.MathUtils; @@ -15,6 +16,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Tests { + [Ignore("getting CI working")] public class TestCaseFruitObjects : OsuTestCase { public override IReadOnlyList RequiredTypes => new[] From 697efba5e2175aef9f275571c7ef9c6a25a08e40 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 15:55:35 +0900 Subject: [PATCH 148/628] Replace .OfType with .Cast --- osu.Game/Rulesets/UI/Playfield.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index b4a26344d5..5c32aeac73 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.UI public class HitObjectContainer : CompositeDrawable { - public virtual IEnumerable Objects => InternalChildren.OfType(); + public virtual IEnumerable Objects => InternalChildren.Cast(); public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject); public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject); } From d0c9d71ee79bdb0f5ef786de3eba25276aa7905a Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 4 Jan 2018 08:15:11 +0100 Subject: [PATCH 149/628] fix covers not showing in user panels --- osu.Game/Users/User.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 5c0e5f1f95..d4bdc05337 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -39,10 +39,14 @@ namespace osu.Game.Users public string AvatarUrl; [JsonProperty(@"cover_url")] - public string CoverUrl; + public string CoverUrl + { + get { return Cover?.Url; } + set { Cover = new UserCover { Url = value }; } + } - //[JsonProperty(@"cover")] - //public UserCover Cover; + [JsonProperty(@"cover")] + public UserCover Cover; public class UserCover { From 7beb4c3507b0dc13ace923c909b0325eabd2d4ca Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 16:21:15 +0900 Subject: [PATCH 150/628] Initial implementation of a new scrolling hitobject container --- .../Visual/TestCaseScrollingHitObjects.cs | 104 ++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 105 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs new file mode 100644 index 0000000000..2827f70ebe --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -0,0 +1,104 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Shapes; +using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseScrollingHitObjects : OsuTestCase + { + public TestCaseScrollingHitObjects() + { + AddStep("Vertically-scrolling", () => createPlayfield(Direction.Vertical)); + AddStep("Horizontally-scrolling", () => createPlayfield(Direction.Horizontal)); + + AddStep("Add hitobject", addHitObject); + } + + private TestPlayfield playfield; + private void createPlayfield(Direction scrollingDirection) + { + if (playfield != null) + Remove(playfield); + Add(playfield = new TestPlayfield(scrollingDirection)); + } + + private void addHitObject() + { + playfield.Add(new TestDrawableHitObject(new HitObject { StartTime = Time.Current + 5000 }) + { + Anchor = playfield.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + }); + } + + private class ScrollingHitObjectContainer : Playfield.HitObjectContainer + { + public double TimeRange = 5000; + + private readonly Direction scrollingDirection; + + public ScrollingHitObjectContainer(Direction scrollingDirection) + { + this.scrollingDirection = scrollingDirection; + + RelativeSizeAxes = Axes.Both; + } + + protected override void Update() + { + base.Update(); + + foreach (var obj in Objects) + { + var relativePosition = (Time.Current - obj.HitObject.StartTime) / TimeRange; + + // Todo: We may need to consider scale here + var finalPosition = (float)relativePosition * DrawSize; + + switch (scrollingDirection) + { + case Direction.Horizontal: + obj.X = finalPosition.X; + break; + case Direction.Vertical: + obj.Y = finalPosition.Y; + break; + } + } + } + } + + private class TestPlayfield : Playfield + { + public readonly Direction ScrollingDirection; + + public TestPlayfield(Direction scrollingDirection) + { + ScrollingDirection = scrollingDirection; + + HitObjects = new ScrollingHitObjectContainer(scrollingDirection); + } + } + + private class TestDrawableHitObject : DrawableHitObject + { + public TestDrawableHitObject(HitObject hitObject) + : base(hitObject) + { + Origin = Anchor.Centre; + AutoSizeAxes = Axes.Both; + + Add(new Box { Size = new Vector2(75) }); + } + + protected override void UpdateState(ArmedState state) + { + } + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8c04874e75..f47a03990a 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -141,6 +141,7 @@ + From f45752c652de311ae32f5a23fcbae165e928126b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 3 Jan 2018 21:31:16 +0900 Subject: [PATCH 151/628] Fix catcher's catchable width being half of what it should --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2bb0f3cd18..988ca1c36e 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -190,15 +190,15 @@ namespace osu.Game.Rulesets.Catch.UI /// Whether the catch is possible. public bool AttemptCatch(CatchHitObject fruit) { - const double relative_catcher_width = CATCHER_SIZE / 2; + double halfCatcherWidth = CATCHER_SIZE * Math.Abs(Scale.X) * 0.5f; // this stuff wil disappear once we move fruit to non-relative coordinate space in the future. var catchObjectPosition = fruit.X * CatchPlayfield.BASE_WIDTH; var catcherPosition = Position.X * CatchPlayfield.BASE_WIDTH; var validCatch = - catchObjectPosition >= catcherPosition - relative_catcher_width / 2 && - catchObjectPosition <= catcherPosition + relative_catcher_width / 2; + catchObjectPosition >= catcherPosition - halfCatcherWidth && + catchObjectPosition <= catcherPosition + halfCatcherWidth; if (validCatch && fruit.HyperDash) { From 152b846cff2089e59805ad24a8117b5582758ae0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 16:28:36 +0900 Subject: [PATCH 152/628] Fix incorrect scaling of hitobjects in catch --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 9 ++++++--- osu.Game/Rulesets/UI/Playfield.cs | 6 ++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 76dbfa77c6..c1f535ba6b 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.UI private readonly CatcherArea catcherArea; public CatchPlayfield(BeatmapDifficulty difficulty) - : base(Axes.Y) + : base(Axes.Y, BASE_WIDTH) { Container explodingFruitContainer; @@ -32,7 +32,10 @@ namespace osu.Game.Rulesets.Catch.UI Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; - InternalChildren = new Drawable[] + ScaledContent.Anchor = Anchor.BottomLeft; + ScaledContent.Origin = Anchor.BottomLeft; + + ScaledContent.AddRange(new Drawable[] { content = new Container { @@ -48,7 +51,7 @@ namespace osu.Game.Rulesets.Catch.UI Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, } - }; + }); } public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj); diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index b4a26344d5..6752bf5c29 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -110,6 +110,12 @@ namespace osu.Game.Rulesets.UI //dividing by the customwidth will effectively scale our content to the required container size. protected override Vector2 DrawScale => CustomWidth.HasValue ? new Vector2(DrawSize.X / CustomWidth.Value) : base.DrawScale; + + protected override void Update() + { + base.Update(); + RelativeChildSize = new Vector2(DrawScale.X, base.RelativeChildSize.Y); + } } } } From c8ec27c4dea1a050d964decb2322c8e29ebee6d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 16:31:41 +0900 Subject: [PATCH 153/628] Remove redundant prefix --- osu.Game/Rulesets/UI/Playfield.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 6752bf5c29..8a4cbcb49c 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.UI protected override void Update() { base.Update(); - RelativeChildSize = new Vector2(DrawScale.X, base.RelativeChildSize.Y); + RelativeChildSize = new Vector2(DrawScale.X, RelativeChildSize.Y); } } } From 2b79ad879f7df53567eec7845b89aaeea46ce076 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 16:37:48 +0900 Subject: [PATCH 154/628] Add a way to access alive hitobjects --- osu.Game/Rulesets/UI/Playfield.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 5c32aeac73..61014b5550 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -97,6 +97,8 @@ namespace osu.Game.Rulesets.UI public class HitObjectContainer : CompositeDrawable { public virtual IEnumerable Objects => InternalChildren.Cast(); + public virtual IEnumerable AliveObjects => AliveInternalChildren.Cast(); + public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject); public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject); } From b968040963a5c33ced93f7d8cdd28e8a96de77e7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 16:38:07 +0900 Subject: [PATCH 155/628] General improvements to testcase --- .../Visual/TestCaseScrollingHitObjects.cs | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 2827f70ebe..7b462b5cac 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +using System; +using System.Collections.Generic; using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; @@ -12,27 +14,36 @@ namespace osu.Game.Tests.Visual { public class TestCaseScrollingHitObjects : OsuTestCase { + public override IReadOnlyList RequiredTypes => new[] { typeof(Playfield) }; + + private List playfields = new List(); + public TestCaseScrollingHitObjects() { - AddStep("Vertically-scrolling", () => createPlayfield(Direction.Vertical)); - AddStep("Horizontally-scrolling", () => createPlayfield(Direction.Horizontal)); + playfields.Add(new TestPlayfield(Direction.Vertical)); + playfields.Add(new TestPlayfield(Direction.Horizontal)); - AddStep("Add hitobject", addHitObject); + AddRange(playfields); } - private TestPlayfield playfield; - private void createPlayfield(Direction scrollingDirection) + protected override void LoadComplete() { - if (playfield != null) - Remove(playfield); - Add(playfield = new TestPlayfield(scrollingDirection)); + base.LoadComplete(); + + for (int i = 0; i <= 5000; i += 1000) + addHitObject(Time.Current + i); + + Scheduler.AddDelayed(() => addHitObject(Time.Current + 5000), 1000, true); } - private void addHitObject() + private void addHitObject(double time) { - playfield.Add(new TestDrawableHitObject(new HitObject { StartTime = Time.Current + 5000 }) + playfields.ForEach(p => { - Anchor = playfield.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + p.Add(new TestDrawableHitObject(new HitObject { StartTime = time }) + { + Anchor = p.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + }); }); } From 210fd290e53d4b0b869c1482022b8ac02e209453 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 16:38:20 +0900 Subject: [PATCH 156/628] Use the new AliveObjects --- osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 7b462b5cac..f5b0a964a3 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -64,7 +64,7 @@ namespace osu.Game.Tests.Visual { base.Update(); - foreach (var obj in Objects) + foreach (var obj in AliveObjects) { var relativePosition = (Time.Current - obj.HitObject.StartTime) / TimeRange; From c067ee5fbe4b12dbd5d03502a3891f8a0fce5500 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 16:38:43 +0900 Subject: [PATCH 157/628] Move position calculation to UpdateAfterChildren Because we want this to occur after lifetimes have been evaluated. --- osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index f5b0a964a3..03b95042b2 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -60,9 +60,9 @@ namespace osu.Game.Tests.Visual RelativeSizeAxes = Axes.Both; } - protected override void Update() + protected override void UpdateAfterChildren() { - base.Update(); + base.UpdateAfterChildren(); foreach (var obj in AliveObjects) { From 90839e6d56f3ad6528cfb67745614b00c68e507b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 17:07:16 +0900 Subject: [PATCH 158/628] Test case improvements with TimeRange testing --- .../Visual/TestCaseScrollingHitObjects.cs | 43 +++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 03b95042b2..346ded046e 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -3,12 +3,15 @@ using System; using System.Collections.Generic; +using osu.Framework.Configuration; using OpenTK; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; +using OpenTK.Graphics; namespace osu.Game.Tests.Visual { @@ -16,14 +19,37 @@ namespace osu.Game.Tests.Visual { public override IReadOnlyList RequiredTypes => new[] { typeof(Playfield) }; - private List playfields = new List(); + private readonly List playfields = new List(); public TestCaseScrollingHitObjects() { playfields.Add(new TestPlayfield(Direction.Vertical)); playfields.Add(new TestPlayfield(Direction.Horizontal)); - AddRange(playfields); + Add(new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.85f), + Masking = true, + BorderColour = Color4.White, + BorderThickness = 2, + MaskingSmoothness = 1, + Children = new Drawable[] + { + new Box + { + Name = "Background", + RelativeSizeAxes = Axes.Both, + Alpha = 0.35f, + }, + playfields[0], + playfields[1] + } + }); + + AddSliderStep("Time range", 100, 10000, 5000, v => playfields.ForEach(p => p.TimeRange.Value = v)); } protected override void LoadComplete() @@ -49,7 +75,11 @@ namespace osu.Game.Tests.Visual private class ScrollingHitObjectContainer : Playfield.HitObjectContainer { - public double TimeRange = 5000; + public readonly BindableDouble TimeRange = new BindableDouble + { + MinValue = 0, + MaxValue = double.MaxValue + }; private readonly Direction scrollingDirection; @@ -86,13 +116,18 @@ namespace osu.Game.Tests.Visual private class TestPlayfield : Playfield { + public readonly BindableDouble TimeRange = new BindableDouble(5000); + public readonly Direction ScrollingDirection; public TestPlayfield(Direction scrollingDirection) { ScrollingDirection = scrollingDirection; - HitObjects = new ScrollingHitObjectContainer(scrollingDirection); + var scrollingHitObjects = new ScrollingHitObjectContainer(scrollingDirection); + scrollingHitObjects.TimeRange.BindTo(TimeRange); + + HitObjects = scrollingHitObjects; } } From 722cad3674051f9bae650cb1249fff4b636a83ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 17:25:51 +0900 Subject: [PATCH 159/628] Caught fruit sit behind plate --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 988ca1c36e..37970cfcdb 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -84,12 +84,12 @@ namespace osu.Game.Rulesets.Catch.UI Children = new Drawable[] { - createCatcherSprite(), caughtFruit = new Container { Anchor = Anchor.TopCentre, Origin = Anchor.BottomCentre, - } + }, + createCatcherSprite(), }; } From 5125abf68199713e9253caed0d02b4ef2a59e1a4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 17:27:17 +0900 Subject: [PATCH 160/628] Better plate alignment and stacking logic --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 37970cfcdb..5f91b75919 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Catch.UI fruit.Position = new Vector2(MovableCatcher.ToLocalSpace(absolutePosition).X - MovableCatcher.DrawSize.X / 2, 0); fruit.Anchor = Anchor.TopCentre; - fruit.Origin = Anchor.BottomCentre; + fruit.Origin = Anchor.Centre; fruit.Scale *= 0.7f; fruit.LifetimeEnd = double.MaxValue; @@ -167,12 +167,18 @@ namespace osu.Game.Rulesets.Catch.UI /// The fruit that was caught. public void Add(DrawableHitObject fruit) { - float distance = fruit.DrawSize.X / 2 * fruit.Scale.X; + float ourRadius = fruit.DrawSize.X / 2 * fruit.Scale.X; + float theirRadius = 0; - while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && Vector2Extensions.DistanceSquared(f.Position, fruit.Position) < distance * distance)) + const float allowance = 6; + + while (caughtFruit.Any(f => + f.LifetimeEnd == double.MaxValue && + Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = (f.DrawSize.X / 2 * f.Scale.X))) / (allowance / 2))) { - fruit.X += RNG.Next(-5, 5); - fruit.Y -= RNG.Next(0, 5); + float diff = (ourRadius + theirRadius) / allowance; + fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff; + fruit.Y -= RNG.NextSingle() * diff; } caughtFruit.Add(fruit); From 0bbc15d24a6ba299aa5f3785a1b508f5210b5f3c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 17:51:34 +0900 Subject: [PATCH 161/628] Clamp fruit to plate --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 5f91b75919..262ea67742 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -174,13 +174,15 @@ namespace osu.Game.Rulesets.Catch.UI while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && - Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = (f.DrawSize.X / 2 * f.Scale.X))) / (allowance / 2))) + Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2))) { float diff = (ourRadius + theirRadius) / allowance; fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff; fruit.Y -= RNG.NextSingle() * diff; } + fruit.X = MathHelper.Clamp(fruit.X, -CATCHER_SIZE / 2, CATCHER_SIZE / 2); + caughtFruit.Add(fruit); var catchObject = (CatchHitObject)fruit.HitObject; From f28053b2fcaf1f6ce01c6d5ae42bf304732c0b87 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 18:13:59 +0900 Subject: [PATCH 162/628] Drop fruit when last in combo is not caught Also cleans up judgement handling a bit --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 15 +---- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 66 +++++++++++++++----- 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 76dbfa77c6..c4458dbe9b 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.UI; -using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; @@ -63,18 +62,6 @@ namespace osu.Game.Rulesets.Catch.UI fruit.CheckPosition = CheckIfWeCanCatch; } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) - { - if (judgement.IsHit) - { - Vector2 screenPosition = judgedObject.ScreenSpaceDrawQuad.Centre; - - // todo: don't do this - (judgedObject.Parent as Container)?.Remove(judgedObject); - (judgedObject.Parent as Container)?.Remove(judgedObject); - - catcherArea.Add(judgedObject, screenPosition); - } - } + public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement); } } diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2bb0f3cd18..63405dce5e 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -12,6 +12,8 @@ using osu.Framework.Input.Bindings; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; using OpenTK.Graphics; @@ -39,17 +41,30 @@ namespace osu.Game.Rulesets.Catch.UI }; } - public void Add(DrawableHitObject fruit, Vector2 absolutePosition) + public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement) { - fruit.RelativePositionAxes = Axes.None; - fruit.Position = new Vector2(MovableCatcher.ToLocalSpace(absolutePosition).X - MovableCatcher.DrawSize.X / 2, 0); + if (judgement.IsHit) + { + var screenSpacePosition = fruit.ScreenSpaceDrawQuad.Centre; - fruit.Anchor = Anchor.TopCentre; - fruit.Origin = Anchor.BottomCentre; - fruit.Scale *= 0.7f; - fruit.LifetimeEnd = double.MaxValue; + fruit.RelativePositionAxes = Axes.None; + fruit.Position = new Vector2(MovableCatcher.ToLocalSpace(screenSpacePosition).X - MovableCatcher.DrawSize.X / 2, 0); - MovableCatcher.Add(fruit); + fruit.Anchor = Anchor.TopCentre; + fruit.Origin = Anchor.Centre; + fruit.Scale *= 0.7f; + fruit.LifetimeEnd = double.MaxValue; + + MovableCatcher.Add(fruit); + } + + if (fruit.HitObject.LastInCombo) + { + if (judgement.IsHit) + MovableCatcher.Explode(); + else + MovableCatcher.Drop(); + } } public bool AttemptCatch(CatchHitObject obj) => MovableCatcher.AttemptCatch(obj); @@ -176,11 +191,6 @@ namespace osu.Game.Rulesets.Catch.UI } caughtFruit.Add(fruit); - - var catchObject = (CatchHitObject)fruit.HitObject; - - if (catchObject.LastInCombo) - explode(); } /// @@ -309,7 +319,35 @@ namespace osu.Game.Rulesets.Catch.UI X = (float)MathHelper.Clamp(X + direction * Clock.ElapsedFrameTime * BASE_SPEED * dashModifier, 0, 1); } - private void explode() + /// + /// Drop any fruit off the plate. + /// + public void Drop() + { + var fruit = caughtFruit.ToArray(); + + foreach (var f in fruit) + { + if (ExplodingFruitTarget != null) + { + f.Anchor = Anchor.TopLeft; + f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget); + + caughtFruit.Remove(f); + + ExplodingFruitTarget.Add(f); + } + + f.MoveToY(f.Y + 75, 750, Easing.InSine); + f.FadeOut(750); + f.Expire(); + } + } + + /// + /// Explode any fruit off the plate. + /// + public void Explode() { var fruit = caughtFruit.ToArray(); From 5bd489863c19249a395c228122d281b3bdcd3408 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 18:20:23 +0900 Subject: [PATCH 163/628] Rename enum --- osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs | 4 ++-- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 4 ++-- osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index e5f8ad5402..f1df1c57f4 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -50,9 +50,9 @@ namespace osu.Game.Rulesets.Catch.Objects public enum FruitVisualRepresentation { - Triforce, + Pear, Grape, - DPad, + Raspberry, Pineapple, Banana // banananananannaanana } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 92d38f1f60..6a71a2f162 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { default: return new Container(); - case FruitVisualRepresentation.DPad: + case FruitVisualRepresentation.Raspberry: return new Container { RelativeSizeAxes = Axes.Both, @@ -176,7 +176,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable }, } }; - case FruitVisualRepresentation.Triforce: + case FruitVisualRepresentation.Pear: return new Container { RelativeSizeAxes = Axes.Both, diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index c4fea5ff75..50cb1b150c 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -80,11 +80,11 @@ namespace osu.Game.Rulesets.Catch.Tests switch (representation) { default: - case FruitVisualRepresentation.Triforce: + case FruitVisualRepresentation.Pear: return new Color4(17, 136, 170, 255); case FruitVisualRepresentation.Grape: return new Color4(204, 102, 0, 255); - case FruitVisualRepresentation.DPad: + case FruitVisualRepresentation.Raspberry: return new Color4(121, 9, 13, 255); case FruitVisualRepresentation.Pineapple: return new Color4(102, 136, 0, 255); From 22fc9601eee461eed5304dd75c2c6f32395a0394 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 18:33:57 +0900 Subject: [PATCH 164/628] Add back missing code --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 63405dce5e..c266106f58 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -47,6 +47,11 @@ namespace osu.Game.Rulesets.Catch.UI { var screenSpacePosition = fruit.ScreenSpaceDrawQuad.Centre; + // remove the fruit from its current parent. + // todo: make this less ugly, somehow. + (fruit.Parent as Container)?.Remove(fruit); + (fruit.Parent as Container)?.Remove(fruit); + fruit.RelativePositionAxes = Axes.None; fruit.Position = new Vector2(MovableCatcher.ToLocalSpace(screenSpacePosition).X - MovableCatcher.DrawSize.X / 2, 0); From 0c5ab98965558a96b80d0efcda631ae0408407dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 18:35:33 +0900 Subject: [PATCH 165/628] Make MultiplierControlPoint's StartTime variable --- osu.Game/Rulesets/Timing/MultiplierControlPoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs index 4f1a85cf2d..8b8bbae9d5 100644 --- a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs +++ b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Timing /// /// The time in milliseconds at which this starts. /// - public readonly double StartTime; + public double StartTime; /// /// The multiplier which this provides. From b11f4ab8341c7cbcb3ae28b6cf88c88e98cec0b7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 18:35:48 +0900 Subject: [PATCH 166/628] Implement control points --- .../Visual/TestCaseScrollingHitObjects.cs | 94 +++++++++++++++++-- 1 file changed, 87 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 346ded046e..d226203b3b 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -8,8 +8,10 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; +using osu.Framework.Lists; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; using OpenTK.Graphics; @@ -26,6 +28,8 @@ namespace osu.Game.Tests.Visual playfields.Add(new TestPlayfield(Direction.Vertical)); playfields.Add(new TestPlayfield(Direction.Horizontal)); + playfields.ForEach(p => p.HitObjects.ControlPoints.Add(new MultiplierControlPoint(double.MinValue))); + Add(new Container { Anchor = Anchor.Centre, @@ -50,6 +54,7 @@ namespace osu.Game.Tests.Visual }); AddSliderStep("Time range", 100, 10000, 5000, v => playfields.ForEach(p => p.TimeRange.Value = v)); + AddStep("Add control point", () => addControlPoint(Time.Current + 5000)); } protected override void LoadComplete() @@ -66,13 +71,35 @@ namespace osu.Game.Tests.Visual { playfields.ForEach(p => { - p.Add(new TestDrawableHitObject(new HitObject { StartTime = time }) + p.Add(new TestDrawableHitObject(time) { Anchor = p.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre }); }); } + private void addControlPoint(double time) + { + playfields.ForEach(p => + { + p.HitObjects.ControlPoints.AddRange(new[] + { + new MultiplierControlPoint(time) { DifficultyPoint = { SpeedMultiplier = 3 } }, + new MultiplierControlPoint(time + 2000) { DifficultyPoint = { SpeedMultiplier = 2 } }, + new MultiplierControlPoint(time + 3000) { DifficultyPoint = { SpeedMultiplier = 1 } }, + }); + + TestDrawableControlPoint createDrawablePoint(double t) => new TestDrawableControlPoint(t) + { + Anchor = p.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + }; + + p.Add(createDrawablePoint(time)); + p.Add(createDrawablePoint(time + 2000)); + p.Add(createDrawablePoint(time + 3000)); + }); + } + private class ScrollingHitObjectContainer : Playfield.HitObjectContainer { public readonly BindableDouble TimeRange = new BindableDouble @@ -81,6 +108,8 @@ namespace osu.Game.Tests.Visual MaxValue = double.MaxValue }; + public readonly SortedList ControlPoints = new SortedList(); + private readonly Direction scrollingDirection; public ScrollingHitObjectContainer(Direction scrollingDirection) @@ -94,9 +123,11 @@ namespace osu.Game.Tests.Visual { base.UpdateAfterChildren(); + var currentMultiplier = controlPointAt(Time.Current); + foreach (var obj in AliveObjects) { - var relativePosition = (Time.Current - obj.HitObject.StartTime) / TimeRange; + var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); // Todo: We may need to consider scale here var finalPosition = (float)relativePosition * DrawSize; @@ -112,6 +143,24 @@ namespace osu.Game.Tests.Visual } } } + + private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); + private MultiplierControlPoint controlPointAt(double time) + { + if (ControlPoints.Count == 0) + return new MultiplierControlPoint(double.MinValue); + + if (time < ControlPoints[0].StartTime) + return ControlPoints[0]; + + searchingPoint.StartTime = time; + + int index = ControlPoints.BinarySearch(searchingPoint); + if (index < 0) + index = ~index - 1; + + return ControlPoints[index]; + } } private class TestPlayfield : Playfield @@ -120,21 +169,52 @@ namespace osu.Game.Tests.Visual public readonly Direction ScrollingDirection; + public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; + public TestPlayfield(Direction scrollingDirection) { ScrollingDirection = scrollingDirection; - var scrollingHitObjects = new ScrollingHitObjectContainer(scrollingDirection); - scrollingHitObjects.TimeRange.BindTo(TimeRange); + base.HitObjects = new ScrollingHitObjectContainer(scrollingDirection); + HitObjects.TimeRange.BindTo(TimeRange); + } + } - HitObjects = scrollingHitObjects; + private class TestDrawableControlPoint : DrawableHitObject + { + private readonly Box box; + + public TestDrawableControlPoint(double time) + : base(new HitObject { StartTime = time }) + { + Origin = Anchor.Centre; + + Add(box = new Box + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }); + } + + protected override void Update() + { + base.Update(); + + RelativeSizeAxes = (Anchor & Anchor.x2) > 0 ? Axes.Y : Axes.X; + Size = new Vector2(1); + + box.Size = DrawSize; + } + + protected override void UpdateState(ArmedState state) + { } } private class TestDrawableHitObject : DrawableHitObject { - public TestDrawableHitObject(HitObject hitObject) - : base(hitObject) + public TestDrawableHitObject(double time) + : base(new HitObject { StartTime = time }) { Origin = Anchor.Centre; AutoSizeAxes = Axes.Both; From f34131f8f444a99e4088776a5fd107b3fd6d4f51 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 18:50:17 +0900 Subject: [PATCH 167/628] Initial game-wide replacement of scrolling playfields --- .../Drawable/DrawableCatchHitObject.cs | 5 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 4 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 1 - .../Mods/IGenerateSpeedAdjustments.cs | 23 -- .../Mods/ManiaModGravity.cs | 48 ---- .../Drawables/DrawableManiaHitObject.cs | 4 +- .../Tests/TestCaseManiaPlayfield.cs | 33 +-- .../Timing/GravityScrollingContainer.cs | 60 ----- .../Timing/ManiaSpeedAdjustmentContainer.cs | 29 --- .../Timing/ScrollingAlgorithm.cs | 17 -- osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- .../UI/ManiaRulesetContainer.cs | 4 - .../osu.Game.Rulesets.Mania.csproj | 5 - .../Objects/Drawables/DrawableBarLine.cs | 2 +- .../Drawables/DrawableTaikoHitObject.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- .../Visual/TestCaseScrollingHitObjects.cs | 66 +----- .../Visual/TestCaseScrollingPlayfield.cs | 219 ------------------ osu.Game.Tests/osu.Game.Tests.csproj | 1 - .../Drawables/DrawableScrollingHitObject.cs | 67 ------ .../Timing/LinearScrollingContainer.cs | 28 --- .../Rulesets/Timing/ScrollingContainer.cs | 93 -------- .../Timing/SpeedAdjustmentContainer.cs | 114 --------- osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 165 ++++--------- .../Rulesets/UI/ScrollingRulesetContainer.cs | 9 +- osu.Game/osu.Game.csproj | 4 - 27 files changed, 61 insertions(+), 948 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs delete mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs delete mode 100644 osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs delete mode 100644 osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs delete mode 100644 osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs delete mode 100644 osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs delete mode 100644 osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs delete mode 100644 osu.Game/Rulesets/Timing/LinearScrollingContainer.cs delete mode 100644 osu.Game/Rulesets/Timing/ScrollingContainer.cs delete mode 100644 osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index a617b65676..8954f9fe9e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -24,14 +24,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable } } - public abstract class DrawableCatchHitObject : DrawableScrollingHitObject + public abstract class DrawableCatchHitObject : DrawableHitObject { protected DrawableCatchHitObject(CatchHitObject hitObject) : base(hitObject) { - RelativePositionAxes = Axes.Both; + RelativePositionAxes = Axes.X; X = hitObject.X; - Y = (float)HitObject.StartTime; } public Func CheckPosition; diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 76dbfa77c6..322d1d91af 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -23,12 +23,10 @@ namespace osu.Game.Rulesets.Catch.UI private readonly CatcherArea catcherArea; public CatchPlayfield(BeatmapDifficulty difficulty) - : base(Axes.Y) + : base(Direction.Vertical) { Container explodingFruitContainer; - Reversed.Value = true; - Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 070c7b09d1..4765f25808 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -95,7 +95,6 @@ namespace osu.Game.Rulesets.Mania new ModCinema(), }, }, - new ManiaModGravity() }; default: diff --git a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs b/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs deleted file mode 100644 index 954ee3f481..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Collections.Generic; -using osu.Game.Rulesets.Mania.UI; -using osu.Game.Rulesets.Timing; - -namespace osu.Game.Rulesets.Mania.Mods -{ - /// - /// A type of mod which generates speed adjustments that scroll the hit objects and bar lines. - /// - internal interface IGenerateSpeedAdjustments - { - /// - /// Applies this mod to a hit renderer. - /// - /// The hit renderer to apply to. - /// The per-column list of speed adjustments for hit objects. - /// The list of speed adjustments for bar lines. - void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges); - } -} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs deleted file mode 100644 index 70270af6c9..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Collections.Generic; -using System.Linq; -using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.UI; -using osu.Game.Rulesets.Mods; -using osu.Game.Graphics; -using osu.Game.Rulesets.Mania.Timing; -using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.Mania.Objects.Drawables; - -namespace osu.Game.Rulesets.Mania.Mods -{ - public class ManiaModGravity : Mod, IGenerateSpeedAdjustments - { - public override string Name => "Gravity"; - public override string ShortenedName => "GR"; - - public override double ScoreMultiplier => 0; - - public override FontAwesome Icon => FontAwesome.fa_sort_desc; - - public void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges) - { - // We have to generate one speed adjustment per hit object for gravity - foreach (ManiaHitObject obj in rulesetContainer.Objects.OfType()) - { - MultiplierControlPoint controlPoint = rulesetContainer.CreateControlPointAt(obj.StartTime); - // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now - controlPoint.TimingPoint.BeatLength = 1000; - - hitObjectTimingChanges[obj.Column].Add(new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Gravity)); - } - - // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (DrawableBarLine barLine in rulesetContainer.BarLines) - { - var controlPoint = rulesetContainer.CreateControlPointAt(barLine.HitObject.StartTime); - // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now - controlPoint.TimingPoint.BeatLength = 1000; - - barlineTimingChanges.Add(new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Gravity)); - } - } - } -} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 6354c6ff77..385f18a4f9 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -1,13 +1,12 @@ // 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 OpenTK.Graphics; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Objects.Drawables { - public abstract class DrawableManiaHitObject : DrawableScrollingHitObject + public abstract class DrawableManiaHitObject : DrawableHitObject where TObject : ManiaHitObject { /// @@ -20,7 +19,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected DrawableManiaHitObject(TObject hitObject, ManiaAction? action = null) : base(hitObject) { - RelativePositionAxes = Axes.Y; HitObject = hitObject; if (action != null) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index b5890b289f..6615b39274 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -5,16 +5,13 @@ using System; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Rulesets.Mania.Judgements; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; -using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Timing; using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Mania.Tests @@ -44,10 +41,10 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right)); AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true)); - AddStep("Notes with input", () => createPlayfieldWithNotes(false)); - AddStep("Notes with input (reversed)", () => createPlayfieldWithNotes(false, true)); - AddStep("Notes with gravity", () => createPlayfieldWithNotes(true)); - AddStep("Notes with gravity (reversed)", () => createPlayfieldWithNotes(true, true)); + AddStep("Notes with input", () => createPlayfieldWithNotes()); + AddStep("Notes with input (reversed)", () => createPlayfieldWithNotes(true)); + AddStep("Notes with gravity", () => createPlayfieldWithNotes()); + AddStep("Notes with gravity (reversed)", () => createPlayfieldWithNotes(true)); AddStep("Hit explosion", () => { @@ -70,11 +67,6 @@ namespace osu.Game.Rulesets.Mania.Tests maniaRuleset = rulesets.GetRuleset(3); } - private SpeedAdjustmentContainer createTimingChange(double time, bool gravity) => new ManiaSpeedAdjustmentContainer(new MultiplierControlPoint(time) - { - TimingPoint = { BeatLength = 1000 } - }, gravity ? ScrollingAlgorithm.Gravity : ScrollingAlgorithm.Basic); - private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false) { Clear(); @@ -95,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.Tests return playfield; } - private void createPlayfieldWithNotes(bool gravity, bool inverted = false) + private void createPlayfieldWithNotes(bool inverted = false) { Clear(); @@ -114,23 +106,14 @@ namespace osu.Game.Rulesets.Mania.Tests playfield.Inverted.Value = inverted; - if (!gravity) - playfield.Columns.ForEach(c => c.Add(createTimingChange(0, false))); - for (double t = start_time; t <= start_time + duration; t += 100) { - if (gravity) - playfield.Columns.ElementAt(0).Add(createTimingChange(t, true)); - playfield.Add(new DrawableNote(new Note { StartTime = t, Column = 0 }, ManiaAction.Key1)); - if (gravity) - playfield.Columns.ElementAt(3).Add(createTimingChange(t, true)); - playfield.Add(new DrawableNote(new Note { StartTime = t, @@ -138,9 +121,6 @@ namespace osu.Game.Rulesets.Mania.Tests }, ManiaAction.Key4)); } - if (gravity) - playfield.Columns.ElementAt(1).Add(createTimingChange(start_time, true)); - playfield.Add(new DrawableHoldNote(new HoldNote { StartTime = start_time, @@ -148,9 +128,6 @@ namespace osu.Game.Rulesets.Mania.Tests Column = 1 }, ManiaAction.Key2)); - if (gravity) - playfield.Columns.ElementAt(2).Add(createTimingChange(start_time, true)); - playfield.Add(new DrawableHoldNote(new HoldNote { StartTime = start_time, diff --git a/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs b/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs deleted file mode 100644 index 699acc477b..0000000000 --- a/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Timing; - -namespace osu.Game.Rulesets.Mania.Timing -{ - /// - /// A that emulates a form of gravity where hit objects speed up over time. - /// - internal class GravityScrollingContainer : ScrollingContainer - { - private readonly MultiplierControlPoint controlPoint; - - public GravityScrollingContainer(MultiplierControlPoint controlPoint) - { - this.controlPoint = controlPoint; - } - - protected override void UpdateAfterChildren() - { - base.UpdateAfterChildren(); - - // The gravity-adjusted start position - float startPos = (float)computeGravityTime(controlPoint.StartTime); - // The gravity-adjusted end position - float endPos = (float)computeGravityTime(controlPoint.StartTime + RelativeChildSize.Y); - - Y = startPos; - Height = endPos - startPos; - } - - /// - /// Applies gravity to a time value based on the current time. - /// - /// The time value gravity should be applied to. - /// The time after gravity is applied to . - private double computeGravityTime(double time) - { - double relativeTime = relativeTimeAt(time); - - // The sign of the relative time, this is used to apply backwards acceleration leading into startTime - double sign = relativeTime < 0 ? -1 : 1; - - return VisibleTimeRange - acceleration * relativeTime * relativeTime * sign; - } - - /// - /// The acceleration due to "gravity" of the content of this container. - /// - private double acceleration => 1 / VisibleTimeRange; - - /// - /// Computes the current time relative to , accounting for . - /// - /// The non-offset time. - /// The current time relative to - . - private double relativeTimeAt(double time) => Time.Current - time + VisibleTimeRange; - } -} diff --git a/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs b/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs deleted file mode 100644 index 321b4ee92b..0000000000 --- a/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Timing; - -namespace osu.Game.Rulesets.Mania.Timing -{ - public class ManiaSpeedAdjustmentContainer : SpeedAdjustmentContainer - { - private readonly ScrollingAlgorithm scrollingAlgorithm; - - public ManiaSpeedAdjustmentContainer(MultiplierControlPoint timingSection, ScrollingAlgorithm scrollingAlgorithm) - : base(timingSection) - { - this.scrollingAlgorithm = scrollingAlgorithm; - } - - protected override ScrollingContainer CreateScrollingContainer() - { - switch (scrollingAlgorithm) - { - default: - return base.CreateScrollingContainer(); - case ScrollingAlgorithm.Gravity: - return new GravityScrollingContainer(ControlPoint); - } - } - } -} \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs b/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs deleted file mode 100644 index 72e096f5aa..0000000000 --- a/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Rulesets.Mania.Timing -{ - public enum ScrollingAlgorithm - { - /// - /// Basic scrolling algorithm based on the timing section time. This is the default algorithm. - /// - Basic, - /// - /// Emulating a form of gravity where hit objects speed up over time. - /// - Gravity - } -} diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 2d553f8639..048b3ef9f9 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Mania.UI private const float opacity_pressed = 0.25f; public Column() - : base(Axes.Y) + : base(Direction.Vertical) { Width = column_width; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 6c164a34f0..549b0f2ee6 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI private readonly int columnCount; public ManiaPlayfield(int columnCount) - : base(Axes.Y) + : base(Direction.Vertical) { this.columnCount = columnCount; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 61446a31b6..db9475b31e 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -17,12 +17,10 @@ using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Replays; using osu.Game.Rulesets.Mania.Scoring; -using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.UI @@ -121,8 +119,6 @@ namespace osu.Game.Rulesets.Mania.UI protected override Vector2 GetPlayfieldAspectAdjust() => new Vector2(1, 0.8f); - protected override SpeedAdjustmentContainer CreateSpeedAdjustmentContainer(MultiplierControlPoint controlPoint) => new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Basic); - protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay, this); } } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 3393774a9c..4445f24cd8 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -62,7 +62,6 @@ - @@ -88,8 +87,6 @@ - - @@ -97,9 +94,7 @@ - - diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs index b30b3a1aca..97fa91a94b 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables /// /// A line that scrolls alongside hit objects in the playfield and visualises control points. /// - public class DrawableBarLine : DrawableScrollingHitObject + public class DrawableBarLine : DrawableHitObject { /// /// The width of the line tracker. diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index cc7dd2fa0f..5cda186086 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -12,7 +12,7 @@ using System.Collections.Generic; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { - public abstract class DrawableTaikoHitObject : DrawableScrollingHitObject, IKeyBindingHandler + public abstract class DrawableTaikoHitObject : DrawableHitObject, IKeyBindingHandler where TaikoHitType : TaikoHitObject { public override Vector2 OriginPosition => new Vector2(DrawHeight / 2); diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 3fdbd056ce..5e1fa7e490 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.UI private readonly Box background; public TaikoPlayfield(ControlPointInfo controlPoints) - : base(Axes.X) + : base(Direction.Horizontal) { AddRangeInternal(new Drawable[] { diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index d226203b3b..01387791a1 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -8,7 +8,6 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Lists; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; @@ -100,68 +99,7 @@ namespace osu.Game.Tests.Visual }); } - private class ScrollingHitObjectContainer : Playfield.HitObjectContainer - { - public readonly BindableDouble TimeRange = new BindableDouble - { - MinValue = 0, - MaxValue = double.MaxValue - }; - public readonly SortedList ControlPoints = new SortedList(); - - private readonly Direction scrollingDirection; - - public ScrollingHitObjectContainer(Direction scrollingDirection) - { - this.scrollingDirection = scrollingDirection; - - RelativeSizeAxes = Axes.Both; - } - - protected override void UpdateAfterChildren() - { - base.UpdateAfterChildren(); - - var currentMultiplier = controlPointAt(Time.Current); - - foreach (var obj in AliveObjects) - { - var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); - - // Todo: We may need to consider scale here - var finalPosition = (float)relativePosition * DrawSize; - - switch (scrollingDirection) - { - case Direction.Horizontal: - obj.X = finalPosition.X; - break; - case Direction.Vertical: - obj.Y = finalPosition.Y; - break; - } - } - } - - private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); - private MultiplierControlPoint controlPointAt(double time) - { - if (ControlPoints.Count == 0) - return new MultiplierControlPoint(double.MinValue); - - if (time < ControlPoints[0].StartTime) - return ControlPoints[0]; - - searchingPoint.StartTime = time; - - int index = ControlPoints.BinarySearch(searchingPoint); - if (index < 0) - index = ~index - 1; - - return ControlPoints[index]; - } - } private class TestPlayfield : Playfield { @@ -169,13 +107,13 @@ namespace osu.Game.Tests.Visual public readonly Direction ScrollingDirection; - public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; + public new ScrollingPlayfield.ScrollingHitObjectContainer HitObjects => (ScrollingPlayfield.ScrollingHitObjectContainer)base.HitObjects; public TestPlayfield(Direction scrollingDirection) { ScrollingDirection = scrollingDirection; - base.HitObjects = new ScrollingHitObjectContainer(scrollingDirection); + base.HitObjects = new ScrollingPlayfield.ScrollingHitObjectContainer(scrollingDirection); HitObjects.TimeRange.BindTo(TimeRange); } } diff --git a/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs b/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs deleted file mode 100644 index 40fb22af1e..0000000000 --- a/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Collections.Generic; -using NUnit.Framework; -using osu.Framework.Extensions.IEnumerableExtensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.Input; -using osu.Framework.Timing; -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Objects; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.UI; -using osu.Game.Tests.Beatmaps; -using OpenTK; - -namespace osu.Game.Tests.Visual -{ - /// - /// The most minimal implementation of a playfield with scrolling hit objects. - /// - [TestFixture] - public class TestCaseScrollingPlayfield : OsuTestCase - { - public TestCaseScrollingPlayfield() - { - Clock = new FramedClock(); - - var objects = new List(); - - int time = 1500; - for (int i = 0; i < 50; i++) - { - objects.Add(new TestHitObject { StartTime = time }); - - time += 500; - } - - Beatmap b = new Beatmap - { - HitObjects = objects, - BeatmapInfo = new BeatmapInfo - { - BaseDifficulty = new BeatmapDifficulty(), - Metadata = new BeatmapMetadata() - } - }; - - WorkingBeatmap beatmap = new TestWorkingBeatmap(b); - - TestRulesetContainer horizontalRulesetContainer; - Add(horizontalRulesetContainer = new TestRulesetContainer(Axes.X, beatmap, true)); - - TestRulesetContainer verticalRulesetContainer; - Add(verticalRulesetContainer = new TestRulesetContainer(Axes.Y, beatmap, true)); - - AddStep("Reverse direction", () => - { - horizontalRulesetContainer.Playfield.Reverse(); - verticalRulesetContainer.Playfield.Reverse(); - }); - } - - [Test] - public void TestSpeedAdjustmentOrdering() - { - var hitObjectContainer = new ScrollingPlayfield.ScrollingHitObjectContainer(Axes.X); - - var speedAdjustments = new[] - { - new SpeedAdjustmentContainer(new MultiplierControlPoint()), - new SpeedAdjustmentContainer(new MultiplierControlPoint(1000) - { - TimingPoint = new TimingControlPoint { BeatLength = 500 } - }), - new SpeedAdjustmentContainer(new MultiplierControlPoint(2000) - { - TimingPoint = new TimingControlPoint { BeatLength = 1000 }, - DifficultyPoint = new DifficultyControlPoint { SpeedMultiplier = 2} - }), - new SpeedAdjustmentContainer(new MultiplierControlPoint(3000) - { - TimingPoint = new TimingControlPoint { BeatLength = 1000 }, - DifficultyPoint = new DifficultyControlPoint { SpeedMultiplier = 1} - }), - }; - - var hitObjects = new[] - { - new DrawableTestHitObject(Axes.X, new TestHitObject { StartTime = -1000 }), - new DrawableTestHitObject(Axes.X, new TestHitObject()), - new DrawableTestHitObject(Axes.X, new TestHitObject { StartTime = 1000 }), - new DrawableTestHitObject(Axes.X, new TestHitObject { StartTime = 2000 }), - new DrawableTestHitObject(Axes.X, new TestHitObject { StartTime = 3000 }), - new DrawableTestHitObject(Axes.X, new TestHitObject { StartTime = 4000 }), - }; - - hitObjects.ForEach(h => hitObjectContainer.Add(h)); - speedAdjustments.ForEach(hitObjectContainer.AddSpeedAdjustment); - - // The 0th index in hitObjectContainer.SpeedAdjustments is the "default" control point - // Check multiplier of the default speed adjustment - Assert.AreEqual(1, hitObjectContainer.SpeedAdjustments[0].ControlPoint.Multiplier); - Assert.AreEqual(1, speedAdjustments[0].ControlPoint.Multiplier); - Assert.AreEqual(2, speedAdjustments[1].ControlPoint.Multiplier); - Assert.AreEqual(2, speedAdjustments[2].ControlPoint.Multiplier); - Assert.AreEqual(1, speedAdjustments[3].ControlPoint.Multiplier); - - // Check insertion of hit objects - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[4].Contains(hitObjects[0])); - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[3].Contains(hitObjects[1])); - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[2].Contains(hitObjects[2])); - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[1].Contains(hitObjects[3])); - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[0].Contains(hitObjects[4])); - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[0].Contains(hitObjects[5])); - - hitObjectContainer.RemoveSpeedAdjustment(hitObjectContainer.SpeedAdjustments[3]); - - // The hit object contained in this speed adjustment should be resorted into the one occuring before it - - Assert.IsTrue(hitObjectContainer.SpeedAdjustments[3].Contains(hitObjects[1])); - } - - private class TestRulesetContainer : ScrollingRulesetContainer - { - private readonly Axes scrollingAxes; - - public TestRulesetContainer(Axes scrollingAxes, WorkingBeatmap beatmap, bool isForCurrentRuleset) - : base(null, beatmap, isForCurrentRuleset) - { - this.scrollingAxes = scrollingAxes; - } - - public new TestPlayfield Playfield => base.Playfield; - - public override ScoreProcessor CreateScoreProcessor() => new TestScoreProcessor(); - - public override PassThroughInputManager CreateInputManager() => new PassThroughInputManager(); - - protected override BeatmapConverter CreateBeatmapConverter() => new TestBeatmapConverter(); - - protected override Playfield CreatePlayfield() => new TestPlayfield(scrollingAxes); - - protected override DrawableHitObject GetVisualRepresentation(TestHitObject h) => new DrawableTestHitObject(scrollingAxes, h); - } - - private class TestScoreProcessor : ScoreProcessor - { - protected override void OnNewJudgement(Judgement judgement) - { - } - } - - private class TestBeatmapConverter : BeatmapConverter - { - protected override IEnumerable ValidConversionTypes => new[] { typeof(HitObject) }; - - protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) - { - yield return original as TestHitObject; - } - } - - private class DrawableTestHitObject : DrawableScrollingHitObject - { - public DrawableTestHitObject(Axes scrollingAxes, TestHitObject hitObject) - : base(hitObject) - { - Anchor = scrollingAxes == Axes.Y ? Anchor.TopCentre : Anchor.CentreLeft; - Origin = Anchor.Centre; - - AutoSizeAxes = Axes.Both; - - Add(new Circle - { - Size = new Vector2(50) - }); - } - - protected override void UpdateState(ArmedState state) - { - } - } - - private class TestPlayfield : ScrollingPlayfield - { - protected override Container Content => content; - private readonly Container content; - - public TestPlayfield(Axes scrollingAxes) - : base(scrollingAxes) - { - InternalChildren = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0.2f - }, - content = new Container { RelativeSizeAxes = Axes.Both } - }; - } - - public void Reverse() => Reversed.Toggle(); - } - - - private class TestHitObject : HitObject - { - } - } -} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index f47a03990a..2eb79f6b35 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -142,7 +142,6 @@ - diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs deleted file mode 100644 index 538bb826ad..0000000000 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs +++ /dev/null @@ -1,67 +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.Configuration; -using osu.Framework.Graphics; -using osu.Game.Rulesets.Objects.Types; - -namespace osu.Game.Rulesets.Objects.Drawables -{ - /// - /// A basic class that overrides and implements . - /// This object does not need to have its set to be able to scroll, as this will - /// will be set by the scrolling container that contains it. - /// - public abstract class DrawableScrollingHitObject : DrawableHitObject, IScrollingHitObject - where TObject : HitObject - { - public BindableDouble LifetimeOffset { get; } = new BindableDouble(); - - Axes IScrollingHitObject.ScrollingAxes - { - set - { - RelativePositionAxes |= value; - - if ((value & Axes.X) > 0) - X = (float)HitObject.StartTime; - if ((value & Axes.Y) > 0) - Y = (float)HitObject.StartTime; - } - } - - public override bool RemoveWhenNotAlive => false; - protected override bool RequiresChildrenUpdate => true; - - protected DrawableScrollingHitObject(TObject hitObject) - : base(hitObject) - { - } - - private double? lifetimeStart; - public override double LifetimeStart - { - get { return lifetimeStart ?? HitObject.StartTime - LifetimeOffset; } - set { lifetimeStart = value; } - } - - private double? lifetimeEnd; - public override double LifetimeEnd - { - get - { - var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; - return lifetimeEnd ?? endTime + LifetimeOffset; - } - set { lifetimeEnd = value; } - } - - protected override void AddNested(DrawableHitObject h) - { - var scrollingHitObject = h as IScrollingHitObject; - scrollingHitObject?.LifetimeOffset.BindTo(LifetimeOffset); - - base.AddNested(h); - } - } -} \ No newline at end of file diff --git a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs deleted file mode 100644 index b093cf3303..0000000000 --- a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs +++ /dev/null @@ -1,28 +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.Rulesets.Timing -{ - /// - /// A which scrolls linearly relative to the start time. - /// - public class LinearScrollingContainer : ScrollingContainer - { - private readonly MultiplierControlPoint controlPoint; - - public LinearScrollingContainer(MultiplierControlPoint controlPoint) - { - this.controlPoint = controlPoint; - } - - protected override void Update() - { - base.Update(); - - if ((ScrollingAxes & Axes.X) > 0) X = (float)(controlPoint.StartTime - Time.Current); - if ((ScrollingAxes & Axes.Y) > 0) Y = (float)(controlPoint.StartTime - Time.Current); - } - } -} diff --git a/osu.Game/Rulesets/Timing/ScrollingContainer.cs b/osu.Game/Rulesets/Timing/ScrollingContainer.cs deleted file mode 100644 index eac596297a..0000000000 --- a/osu.Game/Rulesets/Timing/ScrollingContainer.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 System; -using System.Linq; -using osu.Framework.Caching; -using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Rulesets.Objects.Drawables; -using OpenTK; -using osu.Game.Rulesets.Objects.Types; - -namespace osu.Game.Rulesets.Timing -{ - /// - /// A container that scrolls relative to the current time. Will autosize to the total duration of all contained hit objects along the scrolling axes. - /// - public abstract class ScrollingContainer : Container - { - /// - /// Gets or sets the range of time that is visible by the length of the scrolling axes. - /// - public readonly BindableDouble VisibleTimeRange = new BindableDouble { Default = 1000 }; - - /// - /// The axes through which this scrolls. This is set by the . - /// - internal Axes ScrollingAxes; - - public override bool RemoveWhenNotAlive => false; - protected override bool RequiresChildrenUpdate => true; - - /// - /// The control point that defines the speed adjustments for this container. This is set by the . - /// - internal MultiplierControlPoint ControlPoint; - - private Cached durationBacking; - - /// - /// Creates a new . - /// - protected ScrollingContainer() - { - RelativeSizeAxes = Axes.Both; - RelativePositionAxes = Axes.Both; - } - - protected override int Compare(Drawable x, Drawable y) - { - var hX = (DrawableHitObject)x; - var hY = (DrawableHitObject)y; - - int result = hY.HitObject.StartTime.CompareTo(hX.HitObject.StartTime); - if (result != 0) - return result; - return base.Compare(y, x); - } - - public override void Add(DrawableHitObject drawable) - { - durationBacking.Invalidate(); - base.Add(drawable); - } - - public override bool Remove(DrawableHitObject drawable) - { - durationBacking.Invalidate(); - return base.Remove(drawable); - } - - // Todo: This may underestimate the size of the hit object in some cases, but won't be too much of a problem for now - private double computeDuration() => Math.Max(0, Children.Select(c => (c.HitObject as IHasEndTime)?.EndTime ?? c.HitObject.StartTime).DefaultIfEmpty().Max() - ControlPoint.StartTime) + 1000; - - /// - /// An approximate total duration of this scrolling container. - /// - public double Duration => durationBacking.IsValid ? durationBacking : (durationBacking.Value = computeDuration()); - - protected override void Update() - { - base.Update(); - - RelativeChildOffset = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)ControlPoint.StartTime : 0, (ScrollingAxes & Axes.Y) > 0 ? (float)ControlPoint.StartTime : 0); - - // We want our size and position-space along the scrolling axes to span our duration to completely enclose all the hit objects - Size = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)Duration : Size.X, (ScrollingAxes & Axes.Y) > 0 ? (float)Duration : Size.Y); - // And we need to make sure the hit object's position-space doesn't change due to our resizing - RelativeChildSize = Size; - } - } -} diff --git a/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs b/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs deleted file mode 100644 index 81e3a5c70e..0000000000 --- a/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs +++ /dev/null @@ -1,114 +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.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Rulesets.Objects.Drawables; -using OpenTK; - -namespace osu.Game.Rulesets.Timing -{ - /// - /// A container that provides the speed adjustments defined by s to affect the scroll speed - /// of container s. - /// - public class SpeedAdjustmentContainer : Container - { - /// - /// Gets or sets the range of time that is visible by the length of the scrolling axes. - /// - public readonly Bindable VisibleTimeRange = new Bindable { Default = 1000 }; - - /// - /// Whether to reverse the scrolling direction is reversed. - /// - public readonly BindableBool Reversed = new BindableBool(); - - protected override Container Content => content; - private readonly Container content; - - /// - /// The axes which the content of this container will scroll through. - /// - public Axes ScrollingAxes - { - get { return scrollingContainer.ScrollingAxes; } - set { scrollingContainer.ScrollingAxes = value; } - } - - public override bool RemoveWhenNotAlive => false; - protected override bool RequiresChildrenUpdate => true; - - /// - /// The that defines the speed adjustments. - /// - public readonly MultiplierControlPoint ControlPoint; - - private readonly ScrollingContainer scrollingContainer; - - /// - /// Creates a new . - /// - /// The that defines the speed adjustments. - public SpeedAdjustmentContainer(MultiplierControlPoint controlPoint) - { - ControlPoint = controlPoint; - RelativeSizeAxes = Axes.Both; - - scrollingContainer = CreateScrollingContainer(); - scrollingContainer.ControlPoint = ControlPoint; - scrollingContainer.VisibleTimeRange.BindTo(VisibleTimeRange); - - AddInternal(content = scrollingContainer); - } - - protected override void Update() - { - float multiplier = (float)ControlPoint.Multiplier; - - // The speed adjustment happens by modifying our size by the multiplier while maintaining the visible time range as the relatve size for our children - Size = new Vector2((ScrollingAxes & Axes.X) > 0 ? multiplier : 1, (ScrollingAxes & Axes.Y) > 0 ? multiplier : 1); - - if (Reversed) - { - RelativeChildSize = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)-VisibleTimeRange : 1, (ScrollingAxes & Axes.Y) > 0 ? (float)-VisibleTimeRange : 1); - RelativeChildOffset = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)VisibleTimeRange : 0, (ScrollingAxes & Axes.Y) > 0 ? (float)VisibleTimeRange : 0); - Origin = Anchor = Anchor.BottomRight; - } - else - { - RelativeChildSize = new Vector2((ScrollingAxes & Axes.X) > 0 ? (float)VisibleTimeRange : 1, (ScrollingAxes & Axes.Y) > 0 ? (float)VisibleTimeRange : 1); - RelativeChildOffset = Vector2.Zero; - Origin = Anchor = Anchor.TopLeft; - } - } - - public override double LifetimeStart => ControlPoint.StartTime - VisibleTimeRange; - public override double LifetimeEnd => ControlPoint.StartTime + scrollingContainer.Duration + VisibleTimeRange; - - public override void Add(DrawableHitObject drawable) - { - var scrollingHitObject = drawable as IScrollingHitObject; - - if (scrollingHitObject != null) - { - scrollingHitObject.LifetimeOffset.BindTo(VisibleTimeRange); - scrollingHitObject.ScrollingAxes = ScrollingAxes; - } - - base.Add(drawable); - } - - /// - /// Whether a point in time falls within this s affecting timespan. - /// - public bool CanContain(double startTime) => ControlPoint.StartTime <= startTime; - - /// - /// Creates the which contains the scrolling s of this container. - /// - /// The . - protected virtual ScrollingContainer CreateScrollingContainer() => new LinearScrollingContainer(ControlPoint); - } -} diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 395248b2fd..56959240a8 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -1,15 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; -using System.Linq; using OpenTK.Input; using osu.Framework.Configuration; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; +using osu.Framework.Lists; using osu.Framework.MathUtils; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; @@ -50,11 +48,6 @@ namespace osu.Game.Rulesets.UI MaxValue = time_span_max }; - /// - /// Whether to reverse the scrolling direction is reversed. Note that this does _not_ invert the hit objects. - /// - protected readonly BindableBool Reversed = new BindableBool(); - /// /// The container that contains the s and s. /// @@ -65,12 +58,11 @@ namespace osu.Game.Rulesets.UI /// /// The axes on which s in this container should scroll. /// Whether we want our internal coordinate system to be scaled to a specified width - protected ScrollingPlayfield(Axes scrollingAxes, float? customWidth = null) + protected ScrollingPlayfield(Direction scrollingDirection, float? customWidth = null) : base(customWidth) { - base.HitObjects = HitObjects = new ScrollingHitObjectContainer(scrollingAxes) { RelativeSizeAxes = Axes.Both }; - HitObjects.VisibleTimeRange.BindTo(VisibleTimeRange); - HitObjects.Reversed.BindTo(Reversed); + base.HitObjects = HitObjects = new ScrollingHitObjectContainer(scrollingDirection) { RelativeSizeAxes = Axes.Both }; + HitObjects.TimeRange.BindTo(VisibleTimeRange); } private List nestedPlayfields; @@ -131,135 +123,66 @@ namespace osu.Game.Rulesets.UI protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value; } - /// - /// A container that provides the foundation for sorting s into s. - /// public class ScrollingHitObjectContainer : HitObjectContainer { - /// - /// Gets or sets the range of time that is visible by the length of the scrolling axes. - /// For example, only hit objects with start time less than or equal to 1000 will be visible with = 1000. - /// - public readonly BindableDouble VisibleTimeRange = new BindableDouble { Default = 1000 }; - - /// - /// Whether to reverse the scrolling direction is reversed. - /// - public readonly BindableBool Reversed = new BindableBool(); - - private readonly SortedContainer speedAdjustments; - public IReadOnlyList SpeedAdjustments => speedAdjustments; - - private readonly SpeedAdjustmentContainer defaultSpeedAdjustment; - - private readonly Axes scrollingAxes; - - /// - /// Creates a new . - /// - /// The axes upon which hit objects should appear to scroll inside this container. - public ScrollingHitObjectContainer(Axes scrollingAxes) + public readonly BindableDouble TimeRange = new BindableDouble { - this.scrollingAxes = scrollingAxes; + MinValue = 0, + MaxValue = double.MaxValue + }; - AddInternal(speedAdjustments = new SortedContainer { RelativeSizeAxes = Axes.Both }); + public readonly SortedList ControlPoints = new SortedList(); - // Default speed adjustment - AddSpeedAdjustment(defaultSpeedAdjustment = new SpeedAdjustmentContainer(new MultiplierControlPoint(0))); + private readonly Direction scrollingDirection; + + public ScrollingHitObjectContainer(Direction scrollingDirection) + { + this.scrollingDirection = scrollingDirection; + + RelativeSizeAxes = Axes.Both; } - /// - /// Adds a to this container, re-sorting all hit objects - /// in the last that occurred (time-wise) before it. - /// - /// The . - public void AddSpeedAdjustment(SpeedAdjustmentContainer speedAdjustment) + protected override void UpdateAfterChildren() { - speedAdjustment.ScrollingAxes = scrollingAxes; - speedAdjustment.VisibleTimeRange.BindTo(VisibleTimeRange); - speedAdjustment.Reversed.BindTo(Reversed); + base.UpdateAfterChildren(); - if (speedAdjustments.Count > 0) + var currentMultiplier = controlPointAt(Time.Current); + + foreach (var obj in AliveObjects) { - // We need to re-sort all hit objects in the speed adjustment container prior to figure out if they - // should now lie within this one - var existingAdjustment = adjustmentContainerAt(speedAdjustment.ControlPoint.StartTime); - for (int i = 0; i < existingAdjustment.Count; i++) + var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); + + // Todo: We may need to consider scale here + var finalPosition = (float)relativePosition * DrawSize; + + switch (scrollingDirection) { - DrawableHitObject hitObject = existingAdjustment[i]; - - if (!speedAdjustment.CanContain(hitObject.HitObject.StartTime)) - continue; - - existingAdjustment.Remove(hitObject); - speedAdjustment.Add(hitObject); - - i--; + case Direction.Horizontal: + obj.X = finalPosition.X; + break; + case Direction.Vertical: + obj.Y = finalPosition.Y; + break; } } - - speedAdjustments.Add(speedAdjustment); } - /// - /// Removes a from this container, re-sorting all hit objects - /// which it contained into new s. - /// - /// The to remove. - public void RemoveSpeedAdjustment(SpeedAdjustmentContainer speedAdjustment) + private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); + private MultiplierControlPoint controlPointAt(double time) { - if (speedAdjustment == defaultSpeedAdjustment) - throw new InvalidOperationException($"The default {nameof(SpeedAdjustmentContainer)} must not be removed."); + if (ControlPoints.Count == 0) + return new MultiplierControlPoint(double.MinValue); - if (!speedAdjustments.Remove(speedAdjustment)) - return; + if (time < ControlPoints[0].StartTime) + return ControlPoints[0]; - while (speedAdjustment.Count > 0) - { - DrawableHitObject hitObject = speedAdjustment[0]; + searchingPoint.StartTime = time; - speedAdjustment.Remove(hitObject); - Add(hitObject); - } - } + int index = ControlPoints.BinarySearch(searchingPoint); + if (index < 0) + index = ~index - 1; - public override IEnumerable Objects => speedAdjustments.SelectMany(s => s.Children); - - /// - /// Adds a hit object to this . The hit objects will be queued to be processed - /// new s are added to this . - /// - /// The hit object to add. - public override void Add(DrawableHitObject hitObject) - { - if (!(hitObject is IScrollingHitObject)) - throw new InvalidOperationException($"Hit objects added to a {nameof(ScrollingHitObjectContainer)} must implement {nameof(IScrollingHitObject)}."); - - adjustmentContainerAt(hitObject.HitObject.StartTime).Add(hitObject); - } - - public override bool Remove(DrawableHitObject hitObject) => speedAdjustments.Any(s => s.Remove(hitObject)); - - /// - /// Finds the which provides the speed adjustment active at a time. - /// If there is no active at the time, then the first (time-wise) speed adjustment is returned. - /// - /// The time to find the active at. - /// The active at . Null if there are no speed adjustments. - private SpeedAdjustmentContainer adjustmentContainerAt(double time) => speedAdjustments.FirstOrDefault(c => c.CanContain(time)) ?? defaultSpeedAdjustment; - - private class SortedContainer : Container - { - protected override int Compare(Drawable x, Drawable y) - { - var sX = (SpeedAdjustmentContainer)x; - var sY = (SpeedAdjustmentContainer)y; - - int result = sY.ControlPoint.StartTime.CompareTo(sX.ControlPoint.StartTime); - if (result != 0) - return result; - return base.Compare(y, x); - } + return ControlPoints[index]; } } } diff --git a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs index f1b8838fa9..9d98382a8b 100644 --- a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.UI private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield) { - playfield.HitObjects.AddSpeedAdjustment(CreateSpeedAdjustmentContainer(controlPoint)); + playfield.HitObjects.ControlPoints.Add(controlPoint); playfield.NestedPlayfields.ForEach(p => applySpeedAdjustment(controlPoint, p)); } @@ -108,12 +108,5 @@ namespace osu.Game.Rulesets.UI return new MultiplierControlPoint(time, DefaultControlPoints[index].DeepClone()); } - - /// - /// Creates a that facilitates the movement of hit objects. - /// - /// The that provides the speed adjustments for the hitobjects. - /// The . - protected virtual SpeedAdjustmentContainer CreateSpeedAdjustmentContainer(MultiplierControlPoint controlPoint) => new SpeedAdjustmentContainer(controlPoint); } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 519e214495..2369724f6b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -614,7 +614,6 @@ - @@ -665,10 +664,7 @@ - - - From 651e24e3cc497c647f782e94fef948dbc75d35a5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 19:17:40 +0900 Subject: [PATCH 168/628] Implement proper scrolling directions --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- .../Visual/TestCaseScrollingHitObjects.cs | 16 ++++++------ osu.Game/Rulesets/UI/ScrollingDirection.cs | 25 +++++++++++++++++++ osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 24 +++++++++++------- osu.Game/osu.Game.csproj | 1 + 8 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 osu.Game/Rulesets/UI/ScrollingDirection.cs diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 322d1d91af..2f7d7449c8 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.UI private readonly CatcherArea catcherArea; public CatchPlayfield(BeatmapDifficulty difficulty) - : base(Direction.Vertical) + : base(ScrollingDirection.Down) { Container explodingFruitContainer; diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 048b3ef9f9..a0768e48a2 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Mania.UI private const float opacity_pressed = 0.25f; public Column() - : base(Direction.Vertical) + : base(ScrollingDirection.Down) { Width = column_width; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 549b0f2ee6..161dd9ec22 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI private readonly int columnCount; public ManiaPlayfield(int columnCount) - : base(Direction.Vertical) + : base(ScrollingDirection.Down) { this.columnCount = columnCount; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 5e1fa7e490..8c55fe009f 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Taiko.UI private readonly Box background; public TaikoPlayfield(ControlPointInfo controlPoints) - : base(Direction.Horizontal) + : base(ScrollingDirection.Left) { AddRangeInternal(new Drawable[] { diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 01387791a1..b05efbde5c 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -24,8 +24,8 @@ namespace osu.Game.Tests.Visual public TestCaseScrollingHitObjects() { - playfields.Add(new TestPlayfield(Direction.Vertical)); - playfields.Add(new TestPlayfield(Direction.Horizontal)); + playfields.Add(new TestPlayfield(ScrollingDirection.Down)); + playfields.Add(new TestPlayfield(ScrollingDirection.Right)); playfields.ForEach(p => p.HitObjects.ControlPoints.Add(new MultiplierControlPoint(double.MinValue))); @@ -72,7 +72,7 @@ namespace osu.Game.Tests.Visual { p.Add(new TestDrawableHitObject(time) { - Anchor = p.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + Anchor = p.Direction == ScrollingDirection.Right ? Anchor.CentreRight : Anchor.BottomCentre }); }); } @@ -90,7 +90,7 @@ namespace osu.Game.Tests.Visual TestDrawableControlPoint createDrawablePoint(double t) => new TestDrawableControlPoint(t) { - Anchor = p.ScrollingDirection == Direction.Horizontal ? Anchor.CentreRight : Anchor.BottomCentre + Anchor = p.Direction == ScrollingDirection.Right ? Anchor.CentreRight : Anchor.BottomCentre }; p.Add(createDrawablePoint(time)); @@ -105,15 +105,15 @@ namespace osu.Game.Tests.Visual { public readonly BindableDouble TimeRange = new BindableDouble(5000); - public readonly Direction ScrollingDirection; + public readonly ScrollingDirection Direction; public new ScrollingPlayfield.ScrollingHitObjectContainer HitObjects => (ScrollingPlayfield.ScrollingHitObjectContainer)base.HitObjects; - public TestPlayfield(Direction scrollingDirection) + public TestPlayfield(ScrollingDirection direction) { - ScrollingDirection = scrollingDirection; + Direction = direction; - base.HitObjects = new ScrollingPlayfield.ScrollingHitObjectContainer(scrollingDirection); + base.HitObjects = new ScrollingPlayfield.ScrollingHitObjectContainer(direction); HitObjects.TimeRange.BindTo(TimeRange); } } diff --git a/osu.Game/Rulesets/UI/ScrollingDirection.cs b/osu.Game/Rulesets/UI/ScrollingDirection.cs new file mode 100644 index 0000000000..29d63499ee --- /dev/null +++ b/osu.Game/Rulesets/UI/ScrollingDirection.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +namespace osu.Game.Rulesets.UI +{ + public enum ScrollingDirection + { + /// + /// Hitobjects will scroll vertically from the bottom of the hitobject container. + /// + Up, + /// + /// Hitobjects will scroll vertically from the top of the hitobject container. + /// + Down, + /// + /// Hitobjects will scroll horizontally from the right of the hitobject container. + /// + Left, + /// + /// Hitobjects will scroll horizontally from the left of the hitobject container. + /// + Right + } +} diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 56959240a8..f391d01ac9 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -58,10 +58,10 @@ namespace osu.Game.Rulesets.UI /// /// The axes on which s in this container should scroll. /// Whether we want our internal coordinate system to be scaled to a specified width - protected ScrollingPlayfield(Direction scrollingDirection, float? customWidth = null) + protected ScrollingPlayfield(ScrollingDirection direction, float? customWidth = null) : base(customWidth) { - base.HitObjects = HitObjects = new ScrollingHitObjectContainer(scrollingDirection) { RelativeSizeAxes = Axes.Both }; + base.HitObjects = HitObjects = new ScrollingHitObjectContainer(direction) { RelativeSizeAxes = Axes.Both }; HitObjects.TimeRange.BindTo(VisibleTimeRange); } @@ -133,11 +133,11 @@ namespace osu.Game.Rulesets.UI public readonly SortedList ControlPoints = new SortedList(); - private readonly Direction scrollingDirection; + private readonly ScrollingDirection direction; - public ScrollingHitObjectContainer(Direction scrollingDirection) + public ScrollingHitObjectContainer(ScrollingDirection direction) { - this.scrollingDirection = scrollingDirection; + this.direction = direction; RelativeSizeAxes = Axes.Both; } @@ -155,14 +155,20 @@ namespace osu.Game.Rulesets.UI // Todo: We may need to consider scale here var finalPosition = (float)relativePosition * DrawSize; - switch (scrollingDirection) + switch (direction) { - case Direction.Horizontal: - obj.X = finalPosition.X; + case ScrollingDirection.Up: + obj.Y = -finalPosition.Y; break; - case Direction.Vertical: + case ScrollingDirection.Down: obj.Y = finalPosition.Y; break; + case ScrollingDirection.Left: + obj.X = -finalPosition.X; + break; + case ScrollingDirection.Right: + obj.X = finalPosition.X; + break; } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2369724f6b..c5c1004663 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -314,6 +314,7 @@ + From e0c921ff5c7426c6115c9f690eb749dcb2405b15 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 19:20:43 +0900 Subject: [PATCH 169/628] Split out ScrollingHitObjectContainer into new file --- .../Visual/TestCaseScrollingHitObjects.cs | 4 +- .../UI/ScrollingHitObjectContainer.cs | 79 +++++++++++++++++++ osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 71 ----------------- osu.Game/osu.Game.csproj | 1 + 4 files changed, 82 insertions(+), 73 deletions(-) create mode 100644 osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index b05efbde5c..71c1295ebb 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -107,13 +107,13 @@ namespace osu.Game.Tests.Visual public readonly ScrollingDirection Direction; - public new ScrollingPlayfield.ScrollingHitObjectContainer HitObjects => (ScrollingPlayfield.ScrollingHitObjectContainer)base.HitObjects; + public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; public TestPlayfield(ScrollingDirection direction) { Direction = direction; - base.HitObjects = new ScrollingPlayfield.ScrollingHitObjectContainer(direction); + base.HitObjects = new ScrollingHitObjectContainer(direction); HitObjects.TimeRange.BindTo(TimeRange); } } diff --git a/osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs new file mode 100644 index 0000000000..61184ac53f --- /dev/null +++ b/osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs @@ -0,0 +1,79 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Lists; +using osu.Game.Rulesets.Timing; + +namespace osu.Game.Rulesets.UI +{ + public class ScrollingHitObjectContainer : Playfield.HitObjectContainer + { + public readonly BindableDouble TimeRange = new BindableDouble + { + MinValue = 0, + MaxValue = double.MaxValue + }; + + public readonly SortedList ControlPoints = new SortedList(); + + private readonly ScrollingDirection direction; + + public ScrollingHitObjectContainer(ScrollingDirection direction) + { + this.direction = direction; + + RelativeSizeAxes = Axes.Both; + } + + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + var currentMultiplier = controlPointAt(Time.Current); + + foreach (var obj in AliveObjects) + { + var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); + + // Todo: We may need to consider scale here + var finalPosition = (float)relativePosition * DrawSize; + + switch (direction) + { + case ScrollingDirection.Up: + obj.Y = -finalPosition.Y; + break; + case ScrollingDirection.Down: + obj.Y = finalPosition.Y; + break; + case ScrollingDirection.Left: + obj.X = -finalPosition.X; + break; + case ScrollingDirection.Right: + obj.X = finalPosition.X; + break; + } + } + } + + private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); + private MultiplierControlPoint controlPointAt(double time) + { + if (ControlPoints.Count == 0) + return new MultiplierControlPoint(double.MinValue); + + if (time < ControlPoints[0].StartTime) + return ControlPoints[0]; + + searchingPoint.StartTime = time; + + int index = ControlPoints.BinarySearch(searchingPoint); + if (index < 0) + index = ~index - 1; + + return ControlPoints[index]; + } + } +} diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index f391d01ac9..5492f9e272 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -7,10 +7,8 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; -using osu.Framework.Lists; using osu.Framework.MathUtils; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Timing; namespace osu.Game.Rulesets.UI { @@ -122,74 +120,5 @@ namespace osu.Game.Rulesets.UI protected override void Apply(ScrollingPlayfield d, double time) => d.VisibleTimeRange.Value = valueAt(time); protected override void ReadIntoStartValue(ScrollingPlayfield d) => StartValue = d.VisibleTimeRange.Value; } - - public class ScrollingHitObjectContainer : HitObjectContainer - { - public readonly BindableDouble TimeRange = new BindableDouble - { - MinValue = 0, - MaxValue = double.MaxValue - }; - - public readonly SortedList ControlPoints = new SortedList(); - - private readonly ScrollingDirection direction; - - public ScrollingHitObjectContainer(ScrollingDirection direction) - { - this.direction = direction; - - RelativeSizeAxes = Axes.Both; - } - - protected override void UpdateAfterChildren() - { - base.UpdateAfterChildren(); - - var currentMultiplier = controlPointAt(Time.Current); - - foreach (var obj in AliveObjects) - { - var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); - - // Todo: We may need to consider scale here - var finalPosition = (float)relativePosition * DrawSize; - - switch (direction) - { - case ScrollingDirection.Up: - obj.Y = -finalPosition.Y; - break; - case ScrollingDirection.Down: - obj.Y = finalPosition.Y; - break; - case ScrollingDirection.Left: - obj.X = -finalPosition.X; - break; - case ScrollingDirection.Right: - obj.X = finalPosition.X; - break; - } - } - } - - private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); - private MultiplierControlPoint controlPointAt(double time) - { - if (ControlPoints.Count == 0) - return new MultiplierControlPoint(double.MinValue); - - if (time < ControlPoints[0].StartTime) - return ControlPoints[0]; - - searchingPoint.StartTime = time; - - int index = ControlPoints.BinarySearch(searchingPoint); - if (index < 0) - index = ~index - 1; - - return ControlPoints[index]; - } - } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c5c1004663..9cf7d72d1b 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,6 +315,7 @@ + From a7aab21a29b5d0cc268141933b4146a8f7b7fbf5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 19:22:15 +0900 Subject: [PATCH 170/628] Re-namespace files --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs | 1 + osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs | 1 + osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs | 1 + osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs | 1 + .../Rulesets/UI/{ => Scrolling}/ScrollingDirection.cs | 2 +- .../UI/{ => Scrolling}/ScrollingHitObjectContainer.cs | 2 +- .../Rulesets/UI/{ => Scrolling}/ScrollingPlayfield.cs | 4 ++-- .../UI/{ => Scrolling}/ScrollingRulesetContainer.cs | 2 +- osu.Game/osu.Game.csproj | 8 ++++---- 13 files changed, 17 insertions(+), 13 deletions(-) rename osu.Game/Rulesets/UI/{ => Scrolling}/ScrollingDirection.cs (92%) rename osu.Game/Rulesets/UI/{ => Scrolling}/ScrollingHitObjectContainer.cs (95%) rename osu.Game/Rulesets/UI/{ => Scrolling}/ScrollingPlayfield.cs (97%) rename osu.Game/Rulesets/UI/{ => Scrolling}/ScrollingRulesetContainer.cs (97%) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 2f7d7449c8..1ea05f8ff6 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Rulesets.UI; using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; @@ -10,6 +9,7 @@ using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Catch.UI { diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index 3ed9090098..e9f1a26e69 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -10,6 +10,7 @@ using osu.Game.Rulesets.Catch.Scoring; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Catch.UI { diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index a0768e48a2..81997d3705 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -12,8 +12,8 @@ using osu.Game.Graphics; using osu.Game.Rulesets.Objects.Drawables; using System; using osu.Framework.Input.Bindings; -using osu.Game.Rulesets.UI; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 161dd9ec22..cc028a85ee 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; using osu.Framework.Graphics.Containers; @@ -17,6 +16,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index db9475b31e..55bae45ab2 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -22,6 +22,7 @@ using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI { diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 8c55fe009f..007c637659 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Taiko.Objects; -using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Taiko.Judgements; @@ -17,6 +16,7 @@ using System.Linq; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Taiko.Objects.Drawables; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Taiko.UI { diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs index 614b446181..cef51c664f 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs @@ -17,6 +17,7 @@ using osu.Game.Rulesets.Taiko.Replays; using OpenTK; using System.Linq; using osu.Framework.Input; +using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Taiko.UI { diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 71c1295ebb..7e332c7310 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -12,6 +12,7 @@ using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; +using osu.Game.Rulesets.UI.Scrolling; using OpenTK.Graphics; namespace osu.Game.Tests.Visual diff --git a/osu.Game/Rulesets/UI/ScrollingDirection.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs similarity index 92% rename from osu.Game/Rulesets/UI/ScrollingDirection.cs rename to osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs index 29d63499ee..d89795f4d3 100644 --- a/osu.Game/Rulesets/UI/ScrollingDirection.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs @@ -1,7 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE -namespace osu.Game.Rulesets.UI +namespace osu.Game.Rulesets.UI.Scrolling { public enum ScrollingDirection { diff --git a/osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs similarity index 95% rename from osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs rename to osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 61184ac53f..4c11c53a89 100644 --- a/osu.Game/Rulesets/UI/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -6,7 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Lists; using osu.Game.Rulesets.Timing; -namespace osu.Game.Rulesets.UI +namespace osu.Game.Rulesets.UI.Scrolling { public class ScrollingHitObjectContainer : Playfield.HitObjectContainer { diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs similarity index 97% rename from osu.Game/Rulesets/UI/ScrollingPlayfield.cs rename to osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 5492f9e272..899048531f 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -2,15 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using OpenTK.Input; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Transforms; using osu.Framework.Input; using osu.Framework.MathUtils; using osu.Game.Rulesets.Objects.Drawables; +using OpenTK.Input; -namespace osu.Game.Rulesets.UI +namespace osu.Game.Rulesets.UI.Scrolling { /// /// A type of specialized towards scrolling s. diff --git a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs similarity index 97% rename from osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs rename to osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs index 9d98382a8b..73c3848f69 100644 --- a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs @@ -13,7 +13,7 @@ using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; -namespace osu.Game.Rulesets.UI +namespace osu.Game.Rulesets.UI.Scrolling { /// /// A type of that supports a . diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9cf7d72d1b..a1912487e9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -314,8 +314,10 @@ - - + + + + @@ -671,8 +673,6 @@ - - From bf64b8fc6966e496aadf8a747ccc47ef93d3fc29 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 4 Jan 2018 11:41:06 +0100 Subject: [PATCH 171/628] added hover effects to panels in social at least partially QQ --- osu.Game.Tests/Visual/TestCaseSocial.cs | 6 ++- osu.Game/Overlays/Social/SocialGridPanel.cs | 15 ++++++ osu.Game/Overlays/Social/SocialListPanel.cs | 16 ++++++ osu.Game/Overlays/Social/SocialPanel.cs | 60 +++++++++++++++++++++ osu.Game/Overlays/SocialOverlay.cs | 30 ++++++----- osu.Game/Users/UpdateableAvatar.cs | 2 +- osu.Game/Users/UserPanel.cs | 8 +-- osu.Game/osu.Game.csproj | 3 ++ 8 files changed, 123 insertions(+), 17 deletions(-) create mode 100644 osu.Game/Overlays/Social/SocialGridPanel.cs create mode 100644 osu.Game/Overlays/Social/SocialListPanel.cs create mode 100644 osu.Game/Overlays/Social/SocialPanel.cs diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs index 3f418174c7..631f08254f 100644 --- a/osu.Game.Tests/Visual/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/TestCaseSocial.cs @@ -13,8 +13,12 @@ namespace osu.Game.Tests.Visual { public override IReadOnlyList RequiredTypes => new[] { + typeof(UserPanel), + typeof(SocialPanel), typeof(FilterControl), - typeof(SocialOverlay) + typeof(SocialOverlay), + typeof(SocialGridPanel), + typeof(SocialListPanel) }; public TestCaseSocial() diff --git a/osu.Game/Overlays/Social/SocialGridPanel.cs b/osu.Game/Overlays/Social/SocialGridPanel.cs new file mode 100644 index 0000000000..b2c6b75ab2 --- /dev/null +++ b/osu.Game/Overlays/Social/SocialGridPanel.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 osu.Game.Users; + +namespace osu.Game.Overlays.Social +{ + public class SocialGridPanel : SocialPanel + { + public SocialGridPanel(User user) : base(user) + { + Width = 300; + } + } +} diff --git a/osu.Game/Overlays/Social/SocialListPanel.cs b/osu.Game/Overlays/Social/SocialListPanel.cs new file mode 100644 index 0000000000..f65fbe8142 --- /dev/null +++ b/osu.Game/Overlays/Social/SocialListPanel.cs @@ -0,0 +1,16 @@ +// 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.Game.Users; + +namespace osu.Game.Overlays.Social +{ + public class SocialListPanel : SocialPanel + { + public SocialListPanel(User user) : base(user) + { + RelativeSizeAxes = Axes.X; + } + } +} diff --git a/osu.Game/Overlays/Social/SocialPanel.cs b/osu.Game/Overlays/Social/SocialPanel.cs new file mode 100644 index 0000000000..234640482e --- /dev/null +++ b/osu.Game/Overlays/Social/SocialPanel.cs @@ -0,0 +1,60 @@ +// 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.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Input; +using osu.Game.Users; + +namespace osu.Game.Overlays.Social +{ + public class SocialPanel : UserPanel + { + private const double hover_transition_time = 400; + + public SocialPanel(User user) : base(user) + { + } + + private readonly EdgeEffectParameters edgeEffectNormal = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Offset = new Vector2(0f, 1f), + Radius = 2f, + Colour = Color4.Black.Opacity(0.25f), + }; + + private readonly EdgeEffectParameters edgeEffectHovered = new EdgeEffectParameters + { + Type = EdgeEffectType.Shadow, + Offset = new Vector2(0f, 5f), + Radius = 10f, + Colour = Color4.Black.Opacity(0.3f), + }; + + protected override bool OnHover(InputState state) + { + TweenEdgeEffectTo(edgeEffectHovered, hover_transition_time, Easing.OutQuint); + //Content.MoveToY(-4, hover_transition_time, Easing.OutQuint); + + return base.OnHover(state); + } + + protected override void OnHoverLost(InputState state) + { + TweenEdgeEffectTo(edgeEffectNormal, hover_transition_time, Easing.OutQuint); + //Content.MoveToY(0, hover_transition_time, Easing.OutQuint); + + base.OnHoverLost(state); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + this.FadeInFromZero(200, Easing.Out); + } + } +} diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index c4ed14022e..823e264ebe 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -22,7 +22,7 @@ namespace osu.Game.Overlays { private APIAccess api; private readonly LoadingAnimation loading; - private FillFlowContainer panels; + private FillFlowContainer panels; protected override Color4 BackgroundColour => OsuColour.FromHex(@"60284b"); protected override Color4 TrianglesColourLight => OsuColour.FromHex(@"672b51"); @@ -121,7 +121,7 @@ namespace osu.Game.Overlays if (Users == null) return; - var newPanels = new FillFlowContainer + var newPanels = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, @@ -129,18 +129,18 @@ namespace osu.Game.Overlays Margin = new MarginPadding { Top = 10 }, ChildrenEnumerable = Users.Select(u => { - UserPanel panel = new UserPanel(u) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre - }; + SocialPanel panel; switch (displayStyle) { case PanelDisplayStyle.Grid: - panel.Width = 300; + panel = new SocialGridPanel(u) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre + }; break; default: - panel.RelativeSizeAxes = Axes.X; + panel = new SocialListPanel(u); break; } panel.Status.BindTo(u.Status); @@ -148,14 +148,20 @@ namespace osu.Game.Overlays }) }; - LoadComponentAsync(newPanels, p => ScrollFlow.Add(panels = newPanels)); + LoadComponentAsync(newPanels, p => + { + if(panels != null) + ScrollFlow.Remove(panels); + + ScrollFlow.Add(panels = newPanels); + }); } private void clearPanels() { if (panels != null) { - ScrollFlow.Remove(panels); + panels.FadeOut(200); panels.Expire(); panels = null; } @@ -185,7 +191,7 @@ namespace osu.Game.Overlays switch (Header.Tabs.Current.Value) { case SocialTab.OnlineFriends: - var friendRequest = new GetFriendsRequest(); // TODO filter??? + var friendRequest = new GetFriendsRequest(); friendRequest.Success += updateUsers; api.Queue(getUsersRequest = friendRequest); break; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index d55c0caad7..455856a6d4 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -44,7 +44,7 @@ namespace osu.Game.Users new Avatar(user) { RelativeSizeAxes = Axes.Both, - OnLoadComplete = d => d.FadeInFromZero(200), + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), }) ); } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index e0a4e3184d..6690c38eca 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -65,8 +65,8 @@ namespace osu.Game.Users Anchor = Anchor.Centre, Origin = Anchor.Centre, FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(200), - }, 0) { RelativeSizeAxes = Axes.Both }, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out) + }, 300) { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both, @@ -76,7 +76,7 @@ namespace osu.Game.Users { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Top = content_padding, Left = content_padding, Right = content_padding }, + Padding = new MarginPadding { Top = content_padding, Horizontal = content_padding }, Children = new Drawable[] { new UpdateableAvatar @@ -167,11 +167,13 @@ namespace osu.Game.Users }; if (user.IsSupporter) + { infoContainer.Add(new SupporterIcon { RelativeSizeAxes = Axes.Y, Width = 20f, }); + } } [BackgroundDependencyLoader(permitNulls: true)] diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 49978693b3..dfc2120b89 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -311,6 +311,9 @@ + + + From 844c428fa7ead72a64422800feadc96fe95915ae Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 4 Jan 2018 11:49:03 +0100 Subject: [PATCH 172/628] Updated submodule osu-framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6134dafccb..66421b8944 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6134dafccb3368dac96d837537325c04b89fb8ee +Subproject commit 66421b894444cb9c4b792f9b93a786dcff5589dd From f569d5495815fe19e4fa1526eea836ada8caf6ad Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 19:52:29 +0900 Subject: [PATCH 173/628] Local circlesize/od variables --- .../Beatmaps/ManiaBeatmapConverter.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 755e0e7563..78b8957de6 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -37,19 +37,22 @@ namespace osu.Game.Rulesets.Mania.Beatmaps { IsForCurrentRuleset = isForCurrentRuleset; + var roundedCircleSize = Math.Round(original.BeatmapInfo.BaseDifficulty.CircleSize); + var roundedOverallDifficulty = Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty); + if (isForCurrentRuleset) - TargetColumns = (int)Math.Max(1, Math.Round(original.BeatmapInfo.BaseDifficulty.CircleSize)); + TargetColumns = (int)Math.Max(1, roundedCircleSize); else { float percentSliderOrSpinner = (float)original.HitObjects.Count(h => h is IHasEndTime) / original.HitObjects.Count; if (percentSliderOrSpinner < 0.2) TargetColumns = 7; - else if (percentSliderOrSpinner < 0.3 || Math.Round(original.BeatmapInfo.BaseDifficulty.CircleSize) >= 5) - TargetColumns = Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 5 ? 7 : 6; + else if (percentSliderOrSpinner < 0.3 || roundedCircleSize >= 5) + TargetColumns = roundedOverallDifficulty > 5 ? 7 : 6; else if (percentSliderOrSpinner > 0.6) - TargetColumns = Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) > 4 ? 5 : 4; + TargetColumns = roundedOverallDifficulty > 4 ? 5 : 4; else - TargetColumns = Math.Max(4, Math.Min((int)Math.Round(original.BeatmapInfo.BaseDifficulty.OverallDifficulty) + 1, 7)); + TargetColumns = Math.Max(4, Math.Min((int)roundedOverallDifficulty + 1, 7)); } } From dcc4e863ab69795a1eb42d0594667624021da98b Mon Sep 17 00:00:00 2001 From: james58899 Date: Thu, 4 Jan 2018 19:04:52 +0800 Subject: [PATCH 174/628] move variables to StoryboardDecoder --- .../Beatmaps/Formats/LegacyBeatmapDecoder.cs | 23 ------------ osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 27 ++++---------- .../Formats/LegacyStoryboardDecoder.cs | 35 +++++++++++++++++++ 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index ea29e480ec..31678fd3b1 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -8,7 +8,6 @@ using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Beatmaps.ControlPoints; -using System.Collections.Generic; namespace osu.Game.Beatmaps.Formats { @@ -82,9 +81,6 @@ namespace osu.Game.Beatmaps.Formats case Section.HitObjects: handleHitObjects(line); break; - case Section.Variables: - handleVariables(line); - break; } } @@ -242,8 +238,6 @@ namespace osu.Game.Beatmaps.Formats private void handleEvents(string line) { - DecodeVariables(ref line); - string[] split = line.Split(','); EventType type; @@ -400,22 +394,5 @@ namespace osu.Game.Beatmaps.Formats if (obj != null) beatmap.HitObjects.Add(obj); } - - private void handleVariables(string line) - { - var pair = splitKeyVal(line, '='); - Variables[pair.Key] = pair.Value; - } - - private KeyValuePair splitKeyVal(string line, char separator) - { - var split = line.Trim().Split(new[] { separator }, 2); - - return new KeyValuePair - ( - split[0].Trim(), - split.Length > 1 ? split[1].Trim() : string.Empty - ); - } } } diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index e5ced5f772..faad03e7d9 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -29,7 +29,6 @@ namespace osu.Game.Beatmaps.Formats } protected int BeatmapVersion; - protected readonly Dictionary Variables = new Dictionary(); public override Decoder GetStoryboardDecoder() => new LegacyStoryboardDecoder(BeatmapVersion); @@ -82,27 +81,15 @@ namespace osu.Game.Beatmaps.Formats protected abstract void ProcessSection(Section section, string line); - /// - /// Decodes any beatmap variables present in a line into their real values. - /// - /// The line which may contains variables. - protected void DecodeVariables(ref string line) + protected KeyValuePair splitKeyVal(string line, char separator) { - while (line.IndexOf('$') >= 0) - { - string origLine = line; - string[] split = line.Split(','); - for (int i = 0; i < split.Length; i++) - { - var item = split[i]; - if (item.StartsWith("$") && Variables.ContainsKey(item)) - split[i] = Variables[item]; - } + var split = line.Trim().Split(new[] { separator }, 2); - line = string.Join(",", split); - if (line == origLine) - break; - } + return new KeyValuePair + ( + split[0].Trim(), + split.Length > 1 ? split[1].Trim() : string.Empty + ); } protected enum Section diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs index 168f37e44e..40f2695f28 100644 --- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.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; @@ -19,6 +20,8 @@ namespace osu.Game.Beatmaps.Formats private StoryboardSprite storyboardSprite; private CommandTimelineGroup timelineGroup; + private readonly Dictionary Variables = new Dictionary(); + public LegacyStoryboardDecoder() { } @@ -47,6 +50,9 @@ namespace osu.Game.Beatmaps.Formats case Section.Events: handleEvents(line); break; + case Section.Variables: + handleVariables(line); + break; } } @@ -266,6 +272,35 @@ namespace osu.Game.Beatmaps.Formats throw new InvalidDataException($@"Unknown origin: {value}"); } + private void handleVariables(string line) + { + var pair = splitKeyVal(line, '='); + Variables[pair.Key] = pair.Value; + } + + /// + /// Decodes any beatmap variables present in a line into their real values. + /// + /// The line which may contains variables. + private void DecodeVariables(ref string line) + { + while (line.IndexOf('$') >= 0) + { + string origLine = line; + string[] split = line.Split(','); + for (int i = 0; i < split.Length; i++) + { + var item = split[i]; + if (item.StartsWith("$") && Variables.ContainsKey(item)) + split[i] = Variables[item]; + } + + line = string.Join(",", split); + if (line == origLine) + break; + } + } + private string cleanFilename(string path) => FileSafety.PathSanitise(path.Trim('\"')); } } From 0158246ba148ab5a0e18e4caca528943f40bf032 Mon Sep 17 00:00:00 2001 From: james58899 Date: Thu, 4 Jan 2018 19:23:00 +0800 Subject: [PATCH 175/628] AppVeyor --- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 10 +++++----- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 2 +- .../Beatmaps/Formats/LegacyStoryboardDecoder.cs | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 31678fd3b1..83d70d832d 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -86,7 +86,7 @@ namespace osu.Game.Beatmaps.Formats private void handleGeneral(string line) { - var pair = splitKeyVal(line, ':'); + var pair = SplitKeyVal(line, ':'); var metadata = beatmap.BeatmapInfo.Metadata; switch (pair.Key) @@ -145,7 +145,7 @@ namespace osu.Game.Beatmaps.Formats private void handleEditor(string line) { - var pair = splitKeyVal(line, ':'); + var pair = SplitKeyVal(line, ':'); switch (pair.Key) { @@ -169,7 +169,7 @@ namespace osu.Game.Beatmaps.Formats private void handleMetadata(string line) { - var pair = splitKeyVal(line, ':'); + var pair = SplitKeyVal(line, ':'); var metadata = beatmap.BeatmapInfo.Metadata; switch (pair.Key) @@ -210,7 +210,7 @@ namespace osu.Game.Beatmaps.Formats private void handleDifficulty(string line) { - var pair = splitKeyVal(line, ':'); + var pair = SplitKeyVal(line, ':'); var difficulty = beatmap.BeatmapInfo.BaseDifficulty; switch (pair.Key) @@ -353,7 +353,7 @@ namespace osu.Game.Beatmaps.Formats private void handleColours(string line) { - var pair = splitKeyVal(line, ':'); + var pair = SplitKeyVal(line, ':'); string[] split = pair.Value.Split(','); diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index faad03e7d9..214f7ccb8b 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -81,7 +81,7 @@ namespace osu.Game.Beatmaps.Formats protected abstract void ProcessSection(Section section, string line); - protected KeyValuePair splitKeyVal(string line, char separator) + protected KeyValuePair SplitKeyVal(string line, char separator) { var split = line.Trim().Split(new[] { separator }, 2); diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs index 40f2695f28..ed4992d532 100644 --- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs @@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps.Formats private StoryboardSprite storyboardSprite; private CommandTimelineGroup timelineGroup; - private readonly Dictionary Variables = new Dictionary(); + private readonly Dictionary variables = new Dictionary(); public LegacyStoryboardDecoder() { @@ -65,7 +65,7 @@ namespace osu.Game.Beatmaps.Formats line = line.Substring(1); } - DecodeVariables(ref line); + decodeVariables(ref line); string[] split = line.Split(','); @@ -274,15 +274,15 @@ namespace osu.Game.Beatmaps.Formats private void handleVariables(string line) { - var pair = splitKeyVal(line, '='); - Variables[pair.Key] = pair.Value; + var pair = SplitKeyVal(line, '='); + variables[pair.Key] = pair.Value; } /// /// Decodes any beatmap variables present in a line into their real values. /// /// The line which may contains variables. - private void DecodeVariables(ref string line) + private void decodeVariables(ref string line) { while (line.IndexOf('$') >= 0) { @@ -291,8 +291,8 @@ namespace osu.Game.Beatmaps.Formats for (int i = 0; i < split.Length; i++) { var item = split[i]; - if (item.StartsWith("$") && Variables.ContainsKey(item)) - split[i] = Variables[item]; + if (item.StartsWith("$") && variables.ContainsKey(item)) + split[i] = variables[item]; } line = string.Join(",", split); From 585df22c88f0c8d83587f17f870afa5da8e9ac8f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 20:56:18 +0900 Subject: [PATCH 176/628] Add a way to calculate length of IHasEndTime objects --- .../Scrolling/ScrollingHitObjectContainer.cs | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 4c11c53a89..36b885c84b 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -4,7 +4,9 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Lists; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; +using OpenTK; namespace osu.Game.Rulesets.UI.Scrolling { @@ -35,9 +37,8 @@ namespace osu.Game.Rulesets.UI.Scrolling foreach (var obj in AliveObjects) { - var relativePosition = (Time.Current - obj.HitObject.StartTime) / (TimeRange / currentMultiplier.Multiplier); - // Todo: We may need to consider scale here + var relativePosition = (Time.Current - obj.HitObject.StartTime) * currentMultiplier.Multiplier / TimeRange; var finalPosition = (float)relativePosition * DrawSize; switch (direction) @@ -55,6 +56,27 @@ namespace osu.Game.Rulesets.UI.Scrolling obj.X = finalPosition.X; break; } + + if (!(obj.HitObject is IHasEndTime endTime)) + continue; + + // Todo: We may need to consider scale here + var relativeEndPosition = (Time.Current - endTime.EndTime) * currentMultiplier.Multiplier / TimeRange; + var finalEndPosition = (float)relativeEndPosition * DrawSize; + + float length = Vector2.Distance(finalPosition, finalEndPosition); + + switch (direction) + { + case ScrollingDirection.Up: + case ScrollingDirection.Down: + obj.Height = length; + break; + case ScrollingDirection.Left: + case ScrollingDirection.Right: + obj.Width = length; + break; + } } } From 4fee76ba0b8b2496f1812cebc5610de88b40ae1d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 20:56:28 +0900 Subject: [PATCH 177/628] Fix drumroll lengths --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index f5bafefd0b..88184d5fcf 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public DrawableDrumRoll(DrumRoll drumRoll) : base(drumRoll) { - Width = (float)HitObject.Duration; + RelativeSizeAxes = Axes.Y; Container tickContainer; MainPiece.Add(tickContainer = new Container From add68ff068577a1f14ac4e9841c56316b8074336 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 21:45:29 +0900 Subject: [PATCH 178/628] Fix swells not stopping at the hit position --- osu-framework | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs | 2 +- .../Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/osu-framework b/osu-framework index 6134dafccb..067fdb8f5b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 6134dafccb3368dac96d837537325c04b89fb8ee +Subproject commit 067fdb8f5b0594be1cd30e6bbd43f2ea749904ec diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 26e6585fb9..c8e5913fd2 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -192,7 +192,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables Size = BaseSize * Parent.RelativeChildSize; // Make the swell stop at the hit target - X = (float)Math.Max(Time.Current, HitObject.StartTime); + X = Math.Max(0, X); double t = Math.Min(HitObject.StartTime, Time.Current); if (t == HitObject.StartTime && !hasStarted) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 36b885c84b..4011e7ffd1 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -29,9 +29,12 @@ namespace osu.Game.Rulesets.UI.Scrolling RelativeSizeAxes = Axes.Both; } - protected override void UpdateAfterChildren() + protected override void UpdateAfterChildrenLife() { - base.UpdateAfterChildren(); + base.UpdateAfterChildrenLife(); + + // We need to calculate this as soon as possible so that hitobjects + // get the final say in their positions var currentMultiplier = controlPointAt(Time.Current); From e0e84ff37011d69a5e0f521bb83f6566c478c7cf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 22:05:20 +0900 Subject: [PATCH 179/628] Fix mania playfield scrolling hitobjects in the wrong direction --- osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 81997d3705..0910f9f37d 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Mania.UI private const float opacity_pressed = 0.25f; public Column() - : base(ScrollingDirection.Down) + : base(ScrollingDirection.Up) { Width = column_width; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index cc028a85ee..edb640a537 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mania.UI private readonly int columnCount; public ManiaPlayfield(int columnCount) - : base(ScrollingDirection.Down) + : base(ScrollingDirection.Up) { this.columnCount = columnCount; From ce94c825d18be7f32ab0ba8235bf01d7ad4b2aa2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 4 Jan 2018 22:05:38 +0900 Subject: [PATCH 180/628] Fix length of hold notes --- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 41d817a746..48e1332597 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -42,8 +42,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables public DrawableHoldNote(HoldNote hitObject, ManiaAction action) : base(hitObject, action) { - RelativeSizeAxes = Axes.Both; - Height = (float)HitObject.Duration; + RelativeSizeAxes = Axes.X; AddRange(new Drawable[] { From ddc9edab5423899579c1f50ff0909e1a34e7ac2f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 14:33:28 +0900 Subject: [PATCH 181/628] Make OsuSliderBar support both float and double values --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index fd75269610..4ff65dea93 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -32,11 +32,18 @@ namespace osu.Game.Graphics.UserInterface get { var bindableDouble = CurrentNumber as BindableNumber; - if (bindableDouble != null) + var bindableFloat = CurrentNumber as BindableNumber; + var floatValue = bindableDouble?.Value ?? bindableFloat?.Value ?? null; + + if (floatValue != null) { - if (bindableDouble.MaxValue == 1 && (bindableDouble.MinValue == 0 || bindableDouble.MinValue == -1)) - return bindableDouble.Value.ToString(@"P0"); - return bindableDouble.Value.ToString(@"n1"); + var floatMinValue = bindableDouble?.MinValue ?? bindableFloat?.MinValue ?? null; + var floatMaxValue = bindableDouble?.MaxValue ?? bindableFloat?.MaxValue ?? null; + + if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) + return floatValue.Value.ToString(@"P0"); + + return floatValue.Value.ToString(@"n1"); } var bindableInt = CurrentNumber as BindableNumber; From 08af3e6303e3e95064c8b5d6e6717aa1f377fd2f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 14:34:50 +0900 Subject: [PATCH 182/628] Make OsuSliderBar formatting support variable number of digits --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 4ff65dea93..bbbe710313 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -27,6 +28,11 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; + /// + /// The amount of decimal digits to display for s with floating point values. + /// + public int TooltipDecimalDigits = 1; + public virtual string TooltipText { get @@ -43,7 +49,10 @@ namespace osu.Game.Graphics.UserInterface if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) return floatValue.Value.ToString(@"P0"); - return floatValue.Value.ToString(@"n1"); + var nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone(); + nfi.NumberDecimalDigits = TooltipDecimalDigits; + + return string.Format(nfi, "{0:F}", floatValue.Value); } var bindableInt = CurrentNumber as BindableNumber; From eaa2a007e779e8003698a8037409a1ab90f0f64d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 16:12:15 +0900 Subject: [PATCH 183/628] Cleanup --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index bbbe710313..c282ed96d6 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -39,12 +39,12 @@ namespace osu.Game.Graphics.UserInterface { var bindableDouble = CurrentNumber as BindableNumber; var bindableFloat = CurrentNumber as BindableNumber; - var floatValue = bindableDouble?.Value ?? bindableFloat?.Value ?? null; + var floatValue = bindableDouble?.Value ?? bindableFloat?.Value; if (floatValue != null) { - var floatMinValue = bindableDouble?.MinValue ?? bindableFloat?.MinValue ?? null; - var floatMaxValue = bindableDouble?.MaxValue ?? bindableFloat?.MaxValue ?? null; + var floatMinValue = bindableDouble?.MinValue ?? bindableFloat.MinValue; + var floatMaxValue = bindableDouble?.MaxValue ?? bindableFloat.MaxValue; if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) return floatValue.Value.ToString(@"P0"); From b84f83cf165cc746308fbb44f94e3c53e6e436f8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 16:12:48 +0900 Subject: [PATCH 184/628] Trigger a value changed event when the number of digits changes --- .../Graphics/UserInterface/OsuSliderBar.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index c282ed96d6..a5fb2de395 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -28,10 +28,26 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; + private int tooltipDecimalDigits = 1; /// /// The amount of decimal digits to display for s with floating point values. /// - public int TooltipDecimalDigits = 1; + public int TooltipDecimalDigits + { + get => tooltipDecimalDigits; + set + { + if (tooltipDecimalDigits == value) + return; + tooltipDecimalDigits = value; + + if (IsLoaded) + { + // Some users may want to see the updated ToolTipText + Current.TriggerChange(); + } + } + } public virtual string TooltipText { From cbf48524385b9c920f1736880ce01175b49a1c79 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 17:00:38 +0900 Subject: [PATCH 185/628] Expose a NumberFormatInfo for more extensibility --- .../Graphics/UserInterface/OsuSliderBar.cs | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index a5fb2de395..701a9d4460 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -28,18 +28,15 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; - private int tooltipDecimalDigits = 1; - /// - /// The amount of decimal digits to display for s with floating point values. - /// - public int TooltipDecimalDigits + private NumberFormatInfo format; + public NumberFormatInfo Format { - get => tooltipDecimalDigits; + get => format ?? (format = createDefaultFormat()); set { - if (tooltipDecimalDigits == value) + if (format == value) return; - tooltipDecimalDigits = value; + format = value; if (IsLoaded) { @@ -63,17 +60,14 @@ namespace osu.Game.Graphics.UserInterface var floatMaxValue = bindableDouble?.MaxValue ?? bindableFloat.MaxValue; if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) - return floatValue.Value.ToString(@"P0"); + return floatValue.Value.ToString("P", Format); - var nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone(); - nfi.NumberDecimalDigits = TooltipDecimalDigits; - - return string.Format(nfi, "{0:F}", floatValue.Value); + return floatValue.Value.ToString("F", Format); } var bindableInt = CurrentNumber as BindableNumber; if (bindableInt != null) - return bindableInt.Value.ToString(@"n0"); + return bindableInt.Value.ToString("N0"); return Current.Value.ToString(); } @@ -137,6 +131,15 @@ namespace osu.Game.Graphics.UserInterface AccentColour = colours.Pink; } + private NumberFormatInfo createDefaultFormat() + { + var nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone(); + nfi.PercentDecimalDigits = 0; + nfi.NumberDecimalDigits = 1; + + return nfi; + } + protected override bool OnHover(InputState state) { Nub.Glowing = true; From 76f4bb1ca08d9257f1dbac24493f4a83d4d15dbf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 17:00:51 +0900 Subject: [PATCH 186/628] Add automated test cases --- .../Visual/TestCaseSliderBarPercentage.cs | 123 +++++++++++++ .../Visual/TestCaseSliderBarPrecision.cs | 172 ++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 2 + 3 files changed, 297 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs create mode 100644 osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs new file mode 100644 index 0000000000..5c4d545348 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs @@ -0,0 +1,123 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Graphics; +using osu.Framework.Configuration; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using OpenTK; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseSliderBarPercentage : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] { typeof(OsuSliderBar<>) }; + + private readonly BindableFloat floatValue; + private readonly BindableDouble doubleValue; + + private readonly TestSliderBar floatSliderBar; + private readonly TestSliderBar doubleSliderBar; + + public TestCaseSliderBarPercentage() + { + floatValue = new BindableFloat + { + MinValue = -1, + MaxValue = 1, + }; + + doubleValue = new BindableDouble + { + MinValue = -1, + MaxValue = 1 + }; + + Child = new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + Width = 300, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 20), + Children = new Drawable[] + { + floatSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, + doubleSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X } + } + }; + + floatSliderBar.Current.BindTo(floatValue); + doubleSliderBar.Current.BindTo(doubleValue); + + floatValue.ValueChanged += setValue; + doubleValue.ValueChanged += setValue; + + AddStep("Digits = 0", () => setPercentageDigits(0)); + AddStep("Value = 0", () => setValue(0)); + AddAssert("Check 0%", () => checkExact(0)); + + AddStep("Value = 0.5", () => setValue(0.5)); + AddAssert("Check 50%", () => checkExact(0.5m)); + + AddStep("Value = 0.54", () => setValue(0.54)); + AddAssert("Check 54%", () => checkExact(0.54m)); + + AddStep("Value = 0.544", () => setValue(0.544)); + AddAssert("Check 54%", () => checkExact(0.54m)); + + AddStep("Value = 0.548", () => setValue(0.548)); + AddAssert("Check 55%", () => checkExact(0.55m)); + + AddStep("Digits = 1", () => setPercentageDigits(1)); + AddAssert("Check 54.8%", () => checkExact(0.548m)); + + AddSliderStep("Percentage", -1.0, 1.0, 0.0, setValue); + AddSliderStep("Digits", 0, 7, 1, setPercentageDigits); + } + + private bool checkExact(decimal percentage) + { + string expectedValue = percentage.ToString("P", floatSliderBar.Format); + return floatSliderBar.TooltipText == expectedValue && doubleSliderBar.TooltipText == expectedValue; + } + + private void setValue(T value) + { + floatValue.Value = Convert.ToSingle(value); + doubleValue.Value = Convert.ToDouble(value); + } + + private void setPercentageDigits(int digits) + { + floatSliderBar.Format.PercentDecimalDigits = digits; + doubleSliderBar.Format.PercentDecimalDigits = digits; + + // Make sure that the text referenced in TestSliderBar is updated + // This doesn't break any assertions if missing, but breaks the visual display + floatSliderBar.Current.TriggerChange(); + doubleSliderBar.Current.TriggerChange(); + } + + private class TestSliderBar : OsuSliderBar + where T : struct, IEquatable + { + public TestSliderBar() + { + SpriteText valueText; + AddInternal(valueText = new OsuSpriteText + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreLeft, + X = 5, + Text = TooltipText + }); + + Current.ValueChanged += v => valueText.Text = TooltipText; + } + } + } +} diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs new file mode 100644 index 0000000000..928ba0d825 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs @@ -0,0 +1,172 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using OpenTK; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseSliderBarPrecision : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] { typeof(OsuSliderBar<>) }; + + private readonly BindableInt intValue; + private readonly BindableFloat floatValue; + private readonly BindableDouble doubleValue; + + private readonly TestSliderBar intSliderBar; + private readonly TestSliderBar floatSliderBar; + private readonly TestSliderBar doubleSliderBar; + + public TestCaseSliderBarPrecision() + { + intValue = new BindableInt + { + MinValue = -1000, + MaxValue = 1000, + }; + + floatValue = new BindableFloat + { + MinValue = -1000, + MaxValue = 1000, + }; + + doubleValue = new BindableDouble + { + MinValue = -1000, + MaxValue = 1000 + }; + + Child = new FillFlowContainer + { + AutoSizeAxes = Axes.Y, + Width = 300, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 20), + Children = new Drawable[] + { + intSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, + floatSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, + doubleSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X } + } + }; + + intSliderBar.Current.BindTo(intValue); + floatSliderBar.Current.BindTo(floatValue); + doubleSliderBar.Current.BindTo(doubleValue); + + intValue.ValueChanged += setValue; + floatValue.ValueChanged += setValue; + doubleValue.ValueChanged += setValue; + + AddStep("Value = 0", () => setValue(0)); + AddStep("Digits = 0", () => setDecimalDigits(0)); + AddAssert("Check all 0", () => checkExact("0")); + + AddStep("Digits = 3", () => setDecimalDigits(3)); + AddAssert("Check 0.000", () => checkExact(0.000m)); + + AddStep("Value = 0.5", () => setValue(0.5)); + AddAssert("Check 0.500", () => checkExact(0.500m)); + + AddStep("Value = 123.4567", () => setValue(123.4567)); + AddAssert("Check 123.457", () => checkExact(123.457m)); + + AddStep("Value = 765.4312", () => setValue(765.4312)); + AddAssert("Check 765.431", () => checkExact(765.431m)); + + AddStep("Value = -12.3456", () => setValue(-12.3456)); + AddAssert("Check -12.346", () => checkExact(-12.346m)); + AddStep("Digits = 1", () => setDecimalDigits(1)); + AddAssert("Check -12.3", () => checkExact(-12.3m)); + AddStep("Digits = 0", () => setDecimalDigits(0)); + AddAssert("Check -12", () => checkExact(-12m)); + + AddStep("Value = -12.8", () => setValue(-12.8)); + AddAssert("Check -13", () => checkExact(-13m)); + AddStep("Digits = 1", () => setDecimalDigits(1)); + AddAssert("Check -12.8", () => checkExact(-12.8m)); + + AddSliderStep("Digits", 0, 7, 1, setDecimalDigits); + } + + /// + /// Checks whether all sliderbar tooltips display an exact value. + /// + /// The expected value that should be displayed. + private bool checkExact(string value) + => intSliderBar.TooltipText == value + && floatSliderBar.TooltipText == value + && doubleSliderBar.TooltipText == value; + + /// + /// Checks whether all sliderbar tooltips display an exact value. + /// + /// The expected value that should be displayed. + private bool checkExact(decimal value) + { + var expectedDecimal = value.ToString(intSliderBar.Format); + + return intSliderBar.TooltipText == Convert.ToInt32(value).ToString("N0") + && floatSliderBar.TooltipText == expectedDecimal + && doubleSliderBar.TooltipText == expectedDecimal; + } + + /// + /// Checks whether all floating-point sliderbar tooltips have a certain number of decimal digits. + /// + /// The expected number of decimal digits. + private bool checkDecimalDigits(int decimals) + => checkDecimalDigits(decimals, floatSliderBar.TooltipText) + && checkDecimalDigits(decimals, doubleSliderBar.TooltipText); + + private bool checkDecimalDigits(int decimals, string value) + => value.Length - value.IndexOf(intSliderBar.Format.NumberDecimalSeparator, StringComparison.InvariantCulture) - 1 == decimals; + + private void setValue(T value) + { + intValue.Value = Convert.ToInt32(value); + floatValue.Value = Convert.ToSingle(value); + doubleValue.Value = Convert.ToDouble(value); + } + + private void setDecimalDigits(int digits) + { + intSliderBar.Format.NumberDecimalDigits = digits; + floatSliderBar.Format.NumberDecimalDigits = digits; + doubleSliderBar.Format.NumberDecimalDigits = digits; + + // Make sure that the text referenced in TestSliderBar is updated + // This doesn't break any assertions if missing, but breaks the visual display + intSliderBar.Current.TriggerChange(); + floatSliderBar.Current.TriggerChange(); + doubleSliderBar.Current.TriggerChange(); + } + + private class TestSliderBar : OsuSliderBar + where T : struct, IEquatable + { + public TestSliderBar() + { + SpriteText valueText; + AddInternal(valueText = new OsuSpriteText + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreLeft, + X = 5, + Text = TooltipText + }); + + Current.ValueChanged += v => valueText.Text = TooltipText; + } + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8c04874e75..53d971a0b3 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -132,6 +132,8 @@ + + From b84da31174403e3790d39d2afa92a742b8686742 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 2 Jan 2018 23:20:58 +0900 Subject: [PATCH 187/628] Change in-line with framework --- osu.Game/Overlays/OnScreenDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index ce0feeb4c6..9a35551645 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -139,7 +139,7 @@ namespace osu.Game.Overlays private readonly List references = new List(); - private void trackSetting(Bindable bindable, Bindable.BindableValueChanged action) + private void trackSetting(Bindable bindable, Action action) { // we need to keep references as we bind references.Add(bindable); From 1571c10c4255213282df82ef686b77ea34900a85 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 14:37:32 +0900 Subject: [PATCH 188/628] Fix up replay settings sliderbar formatting --- osu.Game/Overlays/Settings/SettingsSlider.cs | 13 +++++++++++-- .../Screens/Play/ReplaySettings/PlaybackSettings.cs | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 49d73f77ec..db6e5e3f2e 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Settings public class SettingsSlider : SettingsItem where T : struct, IEquatable - where U : SliderBar, new() + where U : OsuSliderBar, new() { protected override Drawable CreateControl() => new U { @@ -24,6 +24,15 @@ namespace osu.Game.Overlays.Settings RelativeSizeAxes = Axes.X }; + /// + /// The format that will be used for the tooltip when the sliderbar is hovered. + /// + public NumberFormatInfo Format + { + get => ((U)Control).Format; + set => ((U)Control).Format = value; + } + public float KeyboardStep; [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 3109552532..a7b03c3742 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -59,6 +59,7 @@ namespace osu.Game.Screens.Play.ReplaySettings } }; + sliderbar.Format.NumberDecimalDigits = 2; sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x"; } From d2b135d2a81545202b25a9d7e8a625318c1d9b85 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 15:48:19 +0900 Subject: [PATCH 189/628] Give hitobjects lifetimes --- .../UI/Scrolling/ScrollingHitObjectContainer.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 4011e7ffd1..7382d46dec 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -29,11 +29,22 @@ namespace osu.Game.Rulesets.UI.Scrolling RelativeSizeAxes = Axes.Both; } + protected override bool UpdateChildrenLife() + { + foreach (var obj in Objects) + { + obj.LifetimeStart = obj.HitObject.StartTime - TimeRange - 1000; + obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime + TimeRange) + 1000; + } + + return base.UpdateChildrenLife(); + } + protected override void UpdateAfterChildrenLife() { base.UpdateAfterChildrenLife(); - // We need to calculate this as soon as possible so that hitobjects + // We need to calculate this as soon as possible after lifetimes so that hitobjects // get the final say in their positions var currentMultiplier = controlPointAt(Time.Current); From 5d12682e83335bae9725465c46495bbe17c6457b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 20:17:02 +0900 Subject: [PATCH 190/628] Initial implementation of the new (old) mania scrolling calculations --- .../Scrolling/ScrollingHitObjectContainer.cs | 46 +++++++++---------- .../UI/Scrolling/ScrollingRulesetContainer.cs | 10 ++-- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 7382d46dec..8c3e1162e3 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Lists; @@ -33,8 +34,8 @@ namespace osu.Game.Rulesets.UI.Scrolling { foreach (var obj in Objects) { - obj.LifetimeStart = obj.HitObject.StartTime - TimeRange - 1000; - obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime + TimeRange) + 1000; + obj.LifetimeStart = obj.HitObject.StartTime - TimeRange * 2; + obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + TimeRange * 2; } return base.UpdateChildrenLife(); @@ -47,27 +48,25 @@ namespace osu.Game.Rulesets.UI.Scrolling // We need to calculate this as soon as possible after lifetimes so that hitobjects // get the final say in their positions - var currentMultiplier = controlPointAt(Time.Current); + var timelinePosition = positionAt(Time.Current); foreach (var obj in AliveObjects) { - // Todo: We may need to consider scale here - var relativePosition = (Time.Current - obj.HitObject.StartTime) * currentMultiplier.Multiplier / TimeRange; - var finalPosition = (float)relativePosition * DrawSize; + var finalPosition = positionAt(obj.HitObject.StartTime); switch (direction) { case ScrollingDirection.Up: - obj.Y = -finalPosition.Y; + obj.Y = finalPosition.Y - timelinePosition.Y; break; case ScrollingDirection.Down: - obj.Y = finalPosition.Y; + obj.Y = -finalPosition.Y + timelinePosition.Y; break; case ScrollingDirection.Left: - obj.X = -finalPosition.X; + obj.X = finalPosition.X - timelinePosition.X; break; case ScrollingDirection.Right: - obj.X = finalPosition.X; + obj.X = -finalPosition.X + timelinePosition.X; break; } @@ -75,8 +74,7 @@ namespace osu.Game.Rulesets.UI.Scrolling continue; // Todo: We may need to consider scale here - var relativeEndPosition = (Time.Current - endTime.EndTime) * currentMultiplier.Multiplier / TimeRange; - var finalEndPosition = (float)relativeEndPosition * DrawSize; + var finalEndPosition = positionAt(endTime.EndTime); float length = Vector2.Distance(finalPosition, finalEndPosition); @@ -94,22 +92,24 @@ namespace osu.Game.Rulesets.UI.Scrolling } } - private readonly MultiplierControlPoint searchingPoint = new MultiplierControlPoint(); - private MultiplierControlPoint controlPointAt(double time) + private Vector2 positionAt(double time) { - if (ControlPoints.Count == 0) - return new MultiplierControlPoint(double.MinValue); + float length = 0; + for (int i = 0; i < ControlPoints.Count; i++) + { + var current = ControlPoints[i]; + var next = i < ControlPoints.Count - 1 ? ControlPoints[i + 1] : null; - if (time < ControlPoints[0].StartTime) - return ControlPoints[0]; + if (i > 0 && current.StartTime > time) + continue; - searchingPoint.StartTime = time; + // Duration of the current control point + var currentDuration = (next?.StartTime ?? double.PositiveInfinity) - current.StartTime; - int index = ControlPoints.BinarySearch(searchingPoint); - if (index < 0) - index = ~index - 1; + length += (float)(Math.Min(currentDuration, time - current.StartTime) * current.Multiplier / TimeRange); + } - return ControlPoints[index]; + return length * DrawSize; } } } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs index 73c3848f69..418013bcc1 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs @@ -70,12 +70,10 @@ namespace osu.Game.Rulesets.UI.Scrolling // Perform some post processing of the timing changes timingChanges = timingChanges - // Collapse sections after the last hit object - .Where(s => s.StartTime <= lastObjectTime) - // Collapse sections with the same start time - .GroupBy(s => s.StartTime).Select(g => g.Last()).OrderBy(s => s.StartTime) - // Collapse sections with the same beat length - .GroupBy(s => s.TimingPoint.BeatLength * s.DifficultyPoint.SpeedMultiplier).Select(g => g.First()); + // Collapse sections after the last hit object + .Where(s => s.StartTime <= lastObjectTime) + // Collapse sections with the same start time + .GroupBy(s => s.StartTime).Select(g => g.Last()).OrderBy(s => s.StartTime); DefaultControlPoints.AddRange(timingChanges); From 37d393bca0dc31692cb20ee46364a35c3d6d56ac Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2018 20:21:19 +0900 Subject: [PATCH 191/628] Update licence headers --- osu.Desktop.Deploy/App.config | 2 +- osu.Desktop.Deploy/GitHubObject.cs | 4 ++-- osu.Desktop.Deploy/GitHubRelease.cs | 4 ++-- osu.Desktop.Deploy/Program.cs | 2 +- osu.Desktop.Deploy/Properties/AssemblyInfo.cs | 2 +- osu.Desktop.Deploy/packages.config | 2 +- osu.Desktop/OsuGameDesktop.cs | 2 +- osu.Desktop/OsuTestBrowser.cs | 4 ++-- osu.Desktop/Overlays/VersionManager.cs | 2 +- osu.Desktop/Program.cs | 2 +- osu.Desktop/Properties/AssemblyInfo.cs | 4 ++-- osu.Desktop/packages.config | 2 +- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs | 2 +- osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs | 2 +- osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Catch/CatchInputManager.cs | 2 +- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs | 2 +- osu.Game.Rulesets.Catch/Mods/CatchMod.cs | 2 +- osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs | 2 +- .../Objects/Drawable/DrawableCatchHitObject.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs | 2 +- .../Objects/Drawable/DrawableJuiceStream.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Droplet.cs | 2 +- osu.Game.Rulesets.Catch/Objects/Fruit.cs | 2 +- osu.Game.Rulesets.Catch/Objects/JuiceStream.cs | 2 +- osu.Game.Rulesets.Catch/Objects/TinyDroplet.cs | 2 +- osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs | 4 ++-- osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs | 2 +- osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs | 2 +- osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs | 2 +- osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs | 2 +- osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs | 2 +- osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 2 +- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs | 2 +- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 2 +- .../Patterns/Legacy/DistanceObjectPatternGenerator.cs | 2 +- .../Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs | 2 +- .../Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs | 2 +- .../Beatmaps/Patterns/Legacy/PatternGenerator.cs | 2 +- .../Beatmaps/Patterns/Legacy/PatternType.cs | 2 +- osu.Game.Rulesets.Mania/Beatmaps/Patterns/Pattern.cs | 2 +- osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs | 2 +- osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs | 2 +- osu.Game.Rulesets.Mania/Judgements/HitWindows.cs | 2 +- osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs | 2 +- osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs | 2 +- osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs | 2 +- osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 2 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- osu.Game.Rulesets.Mania/MathUtils/FastRandom.cs | 2 +- osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs | 2 +- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 2 +- osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/BarLine.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs | 2 +- .../Objects/Drawables/DrawableHoldNoteTick.cs | 2 +- .../Objects/Drawables/DrawableManiaHitObject.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs | 2 +- .../Objects/Drawables/Pieces/LaneGlowPiece.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs | 2 +- osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 2 +- osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Note.cs | 2 +- osu.Game.Rulesets.Mania/Objects/Types/IHasColumn.cs | 2 +- osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs | 4 ++-- osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs | 2 +- .../Replays/ManiaFramedReplayInputHandler.cs | 2 +- osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs | 2 +- osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs | 2 +- osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs | 2 +- osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs | 2 +- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs | 2 +- .../Timing/ManiaSpeedAdjustmentContainer.cs | 4 ++-- osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs | 2 +- osu.Game.Rulesets.Mania/UI/Column.cs | 2 +- osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs | 2 +- osu.Game.Rulesets.Mania/UI/HitExplosion.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs | 2 +- osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs | 2 +- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs | 2 +- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs | 2 +- osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs | 2 +- osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs | 2 +- osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs | 2 +- osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 2 +- .../Objects/Drawables/Connections/ConnectionRenderer.cs | 2 +- .../Objects/Drawables/Connections/FollowPoint.cs | 2 +- .../Objects/Drawables/Connections/FollowPointRenderer.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs | 2 +- .../Objects/Drawables/DrawableOsuHitObject.cs | 2 +- .../Objects/Drawables/DrawableOsuJudgement.cs | 2 +- .../Objects/Drawables/DrawableRepeatPoint.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs | 2 +- .../Objects/Drawables/Pieces/ApproachCircle.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs | 4 ++-- .../Objects/Drawables/Pieces/ExplodePiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs | 2 +- .../Objects/Drawables/Pieces/SpinnerBackground.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs | 2 +- .../Objects/Drawables/Pieces/SpinnerSpmCounter.cs | 2 +- .../Objects/Drawables/Pieces/SpinnerTicks.cs | 4 ++-- .../Objects/Drawables/Pieces/TrianglesPiece.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/HitCircle.cs | 2 +- osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 2 +- osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- osu.Game.Rulesets.Osu/Objects/SliderTick.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Spinner.cs | 2 +- .../OsuDifficulty/OsuDifficultyCalculator.cs | 2 +- .../OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs | 2 +- .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 2 +- osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Aim.cs | 2 +- osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs | 2 +- osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Speed.cs | 2 +- osu.Game.Rulesets.Osu/OsuDifficulty/Utils/History.cs | 2 +- osu.Game.Rulesets.Osu/OsuInputManager.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs | 4 ++-- osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs | 2 +- osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs | 2 +- osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs | 2 +- osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs | 2 +- osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs | 2 +- osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs | 2 +- osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs | 2 +- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuSettings.cs | 2 +- osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs | 2 +- osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 2 +- .../Judgements/TaikoDrumRollTickJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/BarLine.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/CentreHit.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs | 2 +- .../Objects/Drawables/DrawableBarLineMajor.cs | 2 +- .../Objects/Drawables/DrawableCentreHit.cs | 2 +- .../Objects/Drawables/DrawableCentreHitStrong.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs | 2 +- .../Objects/Drawables/DrawableDrumRollTick.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 2 +- .../Objects/Drawables/DrawableHitStrong.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs | 2 +- .../Objects/Drawables/DrawableRimHitStrong.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs | 2 +- .../Objects/Drawables/DrawableTaikoHitObject.cs | 2 +- .../Objects/Drawables/Pieces/CentreHitSymbolPiece.cs | 2 +- .../Objects/Drawables/Pieces/CirclePiece.cs | 4 ++-- .../Objects/Drawables/Pieces/ElongatedCirclePiece.cs | 2 +- .../Objects/Drawables/Pieces/RimHitSymbolPiece.cs | 2 +- .../Objects/Drawables/Pieces/SwellSymbolPiece.cs | 2 +- .../Objects/Drawables/Pieces/TaikoPiece.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs | 4 ++-- osu.Game.Rulesets.Taiko/Objects/Hit.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/RimHit.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Swell.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/TaikoHitObjectDifficulty.cs | 4 ++-- osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs | 4 ++-- osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs | 2 +- .../Replays/TaikoFramedReplayInputHandler.cs | 2 +- osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoInputManager.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs | 2 +- osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs | 2 +- osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs | 2 +- osu.Game.Rulesets.Taiko/UI/HitExplosion.cs | 2 +- osu.Game.Rulesets.Taiko/UI/HitTarget.cs | 2 +- osu.Game.Rulesets.Taiko/UI/InputDrum.cs | 2 +- osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs | 4 ++-- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs | 2 +- osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs | 2 +- .../Beatmaps/Formats/LegacyStoryboardDecoderTest.cs | 2 +- osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs | 2 +- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 2 +- osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs | 2 +- osu.Game.Tests/Resources/Resource.cs | 4 ++-- osu.Game.Tests/Visual/TestCaseAllPlayers.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs | 2 +- osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs | 2 +- osu.Game.Tests/Visual/TestCaseBreakOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseButtonSystem.cs | 2 +- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 2 +- osu.Game.Tests/Visual/TestCaseContextMenu.cs | 2 +- osu.Game.Tests/Visual/TestCaseDialogOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseDirect.cs | 2 +- osu.Game.Tests/Visual/TestCaseDrawableRoom.cs | 2 +- osu.Game.Tests/Visual/TestCaseDrawings.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditor.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorCompose.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorComposeRadioButtons.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorMenuBar.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs | 2 +- osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs | 2 +- osu.Game.Tests/Visual/TestCaseGamefield.cs | 2 +- osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseGraph.cs | 2 +- osu.Game.Tests/Visual/TestCaseHistoricalSection.cs | 2 +- osu.Game.Tests/Visual/TestCaseIconButton.cs | 2 +- osu.Game.Tests/Visual/TestCaseIntroSequence.cs | 2 +- osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs | 2 +- osu.Game.Tests/Visual/TestCaseKeyCounter.cs | 2 +- osu.Game.Tests/Visual/TestCaseLeaderboard.cs | 2 +- osu.Game.Tests/Visual/TestCaseMedalOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseMods.cs | 2 +- osu.Game.Tests/Visual/TestCaseMusicController.cs | 2 +- osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs | 2 +- osu.Game.Tests/Visual/TestCaseOsuGame.cs | 2 +- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 2 +- osu.Game.Tests/Visual/TestCasePlaybackControl.cs | 2 +- osu.Game.Tests/Visual/TestCasePopupDialog.cs | 2 +- osu.Game.Tests/Visual/TestCaseRankGraph.cs | 2 +- osu.Game.Tests/Visual/TestCaseReplay.cs | 2 +- osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs | 2 +- osu.Game.Tests/Visual/TestCaseResults.cs | 2 +- osu.Game.Tests/Visual/TestCaseRoomInspector.cs | 2 +- osu.Game.Tests/Visual/TestCaseScoreCounter.cs | 2 +- osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs | 2 +- osu.Game.Tests/Visual/TestCaseSettings.cs | 2 +- osu.Game.Tests/Visual/TestCaseSkipButton.cs | 2 +- osu.Game.Tests/Visual/TestCaseSocial.cs | 2 +- osu.Game.Tests/Visual/TestCaseSongProgress.cs | 2 +- osu.Game.Tests/Visual/TestCaseStoryboard.cs | 2 +- osu.Game.Tests/Visual/TestCaseTabControl.cs | 2 +- osu.Game.Tests/Visual/TestCaseTextAwesome.cs | 2 +- osu.Game.Tests/Visual/TestCaseToolbar.cs | 2 +- osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs | 2 +- osu.Game.Tests/Visual/TestCaseUserPanel.cs | 2 +- osu.Game.Tests/Visual/TestCaseUserProfile.cs | 2 +- osu.Game.Tests/Visual/TestCaseUserRanks.cs | 2 +- osu.Game.Tests/Visual/TestCaseWaveform.cs | 2 +- osu.Game.Tests/packages.config | 2 +- osu.Game/Audio/SampleInfo.cs | 2 +- osu.Game/Beatmaps/Beatmap.cs | 2 +- osu.Game/Beatmaps/BeatmapConverter.cs | 2 +- osu.Game/Beatmaps/BeatmapDifficulty.cs | 2 +- osu.Game/Beatmaps/BeatmapInfo.cs | 2 +- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- osu.Game/Beatmaps/BeatmapMetadata.cs | 2 +- osu.Game/Beatmaps/BeatmapMetrics.cs | 2 +- osu.Game/Beatmaps/BeatmapOnlineInfo.cs | 2 +- osu.Game/Beatmaps/BeatmapProcessor.cs | 2 +- osu.Game/Beatmaps/BeatmapSetFileInfo.cs | 2 +- osu.Game/Beatmaps/BeatmapSetInfo.cs | 2 +- osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs | 2 +- osu.Game/Beatmaps/BeatmapStatistic.cs | 4 ++-- osu.Game/Beatmaps/BeatmapStore.cs | 2 +- osu.Game/Beatmaps/ControlPoints/ControlPoint.cs | 2 +- osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs | 2 +- osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs | 2 +- osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs | 4 ++-- osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs | 2 +- osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs | 4 ++-- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs | 2 +- osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs | 2 +- osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs | 2 +- osu.Game/Beatmaps/Drawables/DifficultyIcon.cs | 2 +- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Beatmaps/Formats/Decoder.cs | 2 +- osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs | 2 +- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 2 +- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 2 +- osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs | 2 +- osu.Game/Beatmaps/IO/ArchiveReader.cs | 4 ++-- osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs | 2 +- osu.Game/Beatmaps/IO/OszArchiveReader.cs | 4 ++-- osu.Game/Beatmaps/Legacy/LegacyBeatmap.cs | 2 +- osu.Game/Beatmaps/RankStatus.cs | 2 +- osu.Game/Beatmaps/Timing/BreakPeriod.cs | 4 ++-- osu.Game/Beatmaps/Timing/TimeSignatures.cs | 4 ++-- osu.Game/Beatmaps/WorkingBeatmap.cs | 2 +- osu.Game/Configuration/OsuConfigManager.cs | 2 +- osu.Game/Configuration/RandomSelectAlgorithm.cs | 2 +- osu.Game/Configuration/RankingType.cs | 4 ++-- osu.Game/Configuration/ReleaseStream.cs | 4 ++-- osu.Game/Configuration/ScoreMeterType.cs | 4 ++-- osu.Game/Configuration/ScreenshotFormat.cs | 4 ++-- osu.Game/Database/DatabaseBackedStore.cs | 2 +- osu.Game/Database/DatabaseContextFactory.cs | 2 +- osu.Game/Database/IHasPrimaryKey.cs | 2 +- osu.Game/Database/OsuDbContext.cs | 2 +- osu.Game/Graphics/Backgrounds/Background.cs | 2 +- osu.Game/Graphics/Backgrounds/Triangles.cs | 2 +- osu.Game/Graphics/Containers/BeatSyncedContainer.cs | 2 +- osu.Game/Graphics/Containers/ConstrainedIconContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuClickableContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuHoverContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuScrollContainer.cs | 2 +- osu.Game/Graphics/Containers/OsuTextFlowContainer.cs | 2 +- osu.Game/Graphics/Containers/ParallaxContainer.cs | 2 +- .../Graphics/Containers/ReverseChildIDFillFlowContainer.cs | 2 +- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 2 +- osu.Game/Graphics/Cursor/OsuContextMenuContainer.cs | 4 ++-- osu.Game/Graphics/Cursor/OsuTooltipContainer.cs | 2 +- osu.Game/Graphics/IHasAccentColour.cs | 2 +- osu.Game/Graphics/OsuColour.cs | 2 +- osu.Game/Graphics/SpriteIcon.cs | 2 +- osu.Game/Graphics/Sprites/OsuSpriteText.cs | 2 +- osu.Game/Graphics/Textures/LargeTextureStore.cs | 2 +- osu.Game/Graphics/UserInterface/BackButton.cs | 2 +- osu.Game/Graphics/UserInterface/Bar.cs | 2 +- osu.Game/Graphics/UserInterface/BarGraph.cs | 4 ++-- osu.Game/Graphics/UserInterface/BreadcrumbControl.cs | 2 +- osu.Game/Graphics/UserInterface/DialogButton.cs | 2 +- osu.Game/Graphics/UserInterface/FocusedTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/HoverClickSounds.cs | 2 +- osu.Game/Graphics/UserInterface/HoverSounds.cs | 2 +- osu.Game/Graphics/UserInterface/IconButton.cs | 2 +- osu.Game/Graphics/UserInterface/LineGraph.cs | 2 +- osu.Game/Graphics/UserInterface/LoadingAnimation.cs | 2 +- osu.Game/Graphics/UserInterface/MenuItemType.cs | 4 ++-- osu.Game/Graphics/UserInterface/Nub.cs | 2 +- osu.Game/Graphics/UserInterface/OsuButton.cs | 2 +- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuContextMenu.cs | 4 ++-- osu.Game/Graphics/UserInterface/OsuDropdown.cs | 2 +- osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs | 2 +- osu.Game/Graphics/UserInterface/OsuMenu.cs | 2 +- osu.Game/Graphics/UserInterface/OsuMenuItem.cs | 4 ++-- osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 2 +- osu.Game/Graphics/UserInterface/PageTabControl.cs | 2 +- osu.Game/Graphics/UserInterface/PercentageCounter.cs | 2 +- osu.Game/Graphics/UserInterface/ProgressBar.cs | 4 ++-- osu.Game/Graphics/UserInterface/RollingCounter.cs | 2 +- osu.Game/Graphics/UserInterface/ScoreCounter.cs | 2 +- osu.Game/Graphics/UserInterface/SearchTextBox.cs | 4 ++-- osu.Game/Graphics/UserInterface/SimpleComboCounter.cs | 4 ++-- osu.Game/Graphics/UserInterface/StarCounter.cs | 2 +- osu.Game/Graphics/UserInterface/TriangleButton.cs | 2 +- osu.Game/Graphics/UserInterface/TwoLayerButton.cs | 4 ++-- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 2 +- .../Graphics/UserInterface/Volume/VolumeControlReceptor.cs | 2 +- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 2 +- osu.Game/IO/FileInfo.cs | 2 +- osu.Game/IO/FileStore.cs | 2 +- osu.Game/IO/Legacy/ILegacySerializable.cs | 4 ++-- osu.Game/IO/Legacy/SerializationReader.cs | 2 +- osu.Game/IO/Legacy/SerializationWriter.cs | 4 ++-- osu.Game/IO/Serialization/Converters/TypedListConverter.cs | 2 +- osu.Game/IO/Serialization/Converters/Vector2Converter.cs | 2 +- osu.Game/IO/Serialization/IJsonSerializable.cs | 2 +- osu.Game/IO/Serialization/KeyContractResolver.cs | 2 +- osu.Game/IPC/BeatmapIPCChannel.cs | 2 +- osu.Game/IPC/ScoreIPCChannel.cs | 2 +- osu.Game/Input/Bindings/DatabasedKeyBinding.cs | 2 +- osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs | 2 +- osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs | 2 +- osu.Game/Input/Handlers/ReplayInputHandler.cs | 4 ++-- osu.Game/Input/KeyBindingStore.cs | 2 +- osu.Game/Online/API/APIAccess.cs | 2 +- osu.Game/Online/API/APIRequest.cs | 2 +- osu.Game/Online/API/IOnlineComponent.cs | 2 +- osu.Game/Online/API/OAuth.cs | 2 +- osu.Game/Online/API/OAuthToken.cs | 2 +- osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs | 2 +- osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs | 2 +- osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs | 2 +- osu.Game/Online/API/Requests/GetBeatmapSetRequest.cs | 2 +- osu.Game/Online/API/Requests/GetMessagesRequest.cs | 4 ++-- osu.Game/Online/API/Requests/GetScoresRequest.cs | 2 +- osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs | 2 +- .../Online/API/Requests/GetUserMostPlayedBeatmapsRequest.cs | 2 +- osu.Game/Online/API/Requests/GetUserRequest.cs | 2 +- osu.Game/Online/API/Requests/GetUserScoresRequest.cs | 4 ++-- osu.Game/Online/API/Requests/GetUsersRequest.cs | 2 +- osu.Game/Online/API/Requests/ListChannelsRequest.cs | 2 +- osu.Game/Online/API/Requests/PostMessageRequest.cs | 2 +- osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs | 2 +- osu.Game/Online/Chat/Channel.cs | 2 +- osu.Game/Online/Chat/ErrorMessage.cs | 2 +- osu.Game/Online/Chat/InfoMessage.cs | 2 +- osu.Game/Online/Chat/LocalEchoMessage.cs | 2 +- osu.Game/Online/Chat/Message.cs | 2 +- osu.Game/Online/Multiplayer/GameType.cs | 2 +- osu.Game/Online/Multiplayer/Room.cs | 2 +- osu.Game/Online/Multiplayer/RoomStatus.cs | 2 +- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Overlays/BeatmapSet/AuthorInfo.cs | 2 +- osu.Game/Overlays/BeatmapSet/BasicStats.cs | 2 +- osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs | 2 +- osu.Game/Overlays/BeatmapSet/Details.cs | 2 +- osu.Game/Overlays/BeatmapSet/DownloadButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/FavouriteButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- osu.Game/Overlays/BeatmapSet/HeaderButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/Info.cs | 2 +- osu.Game/Overlays/BeatmapSet/PreviewButton.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 2 +- osu.Game/Overlays/BeatmapSet/SuccessRate.cs | 2 +- osu.Game/Overlays/BeatmapSetOverlay.cs | 2 +- osu.Game/Overlays/Chat/ChannelListItem.cs | 2 +- osu.Game/Overlays/Chat/ChannelSection.cs | 2 +- osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs | 2 +- osu.Game/Overlays/Chat/ChatLine.cs | 2 +- osu.Game/Overlays/Chat/ChatTabControl.cs | 2 +- osu.Game/Overlays/Chat/DrawableChannel.cs | 2 +- osu.Game/Overlays/ChatOverlay.cs | 2 +- osu.Game/Overlays/Dialog/PopupDialog.cs | 2 +- osu.Game/Overlays/Dialog/PopupDialogButton.cs | 2 +- osu.Game/Overlays/Dialog/PopupDialogCancelButton.cs | 2 +- osu.Game/Overlays/Dialog/PopupDialogOkButton.cs | 2 +- osu.Game/Overlays/DialogOverlay.cs | 2 +- osu.Game/Overlays/Direct/DirectGridPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectListPanel.cs | 2 +- osu.Game/Overlays/Direct/DirectPanel.cs | 2 +- osu.Game/Overlays/Direct/DownloadButton.cs | 4 ++-- osu.Game/Overlays/Direct/FilterControl.cs | 2 +- osu.Game/Overlays/Direct/Header.cs | 2 +- osu.Game/Overlays/Direct/PlayButton.cs | 2 +- osu.Game/Overlays/DirectOverlay.cs | 2 +- osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs | 4 ++-- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 2 +- osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs | 2 +- osu.Game/Overlays/KeyBinding/RulesetBindingsSection.cs | 4 ++-- osu.Game/Overlays/KeyBinding/VariantBindingsSubsection.cs | 4 ++-- osu.Game/Overlays/KeyBindingOverlay.cs | 4 ++-- osu.Game/Overlays/LoginOverlay.cs | 2 +- osu.Game/Overlays/MainSettings.cs | 2 +- osu.Game/Overlays/MedalOverlay.cs | 2 +- osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 2 +- osu.Game/Overlays/Mods/AssistedSection.cs | 2 +- osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs | 2 +- osu.Game/Overlays/Mods/DifficultyReductionSection.cs | 2 +- osu.Game/Overlays/Mods/ModButton.cs | 2 +- osu.Game/Overlays/Mods/ModButtonEmpty.cs | 2 +- osu.Game/Overlays/Mods/ModSection.cs | 2 +- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- osu.Game/Overlays/Music/CollectionsDropdown.cs | 2 +- osu.Game/Overlays/Music/FilterControl.cs | 2 +- osu.Game/Overlays/Music/PlaylistItem.cs | 2 +- osu.Game/Overlays/Music/PlaylistList.cs | 2 +- osu.Game/Overlays/Music/PlaylistOverlay.cs | 2 +- osu.Game/Overlays/MusicController.cs | 2 +- osu.Game/Overlays/NotificationOverlay.cs | 2 +- osu.Game/Overlays/Notifications/IHasCompletionTarget.cs | 4 ++-- osu.Game/Overlays/Notifications/Notification.cs | 2 +- osu.Game/Overlays/Notifications/NotificationSection.cs | 2 +- .../Overlays/Notifications/ProgressCompletionNotification.cs | 4 ++-- osu.Game/Overlays/Notifications/ProgressNotification.cs | 2 +- osu.Game/Overlays/Notifications/SimpleNotification.cs | 2 +- osu.Game/Overlays/OnScreenDisplay.cs | 2 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 2 +- osu.Game/Overlays/Profile/ProfileSection.cs | 2 +- osu.Game/Overlays/Profile/RankGraph.cs | 2 +- osu.Game/Overlays/Profile/Sections/AboutSection.cs | 2 +- .../Overlays/Profile/Sections/BeatmapMetadataContainer.cs | 2 +- .../Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs | 2 +- osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs | 2 +- osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs | 2 +- .../Profile/Sections/Historical/DrawableMostPlayedRow.cs | 2 +- .../Historical/PaginatedMostPlayedBeatmapContainer.cs | 2 +- osu.Game/Overlays/Profile/Sections/HistoricalSection.cs | 2 +- osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs | 2 +- osu.Game/Overlays/Profile/Sections/KudosuSection.cs | 2 +- osu.Game/Overlays/Profile/Sections/MedalsSection.cs | 2 +- osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs | 2 +- .../Profile/Sections/Ranks/DrawablePerformanceScore.cs | 2 +- .../Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs | 2 +- .../Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs | 2 +- .../Profile/Sections/Ranks/PaginatedScoreContainer.cs | 2 +- .../Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs | 2 +- osu.Game/Overlays/Profile/Sections/RanksSection.cs | 2 +- osu.Game/Overlays/Profile/Sections/RecentSection.cs | 2 +- osu.Game/Overlays/Profile/SupporterIcon.cs | 2 +- osu.Game/Overlays/SearchableList/DisplayStyleControl.cs | 2 +- osu.Game/Overlays/SearchableList/HeaderTabControl.cs | 2 +- .../Overlays/SearchableList/SearchableListFilterControl.cs | 2 +- osu.Game/Overlays/SearchableList/SearchableListHeader.cs | 2 +- osu.Game/Overlays/SearchableList/SearchableListOverlay.cs | 2 +- osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs | 2 +- osu.Game/Overlays/Settings/DangerousSettingsButton.cs | 2 +- .../Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/AudioSection.cs | 2 +- osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/DebugSection.cs | 4 ++-- .../Overlays/Settings/Sections/Gameplay/GeneralSettings.cs | 2 +- .../Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/GameplaySection.cs | 4 ++-- .../Overlays/Settings/Sections/General/LanguageSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/GeneralSection.cs | 2 +- .../Overlays/Settings/Sections/Graphics/DetailSettings.cs | 2 +- .../Overlays/Settings/Sections/Graphics/LayoutSettings.cs | 2 +- .../Overlays/Settings/Sections/Graphics/MainMenuSettings.cs | 2 +- .../Overlays/Settings/Sections/Graphics/RendererSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/GraphicsSection.cs | 2 +- osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/InputSection.cs | 2 +- .../Settings/Sections/Maintenance/DeleteAllBeatmapsDialog.cs | 2 +- .../Overlays/Settings/Sections/Maintenance/GeneralSettings.cs | 2 +- osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs | 2 +- osu.Game/Overlays/Settings/Sections/OnlineSection.cs | 4 ++-- osu.Game/Overlays/Settings/Sections/SkinSection.cs | 2 +- osu.Game/Overlays/Settings/SettingsButton.cs | 2 +- osu.Game/Overlays/Settings/SettingsCheckbox.cs | 2 +- osu.Game/Overlays/Settings/SettingsDropdown.cs | 2 +- osu.Game/Overlays/Settings/SettingsEnumDropdown.cs | 2 +- osu.Game/Overlays/Settings/SettingsFooter.cs | 4 ++-- osu.Game/Overlays/Settings/SettingsHeader.cs | 4 ++-- osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- osu.Game/Overlays/Settings/SettingsLabel.cs | 2 +- osu.Game/Overlays/Settings/SettingsSection.cs | 2 +- osu.Game/Overlays/Settings/SettingsSlider.cs | 2 +- osu.Game/Overlays/Settings/SettingsSubsection.cs | 2 +- osu.Game/Overlays/Settings/SettingsTextBox.cs | 2 +- osu.Game/Overlays/Settings/Sidebar.cs | 2 +- osu.Game/Overlays/Settings/SidebarButton.cs | 2 +- osu.Game/Overlays/SettingsOverlay.cs | 2 +- osu.Game/Overlays/Social/FilterControl.cs | 2 +- osu.Game/Overlays/Social/Header.cs | 2 +- osu.Game/Overlays/SocialOverlay.cs | 2 +- osu.Game/Overlays/Toolbar/Toolbar.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarChatButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarModeButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserArea.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- osu.Game/Overlays/UserProfileOverlay.cs | 2 +- osu.Game/Overlays/WaveOverlayContainer.cs | 2 +- osu.Game/Properties/AssemblyInfo.cs | 4 ++-- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 2 +- osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs | 2 +- osu.Game/Rulesets/Edit/Layers/Selection/HandleContainer.cs | 2 +- .../Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs | 2 +- osu.Game/Rulesets/Edit/Layers/Selection/OriginHandle.cs | 2 +- osu.Game/Rulesets/Edit/Layers/Selection/SelectionInfo.cs | 2 +- osu.Game/Rulesets/Edit/Layers/Selection/SelectionLayer.cs | 2 +- osu.Game/Rulesets/Edit/ToolboxGroup.cs | 2 +- osu.Game/Rulesets/Edit/Tools/HitObjectCompositionTool.cs | 2 +- osu.Game/Rulesets/Edit/Tools/ICompositionTool.cs | 2 +- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 2 +- osu.Game/Rulesets/Judgements/Judgement.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableFailOverride.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableMod.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToClock.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToHitObject.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs | 2 +- osu.Game/Rulesets/Mods/Mod.cs | 2 +- osu.Game/Rulesets/Mods/ModAutoplay.cs | 2 +- osu.Game/Rulesets/Mods/ModCinema.cs | 4 ++-- osu.Game/Rulesets/Mods/ModDaycore.cs | 4 ++-- osu.Game/Rulesets/Mods/ModDoubleTime.cs | 4 ++-- osu.Game/Rulesets/Mods/ModEasy.cs | 4 ++-- osu.Game/Rulesets/Mods/ModFlashlight.cs | 4 ++-- osu.Game/Rulesets/Mods/ModHalfTime.cs | 4 ++-- osu.Game/Rulesets/Mods/ModHardRock.cs | 2 +- osu.Game/Rulesets/Mods/ModHidden.cs | 4 ++-- osu.Game/Rulesets/Mods/ModNightcore.cs | 4 ++-- osu.Game/Rulesets/Mods/ModNoFail.cs | 2 +- osu.Game/Rulesets/Mods/ModPerfect.cs | 2 +- osu.Game/Rulesets/Mods/ModRelax.cs | 4 ++-- osu.Game/Rulesets/Mods/ModSuddenDeath.cs | 2 +- osu.Game/Rulesets/Mods/ModType.cs | 2 +- osu.Game/Rulesets/Mods/MultiMod.cs | 4 ++-- osu.Game/Rulesets/Objects/BezierApproximator.cs | 4 ++-- osu.Game/Rulesets/Objects/CircularArcApproximator.cs | 2 +- osu.Game/Rulesets/Objects/Drawables/ArmedState.cs | 4 ++-- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 2 +- .../Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs | 4 ++-- .../Drawables/IDrawableHitObjectWithProxiedApproach.cs | 2 +- osu.Game/Rulesets/Objects/Drawables/IScrollingHitObject.cs | 4 ++-- osu.Game/Rulesets/Objects/HitObject.cs | 2 +- osu.Game/Rulesets/Objects/HitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHit.cs | 2 +- .../Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSlider.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSpinner.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs | 4 ++-- osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHit.cs | 2 +- .../Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHold.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSlider.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSpinner.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs | 2 +- .../Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHit.cs | 2 +- .../Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSlider.cs | 2 +- osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSpinner.cs | 2 +- osu.Game/Rulesets/Objects/SliderCurve.cs | 2 +- osu.Game/Rulesets/Objects/Types/CurveType.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasCombo.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasCurve.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasDistance.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasEndTime.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasHold.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasPosition.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasRepeats.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasXPosition.cs | 2 +- osu.Game/Rulesets/Objects/Types/IHasYPosition.cs | 2 +- osu.Game/Rulesets/Replays/AutoGenerator.cs | 2 +- osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs | 2 +- osu.Game/Rulesets/Replays/IAutoGenerator.cs | 2 +- osu.Game/Rulesets/Replays/Replay.cs | 2 +- osu.Game/Rulesets/Replays/ReplayButtonState.cs | 4 ++-- osu.Game/Rulesets/Replays/ReplayFrame.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 2 +- osu.Game/Rulesets/RulesetInfo.cs | 2 +- osu.Game/Rulesets/RulesetStore.cs | 2 +- osu.Game/Rulesets/Scoring/HitResult.cs | 2 +- osu.Game/Rulesets/Scoring/PerformanceCalculator.cs | 2 +- osu.Game/Rulesets/Scoring/Score.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreRank.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreStore.cs | 2 +- osu.Game/Rulesets/Timing/LinearScrollingContainer.cs | 2 +- osu.Game/Rulesets/Timing/MultiplierControlPoint.cs | 2 +- osu.Game/Rulesets/Timing/ScrollingContainer.cs | 2 +- osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs | 2 +- osu.Game/Rulesets/UI/ModIcon.cs | 2 +- osu.Game/Rulesets/UI/Playfield.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 2 +- osu.Game/Rulesets/UI/ScrollingPlayfield.cs | 2 +- osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs | 2 +- osu.Game/Screens/BackgroundScreen.cs | 2 +- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 2 +- osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs | 4 ++-- osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs | 2 +- osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs | 4 ++-- osu.Game/Screens/Charts/ChartInfo.cs | 2 +- osu.Game/Screens/Charts/ChartListing.cs | 2 +- osu.Game/Screens/Direct/OnlineListing.cs | 2 +- osu.Game/Screens/Edit/Components/BottomBarContainer.cs | 2 +- osu.Game/Screens/Edit/Components/PlaybackControl.cs | 2 +- osu.Game/Screens/Edit/Components/TimeInfoContainer.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/BreakPart.cs | 2 +- .../Components/Timelines/Summary/Parts/ControlPointPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/MarkerPart.cs | 2 +- .../Edit/Components/Timelines/Summary/Parts/TimelinePart.cs | 2 +- .../Edit/Components/Timelines/Summary/SummaryTimeline.cs | 2 +- .../Timelines/Summary/Visualisations/DurationVisualisation.cs | 2 +- .../Timelines/Summary/Visualisations/PointVisualisation.cs | 2 +- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 2 +- osu.Game/Screens/Edit/Menus/EditorMenuItem.cs | 2 +- osu.Game/Screens/Edit/Menus/EditorMenuItemSpacer.cs | 2 +- osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs | 2 +- osu.Game/Screens/Edit/Screens/Compose/Compose.cs | 2 +- .../Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs | 2 +- .../Screens/Edit/Screens/Compose/RadioButtons/RadioButton.cs | 2 +- .../Screens/Compose/RadioButtons/RadioButtonCollection.cs | 2 +- .../Edit/Screens/Compose/Timeline/BeatmapWaveformGraph.cs | 2 +- .../Edit/Screens/Compose/Timeline/ScrollableTimeline.cs | 2 +- .../Screens/Compose/Timeline/ScrollingTimelineContainer.cs | 2 +- .../Screens/Edit/Screens/Compose/Timeline/TimelineButton.cs | 2 +- osu.Game/Screens/Edit/Screens/Design/Design.cs | 2 +- osu.Game/Screens/Edit/Screens/EditorScreen.cs | 2 +- osu.Game/Screens/Edit/Screens/EditorScreenMode.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/Button.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- osu.Game/Screens/Menu/FlowContainerWithOrigin.cs | 2 +- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/IntroSequence.cs | 2 +- osu.Game/Screens/Menu/LogoVisualisation.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/Menu/MenuSideFlashes.cs | 2 +- osu.Game/Screens/Menu/OsuLogo.cs | 2 +- osu.Game/Screens/Multiplayer/DrawableGameType.cs | 2 +- osu.Game/Screens/Multiplayer/DrawableRoom.cs | 2 +- osu.Game/Screens/Multiplayer/Lobby.cs | 2 +- osu.Game/Screens/Multiplayer/Match.cs | 2 +- osu.Game/Screens/Multiplayer/MatchCreate.cs | 2 +- osu.Game/Screens/Multiplayer/ModeTypeInfo.cs | 2 +- osu.Game/Screens/Multiplayer/ParticipantInfo.cs | 2 +- osu.Game/Screens/Multiplayer/RoomInspector.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/ArrowsOverlay.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/GlowIcon.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/InfoLine.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/LetterboxOverlay.cs | 2 +- osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs | 2 +- osu.Game/Screens/Play/FailOverlay.cs | 2 +- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 2 +- osu.Game/Screens/Play/HUD/ComboCounter.cs | 2 +- osu.Game/Screens/Play/HUD/ComboResultCounter.cs | 2 +- osu.Game/Screens/Play/HUD/HealthDisplay.cs | 2 +- osu.Game/Screens/Play/HUD/ModDisplay.cs | 2 +- osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs | 2 +- osu.Game/Screens/Play/HUD/StandardComboCounter.cs | 2 +- osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs | 2 +- osu.Game/Screens/Play/HUDOverlay.cs | 2 +- osu.Game/Screens/Play/HotkeyRetryOverlay.cs | 2 +- osu.Game/Screens/Play/KeyCounter.cs | 2 +- osu.Game/Screens/Play/KeyCounterAction.cs | 4 ++-- osu.Game/Screens/Play/KeyCounterCollection.cs | 2 +- osu.Game/Screens/Play/KeyCounterKeyboard.cs | 2 +- osu.Game/Screens/Play/KeyCounterMouse.cs | 2 +- osu.Game/Screens/Play/PauseContainer.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 2 +- osu.Game/Screens/Play/ReplayPlayer.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs | 2 +- osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs | 2 +- osu.Game/Screens/Play/SkipButton.cs | 2 +- osu.Game/Screens/Play/SongProgress.cs | 2 +- osu.Game/Screens/Play/SongProgressBar.cs | 2 +- osu.Game/Screens/Play/SongProgressGraph.cs | 2 +- osu.Game/Screens/Play/SongProgressInfo.cs | 2 +- osu.Game/Screens/Play/SquareGraph.cs | 2 +- osu.Game/Screens/Ranking/AspectContainer.cs | 4 ++-- osu.Game/Screens/Ranking/ResultMode.cs | 4 ++-- osu.Game/Screens/Ranking/ResultModeButton.cs | 2 +- osu.Game/Screens/Ranking/ResultModeTabControl.cs | 4 ++-- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/Ranking/ResultsPage.cs | 2 +- osu.Game/Screens/Ranking/ResultsPageRanking.cs | 2 +- osu.Game/Screens/Ranking/ResultsPageScore.cs | 2 +- osu.Game/Screens/ScreenWhiteBox.cs | 2 +- osu.Game/Screens/Select/BeatmapCarousel.cs | 2 +- osu.Game/Screens/Select/BeatmapDeleteDialog.cs | 2 +- osu.Game/Screens/Select/BeatmapDetailArea.cs | 2 +- osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs | 2 +- osu.Game/Screens/Select/BeatmapDetails.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 2 +- osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs | 2 +- osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs | 2 +- osu.Game/Screens/Select/Carousel/CarouselGroup.cs | 2 +- osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs | 2 +- osu.Game/Screens/Select/Carousel/CarouselItem.cs | 2 +- osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs | 2 +- .../Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs | 2 +- osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs | 2 +- osu.Game/Screens/Select/Details/AdvancedStats.cs | 2 +- osu.Game/Screens/Select/Details/FailRetryGraph.cs | 2 +- osu.Game/Screens/Select/Details/UserRatings.cs | 2 +- osu.Game/Screens/Select/EditSongSelect.cs | 2 +- osu.Game/Screens/Select/Filter/GroupMode.cs | 2 +- osu.Game/Screens/Select/Filter/SortMode.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 2 +- osu.Game/Screens/Select/FilterCriteria.cs | 2 +- osu.Game/Screens/Select/Footer.cs | 2 +- osu.Game/Screens/Select/FooterButton.cs | 2 +- osu.Game/Screens/Select/ImportFromStablePopup.cs | 2 +- osu.Game/Screens/Select/Leaderboards/DrawableRank.cs | 2 +- osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 2 +- osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Screens/Select/Leaderboards/MessagePlaceholder.cs | 2 +- osu.Game/Screens/Select/Leaderboards/Placeholder.cs | 2 +- .../Select/Leaderboards/RetrievalFailurePlaceholder.cs | 2 +- osu.Game/Screens/Select/MatchSongSelect.cs | 2 +- osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs | 2 +- osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- osu.Game/Screens/Select/WedgeBackground.cs | 4 ++-- .../Screens/Tournament/Components/DrawingsConfigManager.cs | 2 +- osu.Game/Screens/Tournament/Components/VisualiserContainer.cs | 2 +- osu.Game/Screens/Tournament/Drawings.cs | 2 +- osu.Game/Screens/Tournament/Group.cs | 2 +- osu.Game/Screens/Tournament/GroupContainer.cs | 2 +- osu.Game/Screens/Tournament/ScrollingTeamContainer.cs | 2 +- osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs | 2 +- osu.Game/Screens/Tournament/Teams/ITeamList.cs | 2 +- osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs | 2 +- osu.Game/Storyboards/CommandLoop.cs | 2 +- osu.Game/Storyboards/CommandTimeline.cs | 2 +- osu.Game/Storyboards/CommandTimelineGroup.cs | 2 +- osu.Game/Storyboards/CommandTrigger.cs | 2 +- osu.Game/Storyboards/Drawables/DrawableStoryboard.cs | 2 +- osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs | 2 +- osu.Game/Storyboards/Drawables/DrawableStoryboardLayer.cs | 2 +- osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs | 2 +- osu.Game/Storyboards/Drawables/DrawablesExtensions.cs | 2 +- osu.Game/Storyboards/Drawables/IFlippable.cs | 2 +- osu.Game/Storyboards/IStoryboardElement.cs | 2 +- osu.Game/Storyboards/Storyboard.cs | 2 +- osu.Game/Storyboards/StoryboardAnimation.cs | 2 +- osu.Game/Storyboards/StoryboardLayer.cs | 2 +- osu.Game/Storyboards/StoryboardSample.cs | 2 +- osu.Game/Storyboards/StoryboardSprite.cs | 2 +- osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs | 2 +- osu.Game/Tests/Platform/TestStorage.cs | 2 +- osu.Game/Tests/Visual/OsuTestCase.cs | 2 +- osu.Game/Tests/Visual/ScreenTestCase.cs | 2 +- osu.Game/Tests/Visual/TestCasePerformancePoints.cs | 2 +- osu.Game/Tests/Visual/TestCasePlayer.cs | 2 +- osu.Game/Users/Avatar.cs | 2 +- osu.Game/Users/Country.cs | 2 +- osu.Game/Users/Medal.cs | 2 +- osu.Game/Users/Team.cs | 2 +- osu.Game/Users/UpdateableAvatar.cs | 2 +- osu.Game/Users/User.cs | 2 +- osu.Game/Users/UserCoverBackground.cs | 2 +- osu.Game/Users/UserPanel.cs | 2 +- osu.Game/Users/UserStatistics.cs | 2 +- osu.Game/Users/UserStatus.cs | 2 +- osu.Game/packages.config | 2 +- osu.licenseheader | 4 ++-- 879 files changed, 970 insertions(+), 970 deletions(-) diff --git a/osu.Desktop.Deploy/App.config b/osu.Desktop.Deploy/App.config index 2fbea810f6..2b948f0a20 100644 --- a/osu.Desktop.Deploy/App.config +++ b/osu.Desktop.Deploy/App.config @@ -1,6 +1,6 @@  diff --git a/osu.Desktop.Deploy/GitHubObject.cs b/osu.Desktop.Deploy/GitHubObject.cs index a91e7273a4..59c15f8015 100644 --- a/osu.Desktop.Deploy/GitHubObject.cs +++ b/osu.Desktop.Deploy/GitHubObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; @@ -13,4 +13,4 @@ namespace osu.Desktop.Deploy [JsonProperty(@"name")] public string Name; } -} \ No newline at end of file +} diff --git a/osu.Desktop.Deploy/GitHubRelease.cs b/osu.Desktop.Deploy/GitHubRelease.cs index fe372a7825..22820b047a 100644 --- a/osu.Desktop.Deploy/GitHubRelease.cs +++ b/osu.Desktop.Deploy/GitHubRelease.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; @@ -25,4 +25,4 @@ namespace osu.Desktop.Deploy [JsonProperty(@"upload_url")] public string UploadUrl; } -} \ No newline at end of file +} diff --git a/osu.Desktop.Deploy/Program.cs b/osu.Desktop.Deploy/Program.cs index e90fb1e567..d8ff2bfd82 100644 --- a/osu.Desktop.Deploy/Program.cs +++ b/osu.Desktop.Deploy/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs index 5841c1b082..47e0e65180 100644 --- a/osu.Desktop.Deploy/Properties/AssemblyInfo.cs +++ b/osu.Desktop.Deploy/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; diff --git a/osu.Desktop.Deploy/packages.config b/osu.Desktop.Deploy/packages.config index 7725be5f5e..371c4c9739 100644 --- a/osu.Desktop.Deploy/packages.config +++ b/osu.Desktop.Deploy/packages.config @@ -1,6 +1,6 @@  diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 3393bbf7fb..8e6391168b 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Desktop/OsuTestBrowser.cs b/osu.Desktop/OsuTestBrowser.cs index 23617de1c0..7aae2604af 100644 --- a/osu.Desktop/OsuTestBrowser.cs +++ b/osu.Desktop/OsuTestBrowser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Platform; @@ -27,4 +27,4 @@ namespace osu.Desktop host.Window.CursorState |= CursorState.Hidden; } } -} \ No newline at end of file +} diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index c46b0e3d12..923356c610 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 720b38144c..6927568cc4 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Desktop/Properties/AssemblyInfo.cs b/osu.Desktop/Properties/AssemblyInfo.cs index 2ed304ebd7..cee9797619 100644 --- a/osu.Desktop/Properties/AssemblyInfo.cs +++ b/osu.Desktop/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu!lazer")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index 4757b50c4c..37014057a0 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -1,6 +1,6 @@  diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index 6b9ec8b9a4..dadb852654 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index 9901dbde18..e7a33d930e 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs index e9524a867d..917a076426 100644 --- a/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Catch/CatchDifficultyCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Catch/CatchInputManager.cs b/osu.Game.Rulesets.Catch/CatchInputManager.cs index 47e9b9905a..d1851d31bf 100644 --- a/osu.Game.Rulesets.Catch/CatchInputManager.cs +++ b/osu.Game.Rulesets.Catch/CatchInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index cb46c75583..35410a7a77 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs index cc5b1eaaf4..d0e22bb04e 100644 --- a/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs +++ b/osu.Game.Rulesets.Catch/Judgements/CatchJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; diff --git a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs index 66261b0f0f..d243ee69e3 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mods; diff --git a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs index 9952e85c70..109f8401c5 100644 --- a/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/CatchHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index a617b65676..f05108a57e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs index 2b2a8e7f8d..31af779943 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 9f46bbd3a4..2c327c9261 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index db0632a07d..031b70924d 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs index 2de266b3f0..87d2ab6eee 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game.Rulesets.Catch/Objects/Droplet.cs b/osu.Game.Rulesets.Catch/Objects/Droplet.cs index a2bdf830e5..4f9636e110 100644 --- a/osu.Game.Rulesets.Catch/Objects/Droplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Droplet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Catch.Objects diff --git a/osu.Game.Rulesets.Catch/Objects/Fruit.cs b/osu.Game.Rulesets.Catch/Objects/Fruit.cs index 5f1060fb51..c738984667 100644 --- a/osu.Game.Rulesets.Catch/Objects/Fruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Fruit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Catch.Objects diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 7d0d80a0ce..b1c83f5964 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Catch/Objects/TinyDroplet.cs b/osu.Game.Rulesets.Catch/Objects/TinyDroplet.cs index 231f3d5361..23b8a7e02f 100644 --- a/osu.Game.Rulesets.Catch/Objects/TinyDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/TinyDroplet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Catch.Objects diff --git a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs index dd2006c60c..4c2542c282 100644 --- a/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Catch/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu.Game.Rulesets.Catch")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 3b9eacde9c..a6dc1350be 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs index cc434b3080..cadf5b36b0 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs index 586de17f15..fca07408b3 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs index 8217265e3d..a2d18520d7 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatcherArea.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs index ce3f79bae2..fd8309c2dc 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs index 0d2dc14160..0c66d8d80a 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 76dbfa77c6..0737d1dc0c 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index 3ed9090098..bfc9db346a 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2bb0f3cd18..99799415cf 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs index b0be34dde2..d775cb392f 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 78b8957de6..8b0b59593c 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mania.Objects; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index 48a1f132c4..d15303af39 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs index f47238d749..278a4c4aab 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/EndTimeObjectPatternGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs index dd5959675c..c4ef23a982 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/HitObjectPatternGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs index d92a036bf1..5f98749f0c 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternType.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternType.cs index d645882511..2ead37e136 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternType.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/PatternType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Pattern.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Pattern.cs index 15d31406e9..d4b0eafa64 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Pattern.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Pattern.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs index 79609ba545..6862fd57c1 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/PatternGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs b/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs index 48450b51bd..aeefc2f396 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/StageDefinition.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mania.UI; diff --git a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs index ded1bc17af..43078a926e 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs index e369df6ae1..361923266c 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTailJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Scoring; diff --git a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs index 4787a4977b..62df4a30cc 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/HoldNoteTickJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Scoring; diff --git a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs index 4762a98c40..dae89bf88d 100644 --- a/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/Judgements/ManiaJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; diff --git a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs index eb0e801067..75a8543548 100644 --- a/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Mania/ManiaDifficultyCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index a574bc75ec..5e12ef5581 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 070c7b09d1..95708e4d11 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Mania/MathUtils/FastRandom.cs b/osu.Game.Rulesets.Mania/MathUtils/FastRandom.cs index f31873d1c8..e14473c478 100644 --- a/osu.Game.Rulesets.Mania/MathUtils/FastRandom.cs +++ b/osu.Game.Rulesets.Mania/MathUtils/FastRandom.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs b/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs index 954ee3f481..431afe0c68 100644 --- a/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs +++ b/osu.Game.Rulesets.Mania/Mods/IGenerateSpeedAdjustments.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index f43f37808c..4cfc4cdd2a 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index 70270af6c9..8b61d33f21 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -45,4 +45,4 @@ namespace osu.Game.Rulesets.Mania.Mods } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Objects/BarLine.cs b/osu.Game.Rulesets.Mania/Objects/BarLine.cs index 76a3d3920d..e5cba161a2 100644 --- a/osu.Game.Rulesets.Mania/Objects/BarLine.cs +++ b/osu.Game.Rulesets.Mania/Objects/BarLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps.ControlPoints; @@ -18,4 +18,4 @@ namespace osu.Game.Rulesets.Mania.Objects /// public int BeatIndex; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs index fc5ea4e116..91c83a62f0 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableBarLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; @@ -71,4 +71,4 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 41d817a746..d680b78b75 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 8ed5d2b924..fbebf40389 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 6354c6ff77..2dd648dfa8 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index aabfcafa85..1696de2880 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs index fe40532e42..d2e6547be4 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/BodyPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs index 6f022f452f..5f4a4a6ace 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/GlowPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs index 6d4ac2fb61..ee83bc93d0 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/LaneGlowPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs index 3df085c346..e8a3377689 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/Pieces/NotePiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index f72bed3142..881ce9199d 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs index 6c4cf127f3..ec502a803d 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNoteTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mania.Objects @@ -9,4 +9,4 @@ namespace osu.Game.Rulesets.Mania.Objects public class HoldNoteTick : ManiaHitObject { } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs index 7beb21f9e3..22616fa0f9 100644 --- a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Mania.Objects.Types; diff --git a/osu.Game.Rulesets.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs index 51a9a18afa..9b40a320f9 100644 --- a/osu.Game.Rulesets.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; diff --git a/osu.Game.Rulesets.Mania/Objects/Types/IHasColumn.cs b/osu.Game.Rulesets.Mania/Objects/Types/IHasColumn.cs index 8281d0d9e4..cdff2b0827 100644 --- a/osu.Game.Rulesets.Mania/Objects/Types/IHasColumn.cs +++ b/osu.Game.Rulesets.Mania/Objects/Types/IHasColumn.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mania.Objects.Types diff --git a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs index 85a8f95b14..d1aeb53aa8 100644 --- a/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Mania/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu.Game.Rulesets.Mania")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs index 153fee3ab6..6f6217f540 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaAutoGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs index 12534d6eb4..fd084f138f 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaFramedReplayInputHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs index d1bc7da911..e5c5ac9eeb 100644 --- a/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs +++ b/osu.Game.Rulesets.Mania/Replays/ManiaReplayFrame.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Replays; diff --git a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs index 140bab2225..c3b840b9f0 100644 --- a/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs +++ b/osu.Game.Rulesets.Mania/Scoring/ManiaScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs index 805553eafc..81c6c5c9d5 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseAutoGeneration.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 03886f5784..3a89101734 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index b5890b289f..2d23f652b6 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs index 8aa8c6b799..f611ae6f43 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs b/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs index 699acc477b..3a026b29af 100644 --- a/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs +++ b/osu.Game.Rulesets.Mania/Timing/GravityScrollingContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Timing; diff --git a/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs b/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs index 321b4ee92b..4ab62290af 100644 --- a/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs +++ b/osu.Game.Rulesets.Mania/Timing/ManiaSpeedAdjustmentContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Timing; @@ -26,4 +26,4 @@ namespace osu.Game.Rulesets.Mania.Timing } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs b/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs index 72e096f5aa..1cf0398d6e 100644 --- a/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs +++ b/osu.Game.Rulesets.Mania/Timing/ScrollingAlgorithm.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mania.Timing diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 2d553f8639..2f57c35be8 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs index 08478cef33..b36c9605cc 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs index 433c518929..dcf54f0819 100644 --- a/osu.Game.Rulesets.Mania/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Mania/UI/HitExplosion.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 6c164a34f0..a02c4421bd 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 91ebd08838..c97b179c93 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs b/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs index 7fd30e7d0d..de017294e4 100644 --- a/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs +++ b/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mania.UI diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs index 919ed04d5f..37cb47a83e 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index 31b374f71d..03d44c31aa 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs index 0d7fa6c334..a3f0b79475 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Cursor; diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs index 1e9e4b4686..96b9acbf78 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs index ec3aa4661c..6652a5fde2 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs index cd9c3888df..b2d9844613 100644 --- a/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Judgements/OsuJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 7b1f80f439..3f9bfc0f41 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs index 192ab0536e..c7dd12cb0c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/ConnectionRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs index ee0b5e6c50..8a93f7151f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index fca9187047..31e2cb6a45 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 72ca9b37a8..143d54a0b6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs index f5f0300ae1..a5f615027c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs index f16a41519e..716f4b629b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableOsuJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 477ced01c6..f18d982bc0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index f32a027f2e..9eaf1c80f8 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index bce7ef6141..09985752a4 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs index bbe6b3a0a0..eb7170c7e9 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs index 323f5fb297..61e9027157 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ApproachCircle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -32,4 +32,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces approachCircle.Texture = textures.Get(@"Play/osu/approachcircle"); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs index a7384b8f8e..286df14056 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/CirclePiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -63,4 +63,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces public bool OnReleased(OsuAction action) => false; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs index 7912108901..9be951e29c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/ExplodePiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -30,4 +30,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs index a80d163246..56faa335b1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/FlashPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -32,4 +32,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs index 0adfed2710..9a1208f998 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/GlowPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -36,4 +36,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces layer.Texture = textures.Get(@"Play/osu/ring-glow"); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs index 28e54c3b4e..afbf00f320 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/NumberPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; @@ -56,4 +56,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs index f66099e1c3..2347927f2e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/RingPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -35,4 +35,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces }; } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index 46b4353f9a..cf2ac5124f 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 75c2c15084..78a33482fc 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs index bdd5b71211..7c96a2a8cf 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs index 9f54ce3fa3..971914ca13 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerDisc.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs index 774511313a..182cc9d56a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerSpmCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs index fc0d436788..135fbbd8db 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerTicks.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -54,4 +54,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs index ea3ddb5051..4d3397de3e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/TrianglesPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics.Backgrounds; @@ -23,4 +23,4 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces base.Update(); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Osu/Objects/HitCircle.cs b/osu.Game.Rulesets.Osu/Objects/HitCircle.cs index be969f1e18..9f6041cb70 100644 --- a/osu.Game.Rulesets.Osu/Objects/HitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/HitCircle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Osu.Objects diff --git a/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs index cb0d177a60..31125121b0 100644 --- a/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs +++ b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Osu.Objects diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index a3a6527b31..a9c7effe53 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs index c113b7cd7a..abdbb97072 100644 --- a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Osu.Objects diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index ec51a10345..40ec57d434 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs index 7112a39f97..e6955b48e7 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Osu.Objects diff --git a/osu.Game.Rulesets.Osu/Objects/Spinner.cs b/osu.Game.Rulesets.Osu/Objects/Spinner.cs index 7d1bd9239d..2f238bb74b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Spinner.cs +++ b/osu.Game.Rulesets.Osu/Objects/Spinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 3d185ab694..70cfbebfff 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs index f8e9423e29..a1a2687cea 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 11c0df0c8c..557e59e6f4 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Aim.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Aim.cs index aad53f6fe8..361b31c7bd 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Aim.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Aim.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs index b9632e18e2..db9658087b 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Skill.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Speed.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Speed.cs index 6c43c53e35..b85904acf9 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Speed.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Skills/Speed.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Utils/History.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Utils/History.cs index d2c2e1d774..9f07248abf 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Utils/History.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Utils/History.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/OsuInputManager.cs b/osu.Game.Rulesets.Osu/OsuInputManager.cs index 56990d1351..1a7f00ea51 100644 --- a/osu.Game.Rulesets.Osu/OsuInputManager.cs +++ b/osu.Game.Rulesets.Osu/OsuInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 19d60c9046..1ba32f474d 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs index b6cf47071a..18b3a007c1 100644 --- a/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Osu/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu.Game.Mode.Osu")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs index ba774e887f..2b14949bd1 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs index 65ed9530f2..b2adeda73b 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGeneratorBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs index 0811a68392..63c9111190 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuReplayInputHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs index 38c602bc42..25d88a38f3 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuPerformanceCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index 7520e1801c..67b96f1fd9 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs index f307ff7c70..77c70c68cd 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs index 7cc0c343a2..1f64de496d 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircleHidden.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs index 25a6110459..4b3277a4e2 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index 1238572484..c395c5edb8 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs index 016909ad73..bd4be1675b 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSliderHidden.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs index 752574018c..f2d031633b 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs index 9ef94b308f..7764f3d4af 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinnerHidden.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs index 90c9e8df2c..37ca0c021b 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index d8dd6c7323..325f22f425 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 0dc6feee75..e7d47da391 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index f37b87e533..5c7413a71e 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs b/osu.Game.Rulesets.Osu/UI/OsuSettings.cs index b820f33b39..d8f0aa9ebf 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuSettings.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs b/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs index 982b339d3a..5493a5029b 100644 --- a/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs +++ b/osu.Game.Rulesets.Taiko/Audio/DrumSampleMapping.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 690b80b12c..a3c9857d0c 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs index ce5be8d148..a713b8ba8c 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoDrumRollTickJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Scoring; diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs index 70cdd1fe0e..f3dc45d78e 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Judgements; diff --git a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs index e1fe19212b..c477851335 100644 --- a/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs +++ b/osu.Game.Rulesets.Taiko/Judgements/TaikoStrongHitJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Taiko.Judgements diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs index abaa8c1bc1..8d13954cf4 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Taiko/Objects/BarLine.cs b/osu.Game.Rulesets.Taiko/Objects/BarLine.cs index 0e6ff9f758..efd7d57ed7 100644 --- a/osu.Game.Rulesets.Taiko/Objects/BarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/BarLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Taiko.Objects diff --git a/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs index f82058fe01..ff7c36a8ad 100644 --- a/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/CentreHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Taiko.Objects diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs index b30b3a1aca..0e869a48ac 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs index 7a4cf1f1f7..23c34e9863 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableBarLineMajor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs index 26aa20f1af..56a0976ddb 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs index 1dbab408de..c0bfaba5f5 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableCentreHitStrong.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index f5bafefd0b..134ea6c0bb 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index a741e35963..96485fbc9e 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 0c10c7142e..38188f89f3 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs index 249bb41d91..cf6236e872 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHitStrong.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs index 9f0cd3e061..e8492ac168 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs index 294198f3ee..b5e232a65d 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableRimHitStrong.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs index 26e6585fb9..d9ec24f302 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableSwell.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs index cc7dd2fa0f..cd8f48fb83 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs index f4c78251d0..05c3f45d80 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CentreHitSymbolPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs index 3264b77bc4..b68dac9e85 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/CirclePiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; @@ -155,4 +155,4 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces .FadeEdgeEffectTo(edge_alpha_kiai, duration, Easing.OutQuint); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs index 4642e318c4..26d099c101 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs index 60224a291d..7614f1d6d8 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/RimHitSymbolPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs index c3fdc671a4..bccfaceb56 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/SwellSymbolPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs index 4b40bbf384..fa2d1c78e3 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TaikoPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs index 211bf910a4..0ff2742be6 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/TickPiece.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs index a39d627cc4..181fee8393 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRoll.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs index 01f9caf215..f72db4db6d 100644 --- a/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/DrumRollTick.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Taiko.Objects @@ -21,4 +21,4 @@ namespace osu.Game.Rulesets.Taiko.Objects /// public double HitWindow => TickSpacing / 2; } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/Objects/Hit.cs b/osu.Game.Rulesets.Taiko/Objects/Hit.cs index 1b9b44fd99..531f4b82f6 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Hit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Hit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Taiko/Objects/RimHit.cs b/osu.Game.Rulesets.Taiko/Objects/RimHit.cs index 8e09842294..d161970c38 100644 --- a/osu.Game.Rulesets.Taiko/Objects/RimHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/RimHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Taiko.Objects diff --git a/osu.Game.Rulesets.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs index cd2876ea2d..e17d11e3e7 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs index 1be91a7d94..6e0d0e380a 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObjectDifficulty.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObjectDifficulty.cs index c8bb73abbb..54f08e9015 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObjectDifficulty.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObjectDifficulty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -124,4 +124,4 @@ namespace osu.Game.Rulesets.Taiko.Objects Odd } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs index f6a9c8f101..9a7d5618c1 100644 --- a/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs +++ b/osu.Game.Rulesets.Taiko/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu.Game.Rulesets.Taiko")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs index c43899ebf1..c1fe2c13a8 100644 --- a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs index fce0179721..05e10b6fce 100644 --- a/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoFramedReplayInputHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Replays; diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 3848e36fc9..9b8bb83bb8 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs index e74c12fa5d..8b4e77573f 100644 --- a/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Taiko/TaikoDifficultyCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Taiko/TaikoInputManager.cs b/osu.Game.Rulesets.Taiko/TaikoInputManager.cs index 1e3c0fbcf2..f668a09f21 100644 --- a/osu.Game.Rulesets.Taiko/TaikoInputManager.cs +++ b/osu.Game.Rulesets.Taiko/TaikoInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 4de9ba0ce7..940fdf4fc9 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs index 172c6e9d84..c7201150e9 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs index 96d5b20b6e..639483b196 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs index 1f13864c2a..9500a1a747 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs index 0b67613ec3..c0e8bd1b5a 100644 --- a/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs +++ b/osu.Game.Rulesets.Taiko/UI/DrawableTaikoJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Drawables; diff --git a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs index 830a01bfbc..1a9915f78e 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Taiko/UI/HitTarget.cs b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs index 8f3b6840f3..fa2b6e737f 100644 --- a/osu.Game.Rulesets.Taiko/UI/HitTarget.cs +++ b/osu.Game.Rulesets.Taiko/UI/HitTarget.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs index 9b2ea095d2..98f20fd558 100644 --- a/osu.Game.Rulesets.Taiko/UI/InputDrum.cs +++ b/osu.Game.Rulesets.Taiko/UI/InputDrum.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs index e3e1d485d8..0f5065f3ec 100644 --- a/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs +++ b/osu.Game.Rulesets.Taiko/UI/KiaiHitExplosion.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; @@ -65,4 +65,4 @@ namespace osu.Game.Rulesets.Taiko.UI Expire(); } } -} \ No newline at end of file +} diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 3fdbd056ce..fb6b3797cb 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs index 614b446181..5b2648a737 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs index d3e7958ec1..21bbc4993c 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs index a0904ee446..cd3f6d066f 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; diff --git a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs index 7143550ee2..186bd44640 100644 --- a/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/OsuJsonDecoderTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 77d78b8bd6..322f0ec608 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs index ffe735c89f..44eb385e22 100644 --- a/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/OszArchiveReaderTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; diff --git a/osu.Game.Tests/Resources/Resource.cs b/osu.Game.Tests/Resources/Resource.cs index 6c66b6818b..39c20e6b19 100644 --- a/osu.Game.Tests/Resources/Resource.cs +++ b/osu.Game.Tests/Resources/Resource.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -17,4 +17,4 @@ namespace osu.Game.Tests.Resources Assembly.LoadFrom(Path.Combine(localPath, @"osu.Game.Resources.dll")).GetManifestResourceStream($@"osu.Game.Resources.{name}"); } } -} \ No newline at end of file +} diff --git a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs index 62b99487a9..912dbc4056 100644 --- a/osu.Game.Tests/Visual/TestCaseAllPlayers.cs +++ b/osu.Game.Tests/Visual/TestCaseAllPlayers.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Tests.Visual diff --git a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs index 35cceaf6fa..f081d090c8 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatSyncedContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index c09b987407..6bfa9bd8b7 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs index a3c1ad307f..3e94de0f3e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetailArea.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs index 62aced7423..e5924fccf8 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapDetails.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index 3a50e43239..bde071c4a3 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs index 12f1cf29ee..cfeed4b1f0 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapOptionsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs index ad15833569..5ce5eb222e 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapScoresContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs index 6a2161809f..ad85b3ed52 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapSetOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs index 7760bffdaf..34abef7d76 100644 --- a/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs +++ b/osu.Game.Tests/Visual/TestCaseBreadcrumbs.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs index 328bbaedba..f9ed606080 100644 --- a/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseBreakOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Timing; diff --git a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs index 9d796617de..61da76970e 100644 --- a/osu.Game.Tests/Visual/TestCaseButtonSystem.cs +++ b/osu.Game.Tests/Visual/TestCaseButtonSystem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 5bfa6c1de4..048106da26 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseContextMenu.cs b/osu.Game.Tests/Visual/TestCaseContextMenu.cs index 45e6464149..6098187dd6 100644 --- a/osu.Game.Tests/Visual/TestCaseContextMenu.cs +++ b/osu.Game.Tests/Visual/TestCaseContextMenu.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs index 6dd84b204f..d7fbf64664 100644 --- a/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseDialogOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseDirect.cs b/osu.Game.Tests/Visual/TestCaseDirect.cs index ede17fa775..8fa576135e 100644 --- a/osu.Game.Tests/Visual/TestCaseDirect.cs +++ b/osu.Game.Tests/Visual/TestCaseDirect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs index 3bbe6de921..1bb72a5ab4 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseDrawings.cs b/osu.Game.Tests/Visual/TestCaseDrawings.cs index a6ef3b309a..204b4f133e 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawings.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Tests/Visual/TestCaseEditor.cs b/osu.Game.Tests/Visual/TestCaseEditor.cs index 6da5e514b2..37da41c228 100644 --- a/osu.Game.Tests/Visual/TestCaseEditor.cs +++ b/osu.Game.Tests/Visual/TestCaseEditor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorCompose.cs b/osu.Game.Tests/Visual/TestCaseEditorCompose.cs index d52f27f4ab..76771ecf82 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorCompose.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorCompose.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorComposeRadioButtons.cs b/osu.Game.Tests/Visual/TestCaseEditorComposeRadioButtons.cs index f8669cde4b..8717f15311 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorComposeRadioButtons.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorComposeRadioButtons.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs b/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs index 02c32dfa56..6a47933a3c 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorComposeTimeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorMenuBar.cs b/osu.Game.Tests/Visual/TestCaseEditorMenuBar.cs index 0d0f2609ef..edfcde22b3 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorMenuBar.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorMenuBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs index 6b7dedf9cf..b318d4afd3 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs b/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs index ef7404ad49..8c8699fffa 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseGamefield.cs b/osu.Game.Tests/Visual/TestCaseGamefield.cs index 9dce0cfe01..0eebd29ffe 100644 --- a/osu.Game.Tests/Visual/TestCaseGamefield.cs +++ b/osu.Game.Tests/Visual/TestCaseGamefield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps.ControlPoints; diff --git a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs index 87552c3f17..9aa5607f6d 100644 --- a/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseGameplayMenuOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseGraph.cs b/osu.Game.Tests/Visual/TestCaseGraph.cs index 4d3fd267db..99184d4689 100644 --- a/osu.Game.Tests/Visual/TestCaseGraph.cs +++ b/osu.Game.Tests/Visual/TestCaseGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Tests/Visual/TestCaseHistoricalSection.cs b/osu.Game.Tests/Visual/TestCaseHistoricalSection.cs index c60b21fa20..a7fc58f2b5 100644 --- a/osu.Game.Tests/Visual/TestCaseHistoricalSection.cs +++ b/osu.Game.Tests/Visual/TestCaseHistoricalSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseIconButton.cs b/osu.Game.Tests/Visual/TestCaseIconButton.cs index 345316708e..525e867c56 100644 --- a/osu.Game.Tests/Visual/TestCaseIconButton.cs +++ b/osu.Game.Tests/Visual/TestCaseIconButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Tests/Visual/TestCaseIntroSequence.cs b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs index ba5cf8ef46..97116e7746 100644 --- a/osu.Game.Tests/Visual/TestCaseIntroSequence.cs +++ b/osu.Game.Tests/Visual/TestCaseIntroSequence.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs index d39ac12a60..57bb36d144 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays; diff --git a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs index 7fddc92ee6..ff1b320b5a 100644 --- a/osu.Game.Tests/Visual/TestCaseKeyCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseKeyCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs index a01dbb7a6b..7b00f4a1d5 100644 --- a/osu.Game.Tests/Visual/TestCaseLeaderboard.cs +++ b/osu.Game.Tests/Visual/TestCaseLeaderboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs index bd69719f10..f11c37f5b2 100644 --- a/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseMedalOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index c78d3b1f9f..039d8bfdb6 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseMusicController.cs b/osu.Game.Tests/Visual/TestCaseMusicController.cs index 16f2fab321..9424a3fee7 100644 --- a/osu.Game.Tests/Visual/TestCaseMusicController.cs +++ b/osu.Game.Tests/Visual/TestCaseMusicController.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs index 46deca073f..b2d3ac8c4d 100644 --- a/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseNotificationOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs index 179f17ab50..9c6c50858f 100644 --- a/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseOnScreenDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseOsuGame.cs b/osu.Game.Tests/Visual/TestCaseOsuGame.cs index 3f869e7378..9e6776800e 100644 --- a/osu.Game.Tests/Visual/TestCaseOsuGame.cs +++ b/osu.Game.Tests/Visual/TestCaseOsuGame.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index 3be4a18ec5..f16cf73039 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs index ff59bb7bfd..82c0b8f4fd 100644 --- a/osu.Game.Tests/Visual/TestCasePlaybackControl.cs +++ b/osu.Game.Tests/Visual/TestCasePlaybackControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCasePopupDialog.cs b/osu.Game.Tests/Visual/TestCasePopupDialog.cs index ed9c47a253..e3bae3955a 100644 --- a/osu.Game.Tests/Visual/TestCasePopupDialog.cs +++ b/osu.Game.Tests/Visual/TestCasePopupDialog.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseRankGraph.cs b/osu.Game.Tests/Visual/TestCaseRankGraph.cs index 489fba6501..54930c51a2 100644 --- a/osu.Game.Tests/Visual/TestCaseRankGraph.cs +++ b/osu.Game.Tests/Visual/TestCaseRankGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays.Profile; diff --git a/osu.Game.Tests/Visual/TestCaseReplay.cs b/osu.Game.Tests/Visual/TestCaseReplay.cs index 8e92696e8d..451c4e013f 100644 --- a/osu.Game.Tests/Visual/TestCaseReplay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index d795b51d34..a5d8019bc1 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseResults.cs b/osu.Game.Tests/Visual/TestCaseResults.cs index 28ce9524e0..012d31e75a 100644 --- a/osu.Game.Tests/Visual/TestCaseResults.cs +++ b/osu.Game.Tests/Visual/TestCaseResults.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs index 4f167329a0..e613d87500 100644 --- a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs +++ b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs index 8f82c5e7a9..a8dc96ad72 100644 --- a/osu.Game.Tests/Visual/TestCaseScoreCounter.cs +++ b/osu.Game.Tests/Visual/TestCaseScoreCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs b/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs index 40fb22af1e..19dae312c8 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseSettings.cs b/osu.Game.Tests/Visual/TestCaseSettings.cs index 15a60386ef..923ae540db 100644 --- a/osu.Game.Tests/Visual/TestCaseSettings.cs +++ b/osu.Game.Tests/Visual/TestCaseSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseSkipButton.cs b/osu.Game.Tests/Visual/TestCaseSkipButton.cs index 296c10a980..3fd66f8be3 100644 --- a/osu.Game.Tests/Visual/TestCaseSkipButton.cs +++ b/osu.Game.Tests/Visual/TestCaseSkipButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Screens.Play; diff --git a/osu.Game.Tests/Visual/TestCaseSocial.cs b/osu.Game.Tests/Visual/TestCaseSocial.cs index ff0707c8ab..d9325d4e54 100644 --- a/osu.Game.Tests/Visual/TestCaseSocial.cs +++ b/osu.Game.Tests/Visual/TestCaseSocial.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays; diff --git a/osu.Game.Tests/Visual/TestCaseSongProgress.cs b/osu.Game.Tests/Visual/TestCaseSongProgress.cs index fe534bc679..2320e8d8db 100644 --- a/osu.Game.Tests/Visual/TestCaseSongProgress.cs +++ b/osu.Game.Tests/Visual/TestCaseSongProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game.Tests/Visual/TestCaseStoryboard.cs b/osu.Game.Tests/Visual/TestCaseStoryboard.cs index aa9618b208..089733c57e 100644 --- a/osu.Game.Tests/Visual/TestCaseStoryboard.cs +++ b/osu.Game.Tests/Visual/TestCaseStoryboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game.Tests/Visual/TestCaseTabControl.cs b/osu.Game.Tests/Visual/TestCaseTabControl.cs index 44a1732e16..5fc774ff42 100644 --- a/osu.Game.Tests/Visual/TestCaseTabControl.cs +++ b/osu.Game.Tests/Visual/TestCaseTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs index e2b4914558..830dea406a 100644 --- a/osu.Game.Tests/Visual/TestCaseTextAwesome.cs +++ b/osu.Game.Tests/Visual/TestCaseTextAwesome.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseToolbar.cs b/osu.Game.Tests/Visual/TestCaseToolbar.cs index 9f538af09b..b596c4d5e0 100644 --- a/osu.Game.Tests/Visual/TestCaseToolbar.cs +++ b/osu.Game.Tests/Visual/TestCaseToolbar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs index 866d1f56ef..cbf3dd150a 100644 --- a/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs +++ b/osu.Game.Tests/Visual/TestCaseTwoLayerButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game.Tests/Visual/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/TestCaseUserPanel.cs index 31f9789093..b18edf0ccb 100644 --- a/osu.Game.Tests/Visual/TestCaseUserPanel.cs +++ b/osu.Game.Tests/Visual/TestCaseUserPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs index 13b6509740..da81de6a3a 100644 --- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game.Tests/Visual/TestCaseUserRanks.cs b/osu.Game.Tests/Visual/TestCaseUserRanks.cs index e7b8047882..1926585f07 100644 --- a/osu.Game.Tests/Visual/TestCaseUserRanks.cs +++ b/osu.Game.Tests/Visual/TestCaseUserRanks.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game.Tests/Visual/TestCaseWaveform.cs b/osu.Game.Tests/Visual/TestCaseWaveform.cs index 4c6efd439f..87492e2332 100644 --- a/osu.Game.Tests/Visual/TestCaseWaveform.cs +++ b/osu.Game.Tests/Visual/TestCaseWaveform.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index 9fbb0537bc..62ddb99609 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -1,6 +1,6 @@  diff --git a/osu.Game/Audio/SampleInfo.cs b/osu.Game/Audio/SampleInfo.cs index 71975bf0fa..e6f4a0b8d1 100644 --- a/osu.Game/Audio/SampleInfo.cs +++ b/osu.Game/Audio/SampleInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Beatmap.cs b/osu.Game/Beatmaps/Beatmap.cs index b639de640a..4fd54e4364 100644 --- a/osu.Game/Beatmaps/Beatmap.cs +++ b/osu.Game/Beatmaps/Beatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Beatmaps/BeatmapConverter.cs b/osu.Game/Beatmaps/BeatmapConverter.cs index 924d454ae2..20de4e9680 100644 --- a/osu.Game/Beatmaps/BeatmapConverter.cs +++ b/osu.Game/Beatmaps/BeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index 03fbf9a0a7..5be786a8e2 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel.DataAnnotations.Schema; diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index 1da3dc8a54..b151570806 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 47202c4534..d7356cf100 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/BeatmapMetadata.cs b/osu.Game/Beatmaps/BeatmapMetadata.cs index 9010f922bb..a28266dc62 100644 --- a/osu.Game/Beatmaps/BeatmapMetadata.cs +++ b/osu.Game/Beatmaps/BeatmapMetadata.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/BeatmapMetrics.cs b/osu.Game/Beatmaps/BeatmapMetrics.cs index e0cd5f10e7..78527e7a02 100644 --- a/osu.Game/Beatmaps/BeatmapMetrics.cs +++ b/osu.Game/Beatmaps/BeatmapMetrics.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Beatmaps/BeatmapOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapOnlineInfo.cs index 6a988036c5..58e4b2b5aa 100644 --- a/osu.Game/Beatmaps/BeatmapOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapOnlineInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps diff --git a/osu.Game/Beatmaps/BeatmapProcessor.cs b/osu.Game/Beatmaps/BeatmapProcessor.cs index 04680fe6fb..9b528699ef 100644 --- a/osu.Game/Beatmaps/BeatmapProcessor.cs +++ b/osu.Game/Beatmaps/BeatmapProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Beatmaps/BeatmapSetFileInfo.cs b/osu.Game/Beatmaps/BeatmapSetFileInfo.cs index 0e3aa61d9f..ae4a6772a2 100644 --- a/osu.Game/Beatmaps/BeatmapSetFileInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetFileInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel.DataAnnotations; diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index a41beaab81..982e41c92c 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs index b38f74b3f7..be3107c7b9 100644 --- a/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetOnlineInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/BeatmapStatistic.cs b/osu.Game/Beatmaps/BeatmapStatistic.cs index c1838d059b..d061651e71 100644 --- a/osu.Game/Beatmaps/BeatmapStatistic.cs +++ b/osu.Game/Beatmaps/BeatmapStatistic.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; @@ -11,4 +11,4 @@ namespace osu.Game.Beatmaps public string Content; public string Name; } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/BeatmapStore.cs b/osu.Game/Beatmaps/BeatmapStore.cs index fb45c17454..02564489ad 100644 --- a/osu.Game/Beatmaps/BeatmapStore.cs +++ b/osu.Game/Beatmaps/BeatmapStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs index 115bba5d9d..2b49716853 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs index 59123380af..69988b2a29 100644 --- a/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs +++ b/osu.Game/Beatmaps/ControlPoints/ControlPointInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs index c622d5310c..69027ffd73 100644 --- a/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/DifficultyControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps.ControlPoints diff --git a/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs index 7671739cd9..566d14a0be 100644 --- a/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps.ControlPoints @@ -15,4 +15,4 @@ namespace osu.Game.Beatmaps.ControlPoints /// public bool OmitFirstBarLine; } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs index c2c13e1909..ce06cc8a7b 100644 --- a/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/SampleControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Audio; diff --git a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs index c7bdbb5dd6..0592ef38c5 100644 --- a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps.Timing; @@ -17,4 +17,4 @@ namespace osu.Game.Beatmaps.ControlPoints /// public double BeatLength = 1000; } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 687e1b2177..55aa876a1b 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs index e4904786c7..37af06e9f5 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapBackgroundSprite.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs index ba79db3f48..90ccb27228 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetCover.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs index 57a5abc4c7..2fc39c71e6 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyColouredContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 8259da9492..ace0541ea5 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 3ec83ed8d5..0ae6637167 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index a6e2699262..8eeada66e8 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs index 29e7cee336..b0798e5a87 100644 --- a/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/JsonBeatmapDecoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.IO; diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index ea29e480ec..d114c89a48 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index e5ced5f772..68c065829a 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs index 168f37e44e..b767caf817 100644 --- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Beatmaps/IO/ArchiveReader.cs b/osu.Game/Beatmaps/IO/ArchiveReader.cs index 3af2a7ea2a..453a03b882 100644 --- a/osu.Game/Beatmaps/IO/ArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/ArchiveReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -34,4 +34,4 @@ namespace osu.Game.Beatmaps.IO public abstract Stream GetUnderlyingStream(); } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs b/osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs index 79a47c8724..4a85f6f526 100644 --- a/osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs +++ b/osu.Game/Beatmaps/IO/LegacyFilesystemReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.IO.File; diff --git a/osu.Game/Beatmaps/IO/OszArchiveReader.cs b/osu.Game/Beatmaps/IO/OszArchiveReader.cs index 4e0c40d28e..e5c971889b 100644 --- a/osu.Game/Beatmaps/IO/OszArchiveReader.cs +++ b/osu.Game/Beatmaps/IO/OszArchiveReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -46,4 +46,4 @@ namespace osu.Game.Beatmaps.IO public override Stream GetUnderlyingStream() => archiveStream; } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/Legacy/LegacyBeatmap.cs b/osu.Game/Beatmaps/Legacy/LegacyBeatmap.cs index 0b8b13f902..2a79c23e0b 100644 --- a/osu.Game/Beatmaps/Legacy/LegacyBeatmap.cs +++ b/osu.Game/Beatmaps/Legacy/LegacyBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps.Legacy diff --git a/osu.Game/Beatmaps/RankStatus.cs b/osu.Game/Beatmaps/RankStatus.cs index 17a4a4aa3f..5ca358ddef 100644 --- a/osu.Game/Beatmaps/RankStatus.cs +++ b/osu.Game/Beatmaps/RankStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Beatmaps/Timing/BreakPeriod.cs b/osu.Game/Beatmaps/Timing/BreakPeriod.cs index 0cf4a0c65b..7345f0df82 100644 --- a/osu.Game/Beatmaps/Timing/BreakPeriod.cs +++ b/osu.Game/Beatmaps/Timing/BreakPeriod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps.Timing @@ -30,4 +30,4 @@ namespace osu.Game.Beatmaps.Timing /// public bool HasEffect => Duration >= MIN_BREAK_DURATION; } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/Timing/TimeSignatures.cs b/osu.Game/Beatmaps/Timing/TimeSignatures.cs index 94b36591f5..6b7d9e7e5a 100644 --- a/osu.Game/Beatmaps/Timing/TimeSignatures.cs +++ b/osu.Game/Beatmaps/Timing/TimeSignatures.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Beatmaps.Timing @@ -8,4 +8,4 @@ namespace osu.Game.Beatmaps.Timing SimpleQuadruple = 4, SimpleTriple = 3 } -} \ No newline at end of file +} diff --git a/osu.Game/Beatmaps/WorkingBeatmap.cs b/osu.Game/Beatmaps/WorkingBeatmap.cs index 8c8cf212c1..c633b94951 100644 --- a/osu.Game/Beatmaps/WorkingBeatmap.cs +++ b/osu.Game/Beatmaps/WorkingBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Audio.Track; diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index f4c7bdb586..cfa52ef13c 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Configuration/RandomSelectAlgorithm.cs b/osu.Game/Configuration/RandomSelectAlgorithm.cs index cde657dba8..6f3d151b50 100644 --- a/osu.Game/Configuration/RandomSelectAlgorithm.cs +++ b/osu.Game/Configuration/RandomSelectAlgorithm.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Configuration/RankingType.cs b/osu.Game/Configuration/RankingType.cs index ff504ba292..20483a9b73 100644 --- a/osu.Game/Configuration/RankingType.cs +++ b/osu.Game/Configuration/RankingType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; @@ -15,4 +15,4 @@ namespace osu.Game.Configuration Friends, Country } -} \ No newline at end of file +} diff --git a/osu.Game/Configuration/ReleaseStream.cs b/osu.Game/Configuration/ReleaseStream.cs index b258ab2f37..9deeb0bed8 100644 --- a/osu.Game/Configuration/ReleaseStream.cs +++ b/osu.Game/Configuration/ReleaseStream.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Configuration @@ -10,4 +10,4 @@ namespace osu.Game.Configuration //Beta40, //Stable } -} \ No newline at end of file +} diff --git a/osu.Game/Configuration/ScoreMeterType.cs b/osu.Game/Configuration/ScoreMeterType.cs index 8926f3ad81..6d4138c4c5 100644 --- a/osu.Game/Configuration/ScoreMeterType.cs +++ b/osu.Game/Configuration/ScoreMeterType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Configuration @@ -9,4 +9,4 @@ namespace osu.Game.Configuration Colour, Error } -} \ No newline at end of file +} diff --git a/osu.Game/Configuration/ScreenshotFormat.cs b/osu.Game/Configuration/ScreenshotFormat.cs index 1a1a3f8920..1bc3013af9 100644 --- a/osu.Game/Configuration/ScreenshotFormat.cs +++ b/osu.Game/Configuration/ScreenshotFormat.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; @@ -13,4 +13,4 @@ namespace osu.Game.Configuration [Description("PNG (lossless)")] Png = 2 } -} \ No newline at end of file +} diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs index d8c3ce6694..3184696266 100644 --- a/osu.Game/Database/DatabaseBackedStore.cs +++ b/osu.Game/Database/DatabaseBackedStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index 6154016083..b1917d92c4 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Platform; diff --git a/osu.Game/Database/IHasPrimaryKey.cs b/osu.Game/Database/IHasPrimaryKey.cs index 9af9852b03..c5ad5f22f9 100644 --- a/osu.Game/Database/IHasPrimaryKey.cs +++ b/osu.Game/Database/IHasPrimaryKey.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Database diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index d6fb9c8c24..091ec3487c 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/Backgrounds/Background.cs b/osu.Game/Graphics/Backgrounds/Background.cs index 4fb08a41f3..c5cc14c25f 100644 --- a/osu.Game/Graphics/Backgrounds/Background.cs +++ b/osu.Game/Graphics/Backgrounds/Background.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 6312db3ad6..5e23389b89 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs index d5d75c9e29..5a5f283fb9 100644 --- a/osu.Game/Graphics/Containers/BeatSyncedContainer.cs +++ b/osu.Game/Graphics/Containers/BeatSyncedContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs index dd2a265a0f..ad0b815957 100644 --- a/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs +++ b/osu.Game/Graphics/Containers/ConstrainedIconContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 8df533ad6e..4e95050bda 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index f67da52fc0..648985e4b1 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index 3f82ad2179..7c62e90f56 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Graphics/Containers/OsuScrollContainer.cs b/osu.Game/Graphics/Containers/OsuScrollContainer.cs index 3fc9f439fa..1d5a2af899 100644 --- a/osu.Game/Graphics/Containers/OsuScrollContainer.cs +++ b/osu.Game/Graphics/Containers/OsuScrollContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs index 143f38ced4..51adf5f232 100644 --- a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 362563507b..cb894ca382 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Graphics/Containers/ReverseChildIDFillFlowContainer.cs b/osu.Game/Graphics/Containers/ReverseChildIDFillFlowContainer.cs index 781e149078..9f028490ef 100644 --- a/osu.Game/Graphics/Containers/ReverseChildIDFillFlowContainer.cs +++ b/osu.Game/Graphics/Containers/ReverseChildIDFillFlowContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index 1e2826189b..acb74588fd 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index da117a94c1..39af99f02e 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/Cursor/OsuContextMenuContainer.cs b/osu.Game/Graphics/Cursor/OsuContextMenuContainer.cs index 1ece10bc60..d8910c5398 100644 --- a/osu.Game/Graphics/Cursor/OsuContextMenuContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuContextMenuContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Cursor; @@ -11,4 +11,4 @@ namespace osu.Game.Graphics.Cursor { protected override Menu CreateMenu() => new OsuContextMenu(); } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs index e9d84b28a3..3706f31ded 100644 --- a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/IHasAccentColour.cs b/osu.Game/Graphics/IHasAccentColour.cs index 0c6bf98db4..84120764d1 100644 --- a/osu.Game/Graphics/IHasAccentColour.cs +++ b/osu.Game/Graphics/IHasAccentColour.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Graphics/OsuColour.cs b/osu.Game/Graphics/OsuColour.cs index 70017d3c6e..8e24807eaa 100644 --- a/osu.Game/Graphics/OsuColour.cs +++ b/osu.Game/Graphics/OsuColour.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/SpriteIcon.cs b/osu.Game/Graphics/SpriteIcon.cs index 326aa2fb79..a93cb4c6cd 100644 --- a/osu.Game/Graphics/SpriteIcon.cs +++ b/osu.Game/Graphics/SpriteIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/Sprites/OsuSpriteText.cs b/osu.Game/Graphics/Sprites/OsuSpriteText.cs index cbd9d9582d..8c1c78906d 100644 --- a/osu.Game/Graphics/Sprites/OsuSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteText.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/Textures/LargeTextureStore.cs b/osu.Game/Graphics/Textures/LargeTextureStore.cs index 166364c8dd..17fa7d4e24 100644 --- a/osu.Game/Graphics/Textures/LargeTextureStore.cs +++ b/osu.Game/Graphics/Textures/LargeTextureStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Textures; diff --git a/osu.Game/Graphics/UserInterface/BackButton.cs b/osu.Game/Graphics/UserInterface/BackButton.cs index 6a3757ec0e..3f348dc19d 100644 --- a/osu.Game/Graphics/UserInterface/BackButton.cs +++ b/osu.Game/Graphics/UserInterface/BackButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/UserInterface/Bar.cs b/osu.Game/Graphics/UserInterface/Bar.cs index c25a9bf5e9..6381c242fe 100644 --- a/osu.Game/Graphics/UserInterface/Bar.cs +++ b/osu.Game/Graphics/UserInterface/Bar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/BarGraph.cs b/osu.Game/Graphics/UserInterface/BarGraph.cs index 1a980e6bd5..3bc1598191 100644 --- a/osu.Game/Graphics/UserInterface/BarGraph.cs +++ b/osu.Game/Graphics/UserInterface/BarGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; @@ -74,4 +74,4 @@ namespace osu.Game.Graphics.UserInterface } } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs index 65ece51a70..99afc02d5d 100644 --- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs +++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/DialogButton.cs b/osu.Game/Graphics/UserInterface/DialogButton.cs index f07bc4114f..99da8755bf 100644 --- a/osu.Game/Graphics/UserInterface/DialogButton.cs +++ b/osu.Game/Graphics/UserInterface/DialogButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs index 206c7a839d..6d9bf231c3 100644 --- a/osu.Game/Graphics/UserInterface/FocusedTextBox.cs +++ b/osu.Game/Graphics/UserInterface/FocusedTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs index 0fac1c8092..9fb0594524 100644 --- a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/UserInterface/HoverSounds.cs b/osu.Game/Graphics/UserInterface/HoverSounds.cs index 24dbe37567..fabb344872 100644 --- a/osu.Game/Graphics/UserInterface/HoverSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverSounds.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Graphics/UserInterface/IconButton.cs b/osu.Game/Graphics/UserInterface/IconButton.cs index afffd930ef..bcf6ab92b6 100644 --- a/osu.Game/Graphics/UserInterface/IconButton.cs +++ b/osu.Game/Graphics/UserInterface/IconButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/LineGraph.cs b/osu.Game/Graphics/UserInterface/LineGraph.cs index 35e3f10526..366c063a0c 100644 --- a/osu.Game/Graphics/UserInterface/LineGraph.cs +++ b/osu.Game/Graphics/UserInterface/LineGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs index eb8ff5be86..54f818e307 100644 --- a/osu.Game/Graphics/UserInterface/LoadingAnimation.cs +++ b/osu.Game/Graphics/UserInterface/LoadingAnimation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/UserInterface/MenuItemType.cs b/osu.Game/Graphics/UserInterface/MenuItemType.cs index bd89dbfced..21c743ecd3 100644 --- a/osu.Game/Graphics/UserInterface/MenuItemType.cs +++ b/osu.Game/Graphics/UserInterface/MenuItemType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Graphics.UserInterface @@ -9,4 +9,4 @@ namespace osu.Game.Graphics.UserInterface Highlighted, Destructive, } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/Nub.cs index f7df6cd4f4..ed2be25feb 100644 --- a/osu.Game/Graphics/UserInterface/Nub.cs +++ b/osu.Game/Graphics/UserInterface/Nub.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/OsuButton.cs b/osu.Game/Graphics/UserInterface/OsuButton.cs index 081e59d3a7..be487bc062 100644 --- a/osu.Game/Graphics/UserInterface/OsuButton.cs +++ b/osu.Game/Graphics/UserInterface/OsuButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 40ff1243dc..5e7dda8713 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs index 4ce6c98744..5335f20bf9 100644 --- a/osu.Game/Graphics/UserInterface/OsuContextMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuContextMenu.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; @@ -36,4 +36,4 @@ namespace osu.Game.Graphics.UserInterface protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint); protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint); } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/OsuDropdown.cs b/osu.Game/Graphics/UserInterface/OsuDropdown.cs index 4401b509fd..b230aa4260 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs b/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs index bf835f0165..b0711a6667 100644 --- a/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs +++ b/osu.Game/Graphics/UserInterface/OsuEnumDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/OsuMenu.cs b/osu.Game/Graphics/UserInterface/OsuMenu.cs index 7f16d73613..968c0eed98 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenu.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenu.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/UserInterface/OsuMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuMenuItem.cs index 1f78666d20..9ccbea2479 100644 --- a/osu.Game/Graphics/UserInterface/OsuMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuMenuItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -22,4 +22,4 @@ namespace osu.Game.Graphics.UserInterface Type = type; } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs index 7f193a0e1a..8c519e5371 100644 --- a/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuPasswordTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index fd75269610..1ea6e8a41d 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index decbf57ad1..032420b61e 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs index a0d48e5ebe..3fd7760802 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControlCheckbox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 3512b4cdb1..31093f1429 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/UserInterface/PageTabControl.cs b/osu.Game/Graphics/UserInterface/PageTabControl.cs index c69857a5c4..57ee334f6b 100644 --- a/osu.Game/Graphics/UserInterface/PageTabControl.cs +++ b/osu.Game/Graphics/UserInterface/PageTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index 0a402f9045..376f7a46ee 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/ProgressBar.cs b/osu.Game/Graphics/UserInterface/ProgressBar.cs index f22983a6e6..43fab9fead 100644 --- a/osu.Game/Graphics/UserInterface/ProgressBar.cs +++ b/osu.Game/Graphics/UserInterface/ProgressBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -64,4 +64,4 @@ namespace osu.Game.Graphics.UserInterface protected override void OnUserChange() => OnSeek?.Invoke(Current); } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/RollingCounter.cs b/osu.Game/Graphics/UserInterface/RollingCounter.cs index ce8d190dc0..3eeba02154 100644 --- a/osu.Game/Graphics/UserInterface/RollingCounter.cs +++ b/osu.Game/Graphics/UserInterface/RollingCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Graphics/UserInterface/ScoreCounter.cs b/osu.Game/Graphics/UserInterface/ScoreCounter.cs index ee4fc912f3..8fd9f41211 100644 --- a/osu.Game/Graphics/UserInterface/ScoreCounter.cs +++ b/osu.Game/Graphics/UserInterface/ScoreCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index ee5d3baf66..9398eb55f3 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -68,4 +68,4 @@ namespace osu.Game.Graphics.UserInterface return base.OnKeyDown(state, args); } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs index 211de72efc..cf09609516 100644 --- a/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs +++ b/osu.Game/Graphics/UserInterface/SimpleComboCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -32,4 +32,4 @@ namespace osu.Game.Graphics.UserInterface Current.Value = Current + amount; } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index b4ca0d2e02..cefa4b3e28 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Graphics/UserInterface/TriangleButton.cs b/osu.Game/Graphics/UserInterface/TriangleButton.cs index 61e9705064..c87d81641f 100644 --- a/osu.Game/Graphics/UserInterface/TriangleButton.cs +++ b/osu.Game/Graphics/UserInterface/TriangleButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs index f17b307826..751f4809dc 100644 --- a/osu.Game/Graphics/UserInterface/TwoLayerButton.cs +++ b/osu.Game/Graphics/UserInterface/TwoLayerButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -251,4 +251,4 @@ namespace osu.Game.Graphics.UserInterface } } } -} \ No newline at end of file +} diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 273a2279bf..33888e57e0 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs index 7c740f16ce..0649e4033f 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index d55b16563d..8323dade44 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/IO/FileInfo.cs b/osu.Game/IO/FileInfo.cs index 31b63ecd21..94a3d455d4 100644 --- a/osu.Game/IO/FileInfo.cs +++ b/osu.Game/IO/FileInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel.DataAnnotations.Schema; diff --git a/osu.Game/IO/FileStore.cs b/osu.Game/IO/FileStore.cs index 4eca310424..31c608a5f4 100644 --- a/osu.Game/IO/FileStore.cs +++ b/osu.Game/IO/FileStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/IO/Legacy/ILegacySerializable.cs b/osu.Game/IO/Legacy/ILegacySerializable.cs index a280a5d13a..43c12a631a 100644 --- a/osu.Game/IO/Legacy/ILegacySerializable.cs +++ b/osu.Game/IO/Legacy/ILegacySerializable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.IO.Legacy @@ -8,4 +8,4 @@ namespace osu.Game.IO.Legacy void ReadFromStream(SerializationReader sr); void WriteToStream(SerializationWriter sw); } -} \ No newline at end of file +} diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index c7ea884821..aaea22d31b 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/IO/Legacy/SerializationWriter.cs b/osu.Game/IO/Legacy/SerializationWriter.cs index 7325129128..5c2d00dca6 100644 --- a/osu.Game/IO/Legacy/SerializationWriter.cs +++ b/osu.Game/IO/Legacy/SerializationWriter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -259,4 +259,4 @@ namespace osu.Game.IO.Legacy WriteRawBytes(Encoding.UTF8.GetBytes(str)); } } -} \ No newline at end of file +} diff --git a/osu.Game/IO/Serialization/Converters/TypedListConverter.cs b/osu.Game/IO/Serialization/Converters/TypedListConverter.cs index d63cceccf3..d1cf34629d 100644 --- a/osu.Game/IO/Serialization/Converters/TypedListConverter.cs +++ b/osu.Game/IO/Serialization/Converters/TypedListConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/IO/Serialization/Converters/Vector2Converter.cs b/osu.Game/IO/Serialization/Converters/Vector2Converter.cs index 87fbd31d21..2cad4bc0fb 100644 --- a/osu.Game/IO/Serialization/Converters/Vector2Converter.cs +++ b/osu.Game/IO/Serialization/Converters/Vector2Converter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/IO/Serialization/IJsonSerializable.cs b/osu.Game/IO/Serialization/IJsonSerializable.cs index 892c266fe3..9e3aaafc81 100644 --- a/osu.Game/IO/Serialization/IJsonSerializable.cs +++ b/osu.Game/IO/Serialization/IJsonSerializable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; diff --git a/osu.Game/IO/Serialization/KeyContractResolver.cs b/osu.Game/IO/Serialization/KeyContractResolver.cs index 10375646ce..a8d1313091 100644 --- a/osu.Game/IO/Serialization/KeyContractResolver.cs +++ b/osu.Game/IO/Serialization/KeyContractResolver.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Humanizer; diff --git a/osu.Game/IPC/BeatmapIPCChannel.cs b/osu.Game/IPC/BeatmapIPCChannel.cs index 6a9019251c..64e5d526e6 100644 --- a/osu.Game/IPC/BeatmapIPCChannel.cs +++ b/osu.Game/IPC/BeatmapIPCChannel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Diagnostics; diff --git a/osu.Game/IPC/ScoreIPCChannel.cs b/osu.Game/IPC/ScoreIPCChannel.cs index ae44250e8d..7f93656549 100644 --- a/osu.Game/IPC/ScoreIPCChannel.cs +++ b/osu.Game/IPC/ScoreIPCChannel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Diagnostics; diff --git a/osu.Game/Input/Bindings/DatabasedKeyBinding.cs b/osu.Game/Input/Bindings/DatabasedKeyBinding.cs index 7e9e25aeff..d20adda8ed 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBinding.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBinding.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel.DataAnnotations.Schema; diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs index 784e6462f2..0bb7417088 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs index 745508ec9e..bf492af776 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Input/Handlers/ReplayInputHandler.cs b/osu.Game/Input/Handlers/ReplayInputHandler.cs index 5f86495580..8aa3a53cc2 100644 --- a/osu.Game/Input/Handlers/ReplayInputHandler.cs +++ b/osu.Game/Input/Handlers/ReplayInputHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -45,4 +45,4 @@ namespace osu.Game.Input.Handlers } } } -} \ No newline at end of file +} diff --git a/osu.Game/Input/KeyBindingStore.cs b/osu.Game/Input/KeyBindingStore.cs index 9e2988417a..92159ab491 100644 --- a/osu.Game/Input/KeyBindingStore.cs +++ b/osu.Game/Input/KeyBindingStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index daf56657d2..5559aadeb4 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/API/APIRequest.cs b/osu.Game/Online/API/APIRequest.cs index 71b18103b0..ce6f3c7c7d 100644 --- a/osu.Game/Online/API/APIRequest.cs +++ b/osu.Game/Online/API/APIRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/API/IOnlineComponent.cs b/osu.Game/Online/API/IOnlineComponent.cs index d213f5a0fc..a3a49b42ae 100644 --- a/osu.Game/Online/API/IOnlineComponent.cs +++ b/osu.Game/Online/API/IOnlineComponent.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Online.API diff --git a/osu.Game/Online/API/OAuth.cs b/osu.Game/Online/API/OAuth.cs index 322688ced9..a59875809e 100644 --- a/osu.Game/Online/API/OAuth.cs +++ b/osu.Game/Online/API/OAuth.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Diagnostics; diff --git a/osu.Game/Online/API/OAuthToken.cs b/osu.Game/Online/API/OAuthToken.cs index 0c9dc26b59..7d644a2628 100644 --- a/osu.Game/Online/API/OAuthToken.cs +++ b/osu.Game/Online/API/OAuthToken.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs b/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs index 1b30853421..8f011b4df7 100644 --- a/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs +++ b/osu.Game/Online/API/Requests/APIResponseBeatmapSet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs index cdcc06a65c..34ebe0c92a 100644 --- a/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs +++ b/osu.Game/Online/API/Requests/DownloadBeatmapSetRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs index 934ef7ffa2..4b6129e015 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapDetailsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; diff --git a/osu.Game/Online/API/Requests/GetBeatmapSetRequest.cs b/osu.Game/Online/API/Requests/GetBeatmapSetRequest.cs index 1e6ceaafc6..cba1d9471c 100644 --- a/osu.Game/Online/API/Requests/GetBeatmapSetRequest.cs +++ b/osu.Game/Online/API/Requests/GetBeatmapSetRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Online.API.Requests diff --git a/osu.Game/Online/API/Requests/GetMessagesRequest.cs b/osu.Game/Online/API/Requests/GetMessagesRequest.cs index 858015e29b..a8f63887a1 100644 --- a/osu.Game/Online/API/Requests/GetMessagesRequest.cs +++ b/osu.Game/Online/API/Requests/GetMessagesRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -32,4 +32,4 @@ namespace osu.Game.Online.API.Requests protected override string Target => @"chat/messages"; } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/Requests/GetScoresRequest.cs b/osu.Game/Online/API/Requests/GetScoresRequest.cs index 14605081b6..b726a3767a 100644 --- a/osu.Game/Online/API/Requests/GetScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetScoresRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs index 173562e04d..2e24b1eea4 100644 --- a/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserBeatmapsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Humanizer; diff --git a/osu.Game/Online/API/Requests/GetUserMostPlayedBeatmapsRequest.cs b/osu.Game/Online/API/Requests/GetUserMostPlayedBeatmapsRequest.cs index 431a14085f..3fcbe98b11 100644 --- a/osu.Game/Online/API/Requests/GetUserMostPlayedBeatmapsRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserMostPlayedBeatmapsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; diff --git a/osu.Game/Online/API/Requests/GetUserRequest.cs b/osu.Game/Online/API/Requests/GetUserRequest.cs index 2e3e7b01c8..6a586bfe2e 100644 --- a/osu.Game/Online/API/Requests/GetUserRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Users; diff --git a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs index 98db234196..65d50bc88a 100644 --- a/osu.Game/Online/API/Requests/GetUserScoresRequest.cs +++ b/osu.Game/Online/API/Requests/GetUserScoresRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -27,4 +27,4 @@ namespace osu.Game.Online.API.Requests Firsts, Recent } -} \ No newline at end of file +} diff --git a/osu.Game/Online/API/Requests/GetUsersRequest.cs b/osu.Game/Online/API/Requests/GetUsersRequest.cs index 5fb8606e1e..267985a253 100644 --- a/osu.Game/Online/API/Requests/GetUsersRequest.cs +++ b/osu.Game/Online/API/Requests/GetUsersRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Online/API/Requests/ListChannelsRequest.cs b/osu.Game/Online/API/Requests/ListChannelsRequest.cs index febdf5c1f0..b387af9694 100644 --- a/osu.Game/Online/API/Requests/ListChannelsRequest.cs +++ b/osu.Game/Online/API/Requests/ListChannelsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Online/API/Requests/PostMessageRequest.cs b/osu.Game/Online/API/Requests/PostMessageRequest.cs index f0c7cb9a9b..e13128cc3c 100644 --- a/osu.Game/Online/API/Requests/PostMessageRequest.cs +++ b/osu.Game/Online/API/Requests/PostMessageRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions; diff --git a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs index 4e6c70124f..d674bcde8e 100644 --- a/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs +++ b/osu.Game/Online/API/Requests/SearchBeatmapSetsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Online/Chat/Channel.cs b/osu.Game/Online/Chat/Channel.cs index 77683ae857..35952fbc6e 100644 --- a/osu.Game/Online/Chat/Channel.cs +++ b/osu.Game/Online/Chat/Channel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/Chat/ErrorMessage.cs b/osu.Game/Online/Chat/ErrorMessage.cs index 0bf18fda39..b083cb6a10 100644 --- a/osu.Game/Online/Chat/ErrorMessage.cs +++ b/osu.Game/Online/Chat/ErrorMessage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Online.Chat diff --git a/osu.Game/Online/Chat/InfoMessage.cs b/osu.Game/Online/Chat/InfoMessage.cs index edadfe351d..3e521de28d 100644 --- a/osu.Game/Online/Chat/InfoMessage.cs +++ b/osu.Game/Online/Chat/InfoMessage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/Chat/LocalEchoMessage.cs b/osu.Game/Online/Chat/LocalEchoMessage.cs index 079ec58686..1b31fe08d6 100644 --- a/osu.Game/Online/Chat/LocalEchoMessage.cs +++ b/osu.Game/Online/Chat/LocalEchoMessage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Online.Chat diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 79b5c4fc1a..bc79469ce0 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Online/Multiplayer/GameType.cs b/osu.Game/Online/Multiplayer/GameType.cs index 7bec0e94bb..01588b05d3 100644 --- a/osu.Game/Online/Multiplayer/GameType.cs +++ b/osu.Game/Online/Multiplayer/GameType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index e808f2c3ad..1971f9941c 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Online/Multiplayer/RoomStatus.cs b/osu.Game/Online/Multiplayer/RoomStatus.cs index 4f943596a7..1d82c8f6a8 100644 --- a/osu.Game/Online/Multiplayer/RoomStatus.cs +++ b/osu.Game/Online/Multiplayer/RoomStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 257b78ea0a..5604ef8f3c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index e311aea8e4..1982fa0db5 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs index 46ee5a9cdb..eec69214de 100644 --- a/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs +++ b/osu.Game/Overlays/BeatmapSet/AuthorInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Overlays/BeatmapSet/BasicStats.cs b/osu.Game/Overlays/BeatmapSet/BasicStats.cs index 3ecff85bee..1b8fff36ec 100644 --- a/osu.Game/Overlays/BeatmapSet/BasicStats.cs +++ b/osu.Game/Overlays/BeatmapSet/BasicStats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs index 2317e8562a..b09e151ebc 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index 128ea7d2d3..7f052f443f 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Overlays/BeatmapSet/DownloadButton.cs b/osu.Game/Overlays/BeatmapSet/DownloadButton.cs index 47787d2ced..9691036b87 100644 --- a/osu.Game/Overlays/BeatmapSet/DownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/DownloadButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/BeatmapSet/FavouriteButton.cs b/osu.Game/Overlays/BeatmapSet/FavouriteButton.cs index 1b22853656..51492fff44 100644 --- a/osu.Game/Overlays/BeatmapSet/FavouriteButton.cs +++ b/osu.Game/Overlays/BeatmapSet/FavouriteButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 4135aef268..36b6a9964a 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSet/HeaderButton.cs b/osu.Game/Overlays/BeatmapSet/HeaderButton.cs index ac5683de00..f859c8f692 100644 --- a/osu.Game/Overlays/BeatmapSet/HeaderButton.cs +++ b/osu.Game/Overlays/BeatmapSet/HeaderButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index b4aea898b2..a0b6d9cefa 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs index 52edd1714f..11d1769f1e 100644 --- a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs index bbb4ef767c..826a7c53f3 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ClickableUsername.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs index 2d5913d8ca..7ef86d349a 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index e3b878587d..66d7a9e4e1 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 4b496ed118..b6efd3b3b0 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index 6df31b9f85..bee1e9284b 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 0a88f586b5..f0f8a6ef10 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Chat/ChannelListItem.cs b/osu.Game/Overlays/Chat/ChannelListItem.cs index f4cf806044..19418c63a8 100644 --- a/osu.Game/Overlays/Chat/ChannelListItem.cs +++ b/osu.Game/Overlays/Chat/ChannelListItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Chat/ChannelSection.cs b/osu.Game/Overlays/Chat/ChannelSection.cs index 5068b415bc..132891bcc0 100644 --- a/osu.Game/Overlays/Chat/ChannelSection.cs +++ b/osu.Game/Overlays/Chat/ChannelSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs index 4362b3f787..3684c47e40 100644 --- a/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs +++ b/osu.Game/Overlays/Chat/ChannelSelectionOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 32f933ff42..19dede56a0 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Chat/ChatTabControl.cs b/osu.Game/Overlays/Chat/ChatTabControl.cs index f58ee8f819..f028590bb4 100644 --- a/osu.Game/Overlays/Chat/ChatTabControl.cs +++ b/osu.Game/Overlays/Chat/ChatTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index 7179d8ed90..d12df70b74 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 32e253f621..15c373356f 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Dialog/PopupDialog.cs b/osu.Game/Overlays/Dialog/PopupDialog.cs index d2bd50cad6..790c097789 100644 --- a/osu.Game/Overlays/Dialog/PopupDialog.cs +++ b/osu.Game/Overlays/Dialog/PopupDialog.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Dialog/PopupDialogButton.cs b/osu.Game/Overlays/Dialog/PopupDialogButton.cs index 5818061402..40200e6417 100644 --- a/osu.Game/Overlays/Dialog/PopupDialogButton.cs +++ b/osu.Game/Overlays/Dialog/PopupDialogButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Dialog/PopupDialogCancelButton.cs b/osu.Game/Overlays/Dialog/PopupDialogCancelButton.cs index a17c4a7bf2..38c5ea34c5 100644 --- a/osu.Game/Overlays/Dialog/PopupDialogCancelButton.cs +++ b/osu.Game/Overlays/Dialog/PopupDialogCancelButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Dialog/PopupDialogOkButton.cs b/osu.Game/Overlays/Dialog/PopupDialogOkButton.cs index 3d99987080..fb21ffc00a 100644 --- a/osu.Game/Overlays/Dialog/PopupDialogOkButton.cs +++ b/osu.Game/Overlays/Dialog/PopupDialogOkButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/DialogOverlay.cs b/osu.Game/Overlays/DialogOverlay.cs index 7853eefd2c..ef4d2bdc00 100644 --- a/osu.Game/Overlays/DialogOverlay.cs +++ b/osu.Game/Overlays/DialogOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Overlays/Direct/DirectGridPanel.cs b/osu.Game/Overlays/Direct/DirectGridPanel.cs index a40f20850e..2cc51f9e4c 100644 --- a/osu.Game/Overlays/Direct/DirectGridPanel.cs +++ b/osu.Game/Overlays/Direct/DirectGridPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Direct/DirectListPanel.cs b/osu.Game/Overlays/Direct/DirectListPanel.cs index 3a1004fd44..403eeb7e10 100644 --- a/osu.Game/Overlays/Direct/DirectListPanel.cs +++ b/osu.Game/Overlays/Direct/DirectListPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 5980cde5fd..ede9f2c412 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Direct/DownloadButton.cs b/osu.Game/Overlays/Direct/DownloadButton.cs index 28f5344eae..2b29b9c5f9 100644 --- a/osu.Game/Overlays/Direct/DownloadButton.cs +++ b/osu.Game/Overlays/Direct/DownloadButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -50,4 +50,4 @@ namespace osu.Game.Overlays.Direct icon.ScaleTo(1f, 500, Easing.OutElastic); } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Direct/FilterControl.cs b/osu.Game/Overlays/Direct/FilterControl.cs index 46ba000a28..84a09547aa 100644 --- a/osu.Game/Overlays/Direct/FilterControl.cs +++ b/osu.Game/Overlays/Direct/FilterControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Direct/Header.cs b/osu.Game/Overlays/Direct/Header.cs index 77743a3a4b..2245f70ed3 100644 --- a/osu.Game/Overlays/Direct/Header.cs +++ b/osu.Game/Overlays/Direct/Header.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 75a3358d51..e939047f1a 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 7994483043..979a357d1e 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs index 4a7e4f4e6e..8ec0a44d9b 100644 --- a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input.Bindings; @@ -28,4 +28,4 @@ namespace osu.Game.Overlays.KeyBinding } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 509a4f3856..379d25313e 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs index c670cc0153..6cbc926fc3 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingsSubsection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/KeyBinding/RulesetBindingsSection.cs b/osu.Game/Overlays/KeyBinding/RulesetBindingsSection.cs index 885e149cb2..c2a4ea8a12 100644 --- a/osu.Game/Overlays/KeyBinding/RulesetBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/RulesetBindingsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; @@ -24,4 +24,4 @@ namespace osu.Game.Overlays.KeyBinding Add(new VariantBindingsSubsection(ruleset, variant)); } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/KeyBinding/VariantBindingsSubsection.cs b/osu.Game/Overlays/KeyBinding/VariantBindingsSubsection.cs index dca5f53b4a..85a587b003 100644 --- a/osu.Game/Overlays/KeyBinding/VariantBindingsSubsection.cs +++ b/osu.Game/Overlays/KeyBinding/VariantBindingsSubsection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets; @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.KeyBinding Defaults = rulesetInstance.GetDefaultKeyBindings(variant); } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/KeyBindingOverlay.cs b/osu.Game/Overlays/KeyBindingOverlay.cs index 4394d0fec0..18e43ad39b 100644 --- a/osu.Game/Overlays/KeyBindingOverlay.cs +++ b/osu.Game/Overlays/KeyBindingOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -28,4 +28,4 @@ namespace osu.Game.Overlays { } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/LoginOverlay.cs b/osu.Game/Overlays/LoginOverlay.cs index fe3a846eb2..cc784d954d 100644 --- a/osu.Game/Overlays/LoginOverlay.cs +++ b/osu.Game/Overlays/LoginOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/MainSettings.cs b/osu.Game/Overlays/MainSettings.cs index 4fe86d62fd..be822f9b06 100644 --- a/osu.Game/Overlays/MainSettings.cs +++ b/osu.Game/Overlays/MainSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/MedalOverlay.cs b/osu.Game/Overlays/MedalOverlay.cs index 776f2ffadb..bd6adffdc7 100644 --- a/osu.Game/Overlays/MedalOverlay.cs +++ b/osu.Game/Overlays/MedalOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index c6be428987..e1a780406b 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Mods/AssistedSection.cs b/osu.Game/Overlays/Mods/AssistedSection.cs index b3cbb410e4..978b12da19 100644 --- a/osu.Game/Overlays/Mods/AssistedSection.cs +++ b/osu.Game/Overlays/Mods/AssistedSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; diff --git a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs index fc759eb7d9..cbf67893a9 100644 --- a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; diff --git a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs index dd3b5965f3..c44af8fc4d 100644 --- a/osu.Game/Overlays/Mods/DifficultyReductionSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyReductionSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Input; diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 21f07bb0a4..80823c56bf 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Mods/ModButtonEmpty.cs b/osu.Game/Overlays/Mods/ModButtonEmpty.cs index f776c174d2..e9e2683816 100644 --- a/osu.Game/Overlays/Mods/ModButtonEmpty.cs +++ b/osu.Game/Overlays/Mods/ModButtonEmpty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 50310d1b27..a43c54f994 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index cc5a17358d..96faa376ba 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Music/CollectionsDropdown.cs b/osu.Game/Overlays/Music/CollectionsDropdown.cs index 3b11d9f52a..648a00993d 100644 --- a/osu.Game/Overlays/Music/CollectionsDropdown.cs +++ b/osu.Game/Overlays/Music/CollectionsDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Music/FilterControl.cs b/osu.Game/Overlays/Music/FilterControl.cs index 52d311e501..fa437fc2e8 100644 --- a/osu.Game/Overlays/Music/FilterControl.cs +++ b/osu.Game/Overlays/Music/FilterControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 8168929f9c..9eab8f797d 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 245b2d36ce..17687a9623 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Music/PlaylistOverlay.cs b/osu.Game/Overlays/Music/PlaylistOverlay.cs index d913895159..2125984785 100644 --- a/osu.Game/Overlays/Music/PlaylistOverlay.cs +++ b/osu.Game/Overlays/Music/PlaylistOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 93ce3329df..d9e08a48ba 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/NotificationOverlay.cs b/osu.Game/Overlays/NotificationOverlay.cs index 5744e8c189..2f46bb4a71 100644 --- a/osu.Game/Overlays/NotificationOverlay.cs +++ b/osu.Game/Overlays/NotificationOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Overlays/Notifications/IHasCompletionTarget.cs b/osu.Game/Overlays/Notifications/IHasCompletionTarget.cs index 7fba75c4fc..ea2928607f 100644 --- a/osu.Game/Overlays/Notifications/IHasCompletionTarget.cs +++ b/osu.Game/Overlays/Notifications/IHasCompletionTarget.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -9,4 +9,4 @@ namespace osu.Game.Overlays.Notifications { Action CompletionTarget { get; set; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index dc2dcf2d74..66db57c18f 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index 42fcc3aa0f..d51cdb8bcc 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs index d70868046b..4cd48edcf3 100644 --- a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.Notifications IconBackgound.Colour = ColourInfo.GradientVertical(colours.GreenDark, colours.GreenLight); } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index d797372390..4106a40867 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Notifications/SimpleNotification.cs b/osu.Game/Overlays/Notifications/SimpleNotification.cs index 1e691e2a5a..c3d5a52476 100644 --- a/osu.Game/Overlays/Notifications/SimpleNotification.cs +++ b/osu.Game/Overlays/Notifications/SimpleNotification.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index ce0feeb4c6..6f0e21ca41 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 960bb60287..6a9f4b84b0 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Profile/ProfileSection.cs b/osu.Game/Overlays/Profile/ProfileSection.cs index 99178570a6..1c23fa575e 100644 --- a/osu.Game/Overlays/Profile/ProfileSection.cs +++ b/osu.Game/Overlays/Profile/ProfileSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/RankGraph.cs b/osu.Game/Overlays/Profile/RankGraph.cs index d216789b1a..9d3183339e 100644 --- a/osu.Game/Overlays/Profile/RankGraph.cs +++ b/osu.Game/Overlays/Profile/RankGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Profile/Sections/AboutSection.cs b/osu.Game/Overlays/Profile/Sections/AboutSection.cs index 1d15300eca..5c56355d65 100644 --- a/osu.Game/Overlays/Profile/Sections/AboutSection.cs +++ b/osu.Game/Overlays/Profile/Sections/AboutSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Overlays.Profile.Sections diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapMetadataContainer.cs b/osu.Game/Overlays/Profile/Sections/BeatmapMetadataContainer.cs index bfd8db5d9c..8a40f0a489 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapMetadataContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapMetadataContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs index 4bfb8107b4..da070d1cc2 100644 --- a/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Beatmaps/PaginatedBeatmapContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs index 3e88795b77..760054716f 100644 --- a/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/BeatmapsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Online.API.Requests; diff --git a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs index 0607549f20..4956015b3f 100644 --- a/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs +++ b/osu.Game/Overlays/Profile/Sections/DrawableProfileRow.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs index 14ab5d8279..2f8f8aa0ae 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedRow.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs b/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs index e54f012faf..176b4bc30a 100644 --- a/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/PaginatedMostPlayedBeatmapContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs b/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs index ab99abdccd..82b520cf10 100644 --- a/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs +++ b/osu.Game/Overlays/Profile/Sections/HistoricalSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs index 904ed609e8..f71dc30de4 100644 --- a/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs +++ b/osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs index 907c26e5e8..74291c587e 100644 --- a/osu.Game/Overlays/Profile/Sections/KudosuSection.cs +++ b/osu.Game/Overlays/Profile/Sections/KudosuSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays.Profile.Sections.Kudosu; diff --git a/osu.Game/Overlays/Profile/Sections/MedalsSection.cs b/osu.Game/Overlays/Profile/Sections/MedalsSection.cs index 47a3e6f4d0..fe5543f264 100644 --- a/osu.Game/Overlays/Profile/Sections/MedalsSection.cs +++ b/osu.Game/Overlays/Profile/Sections/MedalsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Overlays.Profile.Sections diff --git a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs index 1d4045c379..3864002367 100644 --- a/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/PaginatedContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs index c3296dae4f..3b814b0542 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index e40ce14326..51b202844a 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs index 56b2950f89..61154b2280 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index 472800860c..8e20953457 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs index 6f050750e4..59b16c0987 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/ScoreModsContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index 7691100d7a..64687284cb 100644 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays.Profile.Sections.Ranks; diff --git a/osu.Game/Overlays/Profile/Sections/RecentSection.cs b/osu.Game/Overlays/Profile/Sections/RecentSection.cs index 7bd41eac79..78b139efe8 100644 --- a/osu.Game/Overlays/Profile/Sections/RecentSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RecentSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Overlays.Profile.Sections diff --git a/osu.Game/Overlays/Profile/SupporterIcon.cs b/osu.Game/Overlays/Profile/SupporterIcon.cs index b5cd94e54b..8f89dfe2ea 100644 --- a/osu.Game/Overlays/Profile/SupporterIcon.cs +++ b/osu.Game/Overlays/Profile/SupporterIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs b/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs index 9fa266c5fe..84d28e95ed 100644 --- a/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs +++ b/osu.Game/Overlays/SearchableList/DisplayStyleControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/SearchableList/HeaderTabControl.cs b/osu.Game/Overlays/SearchableList/HeaderTabControl.cs index 56569fcca5..2dd9d7de29 100644 --- a/osu.Game/Overlays/SearchableList/HeaderTabControl.cs +++ b/osu.Game/Overlays/SearchableList/HeaderTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs index 8d7d1ce994..ffc6a370ec 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListFilterControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/SearchableList/SearchableListHeader.cs b/osu.Game/Overlays/SearchableList/SearchableListHeader.cs index 4239a123b8..0f2650ad40 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListHeader.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListHeader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs index d1d40388e1..3998af05b2 100644 --- a/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs +++ b/osu.Game/Overlays/SearchableList/SearchableListOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs b/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs index 2870607519..a528a3c35d 100644 --- a/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs +++ b/osu.Game/Overlays/SearchableList/SlimEnumDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Settings/DangerousSettingsButton.cs b/osu.Game/Overlays/Settings/DangerousSettingsButton.cs index 7c324658a3..69c0c03552 100644 --- a/osu.Game/Overlays/Settings/DangerousSettingsButton.cs +++ b/osu.Game/Overlays/Settings/DangerousSettingsButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs index a2f3ad545b..5260fb89d4 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -70,4 +70,4 @@ namespace osu.Game.Overlays.Settings.Sections.Audio audio.OnLostDevice += onDeviceChanged; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs index 41a1bad364..ad1eec3c68 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/MainMenuSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs index 4ae127c816..598195333c 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/OffsetSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index d197f8c466..40b9ff069b 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/AudioSection.cs b/osu.Game/Overlays/Settings/Sections/AudioSection.cs index 738c9e94d7..ad074f6328 100644 --- a/osu.Game/Overlays/Settings/Sections/AudioSection.cs +++ b/osu.Game/Overlays/Settings/Sections/AudioSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs index 23e7433732..9a5946bf4e 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GCSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs index c042aeb19b..867410b178 100644 --- a/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Debug/GeneralSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/DebugSection.cs b/osu.Game/Overlays/Settings/Sections/DebugSection.cs index 05b7171eed..fb4d4f62a8 100644 --- a/osu.Game/Overlays/Settings/Sections/DebugSection.cs +++ b/osu.Game/Overlays/Settings/Sections/DebugSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.Settings.Sections }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs index 8ec6af5cd0..6ce0157a9c 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/GeneralSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs index 03cd2118b9..4bbd87c7e6 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/SongSelectSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs index 035a3c7a13..799c2d9ff8 100644 --- a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -35,4 +35,4 @@ namespace osu.Game.Overlays.Settings.Sections } } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs index 552b8bea1b..113ef10bad 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LanguageSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 56b9a55398..d959da52f3 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs index 3bca0af3af..caee7639e4 100644 --- a/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/UpdateSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/GeneralSection.cs b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs index 77148986ff..f7dfd9471b 100644 --- a/osu.Game/Overlays/Settings/Sections/GeneralSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GeneralSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs index 00e6b8b722..b9d76c05f0 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/DetailSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Game.Configuration; diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 3d09d6b901..8f775e686a 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs index 7fe5be2fa1..e779538fc8 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/MainMenuSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 8e84a25bb9..7e9ff018c4 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs index 04a9a4d70c..a34a76ff40 100644 --- a/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs +++ b/osu.Game/Overlays/Settings/Sections/GraphicsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs index 00a1c093fd..49ac650f92 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/KeyboardSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -21,4 +21,4 @@ namespace osu.Game.Overlays.Settings.Sections.Input }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 392bc6f1bd..ab501906dc 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/Sections/InputSection.cs b/osu.Game/Overlays/Settings/Sections/InputSection.cs index 5ece8aad77..ae4167fe52 100644 --- a/osu.Game/Overlays/Settings/Sections/InputSection.cs +++ b/osu.Game/Overlays/Settings/Sections/InputSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/DeleteAllBeatmapsDialog.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/DeleteAllBeatmapsDialog.cs index 8ae520651a..027b5b5aeb 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/DeleteAllBeatmapsDialog.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/DeleteAllBeatmapsDialog.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs index 9ab4143613..1223310c74 100644 --- a/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Maintenance/GeneralSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs index b42c64d324..808b32f881 100644 --- a/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs +++ b/osu.Game/Overlays/Settings/Sections/MaintenanceSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs index 4494da1bf4..a002b8516c 100644 --- a/osu.Game/Overlays/Settings/Sections/OnlineSection.cs +++ b/osu.Game/Overlays/Settings/Sections/OnlineSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -18,4 +18,4 @@ namespace osu.Game.Overlays.Settings.Sections }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index b4475aebb1..f6915896d7 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/SettingsButton.cs b/osu.Game/Overlays/Settings/SettingsButton.cs index 19493f6c70..9fccc6476f 100644 --- a/osu.Game/Overlays/Settings/SettingsButton.cs +++ b/osu.Game/Overlays/Settings/SettingsButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/SettingsCheckbox.cs b/osu.Game/Overlays/Settings/SettingsCheckbox.cs index 659754ce79..773cb04313 100644 --- a/osu.Game/Overlays/Settings/SettingsCheckbox.cs +++ b/osu.Game/Overlays/Settings/SettingsCheckbox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index bf2cd10b9d..4356d8a599 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs index 5725ee8439..d4a5a1a861 100644 --- a/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsEnumDropdown.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/SettingsFooter.cs b/osu.Game/Overlays/Settings/SettingsFooter.cs index bf417a2fac..b9581bac8a 100644 --- a/osu.Game/Overlays/Settings/SettingsFooter.cs +++ b/osu.Game/Overlays/Settings/SettingsFooter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -70,4 +70,4 @@ namespace osu.Game.Overlays.Settings }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/SettingsHeader.cs b/osu.Game/Overlays/Settings/SettingsHeader.cs index 80d60b6e5d..7cdd24b48d 100644 --- a/osu.Game/Overlays/Settings/SettingsHeader.cs +++ b/osu.Game/Overlays/Settings/SettingsHeader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; @@ -61,4 +61,4 @@ namespace osu.Game.Overlays.Settings }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index da50c2b444..b58b99f1e3 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Settings/SettingsLabel.cs b/osu.Game/Overlays/Settings/SettingsLabel.cs index 6a1d3ae72c..db7712c873 100644 --- a/osu.Game/Overlays/Settings/SettingsLabel.cs +++ b/osu.Game/Overlays/Settings/SettingsLabel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Settings/SettingsSection.cs b/osu.Game/Overlays/Settings/SettingsSection.cs index a107878fb8..546b40a1f2 100644 --- a/osu.Game/Overlays/Settings/SettingsSection.cs +++ b/osu.Game/Overlays/Settings/SettingsSection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 49d73f77ec..5d6f1fd0ae 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 79a644b2cb..f0191f3af1 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Overlays/Settings/SettingsTextBox.cs b/osu.Game/Overlays/Settings/SettingsTextBox.cs index 710330ad41..8f901ef252 100644 --- a/osu.Game/Overlays/Settings/SettingsTextBox.cs +++ b/osu.Game/Overlays/Settings/SettingsTextBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Settings/Sidebar.cs b/osu.Game/Overlays/Settings/Sidebar.cs index 4e51ae3a2e..8792eafdbe 100644 --- a/osu.Game/Overlays/Settings/Sidebar.cs +++ b/osu.Game/Overlays/Settings/Sidebar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Settings/SidebarButton.cs b/osu.Game/Overlays/Settings/SidebarButton.cs index 4b8366f0fc..7cbf0ea559 100644 --- a/osu.Game/Overlays/Settings/SidebarButton.cs +++ b/osu.Game/Overlays/Settings/SidebarButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index f798d63e5a..277ed81ce8 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index cf4097643e..45a02074b1 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index 2674854327..5107a76f0d 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Overlays.SearchableList; diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 954a838461..3b17c7ae62 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index ef1f7c8c70..8ac4e44a84 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index c039f9d311..f3a25b79a1 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs index b0171feb30..fd78db5a8b 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarChatButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs index 5c64ae69ec..5922b6212c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarDirectButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs index 9f020cada5..3bce67765a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarHomeButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs index b615cd3303..451af65ce7 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index f38c772890..0fa6fa23a2 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs index 81c57a984f..428467fece 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarMusicButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs index c093767e52..9cff2e4a77 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarNotificationButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs index 59314b8771..0f7f34c36a 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarOverlayToggleButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs index d0d76dd5d2..64fa763a0b 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs index 74d1da4384..519210d6e2 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs index 4562464dfe..158912e7fe 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserArea.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 3714094924..c2dfea9a08 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index c2e7fc5b44..59f940a19d 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Overlays/WaveOverlayContainer.cs b/osu.Game/Overlays/WaveOverlayContainer.cs index 3f9703a523..074d83a5ad 100644 --- a/osu.Game/Overlays/WaveOverlayContainer.cs +++ b/osu.Game/Overlays/WaveOverlayContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Properties/AssemblyInfo.cs b/osu.Game/Properties/AssemblyInfo.cs index e28f8a3873..56558044f8 100644 --- a/osu.Game/Properties/AssemblyInfo.cs +++ b/osu.Game/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Reflection; @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ppy Pty Ltd")] [assembly: AssemblyProduct("osu.Game")] -[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2017")] +[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index 36740b96cb..7f22b3764c 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs b/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs index 2982a68b3b..d275022a15 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/Handle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/HandleContainer.cs b/osu.Game/Rulesets/Edit/Layers/Selection/HandleContainer.cs index 22d993e7cd..359cdd009a 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/HandleContainer.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/HandleContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs index 6f73d6b916..c840cb0c38 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/OriginHandle.cs b/osu.Game/Rulesets/Edit/Layers/Selection/OriginHandle.cs index 8326ebeeac..6f8c946165 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/OriginHandle.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/OriginHandle.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/SelectionInfo.cs b/osu.Game/Rulesets/Edit/Layers/Selection/SelectionInfo.cs index aec16bd46d..beedb415c2 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/SelectionInfo.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/SelectionInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/SelectionLayer.cs b/osu.Game/Rulesets/Edit/Layers/Selection/SelectionLayer.cs index 98bcfd0ec8..93755d400a 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/SelectionLayer.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/SelectionLayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Rulesets/Edit/ToolboxGroup.cs b/osu.Game/Rulesets/Edit/ToolboxGroup.cs index 70e4d3a0c5..3b13cc38ab 100644 --- a/osu.Game/Rulesets/Edit/ToolboxGroup.cs +++ b/osu.Game/Rulesets/Edit/ToolboxGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Rulesets/Edit/Tools/HitObjectCompositionTool.cs b/osu.Game/Rulesets/Edit/Tools/HitObjectCompositionTool.cs index dd182dcbdb..a548795df3 100644 --- a/osu.Game/Rulesets/Edit/Tools/HitObjectCompositionTool.cs +++ b/osu.Game/Rulesets/Edit/Tools/HitObjectCompositionTool.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Rulesets/Edit/Tools/ICompositionTool.cs b/osu.Game/Rulesets/Edit/Tools/ICompositionTool.cs index eba873f0cf..db5fecf525 100644 --- a/osu.Game/Rulesets/Edit/Tools/ICompositionTool.cs +++ b/osu.Game/Rulesets/Edit/Tools/ICompositionTool.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Edit.Tools diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 3d7880f56f..0f6642ae0e 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Judgements/Judgement.cs b/osu.Game/Rulesets/Judgements/Judgement.cs index f8c9b9734f..c2216fea51 100644 --- a/osu.Game/Rulesets/Judgements/Judgement.cs +++ b/osu.Game/Rulesets/Judgements/Judgement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Drawables; diff --git a/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs b/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs index 2d7cda5f1f..81268e0ad4 100644 --- a/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs +++ b/osu.Game/Rulesets/Mods/IApplicableFailOverride.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mods diff --git a/osu.Game/Rulesets/Mods/IApplicableMod.cs b/osu.Game/Rulesets/Mods/IApplicableMod.cs index ed2b652598..8e56a90d47 100644 --- a/osu.Game/Rulesets/Mods/IApplicableMod.cs +++ b/osu.Game/Rulesets/Mods/IApplicableMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mods diff --git a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs index 8b4aee4f38..6b02a902e0 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game/Rulesets/Mods/IApplicableToClock.cs b/osu.Game/Rulesets/Mods/IApplicableToClock.cs index 8bb4e2b97d..46c1648951 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToClock.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToClock.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Timing; diff --git a/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs b/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs index a95aa4370c..a87ae701c1 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToDifficulty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs index fb9d7128c0..cd39f90ac4 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToDrawableHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs index 1964ad728f..c20abe0151 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs index eae8c9d15c..f03866e7bb 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs index 2314999d4f..f45bbab194 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Scoring; diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 68ed545701..26cdcde9fe 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index bddb97f374..e8f5bb4740 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index 581fbc5e3a..576d29fdfb 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; @@ -11,4 +11,4 @@ namespace osu.Game.Rulesets.Mods public override string ShortenedName => "CN"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index cbad224316..180199cd70 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Audio; @@ -23,4 +23,4 @@ namespace osu.Game.Rulesets.Mods base.ApplyToClock(clock); } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModDoubleTime.cs b/osu.Game/Rulesets/Mods/ModDoubleTime.cs index d8aa5ea1d2..0b8f4b0b5b 100644 --- a/osu.Game/Rulesets/Mods/ModDoubleTime.cs +++ b/osu.Game/Rulesets/Mods/ModDoubleTime.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Mods clock.Rate = 1.5; } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModEasy.cs b/osu.Game/Rulesets/Mods/ModEasy.cs index aaf083fd9e..5c5b9b1b44 100644 --- a/osu.Game/Rulesets/Mods/ModEasy.cs +++ b/osu.Game/Rulesets/Mods/ModEasy.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -27,4 +27,4 @@ namespace osu.Game.Rulesets.Mods difficulty.OverallDifficulty *= ratio; } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index b7499e624a..9858e00083 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; @@ -14,4 +14,4 @@ namespace osu.Game.Rulesets.Mods public override string Description => "Restricted view area."; public override bool Ranked => true; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index a9e49bb4b0..bb9ed0047d 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -24,4 +24,4 @@ namespace osu.Game.Rulesets.Mods clock.Rate = 0.75; } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index 36d82362e3..97b2fe7d1e 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Mods/ModHidden.cs b/osu.Game/Rulesets/Mods/ModHidden.cs index 25f6ad024d..303a46f629 100644 --- a/osu.Game/Rulesets/Mods/ModHidden.cs +++ b/osu.Game/Rulesets/Mods/ModHidden.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics; @@ -13,4 +13,4 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override bool Ranked => true; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModNightcore.cs b/osu.Game/Rulesets/Mods/ModNightcore.cs index 5cefd89023..ad4df55b91 100644 --- a/osu.Game/Rulesets/Mods/ModNightcore.cs +++ b/osu.Game/Rulesets/Mods/ModNightcore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Audio; @@ -23,4 +23,4 @@ namespace osu.Game.Rulesets.Mods base.ApplyToClock(clock); } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModNoFail.cs b/osu.Game/Rulesets/Mods/ModNoFail.cs index 8aefd1b88e..9686eff99c 100644 --- a/osu.Game/Rulesets/Mods/ModNoFail.cs +++ b/osu.Game/Rulesets/Mods/ModNoFail.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Mods/ModPerfect.cs b/osu.Game/Rulesets/Mods/ModPerfect.cs index 59539d2b2c..bb12b2e39f 100644 --- a/osu.Game/Rulesets/Mods/ModPerfect.cs +++ b/osu.Game/Rulesets/Mods/ModPerfect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Scoring; diff --git a/osu.Game/Rulesets/Mods/ModRelax.cs b/osu.Game/Rulesets/Mods/ModRelax.cs index a3f38e4ff6..e8328c3ac7 100644 --- a/osu.Game/Rulesets/Mods/ModRelax.cs +++ b/osu.Game/Rulesets/Mods/ModRelax.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -14,4 +14,4 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) }; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs index bc42c69cbe..490825220c 100644 --- a/osu.Game/Rulesets/Mods/ModSuddenDeath.cs +++ b/osu.Game/Rulesets/Mods/ModSuddenDeath.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Mods/ModType.cs b/osu.Game/Rulesets/Mods/ModType.cs index 15ffc4ad63..8aeb880be8 100644 --- a/osu.Game/Rulesets/Mods/ModType.cs +++ b/osu.Game/Rulesets/Mods/ModType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mods diff --git a/osu.Game/Rulesets/Mods/MultiMod.cs b/osu.Game/Rulesets/Mods/MultiMod.cs index c40d107bda..1de5297e22 100644 --- a/osu.Game/Rulesets/Mods/MultiMod.cs +++ b/osu.Game/Rulesets/Mods/MultiMod.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Mods @@ -12,4 +12,4 @@ namespace osu.Game.Rulesets.Mods public Mod[] Mods; } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/BezierApproximator.cs b/osu.Game/Rulesets/Objects/BezierApproximator.cs index 12be591aab..6ed83a5f57 100644 --- a/osu.Game/Rulesets/Objects/BezierApproximator.cs +++ b/osu.Game/Rulesets/Objects/BezierApproximator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; @@ -147,4 +147,4 @@ namespace osu.Game.Rulesets.Objects return output; } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/CircularArcApproximator.cs b/osu.Game/Rulesets/Objects/CircularArcApproximator.cs index 642793fa3f..cc319d1a8f 100644 --- a/osu.Game/Rulesets/Objects/CircularArcApproximator.cs +++ b/osu.Game/Rulesets/Objects/CircularArcApproximator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs b/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs index 5e57c57f4d..02b8f2e654 100644 --- a/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs +++ b/osu.Game/Rulesets/Objects/Drawables/ArmedState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Drawables @@ -9,4 +9,4 @@ namespace osu.Game.Rulesets.Objects.Drawables Hit, Miss } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 45a7275c53..34c34e1d33 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs index 538bb826ad..413a382c37 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableScrollingHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; @@ -64,4 +64,4 @@ namespace osu.Game.Rulesets.Objects.Drawables base.AddNested(h); } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs b/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs index 0314ef3037..d10149facd 100644 --- a/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs +++ b/osu.Game/Rulesets/Objects/Drawables/IDrawableHitObjectWithProxiedApproach.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Rulesets/Objects/Drawables/IScrollingHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/IScrollingHitObject.cs index 30b65237a4..55dd0a16cc 100644 --- a/osu.Game/Rulesets/Objects/Drawables/IScrollingHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/IScrollingHitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; @@ -28,4 +28,4 @@ namespace osu.Game.Rulesets.Objects.Drawables /// Axes ScrollingAxes { set; } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs index 4f06f6afe1..160d639e8e 100644 --- a/osu.Game/Rulesets/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Objects/HitObjectParser.cs b/osu.Game/Rulesets/Objects/HitObjectParser.cs index ea0b5e0d2e..5a38daa654 100644 --- a/osu.Game/Rulesets/Objects/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/HitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHit.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHit.cs index 30c10c302a..366449a910 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs index fbf02f5345..d0e7e09ad2 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSlider.cs index 781fe8f7fa..6132ea63a6 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSpinner.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSpinner.cs index 0652737b12..1df7cce899 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSpinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/ConvertSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index bdbd7a9e65..840322f8a8 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs index 09f005e666..16ea008216 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -15,4 +15,4 @@ namespace osu.Game.Rulesets.Objects.Legacy ColourHax = 112, Hold = 1 << 7 } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs index 6dc8a07630..4e01402668 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHit.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHit.cs index 2a65b853b7..d756dc71ee 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs index 2060b84222..ad51b636d3 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHold.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHold.cs index 1dda577320..24006a4901 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHold.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHold.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSlider.cs index adc0c064bc..d70c58e262 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSpinner.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSpinner.cs index f72c5b9894..0def535129 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSpinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/ConvertSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs index 0c1000965c..330b8acfec 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs index 0062d29446..19f9a93976 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs index 75a6d80560..513ea0616b 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs index 2b2dbe0765..4dbcc6d017 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/ConvertSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHit.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHit.cs index 7088cc480b..1eafc477fa 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHit.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHit.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs index 529a28ac15..1d3bbd0946 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSlider.cs index b472423a1d..a5e22602b0 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSlider.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSpinner.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSpinner.cs index abef667d91..3047228cdc 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSpinner.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertSpinner.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; diff --git a/osu.Game/Rulesets/Objects/SliderCurve.cs b/osu.Game/Rulesets/Objects/SliderCurve.cs index 363c330d3d..ae79d62ec8 100644 --- a/osu.Game/Rulesets/Objects/SliderCurve.cs +++ b/osu.Game/Rulesets/Objects/SliderCurve.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Objects/Types/CurveType.cs b/osu.Game/Rulesets/Objects/Types/CurveType.cs index 18db712a65..9b6772539e 100644 --- a/osu.Game/Rulesets/Objects/Types/CurveType.cs +++ b/osu.Game/Rulesets/Objects/Types/CurveType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Types diff --git a/osu.Game/Rulesets/Objects/Types/IHasCombo.cs b/osu.Game/Rulesets/Objects/Types/IHasCombo.cs index f053fdcf49..a10f5d814d 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasCombo.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCombo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Types diff --git a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs index 399138bc24..92df232ea9 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Objects/Types/IHasDistance.cs b/osu.Game/Rulesets/Objects/Types/IHasDistance.cs index a5e487a0ba..98ef898f22 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasDistance.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasDistance.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Types diff --git a/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs index ac30afe5fb..1fedb8e061 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasEndTime.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Types diff --git a/osu.Game/Rulesets/Objects/Types/IHasHold.cs b/osu.Game/Rulesets/Objects/Types/IHasHold.cs index 4054fc4fd1..1c33187e93 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasHold.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasHold.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Objects.Types diff --git a/osu.Game/Rulesets/Objects/Types/IHasPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs index 6eca86656d..0d9cd5ad2e 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasPosition.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs index 2fe2424d49..bd097cb96f 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Audio; diff --git a/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs index b0ad3af7d2..2dec9e6ef1 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE diff --git a/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs index 222e8f762f..8a38bde0f9 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE diff --git a/osu.Game/Rulesets/Replays/AutoGenerator.cs b/osu.Game/Rulesets/Replays/AutoGenerator.cs index b8bb63675a..21aa77d4cd 100644 --- a/osu.Game/Rulesets/Replays/AutoGenerator.cs +++ b/osu.Game/Rulesets/Replays/AutoGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects; diff --git a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs index 06f7259f78..913214abfb 100644 --- a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs +++ b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Replays/IAutoGenerator.cs b/osu.Game/Rulesets/Replays/IAutoGenerator.cs index 10925a27cb..7e26fb5758 100644 --- a/osu.Game/Rulesets/Replays/IAutoGenerator.cs +++ b/osu.Game/Rulesets/Replays/IAutoGenerator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.Replays diff --git a/osu.Game/Rulesets/Replays/Replay.cs b/osu.Game/Rulesets/Replays/Replay.cs index 89e19434f0..27a77addba 100644 --- a/osu.Game/Rulesets/Replays/Replay.cs +++ b/osu.Game/Rulesets/Replays/Replay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Replays/ReplayButtonState.cs b/osu.Game/Rulesets/Replays/ReplayButtonState.cs index be55a153cb..4421a79af8 100644 --- a/osu.Game/Rulesets/Replays/ReplayButtonState.cs +++ b/osu.Game/Rulesets/Replays/ReplayButtonState.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; @@ -15,4 +15,4 @@ namespace osu.Game.Rulesets.Replays Right2 = 8, Smoke = 16 } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/Replays/ReplayFrame.cs b/osu.Game/Rulesets/Replays/ReplayFrame.cs index 02c969f648..92defad62e 100644 --- a/osu.Game/Rulesets/Replays/ReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/ReplayFrame.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 64a2157069..6c5c272eac 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/RulesetInfo.cs b/osu.Game/Rulesets/RulesetInfo.cs index c5324d92a9..43da3670b0 100644 --- a/osu.Game/Rulesets/RulesetInfo.cs +++ b/osu.Game/Rulesets/RulesetInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 3038c51e64..76a4c99b86 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Scoring/HitResult.cs b/osu.Game/Rulesets/Scoring/HitResult.cs index 49ab9fd2f0..05f3b82810 100644 --- a/osu.Game/Rulesets/Scoring/HitResult.cs +++ b/osu.Game/Rulesets/Scoring/HitResult.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs index 4f603049db..ba16d78b37 100644 --- a/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs +++ b/osu.Game/Rulesets/Scoring/PerformanceCalculator.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/Scoring/Score.cs b/osu.Game/Rulesets/Scoring/Score.cs index 025335ba55..ed79333a16 100644 --- a/osu.Game/Rulesets/Scoring/Score.cs +++ b/osu.Game/Rulesets/Scoring/Score.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 23c4464bb1..b321123b74 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Scoring/ScoreRank.cs b/osu.Game/Rulesets/Scoring/ScoreRank.cs index f4a6a1e03c..5df52ddf95 100644 --- a/osu.Game/Rulesets/Scoring/ScoreRank.cs +++ b/osu.Game/Rulesets/Scoring/ScoreRank.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Rulesets/Scoring/ScoreStore.cs b/osu.Game/Rulesets/Scoring/ScoreStore.cs index d8a79d8cfb..fe366f52a5 100644 --- a/osu.Game/Rulesets/Scoring/ScoreStore.cs +++ b/osu.Game/Rulesets/Scoring/ScoreStore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs index b093cf3303..2a9dd56555 100644 --- a/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs +++ b/osu.Game/Rulesets/Timing/LinearScrollingContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs index 4f1a85cf2d..1d63d37a69 100644 --- a/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs +++ b/osu.Game/Rulesets/Timing/MultiplierControlPoint.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Timing/ScrollingContainer.cs b/osu.Game/Rulesets/Timing/ScrollingContainer.cs index eac596297a..1990ea62b3 100644 --- a/osu.Game/Rulesets/Timing/ScrollingContainer.cs +++ b/osu.Game/Rulesets/Timing/ScrollingContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs b/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs index 81e3a5c70e..5f6774b739 100644 --- a/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs +++ b/osu.Game/Rulesets/Timing/SpeedAdjustmentContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Rulesets/UI/ModIcon.cs b/osu.Game/Rulesets/UI/ModIcon.cs index 90f63aeab6..f01069118c 100644 --- a/osu.Game/Rulesets/UI/ModIcon.cs +++ b/osu.Game/Rulesets/UI/ModIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index b4a26344d5..9b6fe36520 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 0329725392..4d559549b7 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 5cd79cff29..223586a959 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs index 395248b2fd..a3ceab07be 100644 --- a/osu.Game/Rulesets/UI/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/ScrollingPlayfield.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs index f1b8838fa9..e1761c2768 100644 --- a/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/ScrollingRulesetContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/BackgroundScreen.cs b/osu.Game/Screens/BackgroundScreen.cs index 5b07ca6020..c5e5883b99 100644 --- a/osu.Game/Screens/BackgroundScreen.cs +++ b/osu.Game/Screens/BackgroundScreen.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 7ae3f6931e..dd76ac5421 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs index dd377938a7..629f5ea3db 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenCustom.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics.Backgrounds; @@ -23,4 +23,4 @@ namespace osu.Game.Screens.Backgrounds return base.Equals(other) && textureName == backgroundScreenCustom.textureName; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs index 36867a84d5..24e744d234 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenDefault.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs index 15aa8d10fe..c64ae23d46 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Backgrounds @@ -7,4 +7,4 @@ namespace osu.Game.Screens.Backgrounds { } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Charts/ChartInfo.cs b/osu.Game/Screens/Charts/ChartInfo.cs index 32577f3e05..70ca3b8b67 100644 --- a/osu.Game/Screens/Charts/ChartInfo.cs +++ b/osu.Game/Screens/Charts/ChartInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Charts diff --git a/osu.Game/Screens/Charts/ChartListing.cs b/osu.Game/Screens/Charts/ChartListing.cs index 41c2a01600..376cc76ef5 100644 --- a/osu.Game/Screens/Charts/ChartListing.cs +++ b/osu.Game/Screens/Charts/ChartListing.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Direct/OnlineListing.cs b/osu.Game/Screens/Direct/OnlineListing.cs index ff6c599e6f..38f4d6a771 100644 --- a/osu.Game/Screens/Direct/OnlineListing.cs +++ b/osu.Game/Screens/Direct/OnlineListing.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Direct diff --git a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs index 0e57407928..69a1296701 100644 --- a/osu.Game/Screens/Edit/Components/BottomBarContainer.cs +++ b/osu.Game/Screens/Edit/Components/BottomBarContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Edit/Components/PlaybackControl.cs b/osu.Game/Screens/Edit/Components/PlaybackControl.cs index 5ffa66c43e..05e47ef5b1 100644 --- a/osu.Game/Screens/Edit/Components/PlaybackControl.cs +++ b/osu.Game/Screens/Edit/Components/PlaybackControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs index b9b6867ea6..9a78e6e189 100644 --- a/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs +++ b/osu.Game/Screens/Edit/Components/TimeInfoContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs index cdb2985473..dfb67e4228 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BookmarkPart.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs index 380f8e2c7b..29cee20a9b 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/BreakPart.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs index 3759470c9a..a8e62d77ad 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/ControlPointPart.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs index b2308aca71..c7f40327a9 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/MarkerPart.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs index df95a5c384..c3c8dd9de0 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Parts/TimelinePart.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs index a63d02a0a5..8a472dc357 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/SummaryTimeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs index 91f5e9b222..f8d3133ae9 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/DurationVisualisation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs index 4719db37d1..4271375740 100644 --- a/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs +++ b/osu.Game/Screens/Edit/Components/Timelines/Summary/Visualisations/PointVisualisation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 76f51d1c33..bb43099352 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index 17b2e64d8e..ab699d1832 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuItem.cs b/osu.Game/Screens/Edit/Menus/EditorMenuItem.cs index c7e36522cf..ec936fb023 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuItem.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuItemSpacer.cs b/osu.Game/Screens/Edit/Menus/EditorMenuItemSpacer.cs index 5060165ef7..1b16b886b0 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuItemSpacer.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuItemSpacer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Edit.Menus diff --git a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs index dae2e4b320..a7569330bd 100644 --- a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs +++ b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs index 6bc7356f26..d42c0bfdac 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs index 10b6c07f3d..e2510ec016 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/DrawableRadioButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButton.cs b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButton.cs index 055362d9e1..5c28cc106a 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButton.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButtonCollection.cs b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButtonCollection.cs index 5f1def4a2e..f178f739dd 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButtonCollection.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/RadioButtons/RadioButtonCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/BeatmapWaveformGraph.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/BeatmapWaveformGraph.cs index 5acee675e8..f82ff5f286 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/BeatmapWaveformGraph.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/BeatmapWaveformGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollableTimeline.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollableTimeline.cs index 81beb4a4de..c308b2b9f8 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollableTimeline.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollableTimeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs index 3e1d0329a9..f71607a6cf 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/ScrollingTimelineContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Timeline/TimelineButton.cs b/osu.Game/Screens/Edit/Screens/Compose/Timeline/TimelineButton.cs index 0c6fc5d133..a0802f0d7d 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Timeline/TimelineButton.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Timeline/TimelineButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Edit/Screens/Design/Design.cs b/osu.Game/Screens/Edit/Screens/Design/Design.cs index edd5ae1a1e..16a71846ac 100644 --- a/osu.Game/Screens/Edit/Screens/Design/Design.cs +++ b/osu.Game/Screens/Edit/Screens/Design/Design.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index ac248930d8..2e654b4373 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs index 578d888193..67e50b34ac 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 1f332312ba..94238285ad 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 5e55166c19..f5dd5cb500 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index c82d90d16c..72fe4368f0 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index d0ad613640..977c8828d2 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs index 071de99209..29ae35fca4 100644 --- a/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs +++ b/osu.Game/Screens/Menu/FlowContainerWithOrigin.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index a6a1afa320..fcee071f04 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 5fca389708..577eb33d18 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 5b86fd6ca3..3fb5cc6d0d 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index fac0ec1422..1e68b2a22d 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index 9317780eac..3cf2ce8e89 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 9ca12702e5..4a13ae421e 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Multiplayer/DrawableGameType.cs b/osu.Game/Screens/Multiplayer/DrawableGameType.cs index 5b85fcc4da..5c57232299 100644 --- a/osu.Game/Screens/Multiplayer/DrawableGameType.cs +++ b/osu.Game/Screens/Multiplayer/DrawableGameType.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 0ba4aaa364..7fcd364fe0 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Multiplayer/Lobby.cs b/osu.Game/Screens/Multiplayer/Lobby.cs index b297835ca9..0676f2d729 100644 --- a/osu.Game/Screens/Multiplayer/Lobby.cs +++ b/osu.Game/Screens/Multiplayer/Lobby.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Multiplayer/Match.cs b/osu.Game/Screens/Multiplayer/Match.cs index e50a7199a4..2ceead1266 100644 --- a/osu.Game/Screens/Multiplayer/Match.cs +++ b/osu.Game/Screens/Multiplayer/Match.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Multiplayer/MatchCreate.cs b/osu.Game/Screens/Multiplayer/MatchCreate.cs index c232c38d08..d60ee8ba48 100644 --- a/osu.Game/Screens/Multiplayer/MatchCreate.cs +++ b/osu.Game/Screens/Multiplayer/MatchCreate.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs b/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs index 40d385418a..92dff890e1 100644 --- a/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs +++ b/osu.Game/Screens/Multiplayer/ModeTypeInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs index 2197b7477c..ff00f53600 100644 --- a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs +++ b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Multiplayer/RoomInspector.cs b/osu.Game/Screens/Multiplayer/RoomInspector.cs index 8d7401500f..03bfb39c3b 100644 --- a/osu.Game/Screens/Multiplayer/RoomInspector.cs +++ b/osu.Game/Screens/Multiplayer/RoomInspector.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 0013d1a882..0111dceb40 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/BreaksOverlay/ArrowsOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/ArrowsOverlay.cs index 0b775d5c35..9fdf90bd28 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/ArrowsOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/ArrowsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs b/osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs index f16e7c7b96..5395d7688e 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BlurredIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index 7ef1ef8d8a..735c81aedf 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Play/BreaksOverlay/GlowIcon.cs b/osu.Game/Screens/Play/BreaksOverlay/GlowIcon.cs index b27eef632c..bad9df2093 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/GlowIcon.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/GlowIcon.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs b/osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs index 1bf9b26cc9..d7ab4ff2e5 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/InfoContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/BreaksOverlay/InfoLine.cs b/osu.Game/Screens/Play/BreaksOverlay/InfoLine.cs index 751523d68c..b39eaf1c22 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/InfoLine.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/InfoLine.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/BreaksOverlay/LetterboxOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/LetterboxOverlay.cs index 4733a5482b..f4c9362fff 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/LetterboxOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/LetterboxOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs index 0df7bb97e0..015fefb423 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/RemainingTimeCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Graphics.Sprites; diff --git a/osu.Game/Screens/Play/FailOverlay.cs b/osu.Game/Screens/Play/FailOverlay.cs index 09f2e15c57..8a37009f56 100644 --- a/osu.Game/Screens/Play/FailOverlay.cs +++ b/osu.Game/Screens/Play/FailOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 094c0331f4..af222b82e2 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/HUD/ComboCounter.cs b/osu.Game/Screens/Play/HUD/ComboCounter.cs index 47099f96e9..f88ef3a862 100644 --- a/osu.Game/Screens/Play/HUD/ComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs index a4732f6796..3a38360332 100644 --- a/osu.Game/Screens/Play/HUD/ComboResultCounter.cs +++ b/osu.Game/Screens/Play/HUD/ComboResultCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Play/HUD/HealthDisplay.cs b/osu.Game/Screens/Play/HUD/HealthDisplay.cs index a146172085..2f918f37de 100644 --- a/osu.Game/Screens/Play/HUD/HealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/HealthDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Screens/Play/HUD/ModDisplay.cs b/osu.Game/Screens/Play/HUD/ModDisplay.cs index fd0e71ece8..8091809431 100644 --- a/osu.Game/Screens/Play/HUD/ModDisplay.cs +++ b/osu.Game/Screens/Play/HUD/ModDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs index c07eebdef8..cb30222831 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Play/HUD/StandardComboCounter.cs b/osu.Game/Screens/Play/HUD/StandardComboCounter.cs index 04fe78116e..0e4861a305 100644 --- a/osu.Game/Screens/Play/HUD/StandardComboCounter.cs +++ b/osu.Game/Screens/Play/HUD/StandardComboCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs index 351db533f3..b7508fd43f 100644 --- a/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs +++ b/osu.Game/Screens/Play/HUD/StandardHealthDisplay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index f4b5efe1e5..721b5344ff 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs index 11f9a484dd..06db1d9df1 100644 --- a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs +++ b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game/Screens/Play/KeyCounter.cs b/osu.Game/Screens/Play/KeyCounter.cs index e507055d5f..05fa756c62 100644 --- a/osu.Game/Screens/Play/KeyCounter.cs +++ b/osu.Game/Screens/Play/KeyCounter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/KeyCounterAction.cs b/osu.Game/Screens/Play/KeyCounterAction.cs index a6baeeafb6..c0ca03beb1 100644 --- a/osu.Game/Screens/Play/KeyCounterAction.cs +++ b/osu.Game/Screens/Play/KeyCounterAction.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input.Bindings; @@ -27,4 +27,4 @@ namespace osu.Game.Screens.Play return false; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 2f077f5c0a..554fbbaf61 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/KeyCounterKeyboard.cs b/osu.Game/Screens/Play/KeyCounterKeyboard.cs index 3516dbbad8..2c10f7a01a 100644 --- a/osu.Game/Screens/Play/KeyCounterKeyboard.cs +++ b/osu.Game/Screens/Play/KeyCounterKeyboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game/Screens/Play/KeyCounterMouse.cs b/osu.Game/Screens/Play/KeyCounterMouse.cs index 12ec976316..2c51f38fa2 100644 --- a/osu.Game/Screens/Play/KeyCounterMouse.cs +++ b/osu.Game/Screens/Play/KeyCounterMouse.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Input; diff --git a/osu.Game/Screens/Play/PauseContainer.cs b/osu.Game/Screens/Play/PauseContainer.cs index 3bd28511c7..ac497868bf 100644 --- a/osu.Game/Screens/Play/PauseContainer.cs +++ b/osu.Game/Screens/Play/PauseContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d4cfa0b3d4..87171ab561 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 15a97096e7..cf6c252bec 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index 4748ddfd71..a26d5b3050 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Replays; diff --git a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs b/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs index 482581abca..9f29e085d1 100644 --- a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs b/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs index 9c4fb03517..cc7ccac7f5 100644 --- a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 3109552532..f8ac653f69 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Timing; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs b/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs index 7ad1e4f527..f0b9ff623a 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs index 06cd783cae..bf22250e12 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs index e80ec092d9..e6e909183d 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 6519a8db36..0001aa0e76 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 68f0cb3661..897fe4bba7 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Play/SongProgressBar.cs b/osu.Game/Screens/Play/SongProgressBar.cs index 7fabf2e80e..ffe7ae04f8 100644 --- a/osu.Game/Screens/Play/SongProgressBar.cs +++ b/osu.Game/Screens/Play/SongProgressBar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Play/SongProgressGraph.cs b/osu.Game/Screens/Play/SongProgressGraph.cs index 38c680902a..49a3b98db8 100644 --- a/osu.Game/Screens/Play/SongProgressGraph.cs +++ b/osu.Game/Screens/Play/SongProgressGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index 06d7176cc5..3ef7750b49 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Play/SquareGraph.cs b/osu.Game/Screens/Play/SquareGraph.cs index 81dbf3eca4..7bccad0c34 100644 --- a/osu.Game/Screens/Play/SquareGraph.cs +++ b/osu.Game/Screens/Play/SquareGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Ranking/AspectContainer.cs b/osu.Game/Screens/Ranking/AspectContainer.cs index 4699b4ab92..ce7c985118 100644 --- a/osu.Game/Screens/Ranking/AspectContainer.cs +++ b/osu.Game/Screens/Ranking/AspectContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -17,4 +17,4 @@ namespace osu.Game.Screens.Ranking Width = DrawHeight; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Ranking/ResultMode.cs b/osu.Game/Screens/Ranking/ResultMode.cs index eeb04033ea..7057ff9b17 100644 --- a/osu.Game/Screens/Ranking/ResultMode.cs +++ b/osu.Game/Screens/Ranking/ResultMode.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Ranking @@ -9,4 +9,4 @@ namespace osu.Game.Screens.Ranking Ranking, Share } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Ranking/ResultModeButton.cs b/osu.Game/Screens/Ranking/ResultModeButton.cs index d38611c45a..9a99cbba7a 100644 --- a/osu.Game/Screens/Ranking/ResultModeButton.cs +++ b/osu.Game/Screens/Ranking/ResultModeButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Ranking/ResultModeTabControl.cs b/osu.Game/Screens/Ranking/ResultModeTabControl.cs index 06a6d31e37..cadcbd4819 100644 --- a/osu.Game/Screens/Ranking/ResultModeTabControl.cs +++ b/osu.Game/Screens/Ranking/ResultModeTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; @@ -27,4 +27,4 @@ namespace osu.Game.Screens.Ranking Origin = TabContainer.Origin }; } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 406887624c..15be68f91b 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 037d5ada09..9e726624e5 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Ranking/ResultsPageRanking.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs index c9d1061bd1..364fcee552 100644 --- a/osu.Game/Screens/Ranking/ResultsPageRanking.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 0d29b74dfd..11acc89448 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/ScreenWhiteBox.cs b/osu.Game/Screens/ScreenWhiteBox.cs index fcf87de655..27652b96b8 100644 --- a/osu.Game/Screens/ScreenWhiteBox.cs +++ b/osu.Game/Screens/ScreenWhiteBox.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 98acd0815d..7a47bb9631 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Select/BeatmapDeleteDialog.cs b/osu.Game/Screens/Select/BeatmapDeleteDialog.cs index aa37705cdf..15a19cfe86 100644 --- a/osu.Game/Screens/Select/BeatmapDeleteDialog.cs +++ b/osu.Game/Screens/Select/BeatmapDeleteDialog.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Select/BeatmapDetailArea.cs b/osu.Game/Screens/Select/BeatmapDetailArea.cs index 4403d412fc..20b9644b06 100644 --- a/osu.Game/Screens/Select/BeatmapDetailArea.cs +++ b/osu.Game/Screens/Select/BeatmapDetailArea.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs index bd0f745016..fe9e360a0d 100644 --- a/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs +++ b/osu.Game/Screens/Select/BeatmapDetailAreaTabControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 79d76dd00e..688ec685b0 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index c25ba66475..7476df4955 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs index d7e7b1e265..091de003a4 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs index 885595fc51..4427a0b7ab 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselBeatmapSet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs index a600693e31..ff23f437db 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroup.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index 5701760221..146bdf0009 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/CarouselItem.cs b/osu.Game/Screens/Select/Carousel/CarouselItem.cs index 7d76aee253..1fbadb31be 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs index cea658b06c..38cb5fc5d8 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs index 40ffcfdc80..d8cfd79e12 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselBeatmapSet.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs index cb354b3602..2d1433e769 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Select/Details/AdvancedStats.cs b/osu.Game/Screens/Select/Details/AdvancedStats.cs index 3c9cffadfb..4e3b852ce5 100644 --- a/osu.Game/Screens/Select/Details/AdvancedStats.cs +++ b/osu.Game/Screens/Select/Details/AdvancedStats.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Select/Details/FailRetryGraph.cs b/osu.Game/Screens/Select/Details/FailRetryGraph.cs index 4d75c49d17..a7e1e2adc5 100644 --- a/osu.Game/Screens/Select/Details/FailRetryGraph.cs +++ b/osu.Game/Screens/Select/Details/FailRetryGraph.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Screens/Select/Details/UserRatings.cs b/osu.Game/Screens/Select/Details/UserRatings.cs index 19bcad367e..bf10b19928 100644 --- a/osu.Game/Screens/Select/Details/UserRatings.cs +++ b/osu.Game/Screens/Select/Details/UserRatings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Select/EditSongSelect.cs b/osu.Game/Screens/Select/EditSongSelect.cs index 37f2663d91..f05fa17578 100644 --- a/osu.Game/Screens/Select/EditSongSelect.cs +++ b/osu.Game/Screens/Select/EditSongSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Select diff --git a/osu.Game/Screens/Select/Filter/GroupMode.cs b/osu.Game/Screens/Select/Filter/GroupMode.cs index b9e0938fcc..b63b3d2ab5 100644 --- a/osu.Game/Screens/Select/Filter/GroupMode.cs +++ b/osu.Game/Screens/Select/Filter/GroupMode.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Screens/Select/Filter/SortMode.cs b/osu.Game/Screens/Select/Filter/SortMode.cs index 4beecb730e..1cd9aff498 100644 --- a/osu.Game/Screens/Select/Filter/SortMode.cs +++ b/osu.Game/Screens/Select/Filter/SortMode.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 2dbd63f77b..a371e6e7d1 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/FilterCriteria.cs b/osu.Game/Screens/Select/FilterCriteria.cs index 8e99e29c1f..7c65b9c36a 100644 --- a/osu.Game/Screens/Select/FilterCriteria.cs +++ b/osu.Game/Screens/Select/FilterCriteria.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets; diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 40c3cf0fd4..21e6108489 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/FooterButton.cs b/osu.Game/Screens/Select/FooterButton.cs index ae6c7d3c1e..c6754d14a5 100644 --- a/osu.Game/Screens/Select/FooterButton.cs +++ b/osu.Game/Screens/Select/FooterButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/ImportFromStablePopup.cs b/osu.Game/Screens/Select/ImportFromStablePopup.cs index 03e9462636..70188c3b95 100644 --- a/osu.Game/Screens/Select/ImportFromStablePopup.cs +++ b/osu.Game/Screens/Select/ImportFromStablePopup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs index 5bd78d5971..7ecc2e62ee 100644 --- a/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs +++ b/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index ac47fade48..6c0301f01f 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index e0c9a3e04e..ac3d5df533 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Screens/Select/Leaderboards/MessagePlaceholder.cs b/osu.Game/Screens/Select/Leaderboards/MessagePlaceholder.cs index 4f94087d30..d6bad1b10b 100644 --- a/osu.Game/Screens/Select/Leaderboards/MessagePlaceholder.cs +++ b/osu.Game/Screens/Select/Leaderboards/MessagePlaceholder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Select/Leaderboards/Placeholder.cs b/osu.Game/Screens/Select/Leaderboards/Placeholder.cs index 8427259106..91e49c297a 100644 --- a/osu.Game/Screens/Select/Leaderboards/Placeholder.cs +++ b/osu.Game/Screens/Select/Leaderboards/Placeholder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs b/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs index 69a478f12a..65e599da73 100644 --- a/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs +++ b/osu.Game/Screens/Select/Leaderboards/RetrievalFailurePlaceholder.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/MatchSongSelect.cs b/osu.Game/Screens/Select/MatchSongSelect.cs index 9143da326d..b4249e251c 100644 --- a/osu.Game/Screens/Select/MatchSongSelect.cs +++ b/osu.Game/Screens/Select/MatchSongSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Select diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs index 5f1bdcc9bb..35331ec981 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsButton.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; diff --git a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs index 789064a5f1..2e8b2f9014 100644 --- a/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs +++ b/osu.Game/Screens/Select/Options/BeatmapOptionsOverlay.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index a3997640ba..6fdd38ce30 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Linq; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 919cfcfbe4..7431a6e0e6 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Select/WedgeBackground.cs b/osu.Game/Screens/Select/WedgeBackground.cs index 4841fcdd09..db96eeb83b 100644 --- a/osu.Game/Screens/Select/WedgeBackground.cs +++ b/osu.Game/Screens/Select/WedgeBackground.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Extensions.Color4Extensions; @@ -37,4 +37,4 @@ namespace osu.Game.Screens.Select }; } } -} \ No newline at end of file +} diff --git a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs b/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs index f12d7ab9ce..0c45729a18 100644 --- a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs +++ b/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration; diff --git a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs index d2b2feb68d..10548c6db9 100644 --- a/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs +++ b/osu.Game/Screens/Tournament/Components/VisualiserContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index fbf24eb609..17a678c191 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index bd13ced2cd..068a817f3c 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Tournament/GroupContainer.cs b/osu.Game/Screens/Tournament/GroupContainer.cs index ba73a61c92..30919c36a5 100644 --- a/osu.Game/Screens/Tournament/GroupContainer.cs +++ b/osu.Game/Screens/Tournament/GroupContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index 2eb0dacec3..4c97ab47b4 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs b/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs index 2739711c35..ff26d1de13 100644 --- a/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs +++ b/osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Screens.Tournament.Teams diff --git a/osu.Game/Screens/Tournament/Teams/ITeamList.cs b/osu.Game/Screens/Tournament/Teams/ITeamList.cs index 9427ebc7fb..6340bc00a7 100644 --- a/osu.Game/Screens/Tournament/Teams/ITeamList.cs +++ b/osu.Game/Screens/Tournament/Teams/ITeamList.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs index 1b2d84a666..5510111a2f 100644 --- a/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs +++ b/osu.Game/Screens/Tournament/Teams/StorageBackedTeamList.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Storyboards/CommandLoop.cs b/osu.Game/Storyboards/CommandLoop.cs index 0d8b57e46c..2de3a1c762 100644 --- a/osu.Game/Storyboards/CommandLoop.cs +++ b/osu.Game/Storyboards/CommandLoop.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Storyboards/CommandTimeline.cs b/osu.Game/Storyboards/CommandTimeline.cs index b9bb6629d1..d3b246a497 100644 --- a/osu.Game/Storyboards/CommandTimeline.cs +++ b/osu.Game/Storyboards/CommandTimeline.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Caching; diff --git a/osu.Game/Storyboards/CommandTimelineGroup.cs b/osu.Game/Storyboards/CommandTimelineGroup.cs index c6d9202121..54588070b3 100644 --- a/osu.Game/Storyboards/CommandTimelineGroup.cs +++ b/osu.Game/Storyboards/CommandTimelineGroup.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Storyboards/CommandTrigger.cs b/osu.Game/Storyboards/CommandTrigger.cs index e2731f9c45..bfefbb1976 100644 --- a/osu.Game/Storyboards/CommandTrigger.cs +++ b/osu.Game/Storyboards/CommandTrigger.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Storyboards diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs index 5df88b342f..7e8a80d86a 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs index 9757756316..ef782abbe5 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardLayer.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardLayer.cs index 737704f6d0..a738916e8d 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardLayer.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardLayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs index 9153b3e514..a39805f74e 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardSprite.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Storyboards/Drawables/DrawablesExtensions.cs b/osu.Game/Storyboards/Drawables/DrawablesExtensions.cs index 3b21c47b96..2fa480a1b5 100644 --- a/osu.Game/Storyboards/Drawables/DrawablesExtensions.cs +++ b/osu.Game/Storyboards/Drawables/DrawablesExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Storyboards/Drawables/IFlippable.cs b/osu.Game/Storyboards/Drawables/IFlippable.cs index 4d21c9d140..eff0f7f32a 100644 --- a/osu.Game/Storyboards/Drawables/IFlippable.cs +++ b/osu.Game/Storyboards/Drawables/IFlippable.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Storyboards/IStoryboardElement.cs b/osu.Game/Storyboards/IStoryboardElement.cs index 74b6a8d8bc..ab78a50d68 100644 --- a/osu.Game/Storyboards/IStoryboardElement.cs +++ b/osu.Game/Storyboards/IStoryboardElement.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Storyboards/Storyboard.cs b/osu.Game/Storyboards/Storyboard.cs index 4eca910c1e..e2587debc9 100644 --- a/osu.Game/Storyboards/Storyboard.cs +++ b/osu.Game/Storyboards/Storyboard.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; diff --git a/osu.Game/Storyboards/StoryboardAnimation.cs b/osu.Game/Storyboards/StoryboardAnimation.cs index 98936df9e5..d56be26d73 100644 --- a/osu.Game/Storyboards/StoryboardAnimation.cs +++ b/osu.Game/Storyboards/StoryboardAnimation.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Storyboards/StoryboardLayer.cs b/osu.Game/Storyboards/StoryboardLayer.cs index f565b13eb5..ba2676b9e5 100644 --- a/osu.Game/Storyboards/StoryboardLayer.cs +++ b/osu.Game/Storyboards/StoryboardLayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Storyboards.Drawables; diff --git a/osu.Game/Storyboards/StoryboardSample.cs b/osu.Game/Storyboards/StoryboardSample.cs index e7a157c2f4..8779ba9a0f 100644 --- a/osu.Game/Storyboards/StoryboardSample.cs +++ b/osu.Game/Storyboards/StoryboardSample.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Storyboards/StoryboardSprite.cs b/osu.Game/Storyboards/StoryboardSprite.cs index 349a59dee0..774f82b860 100644 --- a/osu.Game/Storyboards/StoryboardSprite.cs +++ b/osu.Game/Storyboards/StoryboardSprite.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; diff --git a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs index 82248c2cb8..af482dc250 100644 --- a/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs +++ b/osu.Game/Tests/Beatmaps/TestWorkingBeatmap.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Audio.Track; diff --git a/osu.Game/Tests/Platform/TestStorage.cs b/osu.Game/Tests/Platform/TestStorage.cs index e583183d46..7199f5ea86 100644 --- a/osu.Game/Tests/Platform/TestStorage.cs +++ b/osu.Game/Tests/Platform/TestStorage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Platform; diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index b2c8be47bd..f9f198a5c1 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Tests/Visual/ScreenTestCase.cs b/osu.Game/Tests/Visual/ScreenTestCase.cs index 2f0831d84a..290b330827 100644 --- a/osu.Game/Tests/Visual/ScreenTestCase.cs +++ b/osu.Game/Tests/Visual/ScreenTestCase.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Screens; diff --git a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs index 8b93be9bb5..c531edb893 100644 --- a/osu.Game/Tests/Visual/TestCasePerformancePoints.cs +++ b/osu.Game/Tests/Visual/TestCasePerformancePoints.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 933781890f..72c1fc7369 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/Avatar.cs b/osu.Game/Users/Avatar.cs index 7ced0305fd..4386028f7f 100644 --- a/osu.Game/Users/Avatar.cs +++ b/osu.Game/Users/Avatar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/Country.cs b/osu.Game/Users/Country.cs index 46ddaee637..71f9cb1a7e 100644 --- a/osu.Game/Users/Country.cs +++ b/osu.Game/Users/Country.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/Medal.cs b/osu.Game/Users/Medal.cs index aa7382b457..51517e3e34 100644 --- a/osu.Game/Users/Medal.cs +++ b/osu.Game/Users/Medal.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Users diff --git a/osu.Game/Users/Team.cs b/osu.Game/Users/Team.cs index 7d5c0322fe..49b1a0f08e 100644 --- a/osu.Game/Users/Team.cs +++ b/osu.Game/Users/Team.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Users diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index d55c0caad7..60dd822d8c 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 5c0e5f1f95..a57d55f7b7 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/UserCoverBackground.cs b/osu.Game/Users/UserCoverBackground.cs index 68c97fc8fd..f6bb40b6d2 100644 --- a/osu.Game/Users/UserCoverBackground.cs +++ b/osu.Game/Users/UserCoverBackground.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index e0a4e3184d..812b32912c 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index 15b57553a6..6f814e43bd 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using Newtonsoft.Json; diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 37b796630b..9ee1b5a08d 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/packages.config b/osu.Game/packages.config index e35f06dd67..2938739eef 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -1,6 +1,6 @@  diff --git a/osu.licenseheader b/osu.licenseheader index 30ea2f9ad9..798b25e550 100644 --- a/osu.licenseheader +++ b/osu.licenseheader @@ -1,9 +1,9 @@ extensions: .cs -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE extensions: .xml .config .xsd \ No newline at end of file From fd60485dd25ecb153b8947f8aa9c8a6a6df6e5e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2018 20:28:38 +0900 Subject: [PATCH 192/628] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 8366ab1705..80bcb82ef8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec +Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 diff --git a/osu-resources b/osu-resources index e01f71160f..7724abdf1d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 +Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 From d1f03ebf0cfffa09284f72ab9408634b410a3e66 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2018 20:29:14 +0900 Subject: [PATCH 193/628] Update in line with framework --- osu.Game/Overlays/OnScreenDisplay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 6f0e21ca41..6a1bd8e182 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -139,7 +139,7 @@ namespace osu.Game.Overlays private readonly List references = new List(); - private void trackSetting(Bindable bindable, Bindable.BindableValueChanged action) + private void trackSetting(Bindable bindable, Action action) { // we need to keep references as we bind references.Add(bindable); From 7526225282f8aa912e51bb7b1a5fa23af8f07260 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 5 Jan 2018 20:56:21 +0900 Subject: [PATCH 194/628] Use DP for most of the code to avoid unnecessary computations --- .../Visual/TestCaseScrollingHitObjects.cs | 11 +- .../Scrolling/ScrollingHitObjectContainer.cs | 105 ++++++++++++------ .../UI/Scrolling/ScrollingRulesetContainer.cs | 2 +- 3 files changed, 79 insertions(+), 39 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 7e332c7310..591bf4fadd 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual playfields.Add(new TestPlayfield(ScrollingDirection.Down)); playfields.Add(new TestPlayfield(ScrollingDirection.Right)); - playfields.ForEach(p => p.HitObjects.ControlPoints.Add(new MultiplierControlPoint(double.MinValue))); + playfields.ForEach(p => p.HitObjects.AddControlPoint(new MultiplierControlPoint(double.MinValue))); Add(new Container { @@ -82,12 +82,9 @@ namespace osu.Game.Tests.Visual { playfields.ForEach(p => { - p.HitObjects.ControlPoints.AddRange(new[] - { - new MultiplierControlPoint(time) { DifficultyPoint = { SpeedMultiplier = 3 } }, - new MultiplierControlPoint(time + 2000) { DifficultyPoint = { SpeedMultiplier = 2 } }, - new MultiplierControlPoint(time + 3000) { DifficultyPoint = { SpeedMultiplier = 1 } }, - }); + p.HitObjects.AddControlPoint(new MultiplierControlPoint(time) { DifficultyPoint = { SpeedMultiplier = 3 } }); + p.HitObjects.AddControlPoint(new MultiplierControlPoint(time + 2000) { DifficultyPoint = { SpeedMultiplier = 2 } }); + p.HitObjects.AddControlPoint(new MultiplierControlPoint(time + 3000) { DifficultyPoint = { SpeedMultiplier = 1 } }); TestDrawableControlPoint createDrawablePoint(double t) => new TestDrawableControlPoint(t) { diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 8c3e1162e3..7bd5ab8f10 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -2,9 +2,12 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; +using osu.Framework.Caching; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Lists; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; using OpenTK; @@ -19,26 +22,86 @@ namespace osu.Game.Rulesets.UI.Scrolling MaxValue = double.MaxValue }; - public readonly SortedList ControlPoints = new SortedList(); - private readonly ScrollingDirection direction; + private Cached positionCache = new Cached(); + public ScrollingHitObjectContainer(ScrollingDirection direction) { this.direction = direction; RelativeSizeAxes = Axes.Both; + + TimeRange.ValueChanged += v => positionCache.Invalidate(); } - protected override bool UpdateChildrenLife() + public override void Add(DrawableHitObject hitObject) { + positionCache.Invalidate(); + base.Add(hitObject); + } + + public override bool Remove(DrawableHitObject hitObject) + { + var result = base.Remove(hitObject); + if (result) + positionCache.Invalidate(); + return result; + } + + private readonly SortedList controlPoints = new SortedList(); + + public void AddControlPoint(MultiplierControlPoint controlPoint) + { + controlPoints.Add(controlPoint); + positionCache.Invalidate(); + } + + public bool RemoveControlPoint(MultiplierControlPoint controlPoint) + { + var result = controlPoints.Remove(controlPoint); + if (result) + positionCache.Invalidate(); + return result; + } + + private readonly Dictionary hitObjectPositions = new Dictionary(); + + protected override void Update() + { + base.Update(); + + if (positionCache.IsValid) + return; + foreach (var obj in Objects) { - obj.LifetimeStart = obj.HitObject.StartTime - TimeRange * 2; - obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + TimeRange * 2; + var startPosition = hitObjectPositions[obj] = positionAt(obj.HitObject.StartTime); + + obj.LifetimeStart = obj.HitObject.StartTime - TimeRange - 1000; + obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + TimeRange + 1000; + + if (!(obj.HitObject is IHasEndTime endTime)) + continue; + + var endPosition = positionAt(endTime.EndTime); + + float length = Vector2.Distance(startPosition, endPosition); + + switch (direction) + { + case ScrollingDirection.Up: + case ScrollingDirection.Down: + obj.Height = length; + break; + case ScrollingDirection.Left: + case ScrollingDirection.Right: + obj.Width = length; + break; + } } - return base.UpdateChildrenLife(); + positionCache.Validate(); } protected override void UpdateAfterChildrenLife() @@ -52,7 +115,7 @@ namespace osu.Game.Rulesets.UI.Scrolling foreach (var obj in AliveObjects) { - var finalPosition = positionAt(obj.HitObject.StartTime); + var finalPosition = hitObjectPositions[obj]; switch (direction) { @@ -69,36 +132,16 @@ namespace osu.Game.Rulesets.UI.Scrolling obj.X = -finalPosition.X + timelinePosition.X; break; } - - if (!(obj.HitObject is IHasEndTime endTime)) - continue; - - // Todo: We may need to consider scale here - var finalEndPosition = positionAt(endTime.EndTime); - - float length = Vector2.Distance(finalPosition, finalEndPosition); - - switch (direction) - { - case ScrollingDirection.Up: - case ScrollingDirection.Down: - obj.Height = length; - break; - case ScrollingDirection.Left: - case ScrollingDirection.Right: - obj.Width = length; - break; - } } } private Vector2 positionAt(double time) { - float length = 0; - for (int i = 0; i < ControlPoints.Count; i++) + double length = 0; + for (int i = 0; i < controlPoints.Count; i++) { - var current = ControlPoints[i]; - var next = i < ControlPoints.Count - 1 ? ControlPoints[i + 1] : null; + var current = controlPoints[i]; + var next = i < controlPoints.Count - 1 ? controlPoints[i + 1] : null; if (i > 0 && current.StartTime > time) continue; diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs index 418013bcc1..8990710a9d 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs @@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.UI.Scrolling private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield) { - playfield.HitObjects.ControlPoints.Add(controlPoint); + playfield.HitObjects.AddControlPoint(controlPoint); playfield.NestedPlayfields.ForEach(p => applySpeedAdjustment(controlPoint, p)); } From c9692a44f9b044a2100d7a86b250b2aa7f9c0bfe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jan 2018 21:04:21 +0900 Subject: [PATCH 195/628] Fix framework licence headers in osu project --- osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs | 2 +- osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs index 5c4d545348..ce32dbe889 100644 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs index 928ba0d825..c4b3a63bf2 100644 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; From 140a09ba3db8efb7faddd2043285b435356a4dad Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Fri, 5 Jan 2018 19:13:54 +0100 Subject: [PATCH 196/628] fix requests not cancelling properly + formatting --- .../Screens/Select/Leaderboards/Leaderboard.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 6c0301f01f..6be6523175 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -93,7 +93,8 @@ namespace osu.Game.Screens.Select.Leaderboards get { return scope; } set { - if (value == scope) return; + if (value == scope) + return; scope = value; updateScores(); @@ -107,8 +108,6 @@ namespace osu.Game.Screens.Select.Leaderboards get { return placeholderState; } set { - if (value == placeholderState) return; - if (value != PlaceholderState.Successful) { getScoresRequest?.Cancel(); @@ -116,6 +115,9 @@ namespace osu.Game.Screens.Select.Leaderboards Scores = null; } + if (value == placeholderState) + return; + switch (placeholderState = value) { case PlaceholderState.NetworkFailure: @@ -171,7 +173,8 @@ namespace osu.Game.Screens.Select.Leaderboards get { return beatmap; } set { - if (beatmap == value) return; + if (beatmap == value) + return; beatmap = value; Scores = null; @@ -259,7 +262,8 @@ namespace osu.Game.Screens.Select.Leaderboards private void onUpdateFailed(Exception e) { - if (e is OperationCanceledException) return; + if (e is OperationCanceledException) + return; PlaceholderState = PlaceholderState.NetworkFailure; Logger.Error(e, @"Couldn't fetch beatmap scores!"); @@ -294,7 +298,8 @@ namespace osu.Game.Screens.Select.Leaderboards if (!scrollContainer.IsScrolledToEnd()) fadeStart -= LeaderboardScore.HEIGHT; - if (scrollFlow == null) return; + if (scrollFlow == null) + return; foreach (var c in scrollFlow.Children) { From eb37c361d8d941737954edf86fba3f01a6adc8d6 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 10:34:45 +0900 Subject: [PATCH 197/628] fix framework branch --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8366ab1705..10cae790c6 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec +Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6 From 232381533c8034886a7db4a68e30a8fef7e21d9e Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 10:43:22 +0900 Subject: [PATCH 198/628] update framework again --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 10cae790c6..8366ab1705 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6 +Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec From a55ac899a87f19710553a5b7d3a6010d986f710e Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 11:08:04 +0900 Subject: [PATCH 199/628] fix Empty argument list is redundant --- .../Tests/TestCaseManiaPlayfield.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 37161a7d3d..034bfc702a 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -43,30 +43,30 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal)); AddStep("4 + 4 columns", () => { - var stages = new List() + var stages = new List { - new StageDefinition() { Columns = 4 }, - new StageDefinition() { Columns = 4 }, + new StageDefinition { Columns = 4 }, + new StageDefinition { Columns = 4 }, }; createPlayfield(stages, SpecialColumnPosition.Normal); }); AddStep("2 + 4 + 2 columns", () => { - var stages = new List() + var stages = new List { - new StageDefinition() { Columns = 2 }, - new StageDefinition() { Columns = 4 }, - new StageDefinition() { Columns = 2 }, + new StageDefinition { Columns = 2 }, + new StageDefinition { Columns = 4 }, + new StageDefinition { Columns = 2 }, }; createPlayfield(stages, SpecialColumnPosition.Normal); }); AddStep("1 + 1 + 8 columns", () => { - var stages = new List() + var stages = new List { - new StageDefinition() { Columns = 1 }, - new StageDefinition() { Columns = 8 }, - new StageDefinition() { Columns = 1 }, + new StageDefinition { Columns = 1 }, + new StageDefinition { Columns = 8 }, + new StageDefinition { Columns = 1 }, }; createPlayfield(stages, SpecialColumnPosition.Normal); }); @@ -108,9 +108,9 @@ namespace osu.Game.Rulesets.Mania.Tests private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false) { - var stages = new List() + var stages = new List { - new StageDefinition() { Columns = cols }, + new StageDefinition { Columns = cols }, }; return createPlayfield(stages, specialPos, inverted); } @@ -146,9 +146,9 @@ namespace osu.Game.Rulesets.Mania.Tests Add(inputManager); ManiaPlayfield playfield; - var stages = new List() + var stages = new List { - new StageDefinition() { Columns = 4 }, + new StageDefinition { Columns = 4 }, }; inputManager.Add(playfield = new ManiaPlayfield(stages) { From 50aaf571fbfcd86bce60328d2372e8f3742b83f8 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 11:08:49 +0900 Subject: [PATCH 200/628] miss --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 48974b4bb8..da929e58ca 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote(){Duration = 1000}, ManiaAction.Key1) + new DrawableHoldNote(new HoldNote{Duration = 1000}, ManiaAction.Key1) { Y = 5000, Height = 1000, From ca7cd40fbac273e49ba65842826e0e220e2fcf94 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 11:21:10 +0900 Subject: [PATCH 201/628] 1. update from ppy master 2. update header --- osu-framework | 2 +- osu-resources | 2 +- osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index 80bcb82ef8..8366ab1705 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 +Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec diff --git a/osu-resources b/osu-resources index 7724abdf1d..e01f71160f 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 +Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs index c0ee3536ff..dad5082175 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; From 6585610dfe51726e6fd03011ca8e4cfc4d6c69ea Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 11:28:57 +0900 Subject: [PATCH 202/628] update resource branch --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index e01f71160f..7724abdf1d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 +Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 From 6437efb54fe60354c5ea11c374a39f9cca9f012e Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sat, 6 Jan 2018 11:38:22 +0900 Subject: [PATCH 203/628] update framework again.... --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8366ab1705..80bcb82ef8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8366ab17059b8964b0fd6d1ef4f07b0f3412c2ec +Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 From 57b44b8c29808fca00a10b4766ea7ebed6b1ed2a Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 6 Jan 2018 10:40:18 +0100 Subject: [PATCH 204/628] fix new panels appearing too soon --- osu.Game/Overlays/SocialOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 823e264ebe..fb111a64d2 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -153,7 +153,7 @@ namespace osu.Game.Overlays if(panels != null) ScrollFlow.Remove(panels); - ScrollFlow.Add(panels = newPanels); + Scheduler.AddDelayed(() => ScrollFlow.Add(panels = newPanels), 200); }); } From 82dcb033deaaee2bacc2476b01da2812b46217e1 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 6 Jan 2018 10:47:56 +0100 Subject: [PATCH 205/628] update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 66421b8944..80bcb82ef8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 66421b894444cb9c4b792f9b93a786dcff5589dd +Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 diff --git a/osu-resources b/osu-resources index e01f71160f..7724abdf1d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 +Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 From a61666d2a732727317f22290a3c85f02b2067440 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 6 Jan 2018 10:54:53 +0100 Subject: [PATCH 206/628] update licence headers --- osu.Game/Online/API/Requests/GetFriendsRequest.cs | 2 +- osu.Game/Overlays/Social/SocialGridPanel.cs | 2 +- osu.Game/Overlays/Social/SocialListPanel.cs | 2 +- osu.Game/Overlays/Social/SocialPanel.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Online/API/Requests/GetFriendsRequest.cs b/osu.Game/Online/API/Requests/GetFriendsRequest.cs index a06471fd74..5bc3d8e39e 100644 --- a/osu.Game/Online/API/Requests/GetFriendsRequest.cs +++ b/osu.Game/Online/API/Requests/GetFriendsRequest.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; diff --git a/osu.Game/Overlays/Social/SocialGridPanel.cs b/osu.Game/Overlays/Social/SocialGridPanel.cs index b2c6b75ab2..f9fbce123d 100644 --- a/osu.Game/Overlays/Social/SocialGridPanel.cs +++ b/osu.Game/Overlays/Social/SocialGridPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Users; diff --git a/osu.Game/Overlays/Social/SocialListPanel.cs b/osu.Game/Overlays/Social/SocialListPanel.cs index f65fbe8142..0f102005d6 100644 --- a/osu.Game/Overlays/Social/SocialListPanel.cs +++ b/osu.Game/Overlays/Social/SocialListPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Overlays/Social/SocialPanel.cs b/osu.Game/Overlays/Social/SocialPanel.cs index 234640482e..2e0b7e6df2 100644 --- a/osu.Game/Overlays/Social/SocialPanel.cs +++ b/osu.Game/Overlays/Social/SocialPanel.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK; From d9866a2052b5bbcc42d8537b754cc3f9e19521c6 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 6 Jan 2018 11:27:17 +0100 Subject: [PATCH 207/628] fix hover effects on social panels --- osu.Game/Overlays/Social/SocialPanel.cs | 8 +- osu.Game/Users/UserPanel.cs | 212 ++++++++++++------------ 2 files changed, 114 insertions(+), 106 deletions(-) diff --git a/osu.Game/Overlays/Social/SocialPanel.cs b/osu.Game/Overlays/Social/SocialPanel.cs index 2e0b7e6df2..54fb88f929 100644 --- a/osu.Game/Overlays/Social/SocialPanel.cs +++ b/osu.Game/Overlays/Social/SocialPanel.cs @@ -37,16 +37,16 @@ namespace osu.Game.Overlays.Social protected override bool OnHover(InputState state) { - TweenEdgeEffectTo(edgeEffectHovered, hover_transition_time, Easing.OutQuint); - //Content.MoveToY(-4, hover_transition_time, Easing.OutQuint); + Content.TweenEdgeEffectTo(edgeEffectHovered, hover_transition_time, Easing.OutQuint); + Content.MoveToY(-4, hover_transition_time, Easing.OutQuint); return base.OnHover(state); } protected override void OnHoverLost(InputState state) { - TweenEdgeEffectTo(edgeEffectNormal, hover_transition_time, Easing.OutQuint); - //Content.MoveToY(0, hover_transition_time, Easing.OutQuint); + Content.TweenEdgeEffectTo(edgeEffectNormal, hover_transition_time, Easing.OutQuint); + Content.MoveToY(0, hover_transition_time, Easing.OutQuint); base.OnHoverLost(state); } diff --git a/osu.Game/Users/UserPanel.cs b/osu.Game/Users/UserPanel.cs index 839c62ea40..c62ba392b8 100644 --- a/osu.Game/Users/UserPanel.cs +++ b/osu.Game/Users/UserPanel.cs @@ -28,9 +28,12 @@ namespace osu.Game.Users private const float content_padding = 10; private const float status_height = 30; - private readonly Container statusBar; - private readonly Box statusBg; - private readonly OsuSpriteText statusMessage; + private Container statusBar; + private Box statusBg; + private OsuSpriteText statusMessage; + + private Container content; + protected override Container Content => content; public readonly Bindable Status = new Bindable(); @@ -45,126 +48,138 @@ namespace osu.Game.Users this.user = user; + Height = height - status_height; + } + + [BackgroundDependencyLoader(permitNulls: true)] + private void load(OsuColour colours, UserProfileOverlay profile) + { + if (colours == null) + throw new ArgumentNullException(nameof(colours)); + FillFlowContainer infoContainer; - Height = height - status_height; - Masking = true; - CornerRadius = 5; - EdgeEffect = new EdgeEffectParameters + AddInternal(content = new Container { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(0.25f), - Radius = 4, - }; - - Children = new Drawable[] - { - new DelayedLoadWrapper(new UserCoverBackground(user) + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = 5, + EdgeEffect = new EdgeEffectParameters { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - FillMode = FillMode.Fill, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out) - }, 300) { RelativeSizeAxes = Axes.Both }, - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.7f), + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.25f), + Radius = 4, }, - new Container + + Children = new Drawable[] { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Top = content_padding, Horizontal = content_padding }, - Children = new Drawable[] + new DelayedLoadWrapper(new UserCoverBackground(user) { - new UpdateableAvatar + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill, + OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out) + }, 300) { RelativeSizeAxes = Axes.Both }, + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(0.7f), + }, + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Top = content_padding, Horizontal = content_padding }, + Children = new Drawable[] { - Size = new Vector2(height - status_height - content_padding * 2), - User = user, - Masking = true, - CornerRadius = 5, - EdgeEffect = new EdgeEffectParameters + new UpdateableAvatar { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(0.25f), - Radius = 4, - }, - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = height - status_height - content_padding }, - Children = new Drawable[] - { - new OsuSpriteText + Size = new Vector2(height - status_height - content_padding * 2), + User = user, + Masking = true, + CornerRadius = 5, + EdgeEffect = new EdgeEffectParameters { - Text = user.Username, - TextSize = 18, - Font = @"Exo2.0-SemiBoldItalic", + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(0.25f), + Radius = 4, }, - infoContainer = new FillFlowContainer + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = height - status_height - content_padding }, + Children = new Drawable[] { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - AutoSizeAxes = Axes.X, - Height = 20f, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(5f, 0f), - Children = new Drawable[] + new OsuSpriteText { - new DrawableFlag(user.Country) + Text = user.Username, + TextSize = 18, + Font = @"Exo2.0-SemiBoldItalic", + }, + infoContainer = new FillFlowContainer + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + AutoSizeAxes = Axes.X, + Height = 20f, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(5f, 0f), + Children = new Drawable[] { - Width = 30f, - RelativeSizeAxes = Axes.Y, + new DrawableFlag(user.Country) + { + Width = 30f, + RelativeSizeAxes = Axes.Y, + }, }, }, }, }, }, }, - }, - statusBar = new Container - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Alpha = 0f, - Children = new Drawable[] + statusBar = new Container { - statusBg = new Box + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Alpha = 0f, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Alpha = 0.5f, - }, - new FillFlowContainer - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - AutoSizeAxes = Axes.Both, - Spacing = new Vector2(5f, 0f), - Children = new Drawable[] + statusBg = new Box { - new SpriteIcon + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + }, + new FillFlowContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Spacing = new Vector2(5f, 0f), + Children = new Drawable[] { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Icon = FontAwesome.fa_circle_o, - Shadow = true, - Size = new Vector2(14), - }, - statusMessage = new OsuSpriteText - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - Font = @"Exo2.0-Semibold", + new SpriteIcon + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Icon = FontAwesome.fa_circle_o, + Shadow = true, + Size = new Vector2(14), + }, + statusMessage = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Font = @"Exo2.0-Semibold", + }, }, }, }, }, - }, - }; + } + }); if (user.IsSupporter) { @@ -174,13 +189,6 @@ namespace osu.Game.Users Width = 20f, }); } - } - - [BackgroundDependencyLoader(permitNulls: true)] - private void load(OsuColour colours, UserProfileOverlay profile) - { - if (colours == null) - throw new ArgumentNullException(nameof(colours)); Status.ValueChanged += displayStatus; Status.ValueChanged += status => statusBg.FadeColour(status?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint); From 47f5b23dcf338ae7a676d4a8bd19985c549e4758 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sun, 7 Jan 2018 00:53:44 +0100 Subject: [PATCH 208/628] fix child size == 0 exception --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 3a89101734..7bd47448c2 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote(), ManiaAction.Key1) + new DrawableHoldNote(new HoldNote { Duration = 1 }, ManiaAction.Key1) { Y = 5000, Height = 1000, From 98fd4f6ff2afae42c569efcb886738e193c06932 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 7 Jan 2018 11:33:59 +0900 Subject: [PATCH 209/628] Fix up precision + sizing issues --- .../Scrolling/ScrollingHitObjectContainer.cs | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 7bd5ab8f10..e0df4321a8 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -10,7 +10,6 @@ using osu.Framework.Lists; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; -using OpenTK; namespace osu.Game.Rulesets.UI.Scrolling { @@ -65,7 +64,15 @@ namespace osu.Game.Rulesets.UI.Scrolling return result; } - private readonly Dictionary hitObjectPositions = new Dictionary(); + public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) + { + if ((invalidation & (Invalidation.RequiredParentSizeToFit | Invalidation.DrawInfo)) > 0) + positionCache.Invalidate(); + + return base.Invalidate(invalidation, source, shallPropagate); + } + + private readonly Dictionary hitObjectPositions = new Dictionary(); protected override void Update() { @@ -84,19 +91,17 @@ namespace osu.Game.Rulesets.UI.Scrolling if (!(obj.HitObject is IHasEndTime endTime)) continue; - var endPosition = positionAt(endTime.EndTime); - - float length = Vector2.Distance(startPosition, endPosition); + var length = positionAt(endTime.EndTime) - startPosition; switch (direction) { case ScrollingDirection.Up: case ScrollingDirection.Down: - obj.Height = length; + obj.Height = (float)(length * DrawHeight); break; case ScrollingDirection.Left: case ScrollingDirection.Right: - obj.Width = length; + obj.Width = (float)(length * DrawWidth); break; } } @@ -115,27 +120,27 @@ namespace osu.Game.Rulesets.UI.Scrolling foreach (var obj in AliveObjects) { - var finalPosition = hitObjectPositions[obj]; + var finalPosition = hitObjectPositions[obj] - timelinePosition; switch (direction) { case ScrollingDirection.Up: - obj.Y = finalPosition.Y - timelinePosition.Y; + obj.Y = (float)(finalPosition * DrawHeight); break; case ScrollingDirection.Down: - obj.Y = -finalPosition.Y + timelinePosition.Y; + obj.Y = (float)(-finalPosition * DrawHeight); break; case ScrollingDirection.Left: - obj.X = finalPosition.X - timelinePosition.X; + obj.X = (float)(finalPosition * DrawWidth); break; case ScrollingDirection.Right: - obj.X = -finalPosition.X + timelinePosition.X; + obj.X = (float)(-finalPosition * DrawWidth); break; } } } - private Vector2 positionAt(double time) + private double positionAt(double time) { double length = 0; for (int i = 0; i < controlPoints.Count; i++) @@ -149,10 +154,10 @@ namespace osu.Game.Rulesets.UI.Scrolling // Duration of the current control point var currentDuration = (next?.StartTime ?? double.PositiveInfinity) - current.StartTime; - length += (float)(Math.Min(currentDuration, time - current.StartTime) * current.Multiplier / TimeRange); + length += Math.Min(currentDuration, time - current.StartTime) * current.Multiplier / TimeRange; } - return length * DrawSize; + return length; } } } From 2d345b2f80e88eebdecb1847fd0ae1203c31a2f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 7 Jan 2018 11:43:31 +0900 Subject: [PATCH 210/628] Fix mania hold note tick positioning --- .../Objects/Drawables/DrawableHoldNoteTick.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 8ed5d2b924..68f6721694 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -32,6 +32,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; + RelativePositionAxes = Axes.Y; Y = (float)HitObject.StartTime; RelativeSizeAxes = Axes.X; From f660eff4d491d3633796f41943c2d7ec14395016 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 7 Jan 2018 11:57:33 +0900 Subject: [PATCH 211/628] FIx incorrect licence header template --- osu.sln.DotSettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 20007e3306..8767e5374a 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -598,7 +598,7 @@ </TypePattern> </Patterns> Copyright (c) 2007-$CURRENT_YEAR$ ppy Pty Ltd <contact@ppy.sh>. -Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> From 117ab8a26d32c5277cb1c585c73fdc726d0f1d38 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 7 Jan 2018 12:47:09 +0900 Subject: [PATCH 212/628] Split out scrolling algorithm --- .../Visual/TestCaseScrollingHitObjects.cs | 6 +- osu.Game/Rulesets/UI/HitObjectContainer.cs | 19 +++ osu.Game/Rulesets/UI/Playfield.cs | 22 ++-- .../Algorithms/GlobalScrollingAlgorithm.cs | 98 +++++++++++++++ .../Algorithms/IScrollingAlgorithm.cs | 15 +++ .../GlobalScrollingHitObjectContainer.cs | 17 +++ .../Scrolling/ScrollingHitObjectContainer.cs | 115 +++++------------- .../UI/Scrolling/ScrollingPlayfield.cs | 16 ++- osu.Game/osu.Game.csproj | 4 + 9 files changed, 205 insertions(+), 107 deletions(-) create mode 100644 osu.Game/Rulesets/UI/HitObjectContainer.cs create mode 100644 osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs create mode 100644 osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs create mode 100644 osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 591bf4fadd..4f2e895e9d 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -99,19 +99,17 @@ namespace osu.Game.Tests.Visual - private class TestPlayfield : Playfield + private class TestPlayfield : ScrollingPlayfield { public readonly BindableDouble TimeRange = new BindableDouble(5000); public readonly ScrollingDirection Direction; - public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; - public TestPlayfield(ScrollingDirection direction) + : base(direction) { Direction = direction; - base.HitObjects = new ScrollingHitObjectContainer(direction); HitObjects.TimeRange.BindTo(TimeRange); } } diff --git a/osu.Game/Rulesets/UI/HitObjectContainer.cs b/osu.Game/Rulesets/UI/HitObjectContainer.cs new file mode 100644 index 0000000000..e7843c86ca --- /dev/null +++ b/osu.Game/Rulesets/UI/HitObjectContainer.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Objects.Drawables; + +namespace osu.Game.Rulesets.UI +{ + public class HitObjectContainer : CompositeDrawable + { + public virtual IEnumerable Objects => InternalChildren.Cast(); + public virtual IEnumerable AliveObjects => AliveInternalChildren.Cast(); + + public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject); + public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject); + } +} diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 61014b5550..91ea3ade2a 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -8,8 +8,6 @@ using osu.Game.Rulesets.Objects.Drawables; using OpenTK; using osu.Game.Rulesets.Judgements; using osu.Framework.Allocation; -using System.Collections.Generic; -using System.Linq; namespace osu.Game.Rulesets.UI { @@ -18,7 +16,7 @@ namespace osu.Game.Rulesets.UI /// /// The HitObjects contained in this Playfield. /// - public HitObjectContainer HitObjects { get; protected set; } + public readonly HitObjectContainer HitObjects; public Container ScaledContent; @@ -52,10 +50,8 @@ namespace osu.Game.Rulesets.UI } }); - HitObjects = new HitObjectContainer - { - RelativeSizeAxes = Axes.Both, - }; + HitObjects = CreateHitObjectContainer(); + HitObjects.RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] @@ -94,14 +90,10 @@ namespace osu.Game.Rulesets.UI /// The that occurred. public virtual void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { } - public class HitObjectContainer : CompositeDrawable - { - public virtual IEnumerable Objects => InternalChildren.Cast(); - public virtual IEnumerable AliveObjects => AliveInternalChildren.Cast(); - - public virtual void Add(DrawableHitObject hitObject) => AddInternal(hitObject); - public virtual bool Remove(DrawableHitObject hitObject) => RemoveInternal(hitObject); - } + /// + /// Creates the container that will be used to contain the s. + /// + protected virtual HitObjectContainer CreateHitObjectContainer() => new HitObjectContainer(); private class ScaledContainer : Container { diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs new file mode 100644 index 0000000000..0a69d00377 --- /dev/null +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs @@ -0,0 +1,98 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Timing; +using OpenTK; + +namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +{ + public class GlobalScrollingAlgorithm : IScrollingAlgorithm + { + private readonly Dictionary hitObjectPositions = new Dictionary(); + + private readonly IReadOnlyList controlPoints; + + public GlobalScrollingAlgorithm(IReadOnlyList controlPoints) + { + this.controlPoints = controlPoints; + } + + public void ComputeInitialStates(IEnumerable hitObjects, ScrollingDirection direction, double timeRange, Vector2 length) + { + foreach (var obj in hitObjects) + { + var startPosition = hitObjectPositions[obj] = positionAt(obj.HitObject.StartTime, timeRange); + + obj.LifetimeStart = obj.HitObject.StartTime - timeRange - 1000; + obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange + 1000; + + if (!(obj.HitObject is IHasEndTime endTime)) + continue; + + var diff = positionAt(endTime.EndTime, timeRange) - startPosition; + + switch (direction) + { + case ScrollingDirection.Up: + case ScrollingDirection.Down: + obj.Height = (float)(diff * length.Y); + break; + case ScrollingDirection.Left: + case ScrollingDirection.Right: + obj.Width = (float)(diff * length.X); + break; + } + } + } + + public void ComputePositions(IEnumerable hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length) + { + var timelinePosition = positionAt(currentTime, timeRange); + + foreach (var obj in hitObjects) + { + var finalPosition = hitObjectPositions[obj] - timelinePosition; + + switch (direction) + { + case ScrollingDirection.Up: + obj.Y = (float)(finalPosition * length.Y); + break; + case ScrollingDirection.Down: + obj.Y = (float)(-finalPosition * length.Y); + break; + case ScrollingDirection.Left: + obj.X = (float)(finalPosition * length.X); + break; + case ScrollingDirection.Right: + obj.X = (float)(-finalPosition * length.X); + break; + } + } + } + + private double positionAt(double time, double timeRange) + { + double length = 0; + for (int i = 0; i < controlPoints.Count; i++) + { + var current = controlPoints[i]; + var next = i < controlPoints.Count - 1 ? controlPoints[i + 1] : null; + + if (i > 0 && current.StartTime > time) + continue; + + // Duration of the current control point + var currentDuration = (next?.StartTime ?? double.PositiveInfinity) - current.StartTime; + + length += Math.Min(currentDuration, time - current.StartTime) * current.Multiplier / timeRange; + } + + return length; + } + } +} diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs new file mode 100644 index 0000000000..2621ae7d6f --- /dev/null +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Rulesets.Objects.Drawables; +using OpenTK; + +namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +{ + public interface IScrollingAlgorithm + { + void ComputeInitialStates(IEnumerable hitObjects, ScrollingDirection direction, double timeRange, Vector2 length); + void ComputePositions(IEnumerable hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length); + } +} diff --git a/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs new file mode 100644 index 0000000000..23dff01940 --- /dev/null +++ b/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Game.Rulesets.UI.Scrolling.Algorithms; + +namespace osu.Game.Rulesets.UI.Scrolling +{ + public class GlobalScrollingHitObjectContainer : ScrollingHitObjectContainer + { + public GlobalScrollingHitObjectContainer(ScrollingDirection direction) + : base(direction) + { + } + + protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new GlobalScrollingAlgorithm(ControlPoints); + } +} diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index e0df4321a8..e1d8fe8d59 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -1,19 +1,17 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Collections.Generic; using osu.Framework.Caching; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Lists; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; +using osu.Game.Rulesets.UI.Scrolling.Algorithms; namespace osu.Game.Rulesets.UI.Scrolling { - public class ScrollingHitObjectContainer : Playfield.HitObjectContainer + public abstract class ScrollingHitObjectContainer : HitObjectContainer { public readonly BindableDouble TimeRange = new BindableDouble { @@ -21,22 +19,32 @@ namespace osu.Game.Rulesets.UI.Scrolling MaxValue = double.MaxValue }; + protected readonly SortedList ControlPoints = new SortedList(); + private readonly ScrollingDirection direction; - private Cached positionCache = new Cached(); + private Cached initialStateCache = new Cached(); - public ScrollingHitObjectContainer(ScrollingDirection direction) + protected ScrollingHitObjectContainer(ScrollingDirection direction) { this.direction = direction; RelativeSizeAxes = Axes.Both; - TimeRange.ValueChanged += v => positionCache.Invalidate(); + TimeRange.ValueChanged += v => initialStateCache.Invalidate(); + } + + private IScrollingAlgorithm scrollingAlgorithm; + protected override void LoadComplete() + { + base.LoadComplete(); + + scrollingAlgorithm = CreateScrollingAlgorithm(); } public override void Add(DrawableHitObject hitObject) { - positionCache.Invalidate(); + initialStateCache.Invalidate(); base.Add(hitObject); } @@ -44,69 +52,42 @@ namespace osu.Game.Rulesets.UI.Scrolling { var result = base.Remove(hitObject); if (result) - positionCache.Invalidate(); + initialStateCache.Invalidate(); return result; } - private readonly SortedList controlPoints = new SortedList(); - public void AddControlPoint(MultiplierControlPoint controlPoint) { - controlPoints.Add(controlPoint); - positionCache.Invalidate(); + ControlPoints.Add(controlPoint); + initialStateCache.Invalidate(); } public bool RemoveControlPoint(MultiplierControlPoint controlPoint) { - var result = controlPoints.Remove(controlPoint); + var result = ControlPoints.Remove(controlPoint); if (result) - positionCache.Invalidate(); + initialStateCache.Invalidate(); return result; } public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true) { if ((invalidation & (Invalidation.RequiredParentSizeToFit | Invalidation.DrawInfo)) > 0) - positionCache.Invalidate(); + initialStateCache.Invalidate(); return base.Invalidate(invalidation, source, shallPropagate); } - private readonly Dictionary hitObjectPositions = new Dictionary(); - protected override void Update() { base.Update(); - if (positionCache.IsValid) + if (initialStateCache.IsValid) return; - foreach (var obj in Objects) - { - var startPosition = hitObjectPositions[obj] = positionAt(obj.HitObject.StartTime); + scrollingAlgorithm.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); - obj.LifetimeStart = obj.HitObject.StartTime - TimeRange - 1000; - obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + TimeRange + 1000; - - if (!(obj.HitObject is IHasEndTime endTime)) - continue; - - var length = positionAt(endTime.EndTime) - startPosition; - - switch (direction) - { - case ScrollingDirection.Up: - case ScrollingDirection.Down: - obj.Height = (float)(length * DrawHeight); - break; - case ScrollingDirection.Left: - case ScrollingDirection.Right: - obj.Width = (float)(length * DrawWidth); - break; - } - } - - positionCache.Validate(); + initialStateCache.Validate(); } protected override void UpdateAfterChildrenLife() @@ -116,48 +97,12 @@ namespace osu.Game.Rulesets.UI.Scrolling // We need to calculate this as soon as possible after lifetimes so that hitobjects // get the final say in their positions - var timelinePosition = positionAt(Time.Current); - - foreach (var obj in AliveObjects) - { - var finalPosition = hitObjectPositions[obj] - timelinePosition; - - switch (direction) - { - case ScrollingDirection.Up: - obj.Y = (float)(finalPosition * DrawHeight); - break; - case ScrollingDirection.Down: - obj.Y = (float)(-finalPosition * DrawHeight); - break; - case ScrollingDirection.Left: - obj.X = (float)(finalPosition * DrawWidth); - break; - case ScrollingDirection.Right: - obj.X = (float)(-finalPosition * DrawWidth); - break; - } - } + scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize); } - private double positionAt(double time) - { - double length = 0; - for (int i = 0; i < controlPoints.Count; i++) - { - var current = controlPoints[i]; - var next = i < controlPoints.Count - 1 ? controlPoints[i + 1] : null; - - if (i > 0 && current.StartTime > time) - continue; - - // Duration of the current control point - var currentDuration = (next?.StartTime ?? double.PositiveInfinity) - current.StartTime; - - length += Math.Min(currentDuration, time - current.StartTime) * current.Multiplier / TimeRange; - } - - return length; - } + /// + /// Creates the algorithm that will process the positions of the s. + /// + protected abstract IScrollingAlgorithm CreateScrollingAlgorithm(); } } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 899048531f..f560d8eaa6 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.UI.Scrolling /// /// A type of specialized towards scrolling s. /// - public class ScrollingPlayfield : Playfield + public abstract class ScrollingPlayfield : Playfield { /// /// The default span of time visible by the length of the scrolling axes. @@ -49,7 +49,9 @@ namespace osu.Game.Rulesets.UI.Scrolling /// /// The container that contains the s and s. /// - public new readonly ScrollingHitObjectContainer HitObjects; + public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects; + + private readonly ScrollingDirection direction; /// /// Creates a new . @@ -59,7 +61,7 @@ namespace osu.Game.Rulesets.UI.Scrolling protected ScrollingPlayfield(ScrollingDirection direction, float? customWidth = null) : base(customWidth) { - base.HitObjects = HitObjects = new ScrollingHitObjectContainer(direction) { RelativeSizeAxes = Axes.Both }; + this.direction = direction; HitObjects.TimeRange.BindTo(VisibleTimeRange); } @@ -105,6 +107,14 @@ namespace osu.Game.Rulesets.UI.Scrolling this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing)); } + protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer(); + + /// + /// Creates the that will handle the scrolling of the s. + /// + /// + protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new GlobalScrollingHitObjectContainer(direction); + private class TransformVisibleTimeRange : Transform { private double valueAt(double time) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6d8ce3c1b6..a33cf73934 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,6 +315,10 @@ + + + + From 4ab3b0d76be328d8141305930eba63d4f3384bb2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sun, 7 Jan 2018 13:24:09 +0900 Subject: [PATCH 213/628] Implement local scrolling hit object container --- .../Algorithms/LocalScrollingAlgorithm.cs | 79 +++++++++++++++++++ .../LocalScrollingHitObjectContainer.cs | 17 ++++ osu.Game/osu.Game.csproj | 2 + 3 files changed, 98 insertions(+) create mode 100644 osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs create mode 100644 osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs new file mode 100644 index 0000000000..ddd06a3725 --- /dev/null +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -0,0 +1,79 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Lists; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Timing; +using OpenTK; + +namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +{ + public class LocalScrollingAlgorithm : IScrollingAlgorithm + { + private readonly Dictionary hitObjectPositions = new Dictionary(); + + private readonly SortedList controlPoints; + + public LocalScrollingAlgorithm(SortedList controlPoints) + { + this.controlPoints = controlPoints; + } + + public void ComputeInitialStates(IEnumerable hitObjects, ScrollingDirection direction, double timeRange, Vector2 length) + { + foreach (var obj in hitObjects) + { + var controlPoint = controlPointAt(obj.HitObject.StartTime); + + obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier; + obj.LifetimeEnd = ((obj as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier; + } + } + + public void ComputePositions(IEnumerable hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length) + { + foreach (var obj in hitObjects) + { + var controlPoint = controlPointAt(obj.HitObject.StartTime); + + var position = (obj.HitObject.StartTime - currentTime) * controlPoint.Multiplier / timeRange; + + switch (direction) + { + case ScrollingDirection.Up: + obj.Y = (float)(position * length.Y); + break; + case ScrollingDirection.Down: + obj.Y = (float)(-position * length.Y); + break; + case ScrollingDirection.Left: + obj.X = (float)(position * length.X); + break; + case ScrollingDirection.Right: + obj.X = (float)(-position * length.X); + break; + } + } + } + + private readonly MultiplierControlPoint searchPoint = new MultiplierControlPoint(); + private MultiplierControlPoint controlPointAt(double time) + { + if (controlPoints.Count == 0) + return new MultiplierControlPoint(double.NegativeInfinity); + + if (time < controlPoints[0].StartTime) + return controlPoints[0]; + + searchPoint.StartTime = time; + int index = controlPoints.BinarySearch(searchPoint); + + if (index < 0) + index = ~index - 1; + + return controlPoints[index]; + } + } +} diff --git a/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs new file mode 100644 index 0000000000..ceef688cbc --- /dev/null +++ b/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Game.Rulesets.UI.Scrolling.Algorithms; + +namespace osu.Game.Rulesets.UI.Scrolling +{ + public class LocalScrollingHitObjectContainer : ScrollingHitObjectContainer + { + public LocalScrollingHitObjectContainer(ScrollingDirection direction) + : base(direction) + { + } + + protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new LocalScrollingAlgorithm(ControlPoints); + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a33cf73934..327b87d5de 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -318,7 +318,9 @@ + + From 006b63eb42c54450e7f74bbb7096c46c01e0d915 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 7 Jan 2018 09:05:36 +0100 Subject: [PATCH 214/628] remove unnecessary change of spinner end sequence it wasn't really visible anyways *shrug* --- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index 3f9bfc0f41..a76b543368 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -86,23 +86,8 @@ namespace osu.Game.Rulesets.Osu.Mods spinner.Background.Hide(); using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true)) - { spinner.FadeOut(fadeOutDuration); - // speed up the end sequence accordingly - switch (state) - { - case ArmedState.Hit: - spinner.ScaleTo(spinner.Scale * 1.2f, fadeOutDuration * 2, Easing.Out); - break; - case ArmedState.Miss: - spinner.ScaleTo(spinner.Scale * 0.8f, fadeOutDuration * 2, Easing.In); - break; - } - - spinner.Expire(); - } - break; } } From 54c0197eb0f315c62a22a7ef35b7916ac666363e Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 7 Jan 2018 09:08:26 +0100 Subject: [PATCH 215/628] remove early fadeout of sliderball on hidden it shouldn't have been done because it makes fast sliders unplayable as they never appear in the first place, ooops --- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index a76b543368..bd2f8090ed 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -70,14 +70,7 @@ namespace osu.Game.Rulesets.Osu.Mods break; case DrawableSlider slider: using (slider.BeginAbsoluteSequence(fadeOutStartTime, true)) - { slider.Body.FadeOut(longFadeDuration, Easing.Out); - - // delay a bit less to let the sliderball fade out peacefully instead of having a hard cut - using (slider.BeginDelayedSequence(longFadeDuration - fadeOutDuration, true)) - slider.Ball.FadeOut(fadeOutDuration); - } - break; case DrawableSpinner spinner: // hide elements we don't care about. @@ -87,7 +80,6 @@ namespace osu.Game.Rulesets.Osu.Mods using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true)) spinner.FadeOut(fadeOutDuration); - break; } } From ae032cbf2376bce33f29bf4b34dc9471b8585323 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sun, 7 Jan 2018 23:40:00 +0300 Subject: [PATCH 216/628] Support HandleKeyboardInput, HandleMouseInput, CanReceiveKeyboardInput, CanReceiveMouseInput properties --- osu.Desktop/Overlays/VersionManager.cs | 3 ++- .../Objects/Drawables/Pieces/SpinnerBackground.cs | 3 ++- osu.Game/Graphics/Backgrounds/Triangles.cs | 4 +++- osu.Game/Graphics/UserInterface/BreadcrumbControl.cs | 4 +++- osu.Game/Overlays/OnScreenDisplay.cs | 3 ++- osu.Game/Overlays/Profile/ProfileHeader.cs | 7 +++++-- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 4 +++- .../Edit/Layers/Selection/HitObjectSelectionBox.cs | 3 ++- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 3 ++- osu.Game/Screens/Menu/Button.cs | 4 +++- osu.Game/Screens/Menu/ButtonSystem.cs | 4 +++- osu.Game/Screens/Menu/LogoVisualisation.cs | 3 ++- osu.Game/Screens/Menu/MenuSideFlashes.cs | 3 ++- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 4 +++- osu.Game/Screens/Play/KeyCounterCollection.cs | 4 +++- osu.Game/Screens/Play/SongProgress.cs | 3 ++- osu.Game/Screens/Play/SquareGraph.cs | 3 ++- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 ++- osu.Game/Storyboards/Drawables/DrawableStoryboard.cs | 3 ++- 19 files changed, 48 insertions(+), 20 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 923356c610..090173f38d 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -31,7 +31,8 @@ namespace osu.Desktop.Overlays private OsuConfigManager config; private OsuGameBase game; - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; [BackgroundDependencyLoader] private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs index 7c96a2a8cf..c44d7594ad 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs @@ -11,7 +11,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerBackground : CircularContainer, IHasAccentColour { - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; protected Box Disc; diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 5e23389b89..6f9d83473f 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -30,7 +30,9 @@ namespace osu.Game.Graphics.Backgrounds /// private const float edge_smoothness = 1; - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; + public Color4 ColourLight = Color4.White; public Color4 ColourDark = Color4.Black; diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs index 99afc02d5d..566254886e 100644 --- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs +++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs @@ -42,7 +42,9 @@ namespace osu.Game.Graphics.UserInterface //don't allow clicking between transitions and don't make the chevron clickable public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos); - public override bool HandleInput => State == Visibility.Visible; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => State == Visibility.Visible; private Visibility state; diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 6a1bd8e182..ce31f10fc4 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -22,7 +22,8 @@ namespace osu.Game.Overlays { private readonly Container box; - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; private readonly SpriteText textLine1; private readonly SpriteText textLine2; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 6a9f4b84b0..450979a261 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -474,7 +474,8 @@ namespace osu.Game.Overlays.Profile private class LinkFlowContainer : OsuTextFlowContainer { - public override bool HandleInput => true; + public override bool HandleKeyboardInput => true; + public override bool HandleMouseInput => true; public LinkFlowContainer(Action defaultCreationParameters = null) : base(defaultCreationParameters) { @@ -488,7 +489,9 @@ namespace osu.Game.Overlays.Profile { private readonly OsuHoverContainer content; - public override bool HandleInput => content.Action != null; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => content.Action != null; protected override Container Content => content ?? (Container)this; diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 0fa6fa23a2..2acc1075a3 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -87,7 +87,9 @@ namespace osu.Game.Overlays.Toolbar ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault(); } - public override bool HandleInput => !ruleset.Disabled; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => !ruleset.Disabled; private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); diff --git a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs index c840cb0c38..fcb2f8f57f 100644 --- a/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs +++ b/osu.Game/Rulesets/Edit/Layers/Selection/HitObjectSelectionBox.cs @@ -165,7 +165,8 @@ namespace osu.Game.Rulesets.Edit.Layers.Selection } private bool isActive = true; - public override bool HandleInput => isActive; + public override bool HandleKeyboardInput => isActive; + public override bool HandleMouseInput => isActive; public override void Hide() { diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 34c34e1d33..546281df44 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -61,7 +61,8 @@ namespace osu.Game.Rulesets.Objects.Drawables public new readonly TObject HitObject; - public override bool HandleInput => Interactive; + public override bool HandleKeyboardInput => Interactive; + public override bool HandleMouseInput => Interactive; public bool Interactive = true; /// diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index f5dd5cb500..fff2435cb4 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -222,7 +222,9 @@ namespace osu.Game.Screens.Menu boxHoverLayer.FadeOut(800, Easing.OutExpo); } - public override bool HandleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; protected override void Update() { diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 72fe4368f0..b77dc4a656 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -200,7 +200,9 @@ namespace osu.Game.Screens.Menu private MenuState state; - public override bool HandleInput => state != MenuState.Exit; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput=> state != MenuState.Exit; public MenuState State { diff --git a/osu.Game/Screens/Menu/LogoVisualisation.cs b/osu.Game/Screens/Menu/LogoVisualisation.cs index 3fb5cc6d0d..3a3f3d4650 100644 --- a/osu.Game/Screens/Menu/LogoVisualisation.cs +++ b/osu.Game/Screens/Menu/LogoVisualisation.cs @@ -64,7 +64,8 @@ namespace osu.Game.Screens.Menu private readonly float[] frequencyAmplitudes = new float[256]; - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; private Shader shader; private readonly Texture texture; diff --git a/osu.Game/Screens/Menu/MenuSideFlashes.cs b/osu.Game/Screens/Menu/MenuSideFlashes.cs index 3cf2ce8e89..f94e2bddc1 100644 --- a/osu.Game/Screens/Menu/MenuSideFlashes.cs +++ b/osu.Game/Screens/Menu/MenuSideFlashes.cs @@ -19,7 +19,8 @@ namespace osu.Game.Screens.Menu { public class MenuSideFlashes : BeatSyncedContainer { - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; private readonly Bindable beatmap = new Bindable(); diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index af222b82e2..8fa76e2e51 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -142,7 +142,9 @@ namespace osu.Game.Screens.Play } } - public override bool HandleInput => State == Visibility.Visible; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => State == Visibility.Visible; protected override void PopIn() => this.FadeIn(transition_duration, Easing.In); protected override void PopOut() => this.FadeOut(transition_duration, Easing.In); diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 554fbbaf61..c716841861 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -111,7 +111,9 @@ namespace osu.Game.Screens.Play } } - public override bool HandleInput => receptor == null; + public override bool HandleKeyboardInput => handleInput; + public override bool HandleMouseInput => handleInput; + private bool handleInput => receptor == null; private Receptor receptor; diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 897fe4bba7..8aad741ad1 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -28,7 +28,8 @@ namespace osu.Game.Screens.Play public Action OnSeek; - public override bool HandleInput => AllowSeeking; + public override bool HandleKeyboardInput => AllowSeeking; + public override bool HandleMouseInput => AllowSeeking; private IClock audioClock; public IClock AudioClock { set { audioClock = info.AudioClock = value; } } diff --git a/osu.Game/Screens/Play/SquareGraph.cs b/osu.Game/Screens/Play/SquareGraph.cs index 7bccad0c34..48013f7943 100644 --- a/osu.Game/Screens/Play/SquareGraph.cs +++ b/osu.Game/Screens/Play/SquareGraph.cs @@ -21,7 +21,8 @@ namespace osu.Game.Screens.Play public int ColumnCount => columns.Length; - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; private int progress; public int Progress diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index 7a47bb9631..93b77fe1c4 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -51,7 +51,8 @@ namespace osu.Game.Screens.Select /// public Action SelectionChanged; - public override bool HandleInput => AllowSelection; + public override bool HandleKeyboardInput => AllowSelection; + public override bool HandleMouseInput => AllowSelection; /// /// Used to avoid firing null selections before the initial beatmaps have been loaded via . diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs index 7e8a80d86a..2489369493 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboard.cs @@ -26,7 +26,8 @@ namespace osu.Game.Storyboards.Drawables protected override Container Content => content; protected override Vector2 DrawScale => new Vector2(Parent.DrawHeight / 480); - public override bool HandleInput => false; + public override bool HandleKeyboardInput => false; + public override bool HandleMouseInput => false; private bool passing = true; public bool Passing From c4d1922c8bbf653a563f8a0854bfff3f7f1e5c78 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 8 Jan 2018 11:34:37 +0900 Subject: [PATCH 217/628] Add scrolling algorithm to global settings --- osu.Game/Configuration/OsuConfigManager.cs | 5 +++- .../Configuration/ScrollingAlgorithmType.cs | 15 +++++++++++ .../Sections/Gameplay/ScrollingSettings.cs | 26 ++++++++++++++++++ .../Settings/Sections/GameplaySection.cs | 3 ++- osu.Game/Rulesets/UI/Playfield.cs | 8 +++--- .../Algorithms/LocalScrollingAlgorithm.cs | 2 +- .../GlobalScrollingHitObjectContainer.cs | 17 ------------ .../LocalScrollingHitObjectContainer.cs | 17 ------------ .../Scrolling/ScrollingHitObjectContainer.cs | 27 +++++++++++-------- .../UI/Scrolling/ScrollingPlayfield.cs | 14 +++++----- osu.Game/osu.Game.csproj | 4 +-- 11 files changed, 77 insertions(+), 61 deletions(-) create mode 100644 osu.Game/Configuration/ScrollingAlgorithmType.cs create mode 100644 osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs delete mode 100644 osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs delete mode 100644 osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index f4c7bdb586..4ff4105b77 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -71,6 +71,8 @@ namespace osu.Game.Configuration Set(OsuSetting.FloatingComments, false); + Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); + // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -114,6 +116,7 @@ namespace osu.Game.Configuration ShowFpsDisplay, ChatDisplayHeight, Version, - ShowConvertedBeatmaps + ShowConvertedBeatmaps, + ScrollingAlgorithm } } diff --git a/osu.Game/Configuration/ScrollingAlgorithmType.cs b/osu.Game/Configuration/ScrollingAlgorithmType.cs new file mode 100644 index 0000000000..b4a2b8a4a3 --- /dev/null +++ b/osu.Game/Configuration/ScrollingAlgorithmType.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using System.ComponentModel; + +namespace osu.Game.Configuration +{ + public enum ScrollingAlgorithmType + { + [Description("Global")] + Global, + [Description("Local")] + Local + } +} diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs new file mode 100644 index 0000000000..b2a2a25da7 --- /dev/null +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Allocation; +using osu.Game.Configuration; + +namespace osu.Game.Overlays.Settings.Sections.Gameplay +{ + public class ScrollingSettings : SettingsSubsection + { + protected override string Header => "Scrolling"; + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + Children = new[] + { + new SettingsEnumDropdown + { + LabelText = "Scrolling algorithm", + Bindable = config.GetBindable(OsuSetting.ScrollingAlgorithm), + } + }; + } + } +} diff --git a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs index 035a3c7a13..8b05bfe8de 100644 --- a/osu.Game/Overlays/Settings/Sections/GameplaySection.cs +++ b/osu.Game/Overlays/Settings/Sections/GameplaySection.cs @@ -21,6 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections { new GeneralSettings(), new SongSelectSettings(), + new ScrollingSettings() }; } @@ -35,4 +36,4 @@ namespace osu.Game.Overlays.Settings.Sections } } } -} \ No newline at end of file +} diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 91ea3ade2a..0f8a650718 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.UI /// /// The HitObjects contained in this Playfield. /// - public readonly HitObjectContainer HitObjects; + public HitObjectContainer HitObjects { get; private set; } public Container ScaledContent; @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.UI } } }); - - HitObjects = CreateHitObjectContainer(); - HitObjects.RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] private void load() { + HitObjects = CreateHitObjectContainer(); + HitObjects.RelativeSizeAxes = Axes.Both; + Add(HitObjects); } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs index ddd06a3725..be8612ca96 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms var controlPoint = controlPointAt(obj.HitObject.StartTime); obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier; - obj.LifetimeEnd = ((obj as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier; + obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier; } } diff --git a/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs deleted file mode 100644 index 23dff01940..0000000000 --- a/osu.Game/Rulesets/UI/Scrolling/GlobalScrollingHitObjectContainer.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE - -using osu.Game.Rulesets.UI.Scrolling.Algorithms; - -namespace osu.Game.Rulesets.UI.Scrolling -{ - public class GlobalScrollingHitObjectContainer : ScrollingHitObjectContainer - { - public GlobalScrollingHitObjectContainer(ScrollingDirection direction) - : base(direction) - { - } - - protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new GlobalScrollingAlgorithm(ControlPoints); - } -} diff --git a/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs deleted file mode 100644 index ceef688cbc..0000000000 --- a/osu.Game/Rulesets/UI/Scrolling/LocalScrollingHitObjectContainer.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE - -using osu.Game.Rulesets.UI.Scrolling.Algorithms; - -namespace osu.Game.Rulesets.UI.Scrolling -{ - public class LocalScrollingHitObjectContainer : ScrollingHitObjectContainer - { - public LocalScrollingHitObjectContainer(ScrollingDirection direction) - : base(direction) - { - } - - protected override IScrollingAlgorithm CreateScrollingAlgorithm() => new LocalScrollingAlgorithm(ControlPoints); - } -} diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index e1d8fe8d59..67f2e8aee0 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -1,17 +1,19 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Allocation; using osu.Framework.Caching; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Lists; +using osu.Game.Configuration; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI.Scrolling.Algorithms; namespace osu.Game.Rulesets.UI.Scrolling { - public abstract class ScrollingHitObjectContainer : HitObjectContainer + public class ScrollingHitObjectContainer : HitObjectContainer { public readonly BindableDouble TimeRange = new BindableDouble { @@ -25,7 +27,7 @@ namespace osu.Game.Rulesets.UI.Scrolling private Cached initialStateCache = new Cached(); - protected ScrollingHitObjectContainer(ScrollingDirection direction) + public ScrollingHitObjectContainer(ScrollingDirection direction) { this.direction = direction; @@ -35,11 +37,19 @@ namespace osu.Game.Rulesets.UI.Scrolling } private IScrollingAlgorithm scrollingAlgorithm; - protected override void LoadComplete() - { - base.LoadComplete(); - scrollingAlgorithm = CreateScrollingAlgorithm(); + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + switch (config.Get(OsuSetting.ScrollingAlgorithm)) + { + case ScrollingAlgorithmType.Global: + scrollingAlgorithm = new GlobalScrollingAlgorithm(ControlPoints); + break; + case ScrollingAlgorithmType.Local: + scrollingAlgorithm = new LocalScrollingAlgorithm(ControlPoints); + break; + } } public override void Add(DrawableHitObject hitObject) @@ -99,10 +109,5 @@ namespace osu.Game.Rulesets.UI.Scrolling scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize); } - - /// - /// Creates the algorithm that will process the positions of the s. - /// - protected abstract IScrollingAlgorithm CreateScrollingAlgorithm(); } } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index f560d8eaa6..8669339294 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Transforms; @@ -62,6 +63,11 @@ namespace osu.Game.Rulesets.UI.Scrolling : base(customWidth) { this.direction = direction; + } + + [BackgroundDependencyLoader] + private void load() + { HitObjects.TimeRange.BindTo(VisibleTimeRange); } @@ -107,13 +113,7 @@ namespace osu.Game.Rulesets.UI.Scrolling this.TransformTo(this.PopulateTransform(new TransformVisibleTimeRange(), newTimeRange, duration, easing)); } - protected sealed override HitObjectContainer CreateHitObjectContainer() => CreateScrollingHitObjectContainer(); - - /// - /// Creates the that will handle the scrolling of the s. - /// - /// - protected virtual ScrollingHitObjectContainer CreateScrollingHitObjectContainer() => new GlobalScrollingHitObjectContainer(direction); + protected sealed override HitObjectContainer CreateHitObjectContainer() => new ScrollingHitObjectContainer(direction); private class TransformVisibleTimeRange : Transform { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 327b87d5de..45183de092 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -265,6 +265,7 @@ + @@ -310,6 +311,7 @@ + @@ -319,8 +321,6 @@ - - From d5b436d91b8347a4afacb45d43762a8120886f29 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Mon, 8 Jan 2018 23:11:20 +0900 Subject: [PATCH 218/628] use public List Columns => listColumnStages.SelectMany(x => x.Columns).ToList(); instead --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3775104a06..292b301e29 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -44,18 +44,7 @@ namespace osu.Game.Rulesets.Mania.UI } } - public List Columns - { - get - { - var list = new List(); - foreach (var stage in listColumnStages) - { - list.AddRange(stage.Columns); - } - return list; - } - } + public List Columns => listColumnStages.SelectMany(x => x.Columns).ToList(); public ManiaPlayfield(List stages) : base(Axes.Y) From f6c168be27568d460ff39d57bb76480faf06ef3c Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 8 Jan 2018 18:21:18 +0100 Subject: [PATCH 219/628] add skip cutscene as "in game" keybinding --- .../Bindings/GlobalKeyBindingInputManager.cs | 13 +++++++++++- .../KeyBinding/GlobalKeyBindingsSection.cs | 20 +++++++++++++++---- osu.Game/Screens/Play/SkipButton.cs | 17 ++++++++-------- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs index bf492af776..f5e54775fb 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs @@ -20,7 +20,9 @@ namespace osu.Game.Input.Bindings handler = game; } - public override IEnumerable DefaultKeyBindings => new[] + public override IEnumerable DefaultKeyBindings => GlobalKeyBindings.Concat(InGameKeyBindings); + + public IEnumerable GlobalKeyBindings => new[] { new KeyBinding(InputKey.F8, GlobalAction.ToggleChat), new KeyBinding(InputKey.F9, GlobalAction.ToggleSocial), @@ -33,6 +35,11 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.MouseWheelDown }, GlobalAction.DecreaseVolume), }; + public IEnumerable InGameKeyBindings => new[] + { + new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene) + }; + protected override IEnumerable KeyBindingInputQueue => handler == null ? base.KeyBindingInputQueue : new[] { handler }.Concat(base.KeyBindingInputQueue); } @@ -55,5 +62,9 @@ namespace osu.Game.Input.Bindings IncreaseVolume, [Description("Decrease Volume")] DecreaseVolume, + + // In-Game Keybindings + [Description("Skip Cutscene")] + SkipCutscene } } diff --git a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs index 8ec0a44d9b..f5b3096404 100644 --- a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs @@ -1,8 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Input.Bindings; using osu.Game.Graphics; +using osu.Game.Input.Bindings; using osu.Game.Overlays.Settings; namespace osu.Game.Overlays.KeyBinding @@ -12,19 +12,31 @@ namespace osu.Game.Overlays.KeyBinding public override FontAwesome Icon => FontAwesome.fa_osu_hot; public override string Header => "Global"; - public GlobalKeyBindingsSection(KeyBindingContainer manager) + public GlobalKeyBindingsSection(GlobalKeyBindingInputManager manager) { Add(new DefaultBindingsSubsection(manager)); + Add(new InGameKeyBindingsSubsection(manager)); } + private class DefaultBindingsSubsection : KeyBindingsSubsection { protected override string Header => string.Empty; - public DefaultBindingsSubsection(KeyBindingContainer manager) + public DefaultBindingsSubsection(GlobalKeyBindingInputManager manager) : base(null) { - Defaults = manager.DefaultKeyBindings; + Defaults = manager.GlobalKeyBindings; + } + } + + private class InGameKeyBindingsSubsection : KeyBindingsSubsection + { + protected override string Header => "In Game"; + + public InGameKeyBindingsSubsection(GlobalKeyBindingInputManager manager) : base(null) + { + Defaults = manager.InGameKeyBindings; } } } diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 0001aa0e76..55b2e21c53 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -14,13 +14,14 @@ using osu.Game.Graphics.Sprites; using osu.Game.Screens.Ranking; using OpenTK; using OpenTK.Graphics; -using OpenTK.Input; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics.Containers; +using osu.Framework.Input.Bindings; +using osu.Game.Input.Bindings; namespace osu.Game.Screens.Play { - public class SkipButton : Container + public class SkipButton : Container, IKeyBindingHandler { private readonly double startTime; public IAdjustableClock AudioClock; @@ -117,20 +118,20 @@ namespace osu.Game.Screens.Play remainingTimeBox.ResizeWidthTo((float)Math.Max(0, 1 - (Time.Current - displayTime) / (beginFadeTime - displayTime)), 120, Easing.OutQuint); } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + public bool OnPressed(GlobalAction action) { - if (args.Repeat) return false; - - switch (args.Key) + switch (action) { - case Key.Space: + case GlobalAction.SkipCutscene: button.TriggerOnClick(); return true; } - return base.OnKeyDown(state, args); + return false; } + public bool OnReleased(GlobalAction action) => false; + private class FadeContainer : Container, IStateful { public event Action StateChanged; From a3f05ca9ecd8bda3928c4061822e788f3ba50b60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 12:43:10 +0900 Subject: [PATCH 220/628] Avoid unnecessary use of linq --- 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 11f0b6d138..c0767cc07a 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -267,7 +267,7 @@ namespace osu.Game.Screens.Select set = visibleSets.ElementAt(RNG.Next(visibleSets.Count)); var visibleBeatmaps = set.Beatmaps.Where(s => !s.Filtered).ToList(); - select(visibleBeatmaps.Skip(RNG.Next(visibleBeatmaps.Count)).FirstOrDefault()); + select(visibleBeatmaps[RNG.Next(visibleBeatmaps.Count)]); return true; } From 722eb2515ff2d3c9dda99408f1b3cb30cafef44f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 12:44:52 +0900 Subject: [PATCH 221/628] Improve variable names --- .../Visual/TestCaseBeatmapCarousel.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs index 586d9f85ed..4a65d12977 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapCarousel.cs @@ -237,7 +237,7 @@ namespace osu.Game.Tests.Visual nextRandom(); AddAssert("ensure repeat", () => selectedSets.Contains(carousel.SelectedBeatmapSet)); - AddStep("Add set with 100 difficulties", () => carousel.UpdateBeatmapSet(createTestBeatmapSetWith100Difficulties(set_count + 1))); + AddStep("Add set with 100 difficulties", () => carousel.UpdateBeatmapSet(createTestBeatmapSetWithManyDifficulties(set_count + 1))); AddStep("Filter Extra", () => carousel.Filter(new FilterCriteria { SearchText = "Extra 10" }, false)); checkInvisibleDifficultiesUnselectable(); checkInvisibleDifficultiesUnselectable(); @@ -353,26 +353,26 @@ namespace osu.Game.Tests.Visual } } - private BeatmapSetInfo createTestBeatmapSet(int i) + private BeatmapSetInfo createTestBeatmapSet(int id) { return new BeatmapSetInfo { - ID = i, - OnlineBeatmapSetID = i, + ID = id, + OnlineBeatmapSetID = id, Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(), Metadata = new BeatmapMetadata { - OnlineBeatmapSetID = i, + OnlineBeatmapSetID = id, // Create random metadata, then we can check if sorting works based on these - Artist = $"peppy{i.ToString().PadLeft(6, '0')}", - Title = $"test set #{i}!", - AuthorString = string.Concat(Enumerable.Repeat((char)('z' - Math.Min(25, i - 1)), 5)) + Artist = $"peppy{id.ToString().PadLeft(6, '0')}", + Title = $"test set #{id}!", + AuthorString = string.Concat(Enumerable.Repeat((char)('z' - Math.Min(25, id - 1)), 5)) }, Beatmaps = new List(new[] { new BeatmapInfo { - OnlineBeatmapID = i * 10, + OnlineBeatmapID = id * 10, Path = "normal.osu", Version = "Normal", StarDifficulty = 2, @@ -383,7 +383,7 @@ namespace osu.Game.Tests.Visual }, new BeatmapInfo { - OnlineBeatmapID = i * 10 + 1, + OnlineBeatmapID = id * 10 + 1, Path = "hard.osu", Version = "Hard", StarDifficulty = 5, @@ -394,7 +394,7 @@ namespace osu.Game.Tests.Visual }, new BeatmapInfo { - OnlineBeatmapID = i * 10 + 2, + OnlineBeatmapID = id * 10 + 2, Path = "insane.osu", Version = "Insane", StarDifficulty = 6, @@ -407,20 +407,20 @@ namespace osu.Game.Tests.Visual }; } - private BeatmapSetInfo createTestBeatmapSetWith100Difficulties(int i) + private BeatmapSetInfo createTestBeatmapSetWithManyDifficulties(int id) { var toReturn = new BeatmapSetInfo { - ID = i, - OnlineBeatmapSetID = i, + ID = id, + OnlineBeatmapSetID = id, Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(), Metadata = new BeatmapMetadata { - OnlineBeatmapSetID = i, + OnlineBeatmapSetID = id, // Create random metadata, then we can check if sorting works based on these - Artist = $"peppy{i.ToString().PadLeft(6, '0')}", - Title = $"test set #{i}!", - AuthorString = string.Concat(Enumerable.Repeat((char)('z' - Math.Min(25, i - 1)), 5)) + Artist = $"peppy{id.ToString().PadLeft(6, '0')}", + Title = $"test set #{id}!", + AuthorString = string.Concat(Enumerable.Repeat((char)('z' - Math.Min(25, id - 1)), 5)) }, Beatmaps = new List(), }; From b8bb0a52e39d91180dfad5ca4b3651b01deaa05d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 13:41:57 +0900 Subject: [PATCH 222/628] Move mod implementations to individual files --- osu.Game.Rulesets.Catch/Mods/CatchMod.cs | 69 ------ .../Mods/CatchModDaycore.cs | 12 ++ .../Mods/CatchModDoubleTime.cs | 12 ++ osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs | 11 + .../Mods/CatchModFlashlight.cs | 12 ++ .../Mods/CatchModHalfTime.cs | 12 ++ .../Mods/CatchModHardRock.cs | 13 ++ .../Mods/CatchModHidden.cs | 13 ++ .../Mods/CatchModNightcore.cs | 12 ++ .../Mods/CatchModNoFail.cs | 11 + .../Mods/CatchModPerfect.cs | 11 + osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs | 12 ++ .../Mods/CatchModSuddenDeath.cs | 11 + .../osu.Game.Rulesets.Catch.csproj | 13 +- osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs | 29 +++ osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 197 ------------------ .../Mods/ManiaModAutoplay.cs | 24 +++ .../Mods/ManiaModDaycore.cs | 12 ++ .../Mods/ManiaModDoubleTime.cs | 12 ++ osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs | 11 + .../Mods/ManiaModFadeIn.cs | 20 ++ .../Mods/ManiaModFlashlight.cs | 14 ++ .../Mods/ManiaModGravity.cs | 14 +- .../Mods/ManiaModHalfTime.cs | 12 ++ .../Mods/ManiaModHardRock.cs | 12 ++ .../Mods/ManiaModHidden.cs | 15 ++ osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey8.cs | 11 + osu.Game.Rulesets.Mania/Mods/ManiaModKey9.cs | 11 + .../Mods/ManiaModKeyCoop.cs | 16 ++ .../Mods/ManiaModNightcore.cs | 12 ++ .../Mods/ManiaModNoFail.cs | 11 + .../Mods/ManiaModPerfect.cs | 11 + .../Mods/ManiaModRandom.cs | 31 +++ .../Mods/ManiaModSuddenDeath.cs | 11 + .../osu.Game.Rulesets.Mania.csproj | 26 ++- osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 189 ----------------- osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs | 20 ++ osu.Game.Rulesets.Osu/Mods/OsuModAutoplay.cs | 26 +++ osu.Game.Rulesets.Osu/Mods/OsuModDaycore.cs | 12 ++ .../Mods/OsuModDoubleTime.cs | 12 ++ osu.Game.Rulesets.Osu/Mods/OsuModEasy.cs | 11 + .../Mods/OsuModFlashlight.cs | 12 ++ osu.Game.Rulesets.Osu/Mods/OsuModHalfTime.cs | 12 ++ osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs | 32 +++ osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs | 79 +++++++ osu.Game.Rulesets.Osu/Mods/OsuModNightcore.cs | 12 ++ osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs | 14 ++ osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs | 11 + osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs | 15 ++ osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs | 20 ++ .../Mods/OsuModSuddenDeath.cs | 14 ++ osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs | 17 ++ .../osu.Game.Rulesets.Osu.csproj | 17 +- osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs | 83 -------- .../Mods/TaikoModAutoplay.cs | 24 +++ .../Mods/TaikoModDaycore.cs | 12 ++ .../Mods/TaikoModDoubleTime.cs | 12 ++ osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs | 11 + .../Mods/TaikoModFlashlight.cs | 12 ++ .../Mods/TaikoModHalfTime.cs | 12 ++ .../Mods/TaikoModHardRock.cs | 13 ++ .../Mods/TaikoModHidden.cs | 13 ++ .../Mods/TaikoModNightcore.cs | 12 ++ .../Mods/TaikoModNoFail.cs | 11 + .../Mods/TaikoModPerfect.cs | 11 + osu.Game.Rulesets.Taiko/Mods/TaikoModRelax.cs | 12 ++ .../Mods/TaikoModSuddenDeath.cs | 11 + .../osu.Game.Rulesets.Taiko.csproj | 14 +- 75 files changed, 1052 insertions(+), 549 deletions(-) delete mode 100644 osu.Game.Rulesets.Catch/Mods/CatchMod.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModDaycore.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModDoubleTime.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModHalfTime.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModNightcore.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModNoFail.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModPerfect.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModSuddenDeath.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs delete mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaMod.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModAutoplay.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModDaycore.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModHalfTime.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey8.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKey9.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModNoFail.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs create mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModSuddenDeath.cs delete mode 100644 osu.Game.Rulesets.Osu/Mods/OsuMod.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModAutoplay.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDaycore.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModDoubleTime.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModEasy.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModHalfTime.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModNightcore.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs create mode 100644 osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs delete mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModAutoplay.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModDaycore.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModDoubleTime.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModHalfTime.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModNightcore.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModNoFail.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModPerfect.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModRelax.cs create mode 100644 osu.Game.Rulesets.Taiko/Mods/TaikoModSuddenDeath.cs diff --git a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs deleted file mode 100644 index d243ee69e3..0000000000 --- a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Rulesets.Mods; - -namespace osu.Game.Rulesets.Catch.Mods -{ - public class CatchModNoFail : ModNoFail - { - - } - - public class CatchModEasy : ModEasy - { - - } - - public class CatchModHidden : ModHidden - { - public override string Description => @"Play with fading notes for a slight score advantage."; - public override double ScoreMultiplier => 1.06; - } - - public class CatchModHardRock : ModHardRock - { - public override double ScoreMultiplier => 1.12; - public override bool Ranked => true; - } - - public class CatchModSuddenDeath : ModSuddenDeath - { - - } - - public class CatchModDaycore : ModDaycore - { - public override double ScoreMultiplier => 0.5; - } - - public class CatchModDoubleTime : ModDoubleTime - { - public override double ScoreMultiplier => 1.06; - } - - public class CatchModRelax : ModRelax - { - public override string Description => @"Use the mouse to control the catcher."; - } - - public class CatchModHalfTime : ModHalfTime - { - public override double ScoreMultiplier => 0.5; - } - - public class CatchModNightcore : ModNightcore - { - public override double ScoreMultiplier => 1.06; - } - - public class CatchModFlashlight : ModFlashlight - { - public override double ScoreMultiplier => 1.12; - } - - public class CatchModPerfect : ModPerfect - { - - } -} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDaycore.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDaycore.cs new file mode 100644 index 0000000000..124af06d56 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDaycore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDoubleTime.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDoubleTime.cs new file mode 100644 index 0000000000..7a7eeed719 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModDoubleTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.06; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs b/osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs new file mode 100644 index 0000000000..5c025bdea0 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModEasy.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModEasy : ModEasy + { + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs new file mode 100644 index 0000000000..424f14ad02 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModHalfTime.cs b/osu.Game.Rulesets.Catch/Mods/CatchModHalfTime.cs new file mode 100644 index 0000000000..303fa6011d --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModHalfTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs b/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs new file mode 100644 index 0000000000..ed33bf7124 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModHardRock.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.12; + public override bool Ranked => true; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs b/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs new file mode 100644 index 0000000000..981ebda9eb --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModHidden.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModHidden : ModHidden + { + public override string Description => @"Play with fading notes for a slight score advantage."; + public override double ScoreMultiplier => 1.06; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModNightcore.cs b/osu.Game.Rulesets.Catch/Mods/CatchModNightcore.cs new file mode 100644 index 0000000000..b53cac0d7c --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModNightcore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.06; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModNoFail.cs b/osu.Game.Rulesets.Catch/Mods/CatchModNoFail.cs new file mode 100644 index 0000000000..afb2d83720 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModNoFail.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModNoFail : ModNoFail + { + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModPerfect.cs b/osu.Game.Rulesets.Catch/Mods/CatchModPerfect.cs new file mode 100644 index 0000000000..bc0dd10f6c --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModPerfect.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModPerfect : ModPerfect + { + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs b/osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs new file mode 100644 index 0000000000..de0b6bc614 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModRelax.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModRelax : ModRelax + { + public override string Description => @"Use the mouse to control the catcher."; + } +} diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModSuddenDeath.cs b/osu.Game.Rulesets.Catch/Mods/CatchModSuddenDeath.cs new file mode 100644 index 0000000000..1e778e5305 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModSuddenDeath.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModSuddenDeath : ModSuddenDeath + { + } +} diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 16c909e063..6c42c4341f 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -49,6 +49,17 @@ + + + + + + + + + + + @@ -71,7 +82,7 @@ - + diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs new file mode 100644 index 0000000000..e6711923ff --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs @@ -0,0 +1,29 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public abstract class ManiaKeyMod : Mod, IApplicableMod, IApplicableToBeatmapConverter + { + public override string ShortenedName => Name; + public abstract int KeyCount { get; } + public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier + public override bool Ranked => true; + + public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) + { + var mbc = (ManiaBeatmapConverter)beatmapConverter; + + // Although this can work, for now let's not allow keymods for mania-specific beatmaps + if (mbc.IsForCurrentRuleset) + return; + + mbc.TargetColumns = KeyCount; + } + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs deleted file mode 100644 index 4cfc4cdd2a..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Graphics; -using osu.Game.Rulesets.Mods; -using System; -using System.Linq; -using osu.Framework.Extensions.IEnumerableExtensions; -using osu.Framework.MathUtils; -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Mania.Beatmaps; -using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.Replays; -using osu.Game.Rulesets.Mania.UI; -using osu.Game.Rulesets.Scoring; -using osu.Game.Users; -using osu.Game.Rulesets.UI; - -namespace osu.Game.Rulesets.Mania.Mods -{ - public class ManiaModNoFail : ModNoFail - { - - } - - public class ManiaModEasy : ModEasy - { - - } - - public class ManiaModHidden : ModHidden - { - public override string Description => @"The notes fade out before you hit them!"; - public override double ScoreMultiplier => 1.0; - public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; - } - - public class ManiaModHardRock : ModHardRock - { - public override double ScoreMultiplier => 1.0; - } - - public class ManiaModSuddenDeath : ModSuddenDeath - { - - } - - public class ManiaModDaycore : ModDaycore - { - public override double ScoreMultiplier => 0.3; - } - - public class ManiaModDoubleTime : ModDoubleTime - { - public override double ScoreMultiplier => 1.0; - } - - public class ManiaModHalfTime : ModHalfTime - { - public override double ScoreMultiplier => 0.3; - } - - public class ManiaModNightcore : ModNightcore - { - public override double ScoreMultiplier => 1.0; - } - - public class ManiaModFlashlight : ModFlashlight - { - public override double ScoreMultiplier => 1.0; - public override Type[] IncompatibleMods => new[] { typeof(ModHidden) }; - } - - public class ManiaModPerfect : ModPerfect - { - - } - - public class ManiaModFadeIn : Mod - { - public override string Name => "FadeIn"; - public override string ShortenedName => "FI"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; - public override ModType Type => ModType.DifficultyIncrease; - public override double ScoreMultiplier => 1; - public override bool Ranked => true; - public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; - } - - public class ManiaModRandom : Mod, IApplicableToRulesetContainer - { - public override string Name => "Random"; - public override string ShortenedName => "RD"; - public override FontAwesome Icon => FontAwesome.fa_osu_dice; - public override string Description => @"Shuffle around the notes!"; - public override double ScoreMultiplier => 1; - - public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) - { - int availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; - var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); - - rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); - } - } - - public abstract class ManiaKeyMod : Mod, IApplicableMod, IApplicableToBeatmapConverter - { - public override string ShortenedName => Name; - public abstract int KeyCount { get; } - public override double ScoreMultiplier => 1; // TODO: Implement the mania key mod score multiplier - public override bool Ranked => true; - - public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) - { - var mbc = (ManiaBeatmapConverter)beatmapConverter; - - // Although this can work, for now let's not allow keymods for mania-specific beatmaps - if (mbc.IsForCurrentRuleset) - return; - - mbc.TargetColumns = KeyCount; - } - } - - public class ManiaModKey1 : ManiaKeyMod - { - public override int KeyCount => 1; - public override string Name => "1K"; - } - - public class ManiaModKey2 : ManiaKeyMod - { - public override int KeyCount => 2; - public override string Name => "2K"; - } - - public class ManiaModKey3 : ManiaKeyMod - { - public override int KeyCount => 3; - public override string Name => "3K"; - } - - public class ManiaModKey4 : ManiaKeyMod - { - public override int KeyCount => 4; - public override string Name => "4K"; - } - - public class ManiaModKey5 : ManiaKeyMod - { - public override int KeyCount => 5; - public override string Name => "5K"; - } - - public class ManiaModKey6 : ManiaKeyMod - { - public override int KeyCount => 6; - public override string Name => "6K"; - } - - public class ManiaModKey7 : ManiaKeyMod - { - public override int KeyCount => 7; - public override string Name => "7K"; - } - - public class ManiaModKey8 : ManiaKeyMod - { - public override int KeyCount => 8; - public override string Name => "8K"; - } - - public class ManiaModKey9 : ManiaKeyMod - { - public override int KeyCount => 9; - public override string Name => "9K"; - } - - public class ManiaModKeyCoop : Mod - { - public override string Name => "KeyCoop"; - public override string ShortenedName => "2P"; - public override string Description => @"Double the key amount, double the fun!"; - public override double ScoreMultiplier => 1; - public override bool Ranked => true; - } - - public class ManiaModAutoplay : ModAutoplay - { - protected override Score CreateReplayScore(Beatmap beatmap) => new Score - { - User = new User { Username = "osu!topus!" }, - Replay = new ManiaAutoGenerator(beatmap).Generate(), - }; - } -} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModAutoplay.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModAutoplay.cs new file mode 100644 index 0000000000..3c5179cef0 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModAutoplay.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Replays; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Users; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModAutoplay : ModAutoplay + { + protected override Score CreateReplayScore(Beatmap beatmap) + { + return new Score + { + User = new User { Username = "osu!topus!" }, + Replay = new ManiaAutoGenerator(beatmap).Generate(), + }; + } + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDaycore.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDaycore.cs new file mode 100644 index 0000000000..7c7dc5e4f7 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDaycore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.3; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs new file mode 100644 index 0000000000..64ce86e748 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDoubleTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.0; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs new file mode 100644 index 0000000000..1faed5e1c0 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModEasy.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModEasy : ModEasy + { + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs new file mode 100644 index 0000000000..03442507d6 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFadeIn.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Graphics; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModFadeIn : Mod + { + public override string Name => "FadeIn"; + public override string ShortenedName => "FI"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_hidden; + public override ModType Type => ModType.DifficultyIncrease; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs new file mode 100644 index 0000000000..89eb02268e --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.0; + public override Type[] IncompatibleMods => new[] { typeof(ModHidden) }; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs index 8b61d33f21..9d158cf3bb 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs @@ -3,13 +3,12 @@ using System.Collections.Generic; using System.Linq; +using osu.Game.Graphics; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; -using osu.Game.Graphics; -using osu.Game.Rulesets.Mania.Timing; using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.Mania.Objects.Drawables; namespace osu.Game.Rulesets.Mania.Mods { @@ -22,12 +21,13 @@ namespace osu.Game.Rulesets.Mania.Mods public override FontAwesome Icon => FontAwesome.fa_sort_desc; - public void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, ref List barlineTimingChanges) + public void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, + ref List barlineTimingChanges) { // We have to generate one speed adjustment per hit object for gravity - foreach (ManiaHitObject obj in rulesetContainer.Objects.OfType()) + foreach (var obj in rulesetContainer.Objects.OfType()) { - MultiplierControlPoint controlPoint = rulesetContainer.CreateControlPointAt(obj.StartTime); + var controlPoint = rulesetContainer.CreateControlPointAt(obj.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now controlPoint.TimingPoint.BeatLength = 1000; @@ -35,7 +35,7 @@ namespace osu.Game.Rulesets.Mania.Mods } // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (DrawableBarLine barLine in rulesetContainer.BarLines) + foreach (var barLine in rulesetContainer.BarLines) { var controlPoint = rulesetContainer.CreateControlPointAt(barLine.HitObject.StartTime); // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHalfTime.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHalfTime.cs new file mode 100644 index 0000000000..2f8404609f --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHalfTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.3; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs new file mode 100644 index 0000000000..91edbaf0cf --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHardRock.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.0; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs new file mode 100644 index 0000000000..c2fc07da89 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModHidden.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModHidden : ModHidden + { + public override string Description => @"The notes fade out before you hit them!"; + public override double ScoreMultiplier => 1.0; + public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight) }; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs new file mode 100644 index 0000000000..8a6943d99b --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey1.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey1 : ManiaKeyMod + { + public override int KeyCount => 1; + public override string Name => "1K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs new file mode 100644 index 0000000000..553827ac1c --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey2.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey2 : ManiaKeyMod + { + public override int KeyCount => 2; + public override string Name => "2K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs new file mode 100644 index 0000000000..ef048c848e --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey3.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey3 : ManiaKeyMod + { + public override int KeyCount => 3; + public override string Name => "3K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs new file mode 100644 index 0000000000..9c713d920f --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey4.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey4 : ManiaKeyMod + { + public override int KeyCount => 4; + public override string Name => "4K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs new file mode 100644 index 0000000000..a83faf4627 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey5.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey5 : ManiaKeyMod + { + public override int KeyCount => 5; + public override string Name => "5K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs new file mode 100644 index 0000000000..d7df901048 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey6.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey6 : ManiaKeyMod + { + public override int KeyCount => 6; + public override string Name => "6K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs new file mode 100644 index 0000000000..4a3f9857e5 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey7.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey7 : ManiaKeyMod + { + public override int KeyCount => 7; + public override string Name => "7K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey8.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey8.cs new file mode 100644 index 0000000000..22c301fb7a --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey8.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey8 : ManiaKeyMod + { + public override int KeyCount => 8; + public override string Name => "8K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKey9.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKey9.cs new file mode 100644 index 0000000000..b2a0bc4ddf --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKey9.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKey9 : ManiaKeyMod + { + public override int KeyCount => 9; + public override string Name => "9K"; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs new file mode 100644 index 0000000000..893e81f165 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModKeyCoop : Mod + { + public override string Name => "KeyCoop"; + public override string ShortenedName => "2P"; + public override string Description => @"Double the key amount, double the fun!"; + public override double ScoreMultiplier => 1; + public override bool Ranked => true; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs new file mode 100644 index 0000000000..a977eef5e3 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModNightcore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.0; + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModNoFail.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModNoFail.cs new file mode 100644 index 0000000000..c9c50f9919 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModNoFail.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModNoFail : ModNoFail + { + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs new file mode 100644 index 0000000000..2c0bd5f8c3 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModPerfect.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModPerfect : ModPerfect + { + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs new file mode 100644 index 0000000000..a6cbad44d7 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.MathUtils; +using osu.Game.Graphics; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.UI; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModRandom : Mod, IApplicableToRulesetContainer + { + public override string Name => "Random"; + public override string ShortenedName => "RD"; + public override FontAwesome Icon => FontAwesome.fa_osu_dice; + public override string Description => @"Shuffle around the notes!"; + public override double ScoreMultiplier => 1; + + public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + { + var availableColumns = ((ManiaRulesetContainer)rulesetContainer).Beatmap.TotalColumns; + var shuffledColumns = Enumerable.Range(0, availableColumns).OrderBy(item => RNG.Next()).ToList(); + + rulesetContainer.Objects.OfType().ForEach(h => h.Column = shuffledColumns[h.Column]); + } + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModSuddenDeath.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModSuddenDeath.cs new file mode 100644 index 0000000000..9edf131195 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModSuddenDeath.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Mania.Mods +{ + public class ManiaModSuddenDeath : ModSuddenDeath + { + } +} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index e9a572835b..11f354ec7d 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -65,6 +65,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -98,7 +122,7 @@ - + diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs deleted file mode 100644 index bd2f8090ed..0000000000 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; -using osu.Game.Graphics; -using osu.Game.Rulesets.Osu.Replays; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Osu.Objects; -using System; -using System.Collections.Generic; -using System.Linq; -using osu.Game.Rulesets.Osu.UI; -using osu.Game.Rulesets.Scoring; -using OpenTK; -using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Osu.Objects.Drawables; -using osu.Framework.Graphics; -using osu.Game.Rulesets.Objects.Types; - -namespace osu.Game.Rulesets.Osu.Mods -{ - public class OsuModNoFail : ModNoFail - { - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); - } - - public class OsuModEasy : ModEasy - { - } - - public class OsuModHidden : ModHidden, IApplicableToDrawableHitObjects - { - public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; - public override double ScoreMultiplier => 1.06; - - private const double fade_in_duration_multiplier = 0.4; - private const double fade_out_duration_multiplier = 0.3; - - private float preEmpt => DrawableOsuHitObject.TIME_PREEMPT; - - public void ApplyToDrawableHitObjects(IEnumerable drawables) - { - foreach (var d in drawables.OfType()) - { - d.ApplyCustomUpdateState += ApplyHiddenState; - d.FadeInDuration = preEmpt * fade_in_duration_multiplier; - } - } - - protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state) - { - if (!(drawable is DrawableOsuHitObject d)) - return; - - var fadeOutStartTime = d.HitObject.StartTime - preEmpt + d.FadeInDuration; - var fadeOutDuration = preEmpt * fade_out_duration_multiplier; - - // new duration from completed fade in to end (before fading out) - var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime; - - switch (drawable) - { - case DrawableHitCircle circle: - // we don't want to see the approach circle - circle.ApproachCircle.Hide(); - - // fade out immediately after fade in. - using (drawable.BeginAbsoluteSequence(fadeOutStartTime, true)) - circle.FadeOut(fadeOutDuration); - break; - case DrawableSlider slider: - using (slider.BeginAbsoluteSequence(fadeOutStartTime, true)) - slider.Body.FadeOut(longFadeDuration, Easing.Out); - break; - case DrawableSpinner spinner: - // hide elements we don't care about. - spinner.Disc.Hide(); - spinner.Ticks.Hide(); - spinner.Background.Hide(); - - using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true)) - spinner.FadeOut(fadeOutDuration); - break; - } - } - } - - public class OsuModHardRock : ModHardRock, IApplicableToHitObject - { - public override double ScoreMultiplier => 1.06; - public override bool Ranked => true; - - public void ApplyToHitObject(OsuHitObject hitObject) - { - hitObject.Position = new Vector2(hitObject.Position.X, OsuPlayfield.BASE_SIZE.Y - hitObject.Y); - - var slider = hitObject as Slider; - if (slider == null) - return; - - var newControlPoints = new List(); - slider.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); - - slider.ControlPoints = newControlPoints; - slider.Curve?.Calculate(); // Recalculate the slider curve - } - } - - public class OsuModSuddenDeath : ModSuddenDeath - { - 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; - } - - public class OsuModRelax : ModRelax - { - public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things."; - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); - } - - public class OsuModHalfTime : ModHalfTime - { - public override double ScoreMultiplier => 0.5; - } - - public class OsuModNightcore : ModNightcore - { - public override double ScoreMultiplier => 1.12; - } - - public class OsuModFlashlight : ModFlashlight - { - public override double ScoreMultiplier => 1.12; - } - - public class OsuModPerfect : ModPerfect - { - } - - public class OsuModSpunOut : Mod - { - public override string Name => "Spun Out"; - public override string ShortenedName => "SO"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout; - public override string Description => @"Spinners will be automatically completed"; - public override double ScoreMultiplier => 0.9; - public override bool Ranked => true; - public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) }; - } - - public class OsuModAutopilot : Mod - { - public override string Name => "Autopilot"; - public override string ShortenedName => "AP"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; - public override string Description => @"Automatic cursor movement - just follow the rhythm."; - public override double ScoreMultiplier => 0; - public override bool Ranked => false; - public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) }; - } - - public class OsuModAutoplay : ModAutoplay - { - public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray(); - - protected override Score CreateReplayScore(Beatmap beatmap) => new Score - { - Replay = new OsuAutoGenerator(beatmap).Generate() - }; - } - - public class OsuModTarget : Mod - { - public override string Name => "Target"; - public override string ShortenedName => "TP"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_target; - public override string Description => @""; - public override double ScoreMultiplier => 1; - } -} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs new file mode 100644 index 0000000000..0c842143e4 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Graphics; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModAutopilot : Mod + { + public override string Name => "Autopilot"; + public override string ShortenedName => "AP"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; + public override string Description => @"Automatic cursor movement - just follow the rhythm."; + public override double ScoreMultiplier => 0; + public override bool Ranked => false; + public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) }; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutoplay.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutoplay.cs new file mode 100644 index 0000000000..42fe95356d --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutoplay.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.Replays; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModAutoplay : ModAutoplay + { + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot), typeof(OsuModSpunOut) }).ToArray(); + + protected override Score CreateReplayScore(Beatmap beatmap) + { + return new Score + { + Replay = new OsuAutoGenerator(beatmap).Generate() + }; + } + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDaycore.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDaycore.cs new file mode 100644 index 0000000000..eb90338e2f --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDaycore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDoubleTime.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDoubleTime.cs new file mode 100644 index 0000000000..5a835aac75 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModDoubleTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModEasy.cs b/osu.Game.Rulesets.Osu/Mods/OsuModEasy.cs new file mode 100644 index 0000000000..80c83bf5d8 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModEasy.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModEasy : ModEasy + { + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs new file mode 100644 index 0000000000..342c53b41f --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHalfTime.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHalfTime.cs new file mode 100644 index 0000000000..7d009b0344 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHalfTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs new file mode 100644 index 0000000000..dfbe9ad021 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHardRock.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Osu.Objects; +using osu.Game.Rulesets.Osu.UI; +using OpenTK; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModHardRock : ModHardRock, IApplicableToHitObject + { + public override double ScoreMultiplier => 1.06; + public override bool Ranked => true; + + public void ApplyToHitObject(OsuHitObject hitObject) + { + hitObject.Position = new Vector2(hitObject.Position.X, OsuPlayfield.BASE_SIZE.Y - hitObject.Y); + + var slider = hitObject as Slider; + if (slider == null) + return; + + var newControlPoints = new List(); + slider.ControlPoints.ForEach(c => newControlPoints.Add(new Vector2(c.X, OsuPlayfield.BASE_SIZE.Y - c.Y))); + + slider.ControlPoints = newControlPoints; + slider.Curve?.Calculate(); // Recalculate the slider curve + } + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs new file mode 100644 index 0000000000..0356ba9aca --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs @@ -0,0 +1,79 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Graphics; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.Osu.Objects.Drawables; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModHidden : ModHidden, IApplicableToDrawableHitObjects + { + public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; + public override double ScoreMultiplier => 1.06; + + private const double fade_in_duration_multiplier = 0.4; + private const double fade_out_duration_multiplier = 0.3; + + private float preEmpt => DrawableOsuHitObject.TIME_PREEMPT; + + public void ApplyToDrawableHitObjects(IEnumerable drawables) + { + foreach (var d in drawables.OfType()) + { + d.ApplyCustomUpdateState += ApplyHiddenState; + d.FadeInDuration = preEmpt * fade_in_duration_multiplier; + } + } + + protected void ApplyHiddenState(DrawableHitObject drawable, ArmedState state) + { + if (!(drawable is DrawableOsuHitObject d)) + return; + + var fadeOutStartTime = d.HitObject.StartTime - preEmpt + d.FadeInDuration; + var fadeOutDuration = preEmpt * fade_out_duration_multiplier; + + // new duration from completed fade in to end (before fading out) + var longFadeDuration = ((d.HitObject as IHasEndTime)?.EndTime ?? d.HitObject.StartTime) - fadeOutStartTime; + + switch (drawable) + { + case DrawableHitCircle circle: + // we don't want to see the approach circle + circle.ApproachCircle.Hide(); + + // fade out immediately after fade in. + using (drawable.BeginAbsoluteSequence(fadeOutStartTime, true)) + { + circle.FadeOut(fadeOutDuration); + } + + break; + case DrawableSlider slider: + using (slider.BeginAbsoluteSequence(fadeOutStartTime, true)) + { + slider.Body.FadeOut(longFadeDuration, Easing.Out); + } + + break; + case DrawableSpinner spinner: + // hide elements we don't care about. + spinner.Disc.Hide(); + spinner.Ticks.Hide(); + spinner.Background.Hide(); + + using (spinner.BeginAbsoluteSequence(fadeOutStartTime + longFadeDuration, true)) + { + spinner.FadeOut(fadeOutDuration); + } + + break; + } + } + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModNightcore.cs b/osu.Game.Rulesets.Osu/Mods/OsuModNightcore.cs new file mode 100644 index 0000000000..aa0acff68d --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModNightcore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs b/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs new file mode 100644 index 0000000000..f94ee484fc --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModNoFail.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModNoFail : ModNoFail + { + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs b/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs new file mode 100644 index 0000000000..886048cd30 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModPerfect.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModPerfect : ModPerfect + { + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs new file mode 100644 index 0000000000..057916c04b --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs @@ -0,0 +1,15 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModRelax : ModRelax + { + public override string Description => "You don't need to click.\nGive your clicking/tapping finger a break from the heat of things."; + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs b/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs new file mode 100644 index 0000000000..18b212f781 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModSpunOut.cs @@ -0,0 +1,20 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Game.Graphics; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModSpunOut : Mod + { + public override string Name => "Spun Out"; + public override string ShortenedName => "SO"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_spunout; + public override string Description => @"Spinners will be automatically completed"; + public override double ScoreMultiplier => 0.9; + public override bool Ranked => true; + public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(OsuModAutopilot) }; + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs b/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs new file mode 100644 index 0000000000..797e0af0ad --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModSuddenDeath.cs @@ -0,0 +1,14 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Linq; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModSuddenDeath : ModSuddenDeath + { + public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); + } +} diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs b/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs new file mode 100644 index 0000000000..b2b5130be3 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Mods/OsuModTarget.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Graphics; +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Osu.Mods +{ + public class OsuModTarget : Mod + { + public override string Name => "Target"; + public override string ShortenedName => "TP"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_target; + public override string Description => @""; + public override double ScoreMultiplier => 1; + } +} diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 05dec5a20d..7d6001359a 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -51,6 +51,21 @@ + + + + + + + + + + + + + + + @@ -108,7 +123,7 @@ - + diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs deleted file mode 100644 index 8d13954cf4..0000000000 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Beatmaps; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Taiko.Objects; -using osu.Game.Rulesets.Taiko.Replays; -using osu.Game.Users; - -namespace osu.Game.Rulesets.Taiko.Mods -{ - public class TaikoModNoFail : ModNoFail - { - - } - - public class TaikoModEasy : ModEasy - { - - } - - public class TaikoModHidden : ModHidden - { - public override string Description => @"The notes fade out before you hit them!"; - public override double ScoreMultiplier => 1.06; - } - - public class TaikoModHardRock : ModHardRock - { - public override double ScoreMultiplier => 1.06; - public override bool Ranked => true; - } - - public class TaikoModSuddenDeath : ModSuddenDeath - { - - } - - public class TaikoModDaycore : ModDaycore - { - public override double ScoreMultiplier => 0.5; - } - - public class TaikoModDoubleTime : ModDoubleTime - { - public override double ScoreMultiplier => 1.12; - } - - public class TaikoModRelax : ModRelax - { - public override string Description => @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's."; - } - - public class TaikoModHalfTime : ModHalfTime - { - public override double ScoreMultiplier => 0.5; - } - - public class TaikoModNightcore : ModNightcore - { - public override double ScoreMultiplier => 1.12; - } - - public class TaikoModFlashlight : ModFlashlight - { - public override double ScoreMultiplier => 1.12; - } - - public class TaikoModPerfect : ModPerfect - { - - } - - public class TaikoModAutoplay : ModAutoplay - { - protected override Score CreateReplayScore(Beatmap beatmap) => new Score - { - User = new User { Username = "mekkadosu!" }, - Replay = new TaikoAutoGenerator(beatmap).Generate(), - }; - } -} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModAutoplay.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModAutoplay.cs new file mode 100644 index 0000000000..239f0d5a6b --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModAutoplay.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Rulesets.Taiko.Objects; +using osu.Game.Rulesets.Taiko.Replays; +using osu.Game.Users; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModAutoplay : ModAutoplay + { + protected override Score CreateReplayScore(Beatmap beatmap) + { + return new Score + { + User = new User { Username = "mekkadosu!" }, + Replay = new TaikoAutoGenerator(beatmap).Generate(), + }; + } + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDaycore.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDaycore.cs new file mode 100644 index 0000000000..c50878c6a3 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDaycore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDoubleTime.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDoubleTime.cs new file mode 100644 index 0000000000..2ae52b4549 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDoubleTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModDoubleTime : ModDoubleTime + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs new file mode 100644 index 0000000000..1c5e43f411 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModEasy.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModEasy : ModEasy + { + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs new file mode 100644 index 0000000000..a2c6d7f9e0 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModFlashlight : ModFlashlight + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHalfTime.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHalfTime.cs new file mode 100644 index 0000000000..9813f8b78e --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHalfTime.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModHalfTime : ModHalfTime + { + public override double ScoreMultiplier => 0.5; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs new file mode 100644 index 0000000000..ba304c41d8 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHardRock.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModHardRock : ModHardRock + { + public override double ScoreMultiplier => 1.06; + public override bool Ranked => true; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs new file mode 100644 index 0000000000..b0ad43b851 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModHidden.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModHidden : ModHidden + { + public override string Description => @"The notes fade out before you hit them!"; + public override double ScoreMultiplier => 1.06; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModNightcore.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModNightcore.cs new file mode 100644 index 0000000000..0504b7c5b6 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModNightcore.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModNightcore : ModNightcore + { + public override double ScoreMultiplier => 1.12; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModNoFail.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModNoFail.cs new file mode 100644 index 0000000000..3e10f58bbd --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModNoFail.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModNoFail : ModNoFail + { + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModPerfect.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModPerfect.cs new file mode 100644 index 0000000000..7388283d41 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModPerfect.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModPerfect : ModPerfect + { + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModRelax.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModRelax.cs new file mode 100644 index 0000000000..ec2385bfba --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModRelax.cs @@ -0,0 +1,12 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModRelax : ModRelax + { + public override string Description => @"Relax! You will no longer get dizzyfied by ninja-like spinners, demanding drumrolls or unexpected katu's."; + } +} diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModSuddenDeath.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModSuddenDeath.cs new file mode 100644 index 0000000000..129d181616 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModSuddenDeath.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Mods; + +namespace osu.Game.Rulesets.Taiko.Mods +{ + public class TaikoModSuddenDeath : ModSuddenDeath + { + } +} diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 1aed86f8f9..36ac9384cf 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -49,6 +49,18 @@ + + + + + + + + + + + + @@ -94,7 +106,7 @@ - + From 1be0569743fc3590aae307c3ddb91f6050c9ba9b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 14:34:52 +0900 Subject: [PATCH 223/628] Update licence headers --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 2 +- osu.Game/Graphics/Containers/ChatFlowContainer.cs | 2 +- osu.Game/Graphics/Sprites/OsuSpriteLink.cs | 2 +- osu.Game/Online/Chat/ChatLink.cs | 2 +- osu.Game/Online/Chat/MessageFormatter.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 9f8c3ce146..7984a67c36 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; diff --git a/osu.Game/Graphics/Containers/ChatFlowContainer.cs b/osu.Game/Graphics/Containers/ChatFlowContainer.cs index 6fd06aef7c..bf7d152a3b 100644 --- a/osu.Game/Graphics/Containers/ChatFlowContainer.cs +++ b/osu.Game/Graphics/Containers/ChatFlowContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs index 9fc24651db..f663f50624 100644 --- a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs +++ b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs index f38eade682..e51f7d0828 100644 --- a/osu.Game/Online/Chat/ChatLink.cs +++ b/osu.Game/Online/Chat/ChatLink.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index eadab8840f..1bfb9b394e 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; From 72624aea186103e000e46cf6235f73a0ad100f5e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 20:22:23 +0900 Subject: [PATCH 224/628] Use a better method of link compilation Adds word wrap back, simplifies a lot. --- osu.Game.Tests/Visual/TestCaseChatDisplay.cs | 19 +--- osu.Game.Tests/Visual/TestCaseChatLink.cs | 11 +-- .../Graphics/Containers/ChatFlowContainer.cs | 61 ------------- .../Graphics/Containers/LinkFlowContainer.cs | 75 ++++++++++++++++ .../Graphics/Containers/OsuHoverContainer.cs | 22 +++-- osu.Game/Graphics/Sprites/OsuSpriteLink.cs | 52 ----------- osu.Game/Online/Chat/ChatLink.cs | 89 ------------------- osu.Game/Online/Chat/DrawableLinkCompiler.cs | 43 +++++++++ osu.Game/Overlays/Chat/ChatLine.cs | 10 +-- osu.Game/Overlays/Profile/ProfileHeader.cs | 54 +++++------ osu.Game/osu.Game.csproj | 5 +- 11 files changed, 172 insertions(+), 269 deletions(-) delete mode 100644 osu.Game/Graphics/Containers/ChatFlowContainer.cs create mode 100644 osu.Game/Graphics/Containers/LinkFlowContainer.cs delete mode 100644 osu.Game/Graphics/Sprites/OsuSpriteLink.cs delete mode 100644 osu.Game/Online/Chat/ChatLink.cs create mode 100644 osu.Game/Online/Chat/DrawableLinkCompiler.cs diff --git a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs index 6df59350e7..048106da26 100644 --- a/osu.Game.Tests/Visual/TestCaseChatDisplay.cs +++ b/osu.Game.Tests/Visual/TestCaseChatDisplay.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; -using osu.Framework.Allocation; using osu.Framework.Graphics.Containers; using osu.Game.Overlays; @@ -11,28 +10,12 @@ namespace osu.Game.Tests.Visual [Description("Testing chat api and overlay")] public class TestCaseChatDisplay : OsuTestCase { - private readonly BeatmapSetOverlay beatmapSetOverlay; - private readonly ChatOverlay chat; - - private DependencyContainer dependencies; - - protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); - public TestCaseChatDisplay() { - Add(chat = new ChatOverlay + Add(new ChatOverlay { State = Visibility.Visible }); - - Add(beatmapSetOverlay = new BeatmapSetOverlay()); - } - - [BackgroundDependencyLoader] - private void load() - { - dependencies.Cache(chat); - dependencies.Cache(beatmapSetOverlay); } } } diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 7984a67c36..ef36242f1f 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -14,6 +14,7 @@ using osu.Game.Overlays.Chat; using osu.Game.Users; using System; using System.Linq; +using osu.Game.Graphics.Sprites; namespace osu.Game.Tests.Visual { @@ -57,7 +58,7 @@ namespace osu.Game.Tests.Visual AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic(newLine.ContentFlow)); AddAssert($"msg #{textContainer.Count} shows link(s)", isShowingLinks); - bool isItalic(ChatFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); + bool isItalic(LinkFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); bool isShowingLinks() { @@ -68,11 +69,11 @@ namespace osu.Game.Tests.Visual textColour = OsuColour.FromHex(newLine.Message.Sender.Colour); return newLine.ContentFlow - .Cast() - .All(sprite => sprite.HandleInput && !sprite.TextColour.Equals(textColour) - || !sprite.HandleInput && sprite.TextColour.Equals(textColour) + .Cast() + .All(sprite => sprite.HandleInput && !sprite.Colour.Equals(textColour) + || !sprite.HandleInput && sprite.Colour.Equals(textColour) // if someone with a background uses /me with a link, the usual link colour is overridden - || isAction && hasBackground && sprite.HandleInput && !sprite.TextColour.Equals((ColourInfo)Color4.White)); + || isAction && hasBackground && sprite.HandleInput && !sprite.Colour.Equals((ColourInfo)Color4.White)); } } diff --git a/osu.Game/Graphics/Containers/ChatFlowContainer.cs b/osu.Game/Graphics/Containers/ChatFlowContainer.cs deleted file mode 100644 index bf7d152a3b..0000000000 --- a/osu.Game/Graphics/Containers/ChatFlowContainer.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Graphics.Colour; -using osu.Game.Online.Chat; -using System; - -namespace osu.Game.Graphics.Containers -{ - public class ChatFlowContainer : OsuTextFlowContainer - { - private readonly Action defaultCreationParameters; - private ColourInfo urlColour; - - public ChatFlowContainer(Action defaultCreationParameters = null) - { - this.defaultCreationParameters = defaultCreationParameters; - } - - public override bool HandleInput => true; - - public void AddLink(string text, string url, LinkAction linkType, string linkArgument) - { - var chatSprite = new ChatLink - { - Text = text, - Url = url, - TextColour = urlColour, - LinkAction = linkType, - LinkArgument = linkArgument, - }; - - defaultCreationParameters?.Invoke(chatSprite); - - AddInternal(chatSprite); - } - - public void AddText(string text, Action creationParameters = null) - { - foreach (var word in SplitWords(text)) - { - if (string.IsNullOrEmpty(word)) - continue; - - var chatSprite = new ChatLink { Text = word }; - - defaultCreationParameters?.Invoke(chatSprite); - creationParameters?.Invoke(chatSprite); - - AddInternal(chatSprite); - } - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - urlColour = colours.Blue; - } - } -} diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs new file mode 100644 index 0000000000..4485630e12 --- /dev/null +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -0,0 +1,75 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Online.Chat; +using System; +using System.Diagnostics; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics.Sprites; +using osu.Game.Overlays; + +namespace osu.Game.Graphics.Containers +{ + public class LinkFlowContainer : OsuTextFlowContainer + { + public LinkFlowContainer(Action defaultCreationParameters = null) + : base(defaultCreationParameters) + { + } + + public override bool HandleInput => true; + + private BeatmapSetOverlay beatmapSetOverlay; + private ChatOverlay chat; + private OsuGame game; + + [BackgroundDependencyLoader(true)] + private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuGame game) + { + this.beatmapSetOverlay = beatmapSetOverlay; + this.chat = chat; + // this will be null in tests + this.game = game; + } + + public void AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) + { + AddInternal(new DrawableLinkCompiler(AddText(text).ToList()) + { + TooltipText = tooltipText ?? (url != text ? url : string.Empty), + Action = () => + { + switch (linkType) + { + case LinkAction.OpenBeatmap: + // todo: implement this when overlay.ShowBeatmap(id) exists + break; + case LinkAction.OpenBeatmapSet: + if (int.TryParse(linkArgument, out int setId)) + beatmapSetOverlay.ShowBeatmapSet(setId); + break; + case LinkAction.OpenChannel: + chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == linkArgument)); + break; + case LinkAction.OpenEditorTimestamp: + game?.LoadEditorTimestamp(); + break; + case LinkAction.JoinMultiplayerMatch: + if (int.TryParse(linkArgument, out int matchId)) + game?.JoinMultiplayerMatch(matchId); + break; + case LinkAction.Spectate: + // todo: implement this when spectating exists + break; + case LinkAction.External: + Process.Start(url); + break; + default: + throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action."); + } + } + }); + } + } +} diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index 502ac6592f..fd1742871b 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -1,8 +1,10 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using OpenTK.Graphics; using osu.Framework.Allocation; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Input; @@ -10,26 +12,34 @@ namespace osu.Game.Graphics.Containers { public class OsuHoverContainer : OsuClickableContainer { - private Color4 hoverColour; - private Color4 unhoverColour; + protected Color4 HoverColour; + + protected Color4 IdleColour = Color4.White; + + protected virtual IEnumerable EffectTargets => new[] { Content }; protected override bool OnHover(InputState state) { - this.FadeColour(hoverColour, 500, Easing.OutQuint); + EffectTargets.ForEach(d => d.FadeColour(HoverColour, 500, Easing.OutQuint)); return base.OnHover(state); } protected override void OnHoverLost(InputState state) { - this.FadeColour(unhoverColour, 500, Easing.OutQuint); + EffectTargets.ForEach(d => d.FadeColour(IdleColour, 500, Easing.OutQuint)); base.OnHoverLost(state); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - hoverColour = colours.Yellow; - unhoverColour = Colour; + HoverColour = colours.Yellow; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + EffectTargets.ForEach(d => d.FadeColour(IdleColour)); } } } diff --git a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs b/osu.Game/Graphics/Sprites/OsuSpriteLink.cs deleted file mode 100644 index f663f50624..0000000000 --- a/osu.Game/Graphics/Sprites/OsuSpriteLink.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; -using System.Collections.Generic; -using System.Diagnostics; -using osu.Framework.Graphics.Containers; -using osu.Game.Graphics.Containers; - -namespace osu.Game.Graphics.Sprites -{ - public class OsuSpriteLink : OsuSpriteText - { - public override bool HandleInput => !string.IsNullOrEmpty(Url); - - protected override IEnumerable FlowingChildren => Children; - - protected override Container Content => content; - - private readonly OsuHoverContainer content; - - public OsuSpriteLink() - { - AddInternal(content = new OsuHoverContainer - { - AutoSizeAxes = Axes.Both, - Action = OnLinkClicked, - }); - } - - private string url; - - public string Url - { - get => url; - set - { - if (!string.IsNullOrEmpty(value)) - url = value; - } - } - - public ColourInfo TextColour - { - get => Content.Colour; - set => Content.Colour = value; - } - - protected virtual void OnLinkClicked() => Process.Start(Url); - } -} diff --git a/osu.Game/Online/Chat/ChatLink.cs b/osu.Game/Online/Chat/ChatLink.cs deleted file mode 100644 index e51f7d0828..0000000000 --- a/osu.Game/Online/Chat/ChatLink.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Graphics.Cursor; -using osu.Game.Graphics.Sprites; -using osu.Game.Overlays; -using System; - -namespace osu.Game.Online.Chat -{ - public class ChatLink : OsuSpriteLink, IHasTooltip - { - private BeatmapSetOverlay beatmapSetOverlay; - private ChatOverlay chat; - private OsuGame game; - - /// - /// The type of action executed on clicking this link. - /// - public LinkAction LinkAction { get; set; } - - /// - /// The argument necessary for the action specified by to execute. - /// Usually a part of the URL. - /// - public string LinkArgument { get; set; } - - protected override void OnLinkClicked() - { - switch (LinkAction) - { - case LinkAction.OpenBeatmap: - // todo: implement this when overlay.ShowBeatmap(id) exists - break; - case LinkAction.OpenBeatmapSet: - if (int.TryParse(LinkArgument, out int setId)) - beatmapSetOverlay.ShowBeatmapSet(setId); - break; - case LinkAction.OpenChannel: - chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == LinkArgument)); - break; - case LinkAction.OpenEditorTimestamp: - game?.LoadEditorTimestamp(); - break; - case LinkAction.JoinMultiplayerMatch: - if (int.TryParse(LinkArgument, out int matchId)) - game?.JoinMultiplayerMatch(matchId); - break; - case LinkAction.Spectate: - // todo: implement this when spectating exists - break; - case LinkAction.External: - base.OnLinkClicked(); - break; - default: - throw new NotImplementedException($"This {nameof(Chat.LinkAction)} ({LinkAction.ToString()}) is missing an associated action."); - } - } - - public string TooltipText - { - get - { - if (Url == Text) - return null; - - switch (LinkAction) - { - case LinkAction.OpenChannel: - return "Switch to channel " + LinkArgument; - case LinkAction.OpenEditorTimestamp: - return "Go to " + LinkArgument; - default: - return Url; - } - } - } - - [BackgroundDependencyLoader(true)] - private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuGame game) - { - this.beatmapSetOverlay = beatmapSetOverlay; - this.chat = chat; - // this will be null in tests - this.game = game; - } - } -} diff --git a/osu.Game/Online/Chat/DrawableLinkCompiler.cs b/osu.Game/Online/Chat/DrawableLinkCompiler.cs new file mode 100644 index 0000000000..f1249031c1 --- /dev/null +++ b/osu.Game/Online/Chat/DrawableLinkCompiler.cs @@ -0,0 +1,43 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Cursor; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using OpenTK; + +namespace osu.Game.Online.Chat +{ + /// + /// An invisible drawable that brings multiple pieces together to form a consumable clickable link. + /// + public class DrawableLinkCompiler : OsuHoverContainer, IHasTooltip + { + /// + /// Each word part of a chat link (split for word-wrap support). + /// + public List Parts; + + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceiveMouseInputAt(screenSpacePos)); + + public DrawableLinkCompiler(IEnumerable parts) + { + Parts = parts.ToList(); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + IdleColour = colours.Blue; + } + + protected override IEnumerable EffectTargets => Parts; + + public string TooltipText { get; set; } + } +} diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index caab77609d..6f847d6f01 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -83,9 +83,9 @@ namespace osu.Game.Overlays.Chat private Message message; private OsuSpriteText username; - private ChatFlowContainer contentFlow; + private LinkFlowContainer contentFlow; - public ChatFlowContainer ContentFlow => contentFlow; + public LinkFlowContainer ContentFlow => contentFlow; public Message Message { @@ -191,14 +191,14 @@ namespace osu.Game.Overlays.Chat Padding = new MarginPadding { Left = message_padding + padding }, Children = new Drawable[] { - contentFlow = new ChatFlowContainer(t => + contentFlow = new LinkFlowContainer(t => { if (Message.IsAction) { t.Font = @"Exo2.0-MediumItalic"; if (senderHasBackground) - t.TextColour = OsuColour.FromHex(message.Sender.Colour); + t.Colour = OsuColour.FromHex(message.Sender.Colour); } t.TextSize = text_size; @@ -252,7 +252,7 @@ namespace osu.Game.Overlays.Chat } } - contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url, link.Action, link.Argument); + contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url); } var lastLink = message.Links[message.Links.Count - 1]; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 35f5e2cd73..25dd56ffdf 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Diagnostics; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -9,6 +10,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; @@ -16,7 +18,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Users; -using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Profile { @@ -435,6 +436,28 @@ namespace osu.Game.Overlays.Profile infoTextRight.NewLine(); } + private class ProfileLink : OsuHoverContainer, IHasTooltip + { + public string TooltipText => "View Profile in Browser"; + + public override bool HandleInput => true; + + public ProfileLink(User user) + { + Action = () => Process.Start($@"https://osu.ppy.sh/users/{user.Id}"); + + AutoSizeAxes = Axes.Both; + + Child = new OsuSpriteText + { + Text = user.Username, + Font = @"Exo2.0-RegularItalic", + TextSize = 30, + }; + } + } + + private class GradeBadge : Container { private const float width = 50; @@ -472,34 +495,5 @@ namespace osu.Game.Overlays.Profile badge.Texture = textures.Get($"Grades/{grade}"); } } - - private class LinkFlowContainer : OsuTextFlowContainer - { - public override bool HandleInput => true; - - public LinkFlowContainer(Action defaultCreationParameters = null) - : base(defaultCreationParameters) - { - } - - protected override SpriteText CreateSpriteText() => new OsuSpriteLink(); - - public void AddLink(string text, string url) => AddText(text, sprite => ((OsuSpriteLink)sprite).Url = url); - } - - private class ProfileLink : OsuSpriteLink, IHasTooltip - { - public string TooltipText => "View Profile in Browser"; - - public override bool HandleInput => true; - - public ProfileLink(User user) - { - Text = user.Username; - Url = $@"https://osu.ppy.sh/users/{user.Id}"; - Font = @"Exo2.0-RegularItalic"; - TextSize = 30; - } - } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2e97545c72..d7096a5691 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -267,12 +267,11 @@ - + - @@ -295,7 +294,7 @@ - + From 2518d16a77f97f7ecb5fbcc4e0932b1212ab613a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 21:34:25 +0900 Subject: [PATCH 225/628] Denote unused variable --- osu.Game/Screens/Play/Player.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 87a7c7dd59..f700bf1a03 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -318,9 +318,9 @@ namespace osu.Game.Screens.Play if (!loadedSuccessfully) return; - dimLevel.ValueChanged += value => updateBackgroundElements(); - blurLevel.ValueChanged += value => updateBackgroundElements(); - showStoryboard.ValueChanged += value => updateBackgroundElements(); + dimLevel.ValueChanged += _ => updateBackgroundElements(); + blurLevel.ValueChanged += _ => updateBackgroundElements(); + showStoryboard.ValueChanged += _ => updateBackgroundElements(); updateBackgroundElements(); Content.Alpha = 0; From fcb197f7b6230c26af195c4e1da5347618d81250 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 22:21:15 +0900 Subject: [PATCH 226/628] Simplify logic --- .../Backgrounds/BackgroundScreenBeatmap.cs | 13 ++++--------- osu.Game/Screens/Play/Player.cs | 15 +++++++++------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index dd76ac5421..1ce84289b2 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Transforms; using OpenTK; using osu.Game.Beatmaps; using osu.Game.Graphics.Backgrounds; @@ -19,10 +20,7 @@ namespace osu.Game.Screens.Backgrounds public WorkingBeatmap Beatmap { - get - { - return beatmap; - } + get { return beatmap; } set { if (beatmap == value && beatmap != null) @@ -56,11 +54,8 @@ namespace osu.Game.Screens.Backgrounds Beatmap = beatmap; } - public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) - { - background?.BlurTo(sigma, duration, easing); - blurTarget = sigma; - } + public TransformSequence BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) + => background?.BlurTo(blurTarget = sigma, duration, easing); public override bool Equals(BackgroundScreen other) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f700bf1a03..79ae8fca30 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,10 +24,10 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Framework.Audio.Sample; using osu.Game.Beatmaps; +using osu.Game.Graphics; using osu.Game.Online.API; using osu.Game.Screens.Play.BreaksOverlay; using osu.Game.Storyboards.Drawables; -using OpenTK.Graphics; namespace osu.Game.Screens.Play { @@ -378,8 +378,9 @@ namespace osu.Game.Screens.Play private void updateBackgroundElements() { + const float duration = 800; + var opacity = 1 - (float)dimLevel; - var blur = new Vector2((float)blurLevel.Value * 25); if (showStoryboard && storyboard == null) initializeStoryboard(true); @@ -387,11 +388,13 @@ namespace osu.Game.Screens.Play var beatmap = Beatmap.Value; var storyboardVisible = showStoryboard && beatmap.Storyboard.HasDrawable; - storyboardContainer.FadeColour(new Color4(opacity, opacity, opacity, 1), 800); - storyboardContainer.FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, 800, Easing.OutQuint); + storyboardContainer + .FadeColour(OsuColour.Gray(opacity), duration, Easing.OutQuint) + .FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, duration, Easing.OutQuint); - Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, 800, Easing.OutQuint); - (Background as BackgroundScreenBeatmap)?.BlurTo(blur, 800, Easing.OutQuint); + (Background as BackgroundScreenBeatmap)? + .BlurTo(new Vector2((float)blurLevel.Value * 25), duration, Easing.OutQuint)? + .FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, duration, Easing.OutQuint); } private void fadeOut() From c4490b5fe812b819dae0f218091c03e27caefd84 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 9 Jan 2018 22:24:12 +0900 Subject: [PATCH 227/628] Fix incorrect licence header --- osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs index 50cb1b150c..d406231cc9 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseFruitObjects.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; From 3bf9901dd20d324ccd5398207b940765e7f8c85c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Tue, 9 Jan 2018 16:11:45 +0100 Subject: [PATCH 228/628] Fixed bugs and added tests --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 90 +++++++++---------- .../Graphics/Containers/LinkFlowContainer.cs | 35 ++++++-- osu.Game/Online/Chat/Message.cs | 9 ++ osu.Game/Online/Chat/MessageFormatter.cs | 6 +- osu.Game/OsuGame.cs | 9 +- osu.Game/Overlays/Chat/ChatLine.cs | 45 +++------- 6 files changed, 96 insertions(+), 98 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index ef36242f1f..722e3c30f3 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -4,12 +4,9 @@ using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using osu.Game.Online.Chat; -using osu.Game.Overlays; using osu.Game.Overlays.Chat; using osu.Game.Users; using System; @@ -20,20 +17,11 @@ namespace osu.Game.Tests.Visual { public class TestCaseChatLink : OsuTestCase { - private readonly BeatmapSetOverlay beatmapSetOverlay; - private readonly ChatOverlay chat; - - private DependencyContainer dependencies; - private readonly TestChatLineContainer textContainer; - - protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); + private Color4 linkColour; public TestCaseChatLink() { - chat = new ChatOverlay(); - Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MinValue }); - Add(textContainer = new TestChatLineContainer { Padding = new MarginPadding { Left = 20, Right = 20 }, @@ -43,37 +31,50 @@ namespace osu.Game.Tests.Visual }); testLinksGeneral(); - testAddingLinks(); testEcho(); } private void clear() => AddStep("clear messages", textContainer.Clear); - private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false, bool isImportant = false) + private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false, bool isImportant = false, params LinkAction[] expectedActions) { var newLine = new ChatLine(new DummyMessage(text, isAction, isImportant)); textContainer.Add(newLine); AddAssert($"msg #{textContainer.Count} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); - AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic(newLine.ContentFlow)); - AddAssert($"msg #{textContainer.Count} shows link(s)", isShowingLinks); + AddAssert($"msg #{textContainer.Count} has the right action", hasExpectedActions); + AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic()); + AddAssert($"msg #{textContainer.Count} shows {linkAmount} link(s)", isShowingLinks); - bool isItalic(LinkFlowContainer c) => c.Cast().All(sprite => sprite.Font == @"Exo2.0-MediumItalic"); + bool hasExpectedActions() + { + var expectedActionsList = expectedActions.ToList(); + + if (expectedActionsList.Count != newLine.Message.Links.Count) + return false; + + for (int i = 0; i < newLine.Message.Links.Count; i++) + { + var action = newLine.Message.Links[i].Action; + if (action != expectedActions[i]) return false; + } + + return true; + } + + bool isItalic() => newLine.ContentFlow.Where(d => d is OsuSpriteText).Cast().All(sprite => sprite.Font == "Exo2.0-MediumItalic"); bool isShowingLinks() { - SRGBColour textColour = Color4.White; bool hasBackground = !string.IsNullOrEmpty(newLine.Message.Sender.Colour); - if (isAction && hasBackground) - textColour = OsuColour.FromHex(newLine.Message.Sender.Colour); + Color4 textColour = isAction && hasBackground ? OsuColour.FromHex(newLine.Message.Sender.Colour) : Color4.White; - return newLine.ContentFlow - .Cast() - .All(sprite => sprite.HandleInput && !sprite.Colour.Equals(textColour) - || !sprite.HandleInput && sprite.Colour.Equals(textColour) - // if someone with a background uses /me with a link, the usual link colour is overridden - || isAction && hasBackground && sprite.HandleInput && !sprite.Colour.Equals((ColourInfo)Color4.White)); + var linkCompilers = newLine.ContentFlow.Where(d => d is DrawableLinkCompiler).ToList(); + var linkSprites = linkCompilers.SelectMany(comp => ((DrawableLinkCompiler)comp).Parts); + + return linkSprites.All(d => d.Colour == linkColour) + && newLine.ContentFlow.Except(linkSprites.Concat(linkCompilers)).All(d => d.Colour == textColour); } } @@ -81,30 +82,20 @@ namespace osu.Game.Tests.Visual { addMessageWithChecks("test!"); addMessageWithChecks("osu.ppy.sh!"); - addMessageWithChecks("https://osu.ppy.sh!", 1); - addMessageWithChecks("00:12:345 (1,2) - Test?", 1); - addMessageWithChecks("Wiki link for tasty [[Performance Points]]", 1); - addMessageWithChecks("(osu forums)[https://osu.ppy.sh/forum] (old link format)", 1); - addMessageWithChecks("[https://osu.ppy.sh/home New site] (new link format)", 1); - addMessageWithChecks("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", 1); - addMessageWithChecks("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", 1, true); - addMessageWithChecks("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", 1, true); - addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/home multiple links] https://osu.ppy.sh/home", 3); + addMessageWithChecks("https://osu.ppy.sh!", 1, expectedActions: LinkAction.External); + addMessageWithChecks("00:12:345 (1,2) - Test?", 1, expectedActions: LinkAction.OpenEditorTimestamp); + addMessageWithChecks("Wiki link for tasty [[Performance Points]]", 1, expectedActions: LinkAction.External); + addMessageWithChecks("(osu forums)[https://osu.ppy.sh/forum] (old link format)", 1, expectedActions: LinkAction.External); + addMessageWithChecks("[https://osu.ppy.sh/home New site] (new link format)", 1, expectedActions: LinkAction.External); + addMessageWithChecks("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", 1, expectedActions: LinkAction.External); + addMessageWithChecks("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmapSet); + addMessageWithChecks("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmap); + addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/b/252238 multiple links] https://osu.ppy.sh/home", 3, expectedActions: new[] { LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External }); // note that there's 0 links here (they get removed if a channel is not found) addMessageWithChecks("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); addMessageWithChecks("I am important!", 0, false, true); addMessageWithChecks("feels important", 0, true, true); - addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true); - } - - private void testAddingLinks() - { - const int count = 5; - - for (int i = 1; i <= count; i++) - AddStep($"add long msg #{i}", () => textContainer.Add(new ChatLine(new DummyMessage("alright let's just put a really long text here to see if it loads in correctly rather than adding the text sprites individually after the chat line appearing!")))); - - clear(); + addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true, expectedActions: LinkAction.External); } private void testEcho() @@ -131,10 +122,9 @@ namespace osu.Game.Tests.Visual } [BackgroundDependencyLoader] - private void load() + private void load(OsuColour colours) { - dependencies.Cache(chat); - dependencies.Cache(beatmapSetOverlay); + linkColour = colours.Blue; } private class DummyEchoMessage : LocalEchoMessage diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 4485630e12..c091e2b5c9 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -7,7 +7,7 @@ using System.Diagnostics; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; -using osu.Game.Overlays; +using System.Collections.Generic; namespace osu.Game.Graphics.Containers { @@ -20,19 +20,36 @@ namespace osu.Game.Graphics.Containers public override bool HandleInput => true; - private BeatmapSetOverlay beatmapSetOverlay; - private ChatOverlay chat; private OsuGame game; [BackgroundDependencyLoader(true)] - private void load(BeatmapSetOverlay beatmapSetOverlay, ChatOverlay chat, OsuGame game) + private void load(OsuGame game) { - this.beatmapSetOverlay = beatmapSetOverlay; - this.chat = chat; - // this will be null in tests + // will be null in tests this.game = game; } + public void AddLinks(string text, List links) + { + if (string.IsNullOrEmpty(text) || links == null) + return; + + if (links.Count == 0) + { + AddText(text); + return; + } + + int previousLinkEnd = 0; + foreach (var link in links) + { + AddText(text.Substring(previousLinkEnd, link.Index - previousLinkEnd)); + + AddLink(text.Substring(link.Index, link.Length), link.Url, link.Action, link.Argument); + previousLinkEnd = link.Index + link.Length; + } + } + public void AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) { AddInternal(new DrawableLinkCompiler(AddText(text).ToList()) @@ -47,10 +64,10 @@ namespace osu.Game.Graphics.Containers break; case LinkAction.OpenBeatmapSet: if (int.TryParse(linkArgument, out int setId)) - beatmapSetOverlay.ShowBeatmapSet(setId); + game?.ShowBeatmapSet(setId); break; case LinkAction.OpenChannel: - chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == linkArgument)); + game?.OpenChannel(linkArgument); break; case LinkAction.OpenEditorTimestamp: game?.LoadEditorTimestamp(); diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index aa1020c2de..374a6e3159 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -41,6 +41,15 @@ namespace osu.Game.Online.Chat { } + /// + /// The text that is displayed in chat. + /// + public string DisplayContent { get; set; } + + /// + /// The links found in this message. + /// + /// The links' positions are according to public List Links; public Message(long? id) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 1bfb9b394e..3a396a04c0 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -66,7 +66,7 @@ namespace osu.Game.Online.Chat //since we just changed the line display text, offset any already processed links. result.Links.ForEach(l => l.Index -= l.Index > index ? m.Length - displayText.Length : 0); - var details = getLinkDetails(link); + var details = getLinkDetails(linkText); result.Links.Add(new Link(linkText, index, displayText.Length, linkActionOverride ?? details.linkType, details.linkArgument)); //adjust the offset for processing the current matches group. @@ -119,7 +119,7 @@ namespace osu.Game.Online.Chat case "s": case "beatmapsets": case "d": - return (LinkAction.External, args[3]); + return (LinkAction.OpenBeatmapSet, args[3]); } } @@ -196,7 +196,7 @@ namespace osu.Game.Online.Chat { var result = format(inputMessage.Content); - inputMessage.Content = result.Text; + inputMessage.DisplayContent = result.Text; // Sometimes, regex matches are not in order result.Links.Sort(); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 847d93e12e..2cf8417d7f 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -119,7 +119,12 @@ namespace osu.Game private ScheduledDelegate scoreLoad; - // TODO: Implement this properly as soon as the Editor is done + #region chat link actions + + internal void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName)); + + internal void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); + internal void LoadEditorTimestamp() { notifications.Post(new SimpleNotification @@ -147,6 +152,8 @@ namespace osu.Game }); } + #endregion + protected void LoadScore(Score s) { scoreLoad?.Cancel(); diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 6f847d6f01..2382a315f5 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -225,42 +225,17 @@ namespace osu.Game.Overlays.Chat timestamp.Text = $@"{message.Timestamp.LocalDateTime:HH:mm:ss}"; username.Text = $@"{message.Sender.Username}" + (senderHasBackground || message.IsAction ? "" : ":"); + // remove any non-existent channels from the link list + var linksToRemove = new List(); + foreach (var link in message.Links) + if (link.Action == LinkAction.OpenChannel && chat?.AvailableChannels.TrueForAll(c => c.Name != link.Argument) != false) + linksToRemove.Add(link); + + foreach (var link in linksToRemove) + message.Links.Remove(link); + contentFlow.Clear(); - - if (message.Links == null || message.Links.Count == 0) - contentFlow.AddText(message.Content); - else - { - int lastLinkEndIndex = 0; - List linksToRemove = new List(); - - foreach (var link in message.Links) - { - contentFlow.AddText(message.Content.Substring(lastLinkEndIndex, link.Index - lastLinkEndIndex)); - lastLinkEndIndex = link.Index + link.Length; - - const string channel_link_prefix = "osu://chan/"; - // If a channel doesn't exist, add it as normal text instead - if (link.Url.StartsWith(channel_link_prefix)) - { - var channelName = link.Url.Substring(channel_link_prefix.Length).Split('/')[0]; - if (chat?.AvailableChannels.TrueForAll(c => c.Name != channelName) != false) - { - linksToRemove.Add(link); - contentFlow.AddText(message.Content.Substring(link.Index, link.Length)); - continue; - } - } - - contentFlow.AddLink(message.Content.Substring(link.Index, link.Length), link.Url); - } - - var lastLink = message.Links[message.Links.Count - 1]; - contentFlow.AddText(message.Content.Substring(lastLink.Index + lastLink.Length)); - - foreach (var link in linksToRemove) - message.Links.Remove(link); - } + contentFlow.AddLinks(message.DisplayContent, message.Links); } private class MessageSender : OsuClickableContainer, IHasContextMenu From 44d821172ab2d60069e95c9986d94eda5f7b1e07 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 9 Jan 2018 16:29:12 +0100 Subject: [PATCH 229/628] tidying up --- osu.Game/Overlays/Social/FilterControl.cs | 1 - osu.Game/Overlays/Social/Header.cs | 13 +++-- osu.Game/Overlays/SocialOverlay.cs | 59 ++++++++++------------- 3 files changed, 31 insertions(+), 42 deletions(-) diff --git a/osu.Game/Overlays/Social/FilterControl.cs b/osu.Game/Overlays/Social/FilterControl.cs index c05c3eb530..382b3fd0e7 100644 --- a/osu.Game/Overlays/Social/FilterControl.cs +++ b/osu.Game/Overlays/Social/FilterControl.cs @@ -21,7 +21,6 @@ namespace osu.Game.Overlays.Social public enum SocialSortCriteria { - Relevance, Rank, Name, Location, diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index 5d243ad36f..0767e0aec0 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Social protected override Color4 BackgroundColour => OsuColour.FromHex(@"38202e"); protected override float TabStripWidth => 438; - protected override SocialTab DefaultTab => SocialTab.OnlinePlayers; + protected override SocialTab DefaultTab => SocialTab.AllPlayers; protected override FontAwesome Icon => FontAwesome.fa_users; protected override Drawable CreateHeaderText() @@ -54,13 +54,12 @@ namespace osu.Game.Overlays.Social public enum SocialTab { - Search, - [Description("Players")] - OnlinePlayers = SocialSortCriteria.Rank, + [Description("All Players")] + AllPlayers = SocialSortCriteria.Rank, [Description("Friends")] - OnlineFriends = SocialSortCriteria.Name, - //[Description("Online Team Members")] - //OnlineTeamMembers, + Friends = SocialSortCriteria.Name, + //[Description("Team Members")] + //TeamMembers, //[Description("Chat Channels")] //ChatChannels, } diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 95e588942c..6fffd37456 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -55,37 +55,35 @@ namespace osu.Game.Overlays Filter.Search.Current.ValueChanged += text => { - if (text != string.Empty) + if (!string.IsNullOrEmpty(text)) { - Header.Tabs.Current.Value = SocialTab.Search; + // force searching in players until searching for friends is supported + Header.Tabs.Current.Value = SocialTab.AllPlayers; - if (Filter.Tabs.Current.Value == SocialSortCriteria.Rank) - Filter.Tabs.Current.Value = SocialSortCriteria.Relevance; - } - else - { - Header.Tabs.Current.Value = SocialTab.OnlinePlayers; - - if (Filter.Tabs.Current.Value == SocialSortCriteria.Relevance) + if (Filter.Tabs.Current.Value != SocialSortCriteria.Rank) Filter.Tabs.Current.Value = SocialSortCriteria.Rank; } }; - Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels; - - // TODO sort our list in some way (either locally or with API call) - //Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch); - Header.Tabs.Current.ValueChanged += tab => { - if (tab != SocialTab.Search) - { - //currentQuery.Value = string.Empty; - Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; - Scheduler.AddOnce(updateSearch); - } + //currentQuery.Value = string.Empty; + Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; + Scheduler.AddOnce(updateSearch); }; + Filter.Tabs.Current.ValueChanged += sortCriteria => + { + // force searching in players until searching for friends is supported + if (Header.Tabs.Current.Value != SocialTab.AllPlayers && sortCriteria != (SocialSortCriteria)Header.Tabs.Current.Value) + Header.Tabs.Current.Value = SocialTab.AllPlayers; + + Scheduler.AddOnce(updateSearch); + }; + + Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels; + Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch); + //currentQuery.ValueChanged += v => //{ // queryChangedDebounce?.Cancel(); @@ -97,14 +95,6 @@ namespace osu.Game.Overlays //}; //currentQuery.BindTo(Filter.Search.Current); - - Filter.Tabs.Current.ValueChanged += sortCriteria => - { - if (Header.Tabs.Current.Value != SocialTab.Search && sortCriteria != (SocialSortCriteria)Header.Tabs.Current.Value) - Header.Tabs.Current.Value = SocialTab.Search; - - Scheduler.AddOnce(updateSearch); - }; } [BackgroundDependencyLoader] @@ -148,11 +138,12 @@ namespace osu.Game.Overlays }) }; - LoadComponentAsync(newPanels, p => + LoadComponentAsync(newPanels, f => { if(panels != null) ScrollFlow.Remove(panels); + // delay new panels so they don't get added before the old ones are gone Scheduler.AddDelayed(() => ScrollFlow.Add(panels = newPanels), 200); }); } @@ -190,13 +181,13 @@ namespace osu.Game.Overlays switch (Header.Tabs.Current.Value) { - case SocialTab.OnlineFriends: - var friendRequest = new GetFriendsRequest(); + case SocialTab.Friends: + var friendRequest = new GetFriendsRequest(); // TODO filter arguments? friendRequest.Success += updateUsers; api.Queue(getUsersRequest = friendRequest); break; default: - var userRequest = new GetUsersRequest(); // TODO filter??? + var userRequest = new GetUsersRequest(); // TODO filter arguments! userRequest.Success += response => updateUsers(response.Select(r => r.User)); api.Queue(getUsersRequest = userRequest); break; @@ -223,7 +214,7 @@ namespace osu.Game.Overlays break; default: Users = null; - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); + clearPanels(); break; } } From 4ce125478a533646cb5c48c4652cae99abd729c6 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 9 Jan 2018 19:03:23 +0100 Subject: [PATCH 230/628] remove unnecessary Schedules one was bugging out when rapidly switching display styles and the other was... unnecessary --- osu.Game/Overlays/SocialOverlay.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 6fffd37456..8d91ae0c18 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -143,8 +143,7 @@ namespace osu.Game.Overlays if(panels != null) ScrollFlow.Remove(panels); - // delay new panels so they don't get added before the old ones are gone - Scheduler.AddDelayed(() => ScrollFlow.Add(panels = newPanels), 200); + ScrollFlow.Add(panels = newPanels); }); } @@ -197,12 +196,9 @@ namespace osu.Game.Overlays private void updateUsers(IEnumerable newUsers) { - Schedule(() => - { - Users = newUsers; - loading.Hide(); - recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); - }); + Users = newUsers; + loading.Hide(); + recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); } public void APIStateChanged(APIAccess api, APIState state) From c48c7b085c15a0da03acef175c34985eafc43887 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Wed, 10 Jan 2018 02:24:51 +0300 Subject: [PATCH 231/628] Visual settings initial commit --- .../Screens/Play/HUD/ReplaySettingsOverlay.cs | 4 +- osu.Game/Screens/Play/HUD/VisualSettings.cs | 59 +++++++++++++++++++ osu.Game/Screens/Play/HUDOverlay.cs | 3 +- osu.Game/Screens/Play/Player.cs | 3 +- .../Play/ReplaySettings/ReplayGroup.cs | 12 ++-- osu.Game/osu.Game.csproj | 1 + 6 files changed, 73 insertions(+), 9 deletions(-) create mode 100644 osu.Game/Screens/Play/HUD/VisualSettings.cs diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs index cb30222831..8fda843bdc 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs @@ -17,6 +17,7 @@ namespace osu.Game.Screens.Play.HUD public bool ReplayLoaded; public readonly PlaybackSettings PlaybackSettings; + public readonly VisualSettings VisualSettings; //public readonly CollectionSettings CollectionSettings; //public readonly DiscussionSettings DiscussionSettings; @@ -33,11 +34,12 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new[] + Children = new ReplayGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), PlaybackSettings = new PlaybackSettings(), + VisualSettings = new VisualSettings() } }; diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs new file mode 100644 index 0000000000..e9aabefc5d --- /dev/null +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Timing; +using osu.Game.Configuration; +using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Play.ReplaySettings; + +namespace osu.Game.Screens.Play.HUD +{ + public class VisualSettings : ReplayGroup + { + protected override string Title => "Visual settings"; + public IAdjustableClock AdjustableClock { get; set; } + + private readonly ReplaySliderBar dimSliderBar; + private readonly ReplayCheckbox showStoryboardToggle; + private readonly ReplayCheckbox mouseWheelDisabledToggle; + + public VisualSettings() + { + Children = new Drawable[] + { + new OsuSpriteText + { + Text = "Background dim:" + }, + dimSliderBar = new ReplaySliderBar(), + new OsuSpriteText + { + Text = "Toggles:" + }, + showStoryboardToggle = new ReplayCheckbox {LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + }; + ToggleContentVisibility(); + } + + [BackgroundDependencyLoader] + private void load(OsuConfigManager config) + { + dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); + showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); + mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); + } + + protected override void ToggleContentVisibility() + { + base.ToggleContentVisibility(); + if (Expanded) + AdjustableClock?.Stop(); + else + AdjustableClock?.Start(); + } + } +} diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 721b5344ff..6593391da4 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -102,7 +102,8 @@ namespace osu.Game.Screens.Play // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) { - ReplaySettingsOverlay.Hide(); + ReplaySettingsOverlay.PlaybackSettings.Hide(); + ReplaySettingsOverlay.Delay(5000).FadeOut(200); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 87171ab561..0245491431 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,7 +228,8 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = + hudOverlay.ReplaySettingsOverlay.VisualSettings.AdjustableClock = adjustableSourceClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs index bf22250e12..3bd2928528 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.ReplaySettings private readonly FillFlowContainer content; private readonly IconButton button; - private bool expanded = true; + protected bool Expanded = true; private Color4 buttonActiveColour; @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.ReplaySettings Position = new Vector2(-15, 0), Icon = FontAwesome.fa_bars, Scale = new Vector2(0.75f), - Action = toggleContentVisibility, + Action = ToggleContentVisibility, }, } }, @@ -112,13 +112,13 @@ namespace osu.Game.Screens.Play.ReplaySettings protected override Container Content => content; - private void toggleContentVisibility() + protected virtual void ToggleContentVisibility() { content.ClearTransforms(); - expanded = !expanded; + Expanded = !Expanded; - if (expanded) + if (Expanded) content.AutoSizeAxes = Axes.Y; else { @@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play.ReplaySettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); + button.FadeColour(Expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); } } } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f87f664199..693205b66d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,6 +315,7 @@ + From 9ec8f130a694c785878cf5b17716f94e73c06a97 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 13:24:26 +0900 Subject: [PATCH 232/628] Ensure changes are only applied when we are the current screen --- osu.Game/Screens/Play/Player.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 79ae8fca30..c24b5e0d2a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -378,6 +378,8 @@ namespace osu.Game.Screens.Play private void updateBackgroundElements() { + if (!IsCurrentScreen) return; + const float duration = 800; var opacity = 1 - (float)dimLevel; From 17e7f75aca98dc5dc826b35bd29202c9bba841dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 15:41:13 +0900 Subject: [PATCH 233/628] More osu!-side bindable fixes --- osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs | 2 +- osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs | 2 +- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 4 ++-- osu.Game/Overlays/Settings/SettingsSlider.cs | 4 ++-- osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs index ce32dbe889..8a64f7c9a4 100644 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs @@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual } private class TestSliderBar : OsuSliderBar - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible { public TestSliderBar() { diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs index c4b3a63bf2..af2b9be351 100644 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs +++ b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs @@ -152,7 +152,7 @@ namespace osu.Game.Tests.Visual } private class TestSliderBar : OsuSliderBar - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible { public TestSliderBar() { diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index e3d9a89bf7..d42efe6678 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -18,7 +18,7 @@ using osu.Framework.Graphics.Shapes; namespace osu.Game.Graphics.UserInterface { public class OsuSliderBar : SliderBar, IHasTooltip, IHasAccentColour - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible { private SampleChannel sample; private double lastSampleTime; @@ -69,7 +69,7 @@ namespace osu.Game.Graphics.UserInterface if (bindableInt != null) return bindableInt.Value.ToString("N0"); - return Current.Value.ToString(); + return Current.Value.ToString(CultureInfo.InvariantCulture); } } diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 43f1fa6a02..56aa77a24f 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -10,12 +10,12 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { public class SettingsSlider : SettingsSlider> - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible { } public class SettingsSlider : SettingsItem - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible where U : OsuSliderBar, new() { protected override Drawable CreateControl() => new U diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs index e6e909183d..724f28dadf 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs @@ -11,7 +11,7 @@ using osu.Game.Overlays.Settings; namespace osu.Game.Screens.Play.ReplaySettings { public class ReplaySliderBar : SettingsSlider - where T : struct, IEquatable + where T : struct, IEquatable, IComparable, IConvertible { protected override Drawable CreateControl() => new Sliderbar { From 58626e3b304ab8de44fbd5cef86d8fc145e6a573 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 16:58:10 +0900 Subject: [PATCH 234/628] Allow rulesets to create their own instantiation info --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../Tests/TestCaseCatchPlayer.cs | 2 +- .../Tests/TestCaseCatchStacker.cs | 2 +- .../Tests/TestCaseHyperdash.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- .../Tests/TestCasePerformancePoints.cs | 2 +- osu.Game.Tests/Visual/TestCaseGamefield.cs | 8 ++-- osu.Game/Beatmaps/DummyWorkingBeatmap.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 16 +++++++- osu.Game/Rulesets/RulesetStore.cs | 27 +++----------- osu.Game/Tests/Visual/TestCasePlayer.cs | 37 ++++++++++--------- 16 files changed, 54 insertions(+), 58 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 35410a7a77..37525470c2 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.Catch public override int LegacyID => 2; - public CatchRuleset(RulesetInfo rulesetInfo) + public CatchRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs index cadf5b36b0..dbd5e5b36c 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchPlayer.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Catch.Tests [Ignore("getting CI working")] public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer { - public TestCaseCatchPlayer() : base(typeof(CatchRuleset)) + public TestCaseCatchPlayer() : base(new CatchRuleset()) { } } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs index fca07408b3..b9fa38f74e 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseCatchStacker.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCaseCatchStacker : Game.Tests.Visual.TestCasePlayer { public TestCaseCatchStacker() - : base(typeof(CatchRuleset)) + : base(new CatchRuleset()) { } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs index fd8309c2dc..59659b3d0d 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseHyperdash.cs @@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCaseHyperdash : Game.Tests.Visual.TestCasePlayer { public TestCaseHyperdash() - : base(typeof(CatchRuleset)) + : base(new CatchRuleset()) { } diff --git a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs index 0c66d8d80a..725eb5cf76 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCasePerformancePoints.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Catch.Tests public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() - : base(new CatchRuleset(new RulesetInfo())) + : base(new CatchRuleset()) { } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 95708e4d11..b553879ef3 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -113,7 +113,7 @@ namespace osu.Game.Rulesets.Mania public override int LegacyID => 3; - public ManiaRuleset(RulesetInfo rulesetInfo) + public ManiaRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { } diff --git a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs index f611ae6f43..c76816db6a 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCasePerformancePoints.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Mania.Tests public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() - : base(new ManiaRuleset(new RulesetInfo())) + : base(new ManiaRuleset()) { } } diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 1ba32f474d..b38f95694f 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -145,7 +145,7 @@ namespace osu.Game.Rulesets.Osu public override int LegacyID => 0; - public OsuRuleset(RulesetInfo rulesetInfo) + public OsuRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { } diff --git a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs index 4b3277a4e2..500347c874 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCasePerformancePoints.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Osu.Tests public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() - : base(new OsuRuleset(new RulesetInfo())) + : base(new OsuRuleset()) { } } diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 940fdf4fc9..50cc80db50 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Taiko public override int LegacyID => 1; - public TaikoRuleset(RulesetInfo rulesetInfo) + public TaikoRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { } diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs index 639483b196..3d2d97b6d3 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCasePerformancePoints.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Taiko.Tests public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints { public TestCasePerformancePoints() - : base(new TaikoRuleset(new RulesetInfo())) + : base(new TaikoRuleset()) { } } diff --git a/osu.Game.Tests/Visual/TestCaseGamefield.cs b/osu.Game.Tests/Visual/TestCaseGamefield.cs index 0eebd29ffe..44f46dea18 100644 --- a/osu.Game.Tests/Visual/TestCaseGamefield.cs +++ b/osu.Game.Tests/Visual/TestCaseGamefield.cs @@ -56,25 +56,25 @@ namespace osu.Game.Tests.Visual Clock = new FramedClock(), Children = new Drawable[] { - new OsuRulesetContainer(new OsuRuleset(new RulesetInfo()), beatmap, false) + new OsuRulesetContainer(new OsuRuleset(), beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.TopLeft, Origin = Anchor.TopLeft }, - new TaikoRulesetContainer(new TaikoRuleset(new RulesetInfo()),beatmap, false) + new TaikoRulesetContainer(new TaikoRuleset(),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.TopRight, Origin = Anchor.TopRight }, - new CatchRulesetContainer(new CatchRuleset(new RulesetInfo()),beatmap, false) + new CatchRulesetContainer(new CatchRuleset(),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, - new ManiaRulesetContainer(new ManiaRuleset(new RulesetInfo()),beatmap, false) + new ManiaRulesetContainer(new ManiaRuleset(),beatmap, false) { Scale = new Vector2(0.5f), Anchor = Anchor.BottomRight, diff --git a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs index 0ae6637167..f4a3dacd53 100644 --- a/osu.Game/Beatmaps/DummyWorkingBeatmap.cs +++ b/osu.Game/Beatmaps/DummyWorkingBeatmap.cs @@ -64,7 +64,7 @@ namespace osu.Game.Beatmaps public override string ShortName => "dummy"; - public DummyRuleset(RulesetInfo rulesetInfo) + public DummyRuleset(RulesetInfo rulesetInfo = null) : base(rulesetInfo) { } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 6c5c272eac..4f256621fb 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -34,9 +34,9 @@ namespace osu.Game.Rulesets public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay); - protected Ruleset(RulesetInfo rulesetInfo) + protected Ruleset(RulesetInfo rulesetInfo = null) { - RulesetInfo = rulesetInfo; + RulesetInfo = rulesetInfo ?? createRulesetInfo(); } /// @@ -88,5 +88,17 @@ namespace osu.Game.Rulesets /// The variant. /// A descriptive name of the variant. public virtual string GetVariantName(int variant) => string.Empty; + + /// + /// Create a ruleset info based on this ruleset. + /// + /// A filled . + private RulesetInfo createRulesetInfo() => new RulesetInfo + { + Name = Description, + ShortName = ShortName, + InstantiationInfo = GetType().AssemblyQualifiedName, + ID = LegacyID + }; } } diff --git a/osu.Game/Rulesets/RulesetStore.cs b/osu.Game/Rulesets/RulesetStore.cs index 76a4c99b86..01e3b6848f 100644 --- a/osu.Game/Rulesets/RulesetStore.cs +++ b/osu.Game/Rulesets/RulesetStore.cs @@ -58,30 +58,21 @@ namespace osu.Game.Rulesets { var context = GetContext(); - var instances = loaded_assemblies.Values.Select(r => (Ruleset)Activator.CreateInstance(r, new RulesetInfo())).ToList(); + var instances = loaded_assemblies.Values.Select(r => (Ruleset)Activator.CreateInstance(r, (RulesetInfo)null)).ToList(); //add all legacy modes in correct order foreach (var r in instances.Where(r => r.LegacyID >= 0).OrderBy(r => r.LegacyID)) { - var rulesetInfo = createRulesetInfo(r); - if (context.RulesetInfo.SingleOrDefault(rsi => rsi.ID == rulesetInfo.ID) == null) - { - context.RulesetInfo.Add(rulesetInfo); - } + if (context.RulesetInfo.SingleOrDefault(rsi => rsi.ID == r.RulesetInfo.ID) == null) + context.RulesetInfo.Add(r.RulesetInfo); } context.SaveChanges(); //add any other modes foreach (var r in instances.Where(r => r.LegacyID < 0)) - { - var us = createRulesetInfo(r); - - var existing = context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo == us.InstantiationInfo); - - if (existing == null) - context.RulesetInfo.Add(us); - } + if (context.RulesetInfo.FirstOrDefault(ri => ri.InstantiationInfo == r.RulesetInfo.InstantiationInfo) == null) + context.RulesetInfo.Add(r.RulesetInfo); context.SaveChanges(); @@ -124,13 +115,5 @@ namespace osu.Game.Rulesets { } } - - private RulesetInfo createRulesetInfo(Ruleset ruleset) => new RulesetInfo - { - Name = ruleset.Description, - ShortName = ruleset.ShortName, - InstantiationInfo = ruleset.GetType().AssemblyQualifiedName, - ID = ruleset.LegacyID - }; } } diff --git a/osu.Game/Tests/Visual/TestCasePlayer.cs b/osu.Game/Tests/Visual/TestCasePlayer.cs index 72c1fc7369..181ed5e0e6 100644 --- a/osu.Game/Tests/Visual/TestCasePlayer.cs +++ b/osu.Game/Tests/Visual/TestCasePlayer.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.IO; using System.Linq; using System.Text; @@ -18,24 +17,19 @@ namespace osu.Game.Tests.Visual { public abstract class TestCasePlayer : ScreenTestCase { - private readonly Type ruleset; + private readonly Ruleset ruleset; protected Player Player; private TestWorkingBeatmap working; - /// - /// Create a TestCase which runs through the Player screen. - /// - /// An optional ruleset type which we want to target. If not provided we'll allow all rulesets to be tested. - protected TestCasePlayer(Type ruleset) + protected TestCasePlayer(Ruleset ruleset) { this.ruleset = ruleset; } protected TestCasePlayer() { - } [BackgroundDependencyLoader] @@ -48,14 +42,21 @@ namespace osu.Game.Tests.Visual Depth = int.MaxValue }); - string instantiation = ruleset?.AssemblyQualifiedName; - - foreach (var r in rulesets.AvailableRulesets.Where(rs => instantiation == null || rs.InstantiationInfo == instantiation)) + if (ruleset != null) { Player p = null; - AddStep(r.Name, () => p = loadPlayerFor(r)); + AddStep(ruleset.RulesetInfo.Name, () => p = loadPlayerFor(ruleset)); AddUntilStep(() => p.IsLoaded); } + else + { + foreach (var r in rulesets.AvailableRulesets) + { + Player p = null; + AddStep(r.Name, () => p = loadPlayerFor(r)); + AddUntilStep(() => p.IsLoaded); + } + } } protected virtual Beatmap CreateBeatmap() @@ -69,21 +70,21 @@ namespace osu.Game.Tests.Visual return beatmap; } - private Player loadPlayerFor(RulesetInfo r) + private Player loadPlayerFor(RulesetInfo ri) => loadPlayerFor(ri.CreateInstance()); + + private Player loadPlayerFor(Ruleset r) { var beatmap = CreateBeatmap(); - beatmap.BeatmapInfo.Ruleset = r; - - var instance = r.CreateInstance(); + beatmap.BeatmapInfo.Ruleset = r.RulesetInfo; working = new TestWorkingBeatmap(beatmap); - working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) }; + working.Mods.Value = new[] { r.GetAllMods().First(m => m is ModNoFail) }; if (Player != null) Remove(Player); - var player = CreatePlayer(working, instance); + var player = CreatePlayer(working, r); LoadComponentAsync(player, LoadScreen); From c010b48b2984e1c625505a778d904a2c3b0b79c7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 17:29:16 +0900 Subject: [PATCH 235/628] Remove number format specified from OsuSliderBar, override ToolTipText Better/cleaner solution. --- .../Visual/TestCaseSliderBarPercentage.cs | 123 ------------- .../Visual/TestCaseSliderBarPrecision.cs | 172 ------------------ osu.Game.Tests/osu.Game.Tests.csproj | 2 - .../Graphics/UserInterface/OsuSliderBar.cs | 22 +-- osu.Game/Overlays/Settings/SettingsSlider.cs | 10 - .../Play/ReplaySettings/PlaybackSettings.cs | 2 +- .../Play/ReplaySettings/ReplaySliderBar.cs | 2 + 7 files changed, 5 insertions(+), 328 deletions(-) delete mode 100644 osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs delete mode 100644 osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs deleted file mode 100644 index 8a64f7c9a4..0000000000 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPercentage.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Collections.Generic; -using osu.Framework.Graphics; -using osu.Framework.Configuration; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using OpenTK; - -namespace osu.Game.Tests.Visual -{ - public class TestCaseSliderBarPercentage : OsuTestCase - { - public override IReadOnlyList RequiredTypes => new[] { typeof(OsuSliderBar<>) }; - - private readonly BindableFloat floatValue; - private readonly BindableDouble doubleValue; - - private readonly TestSliderBar floatSliderBar; - private readonly TestSliderBar doubleSliderBar; - - public TestCaseSliderBarPercentage() - { - floatValue = new BindableFloat - { - MinValue = -1, - MaxValue = 1, - }; - - doubleValue = new BindableDouble - { - MinValue = -1, - MaxValue = 1 - }; - - Child = new FillFlowContainer - { - AutoSizeAxes = Axes.Y, - Width = 300, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 20), - Children = new Drawable[] - { - floatSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, - doubleSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X } - } - }; - - floatSliderBar.Current.BindTo(floatValue); - doubleSliderBar.Current.BindTo(doubleValue); - - floatValue.ValueChanged += setValue; - doubleValue.ValueChanged += setValue; - - AddStep("Digits = 0", () => setPercentageDigits(0)); - AddStep("Value = 0", () => setValue(0)); - AddAssert("Check 0%", () => checkExact(0)); - - AddStep("Value = 0.5", () => setValue(0.5)); - AddAssert("Check 50%", () => checkExact(0.5m)); - - AddStep("Value = 0.54", () => setValue(0.54)); - AddAssert("Check 54%", () => checkExact(0.54m)); - - AddStep("Value = 0.544", () => setValue(0.544)); - AddAssert("Check 54%", () => checkExact(0.54m)); - - AddStep("Value = 0.548", () => setValue(0.548)); - AddAssert("Check 55%", () => checkExact(0.55m)); - - AddStep("Digits = 1", () => setPercentageDigits(1)); - AddAssert("Check 54.8%", () => checkExact(0.548m)); - - AddSliderStep("Percentage", -1.0, 1.0, 0.0, setValue); - AddSliderStep("Digits", 0, 7, 1, setPercentageDigits); - } - - private bool checkExact(decimal percentage) - { - string expectedValue = percentage.ToString("P", floatSliderBar.Format); - return floatSliderBar.TooltipText == expectedValue && doubleSliderBar.TooltipText == expectedValue; - } - - private void setValue(T value) - { - floatValue.Value = Convert.ToSingle(value); - doubleValue.Value = Convert.ToDouble(value); - } - - private void setPercentageDigits(int digits) - { - floatSliderBar.Format.PercentDecimalDigits = digits; - doubleSliderBar.Format.PercentDecimalDigits = digits; - - // Make sure that the text referenced in TestSliderBar is updated - // This doesn't break any assertions if missing, but breaks the visual display - floatSliderBar.Current.TriggerChange(); - doubleSliderBar.Current.TriggerChange(); - } - - private class TestSliderBar : OsuSliderBar - where T : struct, IEquatable, IComparable, IConvertible - { - public TestSliderBar() - { - SpriteText valueText; - AddInternal(valueText = new OsuSpriteText - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreLeft, - X = 5, - Text = TooltipText - }); - - Current.ValueChanged += v => valueText.Text = TooltipText; - } - } - } -} diff --git a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs b/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs deleted file mode 100644 index af2b9be351..0000000000 --- a/osu.Game.Tests/Visual/TestCaseSliderBarPrecision.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; -using System.Collections.Generic; -using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using OpenTK; - -namespace osu.Game.Tests.Visual -{ - public class TestCaseSliderBarPrecision : OsuTestCase - { - public override IReadOnlyList RequiredTypes => new[] { typeof(OsuSliderBar<>) }; - - private readonly BindableInt intValue; - private readonly BindableFloat floatValue; - private readonly BindableDouble doubleValue; - - private readonly TestSliderBar intSliderBar; - private readonly TestSliderBar floatSliderBar; - private readonly TestSliderBar doubleSliderBar; - - public TestCaseSliderBarPrecision() - { - intValue = new BindableInt - { - MinValue = -1000, - MaxValue = 1000, - }; - - floatValue = new BindableFloat - { - MinValue = -1000, - MaxValue = 1000, - }; - - doubleValue = new BindableDouble - { - MinValue = -1000, - MaxValue = 1000 - }; - - Child = new FillFlowContainer - { - AutoSizeAxes = Axes.Y, - Width = 300, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 20), - Children = new Drawable[] - { - intSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, - floatSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X }, - doubleSliderBar = new TestSliderBar { RelativeSizeAxes = Axes.X } - } - }; - - intSliderBar.Current.BindTo(intValue); - floatSliderBar.Current.BindTo(floatValue); - doubleSliderBar.Current.BindTo(doubleValue); - - intValue.ValueChanged += setValue; - floatValue.ValueChanged += setValue; - doubleValue.ValueChanged += setValue; - - AddStep("Value = 0", () => setValue(0)); - AddStep("Digits = 0", () => setDecimalDigits(0)); - AddAssert("Check all 0", () => checkExact("0")); - - AddStep("Digits = 3", () => setDecimalDigits(3)); - AddAssert("Check 0.000", () => checkExact(0.000m)); - - AddStep("Value = 0.5", () => setValue(0.5)); - AddAssert("Check 0.500", () => checkExact(0.500m)); - - AddStep("Value = 123.4567", () => setValue(123.4567)); - AddAssert("Check 123.457", () => checkExact(123.457m)); - - AddStep("Value = 765.4312", () => setValue(765.4312)); - AddAssert("Check 765.431", () => checkExact(765.431m)); - - AddStep("Value = -12.3456", () => setValue(-12.3456)); - AddAssert("Check -12.346", () => checkExact(-12.346m)); - AddStep("Digits = 1", () => setDecimalDigits(1)); - AddAssert("Check -12.3", () => checkExact(-12.3m)); - AddStep("Digits = 0", () => setDecimalDigits(0)); - AddAssert("Check -12", () => checkExact(-12m)); - - AddStep("Value = -12.8", () => setValue(-12.8)); - AddAssert("Check -13", () => checkExact(-13m)); - AddStep("Digits = 1", () => setDecimalDigits(1)); - AddAssert("Check -12.8", () => checkExact(-12.8m)); - - AddSliderStep("Digits", 0, 7, 1, setDecimalDigits); - } - - /// - /// Checks whether all sliderbar tooltips display an exact value. - /// - /// The expected value that should be displayed. - private bool checkExact(string value) - => intSliderBar.TooltipText == value - && floatSliderBar.TooltipText == value - && doubleSliderBar.TooltipText == value; - - /// - /// Checks whether all sliderbar tooltips display an exact value. - /// - /// The expected value that should be displayed. - private bool checkExact(decimal value) - { - var expectedDecimal = value.ToString(intSliderBar.Format); - - return intSliderBar.TooltipText == Convert.ToInt32(value).ToString("N0") - && floatSliderBar.TooltipText == expectedDecimal - && doubleSliderBar.TooltipText == expectedDecimal; - } - - /// - /// Checks whether all floating-point sliderbar tooltips have a certain number of decimal digits. - /// - /// The expected number of decimal digits. - private bool checkDecimalDigits(int decimals) - => checkDecimalDigits(decimals, floatSliderBar.TooltipText) - && checkDecimalDigits(decimals, doubleSliderBar.TooltipText); - - private bool checkDecimalDigits(int decimals, string value) - => value.Length - value.IndexOf(intSliderBar.Format.NumberDecimalSeparator, StringComparison.InvariantCulture) - 1 == decimals; - - private void setValue(T value) - { - intValue.Value = Convert.ToInt32(value); - floatValue.Value = Convert.ToSingle(value); - doubleValue.Value = Convert.ToDouble(value); - } - - private void setDecimalDigits(int digits) - { - intSliderBar.Format.NumberDecimalDigits = digits; - floatSliderBar.Format.NumberDecimalDigits = digits; - doubleSliderBar.Format.NumberDecimalDigits = digits; - - // Make sure that the text referenced in TestSliderBar is updated - // This doesn't break any assertions if missing, but breaks the visual display - intSliderBar.Current.TriggerChange(); - floatSliderBar.Current.TriggerChange(); - doubleSliderBar.Current.TriggerChange(); - } - - private class TestSliderBar : OsuSliderBar - where T : struct, IEquatable, IComparable, IConvertible - { - public TestSliderBar() - { - SpriteText valueText; - AddInternal(valueText = new OsuSpriteText - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreLeft, - X = 5, - Text = TooltipText - }); - - Current.ValueChanged += v => valueText.Text = TooltipText; - } - } - } -} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 53d971a0b3..8c04874e75 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -132,8 +132,6 @@ - - diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index d42efe6678..f574ac13f7 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -28,24 +28,6 @@ namespace osu.Game.Graphics.UserInterface private readonly Box leftBox; private readonly Box rightBox; - private NumberFormatInfo format; - public NumberFormatInfo Format - { - get => format ?? (format = createDefaultFormat()); - set - { - if (format == value) - return; - format = value; - - if (IsLoaded) - { - // Some users may want to see the updated ToolTipText - Current.TriggerChange(); - } - } - } - public virtual string TooltipText { get @@ -60,9 +42,9 @@ namespace osu.Game.Graphics.UserInterface var floatMaxValue = bindableDouble?.MaxValue ?? bindableFloat.MaxValue; if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) - return floatValue.Value.ToString("P", Format); + return floatValue.Value.ToString("P0"); - return floatValue.Value.ToString("F", Format); + return floatValue.Value.ToString("N1"); } var bindableInt = CurrentNumber as BindableNumber; diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 56aa77a24f..708d9437a5 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; @@ -24,15 +23,6 @@ namespace osu.Game.Overlays.Settings RelativeSizeAxes = Axes.X }; - /// - /// The format that will be used for the tooltip when the sliderbar is hovered. - /// - public NumberFormatInfo Format - { - get => ((U)Control).Format; - set => ((U)Control).Format = value; - } - public float KeyboardStep; [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 65d83480a0..a63a3415e3 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -59,7 +59,6 @@ namespace osu.Game.Screens.Play.ReplaySettings } }; - sliderbar.Format.NumberDecimalDigits = 2; sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x"; } @@ -73,5 +72,6 @@ namespace osu.Game.Screens.Play.ReplaySettings var clockRate = AdjustableClock.Rate; sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier; } + } } diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs index 724f28dadf..e755e6bfd9 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs @@ -21,6 +21,8 @@ namespace osu.Game.Screens.Play.ReplaySettings private class Sliderbar : OsuSliderBar { + public override string TooltipText => $"{CurrentNumber.Value}"; + [BackgroundDependencyLoader] private void load(OsuColour colours) { From d1476833619261ed5ff136d6faf33069cf9ad2dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 17:39:15 +0900 Subject: [PATCH 236/628] Cleanup --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 9 --------- osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs | 1 - 2 files changed, 10 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index f574ac13f7..3c3939586e 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -113,15 +113,6 @@ namespace osu.Game.Graphics.UserInterface AccentColour = colours.Pink; } - private NumberFormatInfo createDefaultFormat() - { - var nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone(); - nfi.PercentDecimalDigits = 0; - nfi.NumberDecimalDigits = 1; - - return nfi; - } - protected override bool OnHover(InputState state) { Nub.Glowing = true; diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index a63a3415e3..f8ac653f69 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -72,6 +72,5 @@ namespace osu.Game.Screens.Play.ReplaySettings var clockRate = AdjustableClock.Rate; sliderbar.Bindable.ValueChanged += rateMultiplier => AdjustableClock.Rate = clockRate * rateMultiplier; } - } } From 1c412e233ae48e65bf17f1a0fce1b8181dd93db9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 18:04:12 +0900 Subject: [PATCH 237/628] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 067fdb8f5b..80bcb82ef8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 067fdb8f5b0594be1cd30e6bbd43f2ea749904ec +Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 diff --git a/osu-resources b/osu-resources index e01f71160f..7724abdf1d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 +Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 From f71d086a41e25704ad801fc05c4e04bd6e90a114 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 18:05:19 +0900 Subject: [PATCH 238/628] Fix post-merge issues --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 4 +--- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index dd99229cca..7fdabd46c2 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -2,8 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Rulesets.UI; -using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; @@ -24,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.UI private readonly CatcherArea catcherArea; public CatchPlayfield(BeatmapDifficulty difficulty) - : base(Axes.Y, BASE_WIDTH) + : base(ScrollingDirection.Down, BASE_WIDTH) { Container explodingFruitContainer; diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index eab39ff002..39f8333413 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -64,7 +64,6 @@ - @@ -120,7 +119,7 @@ - + From 9036ea92ebc3146124348af74b3c490e6b6d51ac Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 18:29:46 +0900 Subject: [PATCH 239/628] Run child updates for nested hitobjects when parent hitobjects are masked --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 34c34e1d33..e461cb96c5 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -36,6 +36,7 @@ namespace osu.Game.Rulesets.Objects.Drawables public override bool RemoveCompletedTransforms => false; public override bool RemoveWhenNotAlive => false; + protected override bool RequiresChildrenUpdate => true; protected DrawableHitObject(HitObject hitObject) { From 6255aaab687335b73e941fedb89ea72bbe6725f7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 10 Jan 2018 19:17:43 +0900 Subject: [PATCH 240/628] Per-hitobject lifetime management --- .../Objects/Drawables/DrawableHoldNote.cs | 4 ++++ .../Objects/Drawables/DrawableHoldNoteTick.cs | 4 ---- .../Objects/Drawables/DrawableManiaHitObject.cs | 4 ++++ osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs | 7 +++++++ .../Objects/Drawables/DrawableDrumRoll.cs | 7 +++++++ .../Objects/Drawables/DrawableDrumRollTick.cs | 2 +- .../UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs | 1 - .../UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs | 3 --- 8 files changed, 23 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 8e3159d531..1ed7cc594a 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -251,6 +251,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables }); } + protected override void UpdateState(ArmedState state) + { + } + public override bool OnPressed(ManiaAction action) => false; // Tail doesn't handle key down public override bool OnReleased(ManiaAction action) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index cfe82a2b59..0685c7bb2d 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -38,10 +38,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables RelativeSizeAxes = Axes.X; Size = new Vector2(1); - // Life time managed by the parent DrawableHoldNote - LifetimeStart = double.MinValue; - LifetimeEnd = double.MaxValue; - Children = new[] { glowContainer = new CircularContainer diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs index 5b98d84e68..0a1624b464 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableManiaHitObject.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics; using OpenTK.Graphics; using osu.Game.Rulesets.Objects.Drawables; @@ -19,6 +20,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected DrawableManiaHitObject(TObject hitObject, ManiaAction? action = null) : base(hitObject) { + Anchor = Anchor.TopCentre; + Origin = Anchor.TopCentre; + HitObject = hitObject; if (action != null) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 1696de2880..101db0205c 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -78,6 +78,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected override void UpdateState(ArmedState state) { + switch (state) + { + case ArmedState.Hit: + case ArmedState.Miss: + this.FadeOut(100).Expire(); + break; + } } public virtual bool OnPressed(ManiaAction action) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 564e496af5..0f16f85b63 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -100,6 +100,13 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables protected override void UpdateState(ArmedState state) { + switch (state) + { + case ArmedState.Hit: + case ArmedState.Miss: + this.FadeOut(100).Expire(); + break; + } } } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index 96485fbc9e..3408a830ed 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables switch (state) { case ArmedState.Hit: - Content.ScaleTo(0, 100, Easing.OutQuint); + Content.ScaleTo(0, 100, Easing.OutQuint).Expire(); break; } } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs index 0a69d00377..a8e41a951b 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs @@ -28,7 +28,6 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms var startPosition = hitObjectPositions[obj] = positionAt(obj.HitObject.StartTime, timeRange); obj.LifetimeStart = obj.HitObject.StartTime - timeRange - 1000; - obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange + 1000; if (!(obj.HitObject is IHasEndTime endTime)) continue; diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs index be8612ca96..c956766474 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using osu.Framework.Lists; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; using OpenTK; @@ -26,9 +25,7 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms foreach (var obj in hitObjects) { var controlPoint = controlPointAt(obj.HitObject.StartTime); - obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier; - obj.LifetimeEnd = ((obj.HitObject as IHasEndTime)?.EndTime ?? obj.HitObject.StartTime) + timeRange / controlPoint.Multiplier; } } From fbffc8bb89d7d4fd4e419e0d878987d44b64732b Mon Sep 17 00:00:00 2001 From: james58899 Date: Wed, 10 Jan 2018 18:55:04 +0800 Subject: [PATCH 241/628] fix load storyboard in osu file --- osu.Game/Beatmaps/BeatmapManager.cs | 11 +++-------- osu.Game/Beatmaps/Formats/Decoder.cs | 7 +++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index d7356cf100..c34ea13eda 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -696,14 +696,9 @@ namespace osu.Game.Beatmaps try { - Decoder decoder; - using (var stream = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path)))) - decoder = Decoder.GetDecoder(stream); - - // try for .osb first and fall back to .osu - string storyboardFile = BeatmapSetInfo.StoryboardFile ?? BeatmapInfo.Path; - using (var stream = new StreamReader(store.GetStream(getPathForFile(storyboardFile)))) - return decoder.GetStoryboardDecoder().DecodeStoryboard(stream); + using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path)))) + using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile)))) + return Decoder.GetDecoder(beatmap).GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard); } catch { diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index 8eeada66e8..87e33429a4 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -70,10 +70,13 @@ namespace osu.Game.Beatmaps.Formats protected abstract void ParseBeatmap(StreamReader stream, Beatmap beatmap); - public virtual Storyboard DecodeStoryboard(StreamReader stream) + public virtual Storyboard DecodeStoryboard(params StreamReader[] streams) { var storyboard = new Storyboard(); - ParseStoryboard(stream, storyboard); + foreach (StreamReader stream in streams) + { + ParseStoryboard(stream, storyboard); + } return storyboard; } From cc0520d7223387ceaf8b48ebec8a0f0879ed1244 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Wed, 10 Jan 2018 23:47:38 +0900 Subject: [PATCH 242/628] 1. because set stage's width doesn't help, so use margin instead 2. adjust spacing when has different number of stages --- osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs | 6 ++++++ osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs index dad5082175..46dd44864a 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs @@ -155,6 +155,12 @@ namespace osu.Game.Rulesets.Mania.UI c.VisibleTimeRange.BindTo(VisibleTimeRange); topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); columns.Add(c); + + Margin = new MarginPadding() + { + Left = columns.Count * HIT_TARGET_POSITION / 2, + Right = columns.Count * HIT_TARGET_POSITION / 2, + }; } public void AddJudgement(Judgement judgement) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 292b301e29..06d0c5c242 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -54,15 +54,18 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.Value = true; + var stageSpacing = 300 / stages.Count(); + InternalChildren = new Drawable[] { listColumnStages = new FillFlowContainer { + Name="Stages", Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Spacing = new Vector2(400), + Spacing = new Vector2(stageSpacing), } }; From 118e0b63ebb1bf1830f127f24ae6f0dab73fe826 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 11 Jan 2018 00:07:27 +0900 Subject: [PATCH 243/628] fix CI error --- osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs index 46dd44864a..5751c87e78 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs @@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Mania.UI topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); columns.Add(c); - Margin = new MarginPadding() + Margin = new MarginPadding { Left = columns.Count * HIT_TARGET_POSITION / 2, Right = columns.Count * HIT_TARGET_POSITION / 2, diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 06d0c5c242..dd86eb5586 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.Value = true; - var stageSpacing = 300 / stages.Count(); + var stageSpacing = 300 / stages.Count; InternalChildren = new Drawable[] { From 312f52072bd4762e5cbd998e1fd905f736c13126 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 10 Jan 2018 16:46:55 +0100 Subject: [PATCH 244/628] enable query change Avatar animation too add forgotten usings --- osu.Game/Overlays/Social/Header.cs | 4 +-- osu.Game/Overlays/SocialOverlay.cs | 42 ++++++++++++------------------ osu.Game/Users/UpdateableAvatar.cs | 2 +- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/osu.Game/Overlays/Social/Header.cs b/osu.Game/Overlays/Social/Header.cs index 0767e0aec0..7bb4b4dde9 100644 --- a/osu.Game/Overlays/Social/Header.cs +++ b/osu.Game/Overlays/Social/Header.cs @@ -55,9 +55,9 @@ namespace osu.Game.Overlays.Social public enum SocialTab { [Description("All Players")] - AllPlayers = SocialSortCriteria.Rank, + AllPlayers, [Description("Friends")] - Friends = SocialSortCriteria.Name, + Friends, //[Description("Team Members")] //TeamMembers, //[Description("Chat Channels")] diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 8d91ae0c18..161ff70dc9 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -15,6 +15,8 @@ using osu.Game.Online.API.Requests; using osu.Game.Overlays.SearchableList; using osu.Game.Overlays.Social; using osu.Game.Users; +using osu.Framework.Configuration; +using osu.Framework.Threading; namespace osu.Game.Overlays { @@ -65,36 +67,24 @@ namespace osu.Game.Overlays } }; - Header.Tabs.Current.ValueChanged += tab => - { - //currentQuery.Value = string.Empty; - Filter.Tabs.Current.Value = (SocialSortCriteria)Header.Tabs.Current.Value; - Scheduler.AddOnce(updateSearch); - }; + Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch); - Filter.Tabs.Current.ValueChanged += sortCriteria => - { - // force searching in players until searching for friends is supported - if (Header.Tabs.Current.Value != SocialTab.AllPlayers && sortCriteria != (SocialSortCriteria)Header.Tabs.Current.Value) - Header.Tabs.Current.Value = SocialTab.AllPlayers; - - Scheduler.AddOnce(updateSearch); - }; + Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch); Filter.DisplayStyleControl.DisplayStyle.ValueChanged += recreatePanels; Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch); - //currentQuery.ValueChanged += v => - //{ - // queryChangedDebounce?.Cancel(); + currentQuery.ValueChanged += query => + { + queryChangedDebounce?.Cancel(); - // if (string.IsNullOrEmpty(v)) - // Scheduler.AddOnce(updateSearch); - // else - // queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); - //}; + if (string.IsNullOrEmpty(query)) + Scheduler.AddOnce(updateSearch); + else + queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500); + }; - //currentQuery.BindTo(Filter.Search.Current); + currentQuery.BindTo(Filter.Search.Current); } [BackgroundDependencyLoader] @@ -159,13 +149,13 @@ namespace osu.Game.Overlays private APIRequest getUsersRequest; - //private readonly Bindable currentQuery = new Bindable(); + private readonly Bindable currentQuery = new Bindable(); - //private ScheduledDelegate queryChangedDebounce; + private ScheduledDelegate queryChangedDebounce; private void updateSearch() { - //queryChangedDebounce?.Cancel(); + queryChangedDebounce?.Cancel(); if (!IsLoaded) return; diff --git a/osu.Game/Users/UpdateableAvatar.cs b/osu.Game/Users/UpdateableAvatar.cs index e58647c7f6..2edd7cbf55 100644 --- a/osu.Game/Users/UpdateableAvatar.cs +++ b/osu.Game/Users/UpdateableAvatar.cs @@ -44,7 +44,7 @@ namespace osu.Game.Users new Avatar(user) { RelativeSizeAxes = Axes.Both, - OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out), + OnLoadComplete = d => d.FadeInFromZero(300, Easing.OutQuint), }) ); } From 98851e4a783843655f114087dd4c055a0d838657 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 11 Jan 2018 01:24:34 +0300 Subject: [PATCH 245/628] Stop time whenever visual settings are expanded --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 17 +++++++++++++---- osu.Game/Screens/Play/HUDOverlay.cs | 3 ++- osu.Game/Screens/Play/Player.cs | 5 +++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index e9aabefc5d..068783df34 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; @@ -14,7 +13,9 @@ namespace osu.Game.Screens.Play.HUD public class VisualSettings : ReplayGroup { protected override string Title => "Visual settings"; - public IAdjustableClock AdjustableClock { get; set; } + + public IAdjustableClock AudioClock { get; set; } + public FramedClock FramedClock { get; set; } private readonly ReplaySliderBar dimSliderBar; private readonly ReplayCheckbox showStoryboardToggle; @@ -51,9 +52,17 @@ namespace osu.Game.Screens.Play.HUD { base.ToggleContentVisibility(); if (Expanded) - AdjustableClock?.Stop(); + { + AudioClock?.Stop(); + if (FramedClock != null) + FramedClock.ProcessSourceClockFrames = false; + } else - AdjustableClock?.Start(); + { + AudioClock?.Start(); + if (FramedClock != null) + FramedClock.ProcessSourceClockFrames = true; + } } } } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 6593391da4..be37da04cd 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -103,7 +103,8 @@ namespace osu.Game.Screens.Play if (!replayLoaded) { ReplaySettingsOverlay.PlaybackSettings.Hide(); - ReplaySettingsOverlay.Delay(5000).FadeOut(200); + // TODO Hide VisualSettings correctly. At least, It shouldn't dissapear in expanded state. + //ReplaySettingsOverlay.VisualSettings.Delay(10000).FadeOut(200); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 0245491431..39d436bdf2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -228,8 +228,9 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = - hudOverlay.ReplaySettingsOverlay.VisualSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.ReplaySettingsOverlay.VisualSettings.AudioClock = decoupledClock; + hudOverlay.ReplaySettingsOverlay.VisualSettings.FramedClock = offsetClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; From 6a5a3b01b265878c5fccca36cc80307769c5cfe5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 12:39:06 +0900 Subject: [PATCH 246/628] Fix license headers --- osu.Game/Configuration/ScrollingAlgorithmType.cs | 2 +- .../Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs | 2 +- osu.Game/Rulesets/UI/HitObjectContainer.cs | 2 +- .../UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs | 2 +- .../Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs | 2 +- .../Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs | 2 +- osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs | 2 +- osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game/Configuration/ScrollingAlgorithmType.cs b/osu.Game/Configuration/ScrollingAlgorithmType.cs index b4a2b8a4a3..8b9d292634 100644 --- a/osu.Game/Configuration/ScrollingAlgorithmType.cs +++ b/osu.Game/Configuration/ScrollingAlgorithmType.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.ComponentModel; diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs index b2a2a25da7..3243f4c23a 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Game.Configuration; diff --git a/osu.Game/Rulesets/UI/HitObjectContainer.cs b/osu.Game/Rulesets/UI/HitObjectContainer.cs index e7843c86ca..c26a6cdff0 100644 --- a/osu.Game/Rulesets/UI/HitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/HitObjectContainer.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.Linq; diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs index a8e41a951b..55a0a7c2f3 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs index 2621ae7d6f..f9863bd299 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using osu.Game.Rulesets.Objects.Drawables; diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs index c956766474..b2d4289a9a 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using osu.Framework.Lists; diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs index d89795f4d3..372bdb1030 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingDirection.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE namespace osu.Game.Rulesets.UI.Scrolling { diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 67f2e8aee0..dfa6a40db4 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . +// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; From 3a869edf36312657761727a26917a3bafb5e7029 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 12:44:17 +0900 Subject: [PATCH 247/628] Add a flag to disable user scroll speed adjustments --- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 1 + osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index b8e4ede120..3c5093d82f 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -37,6 +37,7 @@ namespace osu.Game.Rulesets.Taiko.UI /// private const float left_area_size = 240; + protected override bool UserScrollSpeedAdjustment => false; private readonly Container hitExplosionContainer; private readonly Container kiaiExplosionContainer; diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 5be1c8bed7..11185015b8 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -47,6 +47,11 @@ namespace osu.Game.Rulesets.UI.Scrolling MaxValue = time_span_max }; + /// + /// Whether the player can change . + /// + protected virtual bool UserScrollSpeedAdjustment => true; + /// /// The container that contains the s and s. /// @@ -92,6 +97,9 @@ namespace osu.Game.Rulesets.UI.Scrolling protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { + if (!UserScrollSpeedAdjustment) + return false; + if (state.Keyboard.ControlPressed) { switch (args.Key) From a6d8b28221910993005d6adbbcc5b0447b5a1511 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 13:40:46 +0900 Subject: [PATCH 248/628] Add OSD + config value for scroll speed --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 5 ++++- osu.Game/Configuration/OsuConfigManager.cs | 4 +++- osu.Game/Overlays/OnScreenDisplay.cs | 6 +++++- osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 919518dbe8..532be2759f 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -15,6 +15,7 @@ using osu.Framework.Configuration; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Framework.Graphics.Shapes; +using osu.Game.Configuration; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.UI.Scrolling; @@ -161,8 +162,10 @@ namespace osu.Game.Rulesets.Mania.UI } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, OsuConfigManager config) { + config.BindWith(OsuSetting.UserScrollSpeed, VisibleTimeRange); + normalColumnColours = new List { colours.RedDark, diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 13213a54a1..26879782fc 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -73,6 +73,7 @@ namespace osu.Game.Configuration Set(OsuSetting.FloatingComments, false); Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); + Set(OsuSetting.UserScrollSpeed, 1500.0, 50.0, 10000.0); // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -119,6 +120,7 @@ namespace osu.Game.Configuration ChatDisplayHeight, Version, ShowConvertedBeatmaps, - ScrollingAlgorithm + ScrollingAlgorithm, + UserScrollSpeed } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 6a1bd8e182..4f3f03c749 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -14,6 +14,7 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; +using osu.Game.Configuration; using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays @@ -115,7 +116,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(FrameworkConfigManager frameworkConfig) + private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig) { trackSetting(frameworkConfig.GetBindable(FrameworkSetting.FrameSync), v => display(v, "Frame Limiter", v.GetDescription(), "Ctrl+F7")); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v)); @@ -135,6 +136,9 @@ namespace osu.Game.Overlays }); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter")); + + // Todo: This should be part of the ruleset-specific OSD + trackSetting(osuConfig.GetBindable(OsuSetting.UserScrollSpeed), v => display(v, "Scroll Speed", $"{v:N0}ms", "Ctrl+(+/-) to change")); } private readonly List references = new List(); diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 11185015b8..fa04b7f137 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -102,13 +103,15 @@ namespace osu.Game.Rulesets.UI.Scrolling if (state.Keyboard.ControlPressed) { + var lastValue = Transforms.OfType().LastOrDefault()?.EndValue ?? VisibleTimeRange.Value; + switch (args.Key) { case Key.Minus: - transformVisibleTimeRangeTo(VisibleTimeRange + time_span_step, 200, Easing.OutQuint); + transformVisibleTimeRangeTo(lastValue + time_span_step, 200, Easing.OutQuint); break; case Key.Plus: - transformVisibleTimeRangeTo(VisibleTimeRange - time_span_step, 200, Easing.OutQuint); + transformVisibleTimeRangeTo(lastValue - time_span_step, 200, Easing.OutQuint); break; } } From 4fa038aa27fcde705f2f53ae2bfb8b71026df15b Mon Sep 17 00:00:00 2001 From: james58899 Date: Thu, 11 Jan 2018 13:53:41 +0800 Subject: [PATCH 249/628] if not storyboard file --- osu.Game/Beatmaps/BeatmapManager.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index c34ea13eda..d342e495e2 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -691,14 +691,19 @@ namespace osu.Game.Beatmaps protected override Storyboard GetStoryboard() { - if (BeatmapInfo?.Path == null && BeatmapSetInfo?.StoryboardFile == null) - return new Storyboard(); - try { - using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo?.Path)))) - using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile)))) - return Decoder.GetDecoder(beatmap).GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard); + + using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path)))) + { + Decoder decoder = Decoder.GetDecoder(beatmap); + + if (BeatmapSetInfo?.StoryboardFile == null) + return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap); + + using (var storyboard = new StreamReader(store.GetStream(getPathForFile(BeatmapSetInfo.StoryboardFile)))) + return decoder.GetStoryboardDecoder().DecodeStoryboard(beatmap, storyboard); + } } catch { From 9d00e5bb7dfc103003f11a73bda6d435b345686c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 15:08:30 +0900 Subject: [PATCH 250/628] Make ScrollingHitObjectContainer handle nested hitobjects --- .../Objects/Drawable/DrawableJuiceStream.cs | 2 +- .../Objects/Drawables/DrawableHoldNote.cs | 24 +---------- .../Objects/Drawables/DrawableHoldNoteTick.cs | 3 -- .../Objects/Drawables/DrawableDrumRoll.cs | 7 +--- .../Objects/Drawables/DrawableDrumRollTick.cs | 12 ------ .../Objects/Drawables/DrawableHitObject.cs | 41 +++++++++++++------ .../Algorithms/GlobalScrollingAlgorithm.cs | 34 ++++++++------- .../Algorithms/LocalScrollingAlgorithm.cs | 6 +++ 8 files changed, 59 insertions(+), 70 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index 031b70924d..dcb7fdb823 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable } } - protected override void AddNested(DrawableHitObject h) + protected override void AddNested(DrawableHitObject h) { ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; dropletContainer.Add(h); diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 1ed7cc594a..6748bc22e6 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -7,7 +7,6 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; using OpenTK.Graphics; -using OpenTK; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Mania.Judgements; using osu.Framework.Extensions.IEnumerableExtensions; @@ -59,12 +58,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, }, - tickContainer = new Container - { - RelativeSizeAxes = Axes.Both, - RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), - RelativeChildSize = new Vector2(1, (float)HitObject.Duration) - }, + tickContainer = new Container { RelativeSizeAxes = Axes.Both }, head = new DrawableHeadNote(this, action) { Anchor = Anchor.TopCentre, @@ -72,7 +66,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables }, tail = new DrawableTailNote(this, action) { - Anchor = Anchor.BottomCentre, + Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre } }); @@ -174,13 +168,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { this.holdNote = holdNote; - RelativePositionAxes = Axes.None; - Y = 0; - - // Life time managed by the parent DrawableHoldNote - LifetimeStart = double.MinValue; - LifetimeEnd = double.MaxValue; - GlowPiece.Alpha = 0; } @@ -213,13 +200,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { this.holdNote = holdNote; - RelativePositionAxes = Axes.None; - Y = 0; - - // Life time managed by the parent DrawableHoldNote - LifetimeStart = double.MinValue; - LifetimeEnd = double.MaxValue; - GlowPiece.Alpha = 0; } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs index 0685c7bb2d..f9c0b96d37 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNoteTick.cs @@ -32,9 +32,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; - RelativePositionAxes = Axes.Y; - Y = (float)HitObject.StartTime; - RelativeSizeAxes = Axes.X; Size = new Vector2(1); diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 0f16f85b63..2fa6c8ed95 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -37,12 +37,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables RelativeSizeAxes = Axes.Y; Container tickContainer; - MainPiece.Add(tickContainer = new Container - { - RelativeSizeAxes = Axes.Both, - RelativeChildOffset = new Vector2((float)HitObject.StartTime, 0), - RelativeChildSize = new Vector2((float)HitObject.Duration, 1) - }); + MainPiece.Add(tickContainer = new Container { RelativeSizeAxes = Axes.Both }); foreach (var tick in drumRoll.NestedHitObjects.OfType()) { diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index 3408a830ed..bc5abce245 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -15,23 +15,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables public DrawableDrumRollTick(DrumRollTick tick) : base(tick) { - // Because ticks aren't added by the ScrollingPlayfield, we need to set the following properties ourselves - RelativePositionAxes = Axes.X; - X = (float)tick.StartTime; - FillMode = FillMode.Fit; } public override bool DisplayJudgement => false; - protected override void LoadComplete() - { - base.LoadComplete(); - - // We need to set this here because RelativeSizeAxes won't/can't set our size by default with a different RelativeChildSize - Width *= Parent.RelativeChildSize.X; - } - protected override TaikoPiece CreateMainPiece() => new TickPiece { Filled = HitObject.FirstTick diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index e461cb96c5..13329a1470 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -38,11 +38,30 @@ namespace osu.Game.Rulesets.Objects.Drawables public override bool RemoveWhenNotAlive => false; protected override bool RequiresChildrenUpdate => true; + public virtual bool AllJudged => false; + protected DrawableHitObject(HitObject hitObject) { HitObject = hitObject; } + /// + /// Processes this , checking if any judgements have occurred. + /// + /// Whether the user triggered this process. + /// Whether a judgement has occurred from this or any nested s. + protected internal virtual bool UpdateJudgement(bool userTriggered) => false; + + private List nestedHitObjects; + public IReadOnlyList NestedHitObjects => nestedHitObjects; + + protected virtual void AddNested(DrawableHitObject h) + { + if (nestedHitObjects == null) + nestedHitObjects = new List(); + nestedHitObjects.Add(h); + } + /// /// The screen-space point that causes this to be selected in the Editor. /// @@ -145,7 +164,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// /// Whether this and all of its nested s have been judged. /// - public bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); + public sealed override bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); /// /// Notifies that a new judgement has occurred for this . @@ -181,7 +200,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// /// Whether the user triggered this process. /// Whether a judgement has occurred from this or any nested s. - protected bool UpdateJudgement(bool userTriggered) + protected internal sealed override bool UpdateJudgement(bool userTriggered) { judgementOccurred = false; @@ -238,18 +257,16 @@ namespace osu.Game.Rulesets.Objects.Drawables UpdateJudgement(false); } - private List> nestedHitObjects; - protected IEnumerable> NestedHitObjects => nestedHitObjects; - - protected virtual void AddNested(DrawableHitObject h) + protected override void AddNested(DrawableHitObject h) { - if (nestedHitObjects == null) - nestedHitObjects = new List>(); + base.AddNested(h); - h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); - h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); - h.ApplyCustomUpdateState += (d, s) => ApplyCustomUpdateState?.Invoke(d, s); - nestedHitObjects.Add(h); + if (!(h is DrawableHitObject hWithJudgement)) + return; + + hWithJudgement.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); + hWithJudgement.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); + hWithJudgement.ApplyCustomUpdateState += (d, s) => ApplyCustomUpdateState?.Invoke(d, s); } /// diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs index 55a0a7c2f3..c1347ad122 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs @@ -29,22 +29,25 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.LifetimeStart = obj.HitObject.StartTime - timeRange - 1000; - if (!(obj.HitObject is IHasEndTime endTime)) - continue; - - var diff = positionAt(endTime.EndTime, timeRange) - startPosition; - - switch (direction) + if (obj.HitObject is IHasEndTime endTime) { - case ScrollingDirection.Up: - case ScrollingDirection.Down: - obj.Height = (float)(diff * length.Y); - break; - case ScrollingDirection.Left: - case ScrollingDirection.Right: - obj.Width = (float)(diff * length.X); - break; + var diff = positionAt(endTime.EndTime, timeRange) - startPosition; + + switch (direction) + { + case ScrollingDirection.Up: + case ScrollingDirection.Down: + obj.Height = (float)(diff * length.Y); + break; + case ScrollingDirection.Left: + case ScrollingDirection.Right: + obj.Width = (float)(diff * length.X); + break; + } } + + if (obj.NestedHitObjects != null) + ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length); } } @@ -71,6 +74,9 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.X = (float)(-finalPosition * length.X); break; } + + if (obj.NestedHitObjects != null) + ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); } } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs index b2d4289a9a..ecb7aaff95 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -26,6 +26,9 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms { var controlPoint = controlPointAt(obj.HitObject.StartTime); obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier; + + if (obj.NestedHitObjects != null) + ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length); } } @@ -52,6 +55,9 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.X = (float)(-position * length.X); break; } + + if (obj.NestedHitObjects != null) + ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); } } From 428f8b6670b2a7b55861de4dc63d53389514a320 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 15:08:46 +0900 Subject: [PATCH 251/628] Fix up license header --- osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index 4f2e895e9d..b8e0934928 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; From 9ae67b519b6bb8f81dab49efa465c6004e5a5981 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 15:25:15 +0900 Subject: [PATCH 252/628] Optimise nested hitobject position computations --- .../UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs | 6 +++--- .../UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs index c1347ad122..ed156ecfd5 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs @@ -47,7 +47,10 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms } if (obj.NestedHitObjects != null) + { ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length); + ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); + } } } @@ -74,9 +77,6 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.X = (float)(-finalPosition * length.X); break; } - - if (obj.NestedHitObjects != null) - ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); } } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs index ecb7aaff95..96a85c5f9f 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs @@ -28,7 +28,10 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.LifetimeStart = obj.HitObject.StartTime - timeRange / controlPoint.Multiplier; if (obj.NestedHitObjects != null) + { ComputeInitialStates(obj.NestedHitObjects, direction, timeRange, length); + ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); + } } } @@ -55,9 +58,6 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms obj.X = (float)(-position * length.X); break; } - - if (obj.NestedHitObjects != null) - ComputePositions(obj.NestedHitObjects, direction, obj.HitObject.StartTime, timeRange, length); } } From d998936e9eaa57a276c3d371496c6dc3e95f0338 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 15:50:44 +0900 Subject: [PATCH 253/628] Fix testcase errors --- osu.Game/Rulesets/UI/Playfield.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 25a7adb5a7..a1d07d9a03 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.UI } } }); + + HitObjects = CreateHitObjectContainer(); + HitObjects.RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] private void load() { - HitObjects = CreateHitObjectContainer(); - HitObjects.RelativeSizeAxes = Axes.Both; - Add(HitObjects); } From ab762045d608655c6495298544ed62c5545f6b36 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 16:51:46 +0900 Subject: [PATCH 254/628] Move back to using load(), fix testcase --- .../Visual/TestCaseEditorSelectionLayer.cs | 39 +++--- .../Visual/TestCaseScrollingHitObjects.cs | 114 ++++++++++-------- osu.Game/Rulesets/UI/Playfield.cs | 6 +- 3 files changed, 90 insertions(+), 69 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs index b318d4afd3..f236182939 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using osu.Framework.Allocation; using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -18,26 +19,10 @@ namespace osu.Game.Tests.Visual { public override IReadOnlyList RequiredTypes => new[] { typeof(SelectionLayer) }; - public TestCaseEditorSelectionLayer() + [BackgroundDependencyLoader] + private void load() { - var playfield = new OsuEditPlayfield - { - new DrawableHitCircle(new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }), - new DrawableHitCircle(new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }), - new DrawableSlider(new Slider - { - ControlPoints = new List - { - new Vector2(128, 256), - new Vector2(344, 256), - }, - Distance = 400, - Position = new Vector2(128, 256), - Velocity = 1, - TickDistance = 100, - Scale = 0.5f - }) - }; + var playfield = new OsuEditPlayfield(); Children = new Drawable[] { @@ -49,6 +34,22 @@ namespace osu.Game.Tests.Visual }, new SelectionLayer(playfield) }; + + playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f })); + playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f })); + playfield.Add(new DrawableSlider(new Slider + { + ControlPoints = new List + { + new Vector2(128, 256), + new Vector2(344, 256), + }, + Distance = 400, + Position = new Vector2(128, 256), + Velocity = 1, + TickDistance = 100, + Scale = 0.5f + })); } } } diff --git a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs index b8e0934928..21d967c3e3 100644 --- a/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs +++ b/osu.Game.Tests/Visual/TestCaseScrollingHitObjects.cs @@ -3,7 +3,7 @@ using System; using System.Collections.Generic; -using osu.Framework.Configuration; +using osu.Framework.Extensions.IEnumerableExtensions; using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -13,7 +13,6 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI.Scrolling; -using OpenTK.Graphics; namespace osu.Game.Tests.Visual { @@ -21,39 +20,29 @@ namespace osu.Game.Tests.Visual { public override IReadOnlyList RequiredTypes => new[] { typeof(Playfield) }; - private readonly List playfields = new List(); + private readonly TestPlayfield[] playfields = new TestPlayfield[4]; public TestCaseScrollingHitObjects() { - playfields.Add(new TestPlayfield(ScrollingDirection.Down)); - playfields.Add(new TestPlayfield(ScrollingDirection.Right)); - - playfields.ForEach(p => p.HitObjects.AddControlPoint(new MultiplierControlPoint(double.MinValue))); - - Add(new Container + Add(new GridContainer { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Size = new Vector2(0.85f), - Masking = true, - BorderColour = Color4.White, - BorderThickness = 2, - MaskingSmoothness = 1, - Children = new Drawable[] + Content = new[] { - new Box + new Drawable[] { - Name = "Background", - RelativeSizeAxes = Axes.Both, - Alpha = 0.35f, + playfields[0] = new TestPlayfield(ScrollingDirection.Up), + playfields[1] = new TestPlayfield(ScrollingDirection.Down) }, - playfields[0], - playfields[1] + new Drawable[] + { + playfields[2] = new TestPlayfield(ScrollingDirection.Left), + playfields[3] = new TestPlayfield(ScrollingDirection.Right) + } } }); - AddSliderStep("Time range", 100, 10000, 5000, v => playfields.ForEach(p => p.TimeRange.Value = v)); + AddSliderStep("Time range", 100, 10000, 5000, v => playfields.ForEach(p => p.VisibleTimeRange.Value = v)); AddStep("Add control point", () => addControlPoint(Time.Current + 5000)); } @@ -61,6 +50,8 @@ namespace osu.Game.Tests.Visual { base.LoadComplete(); + playfields.ForEach(p => p.HitObjects.AddControlPoint(new MultiplierControlPoint(0))); + for (int i = 0; i <= 5000; i += 1000) addHitObject(Time.Current + i); @@ -71,10 +62,10 @@ namespace osu.Game.Tests.Visual { playfields.ForEach(p => { - p.Add(new TestDrawableHitObject(time) - { - Anchor = p.Direction == ScrollingDirection.Right ? Anchor.CentreRight : Anchor.BottomCentre - }); + var hitObject = new TestDrawableHitObject(time); + setAnchor(hitObject, p); + + p.Add(hitObject); }); } @@ -86,10 +77,12 @@ namespace osu.Game.Tests.Visual p.HitObjects.AddControlPoint(new MultiplierControlPoint(time + 2000) { DifficultyPoint = { SpeedMultiplier = 2 } }); p.HitObjects.AddControlPoint(new MultiplierControlPoint(time + 3000) { DifficultyPoint = { SpeedMultiplier = 1 } }); - TestDrawableControlPoint createDrawablePoint(double t) => new TestDrawableControlPoint(t) + TestDrawableControlPoint createDrawablePoint(double t) { - Anchor = p.Direction == ScrollingDirection.Right ? Anchor.CentreRight : Anchor.BottomCentre - }; + var obj = new TestDrawableControlPoint(p.Direction, t); + setAnchor(obj, p); + return obj; + } p.Add(createDrawablePoint(time)); p.Add(createDrawablePoint(time + 2000)); @@ -97,12 +90,28 @@ namespace osu.Game.Tests.Visual }); } + private void setAnchor(DrawableHitObject obj, TestPlayfield playfield) + { + switch (playfield.Direction) + { + case ScrollingDirection.Up: + obj.Anchor = Anchor.TopCentre; + break; + case ScrollingDirection.Down: + obj.Anchor = Anchor.BottomCentre; + break; + case ScrollingDirection.Left: + obj.Anchor = Anchor.CentreLeft; + break; + case ScrollingDirection.Right: + obj.Anchor = Anchor.CentreRight; + break; + } + } private class TestPlayfield : ScrollingPlayfield { - public readonly BindableDouble TimeRange = new BindableDouble(5000); - public readonly ScrollingDirection Direction; public TestPlayfield(ScrollingDirection direction) @@ -110,34 +119,45 @@ namespace osu.Game.Tests.Visual { Direction = direction; - HitObjects.TimeRange.BindTo(TimeRange); + Padding = new MarginPadding(2); + ScaledContent.Masking = true; + + AddInternal(new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + Depth = float.MaxValue + }); } } private class TestDrawableControlPoint : DrawableHitObject { - private readonly Box box; - - public TestDrawableControlPoint(double time) + public TestDrawableControlPoint(ScrollingDirection direction, double time) : base(new HitObject { StartTime = time }) { Origin = Anchor.Centre; - Add(box = new Box + Add(new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both }); - } - protected override void Update() - { - base.Update(); - - RelativeSizeAxes = (Anchor & Anchor.x2) > 0 ? Axes.Y : Axes.X; - Size = new Vector2(1); - - box.Size = DrawSize; + switch (direction) + { + case ScrollingDirection.Up: + case ScrollingDirection.Down: + RelativeSizeAxes = Axes.X; + Height = 2; + break; + case ScrollingDirection.Left: + case ScrollingDirection.Right: + RelativeSizeAxes = Axes.Y; + Width = 2; + break; + } } protected override void UpdateState(ArmedState state) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index a1d07d9a03..25a7adb5a7 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -49,14 +49,14 @@ namespace osu.Game.Rulesets.UI } } }); - - HitObjects = CreateHitObjectContainer(); - HitObjects.RelativeSizeAxes = Axes.Both; } [BackgroundDependencyLoader] private void load() { + HitObjects = CreateHitObjectContainer(); + HitObjects.RelativeSizeAxes = Axes.Both; + Add(HitObjects); } From 86581b645163a83c0cc9886ca16f015bf812ba98 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Thu, 11 Jan 2018 17:02:09 +0900 Subject: [PATCH 255/628] Remove extra braces --- osu.Game/Beatmaps/Formats/Decoder.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/Decoder.cs b/osu.Game/Beatmaps/Formats/Decoder.cs index 87e33429a4..1aae52208a 100644 --- a/osu.Game/Beatmaps/Formats/Decoder.cs +++ b/osu.Game/Beatmaps/Formats/Decoder.cs @@ -74,9 +74,7 @@ namespace osu.Game.Beatmaps.Formats { var storyboard = new Storyboard(); foreach (StreamReader stream in streams) - { ParseStoryboard(stream, storyboard); - } return storyboard; } From c5c33e20bf86d3410ce939558dedff409693b669 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 19:03:01 +0900 Subject: [PATCH 256/628] OverlayContainer changes in-line with framework --- .../Graphics/Containers/OsuFocusedOverlayContainer.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 648985e4b1..ec461b86fd 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -33,15 +33,6 @@ namespace osu.Game.Graphics.Containers // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => BlockScreenWideMouse || base.ReceiveMouseInputAt(screenSpacePos); - protected override bool OnWheel(InputState state) - { - // always allow wheel to pass through to stuff outside our DrawRectangle. - if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) - return false; - - return BlockPassThroughMouse; - } - protected override bool OnClick(InputState state) { if (!base.ReceiveMouseInputAt(state.Mouse.NativeState.Position)) From 5cfb2c2ffe3e3bb111b11d344955710a1b13cb66 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 19:03:31 +0900 Subject: [PATCH 257/628] Make VolumeControlReceptor handle global input Fixes volume not being able to be changed in dead areas of OverlayContainers. --- .../Graphics/UserInterface/Volume/VolumeControlReceptor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs index 0649e4033f..2328533665 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControlReceptor.cs @@ -3,12 +3,13 @@ using System; using osu.Framework.Graphics.Containers; +using osu.Framework.Input; using osu.Framework.Input.Bindings; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { - public class VolumeControlReceptor : Container, IKeyBindingHandler + public class VolumeControlReceptor : Container, IKeyBindingHandler, IHandleGlobalInput { public Func ActionRequested; From 35c3ee261d9e3b90367947bbe3ad10e6fd1b3d51 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 20:02:52 +0900 Subject: [PATCH 258/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 80bcb82ef8..6594729122 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 +Subproject commit 65947291229541de3eb1aff0e703f6968b07f976 From 5b190d3cd2e311cf28d1fcdf93ebf08c521ab288 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 12:47:04 +0900 Subject: [PATCH 259/628] Use correct container type when removing fruit (cherry picked from commit a2be7f7) --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index e02849d0f5..c70cb15b40 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -15,6 +15,7 @@ using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; @@ -48,7 +49,7 @@ namespace osu.Game.Rulesets.Catch.UI var screenSpacePosition = fruit.ScreenSpaceDrawQuad.Centre; // todo: make this less ugly, somehow. - (fruit.Parent as Container)?.Remove(fruit); + (fruit.Parent as HitObjectContainer)?.Remove(fruit); (fruit.Parent as Container)?.Remove(fruit); fruit.RelativePositionAxes = Axes.None; From 66ebe2ee6679866d46b497a6b1318d8bc5cab5e3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 20:55:43 +0900 Subject: [PATCH 260/628] Change anchors in line with new ScrollingPlayfield implementation (cherry picked from commit 079827d) --- .../Objects/Drawable/DrawableCatchHitObject.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 41313b9197..d9a16ad248 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -21,6 +21,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable HitObject = hitObject; Scale = new Vector2(HitObject.Scale); + + Anchor = Anchor.BottomLeft; } } From 0609fc40de1ba8ba08e5126bc22c1351b027d268 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 20:56:09 +0900 Subject: [PATCH 261/628] Fix up DrawableJuiceStream/BananaShower (cherry picked from commit 0bfb3b6) --- .../Objects/Drawable/DrawableJuiceStream.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index dcb7fdb823..036c5bd879 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -16,15 +16,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public DrawableJuiceStream(JuiceStream s) : base(s) { RelativeSizeAxes = Axes.Both; - Height = (float)HitObject.Duration; + Origin = Anchor.BottomLeft; X = 0; - Child = dropletContainer = new Container - { - RelativeSizeAxes = Axes.Both, - RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), - RelativeChildSize = new Vector2(1, (float)HitObject.Duration) - }; + Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, }; foreach (CatchHitObject tick in s.NestedHitObjects.OfType()) { From 61062164cb3944efb45066132015a3a67b4d9bd0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 21:12:27 +0900 Subject: [PATCH 262/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 80bcb82ef8..6594729122 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 +Subproject commit 65947291229541de3eb1aff0e703f6968b07f976 From e5f17e3ddbd6ec793f5e618fb57f2067b376f1ad Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 21:49:20 +0900 Subject: [PATCH 263/628] Remove scale from all but palpable fruit --- .../Objects/Drawable/DrawableCatchHitObject.cs | 14 +++++++++++--- .../Objects/Drawable/DrawableDroplet.cs | 2 +- .../Objects/Drawable/DrawableFruit.cs | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index d9a16ad248..554fb1323e 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -10,6 +10,17 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Catch.Objects.Drawable { + public abstract class PalpableCatchHitObject : DrawableCatchHitObject + where TObject : CatchHitObject + { + protected PalpableCatchHitObject(TObject hitObject) + : base(hitObject) + { + Scale = new Vector2(HitObject.Scale); + } + } + + public abstract class DrawableCatchHitObject : DrawableCatchHitObject where TObject : CatchHitObject { @@ -19,9 +30,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable : base(hitObject) { HitObject = hitObject; - - Scale = new Vector2(HitObject.Scale); - Anchor = Anchor.BottomLeft; } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs index 289323c1b5..c2b0552ab3 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableDroplet.cs @@ -8,7 +8,7 @@ using OpenTK; namespace osu.Game.Rulesets.Catch.Objects.Drawable { - public class DrawableDroplet : DrawableCatchHitObject + public class DrawableDroplet : PalpableCatchHitObject { public DrawableDroplet(Droplet h) : base(h) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index c2c59468e9..ae20abf0d9 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -14,7 +14,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.Objects.Drawable { - public class DrawableFruit : DrawableCatchHitObject + public class DrawableFruit : PalpableCatchHitObject { private Circle border; From 174fdf5037f637215b4c3104e486a1ceb2657297 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 11 Jan 2018 18:51:20 +0100 Subject: [PATCH 264/628] Nicer code to remove non-existent channels from links --- osu.Game/Overlays/Chat/ChatLine.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 2382a315f5..d87f60a350 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -15,7 +15,6 @@ using osu.Game.Users; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; -using System.Collections.Generic; namespace osu.Game.Overlays.Chat { @@ -225,14 +224,8 @@ namespace osu.Game.Overlays.Chat timestamp.Text = $@"{message.Timestamp.LocalDateTime:HH:mm:ss}"; username.Text = $@"{message.Sender.Username}" + (senderHasBackground || message.IsAction ? "" : ":"); - // remove any non-existent channels from the link list - var linksToRemove = new List(); - foreach (var link in message.Links) - if (link.Action == LinkAction.OpenChannel && chat?.AvailableChannels.TrueForAll(c => c.Name != link.Argument) != false) - linksToRemove.Add(link); - - foreach (var link in linksToRemove) - message.Links.Remove(link); + // remove non-existent channels from the link list + message.Links.RemoveAll(link => link.Action == LinkAction.OpenChannel && chat?.AvailableChannels.TrueForAll(c => c.Name != link.Argument) != false); contentFlow.Clear(); contentFlow.AddLinks(message.DisplayContent, message.Links); From 2c67ff75edd699604fa612c7fd7882dcae6c782c Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 11 Jan 2018 18:52:50 +0100 Subject: [PATCH 265/628] added custom hoverclicksounds so links make sounds on hover&click --- .../Graphics/Containers/OsuClickableContainer.cs | 4 +++- osu.Game/Online/Chat/DrawableLinkCompiler.cs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuClickableContainer.cs b/osu.Game/Graphics/Containers/OsuClickableContainer.cs index 4e95050bda..b9ee1f4463 100644 --- a/osu.Game/Graphics/Containers/OsuClickableContainer.cs +++ b/osu.Game/Graphics/Containers/OsuClickableContainer.cs @@ -16,6 +16,8 @@ namespace osu.Game.Graphics.Containers protected override Container Content => content; + protected virtual HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new HoverClickSounds(sampleSet); + public OsuClickableContainer(HoverSampleSet sampleSet = HoverSampleSet.Normal) { this.sampleSet = sampleSet; @@ -33,7 +35,7 @@ namespace osu.Game.Graphics.Containers InternalChildren = new Drawable[] { content, - new HoverClickSounds(sampleSet) + CreateHoverClickSounds(sampleSet) }; } } diff --git a/osu.Game/Online/Chat/DrawableLinkCompiler.cs b/osu.Game/Online/Chat/DrawableLinkCompiler.cs index f1249031c1..234781fb52 100644 --- a/osu.Game/Online/Chat/DrawableLinkCompiler.cs +++ b/osu.Game/Online/Chat/DrawableLinkCompiler.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; using OpenTK; namespace osu.Game.Online.Chat @@ -25,6 +26,8 @@ namespace osu.Game.Online.Chat public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Parts.Any(d => d.ReceiveMouseInputAt(screenSpacePos)); + protected override HoverClickSounds CreateHoverClickSounds(HoverSampleSet sampleSet) => new LinkHoverSounds(sampleSet, Parts); + public DrawableLinkCompiler(IEnumerable parts) { Parts = parts.ToList(); @@ -39,5 +42,18 @@ namespace osu.Game.Online.Chat protected override IEnumerable EffectTargets => Parts; public string TooltipText { get; set; } + + private class LinkHoverSounds : HoverClickSounds + { + private readonly List parts; + + public LinkHoverSounds(HoverSampleSet sampleSet, List parts) + : base(sampleSet) + { + this.parts = parts; + } + + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => parts.Any(d => d.ReceiveMouseInputAt(screenSpacePos)); + } } } From 3ec93966a0fd8630a0e6026f2a149d73167db523 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 11 Jan 2018 23:39:23 +0300 Subject: [PATCH 266/628] Implement VisualSettings autohiding --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 65 +++++++++++++++------ osu.Game/Screens/Play/HUDOverlay.cs | 3 +- 2 files changed, 48 insertions(+), 20 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index 068783df34..778978d26e 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +using System; +using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Timing; @@ -17,6 +19,23 @@ namespace osu.Game.Screens.Play.HUD public IAdjustableClock AudioClock { get; set; } public FramedClock FramedClock { get; set; } + private bool autohide; + public bool Autohide + { + get => autohide; + set + { + autohide = value; + if (autohide && hideStopWatch == null) + hideStopWatch = Stopwatch.StartNew(); + else if (!autohide) + hideStopWatch = null; + } + } + + private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(5); + private Stopwatch hideStopWatch; + private readonly ReplaySliderBar dimSliderBar; private readonly ReplayCheckbox showStoryboardToggle; private readonly ReplayCheckbox mouseWheelDisabledToggle; @@ -25,19 +44,18 @@ namespace osu.Game.Screens.Play.HUD { Children = new Drawable[] { - new OsuSpriteText - { - Text = "Background dim:" - }, - dimSliderBar = new ReplaySliderBar(), - new OsuSpriteText - { - Text = "Toggles:" - }, - showStoryboardToggle = new ReplayCheckbox {LabelText = "Storyboards" }, - mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + new OsuSpriteText + { + Text = "Background dim:" + }, + dimSliderBar = new ReplaySliderBar(), + new OsuSpriteText + { + Text = "Toggles:" + }, + showStoryboardToggle = new ReplayCheckbox { LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } }; - ToggleContentVisibility(); } [BackgroundDependencyLoader] @@ -46,23 +64,34 @@ namespace osu.Game.Screens.Play.HUD dimSliderBar.Bindable = config.GetBindable(OsuSetting.DimLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); + + ToggleContentVisibility(); } protected override void ToggleContentVisibility() { base.ToggleContentVisibility(); + if (!Autohide) + return; if (Expanded) { - AudioClock?.Stop(); - if (FramedClock != null) - FramedClock.ProcessSourceClockFrames = false; + AudioClock.Stop(); + FramedClock.ProcessSourceClockFrames = false; + hideStopWatch.Stop(); } else { - AudioClock?.Start(); - if (FramedClock != null) - FramedClock.ProcessSourceClockFrames = true; + AudioClock.Start(); + FramedClock.ProcessSourceClockFrames = true; + hideStopWatch.Start(); } } + + protected override void Update() + { + base.Update(); + + if (Autohide && IsPresent && hideStopWatch.Elapsed > hideTimeSpan) this.FadeOut(100); + } } } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index be37da04cd..f677734d04 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -103,8 +103,7 @@ namespace osu.Game.Screens.Play if (!replayLoaded) { ReplaySettingsOverlay.PlaybackSettings.Hide(); - // TODO Hide VisualSettings correctly. At least, It shouldn't dissapear in expanded state. - //ReplaySettingsOverlay.VisualSettings.Delay(10000).FadeOut(200); + ReplaySettingsOverlay.VisualSettings.Autohide = true; ModDisplay.Delay(2000).FadeOut(200); } } From affbb7a8470076323c1c2b96a3dc8699f68536da Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 12 Jan 2018 00:37:28 +0300 Subject: [PATCH 267/628] Fix license header --- osu.Game/Screens/Play/HUD/VisualSettings.cs | 3 ++- osu.sln.DotSettings | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/HUD/VisualSettings.cs index 252aa8371e..15efd22eeb 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/HUD/VisualSettings.cs @@ -1,5 +1,5 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Diagnostics; @@ -20,6 +20,7 @@ namespace osu.Game.Screens.Play.HUD public FramedClock FramedClock { get; set; } private bool autohide; + public bool Autohide { get => autohide; diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 20007e3306..8767e5374a 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -598,7 +598,7 @@ </TypePattern> </Patterns> Copyright (c) 2007-$CURRENT_YEAR$ ppy Pty Ltd <contact@ppy.sh>. -Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE +Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> From 712d586d4159e1271d7b57129c4a6564637cb965 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 11 Jan 2018 13:40:46 +0900 Subject: [PATCH 268/628] Revert "Add OSD + config value for scroll speed" This reverts commit a6d8b28221910993005d6adbbcc5b0447b5a1511. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 5 +---- osu.Game/Configuration/OsuConfigManager.cs | 4 +--- osu.Game/Overlays/OnScreenDisplay.cs | 6 +----- osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs | 7 ++----- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 532be2759f..919518dbe8 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -15,7 +15,6 @@ using osu.Framework.Configuration; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Framework.Graphics.Shapes; -using osu.Game.Configuration; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.UI.Scrolling; @@ -162,10 +161,8 @@ namespace osu.Game.Rulesets.Mania.UI } [BackgroundDependencyLoader] - private void load(OsuColour colours, OsuConfigManager config) + private void load(OsuColour colours) { - config.BindWith(OsuSetting.UserScrollSpeed, VisibleTimeRange); - normalColumnColours = new List { colours.RedDark, diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 26879782fc..13213a54a1 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -73,7 +73,6 @@ namespace osu.Game.Configuration Set(OsuSetting.FloatingComments, false); Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); - Set(OsuSetting.UserScrollSpeed, 1500.0, 50.0, 10000.0); // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -120,7 +119,6 @@ namespace osu.Game.Configuration ChatDisplayHeight, Version, ShowConvertedBeatmaps, - ScrollingAlgorithm, - UserScrollSpeed + ScrollingAlgorithm } } diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 4f3f03c749..6a1bd8e182 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -14,7 +14,6 @@ using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; using osu.Framework.Extensions.Color4Extensions; -using osu.Game.Configuration; using osu.Game.Graphics.Sprites; namespace osu.Game.Overlays @@ -116,7 +115,7 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(FrameworkConfigManager frameworkConfig, OsuConfigManager osuConfig) + private void load(FrameworkConfigManager frameworkConfig) { trackSetting(frameworkConfig.GetBindable(FrameworkSetting.FrameSync), v => display(v, "Frame Limiter", v.GetDescription(), "Ctrl+F7")); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v)); @@ -136,9 +135,6 @@ namespace osu.Game.Overlays }); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter")); - - // Todo: This should be part of the ruleset-specific OSD - trackSetting(osuConfig.GetBindable(OsuSetting.UserScrollSpeed), v => display(v, "Scroll Speed", $"{v:N0}ms", "Ctrl+(+/-) to change")); } private readonly List references = new List(); diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index fa04b7f137..11185015b8 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -103,15 +102,13 @@ namespace osu.Game.Rulesets.UI.Scrolling if (state.Keyboard.ControlPressed) { - var lastValue = Transforms.OfType().LastOrDefault()?.EndValue ?? VisibleTimeRange.Value; - switch (args.Key) { case Key.Minus: - transformVisibleTimeRangeTo(lastValue + time_span_step, 200, Easing.OutQuint); + transformVisibleTimeRangeTo(VisibleTimeRange + time_span_step, 200, Easing.OutQuint); break; case Key.Plus: - transformVisibleTimeRangeTo(lastValue - time_span_step, 200, Easing.OutQuint); + transformVisibleTimeRangeTo(VisibleTimeRange - time_span_step, 200, Easing.OutQuint); break; } } From 4b2d971b005bf6e82d84d4969b248bbf55ef32b8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 13:03:47 +0900 Subject: [PATCH 269/628] Add some comments --- .../Algorithms/IScrollingAlgorithm.cs | 18 ++++++++++++++++++ .../Scrolling/ScrollingHitObjectContainer.cs | 10 +++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs index f9863bd299..d9e4ab228f 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs @@ -9,7 +9,25 @@ namespace osu.Game.Rulesets.UI.Scrolling.Algorithms { public interface IScrollingAlgorithm { + /// + /// Computes the states of s that are constant, such as lifetime and spatial length. + /// This is invoked once whenever or changes. + /// + /// The s whose states should be computed. + /// The scrolling direction. + /// The duration required to scroll through one length of the screen before any control point adjustments. + /// The length of the screen that is scrolled through. void ComputeInitialStates(IEnumerable hitObjects, ScrollingDirection direction, double timeRange, Vector2 length); + + /// + /// Computes the states of s that change depending on , such as position. + /// This is invoked once per frame. + /// + /// The s whose states should be computed. + /// The scrolling direction. + /// The current time. + /// The duration required to scroll through one length of the screen before any control point adjustments. + /// The length of the screen that is scrolled through. void ComputePositions(IEnumerable hitObjects, ScrollingDirection direction, double currentTime, double timeRange, Vector2 length); } } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index dfa6a40db4..960fd94762 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -15,12 +15,18 @@ namespace osu.Game.Rulesets.UI.Scrolling { public class ScrollingHitObjectContainer : HitObjectContainer { + /// + /// The duration required to scroll through one length of the before any control point adjustments. + /// public readonly BindableDouble TimeRange = new BindableDouble { MinValue = 0, MaxValue = double.MaxValue }; + /// + /// The control points that adjust the scrolling speed. + /// protected readonly SortedList ControlPoints = new SortedList(); private readonly ScrollingDirection direction; @@ -104,9 +110,7 @@ namespace osu.Game.Rulesets.UI.Scrolling { base.UpdateAfterChildrenLife(); - // We need to calculate this as soon as possible after lifetimes so that hitobjects - // get the final say in their positions - + // We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize); } } From 1985e5bdb23a887d7a1cc8d392f1380971843061 Mon Sep 17 00:00:00 2001 From: james58899 Date: Fri, 12 Jan 2018 12:21:37 +0800 Subject: [PATCH 270/628] fix background dim --- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 2 +- osu.Game/Screens/Play/Player.cs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 1ce84289b2..032950db4a 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -54,7 +54,7 @@ namespace osu.Game.Screens.Backgrounds Beatmap = beatmap; } - public TransformSequence BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) + public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) => background?.BlurTo(blurTarget = sigma, duration, easing); public override bool Equals(BackgroundScreen other) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c24b5e0d2a..fc8b0f2c88 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -394,9 +394,8 @@ namespace osu.Game.Screens.Play .FadeColour(OsuColour.Gray(opacity), duration, Easing.OutQuint) .FadeTo(storyboardVisible && opacity > 0 ? 1 : 0, duration, Easing.OutQuint); - (Background as BackgroundScreenBeatmap)? - .BlurTo(new Vector2((float)blurLevel.Value * 25), duration, Easing.OutQuint)? - .FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, duration, Easing.OutQuint); + (Background as BackgroundScreenBeatmap)?.BlurTo(new Vector2((float)blurLevel.Value * 25), duration, Easing.OutQuint); + Background?.FadeTo(!storyboardVisible || beatmap.Background == null ? opacity : 0, duration, Easing.OutQuint); } private void fadeOut() From 2e235660ad6a5814d4dc0d4adb2baafc249c03b7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 13:25:49 +0900 Subject: [PATCH 271/628] Fix skip button appearing below osu!mania's stage --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index c24b5e0d2a..577991c500 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -176,13 +176,13 @@ namespace osu.Game.Screens.Play }, Children = new Drawable[] { - new SkipButton(firstObjectTime) { AudioClock = decoupledClock }, new Container { RelativeSizeAxes = Axes.Both, Clock = offsetClock, Child = RulesetContainer, }, + new SkipButton(firstObjectTime) { AudioClock = decoupledClock }, hudOverlay = new HUDOverlay { Anchor = Anchor.Centre, From 61c8fd4ab94a24ea6fda301aeb92e9a18eaa7e90 Mon Sep 17 00:00:00 2001 From: james58899 Date: Fri, 12 Jan 2018 12:39:32 +0800 Subject: [PATCH 272/628] useless using --- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 032950db4a..f7042991ac 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; -using osu.Framework.Graphics.Transforms; using OpenTK; using osu.Game.Beatmaps; using osu.Game.Graphics.Backgrounds; From 057efa24c729f570b7205cacda1f72f974b53f48 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 14:26:09 +0900 Subject: [PATCH 273/628] Move a few interfaces to base classes --- osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs | 2 +- osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs index e6711923ff..aafebb61ec 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaKeyMod.cs @@ -8,7 +8,7 @@ using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Mania.Mods { - public abstract class ManiaKeyMod : Mod, IApplicableMod, IApplicableToBeatmapConverter + public abstract class ManiaKeyMod : Mod, IApplicableToBeatmapConverter { public override string ShortenedName => Name; public abstract int KeyCount { get; } diff --git a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs index 6b02a902e0..d89d6f20d8 100644 --- a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs +++ b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Mods /// Interface for a that applies changes to a . /// /// The type of converted . - public interface IApplicableToBeatmapConverter + public interface IApplicableToBeatmapConverter : IApplicableMod where TObject : HitObject { /// From 9a77005d2e443aff2b5c3edf2b94841f6bc713b6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 14:26:23 +0900 Subject: [PATCH 274/628] Make sure unimplemented auto mods aren't consumable --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 3 ++- osu.Game/Rulesets/Mods/ModAutoplay.cs | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 37525470c2..0d52046485 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -10,6 +10,7 @@ using osu.Game.Rulesets.UI; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; +using osu.Game.Rulesets.Catch.Objects; namespace osu.Game.Rulesets.Catch { @@ -80,7 +81,7 @@ namespace osu.Game.Rulesets.Catch { Mods = new Mod[] { - new ModAutoplay(), + new ModAutoplay(), new ModCinema(), }, }, diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index e8f5bb4740..a0752acb1a 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -5,23 +5,25 @@ using System; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Rulesets.Objects; +using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mods { - public abstract class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer + public class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer, IApplicableFailOverride where T : HitObject { - protected abstract Score CreateReplayScore(Beatmap beatmap); + protected virtual Score CreateReplayScore(Beatmap beatmap) => new Score { Replay = new Replay() }; - public virtual void ApplyToRulesetContainer(RulesetContainer rulesetContainer) - { - rulesetContainer.SetReplay(CreateReplayScore(rulesetContainer.Beatmap)?.Replay); - } + public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0; + + public bool AllowFail => false; + + public virtual void ApplyToRulesetContainer(RulesetContainer rulesetContainer) => rulesetContainer.SetReplay(CreateReplayScore(rulesetContainer.Beatmap)?.Replay); } - public class ModAutoplay : Mod, IApplicableFailOverride + public abstract class ModAutoplay : Mod { public override string Name => "Autoplay"; public override string ShortenedName => "AT"; @@ -29,6 +31,5 @@ namespace osu.Game.Rulesets.Mods public override string Description => "Watch a perfect automated play through the song"; public override double ScoreMultiplier => 0; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; - public bool AllowFail => false; } } From f83c84a0a6139e8789b32d4c65767b94f4d9680f Mon Sep 17 00:00:00 2001 From: james58899 Date: Fri, 12 Jan 2018 14:24:42 +0800 Subject: [PATCH 275/628] keep BlurTo --- osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index f7042991ac..1ce84289b2 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; +using osu.Framework.Graphics.Transforms; using OpenTK; using osu.Game.Beatmaps; using osu.Game.Graphics.Backgrounds; @@ -53,7 +54,7 @@ namespace osu.Game.Screens.Backgrounds Beatmap = beatmap; } - public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) + public TransformSequence BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None) => background?.BlurTo(blurTarget = sigma, duration, easing); public override bool Equals(BackgroundScreen other) From 03824eccc8f658a50551e1f592520a45aa77447c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 17:09:21 +0900 Subject: [PATCH 276/628] Block fadeout on holdnote heads --- .../Objects/Drawables/DrawableHoldNote.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 6748bc22e6..76fc0dcf77 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -186,6 +186,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables return true; } + + protected override void UpdateState(ArmedState state) + { + // The holdnote keeps scrolling through for now, so having the head disappear looks weird + } } /// From cae93a1d1f7a6d31ebc181c97766e341d3023322 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 17:09:34 +0900 Subject: [PATCH 277/628] Add comment to fade override of holdnote tail --- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 76fc0dcf77..58f024870d 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -238,6 +238,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables protected override void UpdateState(ArmedState state) { + // The holdnote keeps scrolling through, so having the tail disappear looks weird } public override bool OnPressed(ManiaAction action) => false; // Tail doesn't handle key down From 441e8aced51376ac99d153423a20de42b1a6e55e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 17:18:34 +0900 Subject: [PATCH 278/628] Better namings for the speed change "algorithms" --- osu.Game/Configuration/OsuConfigManager.cs | 4 ++-- ...pe.cs => SpeedChangeVisualisationMethod.cs} | 10 +++++----- .../Sections/Gameplay/ScrollingSettings.cs | 6 +++--- .../Scrolling/ScrollingHitObjectContainer.cs | 18 +++++++++--------- .../ISpeedChangeVisualiser.cs} | 4 ++-- .../OverlappingSpeedChangeVisualiser.cs} | 6 +++--- .../SequentialSpeedChangeVisualiser.cs} | 6 +++--- osu.Game/osu.Game.csproj | 8 ++++---- 8 files changed, 31 insertions(+), 31 deletions(-) rename osu.Game/Configuration/{ScrollingAlgorithmType.cs => SpeedChangeVisualisationMethod.cs} (57%) rename osu.Game/Rulesets/UI/Scrolling/{Algorithms/IScrollingAlgorithm.cs => Visualisers/ISpeedChangeVisualiser.cs} (93%) rename osu.Game/Rulesets/UI/Scrolling/{Algorithms/LocalScrollingAlgorithm.cs => Visualisers/OverlappingSpeedChangeVisualiser.cs} (90%) rename osu.Game/Rulesets/UI/Scrolling/{Algorithms/GlobalScrollingAlgorithm.cs => Visualisers/SequentialSpeedChangeVisualiser.cs} (92%) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 13213a54a1..23f7fd6ac1 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -72,7 +72,7 @@ namespace osu.Game.Configuration Set(OsuSetting.FloatingComments, false); - Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); + Set(OsuSetting.SpeedChangeVisualisation, SpeedChangeVisualisationMethod.Sequential); // Update Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); @@ -119,6 +119,6 @@ namespace osu.Game.Configuration ChatDisplayHeight, Version, ShowConvertedBeatmaps, - ScrollingAlgorithm + SpeedChangeVisualisation } } diff --git a/osu.Game/Configuration/ScrollingAlgorithmType.cs b/osu.Game/Configuration/SpeedChangeVisualisationMethod.cs similarity index 57% rename from osu.Game/Configuration/ScrollingAlgorithmType.cs rename to osu.Game/Configuration/SpeedChangeVisualisationMethod.cs index 8b9d292634..644ae0a727 100644 --- a/osu.Game/Configuration/ScrollingAlgorithmType.cs +++ b/osu.Game/Configuration/SpeedChangeVisualisationMethod.cs @@ -5,11 +5,11 @@ using System.ComponentModel; namespace osu.Game.Configuration { - public enum ScrollingAlgorithmType + public enum SpeedChangeVisualisationMethod { - [Description("Global")] - Global, - [Description("Local")] - Local + [Description("Sequential")] + Sequential, + [Description("Overlapping")] + Overlapping } } diff --git a/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs index 3243f4c23a..4e8706137c 100644 --- a/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Gameplay/ScrollingSettings.cs @@ -15,10 +15,10 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay { Children = new[] { - new SettingsEnumDropdown + new SettingsEnumDropdown { - LabelText = "Scrolling algorithm", - Bindable = config.GetBindable(OsuSetting.ScrollingAlgorithm), + LabelText = "Visualise speed changes as", + Bindable = config.GetBindable(OsuSetting.SpeedChangeVisualisation), } }; } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index 960fd94762..e69abec45e 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -9,7 +9,7 @@ using osu.Framework.Lists; using osu.Game.Configuration; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; -using osu.Game.Rulesets.UI.Scrolling.Algorithms; +using osu.Game.Rulesets.UI.Scrolling.Visualisers; namespace osu.Game.Rulesets.UI.Scrolling { @@ -42,18 +42,18 @@ namespace osu.Game.Rulesets.UI.Scrolling TimeRange.ValueChanged += v => initialStateCache.Invalidate(); } - private IScrollingAlgorithm scrollingAlgorithm; + private ISpeedChangeVisualiser speedChangeVisualiser; [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - switch (config.Get(OsuSetting.ScrollingAlgorithm)) + switch (config.Get(OsuSetting.SpeedChangeVisualisation)) { - case ScrollingAlgorithmType.Global: - scrollingAlgorithm = new GlobalScrollingAlgorithm(ControlPoints); + case SpeedChangeVisualisationMethod.Sequential: + speedChangeVisualiser = new SequentialSpeedChangeVisualiser(ControlPoints); break; - case ScrollingAlgorithmType.Local: - scrollingAlgorithm = new LocalScrollingAlgorithm(ControlPoints); + case SpeedChangeVisualisationMethod.Overlapping: + speedChangeVisualiser = new OverlappingSpeedChangeVisualiser(ControlPoints); break; } } @@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.UI.Scrolling if (initialStateCache.IsValid) return; - scrollingAlgorithm.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); + speedChangeVisualiser.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); initialStateCache.Validate(); } @@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.UI.Scrolling base.UpdateAfterChildrenLife(); // We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions - scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize); + speedChangeVisualiser.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize); } } } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Visualisers/ISpeedChangeVisualiser.cs similarity index 93% rename from osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs rename to osu.Game/Rulesets/UI/Scrolling/Visualisers/ISpeedChangeVisualiser.cs index d9e4ab228f..46d71e1602 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/IScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Visualisers/ISpeedChangeVisualiser.cs @@ -5,9 +5,9 @@ using System.Collections.Generic; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; -namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +namespace osu.Game.Rulesets.UI.Scrolling.Visualisers { - public interface IScrollingAlgorithm + public interface ISpeedChangeVisualiser { /// /// Computes the states of s that are constant, such as lifetime and spatial length. diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs similarity index 90% rename from osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs rename to osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs index 96a85c5f9f..24f69c627d 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/LocalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs @@ -7,15 +7,15 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Timing; using OpenTK; -namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +namespace osu.Game.Rulesets.UI.Scrolling.Visualisers { - public class LocalScrollingAlgorithm : IScrollingAlgorithm + public class OverlappingSpeedChangeVisualiser : ISpeedChangeVisualiser { private readonly Dictionary hitObjectPositions = new Dictionary(); private readonly SortedList controlPoints; - public LocalScrollingAlgorithm(SortedList controlPoints) + public OverlappingSpeedChangeVisualiser(SortedList controlPoints) { this.controlPoints = controlPoints; } diff --git a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs b/osu.Game/Rulesets/UI/Scrolling/Visualisers/SequentialSpeedChangeVisualiser.cs similarity index 92% rename from osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs rename to osu.Game/Rulesets/UI/Scrolling/Visualisers/SequentialSpeedChangeVisualiser.cs index ed156ecfd5..94705426f8 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Algorithms/GlobalScrollingAlgorithm.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Visualisers/SequentialSpeedChangeVisualiser.cs @@ -8,15 +8,15 @@ using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Timing; using OpenTK; -namespace osu.Game.Rulesets.UI.Scrolling.Algorithms +namespace osu.Game.Rulesets.UI.Scrolling.Visualisers { - public class GlobalScrollingAlgorithm : IScrollingAlgorithm + public class SequentialSpeedChangeVisualiser : ISpeedChangeVisualiser { private readonly Dictionary hitObjectPositions = new Dictionary(); private readonly IReadOnlyList controlPoints; - public GlobalScrollingAlgorithm(IReadOnlyList controlPoints) + public SequentialSpeedChangeVisualiser(IReadOnlyList controlPoints) { this.controlPoints = controlPoints; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 45183de092..01052a7898 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -265,7 +265,7 @@ - + @@ -318,9 +318,9 @@ - - - + + + From 8a04c954a90198a6c2e4b3369160a9fcd84c8dea Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 17:19:59 +0900 Subject: [PATCH 279/628] Cleanup --- .../UI/Scrolling/ScrollingHitObjectContainer.cs | 11 +++++------ .../Visualisers/OverlappingSpeedChangeVisualiser.cs | 2 -- osu.Game/osu.Game.csproj | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index e69abec45e..530ed653aa 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -98,12 +98,11 @@ namespace osu.Game.Rulesets.UI.Scrolling { base.Update(); - if (initialStateCache.IsValid) - return; - - speedChangeVisualiser.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); - - initialStateCache.Validate(); + if (!initialStateCache.IsValid) + { + speedChangeVisualiser.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); + initialStateCache.Validate(); + } } protected override void UpdateAfterChildrenLife() diff --git a/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs b/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs index 24f69c627d..4cce90ee94 100644 --- a/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs +++ b/osu.Game/Rulesets/UI/Scrolling/Visualisers/OverlappingSpeedChangeVisualiser.cs @@ -11,8 +11,6 @@ namespace osu.Game.Rulesets.UI.Scrolling.Visualisers { public class OverlappingSpeedChangeVisualiser : ISpeedChangeVisualiser { - private readonly Dictionary hitObjectPositions = new Dictionary(); - private readonly SortedList controlPoints; public OverlappingSpeedChangeVisualiser(SortedList controlPoints) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 01052a7898..967f3fc1d7 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -318,9 +318,9 @@ - - - + + + From 0a06f8069f5d6515bd7209645bff54cf85374bf9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 17:22:51 +0900 Subject: [PATCH 280/628] Remove panel fade out for now Should be implemented at one level above using a dedicated container. --- osu.Game/Overlays/SocialOverlay.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index 161ff70dc9..e61153d290 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -137,16 +137,6 @@ namespace osu.Game.Overlays }); } - private void clearPanels() - { - if (panels != null) - { - panels.FadeOut(200); - panels.Expire(); - panels = null; - } - } - private APIRequest getUsersRequest; private readonly Bindable currentQuery = new Bindable(); @@ -191,6 +181,15 @@ namespace osu.Game.Overlays recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); } + private void clearPanels() + { + if (panels != null) + { + panels.Expire(); + panels = null; + } + } + public void APIStateChanged(APIAccess api, APIState state) { switch (state) From 7f189080b91a0d8d7a082b28b023eb939c86b023 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 17:43:56 +0900 Subject: [PATCH 281/628] Move fail override back to abstract implementation --- osu.Game/Rulesets/Mods/ModAutoplay.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index a0752acb1a..3356a56c33 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -11,25 +11,24 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mods { - public class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer, IApplicableFailOverride + public class ModAutoplay : ModAutoplay, IApplicableToRulesetContainer where T : HitObject { protected virtual Score CreateReplayScore(Beatmap beatmap) => new Score { Replay = new Replay() }; public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0; - public bool AllowFail => false; - public virtual void ApplyToRulesetContainer(RulesetContainer rulesetContainer) => rulesetContainer.SetReplay(CreateReplayScore(rulesetContainer.Beatmap)?.Replay); } - public abstract class ModAutoplay : Mod + public abstract class ModAutoplay : Mod, IApplicableFailOverride { public override string Name => "Autoplay"; public override string ShortenedName => "AT"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto; public override string Description => "Watch a perfect automated play through the song"; public override double ScoreMultiplier => 0; + public bool AllowFail => false; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; } } From b55adf655f9334ad292363465b33e49d2737e144 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 17:46:24 +0900 Subject: [PATCH 282/628] Yeah, cinema mod isn't going to work --- osu.Game/Rulesets/Mods/ModCinema.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/Mods/ModCinema.cs b/osu.Game/Rulesets/Mods/ModCinema.cs index 576d29fdfb..c0480b0647 100644 --- a/osu.Game/Rulesets/Mods/ModCinema.cs +++ b/osu.Game/Rulesets/Mods/ModCinema.cs @@ -9,6 +9,7 @@ namespace osu.Game.Rulesets.Mods { public override string Name => "Cinema"; public override string ShortenedName => "CN"; + public override bool HasImplementation => false; public override FontAwesome Icon => FontAwesome.fa_osu_mod_cinema; } } From e5056e11f416fcaabdbc60d5e6bd3463c861794c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:07:40 +0900 Subject: [PATCH 283/628] Remove extra newline --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 0a1a6c7960..2d1331d30a 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -78,7 +78,6 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); - Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } } From 2bf2cc15d41863014a81d46109425e0fcce23efd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:09:37 +0900 Subject: [PATCH 284/628] Fix unnecessary osu-resources rollback --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index e01f71160f..7724abdf1d 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604 +Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 From 512e4d2c9fbf411cdf573ec3df82cc248a1aef5f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 18:13:17 +0900 Subject: [PATCH 285/628] Rewrite the way that cursor overrides are done game-wide --- .../Edit/OsuEditPlayfield.cs | 3 -- .../Edit/OsuEditRulesetContainer.cs | 3 ++ osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 15 ------ .../UI/OsuRulesetContainer.cs | 4 ++ .../Graphics/Cursor/IProvideLocalCursor.cs | 22 ++++++++ .../Graphics/Cursor/OsuCursorContainer.cs | 53 +++++++++++++++++++ osu.Game/OsuGame.cs | 4 -- osu.Game/OsuGameBase.cs | 23 +++----- osu.Game/Rulesets/UI/Playfield.cs | 5 -- osu.Game/Rulesets/UI/RulesetContainer.cs | 24 ++++++--- osu.Game/Screens/Menu/Disclaimer.cs | 7 ++- osu.Game/Screens/Menu/Intro.cs | 9 ++-- osu.Game/Screens/OsuScreen.cs | 2 - osu.Game/Screens/Play/Player.cs | 16 ++++-- osu.Game/osu.Game.csproj | 2 + 15 files changed, 132 insertions(+), 60 deletions(-) create mode 100644 osu.Game/Graphics/Cursor/IProvideLocalCursor.cs create mode 100644 osu.Game/Graphics/Cursor/OsuCursorContainer.cs diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs index a3f0b79475..5f232b1889 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs @@ -1,15 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Cursor; using osu.Game.Rulesets.Osu.UI; namespace osu.Game.Rulesets.Osu.Edit { public class OsuEditPlayfield : OsuPlayfield { - protected override CursorContainer CreateCursor() => null; - protected override bool ProxyApproachCircles => false; } } diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs index 96b9acbf78..56efc25fa5 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditRulesetContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics.Cursor; using osu.Game.Beatmaps; using osu.Game.Rulesets.Osu.UI; using osu.Game.Rulesets.UI; @@ -15,5 +16,7 @@ namespace osu.Game.Rulesets.Osu.Edit } protected override Playfield CreatePlayfield() => new OsuEditPlayfield(); + + protected override CursorContainer CreateCursor() => null; } } diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index e7d47da391..892df089f5 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -12,8 +12,6 @@ using osu.Game.Rulesets.UI; using System.Linq; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Osu.Judgements; -using osu.Game.Rulesets.Osu.UI.Cursor; -using osu.Framework.Graphics.Cursor; namespace osu.Game.Rulesets.Osu.UI { @@ -23,8 +21,6 @@ namespace osu.Game.Rulesets.Osu.UI private readonly Container judgementLayer; private readonly ConnectionRenderer connectionLayer; - public override bool ProvidingUserCursor => true; - // Todo: This should not be a thing, but is currently required for the editor // https://github.com/ppy/osu-framework/issues/1283 protected virtual bool ProxyApproachCircles => true; @@ -70,15 +66,6 @@ namespace osu.Game.Rulesets.Osu.UI }); } - protected override void LoadComplete() - { - base.LoadComplete(); - - var cursor = CreateCursor(); - if (cursor != null) - AddInternal(cursor); - } - public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; @@ -113,7 +100,5 @@ namespace osu.Game.Rulesets.Osu.UI judgementLayer.Add(explosion); } - - protected virtual CursorContainer CreateCursor() => new GameplayCursor(); } } diff --git a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs index 5c7413a71e..526348062f 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuRulesetContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using OpenTK; using osu.Game.Beatmaps; @@ -10,6 +11,7 @@ using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Rulesets.Osu.Replays; using osu.Game.Rulesets.Osu.Scoring; +using osu.Game.Rulesets.Osu.UI.Cursor; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.Replays; @@ -49,5 +51,7 @@ namespace osu.Game.Rulesets.Osu.UI protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay); protected override Vector2 GetPlayfieldAspectAdjust() => new Vector2(0.75f); + + protected override CursorContainer CreateCursor() => new GameplayCursor(); } } diff --git a/osu.Game/Graphics/Cursor/IProvideLocalCursor.cs b/osu.Game/Graphics/Cursor/IProvideLocalCursor.cs new file mode 100644 index 0000000000..61631b1220 --- /dev/null +++ b/osu.Game/Graphics/Cursor/IProvideLocalCursor.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Cursor; + +namespace osu.Game.Graphics.Cursor +{ + public interface IProvideLocalCursor : IDrawable + { + /// + /// The cursor provided by this . + /// + CursorContainer LocalCursor { get; } + + /// + /// Whether the cursor provided by this should be displayed. + /// If this is false, a cursor occurring earlier in the draw hierarchy will be displayed instead. + /// + bool ProvidesUserCursor { get; } + } +} diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs new file mode 100644 index 0000000000..ca6b6085c2 --- /dev/null +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -0,0 +1,53 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Input; + +namespace osu.Game.Graphics.Cursor +{ + public class OsuCursorContainer : Container, IProvideLocalCursor + { + protected override Container Content => content; + private readonly Container content; + + public CursorContainer LocalCursor { get; } + public bool ProvidesUserCursor => true; + + public OsuCursorContainer() + { + AddRangeInternal(new Drawable[] + { + LocalCursor = new MenuCursor { State = Visibility.Hidden }, + content = new Container { RelativeSizeAxes = Axes.Both } + }); + } + + private InputManager inputManager; + + protected override void LoadComplete() + { + base.LoadComplete(); + inputManager = GetContainingInputManager(); + } + + private IProvideLocalCursor currentTarget; + protected override void Update() + { + base.Update(); + + var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidesUserCursor) ?? this; + + if (currentTarget == newTarget) + return; + + currentTarget?.LocalCursor?.Hide(); + newTarget.LocalCursor?.Show(); + + currentTarget = newTarget; + } + } +} diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 5604ef8f3c..f0edcbbc6b 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -297,8 +297,6 @@ namespace osu.Game else Toolbar.State = Visibility.Visible; }; - - Cursor.State = Visibility.Hidden; } private void forwardLoggedErrorsToNotifications() @@ -446,8 +444,6 @@ namespace osu.Game Beatmap.Disabled = applyRestrictions; mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; - - Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden; } private void screenAdded(Screen newScreen) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 1982fa0db5..ff9264c598 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -52,8 +52,6 @@ namespace osu.Game protected override Container Content => content; - protected MenuCursor Cursor; - public Bindable Beatmap { get; private set; } private Bindable fpsDisplayVisible; @@ -211,21 +209,14 @@ namespace osu.Game GlobalKeyBindingInputManager globalBinding; - base.Content.Add(new DrawSizePreservingFillContainer + var cursorContainer = new OsuCursorContainer { RelativeSizeAxes = Axes.Both }; + cursorContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) { - Children = new Drawable[] - { - Cursor = new MenuCursor(), - globalBinding = new GlobalKeyBindingInputManager(this) - { - RelativeSizeAxes = Axes.Both, - Child = content = new OsuTooltipContainer(Cursor) - { - RelativeSizeAxes = Axes.Both, - } - } - } - }); + RelativeSizeAxes = Axes.Both, + Child = content = new OsuTooltipContainer(cursorContainer.LocalCursor) { RelativeSizeAxes = Axes.Both } + }; + + base.Content.Add(new DrawSizePreservingFillContainer { Child = cursorContainer }); KeyBindingStore.Register(globalBinding); dependencies.Cache(globalBinding); diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 6274301a47..e60ac00588 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -22,11 +22,6 @@ namespace osu.Game.Rulesets.UI public Container ScaledContent; - /// - /// Whether we are currently providing the local user a gameplay cursor. - /// - public virtual bool ProvidingUserCursor => false; - protected override Container Content => content; private readonly Container content; diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 4d559549b7..40f88ce577 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -13,6 +13,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; @@ -43,11 +44,6 @@ namespace osu.Game.Rulesets.UI /// public PassThroughInputManager KeyBindingInputManager; - /// - /// Whether we are currently providing the local user a gameplay cursor. - /// - public virtual bool ProvidingUserCursor => false; - /// /// Whether we have a replay loaded currently. /// @@ -61,6 +57,11 @@ namespace osu.Game.Rulesets.UI /// public Playfield Playfield => playfield.Value; + /// + /// The cursor provided by this . May be null if no cursor is provided. + /// + public readonly CursorContainer Cursor; + protected readonly Ruleset Ruleset; /// @@ -71,6 +72,8 @@ namespace osu.Game.Rulesets.UI { Ruleset = ruleset; playfield = new Lazy(CreatePlayfield); + + Cursor = CreateCursor(); } public abstract ScoreProcessor CreateScoreProcessor(); @@ -98,6 +101,12 @@ namespace osu.Game.Rulesets.UI ReplayInputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null; } + + /// + /// Creates the cursor. May be null if the doesn't provide a custom cursor. + /// + protected virtual CursorContainer CreateCursor() => null; + /// /// Creates a Playfield. /// @@ -144,8 +153,6 @@ namespace osu.Game.Rulesets.UI /// protected readonly bool IsForCurrentRuleset; - public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor; - public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor(this); protected override Container Content => content; @@ -212,6 +219,9 @@ namespace osu.Game.Rulesets.UI AddInternal(KeyBindingInputManager); KeyBindingInputManager.Add(Playfield); + if (Cursor != null) + KeyBindingInputManager.Add(Cursor); + loadObjects(); } diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 977c8828d2..a54abe8cf1 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -9,10 +9,12 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Game.Graphics.Cursor; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Screens.Menu { - public class Disclaimer : OsuScreen + public class Disclaimer : OsuScreen, IProvideLocalCursor { private Intro intro; private readonly SpriteIcon icon; @@ -20,7 +22,8 @@ namespace osu.Game.Screens.Menu public override bool ShowOverlaysOnEnter => false; - public override bool HasLocalCursorDisplayed => true; + public CursorContainer LocalCursor => null; + public bool ProvidesUserCursor => true; public Disclaimer() { diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index fcee071f04..5fac56fafb 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -15,10 +15,12 @@ using osu.Game.Configuration; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; +using osu.Game.Graphics.Cursor; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Screens.Menu { - public class Intro : OsuScreen + public class Intro : OsuScreen, IProvideLocalCursor { private const string menu_music_beatmap_hash = "3c8b1fcc9434dbb29e2fb613d3b9eada9d7bb6c125ceb32396c3b53437280c83"; @@ -31,10 +33,11 @@ namespace osu.Game.Screens.Menu private SampleChannel welcome; private SampleChannel seeya; - public override bool HasLocalCursorDisplayed => true; - public override bool ShowOverlaysOnEnter => false; + public CursorContainer LocalCursor => null; + public bool ProvidesUserCursor => true; + protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); private Bindable menuVoice; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 0111dceb40..48ca4d5907 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -37,8 +37,6 @@ namespace osu.Game.Screens protected new OsuGameBase Game => base.Game as OsuGameBase; - public virtual bool HasLocalCursorDisplayed => false; - private OsuLogo logo; /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 577991c500..a2d1d161c4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -23,22 +23,22 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Framework.Audio.Sample; +using osu.Framework.Graphics.Cursor; using osu.Game.Beatmaps; using osu.Game.Graphics; +using osu.Game.Graphics.Cursor; using osu.Game.Online.API; using osu.Game.Screens.Play.BreaksOverlay; using osu.Game.Storyboards.Drawables; namespace osu.Game.Screens.Play { - public class Player : OsuScreen + public class Player : OsuScreen, IProvideLocalCursor { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); public override bool ShowOverlaysOnEnter => false; - public override bool HasLocalCursorDisplayed => !pauseContainer.IsPaused && !HasFailed && RulesetContainer.ProvidingUserCursor; - public Action RestartRequested; public override bool AllowBeatmapRulesetChange => false; @@ -51,6 +51,9 @@ namespace osu.Game.Screens.Play public int RestartCount; + public CursorContainer LocalCursor => RulesetContainer.Cursor; + public bool ProvidesUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded; + private IAdjustableClock adjustableSourceClock; private FramedOffsetClock offsetClock; private DecoupleableInterpolatingFramedClock decoupledClock; @@ -152,6 +155,12 @@ namespace osu.Game.Screens.Play userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); + // We want the cursor to be above everything (including the skip button), but still be able to be controlled + // by the ruleset's input manager and replay, so we need to proxy it out from the ruleset container + var cursorProxyContainer = new Container { RelativeSizeAxes = Axes.Both }; + if (RulesetContainer.Cursor != null) + cursorProxyContainer.Add(RulesetContainer.Cursor.CreateProxy()); + Children = new Drawable[] { storyboardContainer = new Container @@ -195,6 +204,7 @@ namespace osu.Game.Screens.Play Clock = decoupledClock, Breaks = beatmap.Breaks }, + cursorProxyContainer } }, failOverlay = new FailOverlay diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index f87f664199..b87c1a0c6e 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -374,8 +374,10 @@ + + From 8ed24e1bca2e750b16cdb0acfeffe9b7eddccbc9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:15:53 +0900 Subject: [PATCH 286/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 6594729122..a6090d3f6f 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 65947291229541de3eb1aff0e703f6968b07f976 +Subproject commit a6090d3f6f03eaf9a3f643cf1ef3db96384c62ff From ff725f0e32f8acd3c5ac9100d8e21d8d6a5c9082 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:17:32 +0900 Subject: [PATCH 287/628] Fix incorrect online conditional check in social browser logic --- osu.Game/Overlays/SocialOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/SocialOverlay.cs b/osu.Game/Overlays/SocialOverlay.cs index e61153d290..ddcb933e5d 100644 --- a/osu.Game/Overlays/SocialOverlay.cs +++ b/osu.Game/Overlays/SocialOverlay.cs @@ -155,7 +155,7 @@ namespace osu.Game.Overlays loading.Hide(); getUsersRequest?.Cancel(); - if (api?.IsLoggedIn == false) + if (api?.IsLoggedIn != true) return; switch (Header.Tabs.Current.Value) From a6c6523a86e8549e98c298f99f20481562797ae5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 18:21:17 +0900 Subject: [PATCH 288/628] Make SkipButton an OverlayContainer to use the menu cursor --- osu.Game/Screens/Play/SkipButton.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 55b2e21c53..827d77a73a 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -21,7 +21,7 @@ using osu.Game.Input.Bindings; namespace osu.Game.Screens.Play { - public class SkipButton : Container, IKeyBindingHandler + public class SkipButton : OverlayContainer, IKeyBindingHandler { private readonly double startTime; public IAdjustableClock AudioClock; @@ -36,6 +36,8 @@ namespace osu.Game.Screens.Play { this.startTime = startTime; + State = Visibility.Visible; + RelativePositionAxes = Axes.Both; RelativeSizeAxes = Axes.Both; @@ -112,6 +114,16 @@ namespace osu.Game.Screens.Play Expire(); } + protected override void PopIn() + { + this.FadeIn(); + } + + protected override void PopOut() + { + this.FadeOut(); + } + protected override void Update() { base.Update(); From 1c3c90bac6886e2757bba11b1c458d2b4aad92f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 4 Jan 2018 18:32:16 +0900 Subject: [PATCH 289/628] Add banana design (cherry picked from commit 6961ca2) --- .../Objects/Drawable/DrawableFruit.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index ae20abf0d9..93a1483f6f 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -243,6 +243,27 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable }, } }; + case FruitVisualRepresentation.Banana: + return new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Framework.Graphics.Drawable[] + { + new Pulp + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + AccentColour = AccentColour, + Size = new Vector2(small_pulp), + Y = -0.15f + }, + new Pulp + { + AccentColour = AccentColour, + Size = new Vector2(large_pulp_4 * 1.2f, large_pulp_4 * 3), + }, + } + }; } } From a36cfd426532ed148cbcd0088f8babf89d6ea49e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 14:52:22 +0900 Subject: [PATCH 290/628] Add BananaShower models and representations (cherry picked from commit e12e095) --- .../Objects/BananaShower.cs | 61 +++++++++++++++++++ .../Objects/Drawable/DrawableBananaShower.cs | 40 ++++++++++++ .../Tests/TestCaseBananaShower.cs | 38 ++++++++++++ .../UI/CatchRulesetContainer.cs | 16 ++--- .../osu.Game.Rulesets.Catch.csproj | 3 + 5 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 osu.Game.Rulesets.Catch/Objects/BananaShower.cs create mode 100644 osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs create mode 100644 osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs diff --git a/osu.Game.Rulesets.Catch/Objects/BananaShower.cs b/osu.Game.Rulesets.Catch/Objects/BananaShower.cs new file mode 100644 index 0000000000..cb0f4eab96 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Objects/BananaShower.cs @@ -0,0 +1,61 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.MathUtils; +using osu.Game.Rulesets.Objects.Types; +using OpenTK.Graphics; + +namespace osu.Game.Rulesets.Catch.Objects +{ + public class BananaShower : CatchHitObject, IHasEndTime + { + public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana; + + protected override void CreateNestedHitObjects() + { + base.CreateNestedHitObjects(); + createBananas(); + } + + private void createBananas() + { + double spacing = Duration; + while (spacing > 100) + spacing /= 2; + + if (spacing <= 0) + return; + + for (double i = StartTime; i <= EndTime; i += spacing) + AddNested(new Banana + { + Samples = Samples, + ComboColour = getNextComboColour(), + StartTime = i, + X = RNG.NextSingle() + }); + } + + private Color4 getNextComboColour() + { + switch (RNG.Next(0, 3)) + { + default: + return new Color4(255, 240, 0, 255); + case 1: + return new Color4(255, 192, 0, 255); + case 2: + return new Color4(214, 221, 28, 255); + } + } + + public double EndTime => StartTime + Duration; + + public double Duration { get; set; } + + public class Banana : Fruit + { + public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana; + } + } +} diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs new file mode 100644 index 0000000000..ff787d80e9 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using OpenTK; +using osu.Game.Rulesets.Objects.Drawables; + +namespace osu.Game.Rulesets.Catch.Objects.Drawable +{ + public class DrawableBananaShower : DrawableCatchHitObject + { + private readonly Container dropletContainer; + + public DrawableBananaShower(BananaShower s) : base(s) + { + RelativeSizeAxes = Axes.Both; + Height = (float)HitObject.Duration; + X = 0; + + Child = dropletContainer = new Container + { + RelativeSizeAxes = Axes.Both, + RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), + RelativeChildSize = new Vector2(1, (float)HitObject.Duration) + }; + + foreach (var b in s.NestedHitObjects.OfType()) + AddNested(new DrawableFruit(b)); + } + + protected override void AddNested(DrawableHitObject h) + { + ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; + dropletContainer.Add(h); + base.AddNested(h); + } + } +} diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs new file mode 100644 index 0000000000..4499905560 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs @@ -0,0 +1,38 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; + +namespace osu.Game.Rulesets.Catch.Tests +{ + [TestFixture] + [Ignore("getting CI working")] + public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer + { + public TestCaseBananaShower() + : base(typeof(CatchRuleset)) + { + } + + protected override Beatmap CreateBeatmap() + { + var beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BaseDifficulty = new BeatmapDifficulty + { + CircleSize = 6, + } + } + }; + + for (int i = 0; i < 10; i++) + beatmap.HitObjects.Add(new BananaShower { StartTime = i * 1200, Duration = 1000, NewCombo = i % 2 == 0 }); + + return beatmap; + } + } +} diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index a146014ca4..076487a5e2 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -33,13 +33,15 @@ namespace osu.Game.Rulesets.Catch.UI protected override DrawableHitObject GetVisualRepresentation(CatchHitObject h) { - var fruit = h as Fruit; - if (fruit != null) - return new DrawableFruit(fruit); - - var stream = h as JuiceStream; - if (stream != null) - return new DrawableJuiceStream(stream); + switch (h) + { + case Fruit fruit: + return new DrawableFruit(fruit); + case JuiceStream stream: + return new DrawableJuiceStream(stream); + case BananaShower banana: + return new DrawableBananaShower(banana); + } return null; } diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 566ec385fc..50fbc8b6a2 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -60,6 +60,8 @@ + + @@ -73,6 +75,7 @@ + From 5c79bdc41c613ac3c9db32004abfe092f4e8e655 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 15:37:55 +0900 Subject: [PATCH 291/628] Use switch pattern matching in more places Also switch access to many classes to public. (cherry picked from commit 86cc3b7) --- .../Beatmaps/CatchBeatmapProcessor.cs | 2 +- .../Objects/Drawable/DrawableJuiceStream.cs | 28 ++++++++--------- .../Scoring/CatchScoreProcessor.cs | 30 ++++++++++--------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs index f601ce624d..d3012b1981 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs @@ -12,7 +12,7 @@ using OpenTK; namespace osu.Game.Rulesets.Catch.Beatmaps { - internal class CatchBeatmapProcessor : BeatmapProcessor + public class CatchBeatmapProcessor : BeatmapProcessor { public override void PostProcess(Beatmap beatmap) { diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index 036c5bd879..2955b51044 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using OpenTK; @@ -13,7 +12,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { private readonly Container dropletContainer; - public DrawableJuiceStream(JuiceStream s) : base(s) + public DrawableJuiceStream(JuiceStream s) + : base(s) { RelativeSizeAxes = Axes.Both; Origin = Anchor.BottomLeft; @@ -21,22 +21,20 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, }; - foreach (CatchHitObject tick in s.NestedHitObjects.OfType()) + foreach (var tick in s.NestedHitObjects) { - TinyDroplet tiny = tick as TinyDroplet; - if (tiny != null) + switch (tick) { - AddNested(new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) }); - continue; + case TinyDroplet tiny: + AddNested(new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) }); + break; + case Droplet droplet: + AddNested(new DrawableDroplet(droplet)); + break; + case Fruit fruit: + AddNested(new DrawableFruit(fruit)); + break; } - - Droplet droplet = tick as Droplet; - if (droplet != null) - AddNested(new DrawableDroplet(droplet)); - - Fruit fruit = tick as Fruit; - if (fruit != null) - AddNested(new DrawableFruit(fruit)); } } diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index a6dc1350be..6df9498881 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -10,7 +10,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Catch.Scoring { - internal class CatchScoreProcessor : ScoreProcessor + public class CatchScoreProcessor : ScoreProcessor { public CatchScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) @@ -21,23 +21,25 @@ namespace osu.Game.Rulesets.Catch.Scoring { foreach (var obj in beatmap.HitObjects) { - var stream = obj as JuiceStream; - - if (stream != null) + switch (obj) { - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - - foreach (var unused in stream.NestedHitObjects.OfType()) + case JuiceStream stream: + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - continue; + foreach (var _ in stream.NestedHitObjects.Cast()) + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + break; + case BananaShower shower: + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + + foreach (var _ in shower.NestedHitObjects.Cast()) + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + break; + case Fruit _: + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + break; } - - var fruit = obj as Fruit; - - if (fruit != null) - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); } base.SimulateAutoplay(beatmap); From 5b150730107888fd4e39f881a3a05d7fe3c1fb24 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 15:38:12 +0900 Subject: [PATCH 292/628] Add actual banana conversion/reading (cherry picked from commit d353158) --- .../Beatmaps/CatchBeatmapConverter.cs | 16 +++++++++++++++- .../Objects/Drawable/DrawableBananaShower.cs | 8 ++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs index dadb852654..01aa7abb9f 100644 --- a/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs +++ b/osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs @@ -11,7 +11,7 @@ using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Catch.Beatmaps { - internal class CatchBeatmapConverter : BeatmapConverter + public class CatchBeatmapConverter : BeatmapConverter { protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; @@ -20,6 +20,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps var curveData = obj as IHasCurve; var positionData = obj as IHasXPosition; var comboData = obj as IHasCombo; + var endTime = obj as IHasEndTime; if (positionData == null) yield break; @@ -42,6 +43,19 @@ namespace osu.Game.Rulesets.Catch.Beatmaps yield break; } + if (endTime != null) + { + yield return new BananaShower + { + StartTime = obj.StartTime, + Samples = obj.Samples, + Duration = endTime.Duration, + NewCombo = comboData?.NewCombo ?? false + }; + + yield break; + } + yield return new Fruit { StartTime = obj.StartTime, diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs index ff787d80e9..0bbf12bfcc 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { public class DrawableBananaShower : DrawableCatchHitObject { - private readonly Container dropletContainer; + private readonly Container bananaContainer; public DrawableBananaShower(BananaShower s) : base(s) { @@ -19,21 +19,21 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Height = (float)HitObject.Duration; X = 0; - Child = dropletContainer = new Container + Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both, RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), RelativeChildSize = new Vector2(1, (float)HitObject.Duration) }; - foreach (var b in s.NestedHitObjects.OfType()) + foreach (var b in s.NestedHitObjects.Cast()) AddNested(new DrawableFruit(b)); } protected override void AddNested(DrawableHitObject h) { ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; - dropletContainer.Add(h); + bananaContainer.Add(h); base.AddNested(h); } } From 26fedd7e61cac1145b92e3e32c6016c30b8f5d23 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 16:58:20 +0900 Subject: [PATCH 293/628] Update in line with upstream changes (cherry picked from commit 2b6d991) --- .../Objects/Drawable/DrawableBananaShower.cs | 7 ++++--- .../Tests/TestCaseBananaShower.cs | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs index 0bbf12bfcc..b38880a8c3 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -13,13 +13,14 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { private readonly Container bananaContainer; - public DrawableBananaShower(BananaShower s) : base(s) + public DrawableBananaShower(BananaShower s) + : base(s) { RelativeSizeAxes = Axes.Both; Height = (float)HitObject.Duration; X = 0; - Child = bananaContainer = new Container + Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both, RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), @@ -27,7 +28,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable }; foreach (var b in s.NestedHitObjects.Cast()) - AddNested(new DrawableFruit(b)); + AddNested(new DrawableFruit(b)); } protected override void AddNested(DrawableHitObject h) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs index 4499905560..aae36beb57 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs @@ -1,9 +1,13 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Collections.Generic; using NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Catch.UI; namespace osu.Game.Rulesets.Catch.Tests { @@ -11,8 +15,17 @@ namespace osu.Game.Rulesets.Catch.Tests [Ignore("getting CI working")] public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(BananaShower), + typeof(DrawableBananaShower), + + typeof(CatchRuleset), + typeof(CatchRulesetContainer), + }; + public TestCaseBananaShower() - : base(typeof(CatchRuleset)) + : base(new CatchRuleset()) { } From 3b929ffd21035432d09ea8dc029150bc4194e54e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 10 Jan 2018 19:18:03 +0900 Subject: [PATCH 294/628] Make test more useful (cherry picked from commit 5985115) --- osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs index aae36beb57..4f183c3ebc 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs @@ -42,8 +42,7 @@ namespace osu.Game.Rulesets.Catch.Tests } }; - for (int i = 0; i < 10; i++) - beatmap.HitObjects.Add(new BananaShower { StartTime = i * 1200, Duration = 1000, NewCombo = i % 2 == 0 }); + beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 10000, NewCombo = true }); return beatmap; } From 9e3091bfe9c78c466b3044316c408340596f0537 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 11 Jan 2018 13:41:50 +0900 Subject: [PATCH 295/628] Change anchors in line with new ScrollingPlayfield implementation (cherry picked from commit 079827d) --- .../Objects/Drawable/DrawableBananaShower.cs | 14 ++++---------- .../Tests/TestCaseBananaShower.cs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs index b38880a8c3..b5d9163a50 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -4,7 +4,6 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using OpenTK; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Catch.Objects.Drawable @@ -16,22 +15,17 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public DrawableBananaShower(BananaShower s) : base(s) { - RelativeSizeAxes = Axes.Both; - Height = (float)HitObject.Duration; + RelativeSizeAxes = Axes.X; + Origin = Anchor.BottomLeft; X = 0; - Child = bananaContainer = new Container - { - RelativeSizeAxes = Axes.Both, - RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime), - RelativeChildSize = new Vector2(1, (float)HitObject.Duration) - }; + Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both }; foreach (var b in s.NestedHitObjects.Cast()) AddNested(new DrawableFruit(b)); } - protected override void AddNested(DrawableHitObject h) + protected override void AddNested(DrawableHitObject h) { ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; bananaContainer.Add(h); diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs index 4f183c3ebc..6bf5b6beca 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Catch.Tests } }; - beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 10000, NewCombo = true }); + beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 500, NewCombo = true }); return beatmap; } From 33fdc2c1d6210898150726457adfe62e48509937 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:35:28 +0900 Subject: [PATCH 296/628] Add very basic replay handling --- osu.Game.Rulesets.Catch/CatchInputManager.cs | 3 +- osu.Game.Rulesets.Catch/CatchRuleset.cs | 2 +- .../Mods/CatchModAutoplay.cs | 24 +++++++++ .../Replays/CatchAutoGenerator.cs | 54 +++++++++++++++++++ .../Replays/CatchFramedReplayInputHandler.cs | 32 +++++++++++ .../Replays/CatchReplayFrame.cs | 17 ++++++ .../UI/CatchRulesetContainer.cs | 4 ++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 17 +++++- .../osu.Game.Rulesets.Catch.csproj | 4 ++ 9 files changed, 154 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Rulesets.Catch/Mods/CatchModAutoplay.cs create mode 100644 osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs create mode 100644 osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs create mode 100644 osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs diff --git a/osu.Game.Rulesets.Catch/CatchInputManager.cs b/osu.Game.Rulesets.Catch/CatchInputManager.cs index d1851d31bf..f57952f95e 100644 --- a/osu.Game.Rulesets.Catch/CatchInputManager.cs +++ b/osu.Game.Rulesets.Catch/CatchInputManager.cs @@ -22,6 +22,7 @@ namespace osu.Game.Rulesets.Catch [Description("Move right")] MoveRight, [Description("Engage dash")] - Dash + Dash, + PositionUpdate } } diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 0d52046485..08bc94863b 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.Catch { Mods = new Mod[] { - new ModAutoplay(), + new CatchModAutoplay(), new ModCinema(), }, }, diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModAutoplay.cs b/osu.Game.Rulesets.Catch/Mods/CatchModAutoplay.cs new file mode 100644 index 0000000000..8ff08ab825 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Mods/CatchModAutoplay.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.Replays; +using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.Scoring; +using osu.Game.Users; + +namespace osu.Game.Rulesets.Catch.Mods +{ + public class CatchModAutoplay : ModAutoplay + { + protected override Score CreateReplayScore(Beatmap beatmap) + { + return new Score + { + User = new User { Username = "osu!salad!" }, + Replay = new CatchAutoGenerator(beatmap).Generate(), + }; + } + } +} diff --git a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs new file mode 100644 index 0000000000..bc53e6e869 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs @@ -0,0 +1,54 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Replays; +using osu.Game.Users; + +namespace osu.Game.Rulesets.Catch.Replays +{ + internal class CatchAutoGenerator : AutoGenerator + { + public const double RELEASE_DELAY = 20; + + public CatchAutoGenerator(Beatmap beatmap) + : base(beatmap) + { + Replay = new Replay { User = new User { Username = @"Autoplay" } }; + } + + protected Replay Replay; + + public override Replay Generate() + { + // Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled + Replay.Frames.Add(new CatchReplayFrame(-100000, 0)); + + foreach (var obj in Beatmap.HitObjects) + { + switch (obj) + { + case Fruit _: + Replay.Frames.Add(new CatchReplayFrame(obj.StartTime, obj.X)); + break; + } + + foreach (var nestedObj in obj.NestedHitObjects.Cast()) + { + switch (nestedObj) + { + case BananaShower.Banana _: + case TinyDroplet _: + case Droplet _: + Replay.Frames.Add(new CatchReplayFrame(nestedObj.StartTime, nestedObj.X)); + break; + } + } + } + + return Replay; + } + } +} diff --git a/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs new file mode 100644 index 0000000000..146e31fa69 --- /dev/null +++ b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using osu.Framework.Input; +using osu.Game.Rulesets.Replays; + +namespace osu.Game.Rulesets.Catch.Replays +{ + public class CatchFramedReplayInputHandler : FramedReplayInputHandler + { + public CatchFramedReplayInputHandler(Replay replay) + : base(replay) + { + } + + public override List GetPendingStates() => new List + { + new CatchReplayState + { + PressedActions = new List { CatchAction.PositionUpdate }, + CatcherX = ((CatchReplayFrame)CurrentFrame).MouseX + }, + new CatchReplayState { PressedActions = new List() }, + }; + + public class CatchReplayState : ReplayState + { + public float? CatcherX { get; set; } + } + } +} diff --git a/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs b/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs new file mode 100644 index 0000000000..c47f60ec3c --- /dev/null +++ b/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Replays; + +namespace osu.Game.Rulesets.Catch.Replays +{ + public class CatchReplayFrame : ReplayFrame + { + public override bool IsImportant => MouseX > 0; + + public CatchReplayFrame(double time, float? x = null) + : base(time, x ?? -1, null, ReplayButtonState.None) + { + } + } +} diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index a146014ca4..08808a445e 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -6,8 +6,10 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Beatmaps; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Catch.Scoring; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI.Scrolling; @@ -23,6 +25,8 @@ namespace osu.Game.Rulesets.Catch.UI public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this); + protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay); + protected override BeatmapProcessor CreateBeatmapProcessor() => new CatchBeatmapProcessor(); protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index c70cb15b40..1837086d9c 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -13,6 +13,7 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects.Drawable; +using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI; @@ -21,7 +22,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.UI { - public class CatcherArea : Container + public class CatcherArea : Container, IKeyBindingHandler { public const float CATCHER_SIZE = 172; @@ -72,6 +73,20 @@ namespace osu.Game.Rulesets.Catch.UI } } + public bool OnPressed(CatchAction action) + { + if (action != CatchAction.PositionUpdate) return false; + + CatchFramedReplayInputHandler.CatchReplayState state = (CatchFramedReplayInputHandler.CatchReplayState)GetContainingInputManager().CurrentState; + + if (state.CatcherX.HasValue) + MovableCatcher.X = state.CatcherX.Value; + + return true; + } + + public bool OnReleased(CatchAction action) => false; + public bool AttemptCatch(CatchHitObject obj) => MovableCatcher.AttemptCatch(obj); public class Catcher : Container, IKeyBindingHandler diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 566ec385fc..4d17fa6570 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -60,11 +60,15 @@ + + + + From 98894f010fada7224403248726d90825ccf64844 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 18:57:53 +0900 Subject: [PATCH 297/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 80bcb82ef8..49b563e2cf 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 80bcb82ef8d2e1af1ce077f4a037b6d279ad9e74 +Subproject commit 49b563e2cf170eb19006b98dd5b69c2398362d9e From 5952f1e7f19e3bf7b029aba917becf7f9536b5df Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:34:14 +0900 Subject: [PATCH 298/628] Adjust transforms for cursor transitions --- osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs | 12 ++++++++++++ osu.Game/Graphics/Cursor/MenuCursor.cs | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs index 325f22f425..0aeb14514d 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/GameplayCursor.cs @@ -159,5 +159,17 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor return false; } + + protected override void PopIn() + { + ActiveCursor.FadeTo(1, 250, Easing.OutQuint); + ActiveCursor.ScaleTo(1, 400, Easing.OutQuint); + } + + protected override void PopOut() + { + ActiveCursor.FadeTo(0, 250, Easing.OutQuint); + ActiveCursor.ScaleTo(0.6f, 250, Easing.In); + } } } diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index 39af99f02e..0de6279b2e 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -99,8 +99,8 @@ namespace osu.Game.Graphics.Cursor protected override void PopOut() { - ActiveCursor.FadeTo(0, 900, Easing.OutQuint); - ActiveCursor.ScaleTo(0, 500, Easing.In); + ActiveCursor.FadeTo(0, 250, Easing.OutQuint); + ActiveCursor.ScaleTo(0.6f, 250, Easing.In); } [BackgroundDependencyLoader] From 620e125fad1a47e6a7f196d90bac84928647fa42 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:34:55 +0900 Subject: [PATCH 299/628] Fix cursor being displayed on intro/disclaimer --- osu.Game/Graphics/Cursor/OsuCursorContainer.cs | 11 +++++++++++ osu.Game/OsuGame.cs | 2 ++ osu.Game/OsuGameBase.cs | 10 ++++++---- osu.Game/Screens/Menu/Disclaimer.cs | 8 ++------ osu.Game/Screens/Menu/Intro.cs | 8 ++------ osu.Game/Screens/OsuScreen.cs | 5 +++++ 6 files changed, 28 insertions(+), 16 deletions(-) diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index ca6b6085c2..8a25c9c587 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -14,6 +14,11 @@ namespace osu.Game.Graphics.Cursor protected override Container Content => content; private readonly Container content; + /// + /// Whether any cursors can be displayed. + /// + public bool CanShowCursor; + public CursorContainer LocalCursor { get; } public bool ProvidesUserCursor => true; @@ -39,6 +44,12 @@ namespace osu.Game.Graphics.Cursor { base.Update(); + if (!CanShowCursor) + { + currentTarget?.LocalCursor?.Hide(); + return; + } + var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidesUserCursor) ?? this; if (currentTarget == newTarget) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f0edcbbc6b..fb20fd57fa 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -444,6 +444,8 @@ namespace osu.Game Beatmap.Disabled = applyRestrictions; mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; + + CursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; } private void screenAdded(Screen newScreen) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ff9264c598..c88ffd3739 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,6 +44,8 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; + protected OsuCursorContainer CursorContainer; + protected override string MainResourceFile => @"osu.Game.Resources.dll"; public APIAccess API; @@ -209,14 +211,14 @@ namespace osu.Game GlobalKeyBindingInputManager globalBinding; - var cursorContainer = new OsuCursorContainer { RelativeSizeAxes = Axes.Both }; - cursorContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) + CursorContainer = new OsuCursorContainer { RelativeSizeAxes = Axes.Both }; + CursorContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) { RelativeSizeAxes = Axes.Both, - Child = content = new OsuTooltipContainer(cursorContainer.LocalCursor) { RelativeSizeAxes = Axes.Both } + Child = content = new OsuTooltipContainer(CursorContainer.LocalCursor) { RelativeSizeAxes = Axes.Both } }; - base.Content.Add(new DrawSizePreservingFillContainer { Child = cursorContainer }); + base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorContainer }); KeyBindingStore.Register(globalBinding); dependencies.Cache(globalBinding); diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index a54abe8cf1..8285416ecb 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -9,21 +9,17 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; -using osu.Game.Graphics.Cursor; -using osu.Framework.Graphics.Cursor; namespace osu.Game.Screens.Menu { - public class Disclaimer : OsuScreen, IProvideLocalCursor + public class Disclaimer : OsuScreen { private Intro intro; private readonly SpriteIcon icon; private Color4 iconColour; public override bool ShowOverlaysOnEnter => false; - - public CursorContainer LocalCursor => null; - public bool ProvidesUserCursor => true; + public override bool CursorVisible => false; public Disclaimer() { diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 5fac56fafb..10b08d704d 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -15,12 +15,10 @@ using osu.Game.Configuration; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; -using osu.Game.Graphics.Cursor; -using osu.Framework.Graphics.Cursor; namespace osu.Game.Screens.Menu { - public class Intro : OsuScreen, IProvideLocalCursor + public class Intro : OsuScreen { private const string menu_music_beatmap_hash = "3c8b1fcc9434dbb29e2fb613d3b9eada9d7bb6c125ceb32396c3b53437280c83"; @@ -34,9 +32,7 @@ namespace osu.Game.Screens.Menu private SampleChannel seeya; public override bool ShowOverlaysOnEnter => false; - - public CursorContainer LocalCursor => null; - public bool ProvidesUserCursor => true; + public override bool CursorVisible => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 48ca4d5907..a2d41dc206 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -35,6 +35,11 @@ namespace osu.Game.Screens /// public virtual bool ShowOverlaysOnEnter => true; + /// + /// Whether this allows the cursor to be displayed. + /// + public virtual bool CursorVisible => true; + protected new OsuGameBase Game => base.Game as OsuGameBase; private OsuLogo logo; From 16d739580b12de0c5aef1916e9c337aa9614f769 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:36:35 +0900 Subject: [PATCH 300/628] IProvideLocalCursor -> IProvideCursor --- ...{IProvideLocalCursor.cs => IProvideCursor.cs} | 4 ++-- osu.Game/Graphics/Cursor/OsuCursorContainer.cs | 16 ++++++++-------- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Screens/Play/Player.cs | 4 ++-- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) rename osu.Game/Graphics/Cursor/{IProvideLocalCursor.cs => IProvideCursor.cs} (84%) diff --git a/osu.Game/Graphics/Cursor/IProvideLocalCursor.cs b/osu.Game/Graphics/Cursor/IProvideCursor.cs similarity index 84% rename from osu.Game/Graphics/Cursor/IProvideLocalCursor.cs rename to osu.Game/Graphics/Cursor/IProvideCursor.cs index 61631b1220..eb17f72846 100644 --- a/osu.Game/Graphics/Cursor/IProvideLocalCursor.cs +++ b/osu.Game/Graphics/Cursor/IProvideCursor.cs @@ -6,12 +6,12 @@ using osu.Framework.Graphics.Cursor; namespace osu.Game.Graphics.Cursor { - public interface IProvideLocalCursor : IDrawable + public interface IProvideCursor : IDrawable { /// /// The cursor provided by this . /// - CursorContainer LocalCursor { get; } + CursorContainer Cursor { get; } /// /// Whether the cursor provided by this should be displayed. diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 8a25c9c587..bc4e084813 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -9,7 +9,7 @@ using osu.Framework.Input; namespace osu.Game.Graphics.Cursor { - public class OsuCursorContainer : Container, IProvideLocalCursor + public class OsuCursorContainer : Container, IProvideCursor { protected override Container Content => content; private readonly Container content; @@ -19,14 +19,14 @@ namespace osu.Game.Graphics.Cursor /// public bool CanShowCursor; - public CursorContainer LocalCursor { get; } + public CursorContainer Cursor { get; } public bool ProvidesUserCursor => true; public OsuCursorContainer() { AddRangeInternal(new Drawable[] { - LocalCursor = new MenuCursor { State = Visibility.Hidden }, + Cursor = new MenuCursor { State = Visibility.Hidden }, content = new Container { RelativeSizeAxes = Axes.Both } }); } @@ -39,24 +39,24 @@ namespace osu.Game.Graphics.Cursor inputManager = GetContainingInputManager(); } - private IProvideLocalCursor currentTarget; + private IProvideCursor currentTarget; protected override void Update() { base.Update(); if (!CanShowCursor) { - currentTarget?.LocalCursor?.Hide(); + currentTarget?.Cursor?.Hide(); return; } - var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidesUserCursor) ?? this; + var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidesUserCursor) ?? this; if (currentTarget == newTarget) return; - currentTarget?.LocalCursor?.Hide(); - newTarget.LocalCursor?.Show(); + currentTarget?.Cursor?.Hide(); + newTarget.Cursor?.Show(); currentTarget = newTarget; } diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index c88ffd3739..c615b212c3 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -215,7 +215,7 @@ namespace osu.Game CursorContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) { RelativeSizeAxes = Axes.Both, - Child = content = new OsuTooltipContainer(CursorContainer.LocalCursor) { RelativeSizeAxes = Axes.Both } + Child = content = new OsuTooltipContainer(CursorContainer.Cursor) { RelativeSizeAxes = Axes.Both } }; base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorContainer }); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a2d1d161c4..4c294b08ff 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -33,7 +33,7 @@ using osu.Game.Storyboards.Drawables; namespace osu.Game.Screens.Play { - public class Player : OsuScreen, IProvideLocalCursor + public class Player : OsuScreen, IProvideCursor { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); @@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play public int RestartCount; - public CursorContainer LocalCursor => RulesetContainer.Cursor; + public CursorContainer Cursor => RulesetContainer.Cursor; public bool ProvidesUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded; private IAdjustableClock adjustableSourceClock; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b87c1a0c6e..7175e813f4 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -374,7 +374,7 @@ - + From 34aee4fea0eae02556b6f9c07dc8ab05f68e61fd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:37:57 +0900 Subject: [PATCH 301/628] Improve comments --- osu.Game/Graphics/Cursor/IProvideCursor.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Cursor/IProvideCursor.cs b/osu.Game/Graphics/Cursor/IProvideCursor.cs index eb17f72846..b36155a881 100644 --- a/osu.Game/Graphics/Cursor/IProvideCursor.cs +++ b/osu.Game/Graphics/Cursor/IProvideCursor.cs @@ -6,16 +6,19 @@ using osu.Framework.Graphics.Cursor; namespace osu.Game.Graphics.Cursor { + /// + /// Interface for s that display cursors which can replace the user's cursor. + /// public interface IProvideCursor : IDrawable { /// /// The cursor provided by this . + /// May be null if no cursor should be visible. /// CursorContainer Cursor { get; } /// - /// Whether the cursor provided by this should be displayed. - /// If this is false, a cursor occurring earlier in the draw hierarchy will be displayed instead. + /// Whether the cursor provided by this should be displayed as the user's cursor. /// bool ProvidesUserCursor { get; } } From 7bdedf802c8881071a42c9083ae6396ea9a532a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 19:18:49 +0900 Subject: [PATCH 302/628] Fix juice streams not propagating accent colours to nested objects --- .../Objects/Drawable/DrawableJuiceStream.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index 036c5bd879..1c59b65663 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -42,7 +42,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected override void AddNested(DrawableHitObject h) { - ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; + var catchObject = (DrawableCatchHitObject)h; + + catchObject.CheckPosition = o => CheckPosition?.Invoke(o) ?? false; + catchObject.AccentColour = HitObject.ComboColour; + dropletContainer.Add(h); base.AddNested(h); } From 78441c05cb5d561d0601ea82a13a1e67b28d972e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:45:09 +0900 Subject: [PATCH 303/628] OsuCursorContainer -> OsuCursorVisualiser --- .../{OsuCursorContainer.cs => OsuCursorVisualiser.cs} | 7 +++++-- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 10 +++++----- osu.Game/osu.Game.csproj | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) rename osu.Game/Graphics/Cursor/{OsuCursorContainer.cs => OsuCursorVisualiser.cs} (85%) diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs similarity index 85% rename from osu.Game/Graphics/Cursor/OsuCursorContainer.cs rename to osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs index bc4e084813..2b2ab593aa 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs @@ -9,7 +9,10 @@ using osu.Framework.Input; namespace osu.Game.Graphics.Cursor { - public class OsuCursorContainer : Container, IProvideCursor + /// + /// Visualises different cursors depending on the currently-hovered s. + /// + public class OsuCursorVisualiser : Container, IProvideCursor { protected override Container Content => content; private readonly Container content; @@ -22,7 +25,7 @@ namespace osu.Game.Graphics.Cursor public CursorContainer Cursor { get; } public bool ProvidesUserCursor => true; - public OsuCursorContainer() + public OsuCursorVisualiser() { AddRangeInternal(new Drawable[] { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fb20fd57fa..3dda26fc02 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -445,7 +445,7 @@ namespace osu.Game mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; - CursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; + CursorVisualiser.CanShowCursor = currentScreen?.CursorVisible ?? false; } private void screenAdded(Screen newScreen) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index c615b212c3..61ad4024f0 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,7 +44,7 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; - protected OsuCursorContainer CursorContainer; + protected OsuCursorVisualiser CursorVisualiser; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -211,14 +211,14 @@ namespace osu.Game GlobalKeyBindingInputManager globalBinding; - CursorContainer = new OsuCursorContainer { RelativeSizeAxes = Axes.Both }; - CursorContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) + CursorVisualiser = new OsuCursorVisualiser { RelativeSizeAxes = Axes.Both }; + CursorVisualiser.Child = globalBinding = new GlobalKeyBindingInputManager(this) { RelativeSizeAxes = Axes.Both, - Child = content = new OsuTooltipContainer(CursorContainer.Cursor) { RelativeSizeAxes = Axes.Both } + Child = content = new OsuTooltipContainer(CursorVisualiser.Cursor) { RelativeSizeAxes = Axes.Both } }; - base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorContainer }); + base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorVisualiser }); KeyBindingStore.Register(globalBinding); dependencies.Cache(globalBinding); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7175e813f4..fd53a211e0 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -377,7 +377,7 @@ - + From d0b177e23390dfee9118453afc41ac1d0bde4c8f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 19:50:09 +0900 Subject: [PATCH 304/628] Proxying isn't needed anymore --- osu.Game/Screens/Play/Player.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4c294b08ff..a93c616c6a 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -155,12 +155,6 @@ namespace osu.Game.Screens.Play userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); - // We want the cursor to be above everything (including the skip button), but still be able to be controlled - // by the ruleset's input manager and replay, so we need to proxy it out from the ruleset container - var cursorProxyContainer = new Container { RelativeSizeAxes = Axes.Both }; - if (RulesetContainer.Cursor != null) - cursorProxyContainer.Add(RulesetContainer.Cursor.CreateProxy()); - Children = new Drawable[] { storyboardContainer = new Container @@ -203,8 +197,7 @@ namespace osu.Game.Screens.Play Origin = Anchor.Centre, Clock = decoupledClock, Breaks = beatmap.Breaks - }, - cursorProxyContainer + } } }, failOverlay = new FailOverlay From 90bcec42d7ef99a48676b0d171f41203b5b30857 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Jan 2018 20:48:58 +0900 Subject: [PATCH 305/628] Remove unused using --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 08bc94863b..5e70239c7c 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -10,7 +10,6 @@ using osu.Game.Rulesets.UI; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; -using osu.Game.Rulesets.Catch.Objects; namespace osu.Game.Rulesets.Catch { From 93c4d58b69d29c3a13b7bee1ab4737eb03b4ae3b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 21:46:50 +0900 Subject: [PATCH 306/628] Make catch plate fruit again --- .../Objects/Drawable/DrawableBananaShower.cs | 5 ++-- .../Drawable/DrawableCatchHitObject.cs | 26 ++++++++++++---- .../Objects/Drawable/DrawableJuiceStream.cs | 22 ++++---------- .../Objects/JuiceStream.cs | 2 -- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 4 ++- .../UI/CatchRulesetContainer.cs | 11 +++++-- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 30 ++++++++++--------- 7 files changed, 55 insertions(+), 45 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs index b5d9163a50..72aeddee56 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -12,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { private readonly Container bananaContainer; - public DrawableBananaShower(BananaShower s) + public DrawableBananaShower(BananaShower s, Func> getVisualRepresentation = null) : base(s) { RelativeSizeAxes = Axes.X; @@ -22,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both }; foreach (var b in s.NestedHitObjects.Cast()) - AddNested(new DrawableFruit(b)); + AddNested(getVisualRepresentation?.Invoke(b)); } protected override void AddNested(DrawableHitObject h) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 554fb1323e..8871e26101 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -5,6 +5,7 @@ using System; using osu.Framework.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; using OpenTK; using osu.Game.Rulesets.Scoring; @@ -13,6 +14,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public abstract class PalpableCatchHitObject : DrawableCatchHitObject where TObject : CatchHitObject { + public override bool CanBePlated => true; + protected PalpableCatchHitObject(TObject hitObject) : base(hitObject) { @@ -36,6 +39,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable public abstract class DrawableCatchHitObject : DrawableHitObject { + public virtual bool CanBePlated => false; + protected DrawableCatchHitObject(CatchHitObject hitObject) : base(hitObject) { @@ -47,8 +52,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected override void CheckForJudgements(bool userTriggered, double timeOffset) { + if (CheckPosition == null) return; + if (timeOffset > 0) - AddJudgement(new Judgement { Result = CheckPosition?.Invoke(HitObject) ?? false ? HitResult.Perfect : HitResult.Miss }); + AddJudgement(new Judgement { Result = (bool)CheckPosition?.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss }); } private const float preempt = 1000; @@ -61,12 +68,19 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable this.FadeIn(200); } - switch (state) + var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; + + using (BeginAbsoluteSequence(endTime, true)) { - case ArmedState.Miss: - using (BeginAbsoluteSequence(HitObject.StartTime, true)) - this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out); - break; + switch (state) + { + case ArmedState.Miss: + this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire(); + break; + case ArmedState.Hit: + this.FadeOut().Expire(); + break; + } } } } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index e66999229c..c8b15aec61 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -1,9 +1,10 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using OpenTK; using osu.Game.Rulesets.Objects.Drawables; namespace osu.Game.Rulesets.Catch.Objects.Drawable @@ -12,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { private readonly Container dropletContainer; - public DrawableJuiceStream(JuiceStream s) + public DrawableJuiceStream(JuiceStream s, Func> getVisualRepresentation = null) : base(s) { RelativeSizeAxes = Axes.Both; @@ -21,21 +22,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, }; - foreach (var tick in s.NestedHitObjects) - { - switch (tick) - { - case TinyDroplet tiny: - AddNested(new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) }); - break; - case Droplet droplet: - AddNested(new DrawableDroplet(droplet)); - break; - case Fruit fruit: - AddNested(new DrawableFruit(fruit)); - break; - } - } + foreach (var o in s.NestedHitObjects.Cast()) + AddNested(getVisualRepresentation?.Invoke(o)); } protected override void AddNested(DrawableHitObject h) diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index b1c83f5964..188af58e6a 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -125,10 +125,8 @@ namespace osu.Game.Rulesets.Catch.Objects X = Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH }); } - } - public double EndTime => StartTime + RepeatCount * Curve.Distance / Velocity; public float EndX => Curve.PositionAt(ProgressAt(1)).X / CatchPlayfield.BASE_WIDTH; diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 7fdabd46c2..8ea30a2899 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; @@ -21,7 +22,7 @@ namespace osu.Game.Rulesets.Catch.UI private readonly CatcherArea catcherArea; - public CatchPlayfield(BeatmapDifficulty difficulty) + public CatchPlayfield(BeatmapDifficulty difficulty, Func> getVisualRepresentation) : base(ScrollingDirection.Down, BASE_WIDTH) { Container explodingFruitContainer; @@ -44,6 +45,7 @@ namespace osu.Game.Rulesets.Catch.UI }, catcherArea = new CatcherArea(difficulty) { + GetVisualRepresentation = getVisualRepresentation, ExplodingFruitTarget = explodingFruitContainer, Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index ae0fe8189e..956a524121 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -13,6 +13,7 @@ using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI.Scrolling; +using OpenTK; namespace osu.Game.Rulesets.Catch.UI { @@ -31,7 +32,7 @@ namespace osu.Game.Rulesets.Catch.UI protected override BeatmapConverter CreateBeatmapConverter() => new CatchBeatmapConverter(); - protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty); + protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation); public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo); @@ -42,9 +43,13 @@ namespace osu.Game.Rulesets.Catch.UI case Fruit fruit: return new DrawableFruit(fruit); case JuiceStream stream: - return new DrawableJuiceStream(stream); + return new DrawableJuiceStream(stream, GetVisualRepresentation); case BananaShower banana: - return new DrawableBananaShower(banana); + return new DrawableBananaShower(banana, GetVisualRepresentation); + case TinyDroplet tiny: + return new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) }; + case Droplet droplet: + return new DrawableDroplet(droplet); } return null; diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 1837086d9c..6d0c3589e8 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -16,7 +16,6 @@ using osu.Game.Rulesets.Catch.Objects.Drawable; using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Rulesets.UI; using OpenTK; using OpenTK.Graphics; @@ -28,6 +27,8 @@ namespace osu.Game.Rulesets.Catch.UI protected readonly Catcher MovableCatcher; + public Func> GetVisualRepresentation; + public Container ExplodingFruitTarget { set { MovableCatcher.ExplodingFruitTarget = value; } @@ -45,23 +46,24 @@ namespace osu.Game.Rulesets.Catch.UI public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement) { - if (judgement.IsHit) + if (judgement.IsHit && fruit.CanBePlated) { - var screenSpacePosition = fruit.ScreenSpaceDrawQuad.Centre; + var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject); - // todo: make this less ugly, somehow. - (fruit.Parent as HitObjectContainer)?.Remove(fruit); - (fruit.Parent as Container)?.Remove(fruit); + if (caughtFruit != null) + { + caughtFruit.State.Value = ArmedState.Idle; + caughtFruit.AccentColour = fruit.AccentColour; + caughtFruit.RelativePositionAxes = Axes.None; + caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0); - fruit.RelativePositionAxes = Axes.None; - fruit.Position = new Vector2(MovableCatcher.ToLocalSpace(screenSpacePosition).X - MovableCatcher.DrawSize.X / 2, 0); + caughtFruit.Anchor = Anchor.TopCentre; + caughtFruit.Origin = Anchor.Centre; + caughtFruit.Scale *= 0.7f; + caughtFruit.LifetimeEnd = double.MaxValue; + } - fruit.Anchor = Anchor.TopCentre; - fruit.Origin = Anchor.Centre; - fruit.Scale *= 0.7f; - fruit.LifetimeEnd = double.MaxValue; - - MovableCatcher.Add(fruit); + MovableCatcher.Add(caughtFruit); } if (fruit.HitObject.LastInCombo) From 20c6f84efab1fa9f851b5b31466844e9492d5c0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 21:46:57 +0900 Subject: [PATCH 307/628] Fix banana test regression --- osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs index 6bf5b6beca..e23e7633ca 100644 --- a/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Tests/TestCaseBananaShower.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Catch.Tests } }; - beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 500, NewCombo = true }); + beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 5000, NewCombo = true }); return beatmap; } From f03b8206da2c2a3e7eaa045b8631c882c352785f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 21:47:52 +0900 Subject: [PATCH 308/628] Make banana showers always last in combo (explodey) --- osu.Game.Rulesets.Catch/Objects/BananaShower.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Catch/Objects/BananaShower.cs b/osu.Game.Rulesets.Catch/Objects/BananaShower.cs index cb0f4eab96..89bd73f8fb 100644 --- a/osu.Game.Rulesets.Catch/Objects/BananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/BananaShower.cs @@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Catch.Objects { public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana; + public override bool LastInCombo => true; + protected override void CreateNestedHitObjects() { base.CreateNestedHitObjects(); From 7b19353ed8653356a7db2b0f2de42f6a3e488c17 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 22:07:21 +0900 Subject: [PATCH 309/628] Fix weird fruit not fading out --- .../Drawable/DrawableCatchHitObject.cs | 3 -- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 44 +++++++++++-------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 8871e26101..d3b714fc9b 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -63,10 +63,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable protected override void UpdateState(ArmedState state) { using (BeginAbsoluteSequence(HitObject.StartTime - preempt)) - { - // animation this.FadeIn(200); - } var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 6d0c3589e8..23b0ceeac1 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -44,35 +44,43 @@ namespace osu.Game.Rulesets.Catch.UI }; } + private DrawableCatchHitObject lastPlateableFruit; + public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement) { if (judgement.IsHit && fruit.CanBePlated) { var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject); - if (caughtFruit != null) - { - caughtFruit.State.Value = ArmedState.Idle; - caughtFruit.AccentColour = fruit.AccentColour; - caughtFruit.RelativePositionAxes = Axes.None; - caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0); + if (caughtFruit == null) return; - caughtFruit.Anchor = Anchor.TopCentre; - caughtFruit.Origin = Anchor.Centre; - caughtFruit.Scale *= 0.7f; - caughtFruit.LifetimeEnd = double.MaxValue; - } + caughtFruit.State.Value = ArmedState.Idle; + caughtFruit.AccentColour = fruit.AccentColour; + caughtFruit.RelativePositionAxes = Axes.None; + caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0); + + caughtFruit.Anchor = Anchor.TopCentre; + caughtFruit.Origin = Anchor.Centre; + caughtFruit.Scale *= 0.7f; + caughtFruit.LifetimeEnd = double.MaxValue; MovableCatcher.Add(caughtFruit); + + lastPlateableFruit = caughtFruit; } - if (fruit.HitObject.LastInCombo) + // this is required to make this run after the last caught fruit runs UpdateState at least once. + // TODO: find a better alternative + lastPlateableFruit.OnLoadComplete = _ => { - if (judgement.IsHit) - MovableCatcher.Explode(); - else - MovableCatcher.Drop(); - } + if (fruit.HitObject.LastInCombo) + { + if (judgement.IsHit) + MovableCatcher.Explode(); + else + MovableCatcher.Drop(); + } + }; } public bool OnPressed(CatchAction action) @@ -211,7 +219,7 @@ namespace osu.Game.Rulesets.Catch.UI while (caughtFruit.Any(f => f.LifetimeEnd == double.MaxValue && - Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2))) + Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2))) { float diff = (ourRadius + theirRadius) / allowance; fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff; From 9e108548400353781971f24e8c4445e4a9539729 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 Jan 2018 22:30:21 +0900 Subject: [PATCH 310/628] Fix banannanananana showers not exploding enough --- .../Objects/Drawable/DrawableBananaShower.cs | 8 ++++++++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs index 72aeddee56..7b0370ef88 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableBananaShower.cs @@ -5,7 +5,9 @@ using System; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Catch.Objects.Drawable { @@ -26,6 +28,12 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AddNested(getVisualRepresentation?.Invoke(b)); } + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + if (timeOffset >= 0) + AddJudgement(new Judgement { Result = NestedHitObjects.Cast().Any(n => n.Judgements.Any(j => j.IsHit)) ? HitResult.Perfect : HitResult.Miss }); + } + protected override void AddNested(DrawableHitObject h) { ((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false; diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 23b0ceeac1..2df43bdcd4 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -69,18 +69,20 @@ namespace osu.Game.Rulesets.Catch.UI lastPlateableFruit = caughtFruit; } - // this is required to make this run after the last caught fruit runs UpdateState at least once. - // TODO: find a better alternative - lastPlateableFruit.OnLoadComplete = _ => + if (fruit.HitObject.LastInCombo) { - if (fruit.HitObject.LastInCombo) + if (judgement.IsHit) { - if (judgement.IsHit) + // this is required to make this run after the last caught fruit runs UpdateState at least once. + // TODO: find a better alternative + if (lastPlateableFruit.IsLoaded) MovableCatcher.Explode(); else - MovableCatcher.Drop(); + lastPlateableFruit.OnLoadComplete = _ => { MovableCatcher.Explode(); }; } - }; + else + MovableCatcher.Drop(); + } } public bool OnPressed(CatchAction action) From b4b15b7dd0893b9e4ecbcece91c26a1a0d2f1c59 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 13 Jan 2018 00:51:20 +0900 Subject: [PATCH 311/628] Apply review fixes --- .../Objects/Drawable/DrawableCatchHitObject.cs | 2 +- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index d3b714fc9b..fce43137d1 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable if (CheckPosition == null) return; if (timeOffset > 0) - AddJudgement(new Judgement { Result = (bool)CheckPosition?.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss }); + AddJudgement(new Judgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss }); } private const float preempt = 1000; diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 2df43bdcd4..17c78f3aa0 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -54,7 +54,6 @@ namespace osu.Game.Rulesets.Catch.UI if (caughtFruit == null) return; - caughtFruit.State.Value = ArmedState.Idle; caughtFruit.AccentColour = fruit.AccentColour; caughtFruit.RelativePositionAxes = Axes.None; caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0); From 1c5b3d009cedc0e2de237b9531195a5accccf0da Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Fri, 12 Jan 2018 17:09:57 +0100 Subject: [PATCH 312/628] remove volume reduction on preview it doubles with global reduction --- osu.Game/Overlays/Direct/PlayButton.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index e939047f1a..9ecddb01ba 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -174,10 +174,7 @@ namespace osu.Game.Overlays.Direct private void load(AudioManager audio) { if (!string.IsNullOrEmpty(preview)) - { Preview = audio.Track.Get(preview); - Preview.Volume.Value = 0.5; - } } } } From ae1adfd2f247509f9f36ce0ec0b43f1dfb1eed53 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Fri, 12 Jan 2018 19:30:34 +0100 Subject: [PATCH 313/628] remove unnecessary empty lines codefactor.io \(o.o)/ also one unnecessary semicolon --- osu.Desktop/Program.cs | 1 - .../Objects/Drawable/DrawableCatchHitObject.cs | 1 - osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 1 - osu.Game.Rulesets.Mania/Objects/HoldNote.cs | 1 - osu.Game/Beatmaps/BeatmapManager.cs | 3 --- osu.Game/Beatmaps/DifficultyCalculator.cs | 1 - osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTabControl.cs | 1 - osu.Game/Online/API/OAuthToken.cs | 1 - osu.Game/Overlays/Chat/ChatLine.cs | 1 - osu.Game/Overlays/Direct/DirectPanel.cs | 1 - osu.Game/Overlays/MedalSplash/DrawableMedal.cs | 2 -- osu.Game/Overlays/Music/PlaylistItem.cs | 1 - osu.Game/Overlays/Music/PlaylistList.cs | 1 - osu.Game/Overlays/Notifications/NotificationSection.cs | 1 - .../Overlays/Notifications/ProgressCompletionNotification.cs | 1 - osu.Game/Overlays/Notifications/ProgressNotification.cs | 1 - osu.Game/Rulesets/Objects/Types/IHasXPosition.cs | 1 - osu.Game/Rulesets/Objects/Types/IHasYPosition.cs | 1 - osu.Game/Rulesets/Replays/ReplayFrame.cs | 1 - osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs | 1 - osu.Game/Screens/Menu/ButtonSystem.cs | 1 - osu.Game/Screens/Multiplayer/DrawableRoom.cs | 1 - 23 files changed, 1 insertion(+), 26 deletions(-) diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index 6927568cc4..9760538197 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -43,7 +43,6 @@ namespace osu.Desktop host.Run(new OsuGameDesktop(args)); break; } - } return 0; } diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index fce43137d1..05ef947e4b 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -23,7 +23,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable } } - public abstract class DrawableCatchHitObject : DrawableCatchHitObject where TObject : CatchHitObject { diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 8b0b59593c..557ce5eb1b 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -58,7 +58,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps protected override Beatmap ConvertBeatmap(Beatmap original) { - BeatmapDifficulty difficulty = original.BeatmapInfo.BaseDifficulty; int seed = (int)Math.Round(difficulty.DrainRate + difficulty.CircleSize) * 20 + (int)(difficulty.OverallDifficulty * 41.2) + (int)Math.Round(difficulty.ApproachRate); diff --git a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs index 881ce9199d..728c79b9cf 100644 --- a/osu.Game.Rulesets.Mania/Objects/HoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/HoldNote.cs @@ -93,7 +93,6 @@ namespace osu.Game.Rulesets.Mania.Objects Column = Column }); } - } /// diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index d342e495e2..634b5bcd20 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -566,7 +566,6 @@ namespace osu.Game.Beatmaps using (var stream = new StreamReader(reader.GetStream(mapName))) metadata = Decoder.GetDecoder(stream).DecodeBeatmap(stream).Metadata; - // check if a set already exists with the same online id. if (metadata.OnlineBeatmapSetID != null) beatmapSet = beatmaps.BeatmapSets.FirstOrDefault(b => b.OnlineBeatmapSetID == metadata.OnlineBeatmapSetID); @@ -581,7 +580,6 @@ namespace osu.Game.Beatmaps Metadata = metadata }; - var mapNames = reader.Filenames.Where(f => f.EndsWith(".osu")); foreach (var name in mapNames) @@ -693,7 +691,6 @@ namespace osu.Game.Beatmaps { try { - using (var beatmap = new StreamReader(store.GetStream(getPathForFile(BeatmapInfo.Path)))) { Decoder decoder = Decoder.GetDecoder(beatmap); diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 55aa876a1b..798268d05f 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -27,7 +27,6 @@ namespace osu.Game.Beatmaps Beatmap = CreateBeatmapConverter(beatmap).Convert(beatmap); Mods = mods ?? new Mod[0]; - ApplyMods(Mods); PreprocessHitObjects(); diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index c4c91e3e09..e0fc439924 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -137,7 +137,7 @@ namespace osu.Game.Beatmaps.Formats CentreRight, BottomLeft, BottomRight - }; + } internal enum StoryLayer { diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index 032420b61e..7ad9bc73a8 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -180,7 +180,6 @@ namespace osu.Game.Graphics.UserInterface } } - protected class OsuTabDropdownHeader : OsuDropdownHeader { public override Color4 AccentColour diff --git a/osu.Game/Online/API/OAuthToken.cs b/osu.Game/Online/API/OAuthToken.cs index 7d644a2628..d2b9703a93 100644 --- a/osu.Game/Online/API/OAuthToken.cs +++ b/osu.Game/Online/API/OAuthToken.cs @@ -56,7 +56,6 @@ namespace osu.Game.Online.API } catch { - } return null; } diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index 19dede56a0..4895c3a37c 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -219,7 +219,6 @@ namespace osu.Game.Overlays.Chat } else contentFlow.Text = message.Content; - } private class MessageSender : OsuClickableContainer, IHasContextMenu diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index ede9f2c412..7dd6be8dc6 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -65,7 +65,6 @@ namespace osu.Game.Overlays.Direct Colour = Color4.Black.Opacity(0.3f), }; - [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay) { diff --git a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs index e1a780406b..8edfdf9d95 100644 --- a/osu.Game/Overlays/MedalSplash/DrawableMedal.cs +++ b/osu.Game/Overlays/MedalSplash/DrawableMedal.cs @@ -183,8 +183,6 @@ namespace osu.Game.Overlays.MedalSplash description.FadeInFromZero(duration * 2); break; } - - } } diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 9eab8f797d..34dcc36699 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -148,7 +148,6 @@ namespace osu.Game.Overlays.Music private class PlaylistItemHandle : SpriteIcon { - public PlaylistItemHandle() { Anchor = Anchor.TopLeft; diff --git a/osu.Game/Overlays/Music/PlaylistList.cs b/osu.Game/Overlays/Music/PlaylistList.cs index 17687a9623..31b7d0f9aa 100644 --- a/osu.Game/Overlays/Music/PlaylistList.cs +++ b/osu.Game/Overlays/Music/PlaylistList.cs @@ -230,7 +230,6 @@ namespace osu.Game.Overlays.Music items.ChangeChildDepth(draggedItem, dstIndex); } - private class ItemSearchContainer : FillFlowContainer, IHasFilterableChildren { public IEnumerable FilterTerms => new string[] { }; diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index d51cdb8bcc..13a69fbe3a 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -168,5 +168,4 @@ namespace osu.Game.Overlays.Notifications // the layout portion of this is being tracked as a framework issue (https://github.com/ppy/osu-framework/issues/1297). protected override bool RequiresChildrenUpdate => true; } - } diff --git a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs index 4cd48edcf3..df2be95b40 100644 --- a/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressCompletionNotification.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Framework.Graphics.Colour; - namespace osu.Game.Overlays.Notifications { public class ProgressCompletionNotification : SimpleNotification diff --git a/osu.Game/Overlays/Notifications/ProgressNotification.cs b/osu.Game/Overlays/Notifications/ProgressNotification.cs index 4106a40867..b36ac6eebc 100644 --- a/osu.Game/Overlays/Notifications/ProgressNotification.cs +++ b/osu.Game/Overlays/Notifications/ProgressNotification.cs @@ -217,7 +217,6 @@ namespace osu.Game.Overlays.Notifications }; } - [BackgroundDependencyLoader] private void load(OsuColour colours) { diff --git a/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs index 2dec9e6ef1..f73f338778 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasXPosition.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - namespace osu.Game.Rulesets.Objects.Types { /// diff --git a/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs index 8a38bde0f9..fc2d21481f 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasYPosition.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - namespace osu.Game.Rulesets.Objects.Types { /// diff --git a/osu.Game/Rulesets/Replays/ReplayFrame.cs b/osu.Game/Rulesets/Replays/ReplayFrame.cs index 92defad62e..4f8ed5163e 100644 --- a/osu.Game/Rulesets/Replays/ReplayFrame.cs +++ b/osu.Game/Rulesets/Replays/ReplayFrame.cs @@ -52,7 +52,6 @@ namespace osu.Game.Rulesets.Replays protected ReplayFrame() { - } public ReplayFrame(double time, float? mouseX, float? mouseY, ReplayButtonState buttonState) diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs index c64ae23d46..758032a711 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenEmpty.cs @@ -5,6 +5,5 @@ namespace osu.Game.Screens.Backgrounds { public class BackgroundScreenEmpty : BackgroundScreen { - } } diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 72fe4368f0..529565312e 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -157,7 +157,6 @@ namespace osu.Game.Screens.Menu return true; } - return false; } diff --git a/osu.Game/Screens/Multiplayer/DrawableRoom.cs b/osu.Game/Screens/Multiplayer/DrawableRoom.cs index 7fcd364fe0..cc2828fb91 100644 --- a/osu.Game/Screens/Multiplayer/DrawableRoom.cs +++ b/osu.Game/Screens/Multiplayer/DrawableRoom.cs @@ -229,7 +229,6 @@ namespace osu.Game.Screens.Multiplayer { coverContainer.FadeIn(transition_duration); - LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet) { Anchor = Anchor.Centre, From 3795411fd13cb9c6ae64d840dfdcdbfcd2914244 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 12 Jan 2018 23:33:24 +0300 Subject: [PATCH 314/628] Do not assign hudOverlay's and breakOverlay's members in Player class --- .../Play/BreaksOverlay/BreakOverlay.cs | 7 +++++- osu.Game/Screens/Play/HUDOverlay.cs | 20 ++++++++++++++--- osu.Game/Screens/Play/Player.cs | 22 ++++--------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index 735c81aedf..7a510aa738 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -41,6 +41,11 @@ namespace osu.Game.Screens.Play.BreaksOverlay private readonly InfoContainer info; private readonly ArrowsOverlay arrowsOverlay; + public BreakOverlay(bool letterboxing, ScoreProcessor scoreProcessor) : this(letterboxing) + { + bindProcessor(scoreProcessor); + } + public BreakOverlay(bool letterboxing) { this.letterboxing = letterboxing; @@ -148,7 +153,7 @@ namespace osu.Game.Screens.Play.BreaksOverlay arrowsOverlay.Hide(); } - public void BindProcessor(ScoreProcessor processor) + private void bindProcessor(ScoreProcessor processor) { info.AccuracyDisplay.Current.BindTo(processor.Accuracy); info.GradeDisplay.Current.BindTo(processor.Rank); diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 721b5344ff..92a0f2ee98 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -6,6 +6,8 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using osu.Framework.Timing; +using osu.Game.Beatmaps; using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; @@ -39,7 +41,7 @@ namespace osu.Game.Screens.Play private static bool hasShownNotificationOnce; - public HUDOverlay() + public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, DecoupleableInterpolatingFramedClock decoupledClock, WorkingBeatmap working, IAdjustableClock adjustableSourceClock) { RelativeSizeAxes = Axes.Both; @@ -59,6 +61,18 @@ namespace osu.Game.Screens.Play ReplaySettingsOverlay = CreateReplaySettingsOverlay(), } }); + + BindProcessor(scoreProcessor); + BindRulesetContainer(rulesetContainer); + + Progress.Objects = rulesetContainer.Objects; + Progress.AudioClock = decoupledClock; + Progress.AllowSeeking = rulesetContainer.HasReplayLoaded; + Progress.OnSeek = pos => decoupledClock.Seek(pos); + + ModDisplay.Current.BindTo(working.Mods); + + ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; } [BackgroundDependencyLoader(true)] @@ -91,7 +105,7 @@ namespace osu.Game.Screens.Play } } - public virtual void BindRulesetContainer(RulesetContainer rulesetContainer) + protected virtual void BindRulesetContainer(RulesetContainer rulesetContainer) { (rulesetContainer.KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(KeyCounter); @@ -184,7 +198,7 @@ namespace osu.Game.Screens.Play protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay(); - public virtual void BindProcessor(ScoreProcessor processor) + protected virtual void BindProcessor(ScoreProcessor processor) { ScoreCounter?.Current.BindTo(processor.TotalScore); AccuracyCounter?.Current.BindTo(processor.Accuracy); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index fc8b0f2c88..58f33fd8db 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -152,6 +152,8 @@ namespace osu.Game.Screens.Play userAudioOffset.ValueChanged += v => offsetClock.Offset = v; userAudioOffset.TriggerChange(); + scoreProcessor = RulesetContainer.CreateScoreProcessor(); + Children = new Drawable[] { storyboardContainer = new Container @@ -183,12 +185,12 @@ namespace osu.Game.Screens.Play Clock = offsetClock, Child = RulesetContainer, }, - hudOverlay = new HUDOverlay + hudOverlay = new HUDOverlay(scoreProcessor, RulesetContainer, decoupledClock, working, adjustableSourceClock) { Anchor = Anchor.Centre, Origin = Anchor.Centre }, - breakOverlay = new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks) + breakOverlay = new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks, scoreProcessor) { Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -213,25 +215,9 @@ namespace osu.Game.Screens.Play } }; - scoreProcessor = RulesetContainer.CreateScoreProcessor(); - if (showStoryboard) initializeStoryboard(false); - hudOverlay.BindProcessor(scoreProcessor); - hudOverlay.BindRulesetContainer(RulesetContainer); - - hudOverlay.Progress.Objects = RulesetContainer.Objects; - hudOverlay.Progress.AudioClock = decoupledClock; - hudOverlay.Progress.AllowSeeking = RulesetContainer.HasReplayLoaded; - hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); - - hudOverlay.ModDisplay.Current.BindTo(working.Mods); - - breakOverlay.BindProcessor(scoreProcessor); - - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; - // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; scoreProcessor.Failed += onFail; From 0c4fcdf6d80cad8da7f019715744d537989e84fa Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 12 Jan 2018 23:59:36 +0300 Subject: [PATCH 315/628] Remove not used breakOverlay field --- osu.Game/Screens/Play/Player.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 58f33fd8db..980d9a6101 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -76,7 +76,6 @@ namespace osu.Game.Screens.Play #endregion - private BreakOverlay breakOverlay; private Container storyboardContainer; private DrawableStoryboard storyboard; @@ -190,7 +189,7 @@ namespace osu.Game.Screens.Play Anchor = Anchor.Centre, Origin = Anchor.Centre }, - breakOverlay = new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks, scoreProcessor) + new BreakOverlay(beatmap.BeatmapInfo.LetterboxInBreaks, scoreProcessor) { Anchor = Anchor.Centre, Origin = Anchor.Centre, From 70fc09f81e697925955da38755691e4d6f1686f5 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 13 Jan 2018 12:42:42 +0100 Subject: [PATCH 316/628] move judgement + state logic up to DrawableHitObject --- .../Objects/Drawables/DrawableHitObject.cs | 298 +++++++++--------- 1 file changed, 142 insertions(+), 156 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 13329a1470..a29ea4cbbb 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -29,37 +29,167 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public virtual Color4 AccentColour { get; set; } = Color4.Gray; + private List nestedHitObjects; + public IReadOnlyList NestedHitObjects => nestedHitObjects; + + public event Action OnJudgement; + public event Action OnJudgementRemoved; + + public IReadOnlyList Judgements => judgements; + private readonly List judgements = new List(); + /// /// Whether a visible judgement should be displayed when this representation is hit. /// public virtual bool DisplayJudgement => true; - public override bool RemoveCompletedTransforms => false; + /// + /// Whether this and all of its nested s have been judged. + /// + public bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); + + /// + /// Whether this can be judged. + /// + protected virtual bool ProvidesJudgement => true; + + private bool judgementOccurred; + private bool judgementFinalized => judgements.LastOrDefault()?.Final == true; + + public bool Interactive = true; + public override bool HandleInput => Interactive; + public override bool RemoveWhenNotAlive => false; + public override bool RemoveCompletedTransforms => false; protected override bool RequiresChildrenUpdate => true; - public virtual bool AllJudged => false; + public readonly Bindable State = new Bindable(); protected DrawableHitObject(HitObject hitObject) { HitObject = hitObject; } + protected override void LoadComplete() + { + base.LoadComplete(); + + State.ValueChanged += state => + { + UpdateState(state); + + // apply any custom state overrides + ApplyCustomUpdateState?.Invoke(this, state); + }; + + State.TriggerChange(); + } + + protected abstract void UpdateState(ArmedState state); + + /// + /// Bind to apply a custom state which can override the default implementation. + /// + public event Action ApplyCustomUpdateState; + + protected override void Update() + { + base.Update(); + + var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; + + while (judgements.Count > 0) + { + var lastJudgement = judgements[judgements.Count - 1]; + if (lastJudgement.TimeOffset + endTime <= Time.Current) + break; + + judgements.RemoveAt(judgements.Count - 1); + State.Value = ArmedState.Idle; + + OnJudgementRemoved?.Invoke(this, lastJudgement); + } + } + + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + UpdateJudgement(false); + } + + protected virtual void AddNested(DrawableHitObject h) + { + if (nestedHitObjects == null) + nestedHitObjects = new List(); + nestedHitObjects.Add(h); + } + + /// + /// Notifies that a new judgement has occurred for this . + /// + /// The . + protected void AddJudgement(Judgement judgement) + { + judgementOccurred = true; + + // Ensure that the judgement is given a valid time offset, because this may not get set by the caller + var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; + judgement.TimeOffset = Time.Current - endTime; + + judgements.Add(judgement); + + switch (judgement.Result) + { + case HitResult.None: + break; + case HitResult.Miss: + State.Value = ArmedState.Miss; + break; + default: + State.Value = ArmedState.Hit; + break; + } + + OnJudgement?.Invoke(this, judgement); + } + /// /// Processes this , checking if any judgements have occurred. /// /// Whether the user triggered this process. /// Whether a judgement has occurred from this or any nested s. - protected internal virtual bool UpdateJudgement(bool userTriggered) => false; - - private List nestedHitObjects; - public IReadOnlyList NestedHitObjects => nestedHitObjects; - - protected virtual void AddNested(DrawableHitObject h) + protected internal bool UpdateJudgement(bool userTriggered) + { + judgementOccurred = false; + + if (AllJudged) + return false; + + if (NestedHitObjects != null) + { + foreach (var d in NestedHitObjects) + judgementOccurred |= d.UpdateJudgement(userTriggered); + } + + if (!ProvidesJudgement || judgementFinalized || judgementOccurred) + return judgementOccurred; + + var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; + CheckForJudgements(userTriggered, Time.Current - endTime); + + return judgementOccurred; + } + + /// + /// Checks if any judgements have occurred for this . This method must construct + /// all s and notify of them through . + /// + /// Whether the user triggered this check. + /// The offset from the end time at which this check occurred. A > 0 + /// implies that this check occurred after the end time of . + protected virtual void CheckForJudgements(bool userTriggered, double timeOffset) { - if (nestedHitObjects == null) - nestedHitObjects = new List(); - nestedHitObjects.Add(h); } /// @@ -76,30 +206,14 @@ namespace osu.Game.Rulesets.Objects.Drawables public abstract class DrawableHitObject : DrawableHitObject where TObject : HitObject { - public event Action OnJudgement; - public event Action OnJudgementRemoved; - public new readonly TObject HitObject; - public override bool HandleInput => Interactive; - public bool Interactive = true; - - /// - /// Whether this can be judged. - /// - protected virtual bool ProvidesJudgement => true; - - private readonly List judgements = new List(); - public IReadOnlyList Judgements => judgements; - protected List Samples = new List(); protected virtual IEnumerable GetSamples() => HitObject.Samples; // Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first protected virtual string SampleNamespace => null; - public readonly Bindable State = new Bindable(); - protected DrawableHitObject(TObject hitObject) : base(hitObject) { @@ -141,139 +255,11 @@ namespace osu.Game.Rulesets.Objects.Drawables State.ValueChanged += state => { - UpdateState(state); - - // apply any custom state overrides - ApplyCustomUpdateState?.Invoke(this, state); - if (State == ArmedState.Hit) PlaySamples(); }; - - State.TriggerChange(); } - protected void PlaySamples() - { - Samples.ForEach(s => s?.Play()); - } - - private bool judgementOccurred; - private bool judgementFinalized => judgements.LastOrDefault()?.Final == true; - - /// - /// Whether this and all of its nested s have been judged. - /// - public sealed override bool AllJudged => (!ProvidesJudgement || judgementFinalized) && (NestedHitObjects?.All(h => h.AllJudged) ?? true); - - /// - /// Notifies that a new judgement has occurred for this . - /// - /// The . - protected void AddJudgement(Judgement judgement) - { - judgementOccurred = true; - - // Ensure that the judgement is given a valid time offset, because this may not get set by the caller - var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; - judgement.TimeOffset = Time.Current - endTime; - - judgements.Add(judgement); - - switch (judgement.Result) - { - case HitResult.None: - break; - case HitResult.Miss: - State.Value = ArmedState.Miss; - break; - default: - State.Value = ArmedState.Hit; - break; - } - - OnJudgement?.Invoke(this, judgement); - } - - /// - /// Processes this , checking if any judgements have occurred. - /// - /// Whether the user triggered this process. - /// Whether a judgement has occurred from this or any nested s. - protected internal sealed override bool UpdateJudgement(bool userTriggered) - { - judgementOccurred = false; - - if (AllJudged) - return false; - - if (NestedHitObjects != null) - { - foreach (var d in NestedHitObjects) - judgementOccurred |= d.UpdateJudgement(userTriggered); - } - - if (!ProvidesJudgement || judgementFinalized || judgementOccurred) - return judgementOccurred; - - var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; - CheckForJudgements(userTriggered, Time.Current - endTime); - - return judgementOccurred; - } - - /// - /// Checks if any judgements have occurred for this . This method must construct - /// all s and notify of them through . - /// - /// Whether the user triggered this check. - /// The offset from the end time at which this check occurred. A > 0 - /// implies that this check occurred after the end time of . - protected virtual void CheckForJudgements(bool userTriggered, double timeOffset) { } - - protected override void Update() - { - base.Update(); - - var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; - - while (judgements.Count > 0) - { - var lastJudgement = judgements[judgements.Count - 1]; - if (lastJudgement.TimeOffset + endTime <= Time.Current) - break; - - judgements.RemoveAt(judgements.Count - 1); - State.Value = ArmedState.Idle; - - OnJudgementRemoved?.Invoke(this, lastJudgement); - } - } - - protected override void UpdateAfterChildren() - { - base.UpdateAfterChildren(); - - UpdateJudgement(false); - } - - protected override void AddNested(DrawableHitObject h) - { - base.AddNested(h); - - if (!(h is DrawableHitObject hWithJudgement)) - return; - - hWithJudgement.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); - hWithJudgement.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); - hWithJudgement.ApplyCustomUpdateState += (d, s) => ApplyCustomUpdateState?.Invoke(d, s); - } - - /// - /// Bind to apply a custom state which can override the default implementation. - /// - public event Action ApplyCustomUpdateState; - - protected abstract void UpdateState(ArmedState state); + protected void PlaySamples() => Samples.ForEach(s => s?.Play()); } } From 356bb5da1e5e63243174c84cfcdb7b2dbefc5839 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 13 Jan 2018 12:55:52 +0100 Subject: [PATCH 317/628] move sample logic up too --- .../Objects/Drawables/DrawableHitObject.cs | 88 +++++++++---------- 1 file changed, 40 insertions(+), 48 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index a29ea4cbbb..68766789e0 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -29,6 +29,12 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public virtual Color4 AccentColour { get; set; } = Color4.Gray; + // Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first + protected virtual string SampleNamespace => null; + + protected List Samples = new List(); + protected virtual IEnumerable GetSamples() => HitObject.Samples; + private List nestedHitObjects; public IReadOnlyList NestedHitObjects => nestedHitObjects; @@ -70,6 +76,35 @@ namespace osu.Game.Rulesets.Objects.Drawables HitObject = hitObject; } + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + var samples = GetSamples(); + if (samples.Any()) + { + if (HitObject.SampleControlPoint == null) + throw new ArgumentNullException(nameof(HitObject.SampleControlPoint), $"{nameof(HitObject)}s must always have an attached {nameof(HitObject.SampleControlPoint)}." + + $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}."); + + foreach (SampleInfo s in samples) + { + SampleInfo localSampleInfo = new SampleInfo + { + Bank = s.Bank ?? HitObject.SampleControlPoint.SampleBank, + Name = s.Name, + Volume = s.Volume > 0 ? s.Volume : HitObject.SampleControlPoint.SampleVolume + }; + + SampleChannel channel = localSampleInfo.GetChannel(audio.Sample, SampleNamespace); + + if (channel == null) + continue; + + Samples.Add(channel); + } + } + } + protected override void LoadComplete() { base.LoadComplete(); @@ -80,6 +115,9 @@ namespace osu.Game.Rulesets.Objects.Drawables // apply any custom state overrides ApplyCustomUpdateState?.Invoke(this, state); + + if (State == ArmedState.Hit) + PlaySamples(); }; State.TriggerChange(); @@ -92,6 +130,8 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public event Action ApplyCustomUpdateState; + protected void PlaySamples() => Samples.ForEach(s => s?.Play()); + protected override void Update() { base.Update(); @@ -208,58 +248,10 @@ namespace osu.Game.Rulesets.Objects.Drawables { public new readonly TObject HitObject; - protected List Samples = new List(); - protected virtual IEnumerable GetSamples() => HitObject.Samples; - - // Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first - protected virtual string SampleNamespace => null; - protected DrawableHitObject(TObject hitObject) : base(hitObject) { HitObject = hitObject; } - - [BackgroundDependencyLoader] - private void load(AudioManager audio) - { - var samples = GetSamples(); - if (samples.Any()) - { - if (HitObject.SampleControlPoint == null) - throw new ArgumentNullException(nameof(HitObject.SampleControlPoint), $"{nameof(HitObject)}s must always have an attached {nameof(HitObject.SampleControlPoint)}." - + $" This is an indication that {nameof(HitObject.ApplyDefaults)} has not been invoked on {this}."); - - foreach (SampleInfo s in samples) - { - SampleInfo localSampleInfo = new SampleInfo - { - Bank = s.Bank ?? HitObject.SampleControlPoint.SampleBank, - Name = s.Name, - Volume = s.Volume > 0 ? s.Volume : HitObject.SampleControlPoint.SampleVolume - }; - - SampleChannel channel = localSampleInfo.GetChannel(audio.Sample, SampleNamespace); - - if (channel == null) - continue; - - Samples.Add(channel); - } - } - } - - protected override void LoadComplete() - { - base.LoadComplete(); - - State.ValueChanged += state => - { - if (State == ArmedState.Hit) - PlaySamples(); - }; - } - - protected void PlaySamples() => Samples.ForEach(s => s?.Play()); } } From 7875f0cb01d44738480b071fd0e7625b41bfe51a Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 13 Jan 2018 16:15:41 +0100 Subject: [PATCH 318/628] remove unnecessary internal --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 68766789e0..e43ef1cc60 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -199,7 +199,7 @@ namespace osu.Game.Rulesets.Objects.Drawables /// /// Whether the user triggered this process. /// Whether a judgement has occurred from this or any nested s. - protected internal bool UpdateJudgement(bool userTriggered) + protected bool UpdateJudgement(bool userTriggered) { judgementOccurred = false; From 8ac6818639c93751a3b7212d05a987ead1bc4adc Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sat, 13 Jan 2018 13:05:23 +0100 Subject: [PATCH 319/628] expose IsHit --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index e43ef1cc60..af14c43a3f 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -49,6 +49,11 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public virtual bool DisplayJudgement => true; + /// + /// Whether this and all of its nested s have been hit. + /// + public bool IsHit => Judgements.Any(j => j.Final && j.IsHit) && (NestedHitObjects?.All(n => n.IsHit) ?? true); + /// /// Whether this and all of its nested s have been judged. /// From 43d2ae348a46974f43dd7a9b2106a797a7070c12 Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sat, 13 Jan 2018 22:25:09 +0300 Subject: [PATCH 320/628] Rename ReplaySomething -> PlayerSomething --- .../Visual/TestCaseReplaySettingsOverlay.cs | 8 +++---- osu.Game/Rulesets/Edit/ToolboxGroup.cs | 4 ++-- ...ngsOverlay.cs => PlayerSettingsOverlay.cs} | 10 ++++----- osu.Game/Screens/Play/HUDOverlay.cs | 12 +++++------ osu.Game/Screens/Play/Player.cs | 6 +++--- .../CollectionSettings.cs | 6 +++--- .../DiscussionSettings.cs | 6 +++--- .../PlaybackSettings.cs | 10 ++++----- .../PlayerCheckbox.cs} | 4 ++-- .../PlayerGroup.cs} | 10 ++++----- .../PlayerSliderBar.cs} | 10 ++++----- .../{HUD => PlayerSettings}/VisualSettings.cs | 21 +++++++++---------- osu.Game/osu.Game.csproj | 16 +++++++------- 13 files changed, 61 insertions(+), 62 deletions(-) rename osu.Game/Screens/Play/HUD/{ReplaySettingsOverlay.cs => PlayerSettingsOverlay.cs} (86%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/CollectionSettings.cs (87%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/DiscussionSettings.cs (85%) rename osu.Game/Screens/Play/{ReplaySettings => PlayerSettings}/PlaybackSettings.cs (88%) rename osu.Game/Screens/Play/{ReplaySettings/ReplayCheckbox.cs => PlayerSettings/PlayerCheckbox.cs} (82%) rename osu.Game/Screens/Play/{ReplaySettings/ReplayGroup.cs => PlayerSettings/PlayerGroup.cs} (94%) rename osu.Game/Screens/Play/{ReplaySettings/ReplaySliderBar.cs => PlayerSettings/PlayerSliderBar.cs} (87%) rename osu.Game/Screens/Play/{HUD => PlayerSettings}/VisualSettings.cs (79%) diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index a5d8019bc1..2d4f1831de 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -4,7 +4,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Play.HUD; -using osu.Game.Screens.Play.ReplaySettings; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Tests.Visual { @@ -14,7 +14,7 @@ namespace osu.Game.Tests.Visual { ExampleContainer container; - Add(new ReplaySettingsOverlay + Add(new PlayerSettingsOverlay { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual Text = @"Button", })); - AddStep(@"Add checkbox", () => container.Add(new ReplayCheckbox + AddStep(@"Add checkbox", () => container.Add(new PlayerCheckbox { LabelText = "Checkbox", })); @@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual })); } - private class ExampleContainer : ReplayGroup + private class ExampleContainer : PlayerGroup { protected override string Title => @"example"; } diff --git a/osu.Game/Rulesets/Edit/ToolboxGroup.cs b/osu.Game/Rulesets/Edit/ToolboxGroup.cs index 3b13cc38ab..e353191bc7 100644 --- a/osu.Game/Rulesets/Edit/ToolboxGroup.cs +++ b/osu.Game/Rulesets/Edit/ToolboxGroup.cs @@ -2,11 +2,11 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; -using osu.Game.Screens.Play.ReplaySettings; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Rulesets.Edit { - public class ToolboxGroup : ReplayGroup + public class ToolboxGroup : PlayerGroup { protected override string Title => "toolbox"; diff --git a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs similarity index 86% rename from osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs rename to osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 8fda843bdc..51cd3d55ab 100644 --- a/osu.Game/Screens/Play/HUD/ReplaySettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -3,14 +3,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Screens.Play.ReplaySettings; using OpenTK; using osu.Framework.Input; +using osu.Game.Screens.Play.PlayerSettings; using OpenTK.Input; namespace osu.Game.Screens.Play.HUD { - public class ReplaySettingsOverlay : VisibilityContainer + public class PlayerSettingsOverlay : VisibilityContainer { private const int fade_duration = 200; @@ -21,12 +21,12 @@ namespace osu.Game.Screens.Play.HUD //public readonly CollectionSettings CollectionSettings; //public readonly DiscussionSettings DiscussionSettings; - public ReplaySettingsOverlay() + public PlayerSettingsOverlay() { AlwaysPresent = true; RelativeSizeAxes = Axes.Both; - Child = new FillFlowContainer + Child = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new ReplayGroup[] + Children = new PlayerGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index f677734d04..bf3cf6b066 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -32,7 +32,7 @@ namespace osu.Game.Screens.Play public readonly HealthDisplay HealthDisplay; public readonly SongProgress Progress; public readonly ModDisplay ModDisplay; - public readonly ReplaySettingsOverlay ReplaySettingsOverlay; + public readonly PlayerSettingsOverlay PlayerSettingsOverlay; private Bindable showHud; private bool replayLoaded; @@ -56,7 +56,7 @@ namespace osu.Game.Screens.Play HealthDisplay = CreateHealthDisplay(), Progress = CreateProgress(), ModDisplay = CreateModsContainer(), - ReplaySettingsOverlay = CreateReplaySettingsOverlay(), + PlayerSettingsOverlay = CreatePlayerSettingsOverlay(), } }); } @@ -97,13 +97,13 @@ namespace osu.Game.Screens.Play replayLoaded = rulesetContainer.HasReplayLoaded; - ReplaySettingsOverlay.ReplayLoaded = replayLoaded; + PlayerSettingsOverlay.ReplayLoaded = replayLoaded; // in the case a replay isn't loaded, we want some elements to only appear briefly. if (!replayLoaded) { - ReplaySettingsOverlay.PlaybackSettings.Hide(); - ReplaySettingsOverlay.VisualSettings.Autohide = true; + PlayerSettingsOverlay.PlaybackSettings.Hide(); + PlayerSettingsOverlay.VisualSettings.Autohide = true; ModDisplay.Delay(2000).FadeOut(200); } } @@ -183,7 +183,7 @@ namespace osu.Game.Screens.Play Margin = new MarginPadding { Top = 20, Right = 10 }, }; - protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay(); + protected virtual PlayerSettingsOverlay CreatePlayerSettingsOverlay() => new PlayerSettingsOverlay(); public virtual void BindProcessor(ScoreProcessor processor) { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 3dcfd8b9c4..0218025e6b 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -230,9 +230,9 @@ namespace osu.Game.Screens.Play breakOverlay.BindProcessor(scoreProcessor); - hudOverlay.ReplaySettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; - hudOverlay.ReplaySettingsOverlay.VisualSettings.AudioClock = decoupledClock; - hudOverlay.ReplaySettingsOverlay.VisualSettings.FramedClock = offsetClock; + hudOverlay.PlayerSettingsOverlay.PlaybackSettings.AdjustableClock = adjustableSourceClock; + hudOverlay.PlayerSettingsOverlay.VisualSettings.AudioClock = decoupledClock; + hudOverlay.PlayerSettingsOverlay.VisualSettings.FramedClock = offsetClock; // Bind ScoreProcessor to ourselves scoreProcessor.AllJudged += onCompletion; diff --git a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs similarity index 87% rename from osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs index 9f29e085d1..4fca3649a2 100644 --- a/osu.Game/Screens/Play/ReplaySettings/CollectionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Overlays.Music; -using System.Collections.Generic; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class CollectionSettings : ReplayGroup + public class CollectionSettings : PlayerGroup { protected override string Title => @"collections"; diff --git a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs similarity index 85% rename from osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs index cc7ccac7f5..acfe3aa510 100644 --- a/osu.Game/Screens/Play/ReplaySettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs @@ -6,9 +6,9 @@ using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class DiscussionSettings : ReplayGroup + public class DiscussionSettings : PlayerGroup { protected override string Title => @"discussions"; @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.ReplaySettings { Children = new Drawable[] { - new ReplayCheckbox + new PlayerCheckbox { LabelText = "Show floating comments", Bindable = config.GetBindable(OsuSetting.FloatingComments) diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs similarity index 88% rename from osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index f8ac653f69..30f8d002d1 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -1,15 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Timing; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Timing; using osu.Game.Graphics.Sprites; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class PlaybackSettings : ReplayGroup + public class PlaybackSettings : PlayerGroup { private const int padding = 10; @@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.ReplaySettings public IAdjustableClock AdjustableClock { set; get; } - private readonly ReplaySliderBar sliderbar; + private readonly PlayerSliderBar sliderbar; public PlaybackSettings() { @@ -47,7 +47,7 @@ namespace osu.Game.Screens.Play.ReplaySettings } }, }, - sliderbar = new ReplaySliderBar + sliderbar = new PlayerSliderBar { Bindable = new BindableDouble(1) { diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs similarity index 82% rename from osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs index f0b9ff623a..89fbbb8bf2 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayCheckbox.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerCheckbox.cs @@ -5,9 +5,9 @@ using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class ReplayCheckbox : OsuCheckbox + public class PlayerCheckbox : OsuCheckbox { [BackgroundDependencyLoader] private void load(OsuColour colours) diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs similarity index 94% rename from osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs index 3bd2928528..bf17e18482 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplayGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2018 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.Graphics; using osu.Framework.Graphics.Containers; @@ -10,10 +8,12 @@ using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; +using OpenTK; +using OpenTK.Graphics; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public abstract class ReplayGroup : Container + public abstract class PlayerGroup : Container { /// /// The title to be displayed in the header of this group. @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play.ReplaySettings private Color4 buttonActiveColour; - protected ReplayGroup() + protected PlayerGroup() { AutoSizeAxes = Axes.Y; Width = container_width; diff --git a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs similarity index 87% rename from osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs index e6e909183d..4496523a13 100644 --- a/osu.Game/Screens/Play/ReplaySettings/ReplaySliderBar.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs @@ -1,16 +1,16 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Allocation; -using osu.Game.Graphics.UserInterface; using System; -using osu.Game.Graphics; +using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; using osu.Game.Overlays.Settings; -namespace osu.Game.Screens.Play.ReplaySettings +namespace osu.Game.Screens.Play.PlayerSettings { - public class ReplaySliderBar : SettingsSlider + public class PlayerSliderBar : SettingsSlider where T : struct, IEquatable { protected override Drawable CreateControl() => new Sliderbar diff --git a/osu.Game/Screens/Play/HUD/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs similarity index 79% rename from osu.Game/Screens/Play/HUD/VisualSettings.cs rename to osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 15efd22eeb..4e5f447b5f 100644 --- a/osu.Game/Screens/Play/HUD/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -8,11 +8,10 @@ using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; -using osu.Game.Screens.Play.ReplaySettings; -namespace osu.Game.Screens.Play.HUD +namespace osu.Game.Screens.Play.PlayerSettings { - public class VisualSettings : ReplayGroup + public class VisualSettings : PlayerGroup { protected override string Title => "Visual settings"; @@ -37,10 +36,10 @@ namespace osu.Game.Screens.Play.HUD private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(3); private Stopwatch hideStopWatch; - private readonly ReplaySliderBar dimSliderBar; - private readonly ReplaySliderBar blurSliderBar; - private readonly ReplayCheckbox showStoryboardToggle; - private readonly ReplayCheckbox mouseWheelDisabledToggle; + private readonly PlayerSliderBar dimSliderBar; + private readonly PlayerSliderBar blurSliderBar; + private readonly PlayerCheckbox showStoryboardToggle; + private readonly PlayerCheckbox mouseWheelDisabledToggle; public VisualSettings() { @@ -50,18 +49,18 @@ namespace osu.Game.Screens.Play.HUD { Text = "Background dim:" }, - dimSliderBar = new ReplaySliderBar(), + dimSliderBar = new PlayerSliderBar(), new OsuSpriteText { Text = "Background blur:" }, - blurSliderBar = new ReplaySliderBar(), + blurSliderBar = new PlayerSliderBar(), new OsuSpriteText { Text = "Toggles:" }, - showStoryboardToggle = new ReplayCheckbox { LabelText = "Storyboards" }, - mouseWheelDisabledToggle = new ReplayCheckbox { LabelText = "Disable mouse wheel" } + showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboards" }, + mouseWheelDisabledToggle = new PlayerCheckbox { LabelText = "Disable mouse wheel" } }; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 693205b66d..ee4ed1312d 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -315,7 +315,7 @@ - + @@ -743,13 +743,13 @@ - - - - - - - + + + + + + + From 6e35484160b86fbb827476a394dd208b581407ed Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Sat, 13 Jan 2018 23:09:43 +0300 Subject: [PATCH 321/628] Fix osu.Game.csproj which was broken during resolving merge conflict --- osu.Game/osu.Game.csproj | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index ee4ed1312d..b716a137c2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -265,10 +265,12 @@ + + @@ -310,12 +312,24 @@ + + + + + + + + + + + + @@ -616,7 +630,6 @@ - @@ -667,16 +680,11 @@ - - - - - @@ -881,4 +889,4 @@ - \ No newline at end of file + From e947e4656642b4d1c62a4fefb16cdece398ff781 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 11:41:52 +0900 Subject: [PATCH 322/628] fix : 1. Add space before {, before Duration, and after 1000 2. How about just ManiaStage? 3. This is really just Columns.Count, you're not saving much with this extra variable here. --- .../Tests/TestCaseManiaHitObjects.cs | 2 +- osu.Game.Rulesets.Mania/UI/Column.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 24 +++++++++---------- .../UI/{ManiaColumnStage.cs => ManiaStage.cs} | 11 ++++----- .../osu.Game.Rulesets.Mania.csproj | 2 +- 5 files changed, 20 insertions(+), 23 deletions(-) rename osu.Game.Rulesets.Mania/UI/{ManiaColumnStage.cs => ManiaStage.cs} (93%) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs index 4a26b1510c..0e6d40dc67 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaHitObjects.cs @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests RelativeChildSize = new Vector2(1, 10000), Children = new[] { - new DrawableHoldNote(new HoldNote{Duration = 1000}, ManiaAction.Key1) + new DrawableHoldNote(new HoldNote { Duration = 1000 } , ManiaAction.Key1) { Y = 5000, Height = 1000, diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 97600632f1..c2dd86d35d 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Hit target + hit objects", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = ManiaColumnStage.HIT_TARGET_POSITION }, + Padding = new MarginPadding { Top = ManiaStage.HIT_TARGET_POSITION }, Children = new Drawable[] { new Container @@ -115,7 +115,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Key", RelativeSizeAxes = Axes.X, - Height = ManiaColumnStage.HIT_TARGET_POSITION, + Height = ManiaStage.HIT_TARGET_POSITION, Children = new Drawable[] { new Box diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3125a01528..8f4d5b04b5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// list mania column stages /// - private readonly FillFlowContainer listColumnStages; + private readonly FillFlowContainer Stages; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. @@ -37,17 +37,17 @@ namespace osu.Game.Rulesets.Mania.UI /// public SpecialColumnPosition SpecialColumnPosition { - get => listColumnStages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + get => Stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; set { - foreach (var singleStage in listColumnStages) + foreach (var singleStage in Stages) { singleStage.SpecialColumnPosition = value; } } } - public List Columns => listColumnStages.SelectMany(x => x.Columns).ToList(); + public List Columns => Stages.SelectMany(x => x.Columns).ToList(); private readonly int columnCount; @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.UI InternalChildren = new Drawable[] { - listColumnStages = new FillFlowContainer + Stages = new FillFlowContainer { Name="Stages", Direction = FillDirection.Horizontal, @@ -78,10 +78,10 @@ namespace osu.Game.Rulesets.Mania.UI foreach (var stage in stages) { - var drawableStage = new ManiaColumnStage(stage.Columns); + var drawableStage = new ManiaStage(); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - listColumnStages.Add(drawableStage); + Stages.Add(drawableStage); AddNested(drawableStage); for (int i = 0; i < stage.Columns; i++) @@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Mania.UI { Scale = new Vector2(1, newValue ? -1 : 1); - foreach (var single in listColumnStages) + foreach (var single in Stages) { single.Judgements.Scale = Scale; } @@ -124,18 +124,18 @@ namespace osu.Game.Rulesets.Mania.UI public void Add(BarLine barline) { - foreach (var single in listColumnStages) + foreach (var single in Stages) { single.HitObjects.Add(new DrawableBarLine(barline)); } } - private ManiaColumnStage getFallDownControlContainerByActualColumn(int actualColumn) + private ManiaStage getFallDownControlContainerByActualColumn(int actualColumn) { int sum = 0; - foreach (var single in listColumnStages) + foreach (var single in Stages) { - sum = sum + single.ColumnCount; + sum = sum + single.Columns.Count(); if (sum > actualColumn) { return single; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs similarity index 93% rename from osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs rename to osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 99f171947c..b2f6460914 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaColumnStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// A collection of s. /// - internal class ManiaColumnStage : ScrollingPlayfield + internal class ManiaStage : ScrollingPlayfield { public const float HIT_TARGET_POSITION = 50; @@ -53,12 +53,9 @@ namespace osu.Game.Rulesets.Mania.UI private List normalColumnColours = new List(); private Color4 specialColumnColour; - public readonly int ColumnCount; - - public ManiaColumnStage(int columnCount) + public ManiaStage() : base(ScrollingDirection.Up) { - ColumnCount = columnCount; Name = "Playfield elements"; Anchor = Anchor.TopCentre; Origin = Anchor.TopCentre; @@ -142,11 +139,11 @@ namespace osu.Game.Rulesets.Mania.UI { default: case SpecialColumnPosition.Normal: - return ColumnCount % 2 == 1 && column == ColumnCount / 2; + return columns.Count % 2 == 1 && column == columns.Count / 2; case SpecialColumnPosition.Left: return column == 0; case SpecialColumnPosition.Right: - return column == ColumnCount - 1; + return column == columns.Count - 1; } } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index c81a6bb2ea..ae29484161 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -115,7 +115,7 @@ - + From 4f0e1f03d2ac835d29562a16f4da4129598e3e1f Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 11:49:23 +0900 Subject: [PATCH 323/628] fix the problem that smoogipoo suggest 1. Rename to stages 2. This should be checking for null or 0, with two exceptions: 3. Space before and after =. 4. foreach (var stage ... 5. Rename to getStageByColumn, and actualColumn -> column. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 43 +++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 8f4d5b04b5..00dd082454 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -23,9 +23,9 @@ namespace osu.Game.Rulesets.Mania.UI public class ManiaPlayfield : ScrollingPlayfield { /// - /// list mania column stages + /// s contained by this . /// - private readonly FillFlowContainer Stages; + private readonly FillFlowContainer stages; /// /// Whether this playfield should be inverted. This flips everything inside the playfield. @@ -37,35 +37,38 @@ namespace osu.Game.Rulesets.Mania.UI /// public SpecialColumnPosition SpecialColumnPosition { - get => Stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; + get => stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; set { - foreach (var singleStage in Stages) + foreach (var singleStage in stages) { singleStage.SpecialColumnPosition = value; } } } - public List Columns => Stages.SelectMany(x => x.Columns).ToList(); + public List Columns => stages.SelectMany(x => x.Columns).ToList(); private readonly int columnCount; - public ManiaPlayfield(List stages) + public ManiaPlayfield(List stageDefinition) : base(ScrollingDirection.Up) { - if (stages.Count <= 0) + if (stageDefinition ==null) + throw new ArgumentNullException(); + + if (stageDefinition.Count <= 0) throw new ArgumentException("Can't have zero or fewer columns."); Inverted.Value = true; - var stageSpacing = 300 / stages.Count; + var stageSpacing = 300 / stageDefinition.Count; InternalChildren = new Drawable[] { - Stages = new FillFlowContainer + this.stages = new FillFlowContainer { - Name="Stages", + Name = "Stages", Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, Anchor = Anchor.Centre, @@ -76,12 +79,12 @@ namespace osu.Game.Rulesets.Mania.UI var currentAction = ManiaAction.Key1; - foreach (var stage in stages) + foreach (var stage in stageDefinition) { var drawableStage = new ManiaStage(); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - Stages.Add(drawableStage); + this.stages.Add(drawableStage); AddNested(drawableStage); for (int i = 0; i < stage.Columns; i++) @@ -105,7 +108,7 @@ namespace osu.Game.Rulesets.Mania.UI { Scale = new Vector2(1, newValue ? -1 : 1); - foreach (var single in Stages) + foreach (var single in stages) { single.Judgements.Scale = Scale; } @@ -117,28 +120,28 @@ namespace osu.Game.Rulesets.Mania.UI int column = maniaObject.Column; Columns[column].OnJudgement(judgedObject, judgement); - getFallDownControlContainerByActualColumn(column).AddJudgement(judgement); + getStageByColumn(column).AddJudgement(judgement); } public override void Add(DrawableHitObject h) => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); public void Add(BarLine barline) { - foreach (var single in Stages) + foreach (var single in stages) { single.HitObjects.Add(new DrawableBarLine(barline)); } } - private ManiaStage getFallDownControlContainerByActualColumn(int actualColumn) + private ManiaStage getStageByColumn(int column) { int sum = 0; - foreach (var single in Stages) + foreach (var stage in stages) { - sum = sum + single.Columns.Count(); - if (sum > actualColumn) + sum = sum + stage.Columns.Count(); + if (sum > column) { - return single; + return stage; } } From f7a908fbfa694c63070216a136f4b175019a1ba8 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 12:08:09 +0900 Subject: [PATCH 324/628] Fix : This (along with OnJudgement above) should be done in the following three steps: . i'm not sure does it means the code i write --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 23 ++++++++++++-------- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 16 +++++++++++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 00dd082454..18d2f83fd9 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -4,14 +4,11 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects; using OpenTK; -using OpenTK.Graphics; using osu.Framework.Graphics.Containers; using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Configuration; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects.Drawables; @@ -79,12 +76,14 @@ namespace osu.Game.Rulesets.Mania.UI var currentAction = ManiaAction.Key1; + int stageIndex = 0; foreach (var stage in stageDefinition) { var drawableStage = new ManiaStage(); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - - this.stages.Add(drawableStage); + drawableStage.ColumnStartIndex = stageIndex; + + stages.Add(drawableStage); AddNested(drawableStage); for (int i = 0; i < stage.Columns; i++) @@ -98,6 +97,8 @@ namespace osu.Game.Rulesets.Mania.UI drawableStage.AddColumn(c); AddNested(c); } + + stageIndex = stageIndex + stage.Columns; } Inverted.ValueChanged += invertedChanged; @@ -118,12 +119,16 @@ namespace osu.Game.Rulesets.Mania.UI { var maniaObject = (ManiaHitObject)judgedObject.HitObject; int column = maniaObject.Column; - Columns[column].OnJudgement(judgedObject, judgement); - - getStageByColumn(column).AddJudgement(judgement); + getStageByColumn(column).AddJudgement(judgedObject,judgement); } - public override void Add(DrawableHitObject h) => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); + public override void Add(DrawableHitObject h) + { + // => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h) + int column = ((ManiaHitObject)h.HitObject).Column; + var stage = getStageByColumn(column); + stage.Add(h); + } public void Add(BarLine barline) { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index b2f6460914..dee0b8a5bb 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -10,6 +10,8 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; using OpenTK; using OpenTK.Graphics; @@ -53,6 +55,8 @@ namespace osu.Game.Rulesets.Mania.UI private List normalColumnColours = new List(); private Color4 specialColumnColour; + public int ColumnStartIndex; + public ManiaStage() : base(ScrollingDirection.Up) { @@ -160,8 +164,18 @@ namespace osu.Game.Rulesets.Mania.UI }; } - public void AddJudgement(Judgement judgement) + public override void Add(DrawableHitObject h) { + int index = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex; + Columns.ElementAt(index).Add(h); + } + + public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement) + { + var maniaObject = (ManiaHitObject)judgedObject.HitObject; + int column = maniaObject.Column - ColumnStartIndex; + columns[column].OnJudgement(judgedObject, judgement); + judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) { From d07636a10589a7c14c02e9fc90ffaf34689dd0a8 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 12:49:01 +0900 Subject: [PATCH 325/628] Fix : 1. This (along with OnJudgement above) should be done in the following three steps: 2. How about giving the stages an Inverted BindableBool, and having them decide their scale? --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 16 ++---------- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 27 +++++++++++++++----- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 18d2f83fd9..5c6f6b4408 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -81,8 +81,9 @@ namespace osu.Game.Rulesets.Mania.UI { var drawableStage = new ManiaStage(); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); + drawableStage.Inverted.BindTo(Inverted); drawableStage.ColumnStartIndex = stageIndex; - + stages.Add(drawableStage); AddNested(drawableStage); @@ -100,19 +101,6 @@ namespace osu.Game.Rulesets.Mania.UI stageIndex = stageIndex + stage.Columns; } - - Inverted.ValueChanged += invertedChanged; - Inverted.TriggerChange(); - } - - private void invertedChanged(bool newValue) - { - Scale = new Vector2(1, newValue ? -1 : 1); - - foreach (var single in stages) - { - single.Judgements.Scale = Scale; - } } public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index dee0b8a5bb..408103458e 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -25,6 +26,11 @@ namespace osu.Game.Rulesets.Mania.UI { public const float HIT_TARGET_POSITION = 50; + /// + /// Whether this playfield should be inverted. This flips everything inside the playfield. + /// + public readonly Bindable Inverted = new Bindable(true); + private SpecialColumnPosition specialColumnPosition; /// @@ -61,8 +67,8 @@ namespace osu.Game.Rulesets.Mania.UI : base(ScrollingDirection.Up) { Name = "Playfield elements"; - Anchor = Anchor.TopCentre; - Origin = Anchor.TopCentre; + Anchor = Anchor.Centre; + Origin = Anchor.Centre; //RelativeSizeAxes = Axes.Y; //AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] @@ -130,6 +136,15 @@ namespace osu.Game.Rulesets.Mania.UI } } }; + + Inverted.ValueChanged += invertedChanged; + Inverted.TriggerChange(); + } + + private void invertedChanged(bool newValue) + { + Scale = new Vector2(1, newValue ? -1 : 1); + Judgements.Scale = Scale; } /// @@ -166,15 +181,15 @@ namespace osu.Game.Rulesets.Mania.UI public override void Add(DrawableHitObject h) { - int index = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex; - Columns.ElementAt(index).Add(h); + int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex; + Columns.ElementAt(columnIndex).Add(h); } public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement) { var maniaObject = (ManiaHitObject)judgedObject.HitObject; - int column = maniaObject.Column - ColumnStartIndex; - columns[column].OnJudgement(judgedObject, judgement); + int columnIndex = maniaObject.Column - ColumnStartIndex; + columns[columnIndex].OnJudgement(judgedObject, judgement); judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) From 58bf611d174a9ad5c3007c12e0fac03a359577bc Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 12:51:55 +0900 Subject: [PATCH 326/628] This should be done in the stage instead of the playfield. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 1 - osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 5c6f6b4408..5cc702b279 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -96,7 +96,6 @@ namespace osu.Game.Rulesets.Mania.UI }; drawableStage.AddColumn(c); - AddNested(c); } stageIndex = stageIndex + stage.Columns; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 408103458e..d188ec9790 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -171,6 +171,7 @@ namespace osu.Game.Rulesets.Mania.UI c.VisibleTimeRange.BindTo(VisibleTimeRange); topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); columns.Add(c); + AddNested(c); Margin = new MarginPadding { From 5ecfc3a57c53f0ca1bdb6f4650a607d701304640 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 13:06:37 +0900 Subject: [PATCH 327/628] fix CI error --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 5cc702b279..d633e4585e 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -46,8 +46,6 @@ namespace osu.Game.Rulesets.Mania.UI public List Columns => stages.SelectMany(x => x.Columns).ToList(); - private readonly int columnCount; - public ManiaPlayfield(List stageDefinition) : base(ScrollingDirection.Up) { @@ -63,7 +61,7 @@ namespace osu.Game.Rulesets.Mania.UI InternalChildren = new Drawable[] { - this.stages = new FillFlowContainer + stages = new FillFlowContainer { Name = "Stages", Direction = FillDirection.Horizontal, From 2d266a860486402a863749644387a49e2b6ac8af Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 20:44:17 +0900 Subject: [PATCH 328/628] fix : 1. Instead of this property, turn SpecialColumnPosition into a 2. special column does not display --- .../Tests/TestCaseManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 12 +--- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 59 ++++++++----------- 3 files changed, 27 insertions(+), 46 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 4950862c09..9f30427045 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -121,9 +121,9 @@ namespace osu.Game.Rulesets.Mania.Tests { Anchor = Anchor.Centre, Origin = Anchor.Centre, - SpecialColumnPosition = specialPos }); + playfield.SpecialColumnPosition.Value = specialPos; playfield.Inverted.Value = inverted; return playfield; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index d633e4585e..f3131ec50a 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -32,17 +32,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// The style to use for the special column. /// - public SpecialColumnPosition SpecialColumnPosition - { - get => stages.FirstOrDefault()?.SpecialColumnPosition ?? SpecialColumnPosition.Normal; - set - { - foreach (var singleStage in stages) - { - singleStage.SpecialColumnPosition = value; - } - } - } + public Bindable SpecialColumnPosition = new Bindable(); public List Columns => stages.SelectMany(x => x.Columns).ToList(); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index d188ec9790..ce154e05e6 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -31,21 +31,7 @@ namespace osu.Game.Rulesets.Mania.UI /// public readonly Bindable Inverted = new Bindable(true); - private SpecialColumnPosition specialColumnPosition; - - /// - /// The style to use for the special column. - /// - public SpecialColumnPosition SpecialColumnPosition - { - get { return specialColumnPosition; } - set - { - if (IsLoaded) - throw new InvalidOperationException($"Setting {nameof(SpecialColumnPosition)} after the playfield is loaded requires re-creating the playfield."); - specialColumnPosition = value; - } - } + public readonly Bindable SpecialColumn = new Bindable(); public IEnumerable Columns => columns.Children; private readonly FillFlowContainer columns; @@ -147,25 +133,6 @@ namespace osu.Game.Rulesets.Mania.UI Judgements.Scale = Scale; } - /// - /// Whether the column index is a special column for this playfield. - /// - /// The 0-based column index. - /// Whether the column is a special column. - private bool isSpecialColumn(int column) - { - switch (SpecialColumnPosition) - { - default: - case SpecialColumnPosition.Normal: - return columns.Count % 2 == 1 && column == columns.Count / 2; - case SpecialColumnPosition.Left: - return column == 0; - case SpecialColumnPosition.Right: - return column == columns.Count - 1; - } - } - public void AddColumn(Column c) { c.VisibleTimeRange.BindTo(VisibleTimeRange); @@ -180,6 +147,25 @@ namespace osu.Game.Rulesets.Mania.UI }; } + /// + /// Whether the column index is a special column for this playfield. + /// + /// The 0-based column index. + /// Whether the column is a special column. + private bool isSpecialColumn(int column) + { + switch (SpecialColumn.Value) + { + default: + case SpecialColumnPosition.Normal: + return columns.Count % 2 == 1 && column == columns.Count / 2; + case SpecialColumnPosition.Left: + return column == 0; + case SpecialColumnPosition.Right: + return column == columns.Count - 1; + } + } + public override void Add(DrawableHitObject h) { int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex; @@ -203,6 +189,11 @@ namespace osu.Game.Rulesets.Mania.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { + for (int i = 0; i < columns.Count; i++) + { + columns[i].IsSpecial = isSpecialColumn(i); + } + normalColumnColours = new List { colours.RedDark, From cf0d9e4d9b37d19d6d6798819349b3936ae5bf9a Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 21:20:01 +0900 Subject: [PATCH 329/628] not sure is it a goodway to delete mania ManiaAction.Special or add more --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 2 ++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 2 -- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 5e12ef5581..14f8ce7427 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -19,6 +19,8 @@ namespace osu.Game.Rulesets.Mania { [Description("Special")] Special, + [Description("Special")] + Specia2, [Description("Key 1")] Key1 = 10, [Description("Key 2")] diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index e8b9828bff..e05b320b95 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Mania bindings.Add(new KeyBinding(rightKeys[i], currentKey++)); if (variant % 2 == 1) - bindings.Add(new KeyBinding(InputKey.Space, ManiaAction.Special)); + bindings.Insert(variant / 2, new KeyBinding(InputKey.Space, ManiaAction.Special)); return bindings; } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index f3131ec50a..bd7f6b7b9d 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -32,7 +32,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// The style to use for the special column. /// - public Bindable SpecialColumnPosition = new Bindable(); + public Bindable SpecialColumnPosition = new Bindable(); public List Columns => stages.SelectMany(x => x.Columns).ToList(); @@ -68,6 +68,7 @@ namespace osu.Game.Rulesets.Mania.UI foreach (var stage in stageDefinition) { var drawableStage = new ManiaStage(); + drawableStage.SpecialColumn.BindTo(SpecialColumnPosition); drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); drawableStage.Inverted.BindTo(Inverted); drawableStage.ColumnStartIndex = stageIndex; @@ -99,7 +100,6 @@ namespace osu.Game.Rulesets.Mania.UI public override void Add(DrawableHitObject h) { - // => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h) int column = ((ManiaHitObject)h.HitObject).Column; var stage = getStageByColumn(column); stage.Add(h); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index ce154e05e6..78d8376b6c 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -55,8 +55,6 @@ namespace osu.Game.Rulesets.Mania.UI Name = "Playfield elements"; Anchor = Anchor.Centre; Origin = Anchor.Centre; - //RelativeSizeAxes = Axes.Y; - //AutoSizeAxes = Axes.X; InternalChildren = new Drawable[] { new Container From 999386497a0d7ad67740b1af70c11548a17368d6 Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 21:35:35 +0900 Subject: [PATCH 330/628] implement co-op mod --- .../Beatmaps/ManiaBeatmap.cs | 4 +-- .../Beatmaps/ManiaBeatmapConverter.cs | 12 ++++++++- .../Mods/ManiaModKeyCoop.cs | 26 ++++++++++++++++++- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs index d775cb392f..c376e2a47b 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -25,9 +25,9 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// Creates a new . /// /// The initial stage. - public ManiaBeatmap(StageDefinition initialStage) + public ManiaBeatmap(List stages) { - Stages.Add(initialStage); + Stages = stages; } } } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 557ce5eb1b..eaa57666fe 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; public int TargetColumns; + public List StageDefinitions; public readonly bool IsForCurrentRuleset; private Pattern lastPattern = new Pattern(); @@ -66,7 +67,16 @@ namespace osu.Game.Rulesets.Mania.Beatmaps return base.ConvertBeatmap(original); } - protected override Beatmap CreateBeatmap() => beatmap = new ManiaBeatmap(new StageDefinition { Columns = TargetColumns }); + protected override Beatmap CreateBeatmap() + { + if(StageDefinitions==null) + StageDefinitions=new List() + { + new StageDefinition { Columns = TargetColumns } + }; + + return beatmap = new ManiaBeatmap(StageDefinitions); + } protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 893e81f165..33da82ba94 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -1,16 +1,40 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mods; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod + public class ManiaModKeyCoop : Mod, IApplicableToBeatmapConverter { public override string Name => "KeyCoop"; public override string ShortenedName => "2P"; public override string Description => @"Double the key amount, double the fun!"; public override double ScoreMultiplier => 1; public override bool Ranked => true; + + public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) + { + var mbc = (ManiaBeatmapConverter)beatmapConverter; + + // Although this can work, for now let's not allow keymods for mania-specific beatmaps + if (mbc.IsForCurrentRuleset) + return; + + int originTargetColumns = mbc.TargetColumns; + + var newStages = new List() + { + new StageDefinition() { Columns = originTargetColumns }, + new StageDefinition() { Columns = originTargetColumns }, + }; + + mbc.StageDefinitions = newStages; + mbc.TargetColumns = originTargetColumns * 2; + } } } From bbb741245e1446c55bc87c02e13a58a0eabaf83d Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Sun, 14 Jan 2018 21:51:07 +0900 Subject: [PATCH 331/628] fix CI error --- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs | 4 ++-- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 4 ++-- osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs index c376e2a47b..69c85fec87 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// /// The definitions for each stage in a . /// - public readonly List Stages = new List(); + public readonly List Stages; /// /// Total number of columns represented by all stages in this . @@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// /// Creates a new . /// - /// The initial stage. + /// The initial stages. public ManiaBeatmap(List stages) { Stages = stages; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index eaa57666fe..e5a444533d 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -69,8 +69,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps protected override Beatmap CreateBeatmap() { - if(StageDefinitions==null) - StageDefinitions=new List() + if (StageDefinitions == null) + StageDefinitions = new List { new StageDefinition { Columns = TargetColumns } }; diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 33da82ba94..01fe9863e9 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -27,10 +27,10 @@ namespace osu.Game.Rulesets.Mania.Mods int originTargetColumns = mbc.TargetColumns; - var newStages = new List() + var newStages = new List { - new StageDefinition() { Columns = originTargetColumns }, - new StageDefinition() { Columns = originTargetColumns }, + new StageDefinition { Columns = originTargetColumns }, + new StageDefinition { Columns = originTargetColumns }, }; mbc.StageDefinitions = newStages; From 43f8a8e8c57adc0266412687d65c6d8cb3037505 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 14:00:13 +0900 Subject: [PATCH 332/628] Rename OsuCursorVisualiser -> CursorOverrideContainer --- ...uCursorVisualiser.cs => CursorOverrideContainer.cs} | 6 +++--- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 10 +++++----- osu.Game/osu.Game.csproj | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) rename osu.Game/Graphics/Cursor/{OsuCursorVisualiser.cs => CursorOverrideContainer.cs} (85%) diff --git a/osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs similarity index 85% rename from osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs rename to osu.Game/Graphics/Cursor/CursorOverrideContainer.cs index 2b2ab593aa..5035020492 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorVisualiser.cs +++ b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs @@ -10,9 +10,9 @@ using osu.Framework.Input; namespace osu.Game.Graphics.Cursor { /// - /// Visualises different cursors depending on the currently-hovered s. + /// A container which provides a which can be overridden by hovered s. /// - public class OsuCursorVisualiser : Container, IProvideCursor + public class CursorOverrideContainer : Container, IProvideCursor { protected override Container Content => content; private readonly Container content; @@ -25,7 +25,7 @@ namespace osu.Game.Graphics.Cursor public CursorContainer Cursor { get; } public bool ProvidesUserCursor => true; - public OsuCursorVisualiser() + public CursorOverrideContainer() { AddRangeInternal(new Drawable[] { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 3dda26fc02..124b9364b3 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -445,7 +445,7 @@ namespace osu.Game mainContent.Padding = new MarginPadding { Top = ToolbarOffset }; - CursorVisualiser.CanShowCursor = currentScreen?.CursorVisible ?? false; + CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; } private void screenAdded(Screen newScreen) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 61ad4024f0..ef02f1a7ec 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,7 +44,7 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; - protected OsuCursorVisualiser CursorVisualiser; + protected CursorOverrideContainer CursorOverrideContainer; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -211,14 +211,14 @@ namespace osu.Game GlobalKeyBindingInputManager globalBinding; - CursorVisualiser = new OsuCursorVisualiser { RelativeSizeAxes = Axes.Both }; - CursorVisualiser.Child = globalBinding = new GlobalKeyBindingInputManager(this) + CursorOverrideContainer = new CursorOverrideContainer { RelativeSizeAxes = Axes.Both }; + CursorOverrideContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) { RelativeSizeAxes = Axes.Both, - Child = content = new OsuTooltipContainer(CursorVisualiser.Cursor) { RelativeSizeAxes = Axes.Both } + Child = content = new OsuTooltipContainer(CursorOverrideContainer.Cursor) { RelativeSizeAxes = Axes.Both } }; - base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorVisualiser }); + base.Content.Add(new DrawSizePreservingFillContainer { Child = CursorOverrideContainer }); KeyBindingStore.Register(globalBinding); dependencies.Cache(globalBinding); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index fd53a211e0..7b97d46531 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -377,7 +377,7 @@ - + From 7c419251440240847ae22afbbcd5a91c0de532ff Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 14:07:09 +0900 Subject: [PATCH 333/628] ProvidesUserCursor -> ProvidingUserCursor, and update xmldoc --- osu.Game/Graphics/Cursor/CursorOverrideContainer.cs | 4 ++-- osu.Game/Graphics/Cursor/IProvideCursor.cs | 7 ++++--- osu.Game/Screens/Play/Player.cs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs index 5035020492..4b29414990 100644 --- a/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs +++ b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs @@ -23,7 +23,7 @@ namespace osu.Game.Graphics.Cursor public bool CanShowCursor; public CursorContainer Cursor { get; } - public bool ProvidesUserCursor => true; + public bool ProvidingUserCursor => true; public CursorOverrideContainer() { @@ -53,7 +53,7 @@ namespace osu.Game.Graphics.Cursor return; } - var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidesUserCursor) ?? this; + var newTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(t => t.ProvidingUserCursor) ?? this; if (currentTarget == newTarget) return; diff --git a/osu.Game/Graphics/Cursor/IProvideCursor.cs b/osu.Game/Graphics/Cursor/IProvideCursor.cs index b36155a881..91b44234fb 100644 --- a/osu.Game/Graphics/Cursor/IProvideCursor.cs +++ b/osu.Game/Graphics/Cursor/IProvideCursor.cs @@ -12,14 +12,15 @@ namespace osu.Game.Graphics.Cursor public interface IProvideCursor : IDrawable { /// - /// The cursor provided by this . + /// The cursor provided by this . /// May be null if no cursor should be visible. /// CursorContainer Cursor { get; } /// - /// Whether the cursor provided by this should be displayed as the user's cursor. + /// Whether should be displayed as the singular user cursor. This will temporarily hide any other user cursor. + /// This value is checked every frame and may be used to control whether multiple cursors are displayed (e.g. watching replays). /// - bool ProvidesUserCursor { get; } + bool ProvidingUserCursor { get; } } } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index a93c616c6a..2ee58980f1 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -52,7 +52,7 @@ namespace osu.Game.Screens.Play public int RestartCount; public CursorContainer Cursor => RulesetContainer.Cursor; - public bool ProvidesUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded; + public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded; private IAdjustableClock adjustableSourceClock; private FramedOffsetClock offsetClock; From bfdfb52666015517059421009fdcdb7175d36316 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:28:08 +0900 Subject: [PATCH 334/628] Fix a few usages of AllJudged possibly not being correct --- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs | 2 +- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 58f024870d..57a4888b2b 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -150,7 +150,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables holdStartTime = null; // If the key has been released too early, the user should not receive full score for the release - if (!tail.AllJudged) + if (!tail.IsHit) hasBroken = true; return true; diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs index 2fa6c8ed95..29d464f614 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRoll.cs @@ -81,7 +81,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (timeOffset < 0) return; - int countHit = NestedHitObjects.Count(o => o.AllJudged); + int countHit = NestedHitObjects.Count(o => o.IsHit); if (countHit > HitObject.RequiredGoodHits) { From 9f9898355055dde7b140f3adcd358ed4fd808504 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:36:36 +0900 Subject: [PATCH 335/628] Remove gravity mod Not sure how this made it back in here. --- .../Mods/ManiaModGravity.cs | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs deleted file mode 100644 index e6967cd605..0000000000 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModGravity.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System.Collections.Generic; -using System.Linq; -using osu.Game.Graphics; -using osu.Game.Rulesets.Mania.Objects; -using osu.Game.Rulesets.Mania.Timing; -using osu.Game.Rulesets.Mania.UI; -using osu.Game.Rulesets.Mods; -using osu.Game.Rulesets.Timing; - -namespace osu.Game.Rulesets.Mania.Mods -{ - public class ManiaModGravity : Mod, IGenerateSpeedAdjustments - { - public override string Name => "Gravity"; - public override string ShortenedName => "GR"; - - public override double ScoreMultiplier => 0; - - public override FontAwesome Icon => FontAwesome.fa_sort_desc; - - public void ApplyToRulesetContainer(ManiaRulesetContainer rulesetContainer, ref List[] hitObjectTimingChanges, - ref List barlineTimingChanges) - { - // We have to generate one speed adjustment per hit object for gravity - foreach (var obj in rulesetContainer.Objects.OfType()) - { - var controlPoint = rulesetContainer.CreateControlPointAt(obj.StartTime); - // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now - controlPoint.TimingPoint.BeatLength = 1000; - - hitObjectTimingChanges[obj.Column].Add(new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Gravity)); - } - - // Like with hit objects, we need to generate one speed adjustment per bar line - foreach (var barLine in rulesetContainer.BarLines) - { - var controlPoint = rulesetContainer.CreateControlPointAt(barLine.StartTime); - // Beat length has too large of an effect for gravity, so we'll force it to a constant value for now - controlPoint.TimingPoint.BeatLength = 1000; - - barlineTimingChanges.Add(new ManiaSpeedAdjustmentContainer(controlPoint, ScrollingAlgorithm.Gravity)); - } - } - } -} From d2b1e2752735aac0aef5e7550f2218bcccc86764 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:49:03 +0900 Subject: [PATCH 336/628] Cleanup implementation of coop key mod This is how I intended the functionality to be implemented. --- .../Beatmaps/ManiaBeatmap.cs | 8 +++---- .../Beatmaps/ManiaBeatmapConverter.cs | 12 +--------- .../Mods/ManiaModKeyCoop.cs | 24 ++++++++++++------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs index 69c85fec87..0a248658a8 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmap.cs @@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// /// The definitions for each stage in a . /// - public readonly List Stages; + public List Stages = new List(); /// /// Total number of columns represented by all stages in this . @@ -24,10 +24,10 @@ namespace osu.Game.Rulesets.Mania.Beatmaps /// /// Creates a new . /// - /// The initial stages. - public ManiaBeatmap(List stages) + /// The initial stages. + public ManiaBeatmap(StageDefinition defaultStage) { - Stages = stages; + Stages.Add(defaultStage); } } } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index e5a444533d..557ce5eb1b 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -26,7 +26,6 @@ namespace osu.Game.Rulesets.Mania.Beatmaps protected override IEnumerable ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) }; public int TargetColumns; - public List StageDefinitions; public readonly bool IsForCurrentRuleset; private Pattern lastPattern = new Pattern(); @@ -67,16 +66,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps return base.ConvertBeatmap(original); } - protected override Beatmap CreateBeatmap() - { - if (StageDefinitions == null) - StageDefinitions = new List - { - new StageDefinition { Columns = TargetColumns } - }; - - return beatmap = new ManiaBeatmap(StageDefinitions); - } + protected override Beatmap CreateBeatmap() => beatmap = new ManiaBeatmap(new StageDefinition { Columns = TargetColumns }); protected override IEnumerable ConvertHitObject(HitObject original, Beatmap beatmap) { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 01fe9863e9..5fbf59e5e6 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -1,15 +1,18 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; +using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod, IApplicableToBeatmapConverter + public class ManiaModKeyCoop : Mod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer { public override string Name => "KeyCoop"; public override string ShortenedName => "2P"; @@ -25,16 +28,21 @@ namespace osu.Game.Rulesets.Mania.Mods if (mbc.IsForCurrentRuleset) return; - int originTargetColumns = mbc.TargetColumns; + mbc.TargetColumns *= 2; + } - var newStages = new List + public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) + { + var mrc = (ManiaRulesetContainer)rulesetContainer; + + var newDefinitions = new List(); + foreach (var existing in mrc.Beatmap.Stages) { - new StageDefinition { Columns = originTargetColumns }, - new StageDefinition { Columns = originTargetColumns }, - }; + newDefinitions.Add(new StageDefinition { Columns = (int)Math.Ceiling(existing.Columns / 2f) }); + newDefinitions.Add(new StageDefinition { Columns = (int)Math.Floor(existing.Columns / 2f) }); + } - mbc.StageDefinitions = newStages; - mbc.TargetColumns = originTargetColumns * 2; + mrc.Beatmap.Stages = newDefinitions; } } } From 1c74e56bab1679e7d42a52b7cc84126e66a10dad Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:50:43 +0900 Subject: [PATCH 337/628] Increase the point at which normal keys start in ManiaAction --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 14f8ce7427..762a914f26 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Mania [Description("Special")] Specia2, [Description("Key 1")] - Key1 = 10, + Key1 = 1000, [Description("Key 2")] Key2, [Description("Key 3")] From dbcabfb6ac14a5940e5d64da57a5d8198ec00eb6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:50:57 +0900 Subject: [PATCH 338/628] Remove ManiaAction.Specia2 --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 762a914f26..23bb70eb46 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -18,9 +18,8 @@ namespace osu.Game.Rulesets.Mania public enum ManiaAction { [Description("Special")] - Special, - [Description("Special")] - Specia2, + Special = 1, + [Description("Key 1")] Key1 = 1000, [Description("Key 2")] From 0d79d1669206d44e452577e52a12c978b1445e2a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 15:52:07 +0900 Subject: [PATCH 339/628] Cleanup testcase --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 9f30427045..d021202f36 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -48,6 +48,7 @@ namespace osu.Game.Rulesets.Mania.Tests }; createPlayfield(stages, SpecialColumnPosition.Normal); }); + AddStep("2 + 4 + 2 columns", () => { var stages = new List @@ -58,7 +59,8 @@ namespace osu.Game.Rulesets.Mania.Tests }; createPlayfield(stages, SpecialColumnPosition.Normal); }); - AddStep("1 + 1 + 8 columns", () => + + AddStep("1 + 8 + 1 columns", () => { var stages = new List { @@ -105,6 +107,7 @@ namespace osu.Game.Rulesets.Mania.Tests { new StageDefinition { Columns = cols }, }; + return createPlayfield(stages, specialPos, inverted); } @@ -143,6 +146,7 @@ namespace osu.Game.Rulesets.Mania.Tests { new StageDefinition { Columns = 4 }, }; + inputManager.Add(playfield = new ManiaPlayfield(stages) { Anchor = Anchor.Centre, From 053a29f9a751abe93eb421c23f39fee9e47679a5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 31 Dec 2017 21:05:01 +0900 Subject: [PATCH 340/628] Make judgements visually smaller This is a temporary change based on people's feedback. Makes judgements feel a lot better. nb: This is one of my changes that I've had deployed sinfce the end-of-year 2017 build. --- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 0f6642ae0e..c1bf55b214 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -40,7 +40,8 @@ namespace osu.Game.Rulesets.Judgements Anchor = Anchor.Centre, Text = judgement.Result.GetDescription().ToUpper(), Font = @"Venera", - TextSize = 16 + Scale = new Vector2(0.85f, 1), + TextSize = 12 } }; } From 351afc350e9a7fa7ec4d6ddcff21de86fa1a244c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 17:43:45 +0900 Subject: [PATCH 341/628] Implement co-op keybindings --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 24 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 222 +++++++++++++++++-- 2 files changed, 223 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 23bb70eb46..6586935c02 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -17,8 +17,10 @@ namespace osu.Game.Rulesets.Mania public enum ManiaAction { - [Description("Special")] + [Description("Special 1")] Special = 1, + [Description("Special 2")] + Special2 = 2, [Description("Key 1")] Key1 = 1000, @@ -37,6 +39,24 @@ namespace osu.Game.Rulesets.Mania [Description("Key 8")] Key8, [Description("Key 9")] - Key9 + Key9, + [Description("Key 10")] + Key10, + [Description("Key 11")] + Key11, + [Description("Key 12")] + Key12, + [Description("Key 13")] + Key13, + [Description("Key 14")] + Key14, + [Description("Key 15")] + Key15, + [Description("Key 16")] + Key16, + [Description("Key 17")] + Key17, + [Description("Key 18")] + Key18, } } diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index e05b320b95..14251359d6 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -1,12 +1,14 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.UI; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using System.Collections.Generic; +using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; using osu.Game.Graphics; @@ -117,42 +119,220 @@ namespace osu.Game.Rulesets.Mania { } - public override IEnumerable AvailableVariants => new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + public override IEnumerable AvailableVariants + { + get + { + for (int i = 1; i <= 9; i++) + yield return (int)ManiaVariantType.Solo + i; + for (int i = 2; i <= 18; i++) + yield return (int)ManiaVariantType.Coop + i; + // Todo: Versus mode + } + } public override IEnumerable GetDefaultKeyBindings(int variant = 0) { - var leftKeys = new[] + switch (getVariantType(variant)) { - InputKey.A, - InputKey.S, - InputKey.D, - InputKey.F - }; + case ManiaVariantType.Solo: + return new VariantMappingGenerator + { + LeftKeys = new[] + { + InputKey.A, + InputKey.S, + InputKey.D, + InputKey.F + }, + RightKeys = new[] + { + InputKey.J, + InputKey.K, + InputKey.L, + InputKey.Semicolon + }, + SpecialKey = InputKey.Space, + SpecialAction = ManiaAction.Special, + NormalActionStart = ManiaAction.Key1, + }.GenerateKeyBindingsFor(variant); + case ManiaVariantType.Coop: + case ManiaVariantType.Versus: + getMultiVariantKeyCounts(variant, out int p1K, out int p2K); - var rightKeys = new[] + var player1Bindings = new VariantMappingGenerator + { + LeftKeys = new[] + { + InputKey.Number1, + InputKey.Number2, + InputKey.Number3, + InputKey.Number4, + }, + RightKeys = new[] + { + InputKey.Z, + InputKey.X, + InputKey.C, + InputKey.V + }, + SpecialKey = InputKey.Tilde, + SpecialAction = ManiaAction.Special, + NormalActionStart = ManiaAction.Key1 + }.GenerateKeyBindingsFor(p1K); + + var player2Bindings = new VariantMappingGenerator + { + LeftKeys = new[] + { + InputKey.Number7, + InputKey.Number8, + InputKey.Number9, + InputKey.Number0 + }, + RightKeys = new[] + { + InputKey.O, + InputKey.P, + InputKey.BracketLeft, + InputKey.BracketRight + }, + SpecialKey = InputKey.BackSlash, + SpecialAction = ManiaAction.Special2, + NormalActionStart = ManiaAction.Key10 + }.GenerateKeyBindingsFor(p2K); + + return player1Bindings.Concat(player2Bindings); + } + + return new KeyBinding[0]; + } + + public override string GetVariantName(int variant) + { + switch (getVariantType(variant)) { - InputKey.J, - InputKey.K, - InputKey.L, - InputKey.Semicolon - }; + default: + case ManiaVariantType.Solo: + return $"{variant}K"; + case ManiaVariantType.Coop: + { + getMultiVariantKeyCounts(variant, out int p1K, out int p2K); + return $"{p1K}K + {p2K}K"; + } + case ManiaVariantType.Versus: + { + getMultiVariantKeyCounts(variant, out int p1K, out int p2K); + return $"{p1K}K Vs. {p2K}K"; + } + } + } - ManiaAction currentKey = ManiaAction.Key1; + /// + /// Finds the number of keys for each player in or . + /// + /// The variant. + /// The number of keys for player 1. + /// The number of keys for player 2. + private void getMultiVariantKeyCounts(int variant, out int player1Keys, out int player2Keys) + { + player1Keys = 0; + player2Keys = 0; + + switch (getVariantType(variant)) + { + case ManiaVariantType.Coop: + { + int totalKeys = variant - (int)ManiaVariantType.Coop; + player1Keys = (int)Math.Ceiling(totalKeys / 2f); + player2Keys = (int)Math.Floor(totalKeys / 2f); + break; + } + case ManiaVariantType.Versus: + { + int totalKeys = variant - (int)ManiaVariantType.Versus; + player1Keys = totalKeys; + player2Keys = totalKeys; + break; + } + } + } + + /// + /// Finds the that corresponds to a variant value. + /// + /// The variant value. + /// The that corresponds to . + private ManiaVariantType getVariantType(int variant) + { + return (ManiaVariantType)Enum.GetValues(typeof(ManiaVariantType)).Cast().OrderByDescending(i => i).First(v => variant > v); + } + } + + public class VariantMappingGenerator + { + /// + /// All the s available to the left hand. + /// + public InputKey[] LeftKeys; + + /// + /// All the s available to the right hand. + /// + public InputKey[] RightKeys; + + /// + /// The for the special key. + /// + public InputKey SpecialKey; + + /// + /// The at which the normal columns should begin. + /// + public ManiaAction NormalActionStart; + + /// + /// The for the special column. + /// + public ManiaAction SpecialAction; + + /// + /// Generates a list of s for a specific number of columns. + /// + /// The number of columns that need to be bound. + /// The keybindings. + public IEnumerable GenerateKeyBindingsFor(int columns) + { + ManiaAction currentNormalAction = NormalActionStart; var bindings = new List(); - for (int i = leftKeys.Length - variant / 2; i < leftKeys.Length; i++) - bindings.Add(new KeyBinding(leftKeys[i], currentKey++)); + for (int i = LeftKeys.Length - columns / 2; i < LeftKeys.Length; i++) + bindings.Add(new KeyBinding(LeftKeys[i], currentNormalAction++)); - for (int i = 0; i < variant / 2; i++) - bindings.Add(new KeyBinding(rightKeys[i], currentKey++)); + for (int i = 0; i < columns / 2; i++) + bindings.Add(new KeyBinding(RightKeys[i], currentNormalAction++)); - if (variant % 2 == 1) - bindings.Insert(variant / 2, new KeyBinding(InputKey.Space, ManiaAction.Special)); + if (columns % 2 == 1) + bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); return bindings; } + } - public override string GetVariantName(int variant) => $"{variant}K"; + public enum ManiaVariantType + { + /// + /// Solo play keybinding variant (single stage). + /// + Solo = 0, + /// + /// Co-op play keybinding variant (multiple stages). + /// + Coop = 1000, + /// + /// Versus play keybinding variant (multiple stages). + /// + Versus = 10000 } } From dd67070b6fd7d5c64f29528005fd55fd3d89bf4f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 17:58:04 +0900 Subject: [PATCH 342/628] ManiaAction.Special -> ManiaAction.Special1 --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 2 +- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 6586935c02..b5036806c6 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mania public enum ManiaAction { [Description("Special 1")] - Special = 1, + Special1 = 1, [Description("Special 2")] Special2 = 2, diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 14251359d6..04245534f5 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -153,7 +153,7 @@ namespace osu.Game.Rulesets.Mania InputKey.Semicolon }, SpecialKey = InputKey.Space, - SpecialAction = ManiaAction.Special, + SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant); case ManiaVariantType.Coop: @@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Mania InputKey.V }, SpecialKey = InputKey.Tilde, - SpecialAction = ManiaAction.Special, + SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1 }.GenerateKeyBindingsFor(p1K); From 89c3fcbf6aa14bf4c31e66ac8d5b124e8f0d1741 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 18:11:53 +0900 Subject: [PATCH 343/628] Refactor column construction --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 42 ++++++---------- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 52 +++++++++++--------- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index bd7f6b7b9d..26e4f5115f 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -39,11 +39,11 @@ namespace osu.Game.Rulesets.Mania.UI public ManiaPlayfield(List stageDefinition) : base(ScrollingDirection.Up) { - if (stageDefinition ==null) - throw new ArgumentNullException(); + if (stageDefinition == null) + throw new ArgumentNullException(nameof(stageDefinition)); if (stageDefinition.Count <= 0) - throw new ArgumentException("Can't have zero or fewer columns."); + throw new ArgumentException("Can't have zero or fewer stages."); Inverted.Value = true; @@ -62,32 +62,18 @@ namespace osu.Game.Rulesets.Mania.UI } }; - var currentAction = ManiaAction.Key1; - - int stageIndex = 0; - foreach (var stage in stageDefinition) + int firstColumnIndex = 0; + for (int i = 0; i < stageDefinition.Count; i++) { - var drawableStage = new ManiaStage(); - drawableStage.SpecialColumn.BindTo(SpecialColumnPosition); - drawableStage.VisibleTimeRange.BindTo(VisibleTimeRange); - drawableStage.Inverted.BindTo(Inverted); - drawableStage.ColumnStartIndex = stageIndex; + var newStage = new ManiaStage(i, firstColumnIndex, stageDefinition[i]); + newStage.SpecialColumn.BindTo(SpecialColumnPosition); + newStage.VisibleTimeRange.BindTo(VisibleTimeRange); + newStage.Inverted.BindTo(Inverted); - stages.Add(drawableStage); - AddNested(drawableStage); + stages.Add(newStage); + AddNested(newStage); - for (int i = 0; i < stage.Columns; i++) - { - var c = new Column - { - //c.Action = c.IsSpecial ? ManiaAction.Special : currentAction++; - Action = currentAction++ - }; - - drawableStage.AddColumn(c); - } - - stageIndex = stageIndex + stage.Columns; + firstColumnIndex += newStage.Columns.Count; } } @@ -95,7 +81,7 @@ namespace osu.Game.Rulesets.Mania.UI { var maniaObject = (ManiaHitObject)judgedObject.HitObject; int column = maniaObject.Column; - getStageByColumn(column).AddJudgement(judgedObject,judgement); + getStageByColumn(column).AddJudgement(judgedObject, judgement); } public override void Add(DrawableHitObject h) @@ -118,7 +104,7 @@ namespace osu.Game.Rulesets.Mania.UI int sum = 0; foreach (var stage in stages) { - sum = sum + stage.Columns.Count(); + sum = sum + stage.Columns.Count; if (sum > column) { return stage; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 78d8376b6c..f0a9f92215 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; @@ -33,8 +34,8 @@ namespace osu.Game.Rulesets.Mania.UI public readonly Bindable SpecialColumn = new Bindable(); - public IEnumerable Columns => columns.Children; - private readonly FillFlowContainer columns; + public IReadOnlyList Columns => columnFlow.Children; + private readonly FillFlowContainer columnFlow; protected override Container Content => content; private readonly Container content; @@ -47,11 +48,17 @@ namespace osu.Game.Rulesets.Mania.UI private List normalColumnColours = new List(); private Color4 specialColumnColour; - public int ColumnStartIndex; + private readonly int stageIndex; + private readonly int firstColumnIndex; + private readonly StageDefinition definition; - public ManiaStage() + public ManiaStage(int stageIndex, int firstColumnIndex, StageDefinition definition) : base(ScrollingDirection.Up) { + this.stageIndex = stageIndex; + this.firstColumnIndex = firstColumnIndex; + this.definition = definition; + Name = "Playfield elements"; Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -79,7 +86,7 @@ namespace osu.Game.Rulesets.Mania.UI RelativeSizeAxes = Axes.Both, Colour = new Color4(0, 0, 0, 0.8f) }, - columns = new FillFlowContainer + columnFlow = new FillFlowContainer { Name = "Columns", RelativeSizeAxes = Axes.Y, @@ -121,6 +128,9 @@ namespace osu.Game.Rulesets.Mania.UI } }; + for (int i = 0; i < definition.Columns; i++) + AddColumn(new Column()); + Inverted.ValueChanged += invertedChanged; Inverted.TriggerChange(); } @@ -134,15 +144,17 @@ namespace osu.Game.Rulesets.Mania.UI public void AddColumn(Column c) { c.VisibleTimeRange.BindTo(VisibleTimeRange); + topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); - columns.Add(c); + columnFlow.Add(c); AddNested(c); - Margin = new MarginPadding - { - Left = columns.Count * HIT_TARGET_POSITION / 2, - Right = columns.Count * HIT_TARGET_POSITION / 2, - }; + c.IsSpecial = isSpecialColumn(Columns.Count - 1); + + if (c.IsSpecial) + c.Action = ManiaAction.Special1 + stageIndex; + else + c.Action = ManiaAction.Key1 + firstColumnIndex + Columns.Count - 1; } /// @@ -156,25 +168,25 @@ namespace osu.Game.Rulesets.Mania.UI { default: case SpecialColumnPosition.Normal: - return columns.Count % 2 == 1 && column == columns.Count / 2; + return definition.Columns % 2 == 1 && column == definition.Columns / 2; case SpecialColumnPosition.Left: return column == 0; case SpecialColumnPosition.Right: - return column == columns.Count - 1; + return column == definition.Columns - 1; } } public override void Add(DrawableHitObject h) { - int columnIndex = ((ManiaHitObject)h.HitObject).Column - ColumnStartIndex; + int columnIndex = ((ManiaHitObject)h.HitObject).Column - firstColumnIndex; Columns.ElementAt(columnIndex).Add(h); } public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement) { var maniaObject = (ManiaHitObject)judgedObject.HitObject; - int columnIndex = maniaObject.Column - ColumnStartIndex; - columns[columnIndex].OnJudgement(judgedObject, judgement); + int columnIndex = maniaObject.Column - firstColumnIndex; + Columns[columnIndex].OnJudgement(judgedObject, judgement); judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) @@ -187,11 +199,6 @@ namespace osu.Game.Rulesets.Mania.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - for (int i = 0; i < columns.Count; i++) - { - columns[i].IsSpecial = isSpecialColumn(i); - } - normalColumnColours = new List { colours.RedDark, @@ -221,12 +228,11 @@ namespace osu.Game.Rulesets.Mania.UI } } - protected override void Update() { // Due to masking differences, it is not possible to get the width of the columns container automatically // While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually - content.Width = columns.Width; + content.Width = columnFlow.Width; } } } From b9909ed1cfd3ba43ba9daf8daf2b6c5809fb41fd Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 18:20:43 +0900 Subject: [PATCH 344/628] Refactor addition of hitobjects --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 41 +++++--------------- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 8 +++- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 26e4f5115f..ed973d6962 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -9,9 +9,8 @@ using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Configuration; -using osu.Game.Rulesets.Judgements; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Mania.Beatmaps; -using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; @@ -36,18 +35,18 @@ namespace osu.Game.Rulesets.Mania.UI public List Columns => stages.SelectMany(x => x.Columns).ToList(); - public ManiaPlayfield(List stageDefinition) + public ManiaPlayfield(List stageDefinitions) : base(ScrollingDirection.Up) { - if (stageDefinition == null) - throw new ArgumentNullException(nameof(stageDefinition)); + if (stageDefinitions == null) + throw new ArgumentNullException(nameof(stageDefinitions)); - if (stageDefinition.Count <= 0) + if (stageDefinitions.Count <= 0) throw new ArgumentException("Can't have zero or fewer stages."); Inverted.Value = true; - var stageSpacing = 300 / stageDefinition.Count; + var stageSpacing = 300 / stageDefinitions.Count; InternalChildren = new Drawable[] { @@ -63,9 +62,9 @@ namespace osu.Game.Rulesets.Mania.UI }; int firstColumnIndex = 0; - for (int i = 0; i < stageDefinition.Count; i++) + for (int i = 0; i < stageDefinitions.Count; i++) { - var newStage = new ManiaStage(i, firstColumnIndex, stageDefinition[i]); + var newStage = new ManiaStage(i, firstColumnIndex, stageDefinitions[i]); newStage.SpecialColumn.BindTo(SpecialColumnPosition); newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); @@ -77,27 +76,9 @@ namespace osu.Game.Rulesets.Mania.UI } } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) - { - var maniaObject = (ManiaHitObject)judgedObject.HitObject; - int column = maniaObject.Column; - getStageByColumn(column).AddJudgement(judgedObject, judgement); - } + public override void Add(DrawableHitObject h) => getStageByColumn(((ManiaHitObject)h.HitObject).Column).Add(h); - public override void Add(DrawableHitObject h) - { - int column = ((ManiaHitObject)h.HitObject).Column; - var stage = getStageByColumn(column); - stage.Add(h); - } - - public void Add(BarLine barline) - { - foreach (var single in stages) - { - single.HitObjects.Add(new DrawableBarLine(barline)); - } - } + public void Add(BarLine barline) => stages.ForEach(s => s.Add(barline)); private ManiaStage getStageByColumn(int column) { @@ -106,9 +87,7 @@ namespace osu.Game.Rulesets.Mania.UI { sum = sum + stage.Columns.Count; if (sum > column) - { return stage; - } } return null; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index f0a9f92215..e0c1658054 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -13,6 +13,7 @@ using osu.Game.Graphics; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Objects; +using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; using OpenTK; @@ -178,11 +179,14 @@ namespace osu.Game.Rulesets.Mania.UI public override void Add(DrawableHitObject h) { - int columnIndex = ((ManiaHitObject)h.HitObject).Column - firstColumnIndex; + var maniaObject = (ManiaHitObject)h.HitObject; + int columnIndex = maniaObject.Column - firstColumnIndex; Columns.ElementAt(columnIndex).Add(h); } - public void AddJudgement(DrawableHitObject judgedObject, Judgement judgement) + public void Add(BarLine barline) => base.Add(new DrawableBarLine(barline)); + + public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { var maniaObject = (ManiaHitObject)judgedObject.HitObject; int columnIndex = maniaObject.Column - firstColumnIndex; From 561786c5ef4cf3277bc1bfa0e2c72020cd0e9405 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 19:25:14 +0900 Subject: [PATCH 345/628] Generate the correct default bindings for variants --- osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs index 0bb7417088..4632c6c5f0 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs @@ -23,7 +23,7 @@ namespace osu.Game.Input.Bindings private KeyBindingStore store; - public override IEnumerable DefaultKeyBindings => ruleset.CreateInstance().GetDefaultKeyBindings(); + public override IEnumerable DefaultKeyBindings => ruleset.CreateInstance().GetDefaultKeyBindings(variant ?? 0); /// /// Create a new instance. From 8a7892b66a14cc0122ada526b9bf22a205fc323a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 19:29:51 +0900 Subject: [PATCH 346/628] Make variant keybindings work --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 38 +++++++++---------- .../Mods/IKeyBindingMod.cs | 13 +++++++ .../Mods/ManiaModKeyCoop.cs | 4 +- .../UI/ManiaRulesetContainer.cs | 7 +++- .../osu.Game.Rulesets.Mania.csproj | 1 + 5 files changed, 42 insertions(+), 21 deletions(-) create mode 100644 osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 04245534f5..befa657715 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -124,9 +124,9 @@ namespace osu.Game.Rulesets.Mania get { for (int i = 1; i <= 9; i++) - yield return (int)ManiaVariantType.Solo + i; + yield return (int)ManiaKeyBindingVariantType.Solo + i; for (int i = 2; i <= 18; i++) - yield return (int)ManiaVariantType.Coop + i; + yield return (int)ManiaKeyBindingVariantType.Coop + i; // Todo: Versus mode } } @@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.Mania { switch (getVariantType(variant)) { - case ManiaVariantType.Solo: + case ManiaKeyBindingVariantType.Solo: return new VariantMappingGenerator { LeftKeys = new[] @@ -156,8 +156,8 @@ namespace osu.Game.Rulesets.Mania SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant); - case ManiaVariantType.Coop: - case ManiaVariantType.Versus: + case ManiaKeyBindingVariantType.Coop: + case ManiaKeyBindingVariantType.Versus: getMultiVariantKeyCounts(variant, out int p1K, out int p2K); var player1Bindings = new VariantMappingGenerator @@ -199,7 +199,7 @@ namespace osu.Game.Rulesets.Mania }, SpecialKey = InputKey.BackSlash, SpecialAction = ManiaAction.Special2, - NormalActionStart = ManiaAction.Key10 + NormalActionStart = ManiaAction.Key1 + p1K }.GenerateKeyBindingsFor(p2K); return player1Bindings.Concat(player2Bindings); @@ -213,14 +213,14 @@ namespace osu.Game.Rulesets.Mania switch (getVariantType(variant)) { default: - case ManiaVariantType.Solo: + case ManiaKeyBindingVariantType.Solo: return $"{variant}K"; - case ManiaVariantType.Coop: + case ManiaKeyBindingVariantType.Coop: { getMultiVariantKeyCounts(variant, out int p1K, out int p2K); return $"{p1K}K + {p2K}K"; } - case ManiaVariantType.Versus: + case ManiaKeyBindingVariantType.Versus: { getMultiVariantKeyCounts(variant, out int p1K, out int p2K); return $"{p1K}K Vs. {p2K}K"; @@ -229,7 +229,7 @@ namespace osu.Game.Rulesets.Mania } /// - /// Finds the number of keys for each player in or . + /// Finds the number of keys for each player in or . /// /// The variant. /// The number of keys for player 1. @@ -241,16 +241,16 @@ namespace osu.Game.Rulesets.Mania switch (getVariantType(variant)) { - case ManiaVariantType.Coop: + case ManiaKeyBindingVariantType.Coop: { - int totalKeys = variant - (int)ManiaVariantType.Coop; + int totalKeys = variant - (int)ManiaKeyBindingVariantType.Coop; player1Keys = (int)Math.Ceiling(totalKeys / 2f); player2Keys = (int)Math.Floor(totalKeys / 2f); break; } - case ManiaVariantType.Versus: + case ManiaKeyBindingVariantType.Versus: { - int totalKeys = variant - (int)ManiaVariantType.Versus; + int totalKeys = variant - (int)ManiaKeyBindingVariantType.Versus; player1Keys = totalKeys; player2Keys = totalKeys; break; @@ -259,13 +259,13 @@ namespace osu.Game.Rulesets.Mania } /// - /// Finds the that corresponds to a variant value. + /// Finds the that corresponds to a variant value. /// /// The variant value. - /// The that corresponds to . - private ManiaVariantType getVariantType(int variant) + /// The that corresponds to . + private ManiaKeyBindingVariantType getVariantType(int variant) { - return (ManiaVariantType)Enum.GetValues(typeof(ManiaVariantType)).Cast().OrderByDescending(i => i).First(v => variant > v); + return (ManiaKeyBindingVariantType)Enum.GetValues(typeof(ManiaKeyBindingVariantType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } } @@ -320,7 +320,7 @@ namespace osu.Game.Rulesets.Mania } } - public enum ManiaVariantType + public enum ManiaKeyBindingVariantType { /// /// Solo play keybinding variant (single stage). diff --git a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs new file mode 100644 index 0000000000..585db9e340 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Mania.Mods +{ + public interface IKeyBindingMod + { + /// + /// The keybinding variant which this requires. + /// + ManiaKeyBindingVariantType Variant { get; } + } +} diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 5fbf59e5e6..382eea589c 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -12,7 +12,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer + public class ManiaModKeyCoop : Mod, IKeyBindingMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer { public override string Name => "KeyCoop"; public override string ShortenedName => "2P"; @@ -44,5 +44,7 @@ namespace osu.Game.Rulesets.Mania.Mods mrc.Beatmap.Stages = newDefinitions; } + + public ManiaKeyBindingVariantType Variant => ManiaKeyBindingVariantType.Coop; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 3a3aaa0e03..db881c5ba2 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -11,6 +11,7 @@ using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Mods; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Replays; @@ -76,7 +77,11 @@ namespace osu.Game.Rulesets.Mania.UI public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this); - public override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Beatmap.TotalColumns); + public override PassThroughInputManager CreateInputManager() + { + var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? ManiaKeyBindingVariantType.Solo; + return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); + } protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(IsForCurrentRuleset, WorkingBeatmap.Beatmap); diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index ae29484161..82202df923 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -64,6 +64,7 @@ + From 28586317ddf424f7ca14f74357f314548bc81172 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 19:44:42 +0900 Subject: [PATCH 347/628] Give stages a size again --- osu.Game.Rulesets.Mania/UI/Column.cs | 1 + osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 1 + osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 6 +++++- osu.Game/Rulesets/UI/Playfield.cs | 10 +--------- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index c2dd86d35d..f2eb2ef326 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -47,6 +47,7 @@ namespace osu.Game.Rulesets.Mania.UI public Column() : base(ScrollingDirection.Up) { + RelativeSizeAxes = Axes.Y; Width = column_width; InternalChildren = new Drawable[] diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index ed973d6962..9a148b6770 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -55,6 +55,7 @@ namespace osu.Game.Rulesets.Mania.UI Name = "Stages", Direction = FillDirection.Horizontal, RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, Anchor = Anchor.Centre, Origin = Anchor.Centre, Spacing = new Vector2(stageSpacing), diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index e0c1658054..2d9e7157da 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -60,9 +60,13 @@ namespace osu.Game.Rulesets.Mania.UI this.firstColumnIndex = firstColumnIndex; this.definition = definition; - Name = "Playfield elements"; + Name = "Stage"; + Anchor = Anchor.Centre; Origin = Anchor.Centre; + RelativeSizeAxes = Axes.Y; + AutoSizeAxes = Axes.X; + InternalChildren = new Drawable[] { new Container diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 25a7adb5a7..2e2fb91b12 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; @@ -34,8 +33,7 @@ namespace osu.Game.Rulesets.UI /// Whether we want our internal coordinate system to be scaled to a specified width. protected Playfield(float? customWidth = null) { - // Default height since we force relative size axes - Size = Vector2.One; + RelativeSizeAxes = Axes.Both; AddInternal(ScaledContent = new ScaledContainer { @@ -60,12 +58,6 @@ namespace osu.Game.Rulesets.UI Add(HitObjects); } - public override Axes RelativeSizeAxes - { - get { return Axes.Both; } - set { throw new InvalidOperationException($@"{nameof(Playfield)}'s {nameof(RelativeSizeAxes)} should never be changed from {Axes.Both}"); } - } - /// /// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield. /// From 39b6425c3e7923730fd08fa09b81fd1148654aa6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 19:55:15 +0900 Subject: [PATCH 348/628] Use a grid container to position the stages Should be more flexible in the future + provides a more dual-stage feel. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 27 +++++--------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 9a148b6770..ba4909615d 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -3,13 +3,11 @@ using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.Objects; -using OpenTK; using osu.Framework.Graphics.Containers; using System; using System.Collections.Generic; using System.Linq; using osu.Framework.Configuration; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.UI.Scrolling; @@ -18,11 +16,6 @@ namespace osu.Game.Rulesets.Mania.UI { public class ManiaPlayfield : ScrollingPlayfield { - /// - /// s contained by this . - /// - private readonly FillFlowContainer stages; - /// /// Whether this playfield should be inverted. This flips everything inside the playfield. /// @@ -34,6 +27,7 @@ namespace osu.Game.Rulesets.Mania.UI public Bindable SpecialColumnPosition = new Bindable(); public List Columns => stages.SelectMany(x => x.Columns).ToList(); + private readonly List stages = new List(); public ManiaPlayfield(List stageDefinitions) : base(ScrollingDirection.Up) @@ -46,20 +40,11 @@ namespace osu.Game.Rulesets.Mania.UI Inverted.Value = true; - var stageSpacing = 300 / stageDefinitions.Count; - - InternalChildren = new Drawable[] + GridContainer playfieldGrid; + InternalChild = playfieldGrid = new GridContainer { - stages = new FillFlowContainer - { - Name = "Stages", - Direction = FillDirection.Horizontal, - RelativeSizeAxes = Axes.Y, - AutoSizeAxes = Axes.X, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Spacing = new Vector2(stageSpacing), - } + RelativeSizeAxes = Axes.Both, + Content = new[] { new Drawable[stageDefinitions.Count] } }; int firstColumnIndex = 0; @@ -70,6 +55,8 @@ namespace osu.Game.Rulesets.Mania.UI newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); + playfieldGrid.Content[0][i] = newStage; + stages.Add(newStage); AddNested(newStage); From 0ae0dac192f3905c1d33ac0c056b94e6ad01030e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 20:35:38 +0900 Subject: [PATCH 349/628] Fix DrawableHitObject not binding nested hitobject events --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index af14c43a3f..2db899c646 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -167,6 +167,11 @@ namespace osu.Game.Rulesets.Objects.Drawables { if (nestedHitObjects == null) nestedHitObjects = new List(); + + h.OnJudgement += (d, j) => OnJudgement?.Invoke(d, j); + h.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(d, j); + h.ApplyCustomUpdateState += (d, j) => ApplyCustomUpdateState?.Invoke(d, j); + nestedHitObjects.Add(h); } From c32ff9c43b7ac6d477c456fa916f4be58e837ea4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 20:22:41 +0900 Subject: [PATCH 350/628] Move nested playfields to the base Playfield --- osu.Game/Rulesets/UI/Playfield.cs | 23 ++++++++++++++++++- .../UI/Scrolling/ScrollingPlayfield.cs | 20 ---------------- .../UI/Scrolling/ScrollingRulesetContainer.cs | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 9b80bba891..e011908c04 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.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 osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; @@ -23,6 +24,13 @@ namespace osu.Game.Rulesets.UI protected override Container Content => content; private readonly Container content; + private List nestedPlayfields; + + /// + /// All the s nested inside this playfield. + /// + public IReadOnlyList NestedPlayfields => nestedPlayfields; + /// /// A container for keeping track of DrawableHitObjects. /// @@ -64,7 +72,7 @@ namespace osu.Game.Rulesets.UI /// /// Performs post-processing tasks (if any) after all DrawableHitObjects are loaded into this Playfield. /// - public virtual void PostProcess() { } + public virtual void PostProcess() => nestedPlayfields?.ForEach(p => p.PostProcess()); /// /// Adds a DrawableHitObject to this Playfield. @@ -85,6 +93,19 @@ namespace osu.Game.Rulesets.UI /// The that occurred. public virtual void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { } + /// + /// Registers a as a nested . + /// This does not add the to the draw hierarchy. + /// + /// The to add. + protected void AddNested(Playfield otherPlayfield) + { + if (nestedPlayfields == null) + nestedPlayfields = new List(); + + nestedPlayfields.Add(otherPlayfield); + } + /// /// Creates the container that will be used to contain the s. /// diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs index 11185015b8..287e917c7b 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingPlayfield.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -76,25 +75,6 @@ namespace osu.Game.Rulesets.UI.Scrolling HitObjects.TimeRange.BindTo(VisibleTimeRange); } - private List nestedPlayfields; - /// - /// All the s nested inside this playfield. - /// - public IEnumerable NestedPlayfields => nestedPlayfields; - - /// - /// Adds a to this playfield. The nested - /// will be given all of the same speed adjustments as this playfield. - /// - /// The to add. - protected void AddNested(ScrollingPlayfield otherPlayfield) - { - if (nestedPlayfields == null) - nestedPlayfields = new List(); - - nestedPlayfields.Add(otherPlayfield); - } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (!UserScrollSpeedAdjustment) diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs index 286545270f..5f6b6801ce 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingRulesetContainer.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.UI.Scrolling private void applySpeedAdjustment(MultiplierControlPoint controlPoint, ScrollingPlayfield playfield) { playfield.HitObjects.AddControlPoint(controlPoint); - playfield.NestedPlayfields.ForEach(p => applySpeedAdjustment(controlPoint, p)); + playfield.NestedPlayfields?.OfType().ForEach(p => applySpeedAdjustment(controlPoint, p)); } /// From 8c5ef0a33076ea2a1948a5a02154d2a1b93759a8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 15 Jan 2018 20:45:30 +0900 Subject: [PATCH 351/628] Remove base OnJudgement from Playfield to properly accomodate nested playfields --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 3 ++- osu.Game.Rulesets.Mania/UI/Column.cs | 5 +++-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 11 ++++++----- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 4 +++- .../Tests/TestCaseTaikoPlayfield.cs | 8 ++++---- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 4 +++- osu.Game/Rulesets/UI/Playfield.cs | 8 -------- osu.Game/Rulesets/UI/RulesetContainer.cs | 7 +------ 8 files changed, 22 insertions(+), 28 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 8ea30a2899..a2324671b2 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -58,6 +58,7 @@ namespace osu.Game.Rulesets.Catch.UI public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; + h.OnJudgement += OnJudgement; base.Add(h); @@ -65,6 +66,6 @@ namespace osu.Game.Rulesets.Catch.UI fruit.CheckPosition = CheckIfWeCanCatch; } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement); + public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement); } } diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index eef57897de..2f6759abf3 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -204,12 +204,13 @@ namespace osu.Game.Rulesets.Mania.UI public override void Add(DrawableHitObject hitObject) { hitObject.Depth = (float)hitObject.HitObject.StartTime; - hitObject.AccentColour = AccentColour; + hitObject.OnJudgement += OnJudgement; + HitObjects.Add(hitObject); } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { if (!judgement.IsHit) return; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 919518dbe8..0e53ac2d6d 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -192,11 +192,8 @@ namespace osu.Game.Rulesets.Mania.UI } } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { - var maniaObject = (ManiaHitObject)judgedObject.HitObject; - columns[maniaObject.Column].OnJudgement(judgedObject, judgement); - judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) { @@ -224,7 +221,11 @@ namespace osu.Game.Rulesets.Mania.UI } } - public override void Add(DrawableHitObject h) => Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); + public override void Add(DrawableHitObject h) + { + h.OnJudgement += OnJudgement; + Columns.ElementAt(((ManiaHitObject)h.HitObject).Column).Add(h); + } public void Add(DrawableBarLine barline) => HitObjects.Add(barline); diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 892df089f5..5310524089 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -70,6 +70,8 @@ namespace osu.Game.Rulesets.Osu.UI { h.Depth = (float)h.HitObject.StartTime; + h.OnJudgement += OnJudgement; + var c = h as IDrawableHitObjectWithProxiedApproach; if (c != null && ProxyApproachCircles) approachCircles.Add(c.ProxiedLayer.CreateProxy()); @@ -84,7 +86,7 @@ namespace osu.Game.Rulesets.Osu.UI .OrderBy(h => h.StartTime).OfType(); } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { var osuJudgement = (OsuJudgement)judgement; var osuObject = (OsuHitObject)judgedObject.HitObject; diff --git a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs index 9500a1a747..fd396c201d 100644 --- a/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/Tests/TestCaseTaikoPlayfield.cs @@ -143,18 +143,18 @@ namespace osu.Game.Rulesets.Taiko.Tests var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) }; - rulesetContainer.Playfield.OnJudgement(h, new TaikoJudgement { Result = hitResult }); + ((TaikoPlayfield)rulesetContainer.Playfield).OnJudgement(h, new TaikoJudgement { Result = hitResult }); if (RNG.Next(10) == 0) { - rulesetContainer.Playfield.OnJudgement(h, new TaikoJudgement { Result = hitResult }); - rulesetContainer.Playfield.OnJudgement(h, new TaikoStrongHitJudgement()); + ((TaikoPlayfield)rulesetContainer.Playfield).OnJudgement(h, new TaikoJudgement { Result = hitResult }); + ((TaikoPlayfield)rulesetContainer.Playfield).OnJudgement(h, new TaikoStrongHitJudgement()); } } private void addMissJudgement() { - rulesetContainer.Playfield.OnJudgement(new DrawableTestHit(new Hit()), new TaikoJudgement { Result = HitResult.Miss }); + ((TaikoPlayfield)rulesetContainer.Playfield).OnJudgement(new DrawableTestHit(new Hit()), new TaikoJudgement { Result = HitResult.Miss }); } private void addBarLine(bool major, double delay = scroll_time) diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index 3c5093d82f..ba7807ec3d 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -209,6 +209,8 @@ namespace osu.Game.Rulesets.Taiko.UI { h.Depth = (float)h.HitObject.StartTime; + h.OnJudgement += OnJudgement; + base.Add(h); var barline = h as DrawableBarLine; @@ -221,7 +223,7 @@ namespace osu.Game.Rulesets.Taiko.UI swell.OnStart += () => topLevelHitContainer.Add(swell.CreateProxy()); } - public override void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null) { diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index e011908c04..b17ea07355 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -7,7 +7,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; -using osu.Game.Rulesets.Judgements; using osu.Framework.Allocation; namespace osu.Game.Rulesets.UI @@ -86,13 +85,6 @@ namespace osu.Game.Rulesets.UI /// The DrawableHitObject to remove. public virtual void Remove(DrawableHitObject h) => HitObjects.Remove(h); - /// - /// Triggered when a new occurs on a . - /// - /// The object that occured for. - /// The that occurred. - public virtual void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { } - /// /// Registers a as a nested . /// This does not add the to the draw hierarchy. diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 40f88ce577..626b56ad67 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -262,12 +262,7 @@ namespace osu.Game.Rulesets.UI if (drawableObject == null) continue; - drawableObject.OnJudgement += (d, j) => - { - Playfield.OnJudgement(d, j); - OnJudgement?.Invoke(j); - }; - + drawableObject.OnJudgement += (d, j) => OnJudgement?.Invoke(j); drawableObject.OnJudgementRemoved += (d, j) => OnJudgementRemoved?.Invoke(j); Playfield.Add(drawableObject); From 65ecc18141ef81eb1945141e4269f7ace3f08a7e Mon Sep 17 00:00:00 2001 From: aQaTL Date: Mon, 15 Jan 2018 16:04:57 +0100 Subject: [PATCH 352/628] Cap ApproachRate in HardRock mod at 10.0f --- osu.Game/Rulesets/Mods/ModHardRock.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModHardRock.cs b/osu.Game/Rulesets/Mods/ModHardRock.cs index 97b2fe7d1e..c4c0f38faf 100644 --- a/osu.Game/Rulesets/Mods/ModHardRock.cs +++ b/osu.Game/Rulesets/Mods/ModHardRock.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mods { const float ratio = 1.4f; difficulty.CircleSize *= 1.3f; // CS uses a custom 1.3 ratio. - difficulty.ApproachRate *= ratio; + difficulty.ApproachRate = Math.Min(difficulty.ApproachRate * ratio, 10.0f); difficulty.DrainRate *= ratio; difficulty.OverallDifficulty *= ratio; } From a81f32a388c83a5d8b534f04828504dedc481e1a Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Mon, 15 Jan 2018 20:52:52 +0300 Subject: [PATCH 353/628] PlayerGroup -> PlayerSettingsGroup --- osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs | 2 +- osu.Game/Rulesets/Edit/ToolboxGroup.cs | 2 +- osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs | 4 ++-- osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs | 2 +- osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs | 2 +- osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs | 2 +- .../PlayerSettings/{PlayerGroup.cs => PlayerSettingsGroup.cs} | 4 ++-- osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs | 2 +- osu.Game/osu.Game.csproj | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) rename osu.Game/Screens/Play/PlayerSettings/{PlayerGroup.cs => PlayerSettingsGroup.cs} (95%) diff --git a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs index 2d4f1831de..595a93b194 100644 --- a/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplaySettingsOverlay.cs @@ -42,7 +42,7 @@ namespace osu.Game.Tests.Visual })); } - private class ExampleContainer : PlayerGroup + private class ExampleContainer : PlayerSettingsGroup { protected override string Title => @"example"; } diff --git a/osu.Game/Rulesets/Edit/ToolboxGroup.cs b/osu.Game/Rulesets/Edit/ToolboxGroup.cs index e353191bc7..e153607f47 100644 --- a/osu.Game/Rulesets/Edit/ToolboxGroup.cs +++ b/osu.Game/Rulesets/Edit/ToolboxGroup.cs @@ -6,7 +6,7 @@ using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Rulesets.Edit { - public class ToolboxGroup : PlayerGroup + public class ToolboxGroup : PlayerSettingsGroup { protected override string Title => "toolbox"; diff --git a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 51cd3d55ab..0f10721425 100644 --- a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Play.HUD AlwaysPresent = true; RelativeSizeAxes = Axes.Both; - Child = new FillFlowContainer + Child = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play.HUD Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Top = 100, Right = 10 }, - Children = new PlayerGroup[] + Children = new PlayerSettingsGroup[] { //CollectionSettings = new CollectionSettings(), //DiscussionSettings = new DiscussionSettings(), diff --git a/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs index 4fca3649a2..f18b0876a2 100644 --- a/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/CollectionSettings.cs @@ -9,7 +9,7 @@ using osu.Game.Overlays.Music; namespace osu.Game.Screens.Play.PlayerSettings { - public class CollectionSettings : PlayerGroup + public class CollectionSettings : PlayerSettingsGroup { protected override string Title => @"collections"; diff --git a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs index acfe3aa510..e6d4fe3e09 100644 --- a/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/DiscussionSettings.cs @@ -8,7 +8,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Play.PlayerSettings { - public class DiscussionSettings : PlayerGroup + public class DiscussionSettings : PlayerSettingsGroup { protected override string Title => @"discussions"; diff --git a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index 30f8d002d1..15d8e73a76 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.PlayerSettings { - public class PlaybackSettings : PlayerGroup + public class PlaybackSettings : PlayerSettingsGroup { private const int padding = 10; diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs similarity index 95% rename from osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs rename to osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index bf17e18482..005e97bd94 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -13,7 +13,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Play.PlayerSettings { - public abstract class PlayerGroup : Container + public abstract class PlayerSettingsGroup : Container { /// /// The title to be displayed in the header of this group. @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private Color4 buttonActiveColour; - protected PlayerGroup() + protected PlayerSettingsGroup() { AutoSizeAxes = Axes.Y; Width = container_width; diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index 4e5f447b5f..f1468aba14 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -11,7 +11,7 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Play.PlayerSettings { - public class VisualSettings : PlayerGroup + public class VisualSettings : PlayerSettingsGroup { protected override string Title => "Visual settings"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b716a137c2..1e52fcb4d6 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -756,7 +756,7 @@ - + @@ -889,4 +889,4 @@ - + \ No newline at end of file From 3c11978cfa76a32436c2e275cf887735e3c5351f Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Mon, 15 Jan 2018 21:42:17 +0300 Subject: [PATCH 354/628] Use local functions --- osu.Desktop/OsuGameDesktop.cs | 2 +- .../Patterns/Legacy/DistanceObjectPatternGenerator.cs | 2 +- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 4 ++-- osu.Game.Tests/Visual/TestCasePlaySongSelect.cs | 2 +- osu.Game/Overlays/OnScreenDisplay.cs | 2 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 4 ++-- osu.Game/Screens/Menu/IntroSequence.cs | 2 +- osu.Game/Screens/Menu/OsuLogo.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 4 ++-- osu.Game/Screens/Tournament/Drawings.cs | 6 +++--- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index 8e6391168b..f37282366a 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -45,7 +45,7 @@ namespace osu.Desktop { protected override string LocateBasePath() { - Func checkExists = p => Directory.Exists(Path.Combine(p, "Songs")); + bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs")); string stableInstallPath; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index d15303af39..1d739c114e 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -321,7 +321,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy break; } - Func isDoubleSample = sample => sample.Name == SampleInfo.HIT_CLAP && sample.Name == SampleInfo.HIT_FINISH; + bool isDoubleSample(SampleInfo sample) => sample.Name == SampleInfo.HIT_CLAP && sample.Name == SampleInfo.HIT_FINISH; bool canGenerateTwoNotes = (convertType & PatternType.LowProbability) == 0; canGenerateTwoNotes &= HitObject.Samples.Any(isDoubleSample) || sampleInfoListAt(HitObject.StartTime).Any(isDoubleSample); diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 322f0ec608..ece1f626ec 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -117,8 +117,8 @@ namespace osu.Game.Tests.Beatmaps.IO //ensure we were stored to beatmap database backing... Assert.IsTrue(resultSets.Count() == 1, $@"Incorrect result count found ({resultSets.Count()} but should be 1)."); - Func> queryBeatmaps = () => store.QueryBeatmaps(s => s.BeatmapSet.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0); - Func> queryBeatmapSets = () => store.QueryBeatmapSets(s => s.OnlineBeatmapSetID == 241526); + IEnumerable queryBeatmaps() => store.QueryBeatmaps(s => s.BeatmapSet.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0); + IEnumerable queryBeatmapSets() => store.QueryBeatmapSets(s => s.OnlineBeatmapSetID == 241526); //if we don't re-check here, the set will be inserted but the beatmaps won't be present yet. waitForOrAssert(() => queryBeatmaps().Count() == 12, diff --git a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs index f16cf73039..809de2b8db 100644 --- a/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs +++ b/osu.Game.Tests/Visual/TestCasePlaySongSelect.cs @@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual // this is by no means clean. should be replacing inside of OsuGameBase somehow. var context = new OsuDbContext(); - Func contextFactory = () => context; + OsuDbContext contextFactory() => context; dependencies.Cache(rulesets = new RulesetStore(contextFactory)); dependencies.Cache(manager = new BeatmapManager(storage, contextFactory, rulesets, null) diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 6a1bd8e182..d29941d590 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -121,7 +121,7 @@ namespace osu.Game.Overlays trackSetting(frameworkConfig.GetBindable(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v)); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.ShowLogOverlay), v => display(v, "Debug Logs", v ? "visible" : "hidden", "Ctrl+F10")); - Action displayResolution = delegate { display(null, "Screen Resolution", frameworkConfig.Get(FrameworkSetting.Width) + "x" + frameworkConfig.Get(FrameworkSetting.Height)); }; + void displayResolution() => display(null, "Screen Resolution", frameworkConfig.Get(FrameworkSetting.Width) + "x" + frameworkConfig.Get(FrameworkSetting.Height)); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.Width), v => displayResolution()); trackSetting(frameworkConfig.GetBindable(FrameworkSetting.Height), v => displayResolution()); diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 6a9f4b84b0..ed8eb258f4 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -319,11 +319,11 @@ namespace osu.Game.Overlays.Profile colourBar.Show(); } - Action boldItalic = t => + void boldItalic(SpriteText t) { t.Font = @"Exo2.0-BoldItalic"; t.Alpha = 1; - }; + } if (user.Age != null) { diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 577eb33d18..6f346995e8 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -188,7 +188,7 @@ namespace osu.Game.Screens.Menu mediumRing.ResizeTo(130, 340, Easing.OutQuad); mediumRing.Foreground.ResizeTo(1, 880, Easing.Out); - Func remainingTime = () => length - TransformDelay; + double remainingTime() => length - TransformDelay; using (BeginDelayedSequence(250, true)) { diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index 4a13ae421e..f6af204237 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -231,7 +231,7 @@ namespace osu.Game.Screens.Menu /// If true, the new animation is delayed until all previous transforms finish. If false, existing transformed are cleared. public void AppendAnimatingAction(Action action, bool waitForPrevious) { - Action runnableAction = () => + void runnableAction() { if (waitForPrevious) this.DelayUntilTransformsFinished().Schedule(action); @@ -240,7 +240,7 @@ namespace osu.Game.Screens.Menu ClearTransforms(); action(); } - }; + } if (IsLoaded) runnableAction(); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 7431a6e0e6..357931b878 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -266,7 +266,7 @@ namespace osu.Game.Screens.Select /// private void carouselSelectionChanged(BeatmapInfo beatmap) { - Action performLoad = delegate + void performLoad() { // We may be arriving here due to another component changing the bindable Beatmap. // In these cases, the other component has already loaded the beatmap, so we don't need to do so again. @@ -279,7 +279,7 @@ namespace osu.Game.Screens.Select } UpdateBeatmap(Beatmap.Value); - }; + } if (beatmap?.Equals(beatmapNoDebounce) == true) return; diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 17a678c191..498dd7de6f 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -265,7 +265,7 @@ namespace osu.Game.Screens.Tournament private void writeResults(string text) { - Action writeAction = () => + void writeAction() { try { @@ -280,9 +280,9 @@ namespace osu.Game.Screens.Tournament { Logger.Error(ex, "Failed to write results."); } - }; + } - writeOp = writeOp?.ContinueWith(t => { writeAction(); }) ?? Task.Run(writeAction); + writeOp = writeOp?.ContinueWith(t => { writeAction(); }) ?? Task.Run((Action)writeAction); } private void reloadTeams() From c3ca40dcff48e7844c098ed4507f8bfc829b7e0f Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Mon, 15 Jan 2018 23:27:00 +0300 Subject: [PATCH 355/628] Local functions related CI fixes --- osu.Game/Screens/Menu/IntroSequence.cs | 1 - osu.Game/Screens/Menu/OsuLogo.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Menu/IntroSequence.cs b/osu.Game/Screens/Menu/IntroSequence.cs index 6f346995e8..ff3b4eba56 100644 --- a/osu.Game/Screens/Menu/IntroSequence.cs +++ b/osu.Game/Screens/Menu/IntroSequence.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Linq; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index f6af204237..b91ff0d74b 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -245,7 +245,7 @@ namespace osu.Game.Screens.Menu if (IsLoaded) runnableAction(); else - Schedule(() => runnableAction()); + Schedule(runnableAction); } [BackgroundDependencyLoader] From 0459f0a0696cadc1ec4cf4212eff6adcb22c98ff Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 13:40:02 +0900 Subject: [PATCH 356/628] Invert CanShowCursor conditional to fix cursor not showing in VisualTests --- osu.Game/Graphics/Cursor/CursorOverrideContainer.cs | 2 +- osu.Game/OsuGame.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs index 4b29414990..0fae4579fa 100644 --- a/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs +++ b/osu.Game/Graphics/Cursor/CursorOverrideContainer.cs @@ -20,7 +20,7 @@ namespace osu.Game.Graphics.Cursor /// /// Whether any cursors can be displayed. /// - public bool CanShowCursor; + public bool CanShowCursor = true; public CursorContainer Cursor { get; } public bool ProvidingUserCursor => true; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 124b9364b3..b48e25f1fe 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -157,6 +157,11 @@ namespace osu.Game { base.LoadComplete(); + // The next time this is updated is in UpdateAfterChildren, which occurs too late and results + // in the cursor being shown for a few frames during the intro. + // This prevents the cursor from showing until we have a screen with CursorVisible = true + CursorOverrideContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; + // hook up notifications to components. BeatmapManager.PostNotification = n => notifications?.Post(n); BeatmapManager.GetStableStorage = GetStorageForStableInstall; From d230fd486e2cc023c59e024287a9422de00c58d1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 15:28:00 +0900 Subject: [PATCH 357/628] Add automated cursor testcase --- osu.Game.Tests/Visual/TestCaseCursors.cs | 250 +++++++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 251 insertions(+) create mode 100644 osu.Game.Tests/Visual/TestCaseCursors.cs diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs new file mode 100644 index 0000000000..e0ce5fad77 --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -0,0 +1,250 @@ +// Copyright (c) 2007-2018 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.Graphics.Cursor; +using osu.Framework.Graphics.Shapes; +using osu.Framework.MathUtils; +using osu.Framework.Testing.Input; +using osu.Game.Graphics.Cursor; +using osu.Game.Graphics.Sprites; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseCursors : OsuTestCase + { + private readonly ManualInputManager inputManager; + private readonly CursorOverrideContainer cursorOverrideContainer; + private readonly CustomCursorBox[] cursorBoxes = new CustomCursorBox[6]; + + public TestCaseCursors() + { + Child = inputManager = new ManualInputManager + { + Child = cursorOverrideContainer = new CursorOverrideContainer + { + RelativeSizeAxes = Axes.Both, + Children = new[] + { + // Middle user + cursorBoxes[0] = new CustomCursorBox(Color4.Green) + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.5f), + }, + // Top-left user + cursorBoxes[1] = new CustomCursorBox(Color4.Blue) + { + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.4f) + }, + // Bottom-right user + cursorBoxes[2] = new CustomCursorBox(Color4.Red) + { + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.4f) + }, + // Bottom-left local + cursorBoxes[3] = new CustomCursorBox(Color4.Magenta, false) + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.4f) + }, + // Top-right local + cursorBoxes[4] = new CustomCursorBox(Color4.Cyan, false) + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.4f) + }, + // Left-local + cursorBoxes[5] = new CustomCursorBox(Color4.Yellow, false) + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.2f, 1), + }, + } + } + }; + + returnUserInput(); + testUserCursor(); + testLocalCursor(); + testUserCursorOverride(); + testMultipleLocalCursors(); + } + + /// + /// Returns input back to the user. + /// + private void returnUserInput() + { + AddStep("Return user input", () => inputManager.UseParentState = true); + } + + /// + /// -- Green Box -- + /// Tests whether hovering in and out of a drawable that provides the user cursor (green) + /// results in the correct visibility state for that cursor. + /// + private void testUserCursor() + { + AddStep("Move to green area", () => inputManager.MoveMouseTo(cursorBoxes[0])); + AddAssert("Check green cursor visible", () => checkVisible(cursorBoxes[0].Cursor)); + AddAssert("Check green cursor at mouse", () => checkAtMouse(cursorBoxes[0].Cursor)); + AddStep("Move out", moveOut); + AddAssert("Check green cursor invisible", () => !checkVisible(cursorBoxes[0].Cursor)); + AddAssert("Check global cursor visible", () => checkVisible(cursorOverrideContainer.Cursor)); + } + + /// + /// -- Purple Box -- + /// Tests whether hovering in and out of a drawable that provides a local cursor (purple) + /// results in the correct visibility and state for that cursor. + /// + private void testLocalCursor() + { + AddStep("Move to purple area", () => inputManager.MoveMouseTo(cursorBoxes[3])); + AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor)); + AddAssert("Check purple cursor at mouse", () => checkAtMouse(cursorBoxes[3].Cursor)); + AddAssert("Check global cursor visible", () => checkVisible(cursorOverrideContainer.Cursor)); + AddAssert("Check global cursor at mouse", () => checkAtMouse(cursorOverrideContainer.Cursor)); + AddStep("Move out", moveOut); + AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor)); + AddAssert("Check global cursor visible", () => checkVisible(cursorOverrideContainer.Cursor)); + } + + /// + /// -- Blue-Green Box Boundary -- + /// Tests whether overriding a user cursor (green) with another user cursor (blue) + /// results in the correct visibility and states for the cursors. + /// + private void testUserCursorOverride() + { + AddStep("Move to blue-green boundary", () => inputManager.MoveMouseTo(cursorBoxes[1].ScreenSpaceDrawQuad.BottomRight - new Vector2(10))); + AddAssert("Check blue cursor visible", () => checkVisible(cursorBoxes[1].Cursor)); + AddAssert("Check green cursor invisible", () => !checkVisible(cursorBoxes[0].Cursor)); + AddAssert("Check blue cursor at mouse", () => checkAtMouse(cursorBoxes[1].Cursor)); + AddStep("Move out", moveOut); + AddAssert("Check blue cursor not visible", () => !checkVisible(cursorBoxes[1].Cursor)); + AddAssert("Check green cursor not visible", () => !checkVisible(cursorBoxes[0].Cursor)); + } + + /// + /// -- Yellow-Purple Box Boundary -- + /// Tests whether multiple local cursors (purple + yellow) may be visible and at the mouse position at the same time. + /// + private void testMultipleLocalCursors() + { + AddStep("Move to yellow-purple boundary", () => inputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.BottomRight - new Vector2(10))); + AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor)); + AddAssert("Check purple cursor at mouse", () => checkAtMouse(cursorBoxes[3].Cursor)); + AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor)); + AddAssert("Check yellow cursor at mouse", () => checkAtMouse(cursorBoxes[5].Cursor)); + AddStep("Move out", moveOut); + AddAssert("Check purple cursor visible", () => checkVisible(cursorBoxes[3].Cursor)); + AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor)); + } + + /// + /// -- Yellow-Blue Box Boundary -- + /// Tests whether a local cursor (yellow) may be displayed along with a user cursor override (blue). + /// + private void testUserOverrideWithLocal() + { + AddStep("Move to yellow-blue boundary", () => inputManager.MoveMouseTo(cursorBoxes[5].ScreenSpaceDrawQuad.TopRight - new Vector2(10))); + AddAssert("Check blue cursor visible", () => checkVisible(cursorBoxes[1].Cursor)); + AddAssert("Check blue cursor at mouse", () => checkAtMouse(cursorBoxes[1].Cursor)); + AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor)); + AddAssert("Check yellow cursor at mouse", () => checkAtMouse(cursorBoxes[5].Cursor)); + AddStep("Move out", moveOut); + AddAssert("Check blue cursor invisible", () => !checkVisible(cursorBoxes[1].Cursor)); + AddAssert("Check yellow cursor visible", () => checkVisible(cursorBoxes[5].Cursor)); + } + + /// + /// Moves the cursor to a point not covered by any cursor containers. + /// + private void moveOut() + => inputManager.MoveMouseTo(new Vector2(inputManager.ScreenSpaceDrawQuad.Centre.X, inputManager.ScreenSpaceDrawQuad.TopLeft.Y)); + + /// + /// Checks if a cursor is visible. + /// + /// The cursor to check. + private bool checkVisible(CursorContainer cursorContainer) => cursorContainer.State == Visibility.Visible; + + /// + /// Checks if a cursor is at the current inputmanager screen position. + /// + /// The cursor to check. + private bool checkAtMouse(CursorContainer cursorContainer) + => Precision.AlmostEquals(inputManager.CurrentState.Mouse.NativeState.Position, cursorContainer.ToScreenSpace(cursorContainer.ActiveCursor.DrawPosition)); + + private class CustomCursorBox : Container, IProvideCursor + { + public CursorContainer Cursor { get; } + public bool ProvidingUserCursor { get; } + + public CustomCursorBox(Color4 cursorColour, bool providesUserCursor = true) + { + ProvidingUserCursor = providesUserCursor; + + Colour = cursorColour; + Masking = true; + + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.1f + }, + new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = providesUserCursor ? "User cursor" : "Local cursor" + }, + Cursor = new TestCursorContainer + { + State = providesUserCursor ? Visibility.Hidden : Visibility.Visible, + } + }; + } + } + + private class TestCursorContainer : CursorContainer + { + protected override Drawable CreateCursor() => new TestCursor(); + + private class TestCursor : CircularContainer + { + public TestCursor() + { + Origin = Anchor.Centre; + + Size = new Vector2(50); + Masking = true; + + Blending = BlendingMode.Additive; + Alpha = 0.5f; + + Child = new Box { RelativeSizeAxes = Axes.Both }; + } + } + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 2eb79f6b35..76b426bf5d 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -104,6 +104,7 @@ + From c309cc94540db54ebc48918f9ca45d2e016c8ab3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 15:37:32 +0900 Subject: [PATCH 358/628] Privatise OnJudgements as much as possible --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/Column.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 4 ++-- osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index a2324671b2..7f56c3bbb1 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Catch.UI public override void Add(DrawableHitObject h) { h.Depth = (float)h.HitObject.StartTime; - h.OnJudgement += OnJudgement; + h.OnJudgement += onJudgement; base.Add(h); @@ -66,6 +66,6 @@ namespace osu.Game.Rulesets.Catch.UI fruit.CheckPosition = CheckIfWeCanCatch; } - public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement); + private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement); } } diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 2f6759abf3..d79a4d62c4 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -205,12 +205,12 @@ namespace osu.Game.Rulesets.Mania.UI { hitObject.Depth = (float)hitObject.HitObject.StartTime; hitObject.AccentColour = AccentColour; - hitObject.OnJudgement += OnJudgement; + hitObject.OnJudgement += onJudgement; HitObjects.Add(hitObject); } - public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) { if (!judgement.IsHit) return; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 0e53ac2d6d..7d3df6cda7 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -192,7 +192,7 @@ namespace osu.Game.Rulesets.Mania.UI } } - public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 5310524089..17521f8992 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Osu.UI { h.Depth = (float)h.HitObject.StartTime; - h.OnJudgement += OnJudgement; + h.OnJudgement += onJudgement; var c = h as IDrawableHitObjectWithProxiedApproach; if (c != null && ProxyApproachCircles) @@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Osu.UI .OrderBy(h => h.StartTime).OfType(); } - public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) { var osuJudgement = (OsuJudgement)judgement; var osuObject = (OsuHitObject)judgedObject.HitObject; diff --git a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs index ba7807ec3d..49c87f7480 100644 --- a/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Rulesets.Taiko/UI/TaikoPlayfield.cs @@ -223,7 +223,7 @@ namespace osu.Game.Rulesets.Taiko.UI swell.OnStart += () => topLevelHitContainer.Add(swell.CreateProxy()); } - public void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) + internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null) { From d8275c4f9ba8fb0e1cb94ad502626611832074c8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 18:20:46 +0900 Subject: [PATCH 359/628] Fix beatmap query not including beatmap files --- osu.Game/Beatmaps/BeatmapStore.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Beatmaps/BeatmapStore.cs b/osu.Game/Beatmaps/BeatmapStore.cs index 02564489ad..df71c5c0d0 100644 --- a/osu.Game/Beatmaps/BeatmapStore.cs +++ b/osu.Game/Beatmaps/BeatmapStore.cs @@ -156,6 +156,7 @@ namespace osu.Game.Beatmaps public IQueryable Beatmaps => GetContext().BeatmapInfo .Include(b => b.BeatmapSet).ThenInclude(s => s.Metadata) + .Include(b => b.BeatmapSet).ThenInclude(s => s.Files).ThenInclude(f => f.FileInfo) .Include(b => b.Metadata) .Include(b => b.Ruleset) .Include(b => b.BaseDifficulty); From 4f7ccb8d939878b3646648348de917e10ab97bc9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Jan 2018 18:38:47 +0900 Subject: [PATCH 360/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 49b563e2cf..95bd66da12 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 49b563e2cf170eb19006b98dd5b69c2398362d9e +Subproject commit 95bd66da12276f39335873972f713774306b4894 From 1174f344896a2670d41cabf79fda5b191572bbcb Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 20:21:09 +0900 Subject: [PATCH 361/628] Update framework post-merge --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 95bd66da12..023a0abe17 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 95bd66da12276f39335873972f713774306b4894 +Subproject commit 023a0abe17490a118fe1ca85ea487462bff4277e From 39af9321cf3e1957a92d4bd233d7b00ca0a555a2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Jan 2018 20:29:11 +0900 Subject: [PATCH 362/628] Remove unnecessary overrides --- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 8fa76e2e51..615c124ea7 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -142,10 +142,6 @@ namespace osu.Game.Screens.Play } } - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => State == Visibility.Visible; - protected override void PopIn() => this.FadeIn(transition_duration, Easing.In); protected override void PopOut() => this.FadeOut(transition_duration, Easing.In); From e7a0a024664ee09989e308a08928c435ed21d680 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Jan 2018 20:29:28 +0900 Subject: [PATCH 363/628] Don't limit keyboard input based on menu button scale --- osu.Game/Screens/Menu/Button.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index fff2435cb4..268be51347 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -222,9 +222,8 @@ namespace osu.Game.Screens.Menu boxHoverLayer.FadeOut(800, Easing.OutExpo); } - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; + public override bool HandleKeyboardInput => state != ButtonState.Exploded; + public override bool HandleMouseInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f; protected override void Update() { From 5e1cd8ddc4c569c07ed31d69d1ed80eff93e6ee3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Jan 2018 20:34:14 +0900 Subject: [PATCH 364/628] Apply conditionals directly rather than using an in-between property --- osu.Game/Graphics/UserInterface/BreadcrumbControl.cs | 6 +++--- osu.Game/Overlays/Profile/ProfileHeader.cs | 5 ++--- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 5 ++--- osu.Game/Screens/Menu/ButtonSystem.cs | 5 ++--- osu.Game/Screens/Play/KeyCounterCollection.cs | 5 ++--- 5 files changed, 11 insertions(+), 15 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs index 566254886e..5ee0aba9cf 100644 --- a/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs +++ b/osu.Game/Graphics/UserInterface/BreadcrumbControl.cs @@ -42,9 +42,9 @@ namespace osu.Game.Graphics.UserInterface //don't allow clicking between transitions and don't make the chevron clickable public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos); - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => State == Visibility.Visible; + + public override bool HandleKeyboardInput => State == Visibility.Visible; + public override bool HandleMouseInput => State == Visibility.Visible; private Visibility state; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index c4819c5bc7..924b5d6c9d 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -489,9 +489,8 @@ namespace osu.Game.Overlays.Profile { private readonly OsuHoverContainer content; - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => content.Action != null; + public override bool HandleKeyboardInput => content.Action != null; + public override bool HandleMouseInput => content.Action != null; protected override Container Content => content ?? (Container)this; diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 2acc1075a3..6d58c78c37 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -87,9 +87,8 @@ namespace osu.Game.Overlays.Toolbar ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault(); } - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => !ruleset.Disabled; + public override bool HandleKeyboardInput => !ruleset.Disabled; + public override bool HandleMouseInput => !ruleset.Disabled; private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index a45f4429c4..72c26af2a6 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -199,9 +199,8 @@ namespace osu.Game.Screens.Menu private MenuState state; - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput=> state != MenuState.Exit; + public override bool HandleKeyboardInput => state != MenuState.Exit; + public override bool HandleMouseInput => state != MenuState.Exit; public MenuState State { diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index c716841861..e40776ae4a 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -111,9 +111,8 @@ namespace osu.Game.Screens.Play } } - public override bool HandleKeyboardInput => handleInput; - public override bool HandleMouseInput => handleInput; - private bool handleInput => receptor == null; + public override bool HandleKeyboardInput => receptor == null; + public override bool HandleMouseInput => receptor == null; private Receptor receptor; From a5415b99aecb21ed74f8c9feb048288878325cf2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 20:35:07 +0900 Subject: [PATCH 365/628] Visualise the hovered drawabe --- osu.Game.Tests/Visual/TestCaseCursors.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs index e0ce5fad77..20e6103436 100644 --- a/osu.Game.Tests/Visual/TestCaseCursors.cs +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input; using osu.Framework.MathUtils; using osu.Framework.Testing.Input; using osu.Game.Graphics.Cursor; @@ -198,6 +199,8 @@ namespace osu.Game.Tests.Visual public CursorContainer Cursor { get; } public bool ProvidingUserCursor { get; } + private readonly Box background; + public CustomCursorBox(Color4 cursorColour, bool providesUserCursor = true) { ProvidingUserCursor = providesUserCursor; @@ -207,7 +210,7 @@ namespace osu.Game.Tests.Visual Children = new Drawable[] { - new Box + background = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.1f @@ -224,6 +227,18 @@ namespace osu.Game.Tests.Visual } }; } + + protected override bool OnHover(InputState state) + { + background.FadeTo(0.4f, 250, Easing.OutQuint); + return false; + } + + protected override void OnHoverLost(InputState state) + { + background.FadeTo(0.1f, 250); + base.OnHoverLost(state); + } } private class TestCursorContainer : CursorContainer From 06f0f2093c71f678b61faa4d9aef4748694b7f47 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 16 Jan 2018 20:35:39 +0900 Subject: [PATCH 366/628] Add a sample way to have local cursors move beyond their bounds --- osu.Game.Tests/Visual/TestCaseCursors.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCaseCursors.cs b/osu.Game.Tests/Visual/TestCaseCursors.cs index 20e6103436..363f6b53f0 100644 --- a/osu.Game.Tests/Visual/TestCaseCursors.cs +++ b/osu.Game.Tests/Visual/TestCaseCursors.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; @@ -81,10 +82,14 @@ namespace osu.Game.Tests.Visual }; returnUserInput(); + + AddToggleStep("Smooth transitions", b => cursorBoxes.ForEach(box => box.SmoothTransition = b)); + testUserCursor(); testLocalCursor(); testUserCursorOverride(); testMultipleLocalCursors(); + returnUserInput(); } /// @@ -196,9 +201,13 @@ namespace osu.Game.Tests.Visual private class CustomCursorBox : Container, IProvideCursor { + public bool SmoothTransition; + public CursorContainer Cursor { get; } public bool ProvidingUserCursor { get; } + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || SmoothTransition && !ProvidingUserCursor; + private readonly Box background; public CustomCursorBox(Color4 cursorColour, bool providesUserCursor = true) From 87d2cce61d3aaf1d1da59d4ee330660c2987a81b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 00:47:14 +0900 Subject: [PATCH 367/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 023a0abe17..8f36ddab94 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 023a0abe17490a118fe1ca85ea487462bff4277e +Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 From 9277586907600f6ae9ace884fea751d431359bbf Mon Sep 17 00:00:00 2001 From: aQaTL Date: Tue, 16 Jan 2018 17:46:54 +0100 Subject: [PATCH 368/628] Toggle mute/unmute keyboard shortcut --- .../UserInterface/Volume/VolumeControl.cs | 4 ++++ .../Graphics/UserInterface/Volume/VolumeMeter.cs | 16 +++++++++++++++- .../Bindings/GlobalKeyBindingInputManager.cs | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 33888e57e0..63b14713e2 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -76,6 +76,10 @@ namespace osu.Game.Graphics.UserInterface.Volume else volumeMeterMaster.Increase(); return true; + case GlobalAction.ToggleMute: + Show(); + volumeMeterMaster.ToogleMute(); + return true; } return false; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 8323dade44..dc1b2e85eb 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -18,6 +18,9 @@ namespace osu.Game.Graphics.UserInterface.Volume private readonly Box meterFill; public BindableDouble Bindable { get; } = new BindableDouble(); + private double lastVolume; + public bool IsMuted { get; private set; } + public VolumeMeter(string meterName) { Size = new Vector2(40, 180); @@ -70,16 +73,19 @@ namespace osu.Game.Graphics.UserInterface.Volume public double Volume { - get { return Bindable.Value; } + get => Bindable.Value; private set { Bindable.Value = value; + if (value > 0) + IsMuted = false; } } public void Increase() { Volume += 0.05f; + IsMuted = false; } public void Decrease() @@ -87,6 +93,14 @@ namespace osu.Game.Graphics.UserInterface.Volume Volume -= 0.05f; } + public void ToogleMute() + { + IsMuted = !IsMuted; + if (IsMuted) + lastVolume = Volume; + Volume = IsMuted ? 0.0 : lastVolume; + } + private void updateFill() => meterFill.ScaleTo(new Vector2(1, (float)Volume), 300, Easing.OutQuint); public bool OnPressed(GlobalAction action) diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs index f5e54775fb..6c317890af 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs @@ -33,6 +33,7 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.MouseWheelUp }, GlobalAction.IncreaseVolume), new KeyBinding(new[] { InputKey.Down }, GlobalAction.DecreaseVolume), new KeyBinding(new[] { InputKey.MouseWheelDown }, GlobalAction.DecreaseVolume), + new KeyBinding(InputKey.F4, GlobalAction.ToggleMute), }; public IEnumerable InGameKeyBindings => new[] @@ -62,6 +63,8 @@ namespace osu.Game.Input.Bindings IncreaseVolume, [Description("Decrease Volume")] DecreaseVolume, + [Description("Toggle mute")] + ToggleMute, // In-Game Keybindings [Description("Skip Cutscene")] From 0340e4f8dcccbf6f5d09189f95aea5543bdca92a Mon Sep 17 00:00:00 2001 From: aQaTL Date: Tue, 16 Jan 2018 20:33:30 +0100 Subject: [PATCH 369/628] Option in settings to toggle mute/unmute when losing/gaining window focus --- osu.Game/Configuration/OsuConfigManager.cs | 3 +++ .../UserInterface/Volume/VolumeControl.cs | 18 ++++++++++++++ osu.Game/OsuGame.cs | 24 +++++++++++++++++++ .../Settings/Sections/Audio/VolumeSettings.cs | 4 +++- 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 23f7fd6ac1..0c90b2c2ec 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -39,6 +39,8 @@ namespace osu.Game.Configuration }; // Audio + Set(OsuSetting.MuteWhenInactive, false); + Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); @@ -101,6 +103,7 @@ namespace osu.Game.Configuration MouseDisableButtons, MouseDisableWheel, AudioOffset, + MuteWhenInactive, MenuMusic, MenuVoice, CursorRotation, diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 63b14713e2..7a1a2de50d 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -91,6 +91,24 @@ namespace osu.Game.Graphics.UserInterface.Volume schedulePopOut(); } + public bool IsMuted => volumeMeterMaster.IsMuted; + + public void Mute() + { + if (!IsMuted) + { + volumeMeterMaster.ToogleMute(); + } + } + + public void Unmute() + { + if (IsMuted) + { + volumeMeterMaster.ToogleMute(); + } + } + [BackgroundDependencyLoader] private void load(AudioManager audio) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 124b9364b3..56cfffdeae 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -115,6 +115,8 @@ namespace osu.Game configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; + + muteWhenInactive = LocalConfig.GetBindable(OsuSetting.MuteWhenInactive); } private ScheduledDelegate scoreLoad; @@ -386,6 +388,28 @@ namespace osu.Game return false; } + private Bindable muteWhenInactive = new Bindable(); + private bool wasMuted; + + protected override void OnDeactivated() + { + base.OnDeactivated(); + if (muteWhenInactive) + { + wasMuted = volume.IsMuted; + volume.Mute(); + } + } + + protected override void OnActivated() + { + base.OnActivated(); + if (IsLoaded && muteWhenInactive && !wasMuted) + { + volume.Unmute(); + } + } + public bool OnReleased(GlobalAction action) => false; private Container mainContent; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 40b9ff069b..01bcf989dc 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; +using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Audio { @@ -12,13 +13,14 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Volume"; [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(AudioManager audio, OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.1f }, + new SettingsCheckbox { LabelText = "Mute osu! when inactive", Bindable = config.GetBindable(OsuSetting.MuteWhenInactive) } }; } } From 538c20a947d0e231ff9b84ba9ce36bac78c52c70 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Tue, 16 Jan 2018 21:30:48 +0100 Subject: [PATCH 370/628] Prevent not saving audio levels when user alt tabs before the window closes --- osu.Game/OsuGame.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 56cfffdeae..de923b3451 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -79,6 +79,8 @@ namespace osu.Game private SettingsOverlay settings; + private bool exiting; + public OsuGame(string[] args = null) { this.args = args; @@ -117,6 +119,13 @@ namespace osu.Game Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; muteWhenInactive = LocalConfig.GetBindable(OsuSetting.MuteWhenInactive); + Host.Window.Exited += () => + { + //Prevent not saving audio levels when user alt tabs before the window closes + if (volume.IsMuted) + volume.Unmute(); + exiting = true; + }; } private ScheduledDelegate scoreLoad; @@ -394,7 +403,7 @@ namespace osu.Game protected override void OnDeactivated() { base.OnDeactivated(); - if (muteWhenInactive) + if (muteWhenInactive && !exiting) { wasMuted = volume.IsMuted; volume.Mute(); @@ -404,7 +413,7 @@ namespace osu.Game protected override void OnActivated() { base.OnActivated(); - if (IsLoaded && muteWhenInactive && !wasMuted) + if (IsLoaded && muteWhenInactive && !wasMuted && !exiting) { volume.Unmute(); } From 52b48f2b7e3f65db4ddd189f970975dbe4d1ae20 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 15:21:49 +0900 Subject: [PATCH 371/628] Fix replays not correctly considering negative time diffs --- osu.Game/Rulesets/Scoring/ScoreStore.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreStore.cs b/osu.Game/Rulesets/Scoring/ScoreStore.cs index fe366f52a5..83c365d53b 100644 --- a/osu.Game/Rulesets/Scoring/ScoreStore.cs +++ b/osu.Game/Rulesets/Scoring/ScoreStore.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; @@ -129,7 +130,14 @@ namespace osu.Game.Rulesets.Scoring { var split = l.Split('|'); - if (split.Length < 4 || float.Parse(split[0]) < 0) continue; + if (split.Length < 4) + continue; + + if (split[0] == "-12345") + { + // Todo: The seed is provided in split[3], which we'll need to use at some point + continue; + } lastTime += float.Parse(split[0]); @@ -141,7 +149,7 @@ namespace osu.Game.Rulesets.Scoring )); } - return new Replay { Frames = frames }; + return new Replay { Frames = frames.OrderBy(f => f.Time).ToList() }; } } } From 2f7d9036bdd13ace2dca123374b87c0f5463cf2a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 16:20:40 +0900 Subject: [PATCH 372/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 49b563e2cf..cbdfad5d7e 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 49b563e2cf170eb19006b98dd5b69c2398362d9e +Subproject commit cbdfad5d7efdb9552a7d28523bd118f35d8542ea From 783ca40c642a6a7e107aff1f2a704ae0d9d6bb30 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 16:51:47 +0900 Subject: [PATCH 373/628] Update with upstream changes --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 2 +- osu.Game/Overlays/Profile/ProfileHeader.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index c091e2b5c9..3c81b92168 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -18,7 +18,7 @@ namespace osu.Game.Graphics.Containers { } - public override bool HandleInput => true; + public override bool HandleMouseInput => true; private OsuGame game; diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 035aba7dd7..937b4efcad 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -440,7 +440,7 @@ namespace osu.Game.Overlays.Profile { public string TooltipText => "View Profile in Browser"; - public override bool HandleInput => true; + public override bool HandleMouseInput => true; public ProfileLink(User user) { From da793d91ea30414b7c62bee7254065f3bc1e70ff Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 17:35:27 +0900 Subject: [PATCH 374/628] Make a testcase for replay vs autoplay --- osu.Game.Tests/Visual/TestCaseAutoplay.cs | 21 +++++++++++++++++++++ osu.Game.Tests/Visual/TestCaseReplay.cs | 18 +++++++++++++++++- osu.Game.Tests/osu.Game.Tests.csproj | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Tests/Visual/TestCaseAutoplay.cs diff --git a/osu.Game.Tests/Visual/TestCaseAutoplay.cs b/osu.Game.Tests/Visual/TestCaseAutoplay.cs new file mode 100644 index 0000000000..d954d0543c --- /dev/null +++ b/osu.Game.Tests/Visual/TestCaseAutoplay.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel; +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets; +using osu.Game.Screens.Play; + +namespace osu.Game.Tests.Visual +{ + [Description("Player instantiated with an autoplay mod.")] + public class TestCaseAutoplay : TestCasePlayer + { + protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) + { + beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); + return base.CreatePlayer(beatmap, ruleset); + } + } +} diff --git a/osu.Game.Tests/Visual/TestCaseReplay.cs b/osu.Game.Tests/Visual/TestCaseReplay.cs index 451c4e013f..237687458d 100644 --- a/osu.Game.Tests/Visual/TestCaseReplay.cs +++ b/osu.Game.Tests/Visual/TestCaseReplay.cs @@ -1,19 +1,35 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.ComponentModel; using System.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { + [Description("Player instantiated with a replay.")] public class TestCaseReplay : TestCasePlayer { protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) { + // We create a dummy RulesetContainer just to get the replay - we don't want to use mods here + // to simulate setting a replay rather than having the replay already set for us beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); - return base.CreatePlayer(beatmap, ruleset); + var dummyRulesetContainer = ruleset.CreateRulesetContainerWith(beatmap, false); + + // We have the replay + var replay = dummyRulesetContainer.Replay; + + // Reset the mods + beatmap.Mods.Value = beatmap.Mods.Value.Where(m => !(m is ModAutoplay)); + + return new ReplayPlayer(replay) + { + InitialBeatmap = beatmap + }; } } } diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 2eb79f6b35..20148828a8 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -136,6 +136,7 @@ + From 2ebb3d6e0ed46b39baa03d6c95f1f3b29ff76b96 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 17:37:14 +0900 Subject: [PATCH 375/628] Fix ReplayLoader not being treated as having a replay loaded Player checks for HasReplayLoaded in Player.load(), but the replay is attached in ReplayPlayer.LoadComplete(), which is too late. --- osu.Game/Rulesets/UI/RulesetContainer.cs | 7 ++++-- osu.Game/Screens/Play/HUDOverlay.cs | 32 ++++++++++++++++-------- osu.Game/Screens/Play/Player.cs | 3 +-- osu.Game/Screens/Play/SongProgress.cs | 13 ++++++++++ 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 626b56ad67..bb4466208b 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -13,6 +13,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using osu.Framework.Configuration; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; using osu.Game.Rulesets.Replays; @@ -45,9 +46,9 @@ namespace osu.Game.Rulesets.UI public PassThroughInputManager KeyBindingInputManager; /// - /// Whether we have a replay loaded currently. + /// Whether a replay is currently loaded. /// - public bool HasReplayLoaded => ReplayInputManager?.ReplayInputHandler != null; + public readonly BindableBool HasReplayLoaded = new BindableBool(); public abstract IEnumerable Objects { get; } @@ -99,6 +100,8 @@ namespace osu.Game.Rulesets.UI Replay = replay; ReplayInputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null; + + HasReplayLoaded.Value = ReplayInputManager.ReplayInputHandler != null; } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 721b5344ff..95d13cea3a 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play public readonly ReplaySettingsOverlay ReplaySettingsOverlay; private Bindable showHud; - private bool replayLoaded; + private readonly BindableBool replayLoaded = new BindableBool(); private static bool hasShownNotificationOnce; @@ -59,6 +59,24 @@ namespace osu.Game.Screens.Play ReplaySettingsOverlay = CreateReplaySettingsOverlay(), } }); + + replayLoaded.ValueChanged += replayLoadedValueChanged; + } + + private void replayLoadedValueChanged(bool loaded) + { + ReplaySettingsOverlay.ReplayLoaded = loaded; + + if (loaded) + { + ReplaySettingsOverlay.Show(); + ModDisplay.FadeIn(200); + } + else + { + ReplaySettingsOverlay.Hide(); + ModDisplay.Delay(2000).FadeOut(200); + } } [BackgroundDependencyLoader(true)] @@ -95,16 +113,10 @@ namespace osu.Game.Screens.Play { (rulesetContainer.KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(KeyCounter); - replayLoaded = rulesetContainer.HasReplayLoaded; + replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); + replayLoaded.TriggerChange(); - ReplaySettingsOverlay.ReplayLoaded = replayLoaded; - - // in the case a replay isn't loaded, we want some elements to only appear briefly. - if (!replayLoaded) - { - ReplaySettingsOverlay.Hide(); - ModDisplay.Delay(2000).FadeOut(200); - } + Progress.BindRulestContainer(rulesetContainer); } protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 31d9fac2ad..8d26d63d41 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -52,7 +52,7 @@ namespace osu.Game.Screens.Play public int RestartCount; public CursorContainer Cursor => RulesetContainer.Cursor; - public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded; + public bool ProvidingUserCursor => RulesetContainer?.Cursor != null && !RulesetContainer.HasReplayLoaded.Value; private IAdjustableClock adjustableSourceClock; private FramedOffsetClock offsetClock; @@ -226,7 +226,6 @@ namespace osu.Game.Screens.Play hudOverlay.Progress.Objects = RulesetContainer.Objects; hudOverlay.Progress.AudioClock = decoupledClock; - hudOverlay.Progress.AllowSeeking = RulesetContainer.HasReplayLoaded; hudOverlay.Progress.OnSeek = pos => decoupledClock.Seek(pos); hudOverlay.ModDisplay.Current.BindTo(working.Mods); diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 897fe4bba7..b367d33c6d 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -9,9 +9,12 @@ using System.Collections.Generic; using osu.Game.Graphics; using osu.Framework.Allocation; using System.Linq; +using osu.Framework.Configuration; using osu.Framework.Timing; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; +using osu.Game.Rulesets.UI; + namespace osu.Game.Screens.Play { public class SongProgress : OverlayContainer @@ -53,6 +56,8 @@ namespace osu.Game.Screens.Play } } + private readonly BindableBool replayLoaded = new BindableBool(); + [BackgroundDependencyLoader] private void load(OsuColour colours) { @@ -92,6 +97,8 @@ namespace osu.Game.Screens.Play OnSeek = position => OnSeek?.Invoke(position), }, }; + + replayLoaded.ValueChanged += v => AllowSeeking = v; } protected override void LoadComplete() @@ -99,6 +106,12 @@ namespace osu.Game.Screens.Play State = Visibility.Visible; } + public void BindRulestContainer(RulesetContainer rulesetContainer) + { + replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); + replayLoaded.TriggerChange(); + } + private bool allowSeeking; public bool AllowSeeking From a01e46bb68b7510665000518667808565450df35 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 17:55:55 +0900 Subject: [PATCH 376/628] Fix ScoreStore replays not getting users --- osu.Game/Rulesets/Scoring/ScoreStore.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreStore.cs b/osu.Game/Rulesets/Scoring/ScoreStore.cs index 83c365d53b..40a2bb34de 100644 --- a/osu.Game/Rulesets/Scoring/ScoreStore.cs +++ b/osu.Game/Rulesets/Scoring/ScoreStore.cs @@ -11,6 +11,7 @@ using osu.Game.Database; using osu.Game.IO.Legacy; using osu.Game.IPC; using osu.Game.Rulesets.Replays; +using osu.Game.Users; using SharpCompress.Compressors.LZMA; namespace osu.Game.Rulesets.Scoring @@ -55,7 +56,7 @@ namespace osu.Game.Rulesets.Scoring var beatmapHash = sr.ReadString(); score.Beatmap = beatmaps.QueryBeatmap(b => b.MD5Hash == beatmapHash); /* score.PlayerName = */ - sr.ReadString(); + score.User = new User { Username = sr.ReadString() }; /* var localScoreChecksum = */ sr.ReadString(); /* score.Count300 = */ @@ -108,7 +109,10 @@ namespace osu.Game.Rulesets.Scoring using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize)) using (var reader = new StreamReader(lzma)) + { score.Replay = createLegacyReplay(reader); + score.Replay.User = score.User; + } } } From 3eccface7274c4aa1ee9a951555421ae1d484987 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:21:32 +0900 Subject: [PATCH 377/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index cbdfad5d7e..aa111a4362 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit cbdfad5d7efdb9552a7d28523bd118f35d8542ea +Subproject commit aa111a4362acc50d5684be62675685041948894f From b27577e242c6d4a66ca201c05006d370b0fac4e9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:37:20 +0900 Subject: [PATCH 378/628] Add temporary browser handling of beatmap difficulty loading until we have an api method to support this. --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index 3c81b92168..ea11f065b4 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -60,7 +60,9 @@ namespace osu.Game.Graphics.Containers switch (linkType) { case LinkAction.OpenBeatmap: - // todo: implement this when overlay.ShowBeatmap(id) exists + // todo: replace this with overlay.ShowBeatmap(id) once an appropriate API call is implemented. + if (int.TryParse(linkArgument, out int beatmapId)) + Process.Start($"https://osu.ppy.sh/b/{beatmapId}"); break; case LinkAction.OpenBeatmapSet: if (int.TryParse(linkArgument, out int setId)) From 5a80c4964004925647c07ee0663ab3da8886ba5a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:44:15 +0900 Subject: [PATCH 379/628] Improve reference xmldoc --- osu.Game/Online/Chat/Message.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/Message.cs b/osu.Game/Online/Chat/Message.cs index 374a6e3159..99735c4d65 100644 --- a/osu.Game/Online/Chat/Message.cs +++ b/osu.Game/Online/Chat/Message.cs @@ -49,7 +49,7 @@ namespace osu.Game.Online.Chat /// /// The links found in this message. /// - /// The links' positions are according to + /// The s' and s are according to public List Links; public Message(long? id) From 38929658947fd9dd6b2ed6941b1211baaf26095b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:45:10 +0900 Subject: [PATCH 380/628] Remove unnecessary region and make methods public --- osu.Game/OsuGame.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 82271090f1..40848d2507 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -119,13 +119,11 @@ namespace osu.Game private ScheduledDelegate scoreLoad; - #region chat link actions + public void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName)); - internal void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName)); + public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); - internal void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); - - internal void LoadEditorTimestamp() + public void LoadEditorTimestamp() { notifications.Post(new SimpleNotification { @@ -134,7 +132,7 @@ namespace osu.Game }); } - internal void LoadSpectatorScreen() + public void LoadSpectatorScreen() { notifications.Post(new SimpleNotification { @@ -143,7 +141,7 @@ namespace osu.Game }); } - internal void JoinMultiplayerMatch(int matchId) + public void JoinMultiplayerMatch(int matchId) { notifications.Post(new SimpleNotification { @@ -152,8 +150,6 @@ namespace osu.Game }); } - #endregion - protected void LoadScore(Score s) { scoreLoad?.Cancel(); From 0b7e1ce667dae810a2fc9d7e2d1ad3b3ada05007 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 19:45:18 +0900 Subject: [PATCH 381/628] Add a way to have ruleset-specific configs --- .../Configuration/IRulesetConfigManager.cs | 9 +++++++ .../Configuration/RulesetConfigManager.cs | 24 +++++++++++++++++++ osu.Game/Rulesets/Ruleset.cs | 6 +++++ osu.Game/Screens/Play/Player.cs | 12 +++++++++- osu.Game/osu.Game.csproj | 2 ++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs create mode 100644 osu.Game/Rulesets/Configuration/RulesetConfigManager.cs diff --git a/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs new file mode 100644 index 0000000000..08fb6f53d6 --- /dev/null +++ b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs @@ -0,0 +1,9 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Configuration +{ + public interface IRulesetConfigManager + { + } +} diff --git a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs new file mode 100644 index 0000000000..633d8f3951 --- /dev/null +++ b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs @@ -0,0 +1,24 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; +using osu.Framework.Platform; + +namespace osu.Game.Rulesets.Configuration +{ + public abstract class RulesetConfigManager : ConfigManager, IRulesetConfigManager + where T : struct + { + protected override string Filename => ruleset?.ShortName; + private readonly Ruleset ruleset; + + protected RulesetConfigManager(Ruleset ruleset, Storage storage) + : base(storage) + { + this.ruleset = ruleset; + + // Re-load with the ruleset + Load(); + } + } +} diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index 4f256621fb..c1aba5b403 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -9,6 +9,7 @@ using osu.Framework.Input.Bindings; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; +using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -89,6 +90,11 @@ namespace osu.Game.Rulesets /// A descriptive name of the variant. public virtual string GetVariantName(int variant) => string.Empty; + /// + /// The that is used for settings specific to this . + /// + public virtual IRulesetConfigManager CreateConfigManager() => null; + /// /// Create a ruleset info based on this ruleset. /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 31d9fac2ad..b78f92f6b7 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,6 +24,7 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Cursor; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Cursor; @@ -88,8 +89,13 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; + private DependencyContainer dependencies; + + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) + => dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); + [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config, APIAccess api) + private void load(AudioManager audio, OsuConfigManager config, APIAccess api, Storage storage) { this.api = api; @@ -129,6 +135,10 @@ namespace osu.Game.Screens.Play if (!RulesetContainer.Objects.Any()) throw new InvalidOperationException("Beatmap contains no hit objects!"); + + var rulesetConfig = rulesetInstance.CreateConfigManager(); + if (rulesetConfig != null) + dependencies.Cache(rulesetConfig); } catch (Exception e) { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 85da54e317..05728c2b41 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -314,6 +314,8 @@ + + From da22b3ec49eb17b4eae275d1f2006e4197839320 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 20:12:39 +0900 Subject: [PATCH 382/628] No more sorting --- osu.Game/Rulesets/Scoring/ScoreStore.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreStore.cs b/osu.Game/Rulesets/Scoring/ScoreStore.cs index 40a2bb34de..b7385b9437 100644 --- a/osu.Game/Rulesets/Scoring/ScoreStore.cs +++ b/osu.Game/Rulesets/Scoring/ScoreStore.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; @@ -143,7 +142,11 @@ namespace osu.Game.Rulesets.Scoring continue; } - lastTime += float.Parse(split[0]); + var diff = float.Parse(split[0]); + lastTime += diff; + + if (diff < 0) + continue; frames.Add(new ReplayFrame( lastTime, @@ -153,7 +156,7 @@ namespace osu.Game.Rulesets.Scoring )); } - return new Replay { Frames = frames.OrderBy(f => f.Time).ToList() }; + return new Replay { Frames = frames }; } } } From 379688e2f25ee31e34aec34bf3a2d042e682855e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 20:15:17 +0900 Subject: [PATCH 383/628] Add todo --- osu.Game/Rulesets/Scoring/ScoreStore.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Rulesets/Scoring/ScoreStore.cs b/osu.Game/Rulesets/Scoring/ScoreStore.cs index b7385b9437..d21ca79736 100644 --- a/osu.Game/Rulesets/Scoring/ScoreStore.cs +++ b/osu.Game/Rulesets/Scoring/ScoreStore.cs @@ -145,6 +145,8 @@ namespace osu.Game.Rulesets.Scoring var diff = float.Parse(split[0]); lastTime += diff; + // Todo: At some point we probably want to rewind and play back the negative-time frames + // but for now we'll achieve equal playback to stable by skipping negative frames if (diff < 0) continue; From 9f4ebad6e3c05f25aced5dc2d20538e92466903f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 20:10:35 +0900 Subject: [PATCH 384/628] Add mania config manager --- .../Configuration/ManiaConfigManager.cs | 21 +++++++++++++++++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 5 +++++ .../osu.Game.Rulesets.Mania.csproj | 1 + osu.Game/Rulesets/Ruleset.cs | 3 ++- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs new file mode 100644 index 0000000000..aa288818c5 --- /dev/null +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Platform; +using osu.Game.Rulesets.Configuration; + +namespace osu.Game.Rulesets.Mania.Configuration +{ + public class ManiaConfigManager : RulesetConfigManager + { + public ManiaConfigManager(Ruleset ruleset, Storage storage) + : base(ruleset, storage) + { + } + } + + public enum ManiaSetting + { + ScrollSpeed + } +} diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index e8b9828bff..2709683eb4 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -9,7 +9,10 @@ using osu.Game.Rulesets.UI; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; +using osu.Framework.Platform; using osu.Game.Graphics; +using osu.Game.Rulesets.Configuration; +using osu.Game.Rulesets.Mania.Configuration; namespace osu.Game.Rulesets.Mania { @@ -154,5 +157,7 @@ namespace osu.Game.Rulesets.Mania } public override string GetVariantName(int variant) => $"{variant}K"; + + public override IRulesetConfigManager CreateConfigManager(Storage storage) => new ManiaConfigManager(this, storage); } } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 39f8333413..3c4e843dff 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -58,6 +58,7 @@ + diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index c1aba5b403..e736e0ac27 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; @@ -93,7 +94,7 @@ namespace osu.Game.Rulesets /// /// The that is used for settings specific to this . /// - public virtual IRulesetConfigManager CreateConfigManager() => null; + public virtual IRulesetConfigManager CreateConfigManager(Storage storage) => null; /// /// Create a ruleset info based on this ruleset. From 38c5434b825724fbf3c7b6d6c92753fd0b1a60c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:52:04 +0900 Subject: [PATCH 385/628] Remove placeholder methods in OsuGame Let's add these when they can actually be implemented. --- .../Graphics/Containers/LinkFlowContainer.cs | 21 +++++++++------ osu.Game/OsuGame.cs | 27 ------------------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index ea11f065b4..f35282fc93 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -8,6 +8,8 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using System.Collections.Generic; +using osu.Game.Overlays; +using osu.Game.Overlays.Notifications; namespace osu.Game.Graphics.Containers { @@ -22,11 +24,19 @@ namespace osu.Game.Graphics.Containers private OsuGame game; + private Action showNotImplementedError; + [BackgroundDependencyLoader(true)] - private void load(OsuGame game) + private void load(OsuGame game, NotificationOverlay notifications) { // will be null in tests this.game = game; + + showNotImplementedError = () => notifications?.Post(new SimpleNotification + { + Text = @"This link type is not yet supported!", + Icon = FontAwesome.fa_life_saver, + }); } public void AddLinks(string text, List links) @@ -72,14 +82,9 @@ namespace osu.Game.Graphics.Containers game?.OpenChannel(linkArgument); break; case LinkAction.OpenEditorTimestamp: - game?.LoadEditorTimestamp(); - break; case LinkAction.JoinMultiplayerMatch: - if (int.TryParse(linkArgument, out int matchId)) - game?.JoinMultiplayerMatch(matchId); - break; case LinkAction.Spectate: - // todo: implement this when spectating exists + showNotImplementedError?.Invoke(); break; case LinkAction.External: Process.Start(url); @@ -87,7 +92,7 @@ namespace osu.Game.Graphics.Containers default: throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action."); } - } + }, }); } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 40848d2507..56fe436210 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -123,33 +123,6 @@ namespace osu.Game public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); - public void LoadEditorTimestamp() - { - notifications.Post(new SimpleNotification - { - Text = @"Sorry, but this is not fully implemented yet!", - Icon = FontAwesome.fa_life_saver, - }); - } - - public void LoadSpectatorScreen() - { - notifications.Post(new SimpleNotification - { - Text = @"Sorry, but spectating is not implemented yet!", - Icon = FontAwesome.fa_life_saver, - }); - } - - public void JoinMultiplayerMatch(int matchId) - { - notifications.Post(new SimpleNotification - { - Text = @"Sorry, but the multiplayer lobby is not implemented yet!", - Icon = FontAwesome.fa_life_saver, - }); - } - protected void LoadScore(Score s) { scoreLoad?.Cancel(); From 73d69e2fd964c7eff983e3ca75bd3ffcf961203a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 20:32:26 +0900 Subject: [PATCH 386/628] Add more xmldoc --- osu.Game/OsuGame.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 56fe436210..dd020e435d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -119,8 +119,16 @@ namespace osu.Game private ScheduledDelegate scoreLoad; + /// + /// Open chat to a channel matching the provided name, if present. + /// + /// The name of the channel. public void OpenChannel(string channelName) => chat.OpenChannel(chat.AvailableChannels.Find(c => c.Name == channelName)); + /// + /// Show a beatmap set as an overlay. + /// + /// The set to display. public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); protected void LoadScore(Score s) From 92da02db8731b2b9eeb699481503c1a3c652903a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 21:07:37 +0900 Subject: [PATCH 387/628] Add extension to filename --- osu.Game/Rulesets/Configuration/RulesetConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs index 633d8f3951..9106485253 100644 --- a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs @@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Configuration public abstract class RulesetConfigManager : ConfigManager, IRulesetConfigManager where T : struct { - protected override string Filename => ruleset?.ShortName; + protected override string Filename => ruleset?.ShortName == null ? null : $"{ruleset.ShortName}.ini"; private readonly Ruleset ruleset; protected RulesetConfigManager(Ruleset ruleset, Storage storage) From d96234bf4063117ed10e391a7d4bbb98a25cd916 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 21:08:23 +0900 Subject: [PATCH 388/628] Enforce that there's only one configmanager per ruleset --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- osu.Game/Rulesets/Ruleset.cs | 10 +++++++++- osu.Game/Screens/Play/Player.cs | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 2709683eb4..9519de8b53 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -158,6 +158,6 @@ namespace osu.Game.Rulesets.Mania public override string GetVariantName(int variant) => $"{variant}K"; - public override IRulesetConfigManager CreateConfigManager(Storage storage) => new ManiaConfigManager(this, storage); + protected override IRulesetConfigManager CreateConfigManager(Storage storage) => new ManiaConfigManager(this, storage); } } diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index e736e0ac27..faadbd24f7 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -91,10 +91,18 @@ namespace osu.Game.Rulesets /// A descriptive name of the variant. public virtual string GetVariantName(int variant) => string.Empty; + private static readonly Dictionary config_manager_cache = new Dictionary(); + public IRulesetConfigManager GetConfigManager(Storage storage) + { + if (config_manager_cache.TryGetValue(GetType(), out var existing)) + return existing; + return config_manager_cache[GetType()] = CreateConfigManager(storage); + } + /// /// The that is used for settings specific to this . /// - public virtual IRulesetConfigManager CreateConfigManager(Storage storage) => null; + protected virtual IRulesetConfigManager CreateConfigManager(Storage storage) => null; /// /// Create a ruleset info based on this ruleset. diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b78f92f6b7..0ad2a4a78d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -136,7 +136,7 @@ namespace osu.Game.Screens.Play if (!RulesetContainer.Objects.Any()) throw new InvalidOperationException("Beatmap contains no hit objects!"); - var rulesetConfig = rulesetInstance.CreateConfigManager(); + var rulesetConfig = rulesetInstance.GetConfigManager(storage); if (rulesetConfig != null) dependencies.Cache(rulesetConfig); } From db27faa4717b0a4e142b09e5c608bd063add07f4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 21:13:14 +0900 Subject: [PATCH 389/628] Add a ScrollTime config setting to osu!mania --- .../Configuration/ManiaConfigManager.cs | 9 ++++++++- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs index aa288818c5..4972e3092a 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs @@ -12,10 +12,17 @@ namespace osu.Game.Rulesets.Mania.Configuration : base(ruleset, storage) { } + + protected override void InitialiseDefaults() + { + base.InitialiseDefaults(); + + Set(ManiaSetting.ScrollTime, 1500.0, 50.0, 10000.0, 50.0); + } } public enum ManiaSetting { - ScrollSpeed + ScrollTime } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 7d3df6cda7..868f4b143c 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -16,6 +16,7 @@ using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Framework.Graphics.Shapes; using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI @@ -161,8 +162,10 @@ namespace osu.Game.Rulesets.Mania.UI } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, ManiaConfigManager maniaConfig) { + maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange); + normalColumnColours = new List { colours.RedDark, From 54ed608ddb11faa2564b6b79890f858b55256e8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 21:26:12 +0900 Subject: [PATCH 390/628] Mute global track volume when a beatmap preview is playing --- osu.Game/Overlays/Direct/PlayButton.cs | 28 +++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 9ecddb01ba..a1f44a7a1b 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -9,6 +9,7 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input; +using osu.Framework.IO.Stores; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; @@ -39,6 +40,8 @@ namespace osu.Game.Overlays.Direct private readonly SpriteIcon icon; private readonly LoadingAnimation loadingAnimation; + private readonly BindableDouble muteBindable = new BindableDouble(); + private const float transition_duration = 500; private bool loading @@ -83,9 +86,10 @@ namespace osu.Game.Overlays.Direct } [BackgroundDependencyLoader] - private void load(OsuColour colour) + private void load(OsuColour colour, AudioManager audio) { hoverColour = colour.Yellow; + this.audio = audio; } protected override bool OnClick(InputState state) @@ -130,15 +134,20 @@ namespace osu.Game.Overlays.Direct Preview.Seek(0); Preview.Start(); + + audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable); } else { + audio.Track.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); + Preview?.Stop(); loading = false; } } private TrackLoader trackLoader; + private AudioManager audio; private void beginAudioLoad() { @@ -164,6 +173,7 @@ namespace osu.Game.Overlays.Direct private readonly string preview; public Track Preview; + private TrackManager trackManager; public TrackLoader(string preview) { @@ -171,10 +181,22 @@ namespace osu.Game.Overlays.Direct } [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(AudioManager audio, FrameworkConfigManager config) { + // create a local trackManager to bypass the mute we are applying above. + audio.AddItem(trackManager = new TrackManager(new OnlineStore())); + + // add back the user's music volume setting (since we are no longer in the global TrackManager's hierarchy). + config.BindWith(FrameworkSetting.VolumeMusic, trackManager.Volume); + if (!string.IsNullOrEmpty(preview)) - Preview = audio.Track.Get(preview); + Preview = trackManager.Get(preview); + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + trackManager?.Dispose(); } } } From e7524445eee93e77846df0430029aeb3f056e1aa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 21:33:19 +0900 Subject: [PATCH 391/628] Use Restart() --- osu.Game/Overlays/Direct/PlayButton.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index a1f44a7a1b..1646591f7f 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -132,8 +132,7 @@ namespace osu.Game.Overlays.Direct return; } - Preview.Seek(0); - Preview.Start(); + Preview.Restart(); audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable); } From c79603290d2f53ecd9bf2511074df72feeb6a05d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 17 Jan 2018 21:52:57 +0900 Subject: [PATCH 392/628] Move TriggerChange to LoadComplete() --- osu.Game/Screens/Play/HUDOverlay.cs | 42 +++++++++++++++------------ osu.Game/Screens/Play/SongProgress.cs | 4 ++- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 95d13cea3a..413d46f66e 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -60,23 +60,6 @@ namespace osu.Game.Screens.Play } }); - replayLoaded.ValueChanged += replayLoadedValueChanged; - } - - private void replayLoadedValueChanged(bool loaded) - { - ReplaySettingsOverlay.ReplayLoaded = loaded; - - if (loaded) - { - ReplaySettingsOverlay.Show(); - ModDisplay.FadeIn(200); - } - else - { - ReplaySettingsOverlay.Hide(); - ModDisplay.Delay(2000).FadeOut(200); - } } [BackgroundDependencyLoader(true)] @@ -109,12 +92,35 @@ namespace osu.Game.Screens.Play } } + protected override void LoadComplete() + { + base.LoadComplete(); + + replayLoaded.ValueChanged += replayLoadedValueChanged; + replayLoaded.TriggerChange(); + } + + private void replayLoadedValueChanged(bool loaded) + { + ReplaySettingsOverlay.ReplayLoaded = loaded; + + if (loaded) + { + ReplaySettingsOverlay.Show(); + ModDisplay.FadeIn(200); + } + else + { + ReplaySettingsOverlay.Hide(); + ModDisplay.Delay(2000).FadeOut(200); + } + } + public virtual void BindRulesetContainer(RulesetContainer rulesetContainer) { (rulesetContainer.KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(KeyCounter); replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); - replayLoaded.TriggerChange(); Progress.BindRulestContainer(rulesetContainer); } diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 2681d9a353..323635b4d6 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -105,12 +105,14 @@ namespace osu.Game.Screens.Play protected override void LoadComplete() { State = Visibility.Visible; + + replayLoaded.ValueChanged += v => AllowSeeking = v; + replayLoaded.TriggerChange(); } public void BindRulestContainer(RulesetContainer rulesetContainer) { replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); - replayLoaded.TriggerChange(); } private bool allowSeeking; From ac41cb59eabaed0034fa34ab6a5a0a5938673cb1 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 14:36:33 +0100 Subject: [PATCH 393/628] Typo fix, removed unnecessary braces --- .../Graphics/UserInterface/Volume/VolumeControl.cs | 10 +++------- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 7a1a2de50d..04c48c629d 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -78,7 +78,7 @@ namespace osu.Game.Graphics.UserInterface.Volume return true; case GlobalAction.ToggleMute: Show(); - volumeMeterMaster.ToogleMute(); + volumeMeterMaster.ToggleMute(); return true; } @@ -96,17 +96,13 @@ namespace osu.Game.Graphics.UserInterface.Volume public void Mute() { if (!IsMuted) - { - volumeMeterMaster.ToogleMute(); - } + volumeMeterMaster.ToggleMute(); } public void Unmute() { if (IsMuted) - { - volumeMeterMaster.ToogleMute(); - } + volumeMeterMaster.ToggleMute(); } [BackgroundDependencyLoader] diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index dc1b2e85eb..aac969b84f 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -93,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface.Volume Volume -= 0.05f; } - public void ToogleMute() + public void ToggleMute() { IsMuted = !IsMuted; if (IsMuted) From a05032779ffa6073f026839f4ad2b658f3daebec Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 00:03:41 +0900 Subject: [PATCH 394/628] Remove unneeded event binding --- osu.Game/Screens/Play/HUDOverlay.cs | 1 - osu.Game/Screens/Play/SongProgress.cs | 2 -- 2 files changed, 3 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 413d46f66e..255c071ac1 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -59,7 +59,6 @@ namespace osu.Game.Screens.Play ReplaySettingsOverlay = CreateReplaySettingsOverlay(), } }); - } [BackgroundDependencyLoader(true)] diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs index 323635b4d6..12f501a632 100644 --- a/osu.Game/Screens/Play/SongProgress.cs +++ b/osu.Game/Screens/Play/SongProgress.cs @@ -98,8 +98,6 @@ namespace osu.Game.Screens.Play OnSeek = position => OnSeek?.Invoke(position), }, }; - - replayLoaded.ValueChanged += v => AllowSeeking = v; } protected override void LoadComplete() From 1440edbf8b14bf3577461247f51758abf72ab92e Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 17:15:13 +0100 Subject: [PATCH 395/628] Use AudioManager adjustments to mute volume --- .../UserInterface/Volume/VolumeControl.cs | 28 ++++++++++++++----- .../UserInterface/Volume/VolumeMeter.cs | 17 +---------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 04c48c629d..d5645d6f24 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -7,12 +7,15 @@ using osu.Framework.Threading; using OpenTK; using osu.Framework.Audio; using osu.Framework.Allocation; +using osu.Framework.Configuration; using osu.Game.Input.Bindings; namespace osu.Game.Graphics.UserInterface.Volume { public class VolumeControl : OverlayContainer { + private AudioManager audio; + private readonly VolumeMeter volumeMeterMaster; protected override bool BlockPassThroughMouse => false; @@ -77,8 +80,10 @@ namespace osu.Game.Graphics.UserInterface.Volume volumeMeterMaster.Increase(); return true; case GlobalAction.ToggleMute: - Show(); - volumeMeterMaster.ToggleMute(); + if (IsMuted) + Unmute(); + else + Mute(); return true; } @@ -91,23 +96,32 @@ namespace osu.Game.Graphics.UserInterface.Volume schedulePopOut(); } - public bool IsMuted => volumeMeterMaster.IsMuted; + private readonly BindableDouble muteBindable = new BindableDouble(); + + public bool IsMuted { get; private set; } public void Mute() { - if (!IsMuted) - volumeMeterMaster.ToggleMute(); + if (IsMuted) + return; + + audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); + IsMuted = true; } public void Unmute() { - if (IsMuted) - volumeMeterMaster.ToggleMute(); + if (!IsMuted) + return; + + audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); + IsMuted = false; } [BackgroundDependencyLoader] private void load(AudioManager audio) { + this.audio = audio; volumeMeterMaster.Bindable.BindTo(audio.Volume); volumeMeterEffect.Bindable.BindTo(audio.VolumeSample); volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack); diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index aac969b84f..a1acb5d2ff 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -19,7 +19,6 @@ namespace osu.Game.Graphics.UserInterface.Volume public BindableDouble Bindable { get; } = new BindableDouble(); private double lastVolume; - public bool IsMuted { get; private set; } public VolumeMeter(string meterName) { @@ -74,18 +73,12 @@ namespace osu.Game.Graphics.UserInterface.Volume public double Volume { get => Bindable.Value; - private set - { - Bindable.Value = value; - if (value > 0) - IsMuted = false; - } + private set => Bindable.Value = value; } public void Increase() { Volume += 0.05f; - IsMuted = false; } public void Decrease() @@ -93,14 +86,6 @@ namespace osu.Game.Graphics.UserInterface.Volume Volume -= 0.05f; } - public void ToggleMute() - { - IsMuted = !IsMuted; - if (IsMuted) - lastVolume = Volume; - Volume = IsMuted ? 0.0 : lastVolume; - } - private void updateFill() => meterFill.ScaleTo(new Vector2(1, (float)Volume), 300, Easing.OutQuint); public bool OnPressed(GlobalAction action) From 6c67f96fdbdce24a75cada1d02c4c14ef2677fca Mon Sep 17 00:00:00 2001 From: "ANDY840119-PC\\andy840119" Date: Thu, 18 Jan 2018 02:01:01 +0900 Subject: [PATCH 396/628] fix ci error --- osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 4 ---- osu.Game/Rulesets/UI/Playfield.cs | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 82036d1e82..382eea589c 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -12,7 +12,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer + public class ManiaModKeyCoop : Mod, IKeyBindingMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer { public override string Name => "KeyCoop"; public override string ShortenedName => "2P"; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 15de119342..115a3cadb7 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -193,10 +193,6 @@ namespace osu.Game.Rulesets.Mania.UI internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { - var maniaObject = (ManiaHitObject)judgedObject.HitObject; - int columnIndex = maniaObject.Column - firstColumnIndex; - //Columns[columnIndex].OnJudgement(judgedObject, judgement); - judgements.Clear(); judgements.Add(new DrawableManiaJudgement(judgement) { diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 25da00362e..a7fed7059b 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; From f86cb30e47f07356286829544b7c2a136cc08057 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 17 Jan 2018 20:35:28 +0100 Subject: [PATCH 397/628] prevent negative width on progress bar --- osu.Game/Overlays/BeatmapSet/PreviewButton.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs index 11d1769f1e..87cd6f7af6 100644 --- a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs @@ -15,6 +15,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Overlays.Direct; using osu.Framework.Configuration; +using System; namespace osu.Game.Overlays.BeatmapSet { @@ -82,7 +83,8 @@ namespace osu.Game.Overlays.BeatmapSet if (Playing.Value && preview != null) { - progress.Width = (float)(preview.CurrentTime / preview.Length); + // prevent negative (potential infinite) width if a track without length was loaded + progress.Width = (float)Math.Max(preview.CurrentTime / preview.Length, 0); } } From 65bac6d31aa80ad8974e3eb4c5eadb5ee9d4d165 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 17 Jan 2018 20:36:47 +0100 Subject: [PATCH 398/628] return preview instead of nothing if it exists already allows listening to it again after reaching the end --- osu.Game/Overlays/Direct/PlayButton.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index 1646591f7f..c00fb9b122 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -150,7 +150,12 @@ namespace osu.Game.Overlays.Direct private void beginAudioLoad() { - if (trackLoader != null) return; + if (trackLoader != null) + { + Preview = trackLoader.Preview; + Playing.TriggerChange(); + return; + } loading = true; From a8fb732256d35c18c99cbf902d8b5fe8efe453de Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 20:43:08 +0100 Subject: [PATCH 399/628] Added muted/unmuted icon --- .../UserInterface/Volume/VolumeControl.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index d5645d6f24..2d350a3474 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -17,6 +17,7 @@ namespace osu.Game.Graphics.UserInterface.Volume private AudioManager audio; private readonly VolumeMeter volumeMeterMaster; + private readonly IconButton muteIcon; protected override bool BlockPassThroughMouse => false; @@ -37,12 +38,23 @@ namespace osu.Game.Graphics.UserInterface.Volume Spacing = new Vector2(15, 0), Children = new Drawable[] { + muteIcon = new IconButton(), volumeMeterMaster = new VolumeMeter("Master"), volumeMeterEffect = new VolumeMeter("Effects"), volumeMeterMusic = new VolumeMeter("Music") } } }; + + muteIcon.Icon = FontAwesome.fa_volume_up; + muteIcon.Scale = new Vector2(2.0f); + muteIcon.Action = () => + { + if (IsMuted) + Unmute(); + else + Mute(); + }; } protected override void LoadComplete() @@ -80,6 +92,8 @@ namespace osu.Game.Graphics.UserInterface.Volume volumeMeterMaster.Increase(); return true; case GlobalAction.ToggleMute: + if (State == Visibility.Hidden) + Show(); if (IsMuted) Unmute(); else @@ -107,6 +121,7 @@ namespace osu.Game.Graphics.UserInterface.Volume audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); IsMuted = true; + muteIcon.Icon = FontAwesome.fa_volume_off; } public void Unmute() @@ -116,6 +131,7 @@ namespace osu.Game.Graphics.UserInterface.Volume audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); IsMuted = false; + muteIcon.Icon = FontAwesome.fa_volume_up; } [BackgroundDependencyLoader] From 8471a579e056db875a198921ba3dab1042c4cae0 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 20:56:44 +0100 Subject: [PATCH 400/628] Removed no longer neccessary "exiting" flag --- osu.Game/OsuGame.cs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index de923b3451..56cfffdeae 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -79,8 +79,6 @@ namespace osu.Game private SettingsOverlay settings; - private bool exiting; - public OsuGame(string[] args = null) { this.args = args; @@ -119,13 +117,6 @@ namespace osu.Game Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; muteWhenInactive = LocalConfig.GetBindable(OsuSetting.MuteWhenInactive); - Host.Window.Exited += () => - { - //Prevent not saving audio levels when user alt tabs before the window closes - if (volume.IsMuted) - volume.Unmute(); - exiting = true; - }; } private ScheduledDelegate scoreLoad; @@ -403,7 +394,7 @@ namespace osu.Game protected override void OnDeactivated() { base.OnDeactivated(); - if (muteWhenInactive && !exiting) + if (muteWhenInactive) { wasMuted = volume.IsMuted; volume.Mute(); @@ -413,7 +404,7 @@ namespace osu.Game protected override void OnActivated() { base.OnActivated(); - if (IsLoaded && muteWhenInactive && !wasMuted && !exiting) + if (IsLoaded && muteWhenInactive && !wasMuted) { volume.Unmute(); } From 18ff57fdf9589a8d2cfffa943ae7bd4fb1733960 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 21:09:46 +0100 Subject: [PATCH 401/628] Inline changing mute icon properties with object creation --- .../UserInterface/Volume/VolumeControl.cs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 2d350a3474..2f565eba22 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -38,23 +38,24 @@ namespace osu.Game.Graphics.UserInterface.Volume Spacing = new Vector2(15, 0), Children = new Drawable[] { - muteIcon = new IconButton(), + muteIcon = new IconButton + { + Icon = FontAwesome.fa_volume_up, + Scale = new Vector2(2.0f), + Action = () => + { + if (IsMuted) + Unmute(); + else + Mute(); + }, + }, volumeMeterMaster = new VolumeMeter("Master"), volumeMeterEffect = new VolumeMeter("Effects"), volumeMeterMusic = new VolumeMeter("Music") } } }; - - muteIcon.Icon = FontAwesome.fa_volume_up; - muteIcon.Scale = new Vector2(2.0f); - muteIcon.Action = () => - { - if (IsMuted) - Unmute(); - else - Mute(); - }; } protected override void LoadComplete() From 9c09b33e4e75b49090fa7bf0679865c19cbcac02 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Wed, 17 Jan 2018 23:17:59 +0100 Subject: [PATCH 402/628] Removed no longer used "lastVolume" field --- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index a1acb5d2ff..ef3702fdf3 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -18,8 +18,6 @@ namespace osu.Game.Graphics.UserInterface.Volume private readonly Box meterFill; public BindableDouble Bindable { get; } = new BindableDouble(); - private double lastVolume; - public VolumeMeter(string meterName) { Size = new Vector2(40, 180); From 09dfea7e29bffd26a98c4c9457dd45655a0eabfe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 15:26:03 +0900 Subject: [PATCH 403/628] Use tracked settings from ConfigManager changes --- osu-framework | 2 +- osu.Game/Overlays/OnScreenDisplay.cs | 72 +++++++++++++++------------- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/osu-framework b/osu-framework index 8f36ddab94..c0c21831ce 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 +Subproject commit c0c21831cef6b2946c5b067f5c4bbd929e89c2ec diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 65803b477b..354c29531d 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; -using osu.Framework.Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -118,43 +117,50 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load(FrameworkConfigManager frameworkConfig) { - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.FrameSync), v => display(v, "Frame Limiter", v.GetDescription(), "Ctrl+F7")); - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.AudioDevice), v => display(v, "Audio Device", string.IsNullOrEmpty(v) ? "Default" : v, v)); - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.ShowLogOverlay), v => display(v, "Debug Logs", v ? "visible" : "hidden", "Ctrl+F10")); - - void displayResolution() => display(null, "Screen Resolution", frameworkConfig.Get(FrameworkSetting.Width) + "x" + frameworkConfig.Get(FrameworkSetting.Height)); - - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.Width), v => displayResolution()); - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.Height), v => displayResolution()); - - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.CursorSensitivity), v => display(v, "Cursor Sensitivity", v.ToString(@"0.##x"), "Ctrl+Alt+R to reset")); - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.ActiveInputHandlers), - delegate (string v) - { - bool raw = v.Contains("Raw"); - display(raw, "Raw Input", raw ? "enabled" : "disabled", "Ctrl+Alt+R to reset"); - }); - - trackSetting(frameworkConfig.GetBindable(FrameworkSetting.WindowMode), v => display(v, "Screen Mode", v.ToString(), "Alt+Enter")); + Register(frameworkConfig); } - private readonly List references = new List(); + private readonly Dictionary trackedConfigManagers = new Dictionary(); - private void trackSetting(Bindable bindable, Action action) + public void Register(ConfigManager configManager) + where T : struct { - // we need to keep references as we bind - references.Add(bindable); + if (configManager == null) throw new ArgumentNullException(nameof(configManager)); - bindable.ValueChanged += action; + if (trackedConfigManagers.ContainsKey(configManager)) + throw new InvalidOperationException($"{nameof(configManager)} is already registered."); + + var trackedSettings = configManager.CreateTrackedSettings(); + if (trackedSettings == null) + return; + + trackedSettings.LoadFrom(configManager); + trackedSettings.SettingChanged += display; + + trackedConfigManagers.Add(configManager, trackedSettings); } - private void display(object rawValue, string settingName, string settingValue, string shortcut = @"") + public void Unregister(ConfigManager configManager) + where T : struct + { + if (configManager == null) throw new ArgumentNullException(nameof(configManager)); + + if (!trackedConfigManagers.TryGetValue(configManager, out var existing)) + return; + + existing.Unload(); + existing.SettingChanged -= display; + + trackedConfigManagers.Remove(configManager); + } + + private void display(SettingDescription description) { Schedule(() => { - textLine1.Text = settingName.ToUpper(); - textLine2.Text = settingValue; - textLine3.Text = shortcut.ToUpper(); + textLine1.Text = description.Name.ToUpper(); + textLine2.Text = description.Value; + textLine3.Text = description.Shortcut.ToUpper(); box.Animate( b => b.FadeIn(500, Easing.OutQuint), @@ -167,16 +173,16 @@ namespace osu.Game.Overlays int optionCount = 0; int selectedOption = -1; - if (rawValue is bool) + if (description.RawValue is bool) { optionCount = 1; - if ((bool)rawValue) selectedOption = 0; + if ((bool)description.RawValue) selectedOption = 0; } - else if (rawValue is Enum) + else if (description.RawValue is Enum) { - var values = Enum.GetValues(rawValue.GetType()); + var values = Enum.GetValues(description.RawValue.GetType()); optionCount = values.Length; - selectedOption = Convert.ToInt32(rawValue); + selectedOption = Convert.ToInt32(description.RawValue); } textLine2.Origin = optionCount > 0 ? Anchor.BottomCentre : Anchor.Centre; From c2c478750d0a48a84a79c1b9ad81a60ce1824ba9 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 16:57:32 +0900 Subject: [PATCH 404/628] Remove generics from OSD registration methods --- osu.Game/Overlays/OnScreenDisplay.cs | 14 +++++++------- .../Configuration/IRulesetConfigManager.cs | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index 354c29531d..cc47f3bfa0 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Configuration; +using osu.Framework.Configuration.Tracking; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -120,28 +121,27 @@ namespace osu.Game.Overlays Register(frameworkConfig); } - private readonly Dictionary trackedConfigManagers = new Dictionary(); + private readonly Dictionary trackedConfigManagers = new Dictionary(); - public void Register(ConfigManager configManager) - where T : struct + public void Register(ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); if (trackedConfigManagers.ContainsKey(configManager)) - throw new InvalidOperationException($"{nameof(configManager)} is already registered."); + return; var trackedSettings = configManager.CreateTrackedSettings(); if (trackedSettings == null) return; - trackedSettings.LoadFrom(configManager); + configManager.LoadInto(trackedSettings); + trackedSettings.SettingChanged += display; trackedConfigManagers.Add(configManager, trackedSettings); } - public void Unregister(ConfigManager configManager) - where T : struct + public void Unregister(ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); diff --git a/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs index 08fb6f53d6..8d386242a9 100644 --- a/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs @@ -1,9 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Configuration; +using osu.Framework.Configuration.Tracking; + namespace osu.Game.Rulesets.Configuration { - public interface IRulesetConfigManager + public interface IRulesetConfigManager : ITrackableConfigManager, IConfigManager { } } From 7910b47868657dacbf90eacddc01d334a424bae1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 17:00:23 +0900 Subject: [PATCH 405/628] Move ConfigManager registration/dependency injection to RulesetContainer --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 5 --- .../UI/ManiaRulesetContainer.cs | 5 +++ osu.Game/OsuGame.cs | 4 +- osu.Game/Rulesets/Ruleset.cs | 15 -------- osu.Game/Rulesets/UI/RulesetContainer.cs | 38 +++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 12 +----- 6 files changed, 47 insertions(+), 32 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 9519de8b53..e8b9828bff 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -9,10 +9,7 @@ using osu.Game.Rulesets.UI; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; -using osu.Framework.Platform; using osu.Game.Graphics; -using osu.Game.Rulesets.Configuration; -using osu.Game.Rulesets.Mania.Configuration; namespace osu.Game.Rulesets.Mania { @@ -157,7 +154,5 @@ namespace osu.Game.Rulesets.Mania } public override string GetVariantName(int variant) => $"{variant}K"; - - protected override IRulesetConfigManager CreateConfigManager(Storage storage) => new ManiaConfigManager(this, storage); } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 5bb980adb2..1ffdb55136 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -9,9 +9,12 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.MathUtils; +using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Mania.Beatmaps; +using osu.Game.Rulesets.Mania.Configuration; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Replays; @@ -98,5 +101,7 @@ namespace osu.Game.Rulesets.Mania.UI protected override Vector2 GetPlayfieldAspectAdjust() => new Vector2(1, 0.8f); protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay, this); + + protected override IRulesetConfigManager CreateConfig(Ruleset ruleset, Storage storage) => new ManiaConfigManager(ruleset, storage); } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b48e25f1fe..b090cc7927 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -71,6 +71,7 @@ namespace osu.Game private OsuScreen screenStack; private VolumeControl volume; + private OnScreenDisplay onscreenDisplay; private Bindable configRuleset; public Bindable Ruleset = new Bindable(); @@ -195,7 +196,7 @@ namespace osu.Game }, overlayContent.Add); loadComponentSingleFile(volume = new VolumeControl(), Add); - loadComponentSingleFile(new OnScreenDisplay(), Add); + loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); //overlay elements loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); @@ -232,6 +233,7 @@ namespace osu.Game forwardLoggedErrorsToNotifications(); dependencies.Cache(settings); + dependencies.Cache(onscreenDisplay); dependencies.Cache(social); dependencies.Cache(direct); dependencies.Cache(chat); diff --git a/osu.Game/Rulesets/Ruleset.cs b/osu.Game/Rulesets/Ruleset.cs index faadbd24f7..4f256621fb 100644 --- a/osu.Game/Rulesets/Ruleset.cs +++ b/osu.Game/Rulesets/Ruleset.cs @@ -6,11 +6,9 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; -using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays.Settings; -using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; @@ -91,19 +89,6 @@ namespace osu.Game.Rulesets /// A descriptive name of the variant. public virtual string GetVariantName(int variant) => string.Empty; - private static readonly Dictionary config_manager_cache = new Dictionary(); - public IRulesetConfigManager GetConfigManager(Storage storage) - { - if (config_manager_cache.TryGetValue(GetType(), out var existing)) - return existing; - return config_manager_cache[GetType()] = CreateConfigManager(storage); - } - - /// - /// The that is used for settings specific to this . - /// - protected virtual IRulesetConfigManager CreateConfigManager(Storage storage) => null; - /// /// Create a ruleset info based on this ruleset. /// diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 626b56ad67..5d1c57a7a5 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -15,6 +15,9 @@ using System.Diagnostics; using System.Linq; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; +using osu.Framework.Platform; +using osu.Game.Overlays; +using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Replays; using osu.Game.Rulesets.Scoring; using OpenTK; @@ -64,6 +67,13 @@ namespace osu.Game.Rulesets.UI protected readonly Ruleset Ruleset; + private IRulesetConfigManager rulesetConfig; + + private DependencyContainer dependencies; + + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) + => dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); + /// /// A visual representation of a . /// @@ -76,6 +86,26 @@ namespace osu.Game.Rulesets.UI Cursor = CreateCursor(); } + [BackgroundDependencyLoader] + private void load(Storage storage, OnScreenDisplay onScreenDisplay) + { + rulesetConfig = getConfig(storage); + + if (rulesetConfig != null) + { + dependencies.Cache(rulesetConfig); + onScreenDisplay?.Register(rulesetConfig); + } + } + + private static readonly Dictionary config_cache = new Dictionary(); + private IRulesetConfigManager getConfig(Storage storage) + { + if (config_cache.TryGetValue(GetType(), out var existing)) + return existing; + return config_cache[GetType()] = CreateConfig(Ruleset, storage); + } + public abstract ScoreProcessor CreateScoreProcessor(); /// @@ -107,11 +137,19 @@ namespace osu.Game.Rulesets.UI /// protected virtual CursorContainer CreateCursor() => null; + protected virtual IRulesetConfigManager CreateConfig(Ruleset ruleset, Storage storage) => null; + /// /// Creates a Playfield. /// /// The Playfield. protected abstract Playfield CreatePlayfield(); + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + rulesetConfig.Save(); + } } /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 0ad2a4a78d..31d9fac2ad 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -24,7 +24,6 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Cursor; -using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Cursor; @@ -89,13 +88,8 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; - private DependencyContainer dependencies; - - protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) - => dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); - [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config, APIAccess api, Storage storage) + private void load(AudioManager audio, OsuConfigManager config, APIAccess api) { this.api = api; @@ -135,10 +129,6 @@ namespace osu.Game.Screens.Play if (!RulesetContainer.Objects.Any()) throw new InvalidOperationException("Beatmap contains no hit objects!"); - - var rulesetConfig = rulesetInstance.GetConfigManager(storage); - if (rulesetConfig != null) - dependencies.Cache(rulesetConfig); } catch (Exception e) { From 89f4bfa7b540d8bf24909bc56498c476de446ddf Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 17:00:41 +0900 Subject: [PATCH 406/628] Track mania scroll speed --- osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs index 4972e3092a..0f062ed72a 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Configuration.Tracking; using osu.Framework.Platform; using osu.Game.Rulesets.Configuration; @@ -19,6 +20,11 @@ namespace osu.Game.Rulesets.Mania.Configuration Set(ManiaSetting.ScrollTime, 1500.0, 50.0, 10000.0, 50.0); } + + public override TrackedSettings CreateTrackedSettings() => new TrackedSettings + { + new TrackedSetting(ManiaSetting.ScrollTime, v => new SettingDescription(v, "Scroll Time", $"{v}ms")) + }; } public enum ManiaSetting From 7ceed8b5eba746c771e352ef725b4a8620bcfda3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 17:28:56 +0900 Subject: [PATCH 407/628] Stop any playing preview when closing the direct overlay Resolves #1925 --- osu.Game/Overlays/DirectOverlay.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index 979a357d1e..d5acb9dc86 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -313,6 +313,14 @@ namespace osu.Game.Overlays api.Queue(getSetsRequest); } + protected override void PopOut() + { + base.PopOut(); + + if (playing != null) + playing.PreviewPlaying.Value = false; + } + private int distinctCount(List list) => list.Distinct().ToArray().Length; public class ResultCounts From dee298c395c26e465bca5037bb0924051e32d969 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 17:40:05 +0900 Subject: [PATCH 408/628] No more statics + better unregistration --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 8 +++++++ osu.Game/Overlays/OnScreenDisplay.cs | 16 +++++++------- .../Configuration/IRulesetConfigManager.cs | 3 +-- osu.Game/Rulesets/UI/RulesetContainer.cs | 22 +++++++++---------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 868f4b143c..7af675cc6a 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -161,11 +161,19 @@ namespace osu.Game.Rulesets.Mania.UI judgements.Scale = Scale; } + private Bindable scrollTime; + [BackgroundDependencyLoader] private void load(OsuColour colours, ManiaConfigManager maniaConfig) { maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange); + // Todo: The following two lines shouldn't be required, but is an effect of not having config databased + // 1. ValueChanged is run prior to values being propagated + // 2. We want the config to be saved ASAP, in-case a new ManiaPlayfield is instantiated + scrollTime = maniaConfig.GetBindable(ManiaSetting.ScrollTime); + scrollTime.ValueChanged += v => maniaConfig.Save(); + normalColumnColours = new List { colours.RedDark, diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index cc47f3bfa0..b9d0213aa6 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -118,16 +118,16 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load(FrameworkConfigManager frameworkConfig) { - Register(frameworkConfig); + Register(this, frameworkConfig); } - private readonly Dictionary trackedConfigManagers = new Dictionary(); + private readonly Dictionary<(IDisposable, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(IDisposable, IConfigManager), TrackedSettings>(); - public void Register(ITrackableConfigManager configManager) + public void Register(IDisposable source, ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); - if (trackedConfigManagers.ContainsKey(configManager)) + if (trackedConfigManagers.ContainsKey((source, configManager))) return; var trackedSettings = configManager.CreateTrackedSettings(); @@ -138,20 +138,20 @@ namespace osu.Game.Overlays trackedSettings.SettingChanged += display; - trackedConfigManagers.Add(configManager, trackedSettings); + trackedConfigManagers.Add((source, configManager), trackedSettings); } - public void Unregister(ITrackableConfigManager configManager) + public void Unregister(IDisposable source, ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); - if (!trackedConfigManagers.TryGetValue(configManager, out var existing)) + if (!trackedConfigManagers.TryGetValue((source, configManager), out var existing)) return; existing.Unload(); existing.SettingChanged -= display; - trackedConfigManagers.Remove(configManager); + trackedConfigManagers.Remove((source, configManager)); } private void display(SettingDescription description) diff --git a/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs index 8d386242a9..56eac730b0 100644 --- a/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/IRulesetConfigManager.cs @@ -1,12 +1,11 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Configuration; using osu.Framework.Configuration.Tracking; namespace osu.Game.Rulesets.Configuration { - public interface IRulesetConfigManager : ITrackableConfigManager, IConfigManager + public interface IRulesetConfigManager : ITrackableConfigManager { } } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 5d1c57a7a5..d4cfb3a3b3 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -68,6 +68,7 @@ namespace osu.Game.Rulesets.UI protected readonly Ruleset Ruleset; private IRulesetConfigManager rulesetConfig; + private OnScreenDisplay onScreenDisplay; private DependencyContainer dependencies; @@ -89,23 +90,17 @@ namespace osu.Game.Rulesets.UI [BackgroundDependencyLoader] private void load(Storage storage, OnScreenDisplay onScreenDisplay) { - rulesetConfig = getConfig(storage); + this.onScreenDisplay = onScreenDisplay; + + rulesetConfig = CreateConfig(Ruleset, storage); if (rulesetConfig != null) { dependencies.Cache(rulesetConfig); - onScreenDisplay?.Register(rulesetConfig); + onScreenDisplay?.Register(this, rulesetConfig); } } - private static readonly Dictionary config_cache = new Dictionary(); - private IRulesetConfigManager getConfig(Storage storage) - { - if (config_cache.TryGetValue(GetType(), out var existing)) - return existing; - return config_cache[GetType()] = CreateConfig(Ruleset, storage); - } - public abstract ScoreProcessor CreateScoreProcessor(); /// @@ -148,7 +143,12 @@ namespace osu.Game.Rulesets.UI protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - rulesetConfig.Save(); + + if (rulesetConfig != null) + { + onScreenDisplay?.Unregister(this, rulesetConfig); + rulesetConfig = null; + } } } From a94ea7025e3cf2a48a308097afe208d59e76b523 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 18:45:48 +0900 Subject: [PATCH 409/628] Register/Unregister -> BeginTracking/StopTracking and add exceptions --- osu.Game/Overlays/OnScreenDisplay.cs | 27 ++++++++++++++++++------ osu.Game/Rulesets/UI/RulesetContainer.cs | 4 ++-- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/osu.Game/Overlays/OnScreenDisplay.cs b/osu.Game/Overlays/OnScreenDisplay.cs index b9d0213aa6..bbb2c476f4 100644 --- a/osu.Game/Overlays/OnScreenDisplay.cs +++ b/osu.Game/Overlays/OnScreenDisplay.cs @@ -118,35 +118,48 @@ namespace osu.Game.Overlays [BackgroundDependencyLoader] private void load(FrameworkConfigManager frameworkConfig) { - Register(this, frameworkConfig); + BeginTracking(this, frameworkConfig); } - private readonly Dictionary<(IDisposable, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(IDisposable, IConfigManager), TrackedSettings>(); + private readonly Dictionary<(object, IConfigManager), TrackedSettings> trackedConfigManagers = new Dictionary<(object, IConfigManager), TrackedSettings>(); - public void Register(IDisposable source, ITrackableConfigManager configManager) + /// + /// Registers a to have its settings tracked by this . + /// + /// The object that is registering the to be tracked. + /// The to be tracked. + /// If is null. + /// If is already being tracked from the same . + public void BeginTracking(object source, ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); if (trackedConfigManagers.ContainsKey((source, configManager))) - return; + throw new InvalidOperationException($"{nameof(configManager)} is already registered."); var trackedSettings = configManager.CreateTrackedSettings(); if (trackedSettings == null) return; configManager.LoadInto(trackedSettings); - trackedSettings.SettingChanged += display; trackedConfigManagers.Add((source, configManager), trackedSettings); } - public void Unregister(IDisposable source, ITrackableConfigManager configManager) + /// + /// Unregisters a from having its settings tracked by this . + /// + /// The object that registered the to be tracked. + /// The that is being tracked. + /// If is null. + /// If is not being tracked from the same . + public void StopTracking(object source, ITrackableConfigManager configManager) { if (configManager == null) throw new ArgumentNullException(nameof(configManager)); if (!trackedConfigManagers.TryGetValue((source, configManager), out var existing)) - return; + throw new InvalidOperationException($"{nameof(configManager)} is not registered."); existing.Unload(); existing.SettingChanged -= display; diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index d4cfb3a3b3..45c112f669 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -97,7 +97,7 @@ namespace osu.Game.Rulesets.UI if (rulesetConfig != null) { dependencies.Cache(rulesetConfig); - onScreenDisplay?.Register(this, rulesetConfig); + onScreenDisplay?.BeginTracking(this, rulesetConfig); } } @@ -146,7 +146,7 @@ namespace osu.Game.Rulesets.UI if (rulesetConfig != null) { - onScreenDisplay?.Unregister(this, rulesetConfig); + onScreenDisplay?.StopTracking(this, rulesetConfig); rulesetConfig = null; } } From b4f2bea37b391eeeefc67b4c05d0312d7d119fbf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 19:50:26 +0900 Subject: [PATCH 410/628] Fix slider samples playing twice when additions are present --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 40ec57d434..90dd68ebf8 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -61,6 +61,7 @@ namespace osu.Game.Rulesets.Osu.Objects public int RepeatCount { get; set; } = 1; private int stackHeight; + public override int StackHeight { get { return stackHeight; } @@ -130,6 +131,17 @@ namespace osu.Game.Rulesets.Osu.Objects var distanceProgress = d / length; var timeProgress = reversed ? 1 - distanceProgress : distanceProgress; + var firstSample = Samples.FirstOrDefault(); + var sampleList = new List(); + + if (firstSample != null) + sampleList.Add(new SampleInfo + { + Bank = firstSample?.Bank, + Volume = firstSample?.Volume ?? 100, + Name = @"slidertick", + }); + AddNested(new SliderTick { RepeatIndex = repeat, @@ -138,12 +150,7 @@ namespace osu.Game.Rulesets.Osu.Objects StackHeight = StackHeight, Scale = Scale, ComboColour = ComboColour, - Samples = new List(Samples.Select(s => new SampleInfo - { - Bank = s.Bank, - Name = @"slidertick", - Volume = s.Volume - })) + Samples = sampleList }); } } From 97884e1d05c2856100b2266dbdb7b3b3037edafe Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 19:57:49 +0900 Subject: [PATCH 411/628] Remove unnecessary null checks --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 90dd68ebf8..4e2883bdb7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -137,8 +137,8 @@ namespace osu.Game.Rulesets.Osu.Objects if (firstSample != null) sampleList.Add(new SampleInfo { - Bank = firstSample?.Bank, - Volume = firstSample?.Volume ?? 100, + Bank = firstSample.Bank, + Volume = firstSample.Volume, Name = @"slidertick", }); From 063767e381121040249d7525d914c7590ff467d9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 20:37:36 +0900 Subject: [PATCH 412/628] Prioritise hit normal It's always first but not strictly guaranteed anywhere yet. --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 4e2883bdb7..4f3c439d9d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using osu.Game.Rulesets.Objects; using System.Linq; +using osu.Framework.Audio.Sample; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; @@ -131,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Objects var distanceProgress = d / length; var timeProgress = reversed ? 1 - distanceProgress : distanceProgress; - var firstSample = Samples.FirstOrDefault(); + var firstSample = Samples.FirstOrDefault(s => s.Name == SampleInfo.HIT_NORMAL) ?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933) var sampleList = new List(); if (firstSample != null) From e2965e1682bbc7a8bd0ad53a7fdf923ea18d41f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 20:46:57 +0900 Subject: [PATCH 413/628] Remove unused using --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 4f3c439d9d..2da285a434 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; using osu.Game.Rulesets.Objects; using System.Linq; -using osu.Framework.Audio.Sample; using osu.Game.Audio; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; From 01ff1584c22de096f34ecf347fa27da79c9081b4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 21:06:47 +0900 Subject: [PATCH 414/628] Fix repeat points not following slider snaking correctly --- .../Objects/Drawables/DrawableRepeatPoint.cs | 5 ++++- .../Objects/Drawables/DrawableSlider.cs | 6 ++++-- .../Objects/Drawables/ITrackSnaking.cs | 12 ++++++++++++ osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index f18d982bc0..7a74709e65 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Drawing.Imaging; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -11,7 +12,7 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public class DrawableRepeatPoint : DrawableOsuHitObject + public class DrawableRepeatPoint : DrawableOsuHitObject, ITrackSnaking { private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; @@ -71,5 +72,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; } } + + public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex / 2 == 0 ? end : start; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 6aa3268e5e..eb499b5da6 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public readonly DrawableHitCircle InitialCircle; - private readonly List components = new List(); + private readonly List components = new List(); private readonly Container ticks; private readonly Container repeatPoints; @@ -101,6 +101,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }; repeatPoints.Add(drawableRepeatPoint); + components.Add(drawableRepeatPoint); AddNested(drawableRepeatPoint); } } @@ -126,7 +127,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables if (!InitialCircle.Judgements.Any(j => j.IsHit)) InitialCircle.Position = slider.Curve.PositionAt(progress); - foreach (var c in components) c.UpdateProgress(progress, repeat); + foreach (var c in components.OfType()) c.UpdateProgress(progress, repeat); + foreach (var c in components.OfType()) c.UpdateSnakingPosition(slider.Curve.PositionAt(Body.SnakedStart ?? 0), slider.Curve.PositionAt(Body.SnakedEnd ?? 0)); foreach (var t in ticks.Children) t.Tracking = Ball.Tracking; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs new file mode 100644 index 0000000000..121df04483 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs @@ -0,0 +1,12 @@ +using OpenTK; + +namespace osu.Game.Rulesets.Osu.Objects.Drawables +{ + /// + /// A component which tracks the current end snaking position of a slider. + /// + public interface ITrackSnaking + { + void UpdateSnakingPosition(Vector2 start, Vector2 end); + } +} diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 7d6001359a..a59d4607df 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -71,6 +71,7 @@ + From 065d2a4887347b7cb4f9fb4ad1e0286c0c51850b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 21:12:53 +0900 Subject: [PATCH 415/628] Add licence header --- osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs index 121df04483..b5fd87f60b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/ITrackSnaking.cs @@ -1,4 +1,7 @@ -using OpenTK; +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; namespace osu.Game.Rulesets.Osu.Objects.Drawables { From 1a83770a061560f5cf196e8f60924fb9888a1978 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2018 21:16:15 +0900 Subject: [PATCH 416/628] Fix incorrect math --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 7a74709e65..3d0a6b7382 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -73,6 +73,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex / 2 == 0 ? end : start; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? start : end; } } From 46ba2cda10e381c279aaf55f746c4046b2a41303 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Thu, 18 Jan 2018 21:19:06 +0900 Subject: [PATCH 417/628] Remove unused using --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 3d0a6b7382..27ea725dea 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Drawing.Imaging; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; From 6908597b95e6690625c3b1a473f2e8bf5c5c76d7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 18 Jan 2018 23:44:00 +0900 Subject: [PATCH 418/628] Fix inverted ternary See #1935 - repeat index 1 is at the end of the slider, not the start. --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 27ea725dea..28ff4b4cdf 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -72,6 +72,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? start : end; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? end : start; } } From 56619ae926e180bb408a01cabcfe28551236e4de Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 18 Jan 2018 15:53:53 +0100 Subject: [PATCH 419/628] use ternary expression --- osu.Game/Overlays/BeatmapSet/PreviewButton.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs index 87cd6f7af6..4f5a6ba718 100644 --- a/osu.Game/Overlays/BeatmapSet/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/PreviewButton.cs @@ -15,7 +15,6 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Overlays.Direct; using osu.Framework.Configuration; -using System; namespace osu.Game.Overlays.BeatmapSet { @@ -84,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet if (Playing.Value && preview != null) { // prevent negative (potential infinite) width if a track without length was loaded - progress.Width = (float)Math.Max(preview.CurrentTime / preview.Length, 0); + progress.Width = preview.Length > 0 ? (float)(preview.CurrentTime / preview.Length) : 0f; } } From 4a85266fca02c4375fafc572fc2c524b08aa9643 Mon Sep 17 00:00:00 2001 From: aQaTL Date: Thu, 18 Jan 2018 17:23:02 +0100 Subject: [PATCH 420/628] Using BindableBool to mute the volume when it's value changes --- .../UserInterface/Volume/VolumeControl.cs | 39 ++++++++----------- osu.Game/OsuGame.cs | 2 - 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 2f565eba22..e611c0dfd0 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -14,8 +14,6 @@ namespace osu.Game.Graphics.UserInterface.Volume { public class VolumeControl : OverlayContainer { - private AudioManager audio; - private readonly VolumeMeter volumeMeterMaster; private readonly IconButton muteIcon; @@ -42,13 +40,7 @@ namespace osu.Game.Graphics.UserInterface.Volume { Icon = FontAwesome.fa_volume_up, Scale = new Vector2(2.0f), - Action = () => - { - if (IsMuted) - Unmute(); - else - Mute(); - }, + Action = () => Adjust(GlobalAction.ToggleMute), }, volumeMeterMaster = new VolumeMeter("Master"), volumeMeterEffect = new VolumeMeter("Effects"), @@ -113,35 +105,36 @@ namespace osu.Game.Graphics.UserInterface.Volume private readonly BindableDouble muteBindable = new BindableDouble(); - public bool IsMuted { get; private set; } + private readonly BindableBool muted = new BindableBool(); + + public bool IsMuted => muted.Value; public void Mute() { - if (IsMuted) - return; - - audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); - IsMuted = true; - muteIcon.Icon = FontAwesome.fa_volume_off; + muted.Value = true; } public void Unmute() { - if (!IsMuted) - return; - - audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); - IsMuted = false; - muteIcon.Icon = FontAwesome.fa_volume_up; + muted.Value = false; } [BackgroundDependencyLoader] private void load(AudioManager audio) { - this.audio = audio; volumeMeterMaster.Bindable.BindTo(audio.Volume); volumeMeterEffect.Bindable.BindTo(audio.VolumeSample); volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack); + + muted.ValueChanged += mute => + { + if (mute) + audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); + else + audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); + + muteIcon.Icon = mute ? FontAwesome.fa_volume_off : FontAwesome.fa_volume_up; + }; } private ScheduledDelegate popOutDelegate; diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 56cfffdeae..f1fb2a4f0a 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -405,9 +405,7 @@ namespace osu.Game { base.OnActivated(); if (IsLoaded && muteWhenInactive && !wasMuted) - { volume.Unmute(); - } } public bool OnReleased(GlobalAction action) => false; From 652f273961b329b744744faa5206d28581f5ac95 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 19 Jan 2018 15:46:42 +0900 Subject: [PATCH 421/628] Ensure previews stop playing when they are removed from the draw hierarchy --- osu.Game/Overlays/Direct/DirectPanel.cs | 2 ++ osu.Game/Overlays/Direct/PlayButton.cs | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 7dd6be8dc6..7da6f1ce2f 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -106,6 +106,8 @@ namespace osu.Game.Overlays.Direct beatmaps.BeatmapDownloadBegan += attachDownload; } + public override bool DisposeOnDeathRemoval => true; + protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); diff --git a/osu.Game/Overlays/Direct/PlayButton.cs b/osu.Game/Overlays/Direct/PlayButton.cs index c00fb9b122..1d67bc2d90 100644 --- a/osu.Game/Overlays/Direct/PlayButton.cs +++ b/osu.Game/Overlays/Direct/PlayButton.cs @@ -145,6 +145,12 @@ namespace osu.Game.Overlays.Direct } } + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + Playing.Value = false; + } + private TrackLoader trackLoader; private AudioManager audio; From 4d1142a0ce1650573523b0dd6e37f59cd977dbcd Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Fri, 19 Jan 2018 11:11:28 -0500 Subject: [PATCH 422/628] overall difficulty --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 2d1331d30a..c14ef9c2ea 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -16,9 +16,9 @@ namespace osu.Game.Rulesets.Osu.Objects public const double OBJECT_RADIUS = 64; private const double hittable_range = 300; - private const double hit_window_50 = 150; - private const double hit_window_100 = 80; - private const double hit_window_300 = 30; + public double HitWindow50 = 150; + public double HitWindow100 = 80; + public double HitWindow300 = 30; public float TimePreempt = 600; public float TimeFadein = 400; @@ -50,13 +50,13 @@ namespace osu.Game.Rulesets.Osu.Objects switch (result) { default: - return 300; + return hittable_range; case HitResult.Meh: - return 150; + return HitWindow50; case HitResult.Good: - return 80; + return HitWindow100; case HitResult.Great: - return 30; + return HitWindow300; } } @@ -78,6 +78,10 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); + HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 99.5, 149.5, 199.5); + HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 59.5, 99.5, 139.5); + HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 19.5, 49.5, 79.5); + Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } } From e109d5fe208cf28935edf583a5ca1c7706d70410 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Fri, 19 Jan 2018 11:13:49 -0500 Subject: [PATCH 423/628] fix slider heads --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index eb499b5da6..232964587c 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -60,7 +60,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Samples = s.Samples, SampleControlPoint = s.SampleControlPoint, TimePreempt = s.TimePreempt, - TimeFadein = s.TimeFadein + TimeFadein = s.TimeFadein, + HitWindow300 = s.HitWindow300, + HitWindow100 = s.HitWindow100, + HitWindow50 = s.HitWindow50 }) }; From 596044e19d79ef0e16908426201a7c97eb8e77da Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Fri, 19 Jan 2018 17:25:32 +0100 Subject: [PATCH 424/628] show beatmapsets with pending deletion in osu!direct --- osu.Game/Overlays/DirectOverlay.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index d5acb9dc86..efd54bec82 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -298,13 +298,15 @@ namespace osu.Game.Overlays Task.Run(() => { var onlineIds = response.Select(r => r.OnlineBeatmapSetID).ToList(); - var presentOnlineIds = beatmaps.QueryBeatmapSets(s => onlineIds.Contains(s.OnlineBeatmapSetID)).Select(r => r.OnlineBeatmapSetID).ToList(); - var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList(); + var presentSets = beatmaps.QueryBeatmapSets(s => onlineIds.Contains(s.OnlineBeatmapSetID)).ToList(); + + var responseSets = response.Select(r => r.ToBeatmapSet(rulesets)).ToList(); + var finalSets = responseSets.Where(b => !presentSets.Any(s => s.OnlineBeatmapSetID == b.OnlineBeatmapSetID && !s.DeletePending)).ToList(); // may not need scheduling; loads async internally. Schedule(() => { - BeatmapSets = sets; + BeatmapSets = finalSets; recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); }); }); From c29eea870d8bcbf87d6b16ec68cb8504070de514 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Fri, 19 Jan 2018 20:56:41 -0500 Subject: [PATCH 425/628] correct values --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index c14ef9c2ea..57ad2717e6 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -78,9 +78,9 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); - HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 99.5, 149.5, 199.5); - HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 59.5, 99.5, 139.5); - HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 19.5, 49.5, 79.5); + HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 100, 150, 200); + HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 60, 100, 140); + HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 20, 50, 80); Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } From 29466438a3e95c10734472a7746e0d486373134c Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Fri, 19 Jan 2018 20:58:43 -0500 Subject: [PATCH 426/628] fix values --- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 57ad2717e6..0e7c2f3d4d 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -78,9 +78,9 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); - HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 100, 150, 200); - HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 60, 100, 140); - HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 20, 50, 80); + HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 200, 150, 100); + HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 140, 100, 60); + HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 80, 50, 20); Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } From c4feb67bceede170fa341a2fe9f56fc7f43c83ca Mon Sep 17 00:00:00 2001 From: aQaTL Date: Sat, 20 Jan 2018 11:45:04 +0100 Subject: [PATCH 427/628] Using field properties to set mute / unmute instead of separate methods --- .../UserInterface/Volume/VolumeControl.cs | 28 ++++++++----------- osu.Game/OsuGame.cs | 6 ++-- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index e611c0dfd0..60242393ab 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -85,12 +85,8 @@ namespace osu.Game.Graphics.UserInterface.Volume volumeMeterMaster.Increase(); return true; case GlobalAction.ToggleMute: - if (State == Visibility.Hidden) - Show(); - if (IsMuted) - Unmute(); - else - Mute(); + Show(); + Muted = !Muted; return true; } @@ -107,16 +103,10 @@ namespace osu.Game.Graphics.UserInterface.Volume private readonly BindableBool muted = new BindableBool(); - public bool IsMuted => muted.Value; - - public void Mute() + public bool Muted { - muted.Value = true; - } - - public void Unmute() - { - muted.Value = false; + get => muted.Value; + set => muted.Value = value; } [BackgroundDependencyLoader] @@ -129,11 +119,15 @@ namespace osu.Game.Graphics.UserInterface.Volume muted.ValueChanged += mute => { if (mute) + { audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); + muteIcon.Icon = FontAwesome.fa_volume_off; + } else + { audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); - - muteIcon.Icon = mute ? FontAwesome.fa_volume_off : FontAwesome.fa_volume_up; + muteIcon.Icon = FontAwesome.fa_volume_up; + } }; } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f1fb2a4f0a..b938595d57 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -396,8 +396,8 @@ namespace osu.Game base.OnDeactivated(); if (muteWhenInactive) { - wasMuted = volume.IsMuted; - volume.Mute(); + wasMuted = volume.Muted; + volume.Muted = true; } } @@ -405,7 +405,7 @@ namespace osu.Game { base.OnActivated(); if (IsLoaded && muteWhenInactive && !wasMuted) - volume.Unmute(); + volume.Muted = false; } public bool OnReleased(GlobalAction action) => false; From ad2df8d8dfdfc775098ae07725adaa03a00f47b0 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 20:09:44 -0500 Subject: [PATCH 428/628] Fixed tilde-key crash at end of beatmap. --- osu.Game/Screens/Play/Player.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 8d26d63d41..d50f463c2c 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -88,6 +88,9 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; + private bool allowRestart = true; + private bool exited = false; + [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, APIAccess api) { @@ -208,10 +211,12 @@ namespace osu.Game.Screens.Play new HotkeyRetryOverlay { Action = () => { - //we want to hide the hitrenderer immediately (looks better). - //we may be able to remove this once the mouse cursor trail is improved. - RulesetContainer?.Hide(); - Restart(); + if (allowRestart) { + //we want to hide the hitrenderer immediately (looks better). + //we may be able to remove this once the mouse cursor trail is improved. + RulesetContainer?.Hide(); + Restart(); + } }, } }; @@ -266,6 +271,7 @@ namespace osu.Game.Screens.Play public void Restart() { + exited = true; sampleRestart?.Play(); ValidForResume = false; RestartRequested?.Invoke(); @@ -288,6 +294,11 @@ namespace osu.Game.Screens.Play { onCompletionEvent = Schedule(delegate { + // This is here to mimic OsuStable behavior. It could be placed outside the delay timer, + // which would remove the need for the check on Push() below, and would make it impossible + // to quick-restart after hitting the last note. + allowRestart = false; + var score = new Score { Beatmap = Beatmap.Value.BeatmapInfo, @@ -295,7 +306,7 @@ namespace osu.Game.Screens.Play }; scoreProcessor.PopulateScore(score); score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; - Push(new Results(score)); + if (!exited) Push(new Results(score)); }); } } From 806da2176051fa3748a3617a1e1fdf862a54e881 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 20:24:19 -0500 Subject: [PATCH 429/628] Removed rreduntant initialization. --- osu.Game/Screens/Play/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index d50f463c2c..2885427e88 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -89,7 +89,7 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; private bool allowRestart = true; - private bool exited = false; + private bool exited; [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, APIAccess api) From 964c6da9a436319f69c7f67fc62a2bdfa0da2413 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 22:00:18 -0500 Subject: [PATCH 430/628] Use IsCurrentScreen instead of a bool --- osu.Game/Screens/Play/Player.cs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 2885427e88..4f7f145ed0 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -89,7 +89,6 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; private bool allowRestart = true; - private bool exited; [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, APIAccess api) @@ -271,7 +270,6 @@ namespace osu.Game.Screens.Play public void Restart() { - exited = true; sampleRestart?.Play(); ValidForResume = false; RestartRequested?.Invoke(); @@ -294,19 +292,19 @@ namespace osu.Game.Screens.Play { onCompletionEvent = Schedule(delegate { - // This is here to mimic OsuStable behavior. It could be placed outside the delay timer, - // which would remove the need for the check on Push() below, and would make it impossible - // to quick-restart after hitting the last note. - allowRestart = false; - - var score = new Score + if (IsCurrentScreen) { - Beatmap = Beatmap.Value.BeatmapInfo, - Ruleset = ruleset - }; - scoreProcessor.PopulateScore(score); - score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; - if (!exited) Push(new Results(score)); + allowRestart = false; + + var score = new Score + { + Beatmap = Beatmap.Value.BeatmapInfo, + Ruleset = ruleset + }; + scoreProcessor.PopulateScore(score); + score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; + Push(new Results(score)); + } }); } } From 530e0afa2c89acda8dc9cc26100501ebd015ba51 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 22:27:15 -0500 Subject: [PATCH 431/628] Use IsCurrentScreen instead of a bool for both checks now. --- osu.Game/Screens/Play/Player.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 4f7f145ed0..e29ff8edd3 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -88,8 +88,6 @@ namespace osu.Game.Screens.Play private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; - private bool allowRestart = true; - [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config, APIAccess api) { @@ -210,7 +208,7 @@ namespace osu.Game.Screens.Play new HotkeyRetryOverlay { Action = () => { - if (allowRestart) { + if (IsCurrentScreen) { //we want to hide the hitrenderer immediately (looks better). //we may be able to remove this once the mouse cursor trail is improved. RulesetContainer?.Hide(); @@ -294,8 +292,6 @@ namespace osu.Game.Screens.Play { if (IsCurrentScreen) { - allowRestart = false; - var score = new Score { Beatmap = Beatmap.Value.BeatmapInfo, From b4e1872322d9ac19c505f29add7c482b87f8a7e1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 12:56:30 +0900 Subject: [PATCH 432/628] osu!-side changes in-line with framework BDL cache changes --- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 4 ++-- osu.Game/Screens/Select/SongSelect.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b48e25f1fe..1e175ff8c4 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -110,7 +110,7 @@ namespace osu.Game Task.Run(() => BeatmapManager.Import(paths.ToArray())); } - dependencies.Cache(this); + dependencies.CacheAs(this); configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ef02f1a7ec..8b317ca59a 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -93,7 +93,7 @@ namespace osu.Game dependencies.Cache(new LargeTextureStore(new RawTextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures")))); - dependencies.Cache(this); + dependencies.CacheAs(this); dependencies.Cache(LocalConfig); runMigrations(); @@ -112,7 +112,7 @@ namespace osu.Game dependencies.Cache(new OsuColour()); //this completely overrides the framework default. will need to change once we make a proper FontStore. - dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }, true); + dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont")); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 357931b878..79f00cc988 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -181,7 +181,7 @@ namespace osu.Game.Screens.Select [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours) { - dependencies.Cache(this); + dependencies.CacheAs(this); if (Footer != null) { From 060d80efbe96e7248b0675247b1475f842408bab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 22 Jan 2018 13:05:07 +0900 Subject: [PATCH 433/628] Continue showing progress bar on direct panels when importing Previously the progrress bar would fade out once downloads completed, which felt unintuitive. --- osu.Game/Graphics/UserInterface/ProgressBar.cs | 2 +- osu.Game/Overlays/Direct/DirectPanel.cs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/ProgressBar.cs b/osu.Game/Graphics/UserInterface/ProgressBar.cs index 43fab9fead..6021cf08be 100644 --- a/osu.Game/Graphics/UserInterface/ProgressBar.cs +++ b/osu.Game/Graphics/UserInterface/ProgressBar.cs @@ -18,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface public Color4 FillColour { - set { fill.Colour = value; } + set { fill.FadeColour(value, 150, Easing.OutQuint); } } public Color4 BackgroundColour diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 7dd6be8dc6..7e7e8d8665 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -65,11 +65,14 @@ namespace osu.Game.Overlays.Direct Colour = Color4.Black.Opacity(0.3f), }; + private OsuColour colours; + [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay) { this.beatmaps = beatmaps; this.beatmapSetOverlay = beatmapSetOverlay; + this.colours = colours; AddInternal(content = new Container { @@ -188,7 +191,7 @@ namespace osu.Game.Overlays.Direct request.Success += data => { progressBar.Current.Value = 1; - progressBar.FadeOut(500); + progressBar.FillColour = colours.Yellow; }; } From 88beee2d1fad2db1c30acc39d8cb6e50a7a9d4f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 22 Jan 2018 13:17:03 +0900 Subject: [PATCH 434/628] Keep downloads active until their associated import operation finishes This avoids race conditions where a second download can potentially be started while the first is still active. --- osu.Game/Beatmaps/BeatmapManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 634b5bcd20..e6ddf4bfd9 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -287,9 +287,8 @@ namespace osu.Game.Beatmaps Import(archive); downloadNotification.State = ProgressNotificationState.Completed; + currentDownloads.Remove(request); }, TaskCreationOptions.LongRunning); - - currentDownloads.Remove(request); }; request.Failure += data => From 9405f349fc1b2828f1324369a5c710adc6a67482 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 13:21:35 +0900 Subject: [PATCH 435/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8f36ddab94..26c01ca606 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 +Subproject commit 26c01ca6069296621f76d8ffbfe31ecf8074c687 From 53e40a77dcb3870d74dd616ce4c29a33ada29106 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 22 Jan 2018 13:25:49 +0900 Subject: [PATCH 436/628] Don't show error messages when a download is user-cancelled Resolves #1941. --- osu.Game/Beatmaps/BeatmapManager.cs | 6 ++++-- osu.Game/Overlays/Direct/DirectPanel.cs | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 634b5bcd20..fa20f779a4 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -292,10 +292,12 @@ namespace osu.Game.Beatmaps currentDownloads.Remove(request); }; - request.Failure += data => + request.Failure += error => { + if (error is OperationCanceledException) return; + downloadNotification.State = ProgressNotificationState.Completed; - Logger.Error(data, "Failed to get beatmap download information"); + Logger.Error(error, "Beatmap download failed!"); currentDownloads.Remove(request); }; diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 7dd6be8dc6..64a36f5671 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -180,7 +180,6 @@ namespace osu.Game.Overlays.Direct { progressBar.Current.Value = 0; progressBar.FadeOut(500); - Logger.Error(e, "Failed to get beatmap download information"); }; request.DownloadProgressed += progress => progressBar.Current.Value = progress; From 4780c3f8c6d41a36762b31629e7cfc8b6fd09c20 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 13:41:47 +0900 Subject: [PATCH 437/628] Disable TestCaseWaveform --- osu.Game.Tests/Visual/TestCaseWaveform.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Tests/Visual/TestCaseWaveform.cs b/osu.Game.Tests/Visual/TestCaseWaveform.cs index 87492e2332..dd5420400f 100644 --- a/osu.Game.Tests/Visual/TestCaseWaveform.cs +++ b/osu.Game.Tests/Visual/TestCaseWaveform.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using NUnit.Framework; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -15,6 +16,7 @@ using osu.Game.Screens.Edit.Screens.Compose.Timeline; namespace osu.Game.Tests.Visual { + [Ignore("CI regularly hangs on this TestCase...")] public class TestCaseWaveform : OsuTestCase { private readonly Bindable beatmapBacking = new Bindable(); From 3d4e2d400cd9896803a2dbf0ce31f928f40b20a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 22 Jan 2018 13:52:10 +0900 Subject: [PATCH 438/628] Remove unused using --- osu.Game/Overlays/Direct/DirectPanel.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index 64a36f5671..9249c5a2c4 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -16,7 +16,6 @@ using osu.Game.Graphics.Sprites; using OpenTK.Graphics; using osu.Framework.Input; using osu.Game.Graphics.UserInterface; -using osu.Framework.Logging; using osu.Game.Online.API.Requests; using osu.Framework.Configuration; using osu.Framework.Audio.Track; From b98d8361bd6556d7c98fcea48bf98de0f5d46d20 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 23:59:35 -0500 Subject: [PATCH 439/628] Use obtained value for displayed name. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index c2dfea9a08..16586adc0c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.Username; + Text = api.LocalUser.Value.Username; avatar.User = api.LocalUser; break; } From 19321ca880c40b2647284e6642141c817b4c6546 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 00:16:38 -0500 Subject: [PATCH 440/628] Save the obtained username when online. --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ef02f1a7ec..fad0c8c3d9 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); break; } } From 293023d99a0f3aa4c228a2144a5793eb3c829e64 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 14:38:41 +0900 Subject: [PATCH 441/628] Fix keybinding offsets due to special keys --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 12 ++++++----- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 4 +++- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 22 ++++++++++---------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index befa657715..64f02f45ec 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -155,7 +155,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.Space, SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, - }.GenerateKeyBindingsFor(variant); + }.GenerateKeyBindingsFor(variant, out _); case ManiaKeyBindingVariantType.Coop: case ManiaKeyBindingVariantType.Versus: getMultiVariantKeyCounts(variant, out int p1K, out int p2K); @@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.Tilde, SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1 - }.GenerateKeyBindingsFor(p1K); + }.GenerateKeyBindingsFor(p1K, out var nextNormal); var player2Bindings = new VariantMappingGenerator { @@ -199,8 +199,8 @@ namespace osu.Game.Rulesets.Mania }, SpecialKey = InputKey.BackSlash, SpecialAction = ManiaAction.Special2, - NormalActionStart = ManiaAction.Key1 + p1K - }.GenerateKeyBindingsFor(p2K); + NormalActionStart = nextNormal + }.GenerateKeyBindingsFor(p2K, out _); return player1Bindings.Concat(player2Bindings); } @@ -300,8 +300,9 @@ namespace osu.Game.Rulesets.Mania /// Generates a list of s for a specific number of columns. /// /// The number of columns that need to be bound. + /// The next to use for normal columns. /// The keybindings. - public IEnumerable GenerateKeyBindingsFor(int columns) + public IEnumerable GenerateKeyBindingsFor(int columns, out ManiaAction nextNormalAction) { ManiaAction currentNormalAction = NormalActionStart; @@ -316,6 +317,7 @@ namespace osu.Game.Rulesets.Mania if (columns % 2 == 1) bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); + nextNormalAction = currentNormalAction; return bindings; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 101586f3e4..e787b70797 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -48,10 +48,12 @@ namespace osu.Game.Rulesets.Mania.UI Content = new[] { new Drawable[stageDefinitions.Count] } }; + var normalColumnAction = ManiaAction.Key1; + var specialColumnAction = ManiaAction.Special1; int firstColumnIndex = 0; for (int i = 0; i < stageDefinitions.Count; i++) { - var newStage = new ManiaStage(i, firstColumnIndex, stageDefinitions[i]); + var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction); newStage.SpecialColumn.BindTo(SpecialColumnPosition); newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 115a3cadb7..ec21c72285 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -49,14 +49,12 @@ namespace osu.Game.Rulesets.Mania.UI private List normalColumnColours = new List(); private Color4 specialColumnColour; - private readonly int stageIndex; private readonly int firstColumnIndex; private readonly StageDefinition definition; - public ManiaStage(int stageIndex, int firstColumnIndex, StageDefinition definition) + public ManiaStage(int firstColumnIndex, StageDefinition definition, ref ManiaAction normalColumnStartAction, ref ManiaAction specialColumnStartAction) : base(ScrollingDirection.Up) { - this.stageIndex = stageIndex; this.firstColumnIndex = firstColumnIndex; this.definition = definition; @@ -134,7 +132,16 @@ namespace osu.Game.Rulesets.Mania.UI }; for (int i = 0; i < definition.Columns; i++) - AddColumn(new Column()); + { + var isSpecial = isSpecialColumn(i); + var column = new Column + { + IsSpecial = isSpecial, + Action = isSpecial ? specialColumnStartAction++ : normalColumnStartAction++ + }; + + AddColumn(column); + } Inverted.ValueChanged += invertedChanged; Inverted.TriggerChange(); @@ -153,13 +160,6 @@ namespace osu.Game.Rulesets.Mania.UI topLevelContainer.Add(c.TopLevelContainer.CreateProxy()); columnFlow.Add(c); AddNested(c); - - c.IsSpecial = isSpecialColumn(Columns.Count - 1); - - if (c.IsSpecial) - c.Action = ManiaAction.Special1 + stageIndex; - else - c.Action = ManiaAction.Key1 + firstColumnIndex + Columns.Count - 1; } /// From c4252ee022635332a3f1c62c26f1b6ed5ad379f3 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Sun, 21 Jan 2018 23:59:35 -0500 Subject: [PATCH 442/628] Use obtained value for displayed name. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index c2dfea9a08..16586adc0c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.Username; + Text = api.LocalUser.Value.Username; avatar.User = api.LocalUser; break; } From 87ec36060d2eca78491d08f5d42940a9a29faf02 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 00:16:38 -0500 Subject: [PATCH 443/628] Save the obtained username when online. --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index ef02f1a7ec..fad0c8c3d9 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); break; } } From 3b47c0fea0cd97f2d9a0fd796bd1f2cc3b3fe677 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 14:54:47 +0900 Subject: [PATCH 444/628] Remove versus-mode variant --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 59 +++++++------------------ 1 file changed, 15 insertions(+), 44 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 64f02f45ec..60f1b207c5 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -127,7 +127,6 @@ namespace osu.Game.Rulesets.Mania yield return (int)ManiaKeyBindingVariantType.Solo + i; for (int i = 2; i <= 18; i++) yield return (int)ManiaKeyBindingVariantType.Coop + i; - // Todo: Versus mode } } @@ -157,10 +156,9 @@ namespace osu.Game.Rulesets.Mania NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); case ManiaKeyBindingVariantType.Coop: - case ManiaKeyBindingVariantType.Versus: - getMultiVariantKeyCounts(variant, out int p1K, out int p2K); + getDualStageKeyCounts(variant, out int s1K, out int s2K); - var player1Bindings = new VariantMappingGenerator + var stage1Bindings = new VariantMappingGenerator { LeftKeys = new[] { @@ -179,9 +177,9 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.Tilde, SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1 - }.GenerateKeyBindingsFor(p1K, out var nextNormal); + }.GenerateKeyBindingsFor(s1K, out var nextNormal); - var player2Bindings = new VariantMappingGenerator + var stage2Bindings = new VariantMappingGenerator { LeftKeys = new[] { @@ -200,9 +198,9 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.BackSlash, SpecialAction = ManiaAction.Special2, NormalActionStart = nextNormal - }.GenerateKeyBindingsFor(p2K, out _); + }.GenerateKeyBindingsFor(s2K, out _); - return player1Bindings.Concat(player2Bindings); + return stage1Bindings.Concat(stage2Bindings); } return new KeyBinding[0]; @@ -213,49 +211,26 @@ namespace osu.Game.Rulesets.Mania switch (getVariantType(variant)) { default: - case ManiaKeyBindingVariantType.Solo: return $"{variant}K"; case ManiaKeyBindingVariantType.Coop: { - getMultiVariantKeyCounts(variant, out int p1K, out int p2K); - return $"{p1K}K + {p2K}K"; - } - case ManiaKeyBindingVariantType.Versus: - { - getMultiVariantKeyCounts(variant, out int p1K, out int p2K); - return $"{p1K}K Vs. {p2K}K"; + getDualStageKeyCounts(variant, out int s1K, out int s2K); + return $"{s1K}K + {s2K}K"; } } } /// - /// Finds the number of keys for each player in or . + /// Finds the number of keys for each stage in a variant. /// /// The variant. - /// The number of keys for player 1. - /// The number of keys for player 2. - private void getMultiVariantKeyCounts(int variant, out int player1Keys, out int player2Keys) + /// The number of keys for the first stage. + /// The number of keys for the second stage. + private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) { - player1Keys = 0; - player2Keys = 0; - - switch (getVariantType(variant)) - { - case ManiaKeyBindingVariantType.Coop: - { - int totalKeys = variant - (int)ManiaKeyBindingVariantType.Coop; - player1Keys = (int)Math.Ceiling(totalKeys / 2f); - player2Keys = (int)Math.Floor(totalKeys / 2f); - break; - } - case ManiaKeyBindingVariantType.Versus: - { - int totalKeys = variant - (int)ManiaKeyBindingVariantType.Versus; - player1Keys = totalKeys; - player2Keys = totalKeys; - break; - } - } + int totalKeys = variant - (int)ManiaKeyBindingVariantType.Coop; + stage1 = (int)Math.Ceiling(totalKeys / 2f); + stage2 = (int)Math.Floor(totalKeys / 2f); } /// @@ -332,9 +307,5 @@ namespace osu.Game.Rulesets.Mania /// Co-op play keybinding variant (multiple stages). /// Coop = 1000, - /// - /// Versus play keybinding variant (multiple stages). - /// - Versus = 10000 } } From 286b1bb81fcf62b99d434c82e925003289ff4e45 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 14:57:25 +0900 Subject: [PATCH 445/628] Solo -> Single, Coop -> Dual --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 25 +++++++++++-------- .../Mods/ManiaModKeyCoop.cs | 2 +- .../UI/ManiaRulesetContainer.cs | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 60f1b207c5..01e7d39897 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -124,9 +124,9 @@ namespace osu.Game.Rulesets.Mania get { for (int i = 1; i <= 9; i++) - yield return (int)ManiaKeyBindingVariantType.Solo + i; + yield return (int)ManiaKeyBindingVariantType.Single + i; for (int i = 2; i <= 18; i++) - yield return (int)ManiaKeyBindingVariantType.Coop + i; + yield return (int)ManiaKeyBindingVariantType.Dual + i; } } @@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mania { switch (getVariantType(variant)) { - case ManiaKeyBindingVariantType.Solo: + case ManiaKeyBindingVariantType.Single: return new VariantMappingGenerator { LeftKeys = new[] @@ -155,7 +155,7 @@ namespace osu.Game.Rulesets.Mania SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); - case ManiaKeyBindingVariantType.Coop: + case ManiaKeyBindingVariantType.Dual: getDualStageKeyCounts(variant, out int s1K, out int s2K); var stage1Bindings = new VariantMappingGenerator @@ -212,7 +212,7 @@ namespace osu.Game.Rulesets.Mania { default: return $"{variant}K"; - case ManiaKeyBindingVariantType.Coop: + case ManiaKeyBindingVariantType.Dual: { getDualStageKeyCounts(variant, out int s1K, out int s2K); return $"{s1K}K + {s2K}K"; @@ -221,14 +221,14 @@ namespace osu.Game.Rulesets.Mania } /// - /// Finds the number of keys for each stage in a variant. + /// Finds the number of keys for each stage in a variant. /// /// The variant. /// The number of keys for the first stage. /// The number of keys for the second stage. private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) { - int totalKeys = variant - (int)ManiaKeyBindingVariantType.Coop; + int totalKeys = variant - (int)ManiaKeyBindingVariantType.Dual; stage1 = (int)Math.Ceiling(totalKeys / 2f); stage2 = (int)Math.Floor(totalKeys / 2f); } @@ -300,12 +300,15 @@ namespace osu.Game.Rulesets.Mania public enum ManiaKeyBindingVariantType { /// - /// Solo play keybinding variant (single stage). + /// A single stage. + /// Number of columns in this stage lies at (item - Single). /// - Solo = 0, + Single = 0, /// - /// Co-op play keybinding variant (multiple stages). + /// A split stage. + /// Overall number of columns lies at (item - Dual), further computation is required for + /// number of columns in each individual stage. /// - Coop = 1000, + Dual = 1000, } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 382eea589c..7ce220ce4f 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -45,6 +45,6 @@ namespace osu.Game.Rulesets.Mania.Mods mrc.Beatmap.Stages = newDefinitions; } - public ManiaKeyBindingVariantType Variant => ManiaKeyBindingVariantType.Coop; + public ManiaKeyBindingVariantType Variant => ManiaKeyBindingVariantType.Dual; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index db881c5ba2..45e840d5e1 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.UI public override PassThroughInputManager CreateInputManager() { - var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? ManiaKeyBindingVariantType.Solo; + var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? ManiaKeyBindingVariantType.Single; return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); } From 2674859b54ac7f50bf6185f3d0594f42b71a3d03 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 14:59:17 +0900 Subject: [PATCH 446/628] ManiaKeyBindingVariantType -> PlayfieldType --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 24 +++++++++---------- .../Mods/IKeyBindingMod.cs | 2 +- .../Mods/ManiaModKeyCoop.cs | 2 +- .../UI/ManiaRulesetContainer.cs | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 01e7d39897..f0feae67f9 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -124,9 +124,9 @@ namespace osu.Game.Rulesets.Mania get { for (int i = 1; i <= 9; i++) - yield return (int)ManiaKeyBindingVariantType.Single + i; + yield return (int)PlayfieldType.Single + i; for (int i = 2; i <= 18; i++) - yield return (int)ManiaKeyBindingVariantType.Dual + i; + yield return (int)PlayfieldType.Dual + i; } } @@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.Mania { switch (getVariantType(variant)) { - case ManiaKeyBindingVariantType.Single: + case PlayfieldType.Single: return new VariantMappingGenerator { LeftKeys = new[] @@ -155,7 +155,7 @@ namespace osu.Game.Rulesets.Mania SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); - case ManiaKeyBindingVariantType.Dual: + case PlayfieldType.Dual: getDualStageKeyCounts(variant, out int s1K, out int s2K); var stage1Bindings = new VariantMappingGenerator @@ -212,7 +212,7 @@ namespace osu.Game.Rulesets.Mania { default: return $"{variant}K"; - case ManiaKeyBindingVariantType.Dual: + case PlayfieldType.Dual: { getDualStageKeyCounts(variant, out int s1K, out int s2K); return $"{s1K}K + {s2K}K"; @@ -221,26 +221,26 @@ namespace osu.Game.Rulesets.Mania } /// - /// Finds the number of keys for each stage in a variant. + /// Finds the number of keys for each stage in a variant. /// /// The variant. /// The number of keys for the first stage. /// The number of keys for the second stage. private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) { - int totalKeys = variant - (int)ManiaKeyBindingVariantType.Dual; + int totalKeys = variant - (int)PlayfieldType.Dual; stage1 = (int)Math.Ceiling(totalKeys / 2f); stage2 = (int)Math.Floor(totalKeys / 2f); } /// - /// Finds the that corresponds to a variant value. + /// Finds the that corresponds to a variant value. /// /// The variant value. - /// The that corresponds to . - private ManiaKeyBindingVariantType getVariantType(int variant) + /// The that corresponds to . + private PlayfieldType getVariantType(int variant) { - return (ManiaKeyBindingVariantType)Enum.GetValues(typeof(ManiaKeyBindingVariantType)).Cast().OrderByDescending(i => i).First(v => variant >= v); + return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } } @@ -297,7 +297,7 @@ namespace osu.Game.Rulesets.Mania } } - public enum ManiaKeyBindingVariantType + public enum PlayfieldType { /// /// A single stage. diff --git a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs index 585db9e340..0eeacc7ce4 100644 --- a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs @@ -8,6 +8,6 @@ namespace osu.Game.Rulesets.Mania.Mods /// /// The keybinding variant which this requires. /// - ManiaKeyBindingVariantType Variant { get; } + PlayfieldType Variant { get; } } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 7ce220ce4f..2fd81b6e40 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -45,6 +45,6 @@ namespace osu.Game.Rulesets.Mania.Mods mrc.Beatmap.Stages = newDefinitions; } - public ManiaKeyBindingVariantType Variant => ManiaKeyBindingVariantType.Dual; + public PlayfieldType Variant => PlayfieldType.Dual; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 45e840d5e1..6e24a266a5 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.UI public override PassThroughInputManager CreateInputManager() { - var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? ManiaKeyBindingVariantType.Single; + var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? PlayfieldType.Single; return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); } From 65a2e09593d9210b8aadd480372c3a646da6028e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:03:05 +0900 Subject: [PATCH 447/628] Privatise VariantMappingGenerator to ManiaRuleset --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 90 ++++++++++++------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index f0feae67f9..a0c79467d0 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -242,58 +242,58 @@ namespace osu.Game.Rulesets.Mania { return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } - } - public class VariantMappingGenerator - { - /// - /// All the s available to the left hand. - /// - public InputKey[] LeftKeys; - - /// - /// All the s available to the right hand. - /// - public InputKey[] RightKeys; - - /// - /// The for the special key. - /// - public InputKey SpecialKey; - - /// - /// The at which the normal columns should begin. - /// - public ManiaAction NormalActionStart; - - /// - /// The for the special column. - /// - public ManiaAction SpecialAction; - - /// - /// Generates a list of s for a specific number of columns. - /// - /// The number of columns that need to be bound. - /// The next to use for normal columns. - /// The keybindings. - public IEnumerable GenerateKeyBindingsFor(int columns, out ManiaAction nextNormalAction) + private class VariantMappingGenerator { - ManiaAction currentNormalAction = NormalActionStart; + /// + /// All the s available to the left hand. + /// + public InputKey[] LeftKeys; - var bindings = new List(); + /// + /// All the s available to the right hand. + /// + public InputKey[] RightKeys; - for (int i = LeftKeys.Length - columns / 2; i < LeftKeys.Length; i++) - bindings.Add(new KeyBinding(LeftKeys[i], currentNormalAction++)); + /// + /// The for the special key. + /// + public InputKey SpecialKey; - for (int i = 0; i < columns / 2; i++) - bindings.Add(new KeyBinding(RightKeys[i], currentNormalAction++)); + /// + /// The at which the normal columns should begin. + /// + public ManiaAction NormalActionStart; - if (columns % 2 == 1) - bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); + /// + /// The for the special column. + /// + public ManiaAction SpecialAction; - nextNormalAction = currentNormalAction; - return bindings; + /// + /// Generates a list of s for a specific number of columns. + /// + /// The number of columns that need to be bound. + /// The next to use for normal columns. + /// The keybindings. + public IEnumerable GenerateKeyBindingsFor(int columns, out ManiaAction nextNormalAction) + { + ManiaAction currentNormalAction = NormalActionStart; + + var bindings = new List(); + + for (int i = LeftKeys.Length - columns / 2; i < LeftKeys.Length; i++) + bindings.Add(new KeyBinding(LeftKeys[i], currentNormalAction++)); + + for (int i = 0; i < columns / 2; i++) + bindings.Add(new KeyBinding(RightKeys[i], currentNormalAction++)); + + if (columns % 2 == 1) + bindings.Add(new KeyBinding(SpecialKey, SpecialAction)); + + nextNormalAction = currentNormalAction; + return bindings; + } } } From 794ae5380a341b83feb61377f9710369211bfe0d Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 01:06:27 -0500 Subject: [PATCH 448/628] Intverted conditionals. --- osu-framework | 2 +- osu.Game/Screens/Play/Player.cs | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/osu-framework b/osu-framework index 26c01ca606..8f36ddab94 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 26c01ca6069296621f76d8ffbfe31ecf8074c687 +Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index e29ff8edd3..a53d598730 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -208,12 +208,12 @@ namespace osu.Game.Screens.Play new HotkeyRetryOverlay { Action = () => { - if (IsCurrentScreen) { - //we want to hide the hitrenderer immediately (looks better). - //we may be able to remove this once the mouse cursor trail is improved. - RulesetContainer?.Hide(); - Restart(); - } + if (!IsCurrentScreen) return; + + //we want to hide the hitrenderer immediately (looks better). + //we may be able to remove this once the mouse cursor trail is improved. + RulesetContainer?.Hide(); + Restart(); }, } }; @@ -290,17 +290,16 @@ namespace osu.Game.Screens.Play { onCompletionEvent = Schedule(delegate { - if (IsCurrentScreen) + if (!IsCurrentScreen) return; + + var score = new Score { - var score = new Score - { - Beatmap = Beatmap.Value.BeatmapInfo, - Ruleset = ruleset - }; - scoreProcessor.PopulateScore(score); - score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; - Push(new Results(score)); - } + Beatmap = Beatmap.Value.BeatmapInfo, + Ruleset = ruleset + }; + scoreProcessor.PopulateScore(score); + score.User = RulesetContainer.Replay?.User ?? api.LocalUser.Value; + Push(new Results(score)); }); } } From 583aa9922fd96043d9735f917a6537ffc5f0138f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:07:14 +0900 Subject: [PATCH 449/628] IKeyBindingMod -> IPlayfieldTypeMod --- .../Mods/{IKeyBindingMod.cs => IPlayfieldTypeMod.cs} | 8 +++++--- osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) rename osu.Game.Rulesets.Mania/Mods/{IKeyBindingMod.cs => IPlayfieldTypeMod.cs} (51%) diff --git a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs b/osu.Game.Rulesets.Mania/Mods/IPlayfieldTypeMod.cs similarity index 51% rename from osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs rename to osu.Game.Rulesets.Mania/Mods/IPlayfieldTypeMod.cs index 0eeacc7ce4..93d98b5d83 100644 --- a/osu.Game.Rulesets.Mania/Mods/IKeyBindingMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/IPlayfieldTypeMod.cs @@ -1,13 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Rulesets.Mods; + namespace osu.Game.Rulesets.Mania.Mods { - public interface IKeyBindingMod + public interface IPlayfieldTypeMod : IApplicableMod { /// - /// The keybinding variant which this requires. + /// The which this requires. /// - PlayfieldType Variant { get; } + PlayfieldType PlayfieldType { get; } } } diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs index 2fd81b6e40..bc7092a871 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs @@ -12,7 +12,7 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod, IKeyBindingMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer + public class ManiaModKeyCoop : Mod, IPlayfieldTypeMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer { public override string Name => "KeyCoop"; public override string ShortenedName => "2P"; @@ -45,6 +45,6 @@ namespace osu.Game.Rulesets.Mania.Mods mrc.Beatmap.Stages = newDefinitions; } - public PlayfieldType Variant => PlayfieldType.Dual; + public PlayfieldType PlayfieldType => PlayfieldType.Dual; } } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 6e24a266a5..c438fe1abc 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Mania.UI public override PassThroughInputManager CreateInputManager() { - var variantType = Mods.OfType().FirstOrDefault()?.Variant ?? PlayfieldType.Single; + var variantType = Mods.OfType().FirstOrDefault()?.PlayfieldType ?? PlayfieldType.Single; return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); } diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 82202df923..f7b5f35221 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -64,7 +64,7 @@ - + From 77c4da5f0fdfd98ec54f17f600cb2eda9f4f3769 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:11:15 +0900 Subject: [PATCH 450/628] KeyCoop -> DualStages --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- .../Mods/{ManiaModKeyCoop.cs => ManiaModDualStages.cs} | 8 ++++---- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename osu.Game.Rulesets.Mania/Mods/{ManiaModKeyCoop.cs => ManiaModDualStages.cs} (80%) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index a0c79467d0..000d8e89bf 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.Mania }, }, new ManiaModRandom(), - new ManiaModKeyCoop(), + new ManiaModDualStages(), new MultiMod { Mods = new Mod[] diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs similarity index 80% rename from osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs rename to osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index bc7092a871..c591da1274 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModKeyCoop.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -12,11 +12,11 @@ using osu.Game.Rulesets.UI; namespace osu.Game.Rulesets.Mania.Mods { - public class ManiaModKeyCoop : Mod, IPlayfieldTypeMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer + public class ManiaModDualStages : Mod, IPlayfieldTypeMod, IApplicableToBeatmapConverter, IApplicableToRulesetContainer { - public override string Name => "KeyCoop"; - public override string ShortenedName => "2P"; - public override string Description => @"Double the key amount, double the fun!"; + public override string Name => "Dual Stages"; + public override string ShortenedName => "DS"; + public override string Description => @"Double the stages, double the fun!"; public override double ScoreMultiplier => 1; public override bool Ranked => true; diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index f7b5f35221..6f367a0798 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -84,7 +84,7 @@ - + From 17d75b349d8807b1468576fd113a7378f1f231b0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:11:45 +0900 Subject: [PATCH 451/628] =?UTF-8?q?Dual=20stages=20is=20not=20ranked=20?= =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index c591da1274..2611d1c6a2 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Mods public override string ShortenedName => "DS"; public override string Description => @"Double the stages, double the fun!"; public override double ScoreMultiplier => 1; - public override bool Ranked => true; + public override bool Ranked => false; public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) { From eede8333ba30657dfcc4ae555c4da462f7e4399a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:18:11 +0900 Subject: [PATCH 452/628] getVariantType -> getPlayfieldType --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 000d8e89bf..dad9633a37 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Mania public override IEnumerable GetDefaultKeyBindings(int variant = 0) { - switch (getVariantType(variant)) + switch (getPlayfieldType(variant)) { case PlayfieldType.Single: return new VariantMappingGenerator @@ -208,7 +208,7 @@ namespace osu.Game.Rulesets.Mania public override string GetVariantName(int variant) { - switch (getVariantType(variant)) + switch (getPlayfieldType(variant)) { default: return $"{variant}K"; @@ -238,7 +238,7 @@ namespace osu.Game.Rulesets.Mania /// /// The variant value. /// The that corresponds to . - private PlayfieldType getVariantType(int variant) + private PlayfieldType getPlayfieldType(int variant) { return (PlayfieldType)Enum.GetValues(typeof(PlayfieldType)).Cast().OrderByDescending(i => i).First(v => variant >= v); } From 1350b68f15aab8af1e5f3856af3511fbab3ae7da Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:18:39 +0900 Subject: [PATCH 453/628] DualStages always doubles the column count in lazer --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 19 ++++++------------- .../Mods/ManiaModDualStages.cs | 5 ++--- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index dad9633a37..39f22b7672 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -156,7 +156,7 @@ namespace osu.Game.Rulesets.Mania NormalActionStart = ManiaAction.Key1, }.GenerateKeyBindingsFor(variant, out _); case PlayfieldType.Dual: - getDualStageKeyCounts(variant, out int s1K, out int s2K); + int keys = getDualStageKeyCount(variant); var stage1Bindings = new VariantMappingGenerator { @@ -177,7 +177,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.Tilde, SpecialAction = ManiaAction.Special1, NormalActionStart = ManiaAction.Key1 - }.GenerateKeyBindingsFor(s1K, out var nextNormal); + }.GenerateKeyBindingsFor(keys, out var nextNormal); var stage2Bindings = new VariantMappingGenerator { @@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Mania SpecialKey = InputKey.BackSlash, SpecialAction = ManiaAction.Special2, NormalActionStart = nextNormal - }.GenerateKeyBindingsFor(s2K, out _); + }.GenerateKeyBindingsFor(keys, out _); return stage1Bindings.Concat(stage2Bindings); } @@ -214,8 +214,8 @@ namespace osu.Game.Rulesets.Mania return $"{variant}K"; case PlayfieldType.Dual: { - getDualStageKeyCounts(variant, out int s1K, out int s2K); - return $"{s1K}K + {s2K}K"; + var keys = getDualStageKeyCount(variant); + return $"{keys}K + {keys}K"; } } } @@ -224,14 +224,7 @@ namespace osu.Game.Rulesets.Mania /// Finds the number of keys for each stage in a variant. /// /// The variant. - /// The number of keys for the first stage. - /// The number of keys for the second stage. - private void getDualStageKeyCounts(int variant, out int stage1, out int stage2) - { - int totalKeys = variant - (int)PlayfieldType.Dual; - stage1 = (int)Math.Ceiling(totalKeys / 2f); - stage2 = (int)Math.Floor(totalKeys / 2f); - } + private int getDualStageKeyCount(int variant) => (variant - (int)PlayfieldType.Dual) / 2; /// /// Finds the that corresponds to a variant value. diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index 2611d1c6a2..1ba4ef9af1 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Collections.Generic; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Beatmaps; @@ -38,8 +37,8 @@ namespace osu.Game.Rulesets.Mania.Mods var newDefinitions = new List(); foreach (var existing in mrc.Beatmap.Stages) { - newDefinitions.Add(new StageDefinition { Columns = (int)Math.Ceiling(existing.Columns / 2f) }); - newDefinitions.Add(new StageDefinition { Columns = (int)Math.Floor(existing.Columns / 2f) }); + newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 }); + newDefinitions.Add(new StageDefinition { Columns = existing.Columns / 2 }); } mrc.Beatmap.Stages = newDefinitions; From 64d7868c035e6330a525eda5e3ef2fc2ef9e54d1 Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Mon, 22 Jan 2018 01:19:22 -0500 Subject: [PATCH 454/628] Update APi.Username in APIAccess intead of ignoring it. --- osu-framework | 2 +- osu.Game/Online/API/APIAccess.cs | 1 + osu.Game/OsuGameBase.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 26c01ca606..8f36ddab94 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 26c01ca6069296621f76d8ffbfe31ecf8074c687 +Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 diff --git a/osu.Game/Online/API/APIAccess.cs b/osu.Game/Online/API/APIAccess.cs index 5559aadeb4..1d657b8664 100644 --- a/osu.Game/Online/API/APIAccess.cs +++ b/osu.Game/Online/API/APIAccess.cs @@ -126,6 +126,7 @@ namespace osu.Game.Online.API userReq.Success += u => { LocalUser.Value = u; + Username = LocalUser.Value.Username; failureCount = 0; //we're connected! diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index fad0c8c3d9..ef02f1a7ec 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -200,7 +200,7 @@ namespace osu.Game switch (state) { case APIState.Online: - LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.LocalUser.Value.Username : string.Empty); + LocalConfig.Set(OsuSetting.Username, LocalConfig.Get(OsuSetting.SaveUsername) ? API.Username : string.Empty); break; } } From ba58b25f010b65ac7a7842ceb64cf04cd548907f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:47:31 +0900 Subject: [PATCH 455/628] Fix showing too many keybindings --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 39f22b7672..051e7d0525 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Mania { for (int i = 1; i <= 9; i++) yield return (int)PlayfieldType.Single + i; - for (int i = 2; i <= 18; i++) + for (int i = 2; i <= 18; i += 2) yield return (int)PlayfieldType.Dual + i; } } From c1331cef1b7364a3ba42fb3e80f5f6a4cd6f49a6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 15:52:54 +0900 Subject: [PATCH 456/628] Disallow DualStages for non-converted beatmaps --- osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs | 4 ++++ osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index 1ba4ef9af1..3330d87e88 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -34,6 +34,10 @@ namespace osu.Game.Rulesets.Mania.Mods { var mrc = (ManiaRulesetContainer)rulesetContainer; + // Although this can work, for now let's not allow keymods for mania-specific beatmaps + if (mrc.IsForCurrentRuleset) + return; + var newDefinitions = new List(); foreach (var existing in mrc.Beatmap.Stages) { diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index bb4466208b..375af75347 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -154,7 +154,7 @@ namespace osu.Game.Rulesets.UI /// /// Whether the specified beatmap is assumed to be specific to the current ruleset. /// - protected readonly bool IsForCurrentRuleset; + public readonly bool IsForCurrentRuleset; public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor(this); From 82c882288824696b0e6011f9ee57e38ad3bdf2b4 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 22 Jan 2018 08:04:14 +0100 Subject: [PATCH 457/628] we need to go back reverted change and instead check `DeletePending` when retrieving existing online IDs --- osu.Game/Overlays/DirectOverlay.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/DirectOverlay.cs b/osu.Game/Overlays/DirectOverlay.cs index efd54bec82..05b5bba09c 100644 --- a/osu.Game/Overlays/DirectOverlay.cs +++ b/osu.Game/Overlays/DirectOverlay.cs @@ -298,15 +298,13 @@ namespace osu.Game.Overlays Task.Run(() => { var onlineIds = response.Select(r => r.OnlineBeatmapSetID).ToList(); - var presentSets = beatmaps.QueryBeatmapSets(s => onlineIds.Contains(s.OnlineBeatmapSetID)).ToList(); - - var responseSets = response.Select(r => r.ToBeatmapSet(rulesets)).ToList(); - var finalSets = responseSets.Where(b => !presentSets.Any(s => s.OnlineBeatmapSetID == b.OnlineBeatmapSetID && !s.DeletePending)).ToList(); + var presentOnlineIds = beatmaps.QueryBeatmapSets(s => onlineIds.Contains(s.OnlineBeatmapSetID) && !s.DeletePending).Select(r => r.OnlineBeatmapSetID).ToList(); + var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList(); // may not need scheduling; loads async internally. Schedule(() => { - BeatmapSets = finalSets; + BeatmapSets = sets; recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value); }); }); From 0ef6384de00b6a405ea329b07a05301ce7261780 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:11:06 +0900 Subject: [PATCH 458/628] Fix hitexplosions not working in the testcase --- osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index d021202f36..2e6cd9208b 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -92,6 +92,7 @@ namespace osu.Game.Rulesets.Mania.Tests }; playfield.OnJudgement(note, new ManiaJudgement { Result = HitResult.Perfect }); + playfield.Columns[col].OnJudgement(note, new ManiaJudgement { Result = HitResult.Perfect }); }); } From 3d36fd3676845e2c057c67f4993257bd2984665f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:11:26 +0900 Subject: [PATCH 459/628] Update xmldoc to be more descriptive of single/dual stages --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 051e7d0525..3bfb4d3e44 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -293,12 +293,12 @@ namespace osu.Game.Rulesets.Mania public enum PlayfieldType { /// - /// A single stage. + /// Columns are grouped into a single stage. /// Number of columns in this stage lies at (item - Single). /// Single = 0, /// - /// A split stage. + /// Columns are grouped into two stages. /// Overall number of columns lies at (item - Dual), further computation is required for /// number of columns in each individual stage. /// From 90d8ee8d36d39e26ccbb7e7a24efaa9188558b5b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:11:41 +0900 Subject: [PATCH 460/628] Fix stage background being too transparent This is the original colour for the background. Not sure why this was changed. --- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index ec21c72285..e6dd2d7d7a 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Mania.UI { Name = "Background", RelativeSizeAxes = Axes.Both, - Colour = new Color4(0, 0, 0, 0.8f) + Colour = Color4.Black }, columnFlow = new FillFlowContainer { From 351be4308f37657b7f80a1dc0013e17ef862b4a8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:12:35 +0900 Subject: [PATCH 461/628] Oops, forgot to commit OnJudgement change --- osu.Game.Rulesets.Mania/UI/Column.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index ccbb5797db..882628642b 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -206,12 +206,12 @@ namespace osu.Game.Rulesets.Mania.UI { hitObject.Depth = (float)hitObject.HitObject.StartTime; hitObject.AccentColour = AccentColour; - hitObject.OnJudgement += onJudgement; + hitObject.OnJudgement += OnJudgement; HitObjects.Add(hitObject); } - private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) + internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) { if (!judgement.IsHit) return; From 8a8b3f25e77b912f480515933ea0e847c9d2dc3a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:12:45 +0900 Subject: [PATCH 462/628] SpecialColumn -> SpecialColumnPosition --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index e787b70797..3c08b0ff34 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Mania.UI for (int i = 0; i < stageDefinitions.Count; i++) { var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction); - newStage.SpecialColumn.BindTo(SpecialColumnPosition); + newStage.SpecialColumnPosition.BindTo(SpecialColumnPosition); newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index e6dd2d7d7a..776bd9e556 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Mania.UI /// public readonly Bindable Inverted = new Bindable(true); - public readonly Bindable SpecialColumn = new Bindable(); + public readonly Bindable SpecialColumnPosition = new Bindable(); public IReadOnlyList Columns => columnFlow.Children; private readonly FillFlowContainer columnFlow; @@ -169,14 +169,14 @@ namespace osu.Game.Rulesets.Mania.UI /// Whether the column is a special column. private bool isSpecialColumn(int column) { - switch (SpecialColumn.Value) + switch (SpecialColumnPosition.Value) { default: - case SpecialColumnPosition.Normal: + case UI.SpecialColumnPosition.Normal: return definition.Columns % 2 == 1 && column == definition.Columns / 2; - case SpecialColumnPosition.Left: + case UI.SpecialColumnPosition.Left: return column == 0; - case SpecialColumnPosition.Right: + case UI.SpecialColumnPosition.Right: return column == definition.Columns - 1; } } From 68a6323168da2502df8fe0585a1d40fba63ec8f0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 22 Jan 2018 16:18:39 +0900 Subject: [PATCH 463/628] Remove SpecialColumnPosition for now This needs to be re-implemented in the future, perhaps in a way that allows it to be dynamically changed. --- .../Tests/TestCaseManiaPlayfield.cs | 29 ++++++++----------- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 6 ---- osu.Game.Rulesets.Mania/UI/ManiaStage.cs | 16 +--------- .../UI/SpecialColumnPosition.cs | 21 -------------- .../osu.Game.Rulesets.Mania.csproj | 1 - 5 files changed, 13 insertions(+), 60 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs diff --git a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs index 2e6cd9208b..7d35ab2f4d 100644 --- a/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/Tests/TestCaseManiaPlayfield.cs @@ -33,12 +33,10 @@ namespace osu.Game.Rulesets.Mania.Tests { var rng = new Random(1337); - AddStep("1 column", () => createPlayfield(1, SpecialColumnPosition.Normal)); - AddStep("4 columns", () => createPlayfield(4, SpecialColumnPosition.Normal)); - AddStep("Left special style", () => createPlayfield(4, SpecialColumnPosition.Left)); - AddStep("Right special style", () => createPlayfield(4, SpecialColumnPosition.Right)); - AddStep("5 columns", () => createPlayfield(5, SpecialColumnPosition.Normal)); - AddStep("8 columns", () => createPlayfield(8, SpecialColumnPosition.Normal)); + AddStep("1 column", () => createPlayfield(1)); + AddStep("4 columns", () => createPlayfield(4)); + AddStep("5 columns", () => createPlayfield(5)); + AddStep("8 columns", () => createPlayfield(8)); AddStep("4 + 4 columns", () => { var stages = new List @@ -46,7 +44,7 @@ namespace osu.Game.Rulesets.Mania.Tests new StageDefinition { Columns = 4 }, new StageDefinition { Columns = 4 }, }; - createPlayfield(stages, SpecialColumnPosition.Normal); + createPlayfield(stages); }); AddStep("2 + 4 + 2 columns", () => @@ -57,7 +55,7 @@ namespace osu.Game.Rulesets.Mania.Tests new StageDefinition { Columns = 4 }, new StageDefinition { Columns = 2 }, }; - createPlayfield(stages, SpecialColumnPosition.Normal); + createPlayfield(stages); }); AddStep("1 + 8 + 1 columns", () => @@ -68,12 +66,10 @@ namespace osu.Game.Rulesets.Mania.Tests new StageDefinition { Columns = 8 }, new StageDefinition { Columns = 1 }, }; - createPlayfield(stages, SpecialColumnPosition.Normal); + createPlayfield(stages); }); - AddStep("Left special style", () => createPlayfield(8, SpecialColumnPosition.Left)); - AddStep("Right special style", () => createPlayfield(8, SpecialColumnPosition.Right)); - AddStep("Reversed", () => createPlayfield(4, SpecialColumnPosition.Normal, true)); + AddStep("Reversed", () => createPlayfield(4, true)); AddStep("Notes with input", () => createPlayfieldWithNotes()); AddStep("Notes with input (reversed)", () => createPlayfieldWithNotes(true)); @@ -82,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Tests AddStep("Hit explosion", () => { - var playfield = createPlayfield(4, SpecialColumnPosition.Normal); + var playfield = createPlayfield(4); int col = rng.Next(0, 4); @@ -102,17 +98,17 @@ namespace osu.Game.Rulesets.Mania.Tests maniaRuleset = rulesets.GetRuleset(3); } - private ManiaPlayfield createPlayfield(int cols, SpecialColumnPosition specialPos, bool inverted = false) + private ManiaPlayfield createPlayfield(int cols, bool inverted = false) { var stages = new List { new StageDefinition { Columns = cols }, }; - return createPlayfield(stages, specialPos, inverted); + return createPlayfield(stages, inverted); } - private ManiaPlayfield createPlayfield(List stages, SpecialColumnPosition specialPos, bool inverted = false) + private ManiaPlayfield createPlayfield(List stages, bool inverted = false) { Clear(); @@ -127,7 +123,6 @@ namespace osu.Game.Rulesets.Mania.Tests Origin = Anchor.Centre, }); - playfield.SpecialColumnPosition.Value = specialPos; playfield.Inverted.Value = inverted; return playfield; diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3c08b0ff34..c008e71819 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -22,11 +22,6 @@ namespace osu.Game.Rulesets.Mania.UI /// public readonly Bindable Inverted = new Bindable(true); - /// - /// The style to use for the special column. - /// - public Bindable SpecialColumnPosition = new Bindable(); - public List Columns => stages.SelectMany(x => x.Columns).ToList(); private readonly List stages = new List(); @@ -54,7 +49,6 @@ namespace osu.Game.Rulesets.Mania.UI for (int i = 0; i < stageDefinitions.Count; i++) { var newStage = new ManiaStage(firstColumnIndex, stageDefinitions[i], ref normalColumnAction, ref specialColumnAction); - newStage.SpecialColumnPosition.BindTo(SpecialColumnPosition); newStage.VisibleTimeRange.BindTo(VisibleTimeRange); newStage.Inverted.BindTo(Inverted); diff --git a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs index 776bd9e556..ebd73d7dca 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaStage.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaStage.cs @@ -33,8 +33,6 @@ namespace osu.Game.Rulesets.Mania.UI /// public readonly Bindable Inverted = new Bindable(true); - public readonly Bindable SpecialColumnPosition = new Bindable(); - public IReadOnlyList Columns => columnFlow.Children; private readonly FillFlowContainer columnFlow; @@ -167,19 +165,7 @@ namespace osu.Game.Rulesets.Mania.UI /// /// The 0-based column index. /// Whether the column is a special column. - private bool isSpecialColumn(int column) - { - switch (SpecialColumnPosition.Value) - { - default: - case UI.SpecialColumnPosition.Normal: - return definition.Columns % 2 == 1 && column == definition.Columns / 2; - case UI.SpecialColumnPosition.Left: - return column == 0; - case UI.SpecialColumnPosition.Right: - return column == definition.Columns - 1; - } - } + private bool isSpecialColumn(int column) => definition.Columns % 2 == 1 && column == definition.Columns / 2; public override void Add(DrawableHitObject h) { diff --git a/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs b/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs deleted file mode 100644 index de017294e4..0000000000 --- a/osu.Game.Rulesets.Mania/UI/SpecialColumnPosition.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Rulesets.Mania.UI -{ - public enum SpecialColumnPosition - { - /// - /// The special column will lie in the center of the columns. - /// - Normal, - /// - /// The special column will lie to the left of the columns. - /// - Left, - /// - /// The special column will lie to the right of the columns. - /// - Right - } -} diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 6f367a0798..c3c0089f14 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -122,7 +122,6 @@ - From 32b540268e3b3ec9817ef167db65eea0ae6e1ea8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 22 Jan 2018 18:46:59 +0900 Subject: [PATCH 464/628] Add more human-like catch autoplay support Closes #1611 --- osu.Game.Rulesets.Catch/CatchInputManager.cs | 1 - .../Replays/CatchAutoGenerator.cs | 72 ++++++++++++++++++- .../Replays/CatchFramedReplayInputHandler.cs | 28 ++++++-- .../Replays/CatchReplayFrame.cs | 4 +- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 12 ++-- 5 files changed, 97 insertions(+), 20 deletions(-) diff --git a/osu.Game.Rulesets.Catch/CatchInputManager.cs b/osu.Game.Rulesets.Catch/CatchInputManager.cs index f57952f95e..fa8958687c 100644 --- a/osu.Game.Rulesets.Catch/CatchInputManager.cs +++ b/osu.Game.Rulesets.Catch/CatchInputManager.cs @@ -23,6 +23,5 @@ namespace osu.Game.Rulesets.Catch MoveRight, [Description("Engage dash")] Dash, - PositionUpdate } } diff --git a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs index bc53e6e869..f8ca75fae9 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs @@ -1,9 +1,12 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using System.Linq; +using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.Replays; using osu.Game.Users; @@ -23,15 +26,78 @@ namespace osu.Game.Rulesets.Catch.Replays public override Replay Generate() { + // todo: add support for HT DT + const double dash_speed = CatcherArea.Catcher.BASE_SPEED; + const double movement_speed = dash_speed / 2; + float lastPosition = 0.5f; + double lastTime = 0; + // Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled - Replay.Frames.Add(new CatchReplayFrame(-100000, 0)); + Replay.Frames.Add(new CatchReplayFrame(-100000, lastPosition)); + + void moveToNext(CatchHitObject h) + { + float positionChange = Math.Abs(lastPosition - h.X); + double timeAvailable = h.StartTime - lastTime; + + //So we can either make it there without a dash or not. + double speedRequired = positionChange / timeAvailable; + + bool dashRequired = speedRequired > movement_speed && h.StartTime != 0; + + // todo: get correct catcher size, based on difficulty CS. + const float catcher_width_half = CatcherArea.CATCHER_SIZE / CatchPlayfield.BASE_WIDTH * 0.3f * 0.5f; + + if (lastPosition - catcher_width_half < h.X && lastPosition + catcher_width_half > h.X) + { + //we are already in the correct range. + lastTime = h.StartTime; + Replay.Frames.Add(new CatchReplayFrame(h.StartTime, lastPosition)); + return; + } + + if (h is BananaShower.Banana) + { + // auto bananas unrealistically warp to catch 100% combo. + Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X)); + } + else if (h.HyperDash) + { + Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable, lastPosition, ReplayButtonState.Right1)); + Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X)); + } + else if (dashRequired) + { + //we do a movement in two parts - the dash part then the normal part... + double timeAtNormalSpeed = positionChange / movement_speed; + double timeWeNeedToSave = timeAtNormalSpeed - timeAvailable; + double timeAtDashSpeed = timeWeNeedToSave / 2; + + float midPosition = (float)Interpolation.Lerp(lastPosition, h.X, (float)timeAtDashSpeed / timeAvailable); + + //dash movement + Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + 1, lastPosition, ReplayButtonState.Left1)); + Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + timeAtDashSpeed, midPosition)); + Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X)); + } + else + { + double timeBefore = positionChange / movement_speed; + + Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeBefore, lastPosition, ReplayButtonState.Right1)); + Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X)); + } + + lastTime = h.StartTime; + lastPosition = h.X; + } foreach (var obj in Beatmap.HitObjects) { switch (obj) { case Fruit _: - Replay.Frames.Add(new CatchReplayFrame(obj.StartTime, obj.X)); + moveToNext(obj); break; } @@ -42,7 +108,7 @@ namespace osu.Game.Rulesets.Catch.Replays case BananaShower.Banana _: case TinyDroplet _: case Droplet _: - Replay.Frames.Add(new CatchReplayFrame(nestedObj.StartTime, nestedObj.X)); + moveToNext(nestedObj); break; } } diff --git a/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs index 146e31fa69..2f296a2504 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchFramedReplayInputHandler.cs @@ -14,15 +14,29 @@ namespace osu.Game.Rulesets.Catch.Replays { } - public override List GetPendingStates() => new List + public override List GetPendingStates() { - new CatchReplayState + if (!Position.HasValue) return new List(); + + var action = new List(); + + if (CurrentFrame.ButtonState == ReplayButtonState.Left1) + action.Add(CatchAction.Dash); + + if (Position.Value.X > CurrentFrame.Position.X) + action.Add(CatchAction.MoveRight); + else if (Position.Value.X < CurrentFrame.Position.X) + action.Add(CatchAction.MoveLeft); + + return new List { - PressedActions = new List { CatchAction.PositionUpdate }, - CatcherX = ((CatchReplayFrame)CurrentFrame).MouseX - }, - new CatchReplayState { PressedActions = new List() }, - }; + new CatchReplayState + { + PressedActions = action, + CatcherX = Position.Value.X + }, + }; + } public class CatchReplayState : ReplayState { diff --git a/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs b/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs index c47f60ec3c..0194fc93a4 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchReplayFrame.cs @@ -9,8 +9,8 @@ namespace osu.Game.Rulesets.Catch.Replays { public override bool IsImportant => MouseX > 0; - public CatchReplayFrame(double time, float? x = null) - : base(time, x ?? -1, null, ReplayButtonState.None) + public CatchReplayFrame(double time, float? x = null, ReplayButtonState button = ReplayButtonState.None) + : base(time, x ?? -1, null, button) { } } diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 17c78f3aa0..5252ba294a 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -21,7 +21,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Catch.UI { - public class CatcherArea : Container, IKeyBindingHandler + public class CatcherArea : Container { public const float CATCHER_SIZE = 172; @@ -84,16 +84,14 @@ namespace osu.Game.Rulesets.Catch.UI } } - public bool OnPressed(CatchAction action) + protected override void Update() { - if (action != CatchAction.PositionUpdate) return false; + base.Update(); - CatchFramedReplayInputHandler.CatchReplayState state = (CatchFramedReplayInputHandler.CatchReplayState)GetContainingInputManager().CurrentState; + var state = GetContainingInputManager().CurrentState as CatchFramedReplayInputHandler.CatchReplayState; - if (state.CatcherX.HasValue) + if (state?.CatcherX != null) MovableCatcher.X = state.CatcherX.Value; - - return true; } public bool OnReleased(CatchAction action) => false; From 66176f2882895dd9ecb93e42f28388da5995065d Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 22 Jan 2018 12:36:38 +0100 Subject: [PATCH 465/628] fix RepeatPoint animations - FadeIn and -Out for RepeatPoints are now calculated instead of fixed values - TimePreempt is now cut down if too long for RepeatPoints following the first one to only show up to two RepeatPoints at any given time --- .../Objects/Drawables/DrawableRepeatPoint.cs | 16 ++++++++-------- .../Objects/Drawables/DrawableSlider.cs | 14 ++++---------- osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs | 14 ++++++++++++++ osu.Game.Rulesets.Osu/Objects/Slider.cs | 17 +++++++++-------- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 1 + 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 28ff4b4cdf..520b4eccfa 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly DrawableSlider drawableSlider; public double FadeInTime; - public double FadeOutTime; + private double animDuration; public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) : base(repeatPoint) @@ -48,11 +48,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void UpdatePreemptState() { - var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime); + animDuration = Math.Min(150, repeatPoint.StartTime - FadeInTime); - this.FadeIn(animIn).ScaleTo(1.2f, animIn) + this.FadeIn(animDuration).ScaleTo(1.2f, animDuration / 2) .Then() - .ScaleTo(1, 150, Easing.Out); + .ScaleTo(1, animDuration / 2, Easing.Out); } protected override void UpdateCurrentState(ArmedState state) @@ -60,14 +60,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables switch (state) { case ArmedState.Idle: - this.Delay(FadeOutTime - repeatPoint.StartTime).FadeOut(); + this.Delay(HitObject.TimePreempt).FadeOut(); break; case ArmedState.Miss: - this.FadeOut(160); + this.FadeOut(animDuration); break; case ArmedState.Hit: - this.FadeOut(120, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, 120, Easing.OutQuint); + this.FadeOut(animDuration, Easing.OutQuint) + .ScaleTo(Scale * 1.5f, animDuration, Easing.OutQuint); break; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 232964587c..99c664a575 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -72,12 +72,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddNested(InitialCircle); - var repeatDuration = s.Curve.Distance / s.Velocity; foreach (var tick in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration; + var repeatStartTime = s.StartTime + tick.RepeatIndex * s.RepeatDuration; var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; + var fadeOutTime = repeatStartTime + s.RepeatDuration; var drawableTick = new DrawableSliderTick(tick) { @@ -92,15 +91,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var repeatPoint in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; - var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) { - FadeInTime = fadeInTime, - FadeOutTime = fadeOutTime, - Position = repeatPoint.Position, + FadeInTime = repeatPoint.StartTime - s.RepeatDuration / 2, + Position = repeatPoint.Position }; repeatPoints.Add(drawableRepeatPoint); diff --git a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs index abdbb97072..42aff7ebaf 100644 --- a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs @@ -1,10 +1,24 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; + namespace osu.Game.Rulesets.Osu.Objects { public class RepeatPoint : OsuHitObject { public int RepeatIndex { get; set; } + public double RepeatDuration { get; set; } + + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) + { + base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + + // We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders + // we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time. + if (RepeatIndex > 1 && TimePreempt > RepeatDuration * 2) + TimePreempt = (float)RepeatDuration * 2; + } } } diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 2da285a434..55de38a602 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -60,6 +60,11 @@ namespace osu.Game.Rulesets.Osu.Objects public List> RepeatSamples { get; set; } = new List>(); public int RepeatCount { get; set; } = 1; + /// + /// The length of one repeat if any repeats are present, otherwise it equals the . + /// + public double RepeatDuration => RepeatCount > 1 ? Distance / Velocity : Duration; + private int stackHeight; public override int StackHeight @@ -114,13 +119,12 @@ namespace osu.Game.Rulesets.Osu.Objects var length = Curve.Distance; var tickDistance = Math.Min(TickDistance, length); - var repeatDuration = length / Velocity; var minDistanceFromEnd = Velocity * 0.01; for (var repeat = 0; repeat < RepeatCount; repeat++) { - var repeatStartTime = StartTime + repeat * repeatDuration; + var repeatStartTime = StartTime + repeat * RepeatDuration; var reversed = repeat % 2 == 1; for (var d = tickDistance; d <= length; d += tickDistance) @@ -145,7 +149,7 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { RepeatIndex = repeat, - StartTime = repeatStartTime + timeProgress * repeatDuration, + StartTime = repeatStartTime + timeProgress * RepeatDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, Scale = Scale, @@ -158,16 +162,13 @@ namespace osu.Game.Rulesets.Osu.Objects private void createRepeatPoints() { - var repeatDuration = Distance / Velocity; - for (var repeat = 1; repeat < RepeatCount; repeat++) { - var repeatStartTime = StartTime + repeat * repeatDuration; - AddNested(new RepeatPoint { RepeatIndex = repeat, - StartTime = repeatStartTime, + RepeatDuration = RepeatDuration, + StartTime = StartTime + repeat * RepeatDuration, Position = Curve.PositionAt(repeat % 2), StackHeight = StackHeight, Scale = Scale, diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index c395c5edb8..2e47b2c72a 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -63,6 +63,7 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Fast Short Slider", () => testShortHighSpeed()); AddStep("Fast Short Slider 1 Repeat", () => testShortHighSpeed(1)); AddStep("Fast Short Slider 2 Repeats", () => testShortHighSpeed(2)); + AddStep("Fast Short Slider 6 Repeats", () => testShortHighSpeed(6)); AddStep("Perfect Curve", testCurve); // TODO more curve types? From b726f90c3714ff85f0714eee7d0f1ba0d4cbf8d1 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 22 Jan 2018 12:44:55 +0100 Subject: [PATCH 466/628] remove unnecessary variable --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 3 +-- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 520b4eccfa..b62c1fa984 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -16,7 +16,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; - public double FadeInTime; private double animDuration; public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) @@ -48,7 +47,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void UpdatePreemptState() { - animDuration = Math.Min(150, repeatPoint.StartTime - FadeInTime); + animDuration = Math.Min(150, repeatPoint.RepeatDuration / 2); this.FadeIn(animDuration).ScaleTo(1.2f, animDuration / 2) .Then() diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 99c664a575..044bce7eca 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -93,7 +93,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) { - FadeInTime = repeatPoint.StartTime - s.RepeatDuration / 2, Position = repeatPoint.Position }; From 423559ec6ce16bc542f344e7686dfc6f0d5d41e9 Mon Sep 17 00:00:00 2001 From: Felix Ang Date: Mon, 22 Jan 2018 15:06:23 +0100 Subject: [PATCH 467/628] Update license year. --- LICENCE | 2 +- osu.Desktop/osu.nuspec | 4 ++-- osu.Game/osu.nuspec | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENCE b/LICENCE index 797be26fff..a11a7ce75b 100644 --- a/LICENCE +++ b/LICENCE @@ -1,4 +1,4 @@ -Copyright (c) 2007-2017 ppy Pty Ltd . +Copyright (c) 2007-2018 ppy Pty Ltd . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/osu.Desktop/osu.nuspec b/osu.Desktop/osu.nuspec index 4c529f57e5..bb7d382cee 100644 --- a/osu.Desktop/osu.nuspec +++ b/osu.Desktop/osu.nuspec @@ -12,12 +12,12 @@ click the circles. to the beat. click the circles. testing - Copyright ppy Pty Ltd 2007-2017 + Copyright ppy Pty Ltd 2007-2018 en-AU - + diff --git a/osu.Game/osu.nuspec b/osu.Game/osu.nuspec index 4c529f57e5..bb7d382cee 100644 --- a/osu.Game/osu.nuspec +++ b/osu.Game/osu.nuspec @@ -12,12 +12,12 @@ click the circles. to the beat. click the circles. testing - Copyright ppy Pty Ltd 2007-2017 + Copyright ppy Pty Ltd 2007-2018 en-AU - + From 2bc67629b817221e086b729f02367a17474ad739 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Tue, 23 Jan 2018 10:03:34 +0900 Subject: [PATCH 468/628] Improve xmldoc + remove explicit Special2 value Special2 value is implicit at Special1 + 1 (2). --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index b5036806c6..417ca8510b 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -20,8 +20,12 @@ namespace osu.Game.Rulesets.Mania [Description("Special 1")] Special1 = 1, [Description("Special 2")] - Special2 = 2, + Special2, + /// + /// This offsets the start value of normal keys in-case we add more special keys + /// above at a later time, without breaking replays/configs. + /// [Description("Key 1")] Key1 = 1000, [Description("Key 2")] From 9b471dea33eb29ef6739ed006e43e286208d6dd9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Tue, 23 Jan 2018 10:51:01 +0900 Subject: [PATCH 469/628] Back to max 10 special keys for now, change xmldoc to normal comment --- osu.Game.Rulesets.Mania/ManiaInputManager.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaInputManager.cs b/osu.Game.Rulesets.Mania/ManiaInputManager.cs index 417ca8510b..01e2821540 100644 --- a/osu.Game.Rulesets.Mania/ManiaInputManager.cs +++ b/osu.Game.Rulesets.Mania/ManiaInputManager.cs @@ -22,12 +22,10 @@ namespace osu.Game.Rulesets.Mania [Description("Special 2")] Special2, - /// - /// This offsets the start value of normal keys in-case we add more special keys - /// above at a later time, without breaking replays/configs. - /// + // This offsets the start value of normal keys in-case we add more special keys + // above at a later time, without breaking replays/configs. [Description("Key 1")] - Key1 = 1000, + Key1 = 10, [Description("Key 2")] Key2, [Description("Key 3")] From f823650b10691fb348b29d56bb7a1a5566abe7b1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 13:05:07 +0900 Subject: [PATCH 470/628] Allow user choice of the quick retry hotkey --- .../Bindings/GlobalKeyBindingInputManager.cs | 7 +++-- osu.Game/Screens/Play/HotkeyRetryOverlay.cs | 28 ++++++++----------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs index f5e54775fb..dcebe939d4 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs @@ -37,7 +37,8 @@ namespace osu.Game.Input.Bindings public IEnumerable InGameKeyBindings => new[] { - new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene) + new KeyBinding(InputKey.Space, GlobalAction.SkipCutscene), + new KeyBinding(InputKey.Tilde, GlobalAction.QuickRetry) }; protected override IEnumerable KeyBindingInputQueue => @@ -65,6 +66,8 @@ namespace osu.Game.Input.Bindings // In-Game Keybindings [Description("Skip Cutscene")] - SkipCutscene + SkipCutscene, + [Description("Quick Retry (Hold)")] + QuickRetry, } } diff --git a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs index 06db1d9df1..fcea15f7b0 100644 --- a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs +++ b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs @@ -8,11 +8,13 @@ using System; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Bindings; +using osu.Game.Input.Bindings; using OpenTK.Graphics; namespace osu.Game.Screens.Play { - public class HotkeyRetryOverlay : Container + public class HotkeyRetryOverlay : Container, IKeyBindingHandler { public Action Action; @@ -40,28 +42,20 @@ namespace osu.Game.Screens.Play }; } - protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) + public bool OnPressed(GlobalAction action) { - if (args.Repeat) return false; + if (action != GlobalAction.QuickRetry) return false; - if (args.Key == Key.Tilde) - { - overlay.FadeIn(activate_delay, Easing.Out); - return true; - } - - return base.OnKeyDown(state, args); + overlay.FadeIn(activate_delay, Easing.Out); + return true; } - protected override bool OnKeyUp(InputState state, KeyUpEventArgs args) + public bool OnReleased(GlobalAction action) { - if (args.Key == Key.Tilde && !fired) - { - overlay.FadeOut(fadeout_delay, Easing.Out); - return true; - } + if (action != GlobalAction.QuickRetry) return false; - return base.OnKeyUp(state, args); + overlay.FadeOut(fadeout_delay, Easing.Out); + return true; } protected override void Update() From fa1f4304f6e7d9bdd1b3a84be3a4fc102ccc8a01 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 13:24:04 +0900 Subject: [PATCH 471/628] Remove usings --- osu.Game/Screens/Play/HotkeyRetryOverlay.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs index fcea15f7b0..f5df02d758 100644 --- a/osu.Game/Screens/Play/HotkeyRetryOverlay.cs +++ b/osu.Game/Screens/Play/HotkeyRetryOverlay.cs @@ -1,8 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Input; -using OpenTK.Input; using osu.Framework.Allocation; using System; using osu.Framework.Graphics.Containers; From d37844c068c70d949422750b43e54d8d930d3b3c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 23 Jan 2018 13:37:25 +0900 Subject: [PATCH 472/628] Clean up off-by-one offsets from repeat-related properties --- .../Objects/JuiceStream.cs | 42 +++++++------------ .../Beatmaps/ManiaBeatmapConverter.cs | 2 +- .../Legacy/DistanceObjectPatternGenerator.cs | 24 +++++------ .../Objects/Drawables/DrawableSlider.cs | 11 ++--- .../Objects/Drawables/Pieces/SliderBall.cs | 2 +- .../Objects/Drawables/Pieces/SliderBody.cs | 7 ++-- .../Objects/ISliderProgress.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Slider.cs | 36 ++++++---------- .../Preprocessing/OsuDifficultyHitObject.cs | 1 + osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 9 +--- .../Beatmaps/TaikoBeatmapConverter.cs | 7 ++-- .../Objects/Legacy/ConvertHitObjectParser.cs | 9 ++-- .../Rulesets/Objects/Legacy/ConvertSlider.cs | 24 +++-------- osu.Game/Rulesets/Objects/Types/IHasCurve.cs | 26 +++++++++--- .../Rulesets/Objects/Types/IHasRepeats.cs | 9 ++++ 15 files changed, 101 insertions(+), 110 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 188af58e6a..be1e360fce 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -21,9 +21,7 @@ namespace osu.Game.Rulesets.Catch.Objects /// private const float base_scoring_distance = 100; - public readonly SliderCurve Curve = new SliderCurve(); - - public int RepeatCount { get; set; } = 1; + public int RepeatCount { get; set; } public double Velocity; public double TickDistance; @@ -55,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.Objects var length = Curve.Distance; var tickDistance = Math.Min(TickDistance, length); - var repeatDuration = length / Velocity; + var spanDuration = length / Velocity; var minDistanceFromEnd = Velocity * 0.01; @@ -67,10 +65,10 @@ namespace osu.Game.Rulesets.Catch.Objects X = X }); - for (var repeat = 0; repeat < RepeatCount; repeat++) + for (var span = 0; span < this.SpanCount(); span++) { - var repeatStartTime = StartTime + repeat * repeatDuration; - var reversed = repeat % 2 == 1; + var spanStartTime = StartTime + span * spanDuration; + var reversed = span % 2 == 1; for (var d = tickDistance; d <= length; d += tickDistance) { @@ -80,7 +78,7 @@ namespace osu.Game.Rulesets.Catch.Objects var timeProgress = d / length; var distanceProgress = reversed ? 1 - timeProgress : timeProgress; - var lastTickTime = repeatStartTime + timeProgress * repeatDuration; + var lastTickTime = spanStartTime + timeProgress * spanDuration; AddNested(new Droplet { StartTime = lastTickTime, @@ -95,17 +93,17 @@ namespace osu.Game.Rulesets.Catch.Objects }); } - double tinyTickInterval = tickDistance / length * repeatDuration; + double tinyTickInterval = tickDistance / length * spanDuration; while (tinyTickInterval > 100) tinyTickInterval /= 2; - for (double t = 0; t < repeatDuration; t += tinyTickInterval) + for (double t = 0; t < spanDuration; t += tinyTickInterval) { - double progress = reversed ? 1 - t / repeatDuration : t / repeatDuration; + double progress = reversed ? 1 - t / spanDuration : t / spanDuration; AddNested(new TinyDroplet { - StartTime = repeatStartTime + t, + StartTime = spanStartTime + t, ComboColour = ComboColour, X = Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH, Samples = new List(Samples.Select(s => new SampleInfo @@ -121,15 +119,15 @@ namespace osu.Game.Rulesets.Catch.Objects { Samples = Samples, ComboColour = ComboColour, - StartTime = repeatStartTime + repeatDuration, + StartTime = spanStartTime + spanDuration, X = Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH }); } } - public double EndTime => StartTime + RepeatCount * Curve.Distance / Velocity; + public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity; - public float EndX => Curve.PositionAt(ProgressAt(1)).X / CatchPlayfield.BASE_WIDTH; + public float EndX => Curve.PositionAt(this.ProgressAt(1)).X / CatchPlayfield.BASE_WIDTH; public double Duration => EndTime - StartTime; @@ -139,6 +137,8 @@ namespace osu.Game.Rulesets.Catch.Objects set { Curve.Distance = value; } } + public SliderCurve Curve { get; } = new SliderCurve(); + public List ControlPoints { get { return Curve.ControlPoints; } @@ -152,17 +152,5 @@ namespace osu.Game.Rulesets.Catch.Objects get { return Curve.CurveType; } set { Curve.CurveType = value; } } - - public Vector2 PositionAt(double progress) => Curve.PositionAt(ProgressAt(progress)); - - public double ProgressAt(double progress) - { - double p = progress * RepeatCount % 1; - if (RepeatAt(progress) % 2 == 1) - p = 1 - p; - return p; - } - - public int RepeatAt(double progress) => (int)(progress * RepeatCount); } } diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index 557ce5eb1b..9922d4c8ad 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -216,7 +216,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps if (curveData == null) return HitObject.Samples; - double segmentTime = (curveData.EndTime - HitObject.StartTime) / curveData.RepeatCount; + double segmentTime = (curveData.EndTime - HitObject.StartTime) / curveData.SpanCount(); int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime); return curveData.RepeatSamples[index]; diff --git a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs index 1d739c114e..a102781e70 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/Patterns/Legacy/DistanceObjectPatternGenerator.cs @@ -25,7 +25,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy private readonly double endTime; private readonly double segmentDuration; - private readonly int repeatCount; + private readonly int spanCount; private PatternType convertType; @@ -39,25 +39,25 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var distanceData = hitObject as IHasDistance; var repeatsData = hitObject as IHasRepeats; - repeatCount = repeatsData?.RepeatCount ?? 1; + spanCount = repeatsData?.SpanCount() ?? 1; TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime); DifficultyControlPoint difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(hitObject.StartTime); // The true distance, accounting for any repeats - double distance = (distanceData?.Distance ?? 0) * repeatCount; + double distance = (distanceData?.Distance ?? 0) * spanCount; // The velocity of the osu! hit object - calculated as the velocity of a slider double osuVelocity = osu_base_scoring_distance * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier / timingPoint.BeatLength; // The duration of the osu! hit object double osuDuration = distance / osuVelocity; endTime = hitObject.StartTime + osuDuration; - segmentDuration = (endTime - HitObject.StartTime) / repeatCount; + segmentDuration = (endTime - HitObject.StartTime) / spanCount; } public override Pattern Generate() { - if (repeatCount > 1) + if (spanCount > 1) { if (segmentDuration <= 90) return generateRandomHoldNotes(HitObject.StartTime, 1); @@ -65,7 +65,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (segmentDuration <= 120) { convertType |= PatternType.ForceNotStack; - return generateRandomNotes(HitObject.StartTime, repeatCount + 1); + return generateRandomNotes(HitObject.StartTime, spanCount + 1); } if (segmentDuration <= 160) @@ -78,7 +78,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (duration >= 4000) return generateNRandomNotes(HitObject.StartTime, 0.23, 0, 0); - if (segmentDuration > 400 && repeatCount < TotalColumns - 1 - RandomStart) + if (segmentDuration > 400 && spanCount < TotalColumns - 1 - RandomStart) return generateTiledHoldNotes(HitObject.StartTime); return generateHoldAndNormalNotes(HitObject.StartTime); @@ -212,7 +212,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy int column = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); bool increasing = Random.NextDouble() > 0.5; - for (int i = 0; i <= repeatCount; i++) + for (int i = 0; i <= spanCount; i++) { addToPattern(pattern, column, startTime, startTime); startTime += segmentDuration; @@ -262,7 +262,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy int interval = Random.Next(1, TotalColumns - (legacy ? 1 : 0)); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); - for (int i = 0; i <= repeatCount; i++) + for (int i = 0; i <= spanCount; i++) { addToPattern(pattern, nextColumn, startTime, startTime); @@ -350,7 +350,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy var pattern = new Pattern(); - int columnRepeat = Math.Min(repeatCount, TotalColumns); + int columnRepeat = Math.Min(spanCount, TotalColumns); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); if ((convertType & PatternType.ForceNotStack) > 0 && PreviousPattern.ColumnWithObjects < TotalColumns) @@ -409,7 +409,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy int nextColumn = Random.Next(RandomStart, TotalColumns); var rowPattern = new Pattern(); - for (int i = 0; i <= repeatCount; i++) + for (int i = 0; i <= spanCount; i++) { if (!(ignoreHead && startTime == HitObject.StartTime)) { @@ -442,7 +442,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy if (curveData == null) return HitObject.Samples; - double segmentTime = (endTime - HitObject.StartTime) / repeatCount; + double segmentTime = (endTime - HitObject.StartTime) / spanCount; int index = (int)(segmentTime == 0 ? 0 : (time - HitObject.StartTime) / segmentTime); return curveData.RepeatSamples[index]; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 232964587c..fae56dcce2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -10,6 +10,7 @@ using System.Linq; using osu.Framework.Graphics.Containers; using osu.Game.Rulesets.Osu.Judgements; using osu.Framework.Graphics.Primitives; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables @@ -109,7 +110,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - private int currentRepeat; + private int currentSpan; public bool Tracking; protected override void Update() @@ -120,17 +121,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables double progress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1); - int repeat = slider.RepeatAt(progress); + int span = slider.SpanAt(progress); progress = slider.ProgressAt(progress); - if (repeat > currentRepeat) - currentRepeat = repeat; + if (span > currentSpan) + currentSpan = span; //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. if (!InitialCircle.Judgements.Any(j => j.IsHit)) InitialCircle.Position = slider.Curve.PositionAt(progress); - foreach (var c in components.OfType()) c.UpdateProgress(progress, repeat); + foreach (var c in components.OfType()) c.UpdateProgress(progress, span); foreach (var c in components.OfType()) c.UpdateSnakingPosition(slider.Curve.PositionAt(Body.SnakedStart ?? 0), slider.Curve.PositionAt(Body.SnakedEnd ?? 0)); foreach (var t in ticks.Children) t.Tracking = Ball.Tracking; } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs index cf2ac5124f..2fda299389 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBall.cs @@ -139,7 +139,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces } } - public void UpdateProgress(double progress, int repeat) + public void UpdateProgress(double progress, int span) { Position = slider.Curve.PositionAt(progress); } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index ddd0f2d650..6fe1fda8eb 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -15,6 +15,7 @@ using OpenTK; using OpenTK.Graphics.ES30; using OpenTK.Graphics; using osu.Framework.Graphics.Primitives; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { @@ -164,14 +165,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces return true; } - public void UpdateProgress(double progress, int repeat) + public void UpdateProgress(double progress, int span) { double start = 0; double end = snakingIn ? MathHelper.Clamp((Time.Current - (slider.StartTime - slider.TimePreempt)) / slider.TimeFadein, 0, 1) : 1; - if (repeat >= slider.RepeatCount - 1) + if (span >= slider.SpanCount() - 1) { - if (Math.Min(repeat, slider.RepeatCount - 1) % 2 == 1) + if (Math.Min(span, slider.SpanCount() - 1) % 2 == 1) { start = 0; end = snakingOut ? progress : 1; diff --git a/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs index 31125121b0..54f783b664 100644 --- a/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs +++ b/osu.Game.Rulesets.Osu/Objects/ISliderProgress.cs @@ -5,6 +5,6 @@ namespace osu.Game.Rulesets.Osu.Objects { public interface ISliderProgress { - void UpdateProgress(double progress, int repeat); + void UpdateProgress(double progress, int span); } } diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 2da285a434..c49fbce16d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -20,12 +20,12 @@ namespace osu.Game.Rulesets.Osu.Objects /// private const float base_scoring_distance = 100; - public readonly SliderCurve Curve = new SliderCurve(); - - public double EndTime => StartTime + RepeatCount * Curve.Distance / Velocity; + public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity; public double Duration => EndTime - StartTime; - public override Vector2 EndPosition => PositionAt(1); + public override Vector2 EndPosition => this.PositionAt(1); + + public SliderCurve Curve { get; } = new SliderCurve(); public List ControlPoints { @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Osu.Objects internal float LazyTravelDistance; public List> RepeatSamples { get; set; } = new List>(); - public int RepeatCount { get; set; } = 1; + public int RepeatCount { get; set; } private int stackHeight; @@ -88,18 +88,6 @@ namespace osu.Game.Rulesets.Osu.Objects TickDistance = scoringDistance / difficulty.SliderTickRate; } - public Vector2 PositionAt(double progress) => Curve.PositionAt(ProgressAt(progress)); - - public double ProgressAt(double progress) - { - double p = progress * RepeatCount % 1; - if (RepeatAt(progress) % 2 == 1) - p = 1 - p; - return p; - } - - public int RepeatAt(double progress) => (int)(progress * RepeatCount); - protected override void CreateNestedHitObjects() { base.CreateNestedHitObjects(); @@ -114,14 +102,14 @@ namespace osu.Game.Rulesets.Osu.Objects var length = Curve.Distance; var tickDistance = Math.Min(TickDistance, length); - var repeatDuration = length / Velocity; + var spanDuration = length / Velocity; var minDistanceFromEnd = Velocity * 0.01; - for (var repeat = 0; repeat < RepeatCount; repeat++) + for (var span = 0; span < this.SpanCount(); span++) { - var repeatStartTime = StartTime + repeat * repeatDuration; - var reversed = repeat % 2 == 1; + var spanStartTime = StartTime + span * spanDuration; + var reversed = span % 2 == 1; for (var d = tickDistance; d <= length; d += tickDistance) { @@ -144,8 +132,8 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { - RepeatIndex = repeat, - StartTime = repeatStartTime + timeProgress * repeatDuration, + RepeatIndex = span, + StartTime = spanStartTime + timeProgress * spanDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, Scale = Scale, @@ -160,7 +148,7 @@ namespace osu.Game.Rulesets.Osu.Objects { var repeatDuration = Distance / Velocity; - for (var repeat = 1; repeat < RepeatCount; repeat++) + for (var repeat = 1; repeat <= RepeatCount; repeat++) { var repeatStartTime = StartTime + repeat * repeatDuration; diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 557e59e6f4..4f950353dc 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -3,6 +3,7 @@ using System; using System.Linq; +using osu.Game.Rulesets.Objects.Types; using OpenTK; using osu.Game.Rulesets.Osu.Objects; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index c395c5edb8..ddf24cc405 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -84,14 +84,9 @@ namespace osu.Game.Rulesets.Osu.Tests private void createSlider(float circleSize = 2, float distance = 400, int repeats = 0, double speedMultiplier = 2) { - repeats++; // The first run through the slider is considered a repeat - var repeatSamples = new List>(); - if (repeats > 1) - { - for (int i = 0; i < repeats; i++) - repeatSamples.Add(new List()); - } + for (int i = 0; i < repeats; i++) + repeatSamples.Add(new List()); var slider = new Slider { diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index a3c9857d0c..e5fe288f20 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -84,7 +84,8 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps if (distanceData != null) { - int repeats = repeatsData?.RepeatCount ?? 1; + // Number of spans of the object - one for the initial length and for each repeat + int spans = repeatsData?.SpanCount() ?? 1; TimingControlPoint timingPoint = beatmap.ControlPointInfo.TimingPointAt(obj.StartTime); DifficultyControlPoint difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(obj.StartTime); @@ -93,7 +94,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps double speedAdjustedBeatLength = timingPoint.BeatLength / speedAdjustment; // The true distance, accounting for any repeats. This ends up being the drum roll distance later - double distance = distanceData.Distance * repeats * legacy_velocity_multiplier; + double distance = distanceData.Distance * spans * legacy_velocity_multiplier; // The velocity of the taiko hit object - calculated as the velocity of a drum roll double taikoVelocity = taiko_base_distance * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier * legacy_velocity_multiplier / speedAdjustedBeatLength; @@ -111,7 +112,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps double osuDuration = distance / osuVelocity; // If the drum roll is to be split into hit circles, assume the ticks are 1/8 spaced within the duration of one beat - double tickSpacing = Math.Min(speedAdjustedBeatLength / beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate, taikoDuration / repeats); + double tickSpacing = Math.Min(speedAdjustedBeatLength / beatmap.BeatmapInfo.BaseDifficulty.SliderTickRate, taikoDuration / spans); if (!isForCurrentRuleset && tickSpacing > 0 && osuDuration < 2 * speedAdjustedBeatLength) { diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs index 840322f8a8..5fdc9a07e1 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs @@ -77,6 +77,10 @@ namespace osu.Game.Rulesets.Objects.Legacy if (repeatCount > 9000) throw new ArgumentOutOfRangeException(nameof(repeatCount), @"Repeat count is way too high"); + // osu-stable treated the first span of the slider as a repeat, but no repeats are happening + repeatCount = Math.Max(0, repeatCount - 1); + + if (split.Length > 7) length = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); @@ -84,8 +88,7 @@ namespace osu.Game.Rulesets.Objects.Legacy readCustomSampleBanks(split[10], bankInfo); // One node for each repeat + the start and end nodes - // Note that the first length of the slider is considered a repeat, but there are no actual repeats happening - int nodes = Math.Max(0, repeatCount - 1) + 2; + int nodes = repeatCount + 2; // Populate node sample bank infos with the default hit object sample bank var nodeBankInfos = new List(); @@ -128,7 +131,7 @@ namespace osu.Game.Rulesets.Objects.Legacy // Generate the final per-node samples var nodeSamples = new List>(nodes); - for (int i = 0; i <= repeatCount; i++) + for (int i = 0; i < nodes; i++) nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i])); result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount, nodeSamples); diff --git a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs index 4e01402668..df7c8b0a83 100644 --- a/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs +++ b/osu.Game/Rulesets/Objects/Legacy/ConvertSlider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Rulesets.Objects.Types; -using System; using System.Collections.Generic; using OpenTK; using osu.Game.Audio; @@ -18,34 +17,23 @@ namespace osu.Game.Rulesets.Objects.Legacy /// private const float base_scoring_distance = 100; + /// + /// s don't need a curve since they're converted to ruleset-specific hitobjects. + /// + public SliderCurve Curve { get; } = null; public List ControlPoints { get; set; } public CurveType CurveType { get; set; } public double Distance { get; set; } public List> RepeatSamples { get; set; } - public int RepeatCount { get; set; } = 1; + public int RepeatCount { get; set; } - public double EndTime => StartTime + RepeatCount * Distance / Velocity; + public double EndTime => StartTime + this.SpanCount() * Distance / Velocity; public double Duration => EndTime - StartTime; public double Velocity = 1; - public Vector2 PositionAt(double progress) - { - throw new NotImplementedException(); - } - - public double ProgressAt(double progress) - { - throw new NotImplementedException(); - } - - public int RepeatAt(double progress) - { - throw new NotImplementedException(); - } - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); diff --git a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs index 92df232ea9..0254a829f4 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs @@ -11,6 +11,11 @@ namespace osu.Game.Rulesets.Objects.Types /// public interface IHasCurve : IHasDistance, IHasRepeats { + /// + /// The curve. + /// + SliderCurve Curve { get; } + /// /// The control points that shape the curve. /// @@ -20,7 +25,10 @@ namespace osu.Game.Rulesets.Objects.Types /// The type of curve. /// CurveType CurveType { get; } + } + public static class HasCurveExtensions + { /// /// Computes the position on the curve at a given progress, accounting for repeat logic. /// @@ -28,20 +36,28 @@ namespace osu.Game.Rulesets.Objects.Types /// /// /// [0, 1] where 0 is the beginning of the curve and 1 is the end of the curve. - Vector2 PositionAt(double progress); + public static Vector2 PositionAt(this IHasCurve obj, double progress) + => obj.Curve.PositionAt(obj.ProgressAt(progress)); /// /// Finds the progress along the curve, accounting for repeat logic. /// /// [0, 1] where 0 is the beginning of the curve and 1 is the end of the curve. /// [0, 1] where 0 is the beginning of the curve and 1 is the end of the curve. - double ProgressAt(double progress); + public static double ProgressAt(this IHasCurve obj, double progress) + { + double p = progress * obj.SpanCount() % 1; + if (obj.SpanAt(progress) % 2 == 1) + p = 1 - p; + return p; + } /// - /// Determines which repeat of the curve the progress point is on. + /// Determines which span of the curve the progress point is on. /// /// [0, 1] where 0 is the beginning of the curve and 1 is the end of the curve. - /// [0, RepeatCount] where 0 is the first run. - int RepeatAt(double progress); + /// [0, SpanCount) where 0 is the first run. + public static int SpanAt(this IHasCurve obj, double progress) + => (int)(progress * obj.SpanCount()); } } diff --git a/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs index bd097cb96f..75dd3776f9 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasRepeats.cs @@ -21,4 +21,13 @@ namespace osu.Game.Rulesets.Objects.Types /// List> RepeatSamples { get; } } + + public static class HasRepeatsExtensions + { + /// + /// The amount of times the length of this spans. + /// + /// The object that has repeats. + public static int SpanCount(this IHasRepeats obj) => obj.RepeatCount + 1; + } } From 33c52ba30fa9ef9c3e02214aec0d9e89da87712a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 23 Jan 2018 13:58:43 +0900 Subject: [PATCH 473/628] Fix off-by-ones in RepeatPoint code --- .../Objects/Drawables/DrawableRepeatPoint.cs | 2 +- .../Objects/Drawables/DrawableSlider.cs | 12 ++++++------ osu.Game.Rulesets.Osu/Objects/Slider.cs | 8 ++++---- osu.Game.Rulesets.Osu/Objects/SliderTick.cs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 28ff4b4cdf..6cf353eaf2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -72,6 +72,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 1 ? end : start; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 0 ? end : start; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index fae56dcce2..6f3bb34a89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -73,12 +73,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddNested(InitialCircle); - var repeatDuration = s.Curve.Distance / s.Velocity; + var spanDuration = s.Curve.Distance / s.Velocity; foreach (var tick in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + tick.RepeatIndex * repeatDuration; - var fadeInTime = repeatStartTime + (tick.StartTime - repeatStartTime) / 2 - (tick.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; + var spanStartTime = s.StartTime + tick.SpanIndex * spanDuration; + var fadeInTime = spanStartTime + (tick.StartTime - spanStartTime) / 2 - (tick.SpanIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); + var fadeOutTime = spanStartTime + spanDuration; var drawableTick = new DrawableSliderTick(tick) { @@ -93,9 +93,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var repeatPoint in s.NestedHitObjects.OfType()) { - var repeatStartTime = s.StartTime + repeatPoint.RepeatIndex * repeatDuration; + var repeatStartTime = s.StartTime + (repeatPoint.RepeatIndex + 1) * spanDuration; var fadeInTime = repeatStartTime + (repeatPoint.StartTime - repeatStartTime) / 2 - (repeatPoint.RepeatIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = repeatStartTime + repeatDuration; + var fadeOutTime = repeatStartTime + spanDuration; var drawableRepeatPoint = new DrawableRepeatPoint(repeatPoint, this) { diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index c49fbce16d..35635788f2 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { - RepeatIndex = span, + SpanIndex = span, StartTime = spanStartTime + timeProgress * spanDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, @@ -148,19 +148,19 @@ namespace osu.Game.Rulesets.Osu.Objects { var repeatDuration = Distance / Velocity; - for (var repeat = 1; repeat <= RepeatCount; repeat++) + for (int repeatIndex = 0, repeat = 1; repeatIndex < RepeatCount; repeatIndex++, repeat++) { var repeatStartTime = StartTime + repeat * repeatDuration; AddNested(new RepeatPoint { - RepeatIndex = repeat, + RepeatIndex = repeatIndex, StartTime = repeatStartTime, Position = Curve.PositionAt(repeat % 2), StackHeight = StackHeight, Scale = Scale, ComboColour = ComboColour, - Samples = new List(RepeatSamples[repeat]) + Samples = new List(RepeatSamples[repeatIndex]) }); } } diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs index e6955b48e7..5f9a978902 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -5,6 +5,6 @@ namespace osu.Game.Rulesets.Osu.Objects { public class SliderTick : OsuHitObject { - public int RepeatIndex { get; set; } + public int SpanIndex { get; set; } } } From 2a9b773b49bbba423992b2f93e90dd2c4c71f190 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 14:10:51 +0900 Subject: [PATCH 474/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8f36ddab94..a7dd1fba84 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 +Subproject commit a7dd1fba8473f636ee8f6e49075331d9076383ee From 5689e93bedd4390e8e3e783d7b1677fd72804ef6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 16:24:08 +0900 Subject: [PATCH 475/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index c0c21831ce..736a139a74 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit c0c21831cef6b2946c5b067f5c4bbd929e89c2ec +Subproject commit 736a139a748eba7cebea41a09b404d47ca589522 From 1fda45fe1098c6a1ef1aa3067c7d0715978d5819 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 16:40:18 +0900 Subject: [PATCH 476/628] Fix broken formatting --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 3b552629cf..9911be9daa 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Mania.UI return null; } - private Bindable scrollTime; + private Bindable scrollTime; [BackgroundDependencyLoader] private void load(ManiaConfigManager maniaConfig) From b197cd56af28b58c77eedda97b324d1ca96d39de Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 23 Jan 2018 16:42:31 +0900 Subject: [PATCH 477/628] Allow DI'd OnScreenDisplay to be null --- osu.Game/Rulesets/UI/RulesetContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 69249c1fe6..f9a7bbe4c8 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -88,7 +88,7 @@ namespace osu.Game.Rulesets.UI Cursor = CreateCursor(); } - [BackgroundDependencyLoader] + [BackgroundDependencyLoader(true)] private void load(Storage storage, OnScreenDisplay onScreenDisplay) { this.onScreenDisplay = onScreenDisplay; From 2c0dd1815cdcb0c98d65b8310bfd4fffd9a0ec09 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 23 Jan 2018 09:09:19 +0100 Subject: [PATCH 478/628] Updated submodule osu-framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 26c01ca606..736a139a74 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 26c01ca6069296621f76d8ffbfe31ecf8074c687 +Subproject commit 736a139a748eba7cebea41a09b404d47ca589522 From fa800f097787f2beb1cb20f76cee250c170aca5e Mon Sep 17 00:00:00 2001 From: james58899 Date: Tue, 23 Jan 2018 18:18:54 +0800 Subject: [PATCH 479/628] fix storyboard path --- .../Beatmaps/Formats/LegacyStoryboardDecoderTest.cs | 4 ++-- osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs index cd3f6d066f..dce6c0f55b 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyStoryboardDecoderTest.cs @@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual(new Vector2(320, 240), sprite.InitialPosition); Assert.IsTrue(sprite.IsDrawable); Assert.AreEqual(Anchor.Centre, sprite.Origin); - Assert.AreEqual(Path.Combine("SB", "lyric", "ja-21.png"), sprite.Path); + Assert.AreEqual("SB/lyric/ja-21.png", sprite.Path); var animation = background.Elements.ElementAt(12) as StoryboardAnimation; Assert.NotNull(animation); @@ -82,7 +82,7 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.IsTrue(animation.IsDrawable); Assert.AreEqual(AnimationLoopType.LoopForever, animation.LoopType); Assert.AreEqual(Anchor.Centre, animation.Origin); - Assert.AreEqual(Path.Combine("SB", "red jitter", "red_0000.jpg"), animation.Path); + Assert.AreEqual("SB/red jitter/red_0000.jpg", animation.Path); Assert.AreEqual(78993, animation.StartTime); } } diff --git a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs index d60297a26c..a4ff060c83 100644 --- a/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyStoryboardDecoder.cs @@ -301,6 +301,6 @@ namespace osu.Game.Beatmaps.Formats } } - private string cleanFilename(string path) => FileSafety.PathSanitise(path.Trim('\"')); + private string cleanFilename(string path) => FileSafety.PathStandardise(FileSafety.PathSanitise(path.Trim('\"'))); } } From efae00c1494dd66582a3c3872826da5fdcb0dc0c Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Tue, 23 Jan 2018 04:31:37 -0600 Subject: [PATCH 480/628] make repeat points look better --- .../Objects/Drawables/DrawableRepeatPoint.cs | 18 ++++++++++++++---- .../Objects/Drawables/DrawableSlider.cs | 2 ++ .../Objects/Drawables/Pieces/SliderBody.cs | 10 +++++----- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index 6cf353eaf2..b6a07aa4e3 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -15,6 +16,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; + private bool isEndRepeat => repeatPoint.RepeatIndex % 2 == 0; public double FadeInTime; public double FadeOutTime; @@ -25,17 +27,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables this.repeatPoint = repeatPoint; this.drawableSlider = drawableSlider; - Size = new Vector2(32 * repeatPoint.Scale); + Size = new Vector2(45 * repeatPoint.Scale); Blending = BlendingMode.Additive; Origin = Anchor.Centre; - + Children = new Drawable[] { new SpriteIcon { RelativeSizeAxes = Axes.Both, - Icon = FontAwesome.fa_eercast + Icon = FontAwesome.fa_chevron_right } }; } @@ -72,6 +74,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public void UpdateSnakingPosition(Vector2 start, Vector2 end) => Position = repeatPoint.RepeatIndex % 2 == 0 ? end : start; + public void UpdateSnakingPosition(Vector2 start, Vector2 end) + { + Position = isEndRepeat ? end : start; + var curve = drawableSlider.CurrentCurve; + if (curve.Count < 3 || curve.All(p => p == Position)) + return; + var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position) - 1 : curve.LastIndexOf(Position) + 1]; + Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); + } } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 6f3bb34a89..8deb31db2a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly Container ticks; private readonly Container repeatPoints; + public List CurrentCurve => Body.CurrentCurve; + public readonly SliderBody Body; public readonly SliderBall Ball; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs index 6fe1fda8eb..901d1c568d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces // We want the container to have the same size as the slider, // and to be positioned such that the slider head is at (0,0). container.Size = path.Size; - container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - currentCurve[0]); + container.Position = -path.PositionInBoundingBox(slider.Curve.PositionAt(0) - CurrentCurve[0]); container.ForceRedraw(); } @@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces path.Texture = texture; } - private readonly List currentCurve = new List(); + public readonly List CurrentCurve = new List(); private bool updateSnaking(double p0, double p1) { if (SnakedStart == p0 && SnakedEnd == p1) return false; @@ -156,11 +156,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces SnakedStart = p0; SnakedEnd = p1; - slider.Curve.GetPathToProgress(currentCurve, p0, p1); + slider.Curve.GetPathToProgress(CurrentCurve, p0, p1); path.ClearVertices(); - foreach (Vector2 p in currentCurve) - path.AddVertex(p - currentCurve[0]); + foreach (Vector2 p in CurrentCurve) + path.AddVertex(p - CurrentCurve[0]); return true; } From 4baadfdd16beac1cd024cc7ac143792e472e823a Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 23 Jan 2018 16:44:33 +0100 Subject: [PATCH 481/628] fix oversight --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index faf0da8339..073ff476c1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Osu.Objects /// /// The length of one repeat if any repeats are present, otherwise it equals the . /// - public double SpanDuration => RepeatCount > 1 ? Distance / Velocity : Duration; + public double SpanDuration => RepeatCount > 0 ? Distance / Velocity : Duration; private int stackHeight; From 6dfd0b5cc244387e2f59355d6038465419b5763f Mon Sep 17 00:00:00 2001 From: Michael Manis Date: Tue, 23 Jan 2018 10:54:42 -0500 Subject: [PATCH 482/628] Unnecessary because of prior commit. --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index 16586adc0c..c2dfea9a08 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Toolbar avatar.User = new User(); break; case APIState.Online: - Text = api.LocalUser.Value.Username; + Text = api.Username; avatar.User = api.LocalUser; break; } From 205d3ed896d228f58006bc98562e72368233537d Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Tue, 23 Jan 2018 19:42:21 +0100 Subject: [PATCH 483/628] fix settings not getting injected --- osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs index 64fa763a0b..1b0c821b54 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarSettingsButton.cs @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Toolbar } [BackgroundDependencyLoader(true)] - private void load(SettingsOverlay settings) + private void load(MainSettings settings) { StateContainer = settings; } From 52c4d22c410e31cfe0d1b592893736cea067248e Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 24 Jan 2018 09:44:50 +0100 Subject: [PATCH 484/628] review changes - use doubles instead of floats - simplify logic --- osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs | 4 ++-- osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs | 2 +- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 4 ++-- osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs | 5 +++-- osu.Game.Rulesets.Osu/Objects/Slider.cs | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs index d42338f20e..3dad5b508c 100644 --- a/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs +++ b/osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapProcessor.cs @@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps continue; double endTime = (stackBaseObject as IHasEndTime)?.EndTime ?? stackBaseObject.StartTime; - float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; + double stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; if (objectN.StartTime - endTime > stackThreshold) //We are no longer within stacking range of the next object. @@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps OsuHitObject objectI = beatmap.HitObjects[i]; if (objectI.StackHeight != 0 || objectI is Spinner) continue; - float stackThreshold = objectI.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; + double stackThreshold = objectI.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f; /* If this object is a hitcircle, then we enter this "special" case. * It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider. diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs index 3a486e7763..b4dd08eadb 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override string Description => @"Play with no approach circles and fading notes for a slight score advantage."; public override double ScoreMultiplier => 1.06; - private const float fade_in_duration_multiplier = 0.4f; + private const double fade_in_duration_multiplier = 0.4; private const double fade_out_duration_multiplier = 0.3; public void ApplyToDrawableHitObjects(IEnumerable drawables) diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index 0e7c2f3d4d..f217ae89e9 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -20,8 +20,8 @@ namespace osu.Game.Rulesets.Osu.Objects public double HitWindow100 = 80; public double HitWindow300 = 30; - public float TimePreempt = 600; - public float TimeFadein = 400; + public double TimePreempt = 600; + public double TimeFadein = 400; public Vector2 Position { get; set; } public float X => Position.X; diff --git a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs index c55235611c..eaaa8d7a7e 100644 --- a/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/RepeatPoint.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; @@ -17,8 +18,8 @@ namespace osu.Game.Rulesets.Osu.Objects // We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders // we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time. - if (RepeatIndex > 0 && TimePreempt > SpanDuration * 2) - TimePreempt = (float)SpanDuration * 2; + if (RepeatIndex > 0) + TimePreempt = Math.Min(SpanDuration * 2, TimePreempt); } } } diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 073ff476c1..79bb14a475 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -61,9 +61,9 @@ namespace osu.Game.Rulesets.Osu.Objects public int RepeatCount { get; set; } /// - /// The length of one repeat if any repeats are present, otherwise it equals the . + /// The length of one span of this . /// - public double SpanDuration => RepeatCount > 0 ? Distance / Velocity : Duration; + public double SpanDuration => Duration / this.SpanCount(); private int stackHeight; From 5a00ae36d124621188096546dfb5b172a7428d4e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Jan 2018 17:35:37 +0900 Subject: [PATCH 485/628] Add database-based configuration for rulesets --- .../Configuration/ManiaConfigManager.cs | 6 +- .../UI/ManiaRulesetContainer.cs | 4 +- .../Configuration/DatabasedConfigManager.cs | 67 ++++ osu.Game/Configuration/DatabasedSetting.cs | 31 ++ osu.Game/Configuration/OsuConfigManager.cs | 2 +- osu.Game/Configuration/Setting.cs | 41 +++ osu.Game/Configuration/SettingsStore.cs | 42 +++ osu.Game/Database/DatabaseBackedStore.cs | 10 +- osu.Game/Database/OsuDbContext.cs | 8 +- .../20180124024000_AddSettings.Designer.cs | 327 ++++++++++++++++++ .../Migrations/20180124024000_AddSettings.cs | 56 +++ .../Migrations/OsuDbContextModelSnapshot.cs | 22 +- osu.Game/OsuGameBase.cs | 3 + .../Configuration/RulesetConfigManager.cs | 15 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 8 +- .../Components/DrawingsConfigManager.cs | 2 +- osu.Game/osu.Game.csproj | 8 + 17 files changed, 624 insertions(+), 28 deletions(-) create mode 100644 osu.Game/Configuration/DatabasedConfigManager.cs create mode 100644 osu.Game/Configuration/DatabasedSetting.cs create mode 100644 osu.Game/Configuration/Setting.cs create mode 100644 osu.Game/Configuration/SettingsStore.cs create mode 100644 osu.Game/Migrations/20180124024000_AddSettings.Designer.cs create mode 100644 osu.Game/Migrations/20180124024000_AddSettings.cs diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs index 0f062ed72a..3167d8300d 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs @@ -2,15 +2,15 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Configuration.Tracking; -using osu.Framework.Platform; +using osu.Game.Configuration; using osu.Game.Rulesets.Configuration; namespace osu.Game.Rulesets.Mania.Configuration { public class ManiaConfigManager : RulesetConfigManager { - public ManiaConfigManager(Ruleset ruleset, Storage storage) - : base(ruleset, storage) + public ManiaConfigManager(RulesetInfo ruleset, SettingsStore settings) + : base(ruleset, settings) { } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index 109c967ded..f517d6b041 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -8,9 +8,9 @@ using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.MathUtils; -using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Configuration; using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Mania.Beatmaps; using osu.Game.Rulesets.Mania.Mods; @@ -107,6 +107,6 @@ namespace osu.Game.Rulesets.Mania.UI protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay, this); - protected override IRulesetConfigManager CreateConfig(Ruleset ruleset, Storage storage) => new ManiaConfigManager(ruleset, storage); + protected override IRulesetConfigManager CreateConfig(Ruleset ruleset, SettingsStore settings) => new ManiaConfigManager(Ruleset.RulesetInfo, settings); } } diff --git a/osu.Game/Configuration/DatabasedConfigManager.cs b/osu.Game/Configuration/DatabasedConfigManager.cs new file mode 100644 index 0000000000..f982490523 --- /dev/null +++ b/osu.Game/Configuration/DatabasedConfigManager.cs @@ -0,0 +1,67 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Configuration; +using osu.Game.Rulesets; + +namespace osu.Game.Configuration +{ + public abstract class DatabasedConfigManager : ConfigManager + where T : struct + { + private readonly SettingsStore settings; + + private readonly List databasedSettings; + + private readonly RulesetInfo ruleset; + + protected DatabasedConfigManager(SettingsStore settings, RulesetInfo ruleset = null) + { + this.settings = settings; + this.ruleset = ruleset; + + databasedSettings = settings.Query(ruleset?.ID); + + InitialiseDefaults(); + } + + protected override void PerformLoad() + { + } + + protected override bool PerformSave() + { + return true; + } + + protected override void AddBindable(T lookup, Bindable bindable) + { + base.AddBindable(lookup, bindable); + + var setting = databasedSettings.FirstOrDefault(s => (int)s.Key == (int)(object)lookup); + if (setting != null) + { + bindable.Parse(setting.Value); + } + else + { + settings.Update(setting = new DatabasedSetting + { + Key = lookup, + Value = bindable.Value, + RulesetID = ruleset?.ID + }); + + databasedSettings.Add(setting); + } + + bindable.ValueChanged += v => + { + setting.Value = v; + settings.Update(setting); + }; + } + } +} diff --git a/osu.Game/Configuration/DatabasedSetting.cs b/osu.Game/Configuration/DatabasedSetting.cs new file mode 100644 index 0000000000..b1644a3cd3 --- /dev/null +++ b/osu.Game/Configuration/DatabasedSetting.cs @@ -0,0 +1,31 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel.DataAnnotations.Schema; +using osu.Game.Database; + +namespace osu.Game.Configuration +{ + [Table("Settings")] + public class DatabasedSetting : Setting, IHasPrimaryKey + { + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int ID { get; set; } + + public int? RulesetID { get; set; } + + [Column("Key")] + public int IntKey + { + get => (int)Key; + private set => Key = value; + } + + [Column("Value")] + public string StringValue + { + get => Value.ToString(); + set => Value = value; + } + } +} diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 23f7fd6ac1..33810c9712 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -8,7 +8,7 @@ using osu.Game.Screens.Select; namespace osu.Game.Configuration { - public class OsuConfigManager : ConfigManager + public class OsuConfigManager : IniConfigManager { protected override void InitialiseDefaults() { diff --git a/osu.Game/Configuration/Setting.cs b/osu.Game/Configuration/Setting.cs new file mode 100644 index 0000000000..8c1d967ad9 --- /dev/null +++ b/osu.Game/Configuration/Setting.cs @@ -0,0 +1,41 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Configuration +{ + /// + /// A binding of a to an action. + /// + public class Setting + { + /// + /// The combination of keys which will trigger this binding. + /// + public object Key; + + /// + /// The resultant action which is triggered by this binding. + /// + public object Value; + + /// + /// Construct a new instance. + /// + /// The combination of keys which will trigger this binding. + /// The resultant action which is triggered by this binding. Usually an enum type. + public Setting(object key, object value) + { + Key = key; + Value = value; + } + + /// + /// Constructor for derived classes that may require serialisation. + /// + public Setting() + { + } + + public override string ToString() => $"{Key}=>{Value}"; + } +} diff --git a/osu.Game/Configuration/SettingsStore.cs b/osu.Game/Configuration/SettingsStore.cs new file mode 100644 index 0000000000..3bcdc05496 --- /dev/null +++ b/osu.Game/Configuration/SettingsStore.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Game.Database; + +namespace osu.Game.Configuration +{ + public class SettingsStore : DatabaseBackedStore + { + public event Action SettingChanged; + + public SettingsStore(Func createContext) + : base(createContext) + { + } + + /// + /// Retrieve s for a specified ruleset/variant content. + /// + /// The ruleset's internal ID. + /// An optional variant. + /// + public List Query(int? rulesetId = null) => + GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId).ToList(); + + public void Update(Setting setting) + { + var dbSetting = (DatabasedSetting)setting; + + var context = GetContext(); + + Refresh(ref dbSetting); + dbSetting.Value = setting.Value; + context.SaveChanges(); + + SettingChanged?.Invoke(); + } + } +} diff --git a/osu.Game/Database/DatabaseBackedStore.cs b/osu.Game/Database/DatabaseBackedStore.cs index 3184696266..ec9967e097 100644 --- a/osu.Game/Database/DatabaseBackedStore.cs +++ b/osu.Game/Database/DatabaseBackedStore.cs @@ -34,8 +34,14 @@ namespace osu.Game.Database if (context.Entry(obj).State != EntityState.Detached) return; var id = obj.ID; - obj = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find(id); - context.Entry(obj).Reload(); + var foundObject = lookupSource?.SingleOrDefault(t => t.ID == id) ?? context.Find(id); + if (foundObject != null) + { + obj = foundObject; + context.Entry(obj).Reload(); + } + else + context.Add(obj); } /// diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index 091ec3487c..be0b4f3543 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -8,9 +8,10 @@ using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Logging; using osu.Framework.Logging; using osu.Game.Beatmaps; -using osu.Game.Input.Bindings; +using osu.Game.Configuration; using osu.Game.IO; using osu.Game.Rulesets; +using DatabasedKeyBinding = osu.Game.Input.Bindings.DatabasedKeyBinding; using LogLevel = Microsoft.Extensions.Logging.LogLevel; namespace osu.Game.Database @@ -22,6 +23,7 @@ namespace osu.Game.Database public DbSet BeatmapMetadata { get; set; } public DbSet BeatmapSetInfo { get; set; } public DbSet DatabasedKeyBinding { get; set; } + public DbSet DatabasedSetting { get; set; } public DbSet FileInfo { get; set; } public DbSet RulesetInfo { get; set; } @@ -86,9 +88,11 @@ namespace osu.Game.Database modelBuilder.Entity().HasIndex(b => b.DeletePending); modelBuilder.Entity().HasIndex(b => b.Hash).IsUnique(); - modelBuilder.Entity().HasIndex(b => b.Variant); + modelBuilder.Entity().HasIndex(b => new { b.RulesetID, b.Variant }); modelBuilder.Entity().HasIndex(b => b.IntAction); + modelBuilder.Entity().HasIndex(b => b.RulesetID); + modelBuilder.Entity().HasIndex(b => b.Hash).IsUnique(); modelBuilder.Entity().HasIndex(b => b.ReferenceCount); diff --git a/osu.Game/Migrations/20180124024000_AddSettings.Designer.cs b/osu.Game/Migrations/20180124024000_AddSettings.Designer.cs new file mode 100644 index 0000000000..5bbf382f7f --- /dev/null +++ b/osu.Game/Migrations/20180124024000_AddSettings.Designer.cs @@ -0,0 +1,327 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using osu.Game.Database; +using System; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20180124024000_AddSettings")] + partial class AddSettings + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapDifficulty", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("ApproachRate"); + + b.Property("CircleSize"); + + b.Property("DrainRate"); + + b.Property("OverallDifficulty"); + + b.Property("SliderMultiplier"); + + b.Property("SliderTickRate"); + + b.HasKey("ID"); + + b.ToTable("BeatmapDifficulty"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("AudioLeadIn"); + + b.Property("BaseDifficultyID"); + + b.Property("BeatDivisor"); + + b.Property("BeatmapSetInfoID"); + + b.Property("Countdown"); + + b.Property("DistanceSpacing"); + + b.Property("GridSize"); + + b.Property("Hash"); + + b.Property("Hidden"); + + b.Property("LetterboxInBreaks"); + + b.Property("MD5Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapID"); + + b.Property("Path"); + + b.Property("RulesetID"); + + b.Property("SpecialStyle"); + + b.Property("StackLeniency"); + + b.Property("StarDifficulty"); + + b.Property("StoredBookmarks"); + + b.Property("TimelineZoom"); + + b.Property("Version"); + + b.Property("WidescreenStoryboard"); + + b.HasKey("ID"); + + b.HasIndex("BaseDifficultyID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MD5Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapID") + .IsUnique(); + + b.HasIndex("RulesetID"); + + b.ToTable("BeatmapInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapMetadata", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Artist"); + + b.Property("ArtistUnicode"); + + b.Property("AudioFile"); + + b.Property("AuthorString") + .HasColumnName("Author"); + + b.Property("BackgroundFile"); + + b.Property("PreviewTime"); + + b.Property("Source"); + + b.Property("Tags"); + + b.Property("Title"); + + b.Property("TitleUnicode"); + + b.HasKey("ID"); + + b.ToTable("BeatmapMetadata"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("BeatmapSetInfoID"); + + b.Property("FileInfoID"); + + b.Property("Filename") + .IsRequired(); + + b.HasKey("ID"); + + b.HasIndex("BeatmapSetInfoID"); + + b.HasIndex("FileInfoID"); + + b.ToTable("BeatmapSetFileInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("DeletePending"); + + b.Property("Hash"); + + b.Property("MetadataID"); + + b.Property("OnlineBeatmapSetID"); + + b.Property("Protected"); + + b.HasKey("ID"); + + b.HasIndex("DeletePending"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("MetadataID"); + + b.HasIndex("OnlineBeatmapSetID") + .IsUnique(); + + b.ToTable("BeatmapSetInfo"); + }); + + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntKey") + .HasColumnName("Key"); + + b.Property("IntValue") + .HasColumnName("Value"); + + b.Property("RulesetID"); + + b.HasKey("ID"); + + b.HasIndex("RulesetID"); + + b.ToTable("Settings"); + }); + + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntAction") + .HasColumnName("Action"); + + b.Property("KeysString") + .HasColumnName("Keys"); + + b.Property("RulesetID"); + + b.Property("Variant"); + + b.HasKey("ID"); + + b.HasIndex("IntAction"); + + b.HasIndex("RulesetID", "Variant"); + + b.ToTable("KeyBinding"); + }); + + modelBuilder.Entity("osu.Game.IO.FileInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Hash"); + + b.Property("ReferenceCount"); + + b.HasKey("ID"); + + b.HasIndex("Hash") + .IsUnique(); + + b.HasIndex("ReferenceCount"); + + b.ToTable("FileInfo"); + }); + + modelBuilder.Entity("osu.Game.Rulesets.RulesetInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("Available"); + + b.Property("InstantiationInfo"); + + b.Property("Name"); + + b.Property("ShortName"); + + b.HasKey("ID"); + + b.HasIndex("Available"); + + b.HasIndex("ShortName") + .IsUnique(); + + b.ToTable("RulesetInfo"); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapDifficulty", "BaseDifficulty") + .WithMany() + .HasForeignKey("BaseDifficultyID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo", "BeatmapSet") + .WithMany("Beatmaps") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("Beatmaps") + .HasForeignKey("MetadataID"); + + b.HasOne("osu.Game.Rulesets.RulesetInfo", "Ruleset") + .WithMany() + .HasForeignKey("RulesetID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetFileInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapSetInfo") + .WithMany("Files") + .HasForeignKey("BeatmapSetInfoID") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("osu.Game.IO.FileInfo", "FileInfo") + .WithMany() + .HasForeignKey("FileInfoID") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("osu.Game.Beatmaps.BeatmapSetInfo", b => + { + b.HasOne("osu.Game.Beatmaps.BeatmapMetadata", "Metadata") + .WithMany("BeatmapSets") + .HasForeignKey("MetadataID"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/osu.Game/Migrations/20180124024000_AddSettings.cs b/osu.Game/Migrations/20180124024000_AddSettings.cs new file mode 100644 index 0000000000..63cacc0645 --- /dev/null +++ b/osu.Game/Migrations/20180124024000_AddSettings.cs @@ -0,0 +1,56 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace osu.Game.Migrations +{ + public partial class AddSettings : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_KeyBinding_Variant", + table: "KeyBinding"); + + migrationBuilder.CreateTable( + name: "Settings", + columns: table => new + { + ID = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Key = table.Column(type: "INTEGER", nullable: false), + Value = table.Column(type: "INTEGER", nullable: false), + RulesetID = table.Column(type: "INTEGER", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Settings", x => x.ID); + }); + + migrationBuilder.CreateIndex( + name: "IX_KeyBinding_RulesetID_Variant", + table: "KeyBinding", + columns: new[] { "RulesetID", "Variant" }); + + migrationBuilder.CreateIndex( + name: "IX_Settings_RulesetID", + table: "Settings", + column: "RulesetID"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Settings"); + + migrationBuilder.DropIndex( + name: "IX_KeyBinding_RulesetID_Variant", + table: "KeyBinding"); + + migrationBuilder.CreateIndex( + name: "IX_KeyBinding_Variant", + table: "KeyBinding", + column: "Variant"); + } + } +} diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index cd4d3c2854..37e2aee3a0 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -193,6 +193,26 @@ namespace osu.Game.Migrations b.ToTable("BeatmapSetInfo"); }); + modelBuilder.Entity("osu.Game.Configuration.DatabasedSetting", b => + { + b.Property("ID") + .ValueGeneratedOnAdd(); + + b.Property("IntKey") + .HasColumnName("Key"); + + b.Property("IntValue") + .HasColumnName("Value"); + + b.Property("RulesetID"); + + b.HasKey("ID"); + + b.HasIndex("RulesetID"); + + b.ToTable("Settings"); + }); + modelBuilder.Entity("osu.Game.Input.Bindings.DatabasedKeyBinding", b => { b.Property("ID") @@ -212,7 +232,7 @@ namespace osu.Game.Migrations b.HasIndex("IntAction"); - b.HasIndex("Variant"); + b.HasIndex("RulesetID", "Variant"); b.ToTable("KeyBinding"); }); diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 8b317ca59a..d0b9634696 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,6 +44,8 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; + protected SettingsStore SettingsStore; + protected CursorOverrideContainer CursorOverrideContainer; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -109,6 +111,7 @@ namespace osu.Game dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory.GetContext, RulesetStore, API, Host)); dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory.GetContext, Host, BeatmapManager, RulesetStore)); dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory.GetContext, RulesetStore)); + dependencies.Cache(SettingsStore = new SettingsStore(contextFactory.GetContext)); dependencies.Cache(new OsuColour()); //this completely overrides the framework default. will need to change once we make a proper FontStore. diff --git a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs index 9106485253..4f9fbe9830 100644 --- a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs @@ -1,24 +1,15 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Configuration; -using osu.Framework.Platform; +using osu.Game.Configuration; namespace osu.Game.Rulesets.Configuration { - public abstract class RulesetConfigManager : ConfigManager, IRulesetConfigManager + public abstract class RulesetConfigManager : DatabasedConfigManager, IRulesetConfigManager where T : struct { - protected override string Filename => ruleset?.ShortName == null ? null : $"{ruleset.ShortName}.ini"; - private readonly Ruleset ruleset; - - protected RulesetConfigManager(Ruleset ruleset, Storage storage) - : base(storage) + protected RulesetConfigManager(RulesetInfo ruleset, SettingsStore settings) : base(settings, ruleset) { - this.ruleset = ruleset; - - // Re-load with the ruleset - Load(); } } } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index f9a7bbe4c8..08498d48c6 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -16,7 +16,7 @@ using System.Linq; using osu.Framework.Configuration; using osu.Framework.Graphics.Cursor; using osu.Framework.Input; -using osu.Framework.Platform; +using osu.Game.Configuration; using osu.Game.Overlays; using osu.Game.Rulesets.Configuration; using osu.Game.Rulesets.Replays; @@ -89,11 +89,11 @@ namespace osu.Game.Rulesets.UI } [BackgroundDependencyLoader(true)] - private void load(Storage storage, OnScreenDisplay onScreenDisplay) + private void load(OnScreenDisplay onScreenDisplay, SettingsStore settings) { this.onScreenDisplay = onScreenDisplay; - rulesetConfig = CreateConfig(Ruleset, storage); + rulesetConfig = CreateConfig(Ruleset, settings); if (rulesetConfig != null) { @@ -135,7 +135,7 @@ namespace osu.Game.Rulesets.UI /// protected virtual CursorContainer CreateCursor() => null; - protected virtual IRulesetConfigManager CreateConfig(Ruleset ruleset, Storage storage) => null; + protected virtual IRulesetConfigManager CreateConfig(Ruleset ruleset, SettingsStore settings) => null; /// /// Creates a Playfield. diff --git a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs b/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs index 0c45729a18..63000d6c54 100644 --- a/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs +++ b/osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs @@ -6,7 +6,7 @@ using osu.Framework.Platform; namespace osu.Game.Screens.Tournament.Components { - public class DrawingsConfigManager : ConfigManager + public class DrawingsConfigManager : IniConfigManager { protected override string Filename => @"drawings.ini"; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 05728c2b41..56cfe6646c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -265,10 +265,18 @@ + + + + + + + 20180124024000_AddSettings.cs + From 8d11596b2f5341f177b8b709362402e4f09a27f2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 24 Jan 2018 17:48:42 +0900 Subject: [PATCH 486/628] Minor cleanups --- osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs | 3 ++- osu.Game/Screens/Play/HUDOverlay.cs | 3 +-- osu.Game/Screens/Play/Player.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs index 7a510aa738..af7c1ef5aa 100644 --- a/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs +++ b/osu.Game/Screens/Play/BreaksOverlay/BreakOverlay.cs @@ -41,7 +41,8 @@ namespace osu.Game.Screens.Play.BreaksOverlay private readonly InfoContainer info; private readonly ArrowsOverlay arrowsOverlay; - public BreakOverlay(bool letterboxing, ScoreProcessor scoreProcessor) : this(letterboxing) + public BreakOverlay(bool letterboxing, ScoreProcessor scoreProcessor) + : this(letterboxing) { bindProcessor(scoreProcessor); } diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 0cdb053e77..5fb867e151 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -41,8 +41,7 @@ namespace osu.Game.Screens.Play private static bool hasShownNotificationOnce; - public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, DecoupleableInterpolatingFramedClock decoupledClock, WorkingBeatmap working, - IAdjustableClock adjustableSourceClock) + public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, DecoupleableInterpolatingFramedClock decoupledClock, WorkingBeatmap working, IAdjustableClock adjustableSourceClock) { RelativeSizeAxes = Axes.Both; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 6da2c0fb76..ca4cb98bc8 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -176,7 +176,7 @@ namespace osu.Game.Screens.Play pauseContainer.Retries = RestartCount; hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused; }, - OnResume = () => { hudOverlay.KeyCounter.IsCounting = true; }, + OnResume = () => hudOverlay.KeyCounter.IsCounting = true, Children = new Drawable[] { new Container From 49e61b565815c0c612ed2dc691e94275d59ec154 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 24 Jan 2018 17:59:27 +0900 Subject: [PATCH 487/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8f36ddab94..736a139a74 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8f36ddab946ff538620081ede7719461d4732b79 +Subproject commit 736a139a748eba7cebea41a09b404d47ca589522 From 29e98a58f29ea50f6d9efedf246c2caf667ece06 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Jan 2018 17:59:49 +0900 Subject: [PATCH 488/628] Combine Setting and DatabasedSetting --- osu.Game/Configuration/DatabasedSetting.cs | 20 ++++++++++- osu.Game/Configuration/Setting.cs | 42 +--------------------- osu.Game/Configuration/SettingsStore.cs | 9 +++-- 3 files changed, 24 insertions(+), 47 deletions(-) diff --git a/osu.Game/Configuration/DatabasedSetting.cs b/osu.Game/Configuration/DatabasedSetting.cs index b1644a3cd3..c284c10872 100644 --- a/osu.Game/Configuration/DatabasedSetting.cs +++ b/osu.Game/Configuration/DatabasedSetting.cs @@ -7,7 +7,7 @@ using osu.Game.Database; namespace osu.Game.Configuration { [Table("Settings")] - public class DatabasedSetting : Setting, IHasPrimaryKey + public class DatabasedSetting : IHasPrimaryKey { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ID { get; set; } @@ -27,5 +27,23 @@ namespace osu.Game.Configuration get => Value.ToString(); set => Value = value; } + + public object Key; + public object Value; + + public DatabasedSetting(object key, object value) + { + Key = key; + Value = value; + } + + /// + /// Constructor for derived classes that may require serialisation. + /// + public DatabasedSetting() + { + } + + public override string ToString() => $"{Key}=>{Value}"; } } diff --git a/osu.Game/Configuration/Setting.cs b/osu.Game/Configuration/Setting.cs index 8c1d967ad9..5f282702bb 100644 --- a/osu.Game/Configuration/Setting.cs +++ b/osu.Game/Configuration/Setting.cs @@ -1,41 +1 @@ -// Copyright (c) 2007-2018 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Configuration -{ - /// - /// A binding of a to an action. - /// - public class Setting - { - /// - /// The combination of keys which will trigger this binding. - /// - public object Key; - - /// - /// The resultant action which is triggered by this binding. - /// - public object Value; - - /// - /// Construct a new instance. - /// - /// The combination of keys which will trigger this binding. - /// The resultant action which is triggered by this binding. Usually an enum type. - public Setting(object key, object value) - { - Key = key; - Value = value; - } - - /// - /// Constructor for derived classes that may require serialisation. - /// - public Setting() - { - } - - public override string ToString() => $"{Key}=>{Value}"; - } -} + \ No newline at end of file diff --git a/osu.Game/Configuration/SettingsStore.cs b/osu.Game/Configuration/SettingsStore.cs index 3bcdc05496..6bb186604f 100644 --- a/osu.Game/Configuration/SettingsStore.cs +++ b/osu.Game/Configuration/SettingsStore.cs @@ -26,14 +26,13 @@ namespace osu.Game.Configuration public List Query(int? rulesetId = null) => GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId).ToList(); - public void Update(Setting setting) + public void Update(DatabasedSetting setting) { - var dbSetting = (DatabasedSetting)setting; - var context = GetContext(); - Refresh(ref dbSetting); - dbSetting.Value = setting.Value; + Refresh(ref setting); + + setting.Value = setting.Value; context.SaveChanges(); SettingChanged?.Invoke(); From 72df2c681b6c63a32b9d3da4c23bbed9c0613f6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Jan 2018 18:01:39 +0900 Subject: [PATCH 489/628] Remove game-wise settings store for the time being --- osu.Game/OsuGameBase.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index d0b9634696..8b317ca59a 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,8 +44,6 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; - protected SettingsStore SettingsStore; - protected CursorOverrideContainer CursorOverrideContainer; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -111,7 +109,6 @@ namespace osu.Game dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory.GetContext, RulesetStore, API, Host)); dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory.GetContext, Host, BeatmapManager, RulesetStore)); dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory.GetContext, RulesetStore)); - dependencies.Cache(SettingsStore = new SettingsStore(contextFactory.GetContext)); dependencies.Cache(new OsuColour()); //this completely overrides the framework default. will need to change once we make a proper FontStore. From 53c6526b22e77eecf5f6ff5c9c045422fbb31f20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Jan 2018 18:04:54 +0900 Subject: [PATCH 490/628] Remove unused code file --- osu.Game/Configuration/Setting.cs | 1 - osu.Game/osu.Game.csproj | 1 - 2 files changed, 2 deletions(-) delete mode 100644 osu.Game/Configuration/Setting.cs diff --git a/osu.Game/Configuration/Setting.cs b/osu.Game/Configuration/Setting.cs deleted file mode 100644 index 5f282702bb..0000000000 --- a/osu.Game/Configuration/Setting.cs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 56cfe6646c..2a09521727 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -266,7 +266,6 @@ - From b77f08941c6238ffb32b20a6d35a524262960f4d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 24 Jan 2018 20:05:11 +0900 Subject: [PATCH 491/628] Make mania play the next note's sounds if no note is hit Fixes #1911. This follows what osu!stable does, which is rather unfortunate, since it just plays _every_ sound for the note :|. --- osu.Game.Rulesets.Mania/UI/Column.cs | 24 ++++++++++++++++++- .../Objects/Drawables/DrawableHitObject.cs | 5 +++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 882628642b..21f00c003b 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -11,13 +11,14 @@ using osu.Framework.Graphics.Colour; using osu.Game.Graphics; using osu.Game.Rulesets.Objects.Drawables; using System; +using System.Linq; using osu.Framework.Input.Bindings; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.UI.Scrolling; namespace osu.Game.Rulesets.Mania.UI { - public class Column : ScrollingPlayfield, IHasAccentColour + public class Column : ScrollingPlayfield, IKeyBindingHandler, IHasAccentColour { private const float key_icon_size = 10; private const float key_icon_corner_radius = 3; @@ -259,5 +260,26 @@ namespace osu.Game.Rulesets.Mania.UI public bool OnPressed(ManiaAction action) => Pressed?.Invoke(action) ?? false; public bool OnReleased(ManiaAction action) => Released?.Invoke(action) ?? false; } + + public bool OnPressed(ManiaAction action) + { + // Play the sounds of the next hitobject + if (HitObjects.AliveObjects.Any()) + { + // If there are alive hitobjects, we can abuse the fact that AliveObjects are sorted by time (see: Add()) + HitObjects.AliveObjects.First().PlaySamples(); + } + else + { + // If not, we do a slow search - we might want to do a BinarySearch here if this becomes problematic + // We fallback to LastOrDefault() if we're beyond the last note in the map + var hitObject = HitObjects.Objects.FirstOrDefault(h => h.HitObject.StartTime > Time.Current) ?? HitObjects.Objects.LastOrDefault(); + hitObject?.PlaySamples(); + } + + return false; + } + + public bool OnReleased(ManiaAction action) => false; } } diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 8680ff4e83..2db02724ed 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -136,7 +136,10 @@ namespace osu.Game.Rulesets.Objects.Drawables /// public event Action ApplyCustomUpdateState; - protected void PlaySamples() => Samples.ForEach(s => s?.Play()); + /// + /// Plays all the hitsounds for this . + /// + public void PlaySamples() => Samples.ForEach(s => s?.Play()); protected override void Update() { From cee8bb50c927668e81c629cacb709cda88cab0f9 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 15:34:52 -0600 Subject: [PATCH 492/628] Fix reference points being wrongly selected --- .../Objects/Drawables/DrawableRepeatPoint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index b6a07aa4e3..adf5350996 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Blending = BlendingMode.Additive; Origin = Anchor.Centre; - + Children = new Drawable[] { new SpriteIcon @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables var curve = drawableSlider.CurrentCurve; if (curve.Count < 3 || curve.All(p => p == Position)) return; - var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position) - 1 : curve.LastIndexOf(Position) + 1]; + var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); } } From 51e188401f7a55246e04bfe9f1037f0a24aa382b Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 25 Jan 2018 00:38:22 +0300 Subject: [PATCH 493/628] Make MusicController draggable again --- osu.Game/Overlays/MusicController.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index d9e08a48ba..b3140d8bd0 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -5,8 +5,6 @@ using System; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; @@ -20,10 +18,12 @@ using osu.Framework.Localisation; using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Overlays.Music; -using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.Containers; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.Music; +using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Overlays { @@ -65,6 +65,12 @@ namespace osu.Game.Overlays AlwaysPresent = true; } + protected override bool OnDragStart(InputState state) + { + base.OnDragStart(state); + return true; + } + protected override bool OnDrag(InputState state) { if (base.OnDrag(state)) return true; From 1f51149da86a35639a7020d43124acf998b32128 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 15:41:51 -0600 Subject: [PATCH 494/628] Add xmldoc --- .../Objects/Drawables/DrawableRepeatPoint.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index adf5350996..077e97aa95 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -16,7 +16,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; - private bool isEndRepeat => repeatPoint.RepeatIndex % 2 == 0; + + /// + /// Are we located in the last ControlPoint of our + /// + private bool isRepeatAtEnd => repeatPoint.RepeatIndex % 2 == 0; public double FadeInTime; public double FadeOutTime; @@ -76,11 +80,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { - Position = isEndRepeat ? end : start; + Position = isRepeatAtEnd ? end : start; var curve = drawableSlider.CurrentCurve; if (curve.Count < 3 || curve.All(p => p == Position)) return; - var referencePoint = curve[isEndRepeat ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; + var referencePoint = curve[isRepeatAtEnd ? curve.IndexOf(Position, curve.Count - 2) - 1 : curve[0] == curve[1] ? 2 : 1]; Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(referencePoint.Y - Position.Y, referencePoint.X - Position.X)); } } From 8eef81e24d4b1eededb42cf076879ad460a1def3 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 24 Jan 2018 16:16:46 -0600 Subject: [PATCH 495/628] Add more cases to TestCase --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 114 ++++++++++++++++-- 1 file changed, 104 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index ddf24cc405..c9ab39e0b9 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -16,6 +16,7 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -41,7 +42,6 @@ namespace osu.Game.Rulesets.Osu.Tests public TestCaseSlider() { base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); - AddStep("Big Single", () => testSimpleBig()); AddStep("Medium Single", () => testSimpleMedium()); AddStep("Small Single", () => testSimpleSmall()); @@ -64,8 +64,22 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Fast Short Slider 1 Repeat", () => testShortHighSpeed(1)); AddStep("Fast Short Slider 2 Repeats", () => testShortHighSpeed(2)); - AddStep("Perfect Curve", testCurve); - // TODO more curve types? + AddStep("Perfect Curve", () => testPerfect()); + AddStep("Perfect Curve 1 Repeat", () => testPerfect(1)); + AddStep("Perfect Curve 2 Repeats", () => testPerfect(2)); + + AddStep("Linear Slider", () => testLinear()); + AddStep("Linear Slider 1 Repeat", () => testLinear(1)); + AddStep("Linear Slider 2 Repeats", () => testLinear(2)); + + AddStep("Beizer Slider", () => testBeizer()); + AddStep("Beizer Slider 1 Repeat", () => testBeizer(1)); + AddStep("Beizer Slider 2 Repeats", () => testBeizer(2)); + + AddStep("Linear Overlaping", () => testLinearOverlaping()); + AddStep("Linear Overlaping 1 Repeat", () => testLinearOverlaping(1)); + AddStep("Linear Overlaping 2 Repeats", () => testLinearOverlaping(2)); + // TODO add catmull } private void testSimpleBig(int repeats = 0) => createSlider(2, repeats: repeats); @@ -84,10 +98,6 @@ namespace osu.Game.Rulesets.Osu.Tests private void createSlider(float circleSize = 2, float distance = 400, int repeats = 0, double speedMultiplier = 2) { - var repeatSamples = new List>(); - for (int i = 0; i < repeats; i++) - repeatSamples.Add(new List()); - var slider = new Slider { StartTime = Time.Current + 1000, @@ -100,13 +110,13 @@ namespace osu.Game.Rulesets.Osu.Tests }, Distance = distance, RepeatCount = repeats, - RepeatSamples = repeatSamples + RepeatSamples = createEmptySamples(repeats) }; addSlider(slider, circleSize, speedMultiplier); } - private void testCurve() + private void testPerfect(int repeats = 0) { var slider = new Slider { @@ -119,12 +129,96 @@ namespace osu.Game.Rulesets.Osu.Tests new Vector2(0, 200), new Vector2(200, 0) }, - Distance = 600 + Distance = 600, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) }; addSlider(slider, 2, 3); } + private void testLinear(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Linear, + StartTime = Time.Current + 1000, + Position = new Vector2(-200, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-200, 0), + new Vector2(-50, 75), + new Vector2(0, 100), + new Vector2(100, -200), + new Vector2(200, 0), + new Vector2(230, 0) + }, + Distance = 793.4417, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private void testBeizer(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Bezier, + StartTime = Time.Current + 1000, + Position = new Vector2(-200, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(-200, 0), + new Vector2(-50, 75), + new Vector2(0, 100), + new Vector2(100, -200), + new Vector2(230, 0) + }, + Distance = 480, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private void testLinearOverlaping(int repeats = 0) + { + var slider = new Slider + { + CurveType = CurveType.Linear, + StartTime = Time.Current + 1000, + Position = new Vector2(0, 0), + ComboColour = Color4.LightSeaGreen, + ControlPoints = new List + { + new Vector2(0, 0), + new Vector2(-200, 0), + new Vector2(0, 0), + new Vector2(0, -200), + new Vector2(-200, -200), + new Vector2(0, -200) + }, + Distance = 1000, + RepeatCount = repeats, + RepeatSamples = createEmptySamples(repeats) + }; + + addSlider(slider, 2, 3); + } + + private List> createEmptySamples(int repeats) + { + var repeatSamples = new List>(); + for (int i = 0; i < repeats; i++) + repeatSamples.Add(new List()); + return repeatSamples; + } + private void addSlider(Slider slider, float circleSize, double speedMultiplier) { var cpi = new ControlPointInfo(); From 794d82d83fb9df18673329ff29dba77ff8fae4f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Jan 2018 10:21:52 +0900 Subject: [PATCH 496/628] Add new default hitsounds Getting these in for more widespread feedback. --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 7724abdf1d..266965f0d7 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 +Subproject commit 266965f0d795b94a126e2da302bd2c10eadd642a From 57cd50c45ee2d45f2ba9fb6804cce7acdc219066 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 25 Jan 2018 17:39:10 +0900 Subject: [PATCH 497/628] Reorder the way input is handled for replays Fixes https://github.com/ppy/osu/issues/1625 . --- .../Objects/Drawables/DrawableHitObject.cs | 2 ++ osu.Game/Rulesets/UI/RulesetInputManager.cs | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 2db02724ed..e4f8124bce 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -71,6 +71,8 @@ namespace osu.Game.Rulesets.Objects.Drawables public override bool HandleKeyboardInput => Interactive; public override bool HandleMouseInput => Interactive; + public override bool MaskingAffectsInput => false; + public override bool RemoveWhenNotAlive => false; public override bool RemoveCompletedTransforms => false; protected override bool RequiresChildrenUpdate => true; diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 223586a959..e32b38a013 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -136,9 +136,20 @@ namespace osu.Game.Rulesets.UI int loops = 0; while (validState && requireMoreUpdateLoops && loops++ < max_catch_up_updates_per_frame) + { if (!base.UpdateSubTree()) return false; + if (isAttached) + { + // When handling replay input, we need to consider the possibility of fast-forwarding, which may cause the clock to be updated + // to a point very far into the future, then playing a frame at that time. In such a case, lifetime MUST be updated before + // input is handled. This is why base.Update is not called from the derived Update when handling replay input, and is instead + // called manually at the correct time here. + base.Update(); + } + } + return true; } @@ -173,8 +184,11 @@ namespace osu.Game.Rulesets.UI // to ensure that the its time is valid for our children before input is processed Clock.ProcessFrame(); - // Process input - base.Update(); + if (!isAttached) + { + // For non-replay input handling, this provides equivalent input ordering as if Update was not overridden + base.Update(); + } } #endregion From c2a58223c55134223ea573d6f1a6e8cb8170e900 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Jan 2018 17:55:41 +0900 Subject: [PATCH 498/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 736a139a74..8c8d8242a8 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 736a139a748eba7cebea41a09b404d47ca589522 +Subproject commit 8c8d8242a8ae78ba272e5e7e89fb7662fca9a1e9 From 80b8780f560f225b184e7fe8b1a0947fd6e202ba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 24 Jan 2018 18:01:39 +0900 Subject: [PATCH 499/628] Revert "Remove game-wise settings store for the time being" This reverts commit 72df2c681b6c63a32b9d3da4c23bbed9c0613f6c. --- osu.Game/OsuGameBase.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 8b317ca59a..d0b9634696 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -44,6 +44,8 @@ namespace osu.Game protected KeyBindingStore KeyBindingStore; + protected SettingsStore SettingsStore; + protected CursorOverrideContainer CursorOverrideContainer; protected override string MainResourceFile => @"osu.Game.Resources.dll"; @@ -109,6 +111,7 @@ namespace osu.Game dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory.GetContext, RulesetStore, API, Host)); dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, contextFactory.GetContext, Host, BeatmapManager, RulesetStore)); dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory.GetContext, RulesetStore)); + dependencies.Cache(SettingsStore = new SettingsStore(contextFactory.GetContext)); dependencies.Cache(new OsuColour()); //this completely overrides the framework default. will need to change once we make a proper FontStore. From 214938b98d8ba0f4c2487ba2e184be9bddd8bf04 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Thu, 25 Jan 2018 10:52:03 +0100 Subject: [PATCH 500/628] fix SliderTicks appearing too late --- .../Objects/Drawables/DrawableSlider.cs | 8 +----- .../Objects/Drawables/DrawableSliderTick.cs | 26 +++++++------------ osu.Game.Rulesets.Osu/Objects/Slider.cs | 1 + osu.Game.Rulesets.Osu/Objects/SliderTick.cs | 12 +++++++++ 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index af947817c0..04df92fc35 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -75,15 +75,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var tick in s.NestedHitObjects.OfType()) { - var spanStartTime = s.StartTime + tick.SpanIndex * s.SpanDuration; - var fadeInTime = spanStartTime + (tick.StartTime - spanStartTime) / 2 - (tick.SpanIndex == 0 ? HitObject.TimeFadein : HitObject.TimeFadein / 2); - var fadeOutTime = spanStartTime + s.SpanDuration; - var drawableTick = new DrawableSliderTick(tick) { - FadeInTime = fadeInTime, - FadeOutTime = fadeOutTime, - Position = tick.Position, + Position = tick.Position }; ticks.Add(drawableTick); diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 09985752a4..a71c8a148e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -14,10 +13,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { public class DrawableSliderTick : DrawableOsuHitObject { - private readonly SliderTick sliderTick; - - public double FadeInTime; - public double FadeOutTime; + private const double anim_duration = 150; public bool Tracking; @@ -25,8 +21,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public DrawableSliderTick(SliderTick sliderTick) : base(sliderTick) { - this.sliderTick = sliderTick; - Size = new Vector2(16) * sliderTick.Scale; Masking = true; @@ -56,13 +50,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables protected override void UpdatePreemptState() { - var animIn = Math.Min(150, sliderTick.StartTime - FadeInTime); - this.Animate( - d => d.FadeIn(animIn), - d => d.ScaleTo(0.5f).ScaleTo(1.2f, animIn) + d => d.FadeIn(anim_duration), + d => d.ScaleTo(0.5f).ScaleTo(1.2f, anim_duration / 2) ).Then( - d => d.ScaleTo(1, 150, Easing.Out) + d => d.ScaleTo(1, anim_duration / 2, Easing.Out) ); } @@ -71,15 +63,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables switch (state) { case ArmedState.Idle: - this.Delay(FadeOutTime - sliderTick.StartTime).FadeOut(); + this.Delay(HitObject.TimePreempt).FadeOut(); break; case ArmedState.Miss: - this.FadeOut(160) - .FadeColour(Color4.Red, 80); + this.FadeOut(anim_duration) + .FadeColour(Color4.Red, anim_duration / 2); break; case ArmedState.Hit: - this.FadeOut(120, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, 120, Easing.OutQuint); + this.FadeOut(anim_duration, Easing.OutQuint) + .ScaleTo(Scale * 1.5f, anim_duration, Easing.OutQuint); break; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 79bb14a475..19a81e9f01 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -137,6 +137,7 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { SpanIndex = span, + SliderStartTime = StartTime, StartTime = spanStartTime + timeProgress * SpanDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs index 5f9a978902..5026519ecf 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -1,10 +1,22 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; + namespace osu.Game.Rulesets.Osu.Objects { public class SliderTick : OsuHitObject { public int SpanIndex { get; set; } + public double SliderStartTime { get; set; } + + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) + { + base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + + // SliderTicks appear earlier and earlier going further into a Slider. + TimePreempt = StartTime - ((StartTime - SliderStartTime) / 2 + SliderStartTime - TimeFadein * 0.66f); + } } } From 45e8a2b69bce8a09d7c5a7cbed00b216c5431e9d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 25 Jan 2018 20:49:18 +0900 Subject: [PATCH 501/628] Remove ManiaPlayfield local scrollTime bindable Now not needed due to having this databased. --- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 9911be9daa..c3cbf81af1 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -80,18 +80,10 @@ namespace osu.Game.Rulesets.Mania.UI return null; } - private Bindable scrollTime; - [BackgroundDependencyLoader] private void load(ManiaConfigManager maniaConfig) { maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange); - - // Todo: The following two lines shouldn't be required, but is an effect of not having config databased - // 1. ValueChanged is run prior to values being propagated - // 2. We want the config to be saved ASAP, in-case a new ManiaPlayfield is instantiated - scrollTime = maniaConfig.GetBindable(ManiaSetting.ScrollTime); - scrollTime.ValueChanged += v => maniaConfig.Save(); } internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement) From 92df704fbd235f4637f6f31888f8bba1c9faebe8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 25 Jan 2018 21:37:38 +0900 Subject: [PATCH 502/628] Fix up taiko not having any important frames --- .../Replays/TaikoAutoGenerator.cs | 14 +++++++------- .../Replays/TaikoReplayFrame.cs | 17 +++++++++++++++++ .../osu.Game.Rulesets.Taiko.csproj | 1 + 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 osu.Game.Rulesets.Taiko/Replays/TaikoReplayFrame.cs diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs index c1fe2c13a8..002159439d 100644 --- a/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoAutoGenerator.cs @@ -35,8 +35,8 @@ namespace osu.Game.Rulesets.Taiko.Replays { bool hitButton = true; - Frames.Add(new ReplayFrame(-100000, null, null, ReplayButtonState.None)); - Frames.Add(new ReplayFrame(Beatmap.HitObjects[0].StartTime - 1000, null, null, ReplayButtonState.None)); + Frames.Add(new TaikoReplayFrame(-100000, ReplayButtonState.None)); + Frames.Add(new TaikoReplayFrame(Beatmap.HitObjects[0].StartTime - 1000, ReplayButtonState.None)); for (int i = 0; i < Beatmap.HitObjects.Count; i++) { @@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Taiko.Replays break; } - Frames.Add(new ReplayFrame(j, null, null, button)); + Frames.Add(new TaikoReplayFrame(j, button)); d = (d + 1) % 4; if (++count == req) break; @@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Taiko.Replays { foreach (var tick in drumRoll.NestedHitObjects.OfType()) { - Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Right1 : ReplayButtonState.Right2)); + Frames.Add(new TaikoReplayFrame(tick.StartTime, hitButton ? ReplayButtonState.Right1 : ReplayButtonState.Right2)); hitButton = !hitButton; } } @@ -107,18 +107,18 @@ namespace osu.Game.Rulesets.Taiko.Replays button = hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2; } - Frames.Add(new ReplayFrame(h.StartTime, null, null, button)); + Frames.Add(new TaikoReplayFrame(h.StartTime, button)); } else throw new InvalidOperationException("Unknown hit object type."); - Frames.Add(new ReplayFrame(endTime + KEY_UP_DELAY, null, null, ReplayButtonState.None)); + Frames.Add(new TaikoReplayFrame(endTime + KEY_UP_DELAY, ReplayButtonState.None)); if (i < Beatmap.HitObjects.Count - 1) { double waitTime = Beatmap.HitObjects[i + 1].StartTime - 1000; if (waitTime > endTime) - Frames.Add(new ReplayFrame(waitTime, null, null, ReplayButtonState.None)); + Frames.Add(new TaikoReplayFrame(waitTime, ReplayButtonState.None)); } hitButton = !hitButton; diff --git a/osu.Game.Rulesets.Taiko/Replays/TaikoReplayFrame.cs b/osu.Game.Rulesets.Taiko/Replays/TaikoReplayFrame.cs new file mode 100644 index 0000000000..0c60cdc109 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Replays/TaikoReplayFrame.cs @@ -0,0 +1,17 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Replays; + +namespace osu.Game.Rulesets.Taiko.Replays +{ + public class TaikoReplayFrame : ReplayFrame + { + public override bool IsImportant => MouseLeft || MouseRight; + + public TaikoReplayFrame(double time, ReplayButtonState buttons) + : base(time, null, null, buttons) + { + } + } +} diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 36ac9384cf..7fb764fd0b 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -91,6 +91,7 @@ + From 03154dbc6307f9ea9ac8f1fbb2cb19b15ab94432 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 Jan 2018 23:41:03 +0900 Subject: [PATCH 503/628] Fix incorrect initial migration Also adds variant to settings --- .../Configuration/ManiaConfigManager.cs | 4 ++-- osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs | 10 ++++------ osu.Game/Configuration/DatabasedConfigManager.cs | 4 ++-- osu.Game/Configuration/DatabasedSetting.cs | 2 ++ osu.Game/Configuration/SettingsStore.cs | 4 ++-- osu.Game/Database/OsuDbContext.cs | 2 +- ...signer.cs => 20180125143340_Settings.Designer.cs} | 12 +++++++----- ...000_AddSettings.cs => 20180125143340_Settings.cs} | 11 ++++++----- osu.Game/Migrations/OsuDbContextModelSnapshot.cs | 8 +++++--- .../Rulesets/Configuration/RulesetConfigManager.cs | 2 +- osu.Game/Rulesets/UI/RulesetContainer.cs | 5 +++++ osu.Game/osu.Game.csproj | 6 +++--- 12 files changed, 40 insertions(+), 30 deletions(-) rename osu.Game/Migrations/{20180124024000_AddSettings.Designer.cs => 20180125143340_Settings.Designer.cs} (94%) rename osu.Game/Migrations/{20180124024000_AddSettings.cs => 20180125143340_Settings.cs} (80%) diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs index 3167d8300d..a4de360870 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaConfigManager.cs @@ -9,8 +9,8 @@ namespace osu.Game.Rulesets.Mania.Configuration { public class ManiaConfigManager : RulesetConfigManager { - public ManiaConfigManager(RulesetInfo ruleset, SettingsStore settings) - : base(ruleset, settings) + public ManiaConfigManager(SettingsStore settings, RulesetInfo ruleset, int variant) + : base(settings, ruleset, variant) { } diff --git a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs index f517d6b041..436d5c1ea6 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaRulesetContainer.cs @@ -80,11 +80,9 @@ namespace osu.Game.Rulesets.Mania.UI public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor(this); - public override PassThroughInputManager CreateInputManager() - { - var variantType = Mods.OfType().FirstOrDefault()?.PlayfieldType ?? PlayfieldType.Single; - return new ManiaInputManager(Ruleset.RulesetInfo, (int)variantType + Beatmap.TotalColumns); - } + public override int Variant => (int)(Mods.OfType().FirstOrDefault()?.PlayfieldType ?? PlayfieldType.Single) + Beatmap.TotalColumns; + + public override PassThroughInputManager CreateInputManager() => new ManiaInputManager(Ruleset.RulesetInfo, Variant); protected override BeatmapConverter CreateBeatmapConverter() => new ManiaBeatmapConverter(IsForCurrentRuleset, WorkingBeatmap.Beatmap); @@ -107,6 +105,6 @@ namespace osu.Game.Rulesets.Mania.UI protected override FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new ManiaFramedReplayInputHandler(replay, this); - protected override IRulesetConfigManager CreateConfig(Ruleset ruleset, SettingsStore settings) => new ManiaConfigManager(Ruleset.RulesetInfo, settings); + protected override IRulesetConfigManager CreateConfig(Ruleset ruleset, SettingsStore settings) => new ManiaConfigManager(settings, Ruleset.RulesetInfo, Variant); } } diff --git a/osu.Game/Configuration/DatabasedConfigManager.cs b/osu.Game/Configuration/DatabasedConfigManager.cs index f982490523..5505f3d31b 100644 --- a/osu.Game/Configuration/DatabasedConfigManager.cs +++ b/osu.Game/Configuration/DatabasedConfigManager.cs @@ -17,12 +17,12 @@ namespace osu.Game.Configuration private readonly RulesetInfo ruleset; - protected DatabasedConfigManager(SettingsStore settings, RulesetInfo ruleset = null) + protected DatabasedConfigManager(SettingsStore settings, RulesetInfo ruleset = null, int variant = 0) { this.settings = settings; this.ruleset = ruleset; - databasedSettings = settings.Query(ruleset?.ID); + databasedSettings = settings.Query(ruleset?.ID, variant); InitialiseDefaults(); } diff --git a/osu.Game/Configuration/DatabasedSetting.cs b/osu.Game/Configuration/DatabasedSetting.cs index c284c10872..7c2f65c854 100644 --- a/osu.Game/Configuration/DatabasedSetting.cs +++ b/osu.Game/Configuration/DatabasedSetting.cs @@ -14,6 +14,8 @@ namespace osu.Game.Configuration public int? RulesetID { get; set; } + public int? Variant { get; set; } + [Column("Key")] public int IntKey { diff --git a/osu.Game/Configuration/SettingsStore.cs b/osu.Game/Configuration/SettingsStore.cs index 6bb186604f..536b4f5786 100644 --- a/osu.Game/Configuration/SettingsStore.cs +++ b/osu.Game/Configuration/SettingsStore.cs @@ -23,8 +23,8 @@ namespace osu.Game.Configuration /// The ruleset's internal ID. /// An optional variant. /// - public List Query(int? rulesetId = null) => - GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId).ToList(); + public List Query(int? rulesetId = null, int? variant = null) => + GetContext().DatabasedSetting.Where(b => b.RulesetID == rulesetId && b.Variant == variant).ToList(); public void Update(DatabasedSetting setting) { diff --git a/osu.Game/Database/OsuDbContext.cs b/osu.Game/Database/OsuDbContext.cs index be0b4f3543..0fa1f238a9 100644 --- a/osu.Game/Database/OsuDbContext.cs +++ b/osu.Game/Database/OsuDbContext.cs @@ -91,7 +91,7 @@ namespace osu.Game.Database modelBuilder.Entity().HasIndex(b => new { b.RulesetID, b.Variant }); modelBuilder.Entity().HasIndex(b => b.IntAction); - modelBuilder.Entity().HasIndex(b => b.RulesetID); + modelBuilder.Entity().HasIndex(b => new { b.RulesetID, b.Variant }); modelBuilder.Entity().HasIndex(b => b.Hash).IsUnique(); modelBuilder.Entity().HasIndex(b => b.ReferenceCount); diff --git a/osu.Game/Migrations/20180124024000_AddSettings.Designer.cs b/osu.Game/Migrations/20180125143340_Settings.Designer.cs similarity index 94% rename from osu.Game/Migrations/20180124024000_AddSettings.Designer.cs rename to osu.Game/Migrations/20180125143340_Settings.Designer.cs index 5bbf382f7f..8e045abc6f 100644 --- a/osu.Game/Migrations/20180124024000_AddSettings.Designer.cs +++ b/osu.Game/Migrations/20180125143340_Settings.Designer.cs @@ -10,8 +10,8 @@ using System; namespace osu.Game.Migrations { [DbContext(typeof(OsuDbContext))] - [Migration("20180124024000_AddSettings")] - partial class AddSettings + [Migration("20180125143340_Settings")] + partial class Settings { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -202,14 +202,16 @@ namespace osu.Game.Migrations b.Property("IntKey") .HasColumnName("Key"); - b.Property("IntValue") + b.Property("RulesetID"); + + b.Property("StringValue") .HasColumnName("Value"); - b.Property("RulesetID"); + b.Property("Variant"); b.HasKey("ID"); - b.HasIndex("RulesetID"); + b.HasIndex("RulesetID", "Variant"); b.ToTable("Settings"); }); diff --git a/osu.Game/Migrations/20180124024000_AddSettings.cs b/osu.Game/Migrations/20180125143340_Settings.cs similarity index 80% rename from osu.Game/Migrations/20180124024000_AddSettings.cs rename to osu.Game/Migrations/20180125143340_Settings.cs index 63cacc0645..86a6b2dc5e 100644 --- a/osu.Game/Migrations/20180124024000_AddSettings.cs +++ b/osu.Game/Migrations/20180125143340_Settings.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace osu.Game.Migrations { - public partial class AddSettings : Migration + public partial class Settings : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -19,8 +19,9 @@ namespace osu.Game.Migrations ID = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Key = table.Column(type: "INTEGER", nullable: false), - Value = table.Column(type: "INTEGER", nullable: false), - RulesetID = table.Column(type: "INTEGER", nullable: true) + RulesetID = table.Column(type: "INTEGER", nullable: true), + Value = table.Column(type: "TEXT", nullable: true), + Variant = table.Column(type: "INTEGER", nullable: true) }, constraints: table => { @@ -33,9 +34,9 @@ namespace osu.Game.Migrations columns: new[] { "RulesetID", "Variant" }); migrationBuilder.CreateIndex( - name: "IX_Settings_RulesetID", + name: "IX_Settings_RulesetID_Variant", table: "Settings", - column: "RulesetID"); + columns: new[] { "RulesetID", "Variant" }); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs index 37e2aee3a0..157125102f 100644 --- a/osu.Game/Migrations/OsuDbContextModelSnapshot.cs +++ b/osu.Game/Migrations/OsuDbContextModelSnapshot.cs @@ -201,14 +201,16 @@ namespace osu.Game.Migrations b.Property("IntKey") .HasColumnName("Key"); - b.Property("IntValue") + b.Property("RulesetID"); + + b.Property("StringValue") .HasColumnName("Value"); - b.Property("RulesetID"); + b.Property("Variant"); b.HasKey("ID"); - b.HasIndex("RulesetID"); + b.HasIndex("RulesetID", "Variant"); b.ToTable("Settings"); }); diff --git a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs index 4f9fbe9830..9f244f6267 100644 --- a/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs +++ b/osu.Game/Rulesets/Configuration/RulesetConfigManager.cs @@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Configuration public abstract class RulesetConfigManager : DatabasedConfigManager, IRulesetConfigManager where T : struct { - protected RulesetConfigManager(RulesetInfo ruleset, SettingsStore settings) : base(settings, ruleset) + protected RulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int variant) : base(settings, ruleset, variant) { } } diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 08498d48c6..8f72644b28 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -38,6 +38,11 @@ namespace osu.Game.Rulesets.UI /// public bool AspectAdjust = true; + /// + /// The selected variant. + /// + public virtual int Variant => 0; + /// /// The input manager for this RulesetContainer. /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 2a09521727..7f88f65a24 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -272,9 +272,9 @@ - - - 20180124024000_AddSettings.cs + + + 20180125143340_Settings.cs From b04e2cbb5c4f03fc30a201a916245cb856dc135f Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Fri, 26 Jan 2018 03:39:19 +0800 Subject: [PATCH 504/628] Fix osu star rating calculation The main bug was that the beatmap was not being processed prior to having its Skill values calculated, causing stacking to be ignored in difficulty calculation. The fix involves processing the beatmap with OsuBeatmapProcessor. Another minor bug was that sliders were not taking into account the stacked position midway through the slider (PositionAt does not return stacked position.), so I corrected by adding StackOffset. --- osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs | 3 +-- .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 2 +- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs index 70cfbebfff..fb5acbb643 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/OsuDifficultyCalculator.cs @@ -29,8 +29,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty protected override void PreprocessHitObjects() { - foreach (OsuHitObject h in Beatmap.HitObjects) - (h as Slider)?.Curve?.Calculate(); + new OsuBeatmapProcessor().PostProcess(Beatmap); } public override double Calculate(Dictionary categoryDifficulty = null) diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 4f950353dc..a1c4a8a466 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing var computeVertex = new Action(t => { // ReSharper disable once PossibleInvalidOperationException (bugged in current r# version) - var diff = slider.PositionAt(t) - slider.LazyEndPosition.Value; + var diff = slider.PositionAt(t) + slider.StackOffset - slider.LazyEndPosition.Value; float dist = diff.Length; if (dist > approxFollowCircleRadius) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index 798268d05f..c8cc831a35 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { - protected readonly Beatmap Beatmap; + protected Beatmap Beatmap; protected readonly Mod[] Mods; protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) From 469b13441b70b408e03f8c372e9888794d436525 Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Fri, 26 Jan 2018 04:02:35 +0800 Subject: [PATCH 505/628] Fix mistake --- osu.Game/Beatmaps/DifficultyCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/DifficultyCalculator.cs b/osu.Game/Beatmaps/DifficultyCalculator.cs index c8cc831a35..798268d05f 100644 --- a/osu.Game/Beatmaps/DifficultyCalculator.cs +++ b/osu.Game/Beatmaps/DifficultyCalculator.cs @@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps public abstract class DifficultyCalculator : DifficultyCalculator where T : HitObject { - protected Beatmap Beatmap; + protected readonly Beatmap Beatmap; protected readonly Mod[] Mods; protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null) From 3b9318e894e206d436bbb8d9a124431b8fe7a8ae Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2018 07:39:03 +0900 Subject: [PATCH 506/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8c8d8242a8..332d133a66 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8c8d8242a8ae78ba272e5e7e89fb7662fca9a1e9 +Subproject commit 332d133a667b2a4d628d08878967e26bc5aae441 From 7a2420ead273a65707e162409b6b6ed46f099ebd Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2018 08:21:09 +0900 Subject: [PATCH 507/628] Fix a couple of regressions --- osu.Game/Configuration/DatabasedConfigManager.cs | 6 +++++- osu.Game/Configuration/SettingsStore.cs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game/Configuration/DatabasedConfigManager.cs b/osu.Game/Configuration/DatabasedConfigManager.cs index 5505f3d31b..7d045ff6d4 100644 --- a/osu.Game/Configuration/DatabasedConfigManager.cs +++ b/osu.Game/Configuration/DatabasedConfigManager.cs @@ -13,6 +13,8 @@ namespace osu.Game.Configuration { private readonly SettingsStore settings; + private int variant; + private readonly List databasedSettings; private readonly RulesetInfo ruleset; @@ -21,6 +23,7 @@ namespace osu.Game.Configuration { this.settings = settings; this.ruleset = ruleset; + this.variant = variant; databasedSettings = settings.Query(ruleset?.ID, variant); @@ -51,7 +54,8 @@ namespace osu.Game.Configuration { Key = lookup, Value = bindable.Value, - RulesetID = ruleset?.ID + RulesetID = ruleset?.ID, + Variant = variant, }); databasedSettings.Add(setting); diff --git a/osu.Game/Configuration/SettingsStore.cs b/osu.Game/Configuration/SettingsStore.cs index 536b4f5786..9b18151c84 100644 --- a/osu.Game/Configuration/SettingsStore.cs +++ b/osu.Game/Configuration/SettingsStore.cs @@ -30,9 +30,12 @@ namespace osu.Game.Configuration { var context = GetContext(); + var newValue = setting.Value; + Refresh(ref setting); - setting.Value = setting.Value; + setting.Value = newValue; + context.SaveChanges(); SettingChanged?.Invoke(); From 0a505dde2e73b89ffeb259090e6e2d577a3c80d4 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 26 Jan 2018 14:47:16 +0900 Subject: [PATCH 508/628] Remove MaskingAffectsInput override --- osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index e4f8124bce..2db02724ed 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -71,8 +71,6 @@ namespace osu.Game.Rulesets.Objects.Drawables public override bool HandleKeyboardInput => Interactive; public override bool HandleMouseInput => Interactive; - public override bool MaskingAffectsInput => false; - public override bool RemoveWhenNotAlive => false; public override bool RemoveCompletedTransforms => false; protected override bool RequiresChildrenUpdate => true; From db58e4dbfed992ba503727077b994784de30866f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2018 15:02:55 +0900 Subject: [PATCH 509/628] Update framework again --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 332d133a66..209021fb49 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 332d133a667b2a4d628d08878967e26bc5aae441 +Subproject commit 209021fb491e21625127be5dbf5efb4c409e6f06 From 81c759f1e1f6ad1e21bf6c224fca15817af2cf54 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Fri, 26 Jan 2018 15:17:56 +0900 Subject: [PATCH 510/628] Make field readonly --- osu.Game/Configuration/DatabasedConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Configuration/DatabasedConfigManager.cs b/osu.Game/Configuration/DatabasedConfigManager.cs index 7d045ff6d4..1f7a84c6d3 100644 --- a/osu.Game/Configuration/DatabasedConfigManager.cs +++ b/osu.Game/Configuration/DatabasedConfigManager.cs @@ -13,7 +13,7 @@ namespace osu.Game.Configuration { private readonly SettingsStore settings; - private int variant; + private readonly int variant; private readonly List databasedSettings; From 1ab2a4075f7bd25fbdc87c1365e142a8935a75ef Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 26 Jan 2018 15:39:37 +0900 Subject: [PATCH 511/628] Update resources --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 7724abdf1d..266965f0d7 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 +Subproject commit 266965f0d795b94a126e2da302bd2c10eadd642a From 7852015db32daf8c1ebf54413c7393e3781ae60f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 26 Jan 2018 19:30:29 +0900 Subject: [PATCH 512/628] Remember mod selection when re-entering song select Removes mod application when exiting back to main menu. Alternative to #1968. Closes #1961. --- osu.Game/OsuGame.cs | 5 ++ osu.Game/Overlays/Mods/ModButton.cs | 16 +++--- osu.Game/Overlays/Mods/ModSection.cs | 17 +++++++ osu.Game/Overlays/Mods/ModSelectOverlay.cs | 59 +++++++++++++--------- osu.Game/Screens/Select/PlaySongSelect.cs | 9 +++- 5 files changed, 74 insertions(+), 32 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 034b857e02..7e50f84089 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.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 osu.Framework.Configuration; using osu.Framework.Screens; using osu.Game.Configuration; @@ -27,6 +28,7 @@ using osu.Game.Overlays.Notifications; using osu.Game.Rulesets; using osu.Game.Screens.Play; using osu.Game.Input.Bindings; +using osu.Game.Rulesets.Mods; using OpenTK.Graphics; namespace osu.Game @@ -80,6 +82,9 @@ namespace osu.Game private SettingsOverlay settings; + // todo: move this to SongSelect once Screen has the ability to unsuspend. + public readonly Bindable> SelectedMods = new Bindable>(new List()); + public OsuGame(string[] args = null) { this.args = args; diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index 80823c56bf..91063bfa38 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -188,17 +188,19 @@ namespace osu.Game.Overlays.Mods start = Mods.Length - 1; for (int i = start; i < Mods.Length && i >= 0; i += direction) - { - if (Mods[i].HasImplementation) - { - changeSelectedIndex(i); - return; - } - } + if (SelectAt(i)) return; Deselect(); } + public bool SelectAt(int index) + { + if (!Mods[index].HasImplementation) return false; + + changeSelectedIndex(index); + return true; + } + public void Deselect() => changeSelectedIndex(-1); private void displayMod(Mod mod) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index a43c54f994..03c1f0468c 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -113,6 +113,23 @@ namespace osu.Game.Overlays.Mods } } + /// + /// Select one or more mods in this section. + /// + /// The types of s which should be deselected. + public void SelectTypes(IEnumerable mods) + { + foreach (var button in buttons) + { + for (int i = 0; i < button.Mods.Length; i++) + { + foreach (var mod in mods) + if (mod.GetType().IsInstanceOfType(button.Mods[i])) + button.SelectAt(i); + } + } + } + protected ModSection() { AutoSizeAxes = Axes.Y; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 96faa376ba..d7268fb186 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -51,6 +51,8 @@ namespace osu.Game.Overlays.Mods [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuColour colours, OsuGame osu, RulesetStore rulesets) { + SelectedMods.ValueChanged += selectedModsChanged; + LowMultiplierColour = colours.Red; HighMultiplierColour = colours.Green; @@ -63,6 +65,37 @@ namespace osu.Game.Overlays.Mods Ruleset.TriggerChange(); } + private void selectedModsChanged(IEnumerable obj) + { + foreach (ModSection section in ModSectionsContainer.Children) + section.SelectTypes(obj); + + updateMods(); + } + + private void updateMods() + { + double multiplier = 1.0; + bool ranked = true; + + foreach (Mod mod in SelectedMods.Value) + { + multiplier *= mod.ScoreMultiplier; + ranked &= mod.Ranked; + } + + MultiplierLabel.Text = $"{multiplier:N2}x"; + if (!ranked) + MultiplierLabel.Text += " (Unranked)"; + + if (multiplier > 1.0) + MultiplierLabel.FadeColour(HighMultiplierColour, 200); + else if (multiplier < 1.0) + MultiplierLabel.FadeColour(LowMultiplierColour, 200); + else + MultiplierLabel.FadeColour(Color4.White, 200); + } + protected override void PopOut() { base.PopOut(); @@ -97,6 +130,7 @@ namespace osu.Game.Overlays.Mods { foreach (ModSection section in ModSectionsContainer.Children) section.DeselectAll(); + refreshSelectedMods(); } @@ -119,30 +153,7 @@ namespace osu.Game.Overlays.Mods refreshSelectedMods(); } - private void refreshSelectedMods() - { - SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); - - double multiplier = 1.0; - bool ranked = true; - - foreach (Mod mod in SelectedMods.Value) - { - multiplier *= mod.ScoreMultiplier; - ranked &= mod.Ranked; - } - - MultiplierLabel.Text = $"{multiplier:N2}x"; - if (!ranked) - MultiplierLabel.Text += " (Unranked)"; - - if (multiplier > 1.0) - MultiplierLabel.FadeColour(HighMultiplierColour, 200); - else if (multiplier < 1.0) - MultiplierLabel.FadeColour(LowMultiplierColour, 200); - else - MultiplierLabel.FadeColour(Color4.White, 200); - } + private void refreshSelectedMods() => SelectedMods.Value = ModSectionsContainer.Children.SelectMany(s => s.SelectedMods).ToArray(); public ModSelectOverlay() { diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 6fdd38ce30..739bc39269 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -13,6 +13,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Overlays; using osu.Game.Overlays.Mods; +using osu.Game.Rulesets.Mods; using osu.Game.Screens.Edit; using osu.Game.Screens.Play; using osu.Game.Screens.Ranking; @@ -47,10 +48,13 @@ namespace osu.Game.Screens.Select private SampleChannel sampleConfirm; [BackgroundDependencyLoader(true)] - private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay) + private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, OsuGame game) { sampleConfirm = audio.Sample.Get(@"SongSelect/confirm-selection"); + if (game != null) + modSelect.SelectedMods.BindTo(game.SelectedMods); + Footer.AddButton(@"mods", colours.Yellow, modSelect, Key.F1, float.MaxValue); BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1); @@ -121,6 +125,9 @@ namespace osu.Game.Screens.Select if (Beatmap.Value.Track != null) Beatmap.Value.Track.Looping = false; + Beatmap.Value.Mods.UnbindBindings(); + Beatmap.Value.Mods.Value = new Mod[] { }; + return false; } From 8f0ab2040f30f6328851227e780ded1ca07ec889 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 26 Jan 2018 12:46:28 +0100 Subject: [PATCH 513/628] Add Jetbrains.Annotations NuGet package --- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 4 ++++ osu.Game.Rulesets.Catch/packages.config | 1 + osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 4 ++++ osu.Game.Rulesets.Mania/packages.config | 1 + osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 4 ++++ osu.Game.Rulesets.Osu/packages.config | 1 + osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 4 ++++ osu.Game.Rulesets.Taiko/packages.config | 1 + osu.Game.Tests/osu.Game.Tests.csproj | 4 ++++ osu.Game.Tests/packages.config | 1 + osu.Game/osu.Game.csproj | 4 ++++ osu.Game/packages.config | 1 + 12 files changed, 30 insertions(+) diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 5f08048bf9..cdce598ce8 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -32,6 +32,10 @@ false + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config index b39a85a382..e67d3e9b34 100644 --- a/osu.Game.Rulesets.Catch/packages.config +++ b/osu.Game.Rulesets.Catch/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index 9b6b546b5f..b9e7f8e60f 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -32,6 +32,10 @@ false + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config index b39a85a382..e67d3e9b34 100644 --- a/osu.Game.Rulesets.Mania/packages.config +++ b/osu.Game.Rulesets.Mania/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index a59d4607df..74a3883f0a 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -33,6 +33,10 @@ false + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config index b39a85a382..e67d3e9b34 100644 --- a/osu.Game.Rulesets.Osu/packages.config +++ b/osu.Game.Rulesets.Osu/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 36ac9384cf..90256c7d63 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -32,6 +32,10 @@ false + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config index b39a85a382..e67d3e9b34 100644 --- a/osu.Game.Rulesets.Taiko/packages.config +++ b/osu.Game.Rulesets.Taiko/packages.config @@ -1,5 +1,6 @@  + \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 059adc6d55..d30241fae4 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -33,6 +33,10 @@ $(SolutionDir)\packages\DeepEqual.1.6.0.0\lib\net40\DeepEqual.dll + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll True diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index 62ddb99609..71c79cd26e 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -5,6 +5,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste --> + diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7f88f65a24..12ca9e5de7 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -91,6 +91,10 @@ $(SolutionDir)\packages\Humanizer.Core.2.2.0\lib\netstandard1.0\Humanizer.dll + + $(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll + True + $(SolutionDir)\packages\Microsoft.Data.Sqlite.Core.2.0.0\lib\netstandard2.0\Microsoft.Data.Sqlite.dll diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 2938739eef..0216c8ae67 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -47,6 +47,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste + From cff3f25cd7d41ea06e2f9067c1cabeab85510e0f Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 26 Jan 2018 12:46:58 +0100 Subject: [PATCH 514/628] make all line endings CR LF (windows style) --- osu.Game.Tests/packages.config | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index 71c79cd26e..c16d10bf45 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -1,12 +1,12 @@ - - - - - - - - + + + + + + + + \ No newline at end of file From d82835107cda01d62dc9147d151f2e7303fbb19a Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 26 Jan 2018 22:20:24 +0300 Subject: [PATCH 515/628] Remove autohide and clock related logic from Visual settings overlay --- osu.Game/Screens/Play/HUDOverlay.cs | 5 +- .../PlayerSettings/PlayerSettingsGroup.cs | 12 ++-- .../Play/PlayerSettings/VisualSettings.cs | 55 ------------------- 3 files changed, 8 insertions(+), 64 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index cdb9c2383d..e68a17f014 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -119,13 +119,12 @@ namespace osu.Game.Screens.Play if (loaded) { - PlayerSettingsOverlay.PlaybackSettings.Show(); + PlayerSettingsOverlay.Show(); ModDisplay.FadeIn(200); } else { - PlayerSettingsOverlay.PlaybackSettings.Hide(); - PlayerSettingsOverlay.VisualSettings.Autohide = true; + PlayerSettingsOverlay.Hide(); ModDisplay.Delay(2000).FadeOut(200); } } diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs index 005e97bd94..e8a4bc6b27 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSettingsGroup.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.PlayerSettings private readonly FillFlowContainer content; private readonly IconButton button; - protected bool Expanded = true; + private bool expanded = true; private Color4 buttonActiveColour; @@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.PlayerSettings Position = new Vector2(-15, 0), Icon = FontAwesome.fa_bars, Scale = new Vector2(0.75f), - Action = ToggleContentVisibility, + Action = toggleContentVisibility, }, } }, @@ -112,13 +112,13 @@ namespace osu.Game.Screens.Play.PlayerSettings protected override Container Content => content; - protected virtual void ToggleContentVisibility() + private void toggleContentVisibility() { content.ClearTransforms(); - Expanded = !Expanded; + expanded = !expanded; - if (Expanded) + if (expanded) content.AutoSizeAxes = Axes.Y; else { @@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play.PlayerSettings content.ResizeHeightTo(0, transition_duration, Easing.OutQuint); } - button.FadeColour(Expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); + button.FadeColour(expanded ? buttonActiveColour : Color4.White, 200, Easing.OutQuint); } } } diff --git a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs index fe8518c6a2..1a7b80ec9a 100644 --- a/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/VisualSettings.cs @@ -1,11 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Timing; using osu.Game.Configuration; using osu.Game.Graphics.Sprites; @@ -15,30 +12,6 @@ namespace osu.Game.Screens.Play.PlayerSettings { protected override string Title => "Visual settings"; - public IAdjustableClock AudioClock { get; set; } - public FramedClock FramedClock { get; set; } - - private bool autohide; - - public bool Autohide - { - get => autohide; - set - { - autohide = value; - if (autohide && hideStopWatch == null) - hideStopWatch = Stopwatch.StartNew(); - else if (!autohide) - { - this.FadeIn(50); - hideStopWatch = null; - } - } - } - - private readonly TimeSpan hideTimeSpan = TimeSpan.FromSeconds(3); - private Stopwatch hideStopWatch; - private readonly PlayerSliderBar dimSliderBar; private readonly PlayerSliderBar blurSliderBar; private readonly PlayerCheckbox showStoryboardToggle; @@ -74,34 +47,6 @@ namespace osu.Game.Screens.Play.PlayerSettings blurSliderBar.Bindable = config.GetBindable(OsuSetting.BlurLevel); showStoryboardToggle.Bindable = config.GetBindable(OsuSetting.ShowStoryboard); mouseWheelDisabledToggle.Bindable = config.GetBindable(OsuSetting.MouseDisableWheel); - - ToggleContentVisibility(); - } - - protected override void ToggleContentVisibility() - { - base.ToggleContentVisibility(); - if (!Autohide) - return; - if (Expanded) - { - AudioClock.Stop(); - FramedClock.ProcessSourceClockFrames = false; - hideStopWatch.Stop(); - } - else - { - AudioClock.Start(); - FramedClock.ProcessSourceClockFrames = true; - hideStopWatch.Start(); - } - } - - protected override void Update() - { - base.Update(); - - if (Autohide && IsPresent && hideStopWatch.Elapsed > hideTimeSpan) this.FadeOut(50); } } } From ce4122b3c4240718d47f1bf87504ffd7381971be Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Fri, 26 Jan 2018 23:29:54 +0300 Subject: [PATCH 516/628] Display visual settings overlay on PlayerLoader screen --- osu.Game/Screens/Play/PlayerLoader.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index cf6c252bec..2950990779 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -13,6 +13,7 @@ using osu.Game.Screens.Backgrounds; using OpenTK; using osu.Framework.Localisation; using osu.Game.Screens.Menu; +using osu.Game.Screens.Play.PlayerSettings; namespace osu.Game.Screens.Play { @@ -21,6 +22,7 @@ namespace osu.Game.Screens.Play private Player player; private BeatmapMetadataDisplay info; + private VisualSettings visualSettings; private bool showOverlays = true; public override bool ShowOverlaysOnEnter => showOverlays; @@ -49,6 +51,12 @@ namespace osu.Game.Screens.Play Anchor = Anchor.Centre, Origin = Anchor.Centre, }); + Add(visualSettings = new VisualSettings + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + Margin = new MarginPadding(25) + }); LoadComponentAsync(player); } @@ -110,7 +118,7 @@ namespace osu.Game.Screens.Play private void pushWhenLoaded() { - if (player.LoadState != LoadState.Ready) + if (player.LoadState != LoadState.Ready || visualSettings.IsHovered) { Schedule(pushWhenLoaded); return; From 247833174cd567e75f3d703e029059fa9a6b0676 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 27 Jan 2018 23:20:49 +0900 Subject: [PATCH 517/628] Fix incorrect case on migration file --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 7f88f65a24..8be79e8279 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -273,7 +273,7 @@ - + 20180125143340_Settings.cs From b789db3a1e645c7c72dc20209932df606d99a60f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 13:53:35 +0900 Subject: [PATCH 518/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 209021fb49..9c4b79ed97 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 209021fb491e21625127be5dbf5efb4c409e6f06 +Subproject commit 9c4b79ed97eb89dc163cca837e197bfbf41400e3 From fc11cac5a0362f5a4cf630c079a41d26ed6aadeb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 15:03:19 +0900 Subject: [PATCH 519/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 9c4b79ed97..2610a31337 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 9c4b79ed97eb89dc163cca837e197bfbf41400e3 +Subproject commit 2610a3133721b0bc4af852342aa2a179d0e66497 From 6e0cb1adb3ad0b0d153118e9c048d24ce7066099 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 15:05:07 +0900 Subject: [PATCH 520/628] Remove redundant arguments --- osu.Game/OsuGame.cs | 2 +- osu.Game/OsuGameBase.cs | 2 +- osu.Game/Screens/Select/SongSelect.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 034b857e02..d1555c7270 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -111,7 +111,7 @@ namespace osu.Game Task.Run(() => BeatmapManager.Import(paths.ToArray())); } - dependencies.CacheAs(this); + dependencies.CacheAs(this); configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index d0b9634696..794e829e7b 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -95,7 +95,7 @@ namespace osu.Game dependencies.Cache(new LargeTextureStore(new RawTextureLoaderStore(new NamespacedResourceStore(Resources, @"Textures")))); - dependencies.CacheAs(this); + dependencies.CacheAs(this); dependencies.Cache(LocalConfig); runMigrations(); diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 79f00cc988..2421a4fdfe 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -181,7 +181,7 @@ namespace osu.Game.Screens.Select [BackgroundDependencyLoader(permitNulls: true)] private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours) { - dependencies.CacheAs(this); + dependencies.CacheAs(this); if (Footer != null) { From c36859ea3a4a7b098229b201635fce4f26d92558 Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Mon, 29 Jan 2018 16:22:14 +0800 Subject: [PATCH 521/628] Create Slider.StackedPositionAt method --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 1 + .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 79bb14a475..daf7409ad1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -23,6 +23,7 @@ namespace osu.Game.Rulesets.Osu.Objects public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity; public double Duration => EndTime - StartTime; + public Vector2 StackedPositionAt(double t) => this.PositionAt(t) + this.StackOffset; public override Vector2 EndPosition => this.PositionAt(1); public SliderCurve Curve { get; } = new SliderCurve(); diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index a1c4a8a466..7ee1bafd08 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing var computeVertex = new Action(t => { // ReSharper disable once PossibleInvalidOperationException (bugged in current r# version) - var diff = slider.PositionAt(t) + slider.StackOffset - slider.LazyEndPosition.Value; + var diff = slider.StackedPositionAt(t) - slider.LazyEndPosition.Value; float dist = diff.Length; if (dist > approxFollowCircleRadius) From 33c5fdcedb0ac324118aa4111a0e6856669c87f5 Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Mon, 29 Jan 2018 16:30:46 +0800 Subject: [PATCH 522/628] AppVeyor fix --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- .../OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index daf7409ad1..4fd3b55245 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Osu.Objects public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity; public double Duration => EndTime - StartTime; - public Vector2 StackedPositionAt(double t) => this.PositionAt(t) + this.StackOffset; + public Vector2 StackedPositionAt(double t) => this.PositionAt(t) + StackOffset; public override Vector2 EndPosition => this.PositionAt(1); public SliderCurve Curve { get; } = new SliderCurve(); diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs index 7ee1bafd08..c817cd0ff3 100644 --- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs +++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using osu.Game.Rulesets.Objects.Types; using OpenTK; using osu.Game.Rulesets.Osu.Objects; From df221b6786f04df96b57d35b0910b9ebfaa83309 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 17:45:23 +0900 Subject: [PATCH 523/628] Remove usage of ValueTuple to allow for dynamic recompilation --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 12 +++++++++ osu.Game/Online/Chat/MessageFormatter.cs | 32 ++++++++++++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 722e3c30f3..136a2fae89 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -10,7 +10,9 @@ using osu.Game.Online.Chat; using osu.Game.Overlays.Chat; using osu.Game.Users; using System; +using System.Collections.Generic; using System.Linq; +using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; namespace osu.Game.Tests.Visual @@ -20,6 +22,16 @@ namespace osu.Game.Tests.Visual private readonly TestChatLineContainer textContainer; private Color4 linkColour; + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ChatLine), + typeof(Message), + typeof(LinkFlowContainer), + typeof(DummyEchoMessage), + typeof(LocalEchoMessage), + typeof(MessageFormatter) + }; + public TestCaseChatLink() { Add(textContainer = new TestChatLineContainer diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 3a396a04c0..2c15f48f95 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -67,7 +67,7 @@ namespace osu.Game.Online.Chat result.Links.ForEach(l => l.Index -= l.Index > index ? m.Length - displayText.Length : 0); var details = getLinkDetails(linkText); - result.Links.Add(new Link(linkText, index, displayText.Length, linkActionOverride ?? details.linkType, details.linkArgument)); + result.Links.Add(new Link(linkText, index, displayText.Length, linkActionOverride ?? details.Action, details.Argument)); //adjust the offset for processing the current matches group. captureOffset += m.Length - displayText.Length; @@ -95,11 +95,11 @@ namespace osu.Game.Online.Chat } var details = getLinkDetails(link); - result.Links.Add(new Link(link, index, indexLength, details.linkType, details.linkArgument)); + result.Links.Add(new Link(link, index, indexLength, details.Action, details.Argument)); } } - private static (LinkAction linkType, string linkArgument) getLinkDetails(string url) + private static LinkDetails getLinkDetails(string url) { var args = url.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); args[0] = args[0].TrimEnd(':'); @@ -115,19 +115,19 @@ namespace osu.Game.Online.Chat { case "b": case "beatmaps": - return (LinkAction.OpenBeatmap, args[3]); + return new LinkDetails(LinkAction.OpenBeatmap, args[3]); case "s": case "beatmapsets": case "d": - return (LinkAction.OpenBeatmapSet, args[3]); + return new LinkDetails(LinkAction.OpenBeatmapSet, args[3]); } } - return (LinkAction.External, null); + return new LinkDetails(LinkAction.External, null); case "osu": // every internal link also needs some kind of argument if (args.Length < 3) - return (LinkAction.External, null); + return new LinkDetails(LinkAction.External, null); LinkAction linkType; switch (args[1]) @@ -153,11 +153,11 @@ namespace osu.Game.Online.Chat break; } - return (linkType, args[2]); + return new LinkDetails(linkType, args[2]); case "osump": - return (LinkAction.JoinMultiplayerMatch, args[1]); + return new LinkDetails(LinkAction.JoinMultiplayerMatch, args[1]); default: - return (LinkAction.External, null); + return new LinkDetails(LinkAction.External, null); } } @@ -215,6 +215,18 @@ namespace osu.Game.Online.Chat OriginalText = Text = text; } } + + public class LinkDetails + { + public LinkAction Action; + public string Argument; + + public LinkDetails(LinkAction action, string argument) + { + Action = action; + Argument = argument; + } + } } public enum LinkAction From c07a31a48495a3a832bbc07e0d98e2d4fefcf7ab Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 17:45:39 +0900 Subject: [PATCH 524/628] Add new (failing) tests --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 136a2fae89..74faa3f48f 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -86,7 +86,7 @@ namespace osu.Game.Tests.Visual var linkSprites = linkCompilers.SelectMany(comp => ((DrawableLinkCompiler)comp).Parts); return linkSprites.All(d => d.Colour == linkColour) - && newLine.ContentFlow.Except(linkSprites.Concat(linkCompilers)).All(d => d.Colour == textColour); + && newLine.ContentFlow.Except(linkSprites.Concat(linkCompilers)).All(d => d.Colour == textColour); } } @@ -102,9 +102,15 @@ namespace osu.Game.Tests.Visual addMessageWithChecks("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", 1, expectedActions: LinkAction.External); addMessageWithChecks("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmapSet); addMessageWithChecks("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmap); - addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/b/252238 multiple links] https://osu.ppy.sh/home", 3, expectedActions: new[] { LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External }); + addMessageWithChecks("Let's (try)[https://osu.ppy.sh/home] [https://osu.ppy.sh/b/252238 multiple links] https://osu.ppy.sh/home", 3, + expectedActions: new[] { LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External }); // note that there's 0 links here (they get removed if a channel is not found) addMessageWithChecks("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); + addMessageWithChecks("Join my multiplayer game osump://12346.", expectedActions: LinkAction.JoinMultiplayerMatch); + addMessageWithChecks("Join my [multiplayer game](osump://12346).", expectedActions: LinkAction.JoinMultiplayerMatch); + addMessageWithChecks("Join my [#english](osu://chan/english).", expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my osu://chan/english.", expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my #english.", expectedActions: LinkAction.OpenChannel); addMessageWithChecks("I am important!", 0, false, true); addMessageWithChecks("feels important", 0, true, true); addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true, expectedActions: LinkAction.External); From f996acd7e6b55dc0493f2c899dba16f49d651883 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 17:56:43 +0900 Subject: [PATCH 525/628] Add back old non-visual tests --- osu.Game.Tests/Chat/MessageFormatterTests.cs | 189 +++++++++++++++++++ osu.Game.Tests/osu.Game.Tests.csproj | 1 + 2 files changed, 190 insertions(+) create mode 100644 osu.Game.Tests/Chat/MessageFormatterTests.cs diff --git a/osu.Game.Tests/Chat/MessageFormatterTests.cs b/osu.Game.Tests/Chat/MessageFormatterTests.cs new file mode 100644 index 0000000000..0fc3054f44 --- /dev/null +++ b/osu.Game.Tests/Chat/MessageFormatterTests.cs @@ -0,0 +1,189 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using NUnit.Framework; +using osu.Game.Online.Chat; + +namespace osu.Game.Tests.Chat +{ + [TestFixture] + public class MessageFormatterTests + { + [Test] + public void TestBareLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a http://www.basic-link.com/?test=test." }); + + Assert.AreEqual("This is a http://www.basic-link.com/?test=test.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("http://www.basic-link.com/?test=test", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(36, result.Links[0].Length); + } + + [Test] + public void TestMultipleComplexLinks() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a http://test.io/link#fragment. (see https://twitter.com). Also, This string should not be altered. http://example.com/" }); + + Assert.AreEqual("This is a http://test.io/link#fragment. (see https://twitter.com). Also, This string should not be altered. http://example.com/", result.DisplayContent); + Assert.AreEqual(3, result.Links.Count); + + Assert.AreEqual("http://test.io/link#fragment", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(28, result.Links[0].Length); + + Assert.AreEqual("https://twitter.com", result.Links[1].Url); + Assert.AreEqual(45, result.Links[1].Index); + Assert.AreEqual(19, result.Links[1].Length); + + Assert.AreEqual("http://example.com/", result.Links[2].Url); + Assert.AreEqual(108, result.Links[2].Index); + Assert.AreEqual(19, result.Links[2].Length); + } + + [Test] + public void TestAjaxLinks() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "https://twitter.com/#!/hashbanglinks" }); + + Assert.AreEqual("https://twitter.com/#!/hashbanglinks", result.DisplayContent); + Assert.AreEqual(0, result.Links[0].Index); + Assert.AreEqual(36, result.Links[0].Length); + } + + [Test] + public void TestUnixHomeLinks() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "http://www.chiark.greenend.org.uk/~sgtatham/putty/" }); + + Assert.AreEqual("http://www.chiark.greenend.org.uk/~sgtatham/putty/", result.DisplayContent); + Assert.AreEqual(0, result.Links[0].Index); + Assert.AreEqual(50, result.Links[0].Length); + } + + [Test] + public void TestCaseInsensitiveLinks() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "look: http://puu.sh/7Ggh8xcC6/asf0asd9876.NEF" }); + + Assert.AreEqual("look: http://puu.sh/7Ggh8xcC6/asf0asd9876.NEF", result.DisplayContent); + Assert.AreEqual(6, result.Links[0].Index); + Assert.AreEqual(39, result.Links[0].Length); + } + + [Test] + public void TestWikiLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [[Wiki Link]]." }); + + Assert.AreEqual("This is a Wiki Link.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("https://osu.ppy.sh/wiki/Wiki Link", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(9, result.Links[0].Length); + } + + [Test] + public void TestMultiWikiLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [[Wiki Link]] [[Wiki:Link]][[Wiki.Link]]." }); + + Assert.AreEqual("This is a Wiki Link Wiki:LinkWiki.Link.", result.DisplayContent); + Assert.AreEqual(3, result.Links.Count); + + Assert.AreEqual("https://osu.ppy.sh/wiki/Wiki Link", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(9, result.Links[0].Length); + + Assert.AreEqual("https://osu.ppy.sh/wiki/Wiki:Link", result.Links[1].Url); + Assert.AreEqual(20, result.Links[1].Index); + Assert.AreEqual(9, result.Links[1].Length); + + Assert.AreEqual("https://osu.ppy.sh/wiki/Wiki.Link", result.Links[2].Url); + Assert.AreEqual(29, result.Links[2].Index); + Assert.AreEqual(9, result.Links[2].Length); + } + + [Test] + public void TestOldFormatLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a (simple test)[https://osu.ppy.sh]." }); + + Assert.AreEqual("This is a simple test.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("https://osu.ppy.sh", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(11, result.Links[0].Length); + } + + [Test] + public void TestNewFormatLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [https://osu.ppy.sh simple test]." }); + + Assert.AreEqual("This is a simple test.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("https://osu.ppy.sh", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(11, result.Links[0].Length); + } + + [Test] + public void TestRecursiveBreaking() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [https://osu.ppy.sh [[simple test]]]." }); + + Assert.AreEqual("This is a [[simple test]].", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("https://osu.ppy.sh", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(15, result.Links[0].Length); + } + + [Test] + public void TestLinkComplex() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [http://www.simple-test.com simple test] with some [traps] and [[wiki links]]. Don't forget to visit https://osu.ppy.sh (now!)[http://google.com]\uD83D\uDE12" }); + + Assert.AreEqual("This is a simple test with some [traps] and wiki links. Don't forget to visit https://osu.ppy.sh now!\0\0\0", result.DisplayContent); + Assert.AreEqual(5, result.Links.Count); + + Link f = result.Links.Find(l => l.Url == "https://osu.ppy.sh/wiki/wiki links"); + Assert.AreEqual(44, f.Index); + Assert.AreEqual(10, f.Length); + + f = result.Links.Find(l => l.Url == "http://www.simple-test.com"); + Assert.AreEqual(10, f.Index); + Assert.AreEqual(11, f.Length); + + f = result.Links.Find(l => l.Url == "http://google.com"); + Assert.AreEqual(97, f.Index); + Assert.AreEqual(4, f.Length); + + f = result.Links.Find(l => l.Url == "https://osu.ppy.sh"); + Assert.AreEqual(78, f.Index); + Assert.AreEqual(18, f.Length); + + f = result.Links.Find(l => l.Url == "\uD83D\uDE12"); + Assert.AreEqual(101, f.Index); + Assert.AreEqual(3, f.Length); + } + + [Test] + public void TestEmoji() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "Hello world\uD83D\uDE12<--This is an emoji,There are more:\uD83D\uDE10\uD83D\uDE00,\uD83D\uDE20" }); + Assert.AreEqual("Hello world\0\0\0<--This is an emoji,There are more:\0\0\0\0\0\0,\0\0\0", result.DisplayContent); + Assert.AreEqual(result.Links.Count, 4); + Assert.AreEqual(result.Links[0].Index, 11); + Assert.AreEqual(result.Links[1].Index, 49); + Assert.AreEqual(result.Links[2].Index, 52); + Assert.AreEqual(result.Links[3].Index, 56); + Assert.AreEqual(result.Links[0].Url, "\uD83D\uDE12"); + Assert.AreEqual(result.Links[1].Url, "\uD83D\uDE10"); + Assert.AreEqual(result.Links[2].Url, "\uD83D\uDE00"); + Assert.AreEqual(result.Links[3].Url, "\uD83D\uDE20"); + } + } +} diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index f308100d2c..8f5fd3587a 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -90,6 +90,7 @@ + From 1920a4e029a4641b65ba2c14817fb9e297b3a5d6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 29 Jan 2018 18:47:14 +0900 Subject: [PATCH 526/628] Prepare tests for fixing --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 30 ++++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index 74faa3f48f..eeb4889f94 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -50,13 +50,14 @@ namespace osu.Game.Tests.Visual private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false, bool isImportant = false, params LinkAction[] expectedActions) { - var newLine = new ChatLine(new DummyMessage(text, isAction, isImportant)); + int index = textContainer.Count + 1; + var newLine = new ChatLine(new DummyMessage(text, isAction, isImportant, index)); textContainer.Add(newLine); - AddAssert($"msg #{textContainer.Count} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); - AddAssert($"msg #{textContainer.Count} has the right action", hasExpectedActions); - AddAssert($"msg #{textContainer.Count} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic()); - AddAssert($"msg #{textContainer.Count} shows {linkAmount} link(s)", isShowingLinks); + AddAssert($"msg #{index} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); + AddAssert($"msg #{index} has the right action", hasExpectedActions); + AddAssert($"msg #{index} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic()); + AddAssert($"msg #{index} shows {linkAmount} link(s)", isShowingLinks); bool hasExpectedActions() { @@ -106,14 +107,14 @@ namespace osu.Game.Tests.Visual expectedActions: new[] { LinkAction.External, LinkAction.OpenBeatmap, LinkAction.External }); // note that there's 0 links here (they get removed if a channel is not found) addMessageWithChecks("#lobby or #osu would be blue (and work) in the ChatDisplay test (when a proper ChatOverlay is present)."); - addMessageWithChecks("Join my multiplayer game osump://12346.", expectedActions: LinkAction.JoinMultiplayerMatch); - addMessageWithChecks("Join my [multiplayer game](osump://12346).", expectedActions: LinkAction.JoinMultiplayerMatch); - addMessageWithChecks("Join my [#english](osu://chan/english).", expectedActions: LinkAction.OpenChannel); - addMessageWithChecks("Join my osu://chan/english.", expectedActions: LinkAction.OpenChannel); - addMessageWithChecks("Join my #english.", expectedActions: LinkAction.OpenChannel); addMessageWithChecks("I am important!", 0, false, true); addMessageWithChecks("feels important", 0, true, true); addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true, expectedActions: LinkAction.External); + addMessageWithChecks("Join my multiplayer game osump://12346.",1, expectedActions: LinkAction.JoinMultiplayerMatch); + addMessageWithChecks("Join my [multiplayer game](osump://12346).", 1, expectedActions: LinkAction.JoinMultiplayerMatch); + addMessageWithChecks("Join my [#english](osu://chan/english).", 1, expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my osu://chan/english.", 1, expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my #english.", 1, expectedActions: LinkAction.OpenChannel); } private void testEcho() @@ -173,12 +174,17 @@ namespace osu.Game.Tests.Visual public new DateTimeOffset Timestamp = DateTimeOffset.Now; - public DummyMessage(string text, bool isAction = false, bool isImportant = false) + public DummyMessage(string text, bool isAction = false, bool isImportant = false, int number = 0) : base(messageCounter++) { Content = text; IsAction = isAction; - Sender = isImportant ? TEST_SENDER_BACKGROUND : TEST_SENDER; + Sender = new User + { + Username = $"User {number}", + Id = number, + Colour = isImportant ? "#250cc9" : null, + }; } } From 373b3871f9b8f40a72bd95888f9d0b7e47b36df0 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 29 Jan 2018 12:03:22 +0100 Subject: [PATCH 527/628] update SliderTick calculation + more ticks in tests math is hard >_< --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 +- osu.Game.Rulesets.Osu/Objects/SliderTick.cs | 14 +++++++++++--- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 5 ++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 19a81e9f01..96df4bf1b8 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -137,7 +137,7 @@ namespace osu.Game.Rulesets.Osu.Objects AddNested(new SliderTick { SpanIndex = span, - SliderStartTime = StartTime, + SpanStartTime = spanStartTime, StartTime = spanStartTime + timeProgress * SpanDuration, Position = Curve.PositionAt(distanceProgress), StackHeight = StackHeight, diff --git a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs index 5026519ecf..966db73eb9 100644 --- a/osu.Game.Rulesets.Osu/Objects/SliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/SliderTick.cs @@ -9,14 +9,22 @@ namespace osu.Game.Rulesets.Osu.Objects public class SliderTick : OsuHitObject { public int SpanIndex { get; set; } - public double SliderStartTime { get; set; } + public double SpanStartTime { get; set; } protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - // SliderTicks appear earlier and earlier going further into a Slider. - TimePreempt = StartTime - ((StartTime - SliderStartTime) / 2 + SliderStartTime - TimeFadein * 0.66f); + double offset; + + if (SpanIndex > 0) + // Adding 200 to include the offset stable used. + // This is so on repeats ticks don't appear too late to be visually processed by the player. + offset = 200; + else + offset = TimeFadein * 0.66f; + + TimePreempt = (StartTime - SpanStartTime) / 2 + offset; } } } diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index 5060137ec6..e46bb77084 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -17,6 +17,7 @@ using OpenTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; +using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Osu.Tests { @@ -27,7 +28,9 @@ namespace osu.Game.Rulesets.Osu.Tests { typeof(SliderBall), typeof(SliderBody), + typeof(SliderTick), typeof(DrawableSlider), + typeof(DrawableSliderTick), typeof(DrawableRepeatPoint), typeof(DrawableOsuHitObject) }; @@ -131,7 +134,7 @@ namespace osu.Game.Rulesets.Osu.Tests var cpi = new ControlPointInfo(); cpi.DifficultyPoints.Add(new DifficultyControlPoint { SpeedMultiplier = speedMultiplier }); - slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize }); + slider.ApplyDefaults(cpi, new BeatmapDifficulty { CircleSize = circleSize, SliderTickRate = 3 }); var drawable = new DrawableSlider(slider) { From f6501e73e3e88c8419f187319566feff8b5a6cb3 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 29 Jan 2018 12:08:03 +0100 Subject: [PATCH 528/628] remove unwanted using --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index e46bb77084..11250e0e95 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -17,7 +17,6 @@ using OpenTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; -using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Osu.Tests { From ef3fb8c05aa09d15920eb921d0d9251127cb49c6 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 14:49:12 +0900 Subject: [PATCH 529/628] InputManager -> Container where KeyBindings are involved --- ...ndingInputManager.cs => DatabasedKeyBindingContainer.cs} | 4 ++-- ...yBindingInputManager.cs => GlobalKeyBindingContainer.cs} | 4 ++-- osu.Game/OsuGameBase.cs | 4 ++-- osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs | 6 +++--- osu.Game/Overlays/KeyBindingOverlay.cs | 2 +- osu.Game/Rulesets/UI/RulesetInputManager.cs | 2 +- osu.Game/osu.Game.csproj | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) rename osu.Game/Input/Bindings/{DatabasedKeyBindingInputManager.cs => DatabasedKeyBindingContainer.cs} (87%) rename osu.Game/Input/Bindings/{GlobalKeyBindingInputManager.cs => GlobalKeyBindingContainer.cs} (91%) diff --git a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs b/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs similarity index 87% rename from osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs rename to osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs index 4632c6c5f0..b6bc348a52 100644 --- a/osu.Game/Input/Bindings/DatabasedKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/DatabasedKeyBindingContainer.cs @@ -14,7 +14,7 @@ namespace osu.Game.Input.Bindings /// A KeyBindingInputManager with a database backing for custom overrides. /// /// The type of the custom action. - public class DatabasedKeyBindingInputManager : KeyBindingContainer + public class DatabasedKeyBindingContainer : KeyBindingContainer where T : struct { private readonly RulesetInfo ruleset; @@ -31,7 +31,7 @@ namespace osu.Game.Input.Bindings /// A reference to identify the current . Used to lookup mappings. Null for global mappings. /// An optional variant for the specified . Used when a ruleset has more than one possible keyboard layouts. /// Specify how to deal with multiple matches of s and s. - public DatabasedKeyBindingInputManager(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None) + public DatabasedKeyBindingContainer(RulesetInfo ruleset = null, int? variant = null, SimultaneousBindingMode simultaneousMode = SimultaneousBindingMode.None) : base(simultaneousMode) { this.ruleset = ruleset; diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs similarity index 91% rename from osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs rename to osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs index dcebe939d4..2b8de20c67 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs @@ -10,11 +10,11 @@ using osu.Framework.Input.Bindings; namespace osu.Game.Input.Bindings { - public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager, IHandleGlobalInput + public class GlobalKeyBindingContainer : DatabasedKeyBindingContainer, IHandleGlobalInput { private readonly Drawable handler; - public GlobalKeyBindingInputManager(OsuGameBase game) + public GlobalKeyBindingContainer(OsuGameBase game) { if (game is IKeyBindingHandler) handler = game; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 794e829e7b..9823ca479b 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -212,10 +212,10 @@ namespace osu.Game { base.LoadComplete(); - GlobalKeyBindingInputManager globalBinding; + GlobalKeyBindingContainer globalBinding; CursorOverrideContainer = new CursorOverrideContainer { RelativeSizeAxes = Axes.Both }; - CursorOverrideContainer.Child = globalBinding = new GlobalKeyBindingInputManager(this) + CursorOverrideContainer.Child = globalBinding = new GlobalKeyBindingContainer(this) { RelativeSizeAxes = Axes.Both, Child = content = new OsuTooltipContainer(CursorOverrideContainer.Cursor) { RelativeSizeAxes = Axes.Both } diff --git a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs index f5b3096404..8e87cac087 100644 --- a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs @@ -12,7 +12,7 @@ namespace osu.Game.Overlays.KeyBinding public override FontAwesome Icon => FontAwesome.fa_osu_hot; public override string Header => "Global"; - public GlobalKeyBindingsSection(GlobalKeyBindingInputManager manager) + public GlobalKeyBindingsSection(GlobalKeyBindingContainer manager) { Add(new DefaultBindingsSubsection(manager)); Add(new InGameKeyBindingsSubsection(manager)); @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.KeyBinding { protected override string Header => string.Empty; - public DefaultBindingsSubsection(GlobalKeyBindingInputManager manager) + public DefaultBindingsSubsection(GlobalKeyBindingContainer manager) : base(null) { Defaults = manager.GlobalKeyBindings; @@ -34,7 +34,7 @@ namespace osu.Game.Overlays.KeyBinding { protected override string Header => "In Game"; - public InGameKeyBindingsSubsection(GlobalKeyBindingInputManager manager) : base(null) + public InGameKeyBindingsSubsection(GlobalKeyBindingContainer manager) : base(null) { Defaults = manager.InGameKeyBindings; } diff --git a/osu.Game/Overlays/KeyBindingOverlay.cs b/osu.Game/Overlays/KeyBindingOverlay.cs index 18e43ad39b..b6902b1c09 100644 --- a/osu.Game/Overlays/KeyBindingOverlay.cs +++ b/osu.Game/Overlays/KeyBindingOverlay.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays protected override Drawable CreateHeader() => new SettingsHeader("key configuration", "Customise your keys!"); [BackgroundDependencyLoader(permitNulls: true)] - private void load(RulesetStore rulesets, GlobalKeyBindingInputManager global) + private void load(RulesetStore rulesets, GlobalKeyBindingContainer global) { AddSection(new GlobalKeyBindingsSection(global)); diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 223586a959..6e06ca6903 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.UI public abstract class RulesetInputManager : PassThroughInputManager, ICanAttachKeyCounter, IHasReplayHandler where T : struct { - public class RulesetKeyBindingContainer : DatabasedKeyBindingInputManager + public class RulesetKeyBindingContainer : DatabasedKeyBindingContainer { public RulesetKeyBindingContainer(RulesetInfo ruleset, int variant, SimultaneousBindingMode unique) : base(ruleset, variant, unique) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 5bcdd2c24d..6276797b6f 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -446,8 +446,8 @@ - - + + From b4cd8ea7169efa65bf106fcefa6921d5cc930968 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 14:54:30 +0900 Subject: [PATCH 530/628] GlobalKeyBindingContainer -> GlobalActionContainer Consitent with "FrameworkActionContainer". --- ...lobalKeyBindingContainer.cs => GlobalActionContainer.cs} | 4 ++-- osu.Game/OsuGameBase.cs | 4 ++-- osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs | 6 +++--- osu.Game/Overlays/KeyBindingOverlay.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game/Input/Bindings/{GlobalKeyBindingContainer.cs => GlobalActionContainer.cs} (91%) diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs similarity index 91% rename from osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs rename to osu.Game/Input/Bindings/GlobalActionContainer.cs index 2b8de20c67..46cda845aa 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -10,11 +10,11 @@ using osu.Framework.Input.Bindings; namespace osu.Game.Input.Bindings { - public class GlobalKeyBindingContainer : DatabasedKeyBindingContainer, IHandleGlobalInput + public class GlobalActionContainer : DatabasedKeyBindingContainer, IHandleGlobalInput { private readonly Drawable handler; - public GlobalKeyBindingContainer(OsuGameBase game) + public GlobalActionContainer(OsuGameBase game) { if (game is IKeyBindingHandler) handler = game; diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 9823ca479b..937b204c81 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -212,10 +212,10 @@ namespace osu.Game { base.LoadComplete(); - GlobalKeyBindingContainer globalBinding; + GlobalActionContainer globalBinding; CursorOverrideContainer = new CursorOverrideContainer { RelativeSizeAxes = Axes.Both }; - CursorOverrideContainer.Child = globalBinding = new GlobalKeyBindingContainer(this) + CursorOverrideContainer.Child = globalBinding = new GlobalActionContainer(this) { RelativeSizeAxes = Axes.Both, Child = content = new OsuTooltipContainer(CursorOverrideContainer.Cursor) { RelativeSizeAxes = Axes.Both } diff --git a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs index 8e87cac087..a4c1621266 100644 --- a/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs +++ b/osu.Game/Overlays/KeyBinding/GlobalKeyBindingsSection.cs @@ -12,7 +12,7 @@ namespace osu.Game.Overlays.KeyBinding public override FontAwesome Icon => FontAwesome.fa_osu_hot; public override string Header => "Global"; - public GlobalKeyBindingsSection(GlobalKeyBindingContainer manager) + public GlobalKeyBindingsSection(GlobalActionContainer manager) { Add(new DefaultBindingsSubsection(manager)); Add(new InGameKeyBindingsSubsection(manager)); @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.KeyBinding { protected override string Header => string.Empty; - public DefaultBindingsSubsection(GlobalKeyBindingContainer manager) + public DefaultBindingsSubsection(GlobalActionContainer manager) : base(null) { Defaults = manager.GlobalKeyBindings; @@ -34,7 +34,7 @@ namespace osu.Game.Overlays.KeyBinding { protected override string Header => "In Game"; - public InGameKeyBindingsSubsection(GlobalKeyBindingContainer manager) : base(null) + public InGameKeyBindingsSubsection(GlobalActionContainer manager) : base(null) { Defaults = manager.InGameKeyBindings; } diff --git a/osu.Game/Overlays/KeyBindingOverlay.cs b/osu.Game/Overlays/KeyBindingOverlay.cs index b6902b1c09..b311ee68c0 100644 --- a/osu.Game/Overlays/KeyBindingOverlay.cs +++ b/osu.Game/Overlays/KeyBindingOverlay.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays protected override Drawable CreateHeader() => new SettingsHeader("key configuration", "Customise your keys!"); [BackgroundDependencyLoader(permitNulls: true)] - private void load(RulesetStore rulesets, GlobalKeyBindingContainer global) + private void load(RulesetStore rulesets, GlobalActionContainer global) { AddSection(new GlobalKeyBindingsSection(global)); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6276797b6f..4e048d60b9 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -447,7 +447,7 @@ - + From c97ea3ed606a60d50597198aa4a545f3a59477c7 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 15:49:55 +0900 Subject: [PATCH 531/628] Post-process beatmap before applying defaults --- osu.Game/Rulesets/UI/RulesetContainer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 8f72644b28..231250e858 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -240,13 +240,13 @@ namespace osu.Game.Rulesets.UI foreach (var mod in Mods.OfType()) mod.ApplyToDifficulty(Beatmap.BeatmapInfo.BaseDifficulty); + // Post-process the beatmap + processor.PostProcess(Beatmap); + // Apply defaults foreach (var h in Beatmap.HitObjects) h.ApplyDefaults(Beatmap.ControlPointInfo, Beatmap.BeatmapInfo.BaseDifficulty); - // Post-process the beatmap - processor.PostProcess(Beatmap); - KeyBindingInputManager = CreateInputManager(); KeyBindingInputManager.RelativeSizeAxes = Axes.Both; From b293408147a3fbb84bcfe7c8b704755dcf4afeaa Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 15:50:48 +0900 Subject: [PATCH 532/628] Construct the head of sliders from Slider --- .../Objects/Drawables/DrawableSlider.cs | 32 ++++++------------- osu.Game.Rulesets.Osu/Objects/Slider.cs | 14 ++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index af947817c0..7462478408 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { private readonly Slider slider; - public readonly DrawableHitCircle InitialCircle; + public readonly DrawableHitCircle HeadCircle; private readonly List components = new List(); @@ -51,27 +51,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AlwaysPresent = true, Alpha = 0 }, - InitialCircle = new DrawableHitCircle(new HitCircle - { - StartTime = s.StartTime, - Position = s.StackedPosition, - IndexInCurrentCombo = s.IndexInCurrentCombo, - Scale = s.Scale, - ComboColour = s.ComboColour, - Samples = s.Samples, - SampleControlPoint = s.SampleControlPoint, - TimePreempt = s.TimePreempt, - TimeFadein = s.TimeFadein, - HitWindow300 = s.HitWindow300, - HitWindow100 = s.HitWindow100, - HitWindow50 = s.HitWindow50 - }) + HeadCircle = new DrawableHitCircle(s.HeadCircle) }; components.Add(Body); components.Add(Ball); - AddNested(InitialCircle); + AddNested(HeadCircle); foreach (var tick in s.NestedHitObjects.OfType()) { @@ -121,8 +107,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables currentSpan = span; //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. - if (!InitialCircle.Judgements.Any(j => j.IsHit)) - InitialCircle.Position = slider.Curve.PositionAt(progress); + if (!HeadCircle.Judgements.Any(j => j.IsHit)) + HeadCircle.Position = slider.Curve.PositionAt(progress); foreach (var c in components.OfType()) c.UpdateProgress(progress, span); foreach (var c in components.OfType()) c.UpdateSnakingPosition(slider.Curve.PositionAt(Body.SnakedStart ?? 0), slider.Curve.PositionAt(Body.SnakedEnd ?? 0)); @@ -135,13 +121,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { var judgementsCount = ticks.Children.Count + repeatPoints.Children.Count + 1; var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + repeatPoints.Children.Count(t => t.Judgements.Any(j => j.IsHit)); - if (InitialCircle.Judgements.Any(j => j.IsHit)) + if (HeadCircle.Judgements.Any(j => j.IsHit)) judgementsHit++; var hitFraction = (double)judgementsHit / judgementsCount; - if (hitFraction == 1 && InitialCircle.Judgements.Any(j => j.Result == HitResult.Great)) + if (hitFraction == 1 && HeadCircle.Judgements.Any(j => j.Result == HitResult.Great)) AddJudgement(new OsuJudgement { Result = HitResult.Great }); - else if (hitFraction >= 0.5 && InitialCircle.Judgements.Any(j => j.Result >= HitResult.Good)) + else if (hitFraction >= 0.5 && HeadCircle.Judgements.Any(j => j.Result >= HitResult.Good)) AddJudgement(new OsuJudgement { Result = HitResult.Good }); else if (hitFraction > 0) AddJudgement(new OsuJudgement { Result = HitResult.Meh }); @@ -173,7 +159,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } } - public Drawable ProxiedLayer => InitialCircle.ApproachCircle; + public Drawable ProxiedLayer => HeadCircle.ApproachCircle; public override Vector2 SelectionPoint => ToScreenSpace(Body.Position); public override Quad SelectionQuad => Body.PathDrawQuad; diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 79bb14a475..fba016a55e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -80,6 +80,8 @@ namespace osu.Game.Rulesets.Osu.Objects public double Velocity; public double TickDistance; + public HitCircle HeadCircle; + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); @@ -91,6 +93,18 @@ namespace osu.Game.Rulesets.Osu.Objects Velocity = scoringDistance / timingPoint.BeatLength; TickDistance = scoringDistance / difficulty.SliderTickRate; + + HeadCircle = new HitCircle + { + StartTime = StartTime, + Position = StackedPosition, + IndexInCurrentCombo = IndexInCurrentCombo, + ComboColour = ComboColour, + Samples = Samples, + SampleControlPoint = SampleControlPoint + }; + + HeadCircle.ApplyDefaults(controlPointInfo, difficulty); } protected override void CreateNestedHitObjects() From 702c4efb88eb26fb87c6ce9f3321ecd9ba288685 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 16:24:23 +0900 Subject: [PATCH 533/628] Give Slider a tail hitobject to make slider ends counts towards score --- .../Judgements/OsuSliderTailJudgement.cs | 13 ++++++++ .../Objects/Drawables/DrawableSlider.cs | 26 ++++++++------- .../Objects/Drawables/DrawableSliderTail.cs | 32 +++++++++++++++++++ .../Objects/Drawables/DrawableSliderTick.cs | 4 +-- .../Objects/Drawables/IRequireTracking.cs | 13 ++++++++ osu.Game.Rulesets.Osu/Objects/Slider.cs | 12 +++++++ .../osu.Game.Rulesets.Osu.csproj | 3 ++ 7 files changed, 89 insertions(+), 14 deletions(-) create mode 100644 osu.Game.Rulesets.Osu/Judgements/OsuSliderTailJudgement.cs create mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs create mode 100644 osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs diff --git a/osu.Game.Rulesets.Osu/Judgements/OsuSliderTailJudgement.cs b/osu.Game.Rulesets.Osu/Judgements/OsuSliderTailJudgement.cs new file mode 100644 index 0000000000..a6e67ea979 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Judgements/OsuSliderTailJudgement.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Judgements +{ + public class OsuSliderTailJudgement : OsuJudgement + { + public override bool AffectsCombo => false; + protected override int NumericResultFor(HitResult result) => 0; + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 7462478408..7247fe1362 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -18,14 +18,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach { private readonly Slider slider; - - public readonly DrawableHitCircle HeadCircle; - private readonly List components = new List(); - private readonly Container ticks; - private readonly Container repeatPoints; - + public readonly DrawableHitCircle HeadCircle; public readonly SliderBody Body; public readonly SliderBall Ball; @@ -34,6 +29,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { slider = s; + DrawableSliderTail tail; + Container ticks; + Container repeatPoints; + Children = new Drawable[] { Body = new SliderBody(s) @@ -51,7 +50,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AlwaysPresent = true, Alpha = 0 }, - HeadCircle = new DrawableHitCircle(s.HeadCircle) + HeadCircle = new DrawableHitCircle(s.HeadCircle), + tail = new DrawableSliderTail(s.TailCircle) }; components.Add(Body); @@ -59,6 +59,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables AddNested(HeadCircle); + AddNested(tail); + components.Add(tail); + foreach (var tick in s.NestedHitObjects.OfType()) { var spanStartTime = s.StartTime + tick.SpanIndex * s.SpanDuration; @@ -73,6 +76,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables }; ticks.Add(drawableTick); + components.Add(drawableTick); AddNested(drawableTick); } @@ -112,17 +116,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables foreach (var c in components.OfType()) c.UpdateProgress(progress, span); foreach (var c in components.OfType()) c.UpdateSnakingPosition(slider.Curve.PositionAt(Body.SnakedStart ?? 0), slider.Curve.PositionAt(Body.SnakedEnd ?? 0)); - foreach (var t in ticks.Children) t.Tracking = Ball.Tracking; + foreach (var t in components.OfType()) t.Tracking = Ball.Tracking; } protected override void CheckForJudgements(bool userTriggered, double timeOffset) { if (!userTriggered && Time.Current >= slider.EndTime) { - var judgementsCount = ticks.Children.Count + repeatPoints.Children.Count + 1; - var judgementsHit = ticks.Children.Count(t => t.Judgements.Any(j => j.IsHit)) + repeatPoints.Children.Count(t => t.Judgements.Any(j => j.IsHit)); - if (HeadCircle.Judgements.Any(j => j.IsHit)) - judgementsHit++; + var judgementsCount = NestedHitObjects.Count; + var judgementsHit = NestedHitObjects.Count(h => h.IsHit); var hitFraction = (double)judgementsHit / judgementsCount; if (hitFraction == 1 && HeadCircle.Judgements.Any(j => j.Result == HitResult.Great)) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs new file mode 100644 index 0000000000..8835fc2b29 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Game.Rulesets.Osu.Judgements; +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Osu.Objects.Drawables +{ + public class DrawableSliderTail : DrawableOsuHitObject, IRequireTracking + { + /// + /// The judgement text is provided by the . + /// + public override bool DisplayJudgement => false; + + public bool Tracking { get; set; } + + public DrawableSliderTail(HitCircle hitCircle) + : base(hitCircle) + { + AlwaysPresent = true; + RelativeSizeAxes = Axes.Both; + } + + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + if (!userTriggered && timeOffset >= 0) + AddJudgement(new OsuSliderTailJudgement { Result = Tracking ? HitResult.Great : HitResult.Miss }); + } + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 09985752a4..ae76f1e0e1 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -12,14 +12,14 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects.Drawables { - public class DrawableSliderTick : DrawableOsuHitObject + public class DrawableSliderTick : DrawableOsuHitObject, IRequireTracking { private readonly SliderTick sliderTick; public double FadeInTime; public double FadeOutTime; - public bool Tracking; + public bool Tracking { get; set; } public override bool DisplayJudgement => false; diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs new file mode 100644 index 0000000000..98fc686dd3 --- /dev/null +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/IRequireTracking.cs @@ -0,0 +1,13 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Rulesets.Osu.Objects.Drawables +{ + public interface IRequireTracking + { + /// + /// Whether the is currently being tracked by the user. + /// + bool Tracking { get; set; } + } +} diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index fba016a55e..0c86c64be7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -81,6 +81,7 @@ namespace osu.Game.Rulesets.Osu.Objects public double TickDistance; public HitCircle HeadCircle; + public HitCircle TailCircle; protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { @@ -104,7 +105,18 @@ namespace osu.Game.Rulesets.Osu.Objects SampleControlPoint = SampleControlPoint }; + TailCircle = new HitCircle + { + StartTime = EndTime, + Position = StackedEndPosition, + IndexInCurrentCombo = IndexInCurrentCombo, + ComboColour = ComboColour, + Samples = Samples, + SampleControlPoint = SampleControlPoint + }; + HeadCircle.ApplyDefaults(controlPointInfo, difficulty); + TailCircle.ApplyDefaults(controlPointInfo, difficulty); } protected override void CreateNestedHitObjects() diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 74a3883f0a..97a003513f 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -55,6 +55,7 @@ + @@ -75,6 +76,8 @@ + + From 27357e100acc1f82a9f5188a4f2a53c6d7eaaa99 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 16:28:38 +0900 Subject: [PATCH 534/628] Simplify condition --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs index 7247fe1362..5f464402d0 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs @@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables currentSpan = span; //todo: we probably want to reconsider this before adding scoring, but it looks and feels nice. - if (!HeadCircle.Judgements.Any(j => j.IsHit)) + if (!HeadCircle.IsHit) HeadCircle.Position = slider.Curve.PositionAt(progress); foreach (var c in components.OfType()) c.UpdateProgress(progress, span); From 1dbaf9b7a75d86ad22c619a770a5ca9283bfdc63 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 16:37:59 +0900 Subject: [PATCH 535/628] Add many more tests --- osu.Game.Tests/Chat/MessageFormatterTests.cs | 60 +++++++++++++++++++- osu.Game.Tests/Visual/TestCaseChatLink.cs | 5 +- 2 files changed, 61 insertions(+), 4 deletions(-) diff --git a/osu.Game.Tests/Chat/MessageFormatterTests.cs b/osu.Game.Tests/Chat/MessageFormatterTests.cs index 0fc3054f44..2a7967bd6f 100644 --- a/osu.Game.Tests/Chat/MessageFormatterTests.cs +++ b/osu.Game.Tests/Chat/MessageFormatterTests.cs @@ -108,9 +108,9 @@ namespace osu.Game.Tests.Chat [Test] public void TestOldFormatLink() { - Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a (simple test)[https://osu.ppy.sh]." }); + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a (simple test)[https://osu.ppy.sh] of links." }); - Assert.AreEqual("This is a simple test.", result.DisplayContent); + Assert.AreEqual("This is a simple test of links.", result.DisplayContent); Assert.AreEqual(1, result.Links.Count); Assert.AreEqual("https://osu.ppy.sh", result.Links[0].Url); Assert.AreEqual(10, result.Links[0].Index); @@ -129,6 +129,62 @@ namespace osu.Game.Tests.Chat Assert.AreEqual(11, result.Links[0].Length); } + [Test] + public void TestMarkdownFormatLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a [simple test](https://osu.ppy.sh)." }); + + Assert.AreEqual("This is a simple test.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("https://osu.ppy.sh", result.Links[0].Url); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(11, result.Links[0].Length); + } + + [Test] + public void TestChannelLink() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is an #english and #japanese." }); + + Assert.AreEqual("This is an #english and #japanese.", result.DisplayContent); + Assert.AreEqual(2, result.Links.Count); + Assert.AreEqual("osu://chan/#english", result.Links[0].Url); + Assert.AreEqual("osu://chan/#japanese", result.Links[1].Url); + } + + [Test] + public void TestOsuProtocol() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a custom protocol osu://chan/#english." }); + + Assert.AreEqual("This is a custom protocol osu://chan/#english.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("osu://chan/#english", result.Links[0].Url); + Assert.AreEqual(26, result.Links[0].Index); + Assert.AreEqual(19, result.Links[0].Length); + + result = MessageFormatter.FormatMessage(new Message { Content = "This is a [custom protocol](osu://chan/#english)." }); + + Assert.AreEqual("This is a custom protocol.", result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("osu://chan/#english", result.Links[0].Url); + Assert.AreEqual("#english", result.Links[0].Argument); + Assert.AreEqual(10, result.Links[0].Index); + Assert.AreEqual(15, result.Links[0].Length); + } + + [Test] + public void TestOsuMpProtocol() + { + Message result = MessageFormatter.FormatMessage(new Message { Content = "Join my multiplayer game osump://12346." }); + + Assert.AreEqual(result.Content, result.DisplayContent); + Assert.AreEqual(1, result.Links.Count); + Assert.AreEqual("osump://12346", result.Links[0].Url); + Assert.AreEqual(25, result.Links[0].Index); + Assert.AreEqual(13, result.Links[0].Length); + } + [Test] public void TestRecursiveBreaking() { diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index eeb4889f94..ee72fcb1ed 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -100,6 +100,7 @@ namespace osu.Game.Tests.Visual addMessageWithChecks("Wiki link for tasty [[Performance Points]]", 1, expectedActions: LinkAction.External); addMessageWithChecks("(osu forums)[https://osu.ppy.sh/forum] (old link format)", 1, expectedActions: LinkAction.External); addMessageWithChecks("[https://osu.ppy.sh/home New site] (new link format)", 1, expectedActions: LinkAction.External); + addMessageWithChecks("[osu forums](https://osu.ppy.sh/forum) (new link format 2)", 1, expectedActions: LinkAction.External); addMessageWithChecks("[https://osu.ppy.sh/home This is only a link to the new osu webpage but this is supposed to test word wrap.]", 1, expectedActions: LinkAction.External); addMessageWithChecks("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmapSet); addMessageWithChecks("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", 1, true, expectedActions: LinkAction.OpenBeatmap); @@ -113,8 +114,8 @@ namespace osu.Game.Tests.Visual addMessageWithChecks("Join my multiplayer game osump://12346.",1, expectedActions: LinkAction.JoinMultiplayerMatch); addMessageWithChecks("Join my [multiplayer game](osump://12346).", 1, expectedActions: LinkAction.JoinMultiplayerMatch); addMessageWithChecks("Join my [#english](osu://chan/english).", 1, expectedActions: LinkAction.OpenChannel); - addMessageWithChecks("Join my osu://chan/english.", 1, expectedActions: LinkAction.OpenChannel); - addMessageWithChecks("Join my #english.", 1, expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my osu://chan/#english.", 1, expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my #english or #japanese channels.", 2, expectedActions: new [] { LinkAction.OpenChannel, LinkAction.OpenChannel }); } private void testEcho() From dd2731b8732df6a13f2f4ccd3570025a4c9fae50 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 16:38:45 +0900 Subject: [PATCH 536/628] Add support for markdown style links --- osu.Game/Online/Chat/MessageFormatter.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 2c15f48f95..4ba5412633 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -18,6 +18,9 @@ namespace osu.Game.Online.Chat // [https://osu.ppy.sh/b/1234 Beatmap [Hard] (poop)] -> Beatmap [hard] (poop) (https://osu.ppy.sh/b/1234) private static readonly Regex new_link_regex = new Regex(@"\[([a-z]+://[^ ]+) ([^\[\]]*(((?\[)[^\[\]]*)+((?\])[^\[\]]*)+)*(?(open)(?!)))\]"); + // [test](https://osu.ppy.sh/b/1234) -> test (https://osu.ppy.sh/b/1234) aka correct markdown format + private static readonly Regex markdown_link_regex = new Regex(@"\[([^\]]*)\]\(([a-z]+://[^ ]+)\)"); + // advanced, RFC-compatible regular expression that matches any possible URL, *but* allows certain invalid characters that are widely used // This is in the format (, [optional]): // http[s]://.[:port][/path][?query][#fragment] @@ -168,6 +171,9 @@ namespace osu.Game.Online.Chat // handle the [link display] format handleMatches(new_link_regex, "{2}", "{1}", result, startIndex); + // handle the standard markdown []() format + handleMatches(markdown_link_regex, "{1}", "{2}", result, startIndex); + // handle the ()[] link format handleMatches(old_link_regex, "{1}", "{2}", result, startIndex); From 662c7c5bdcb8229c2667ed6a9fb59cec53bd3d3f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 16:39:08 +0900 Subject: [PATCH 537/628] Fix osump links --- osu.Game/Online/Chat/MessageFormatter.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 4ba5412633..855770b953 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -24,13 +24,20 @@ namespace osu.Game.Online.Chat // advanced, RFC-compatible regular expression that matches any possible URL, *but* allows certain invalid characters that are widely used // This is in the format (, [optional]): // http[s]://.[:port][/path][?query][#fragment] - private static readonly Regex advanced_link_regex = new Regex(@"(?\([^)]*)?" + - @"(?https?:\/\/" + - @"(?(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z][a-z0-9-]*[a-z0-9]" + // domain, TLD - @"(?::\d+)?)" + // port - @"(?(?:(?:\/+(?:[a-z0-9$_\.\+!\*\',;:\(\)@&~=-]|%[0-9a-f]{2})*)*" + // path - @"(?:\?(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?" + // query - @"(?:#(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?)", // fragment + private static readonly Regex advanced_link_regex = new Regex( + @"(?\([^)]*)?" + + // protocol + @"(?[a-z]*?:\/\/" + + // domain + tld + @"(?(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*[a-z0-9-]*[a-z0-9]" + + // port (optional) + @"(?::\d+)?)" + + // path (optional) + @"(?(?:(?:\/+(?:[a-z0-9$_\.\+!\*\',;:\(\)@&~=-]|%[0-9a-f]{2})*)*" + + // query (optional) + @"(?:\?(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?" + + // fragment (optional) + @"(?:#(?:[a-z0-9$_\+!\*\',;:\(\)@&=\/~-]|%[0-9a-f]{2})*)?)?)", RegexOptions.IgnoreCase); // 00:00:000 (1,2,3) - test From 4b63d25871bb3f99cf22ffdb94e8560f1efe2822 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 16:45:48 +0900 Subject: [PATCH 538/628] Add hit/miss display to TestCaseSlider --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index 5060137ec6..b98124b9c9 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -16,6 +16,9 @@ using OpenTK; using OpenTK.Graphics; using osu.Game.Rulesets.Mods; using System.Linq; +using osu.Game.Graphics.Sprites; +using osu.Game.Rulesets.Judgements; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -142,7 +145,31 @@ namespace osu.Game.Rulesets.Osu.Tests foreach (var mod in Mods.OfType()) mod.ApplyToDrawableHitObjects(new[] { drawable }); + drawable.OnJudgement += onJudgement; + Add(drawable); } + + private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) + { + var osuObject = judgedObject as DrawableOsuHitObject; + if (osuObject == null) + return; + + OsuSpriteText text; + Add(text = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Text = judgement.IsHit ? "Hit!" : "Miss!", + Colour = judgement.IsHit ? Color4.Green : Color4.Red, + TextSize = 30, + Position = osuObject.HitObject.StackedEndPosition - new Vector2(0, 45) + }); + + text.Delay(150) + .Then().FadeOut(200) + .Then().Expire(); + } } } From cd4a0612c06c15b9803dd7a88205c7a672f3b37e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 16:53:19 +0900 Subject: [PATCH 539/628] Properly construct slider ends using HitObject.AddNested --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 0c86c64be7..d4444c5c5d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -94,7 +94,19 @@ namespace osu.Game.Rulesets.Osu.Objects Velocity = scoringDistance / timingPoint.BeatLength; TickDistance = scoringDistance / difficulty.SliderTickRate; + } + protected override void CreateNestedHitObjects() + { + base.CreateNestedHitObjects(); + + createSliderEnds(); + createTicks(); + createRepeatPoints(); + } + + private void createSliderEnds() + { HeadCircle = new HitCircle { StartTime = StartTime, @@ -115,16 +127,8 @@ namespace osu.Game.Rulesets.Osu.Objects SampleControlPoint = SampleControlPoint }; - HeadCircle.ApplyDefaults(controlPointInfo, difficulty); - TailCircle.ApplyDefaults(controlPointInfo, difficulty); - } - - protected override void CreateNestedHitObjects() - { - base.CreateNestedHitObjects(); - - createTicks(); - createRepeatPoints(); + AddNested(HeadCircle); + AddNested(TailCircle); } private void createTicks() From d81d884a01e7355e21eef3e50f5bc9e02b0f53c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 17:16:01 +0900 Subject: [PATCH 540/628] Remove unnecessary paren handling from regex Can't find a reason for this to exist --- osu.Game/Online/Chat/MessageFormatter.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 855770b953..5a1e866650 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -25,7 +25,6 @@ namespace osu.Game.Online.Chat // This is in the format (, [optional]): // http[s]://.[:port][/path][?query][#fragment] private static readonly Regex advanced_link_regex = new Regex( - @"(?\([^)]*)?" + // protocol @"(?[a-z]*?:\/\/" + // domain + tld @@ -90,20 +89,9 @@ namespace osu.Game.Online.Chat foreach (Match m in regex.Matches(result.Text, startIndex)) { var index = m.Index; - var prefix = m.Groups["paren"].Value; var link = m.Groups["link"].Value; var indexLength = link.Length; - if (!String.IsNullOrEmpty(prefix)) - { - index += prefix.Length; - if (link.EndsWith(")")) - { - indexLength = indexLength - 1; - link = link.Remove(link.Length - 1); - } - } - var details = getLinkDetails(link); result.Links.Add(new Link(link, index, indexLength, details.Action, details.Argument)); } From e5188fd1517379ef0bdc7ddb276ab12ea4621fc2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 17:43:19 +0900 Subject: [PATCH 541/628] Add better channel test cases (testing non-existent channels) --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 32 ++++++++++++++++------- osu.Game/Online/Chat/MessageFormatter.cs | 2 +- osu.Game/Overlays/Chat/ChatLine.cs | 3 ++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index ee72fcb1ed..3a7be686e1 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -14,6 +14,7 @@ using System.Collections.Generic; using System.Linq; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; namespace osu.Game.Tests.Visual { @@ -32,6 +33,9 @@ namespace osu.Game.Tests.Visual typeof(MessageFormatter) }; + private DependencyContainer dependencies; + protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); + public TestCaseChatLink() { Add(textContainer = new TestChatLineContainer @@ -41,6 +45,20 @@ namespace osu.Game.Tests.Visual AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, }); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + linkColour = colours.Blue; + dependencies.Cache(new ChatOverlay + { + AvailableChannels = + { + new Channel { Name = "#english" }, + new Channel { Name = "#japanese" } + } + }); testLinksGeneral(); testEcho(); @@ -111,11 +129,12 @@ namespace osu.Game.Tests.Visual addMessageWithChecks("I am important!", 0, false, true); addMessageWithChecks("feels important", 0, true, true); addMessageWithChecks("likes to post this [https://osu.ppy.sh/home link].", 1, true, true, expectedActions: LinkAction.External); - addMessageWithChecks("Join my multiplayer game osump://12346.",1, expectedActions: LinkAction.JoinMultiplayerMatch); + addMessageWithChecks("Join my multiplayer game osump://12346.", 1, expectedActions: LinkAction.JoinMultiplayerMatch); addMessageWithChecks("Join my [multiplayer game](osump://12346).", 1, expectedActions: LinkAction.JoinMultiplayerMatch); - addMessageWithChecks("Join my [#english](osu://chan/english).", 1, expectedActions: LinkAction.OpenChannel); + addMessageWithChecks("Join my [#english](osu://chan/#english).", 1, expectedActions: LinkAction.OpenChannel); addMessageWithChecks("Join my osu://chan/#english.", 1, expectedActions: LinkAction.OpenChannel); - addMessageWithChecks("Join my #english or #japanese channels.", 2, expectedActions: new [] { LinkAction.OpenChannel, LinkAction.OpenChannel }); + addMessageWithChecks("Join my #english or #japanese channels.", 2, expectedActions: new[] { LinkAction.OpenChannel, LinkAction.OpenChannel }); + addMessageWithChecks("Join my #english or #nonexistent #hashtag channels.", 1, expectedActions: LinkAction.OpenChannel); } private void testEcho() @@ -141,12 +160,6 @@ namespace osu.Game.Tests.Visual } } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - linkColour = colours.Blue; - } - private class DummyEchoMessage : LocalEchoMessage { public DummyEchoMessage(string text) @@ -160,6 +173,7 @@ namespace osu.Game.Tests.Visual private class DummyMessage : Message { private static long messageCounter; + internal static readonly User TEST_SENDER_BACKGROUND = new User { Username = @"i-am-important", diff --git a/osu.Game/Online/Chat/MessageFormatter.cs b/osu.Game/Online/Chat/MessageFormatter.cs index 5a1e866650..906f42d50e 100644 --- a/osu.Game/Online/Chat/MessageFormatter.cs +++ b/osu.Game/Online/Chat/MessageFormatter.cs @@ -43,7 +43,7 @@ namespace osu.Game.Online.Chat private static readonly Regex time_regex = new Regex(@"\d\d:\d\d:\d\d\d? [^-]*"); // #osu - private static readonly Regex channel_regex = new Regex(@"#[a-zA-Z]+[a-zA-Z0-9]+"); + private static readonly Regex channel_regex = new Regex(@"(#[a-zA-Z]+[a-zA-Z0-9]+)"); // Unicode emojis private static readonly Regex emoji_regex = new Regex(@"(\uD83D[\uDC00-\uDE4F])"); diff --git a/osu.Game/Overlays/Chat/ChatLine.cs b/osu.Game/Overlays/Chat/ChatLine.cs index d87f60a350..dd41dd5428 100644 --- a/osu.Game/Overlays/Chat/ChatLine.cs +++ b/osu.Game/Overlays/Chat/ChatLine.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; @@ -225,7 +226,7 @@ namespace osu.Game.Overlays.Chat username.Text = $@"{message.Sender.Username}" + (senderHasBackground || message.IsAction ? "" : ":"); // remove non-existent channels from the link list - message.Links.RemoveAll(link => link.Action == LinkAction.OpenChannel && chat?.AvailableChannels.TrueForAll(c => c.Name != link.Argument) != false); + message.Links.RemoveAll(link => link.Action == LinkAction.OpenChannel && chat?.AvailableChannels.Any(c => c.Name == link.Argument) != true); contentFlow.Clear(); contentFlow.AddLinks(message.DisplayContent, message.Links); From 53129e52359147b28544b36aeda6e39e91243b63 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 17:47:22 +0900 Subject: [PATCH 542/628] Fix text getting truncated after last link in chat line --- osu.Game/Graphics/Containers/LinkFlowContainer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index f35282fc93..9f1b44af44 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -54,10 +54,11 @@ namespace osu.Game.Graphics.Containers foreach (var link in links) { AddText(text.Substring(previousLinkEnd, link.Index - previousLinkEnd)); - AddLink(text.Substring(link.Index, link.Length), link.Url, link.Action, link.Argument); previousLinkEnd = link.Index + link.Length; } + + AddText(text.Substring(previousLinkEnd)); } public void AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) From 00001364c32cf0a20174d3fb211765847c958296 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 18:10:14 +0900 Subject: [PATCH 543/628] Better judgement visualisations in testcase --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index b98124b9c9..2d26b74d01 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -150,6 +150,7 @@ namespace osu.Game.Rulesets.Osu.Tests Add(drawable); } + private float judgementOffsetDirection = 1; private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) { var osuObject = judgedObject as DrawableOsuHitObject; @@ -164,12 +165,14 @@ namespace osu.Game.Rulesets.Osu.Tests Text = judgement.IsHit ? "Hit!" : "Miss!", Colour = judgement.IsHit ? Color4.Green : Color4.Red, TextSize = 30, - Position = osuObject.HitObject.StackedEndPosition - new Vector2(0, 45) + Position = osuObject.HitObject.StackedEndPosition + judgementOffsetDirection * new Vector2(0, 45) }); text.Delay(150) .Then().FadeOut(200) .Then().Expire(); + + judgementOffsetDirection *= -1; } } } From 58cdb59a27835acfae71885e47384585589e2627 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 30 Jan 2018 18:22:40 +0900 Subject: [PATCH 544/628] Fix failing testcase --- .../Visual/TestCaseEditorSelectionLayer.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs index f236182939..755800c4e1 100644 --- a/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs +++ b/osu.Game.Tests/Visual/TestCaseEditorSelectionLayer.cs @@ -8,6 +8,8 @@ using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Timing; +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Edit.Layers.Selection; using osu.Game.Rulesets.Osu.Edit; using osu.Game.Rulesets.Osu.Objects; @@ -35,9 +37,9 @@ namespace osu.Game.Tests.Visual new SelectionLayer(playfield) }; - playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f })); - playfield.Add(new DrawableHitCircle(new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f })); - playfield.Add(new DrawableSlider(new Slider + var hitCircle1 = new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }; + var hitCircle2 = new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }; + var slider = new Slider { ControlPoints = new List { @@ -48,8 +50,16 @@ namespace osu.Game.Tests.Visual Position = new Vector2(128, 256), Velocity = 1, TickDistance = 100, - Scale = 0.5f - })); + Scale = 0.5f, + }; + + hitCircle1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + hitCircle2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); + + playfield.Add(new DrawableHitCircle(hitCircle1)); + playfield.Add(new DrawableHitCircle(hitCircle2)); + playfield.Add(new DrawableSlider(slider)); } } } From 9b4546bdc42107bcc713b1ea25a5bcd3373516b6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 18:23:25 +0900 Subject: [PATCH 545/628] Update taiko hitsounds (courtesey of cYsmix) --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 266965f0d7..92ec3d10b1 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 266965f0d795b94a126e2da302bd2c10eadd642a +Subproject commit 92ec3d10b12c5e9bfc1d3b05d3db174a506efd6d From 2ffe16d3d2224efe751f9205e3915ca17941ffa8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 30 Jan 2018 18:51:13 +0900 Subject: [PATCH 546/628] Improve clarity and coverage of unit tests --- osu.Game.Tests/Chat/MessageFormatterTests.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Chat/MessageFormatterTests.cs b/osu.Game.Tests/Chat/MessageFormatterTests.cs index 2a7967bd6f..f102e4c59f 100644 --- a/osu.Game.Tests/Chat/MessageFormatterTests.cs +++ b/osu.Game.Tests/Chat/MessageFormatterTests.cs @@ -14,7 +14,7 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a http://www.basic-link.com/?test=test." }); - Assert.AreEqual("This is a http://www.basic-link.com/?test=test.", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(1, result.Links.Count); Assert.AreEqual("http://www.basic-link.com/?test=test", result.Links[0].Url); Assert.AreEqual(10, result.Links[0].Index); @@ -26,7 +26,7 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a http://test.io/link#fragment. (see https://twitter.com). Also, This string should not be altered. http://example.com/" }); - Assert.AreEqual("This is a http://test.io/link#fragment. (see https://twitter.com). Also, This string should not be altered. http://example.com/", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(3, result.Links.Count); Assert.AreEqual("http://test.io/link#fragment", result.Links[0].Url); @@ -47,7 +47,8 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "https://twitter.com/#!/hashbanglinks" }); - Assert.AreEqual("https://twitter.com/#!/hashbanglinks", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); + Assert.AreEqual(result.Content, result.Links[0].Url); Assert.AreEqual(0, result.Links[0].Index); Assert.AreEqual(36, result.Links[0].Length); } @@ -57,7 +58,8 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "http://www.chiark.greenend.org.uk/~sgtatham/putty/" }); - Assert.AreEqual("http://www.chiark.greenend.org.uk/~sgtatham/putty/", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); + Assert.AreEqual(result.Content, result.Links[0].Url); Assert.AreEqual(0, result.Links[0].Index); Assert.AreEqual(50, result.Links[0].Length); } @@ -67,7 +69,7 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "look: http://puu.sh/7Ggh8xcC6/asf0asd9876.NEF" }); - Assert.AreEqual("look: http://puu.sh/7Ggh8xcC6/asf0asd9876.NEF", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(6, result.Links[0].Index); Assert.AreEqual(39, result.Links[0].Length); } @@ -146,7 +148,7 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "This is an #english and #japanese." }); - Assert.AreEqual("This is an #english and #japanese.", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(2, result.Links.Count); Assert.AreEqual("osu://chan/#english", result.Links[0].Url); Assert.AreEqual("osu://chan/#japanese", result.Links[1].Url); @@ -157,7 +159,7 @@ namespace osu.Game.Tests.Chat { Message result = MessageFormatter.FormatMessage(new Message { Content = "This is a custom protocol osu://chan/#english." }); - Assert.AreEqual("This is a custom protocol osu://chan/#english.", result.DisplayContent); + Assert.AreEqual(result.Content, result.DisplayContent); Assert.AreEqual(1, result.Links.Count); Assert.AreEqual("osu://chan/#english", result.Links[0].Url); Assert.AreEqual(26, result.Links[0].Index); From 042a34e1c23b263bd3d50f24e29e156ba8afb29b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 16:10:48 +0900 Subject: [PATCH 547/628] Add migration to ensure database aligns to changed enum --- .../20180131154205_AddMuteBinding.cs | 25 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 2 files changed, 26 insertions(+) create mode 100644 osu.Game/Migrations/20180131154205_AddMuteBinding.cs diff --git a/osu.Game/Migrations/20180131154205_AddMuteBinding.cs b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs new file mode 100644 index 0000000000..6948ad03da --- /dev/null +++ b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Infrastructure; +using osu.Game.Database; +using osu.Game.Input.Bindings; + +namespace osu.Game.Migrations +{ + [DbContext(typeof(OsuDbContext))] + [Migration("20180131154205_AddMuteBinding")] + public partial class AddMuteBinding : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql($"UPDATE KeyBinding SET Action = Action + 1 WHERE RulesetID IS NULL AND Variant IS NULL AND Action >= {(int)GlobalAction.ToggleMute}"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("DELETE FROM KeyBinding WHERE RulesetID IS NULL AND Variant IS NULL AND Action = 8"); + migrationBuilder.Sql($"UPDATE KeyBinding SET Action = Action - 1 WHERE RulesetID IS NULL AND Variant IS NULL AND Action > {(int)GlobalAction.ToggleMute}"); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4e048d60b9..05cf61c23c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -280,6 +280,7 @@ 20180125143340_Settings.cs + From 5a99651561c97d2b607b69a7fd9485b17ab66817 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 16:10:55 +0900 Subject: [PATCH 548/628] Remove unnecessary arrays --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 918a4e374a..17ec2af4b9 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -29,10 +29,10 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.Control, InputKey.Alt, InputKey.R }, GlobalAction.ResetInputSettings), new KeyBinding(new[] { InputKey.Control, InputKey.T }, GlobalAction.ToggleToolbar), new KeyBinding(new[] { InputKey.Control, InputKey.O }, GlobalAction.ToggleSettings), - new KeyBinding(new[] { InputKey.Up }, GlobalAction.IncreaseVolume), - new KeyBinding(new[] { InputKey.MouseWheelUp }, GlobalAction.IncreaseVolume), - new KeyBinding(new[] { InputKey.Down }, GlobalAction.DecreaseVolume), - new KeyBinding(new[] { InputKey.MouseWheelDown }, GlobalAction.DecreaseVolume), + new KeyBinding(InputKey.Up, GlobalAction.IncreaseVolume), + new KeyBinding(InputKey.MouseWheelUp, GlobalAction.IncreaseVolume), + new KeyBinding(InputKey.Down, GlobalAction.DecreaseVolume), + new KeyBinding(InputKey.MouseWheelDown, GlobalAction.DecreaseVolume), new KeyBinding(InputKey.F4, GlobalAction.ToggleMute), }; From 2865dd3a10404408145ffe0a01caeef9734247a5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 16:20:01 +0900 Subject: [PATCH 549/628] Replace missed hardcoded int with enum reference --- osu.Game/Migrations/20180131154205_AddMuteBinding.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Migrations/20180131154205_AddMuteBinding.cs b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs index 6948ad03da..fc1f2fff55 100644 --- a/osu.Game/Migrations/20180131154205_AddMuteBinding.cs +++ b/osu.Game/Migrations/20180131154205_AddMuteBinding.cs @@ -18,7 +18,7 @@ namespace osu.Game.Migrations protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.Sql("DELETE FROM KeyBinding WHERE RulesetID IS NULL AND Variant IS NULL AND Action = 8"); + migrationBuilder.Sql($"DELETE FROM KeyBinding WHERE RulesetID IS NULL AND Variant IS NULL AND Action = {(int)GlobalAction.ToggleMute}"); migrationBuilder.Sql($"UPDATE KeyBinding SET Action = Action - 1 WHERE RulesetID IS NULL AND Variant IS NULL AND Action > {(int)GlobalAction.ToggleMute}"); } } From 97ae44f23c5b694249ad33acd27c3200a9871346 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 16:56:26 +0900 Subject: [PATCH 550/628] Remove outwards exposure of mute property --- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 60242393ab..cfc8b81420 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -86,7 +86,7 @@ namespace osu.Game.Graphics.UserInterface.Volume return true; case GlobalAction.ToggleMute: Show(); - Muted = !Muted; + muted.Toggle(); return true; } @@ -103,12 +103,6 @@ namespace osu.Game.Graphics.UserInterface.Volume private readonly BindableBool muted = new BindableBool(); - public bool Muted - { - get => muted.Value; - set => muted.Value = value; - } - [BackgroundDependencyLoader] private void load(AudioManager audio) { From 86f5c9d6f140ce3ee117fdf56797766b4cce315d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 16:57:26 +0900 Subject: [PATCH 551/628] Add inactive volume ducking, rather than outright mute --- osu.Game/Configuration/OsuConfigManager.cs | 4 ++-- osu.Game/OsuGame.cs | 16 ++++++---------- .../Settings/Sections/Audio/VolumeSettings.cs | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 230aabb2cd..c33dd91330 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -39,7 +39,7 @@ namespace osu.Game.Configuration }; // Audio - Set(OsuSetting.MuteWhenInactive, false); + Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01); Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); @@ -103,7 +103,7 @@ namespace osu.Game.Configuration MouseDisableButtons, MouseDisableWheel, AudioOffset, - MuteWhenInactive, + VolumeInactive, MenuMusic, MenuVoice, CursorRotation, diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index f1914b53b5..fbbc14dd5e 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -19,6 +19,7 @@ using OpenTK; using System.Linq; using System.Threading; using System.Threading.Tasks; +using osu.Framework.Audio; using osu.Framework.Input.Bindings; using osu.Framework.Platform; using osu.Framework.Threading; @@ -122,7 +123,7 @@ namespace osu.Game Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; - muteWhenInactive = LocalConfig.GetBindable(OsuSetting.MuteWhenInactive); + LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveDuckVolume); } private ScheduledDelegate scoreLoad; @@ -400,24 +401,19 @@ namespace osu.Game return false; } - private Bindable muteWhenInactive = new Bindable(); - private bool wasMuted; + private readonly BindableDouble inactiveDuckVolume = new BindableDouble(); protected override void OnDeactivated() { base.OnDeactivated(); - if (muteWhenInactive) - { - wasMuted = volume.Muted; - volume.Muted = true; - } + Audio.AddAdjustment(AdjustableProperty.Volume, inactiveDuckVolume); } protected override void OnActivated() { base.OnActivated(); - if (IsLoaded && muteWhenInactive && !wasMuted) - volume.Muted = false; + Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveDuckVolume); + } public bool OnReleased(GlobalAction action) => false; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 01bcf989dc..92ee01dd7a 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -18,9 +18,9 @@ namespace osu.Game.Overlays.Settings.Sections.Audio Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.1f }, + new SettingsSlider { LabelText = "Master (Window Inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.1f }, - new SettingsCheckbox { LabelText = "Mute osu! when inactive", Bindable = config.GetBindable(OsuSetting.MuteWhenInactive) } }; } } From 93ffa1f8a2a1920e321522302dac97849db73926 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 17:36:53 +0900 Subject: [PATCH 552/628] Fix button alignment and animation --- osu.Game/Graphics/UserInterface/IconButton.cs | 4 ++-- .../Graphics/UserInterface/Volume/VolumeControl.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/IconButton.cs b/osu.Game/Graphics/UserInterface/IconButton.cs index bcf6ab92b6..5b266d9a59 100644 --- a/osu.Game/Graphics/UserInterface/IconButton.cs +++ b/osu.Game/Graphics/UserInterface/IconButton.cs @@ -15,7 +15,7 @@ namespace osu.Game.Graphics.UserInterface { public class IconButton : OsuClickableContainer { - private const float button_size = 30; + public const float BUTTON_SIZE = 30; private Color4? flashColour; /// @@ -106,7 +106,7 @@ namespace osu.Game.Graphics.UserInterface { Origin = Anchor.Centre, Anchor = Anchor.Centre, - Size = new Vector2(button_size), + Size = new Vector2(BUTTON_SIZE), CornerRadius = 5, Masking = true, EdgeEffect = new EdgeEffectParameters diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index cfc8b81420..40c46d4ff8 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -36,11 +36,16 @@ namespace osu.Game.Graphics.UserInterface.Volume Spacing = new Vector2(15, 0), Children = new Drawable[] { - muteIcon = new IconButton + new Container { - Icon = FontAwesome.fa_volume_up, - Scale = new Vector2(2.0f), - Action = () => Adjust(GlobalAction.ToggleMute), + Size = new Vector2(IconButton.BUTTON_SIZE), + Child = muteIcon = new IconButton + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Icon = FontAwesome.fa_volume_up, + Action = () => Adjust(GlobalAction.ToggleMute), + } }, volumeMeterMaster = new VolumeMeter("Master"), volumeMeterEffect = new VolumeMeter("Effects"), From 47b92f3d1d6433b766d872669ec6691a63f73455 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 18:00:44 +0900 Subject: [PATCH 553/628] Fix mute button not prolonging volume control display --- .../UserInterface/Volume/VolumeControl.cs | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 40c46d4ff8..ccf70af6ed 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -59,18 +59,10 @@ namespace osu.Game.Graphics.UserInterface.Volume { base.LoadComplete(); - volumeMeterMaster.Bindable.ValueChanged += volumeChanged; - volumeMeterEffect.Bindable.ValueChanged += volumeChanged; - volumeMeterMusic.Bindable.ValueChanged += volumeChanged; - } - - protected override void Dispose(bool isDisposing) - { - base.Dispose(isDisposing); - - volumeMeterMaster.Bindable.ValueChanged -= volumeChanged; - volumeMeterEffect.Bindable.ValueChanged -= volumeChanged; - volumeMeterMusic.Bindable.ValueChanged -= volumeChanged; + volumeMeterMaster.Bindable.ValueChanged += _ => settingChanged(); + volumeMeterEffect.Bindable.ValueChanged += _ => settingChanged(); + volumeMeterMusic.Bindable.ValueChanged += _ => settingChanged(); + muted.ValueChanged += _ => settingChanged(); } public bool Adjust(GlobalAction action) @@ -98,13 +90,13 @@ namespace osu.Game.Graphics.UserInterface.Volume return false; } - private void volumeChanged(double newVolume) + private void settingChanged() { Show(); schedulePopOut(); } - private readonly BindableDouble muteBindable = new BindableDouble(); + private readonly BindableDouble muteAdjustment = new BindableDouble(); private readonly BindableBool muted = new BindableBool(); @@ -119,12 +111,12 @@ namespace osu.Game.Graphics.UserInterface.Volume { if (mute) { - audio.AddAdjustment(AdjustableProperty.Volume, muteBindable); + audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment); muteIcon.Icon = FontAwesome.fa_volume_off; } else { - audio.RemoveAdjustment(AdjustableProperty.Volume, muteBindable); + audio.RemoveAdjustment(AdjustableProperty.Volume, muteAdjustment); muteIcon.Icon = FontAwesome.fa_volume_up; } }; From fef69cea04049e376a0e29973fb9189cc859aca0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 18:11:38 +0900 Subject: [PATCH 554/628] Revert "Add volume ducking" This reverts commit 01325de3a2897a24b2ba0f585d7e976d0fb44b70. --- osu.Game/Configuration/OsuConfigManager.cs | 3 --- osu.Game/OsuGame.cs | 18 ------------------ .../Settings/Sections/Audio/VolumeSettings.cs | 4 +--- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index c33dd91330..33810c9712 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -39,8 +39,6 @@ namespace osu.Game.Configuration }; // Audio - Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01); - Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); @@ -103,7 +101,6 @@ namespace osu.Game.Configuration MouseDisableButtons, MouseDisableWheel, AudioOffset, - VolumeInactive, MenuMusic, MenuVoice, CursorRotation, diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fbbc14dd5e..bd71d37f97 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -19,7 +19,6 @@ using OpenTK; using System.Linq; using System.Threading; using System.Threading.Tasks; -using osu.Framework.Audio; using osu.Framework.Input.Bindings; using osu.Framework.Platform; using osu.Framework.Threading; @@ -122,8 +121,6 @@ namespace osu.Game configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; - - LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveDuckVolume); } private ScheduledDelegate scoreLoad; @@ -401,21 +398,6 @@ namespace osu.Game return false; } - private readonly BindableDouble inactiveDuckVolume = new BindableDouble(); - - protected override void OnDeactivated() - { - base.OnDeactivated(); - Audio.AddAdjustment(AdjustableProperty.Volume, inactiveDuckVolume); - } - - protected override void OnActivated() - { - base.OnActivated(); - Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveDuckVolume); - - } - public bool OnReleased(GlobalAction action) => false; private Container mainContent; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 92ee01dd7a..40b9ff069b 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; -using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Audio { @@ -13,12 +12,11 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Volume"; [BackgroundDependencyLoader] - private void load(AudioManager audio, OsuConfigManager config) + private void load(AudioManager audio) { Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.1f }, - new SettingsSlider { LabelText = "Master (Window Inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.1f }, }; From 335f0d577c38803d1952168f9925c13cdf5395f4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 18:11:38 +0900 Subject: [PATCH 555/628] Add the ability to duck volume when the game is inactive --- osu.Game/Configuration/OsuConfigManager.cs | 3 +++ osu.Game/OsuGame.cs | 18 ++++++++++++++++++ .../Settings/Sections/Audio/VolumeSettings.cs | 4 +++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 33810c9712..c33dd91330 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -39,6 +39,8 @@ namespace osu.Game.Configuration }; // Audio + Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01); + Set(OsuSetting.MenuVoice, true); Set(OsuSetting.MenuMusic, true); @@ -101,6 +103,7 @@ namespace osu.Game.Configuration MouseDisableButtons, MouseDisableWheel, AudioOffset, + VolumeInactive, MenuMusic, MenuVoice, CursorRotation, diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index bd71d37f97..fed3392460 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -19,6 +19,7 @@ using OpenTK; using System.Linq; using System.Threading; using System.Threading.Tasks; +using osu.Framework.Audio; using osu.Framework.Input.Bindings; using osu.Framework.Platform; using osu.Framework.Threading; @@ -121,6 +122,8 @@ namespace osu.Game configRuleset = LocalConfig.GetBindable(OsuSetting.Ruleset); Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First(); Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0; + + LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust); } private ScheduledDelegate scoreLoad; @@ -398,6 +401,21 @@ namespace osu.Game return false; } + private readonly BindableDouble inactiveVolumeAdjust = new BindableDouble(); + + protected override void OnDeactivated() + { + base.OnDeactivated(); + Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust); + } + + protected override void OnActivated() + { + base.OnActivated(); + Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust); + + } + public bool OnReleased(GlobalAction action) => false; private Container mainContent; diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index 40b9ff069b..92ee01dd7a 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -4,6 +4,7 @@ using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; +using osu.Game.Configuration; namespace osu.Game.Overlays.Settings.Sections.Audio { @@ -12,11 +13,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio protected override string Header => "Volume"; [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(AudioManager audio, OsuConfigManager config) { Children = new Drawable[] { new SettingsSlider { LabelText = "Master", Bindable = audio.Volume, KeyboardStep = 0.1f }, + new SettingsSlider { LabelText = "Master (Window Inactive)", Bindable = config.GetBindable(OsuSetting.VolumeInactive), KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.1f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.1f }, }; From cdf4d9b03371c61ba017d530fddb3629d48c4b4b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 31 Jan 2018 18:33:18 +0900 Subject: [PATCH 556/628] Remove empty line --- osu.Game/OsuGame.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fed3392460..b667bc6876 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -413,7 +413,6 @@ namespace osu.Game { base.OnActivated(); Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust); - } public bool OnReleased(GlobalAction action) => false; From 41329052d91b35827659fe7028b28c15a2d86cba Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Wed, 31 Jan 2018 10:46:03 +0100 Subject: [PATCH 557/628] Updated submodule osu-resources --- osu-resources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-resources b/osu-resources index 7724abdf1d..92ec3d10b1 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 7724abdf1d7c9705ba2e3989a9c604e17ccdc871 +Subproject commit 92ec3d10b12c5e9bfc1d3b05d3db174a506efd6d From b656858ee68929f4cfde511f831885d44d14eaa8 Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Wed, 31 Jan 2018 21:32:10 -0600 Subject: [PATCH 558/628] Fix typos --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index d747dfc2e9..990a932f46 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -73,13 +73,13 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Linear Slider 1 Repeat", () => testLinear(1)); AddStep("Linear Slider 2 Repeats", () => testLinear(2)); - AddStep("Beizer Slider", () => testBeizer()); - AddStep("Beizer Slider 1 Repeat", () => testBeizer(1)); - AddStep("Beizer Slider 2 Repeats", () => testBeizer(2)); + AddStep("Bezier Slider", () => testBeizer()); + AddStep("Bezier Slider 1 Repeat", () => testBeizer(1)); + AddStep("Bezier Slider 2 Repeats", () => testBeizer(2)); - AddStep("Linear Overlaping", () => testLinearOverlaping()); - AddStep("Linear Overlaping 1 Repeat", () => testLinearOverlaping(1)); - AddStep("Linear Overlaping 2 Repeats", () => testLinearOverlaping(2)); + AddStep("Linear Overlapping", () => testLinearOverlaping()); + AddStep("Linear Overlapping 1 Repeat", () => testLinearOverlaping(1)); + AddStep("Linear Overlapping 2 Repeats", () => testLinearOverlaping(2)); // TODO add catmull } From 1b99e54005456315288c837ff662eaef56193064 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 1 Feb 2018 15:21:23 +0900 Subject: [PATCH 559/628] Fix IsMaskedAway not being up-to-date when fastfowarding replays --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 037f9136a8..6a978a3eb3 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -140,6 +140,8 @@ namespace osu.Game.Rulesets.UI if (!base.UpdateSubTree()) return false; + UpdateSubTreeMasking(ScreenSpaceDrawQuad.AABBFloat); + if (isAttached) { // When handling replay input, we need to consider the possibility of fast-forwarding, which may cause the clock to be updated From 1cc7c23982b41129efcbbba2490c252c16e4f944 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 17:48:26 +0900 Subject: [PATCH 560/628] Hits -> JudgedHits --- .../Scoring/TaikoScoreProcessor.cs | 2 +- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs index 9b8bb83bb8..b91f37d84d 100644 --- a/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs +++ b/osu.Game.Rulesets.Taiko/Scoring/TaikoScoreProcessor.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring /// /// Taiko fails at the end of the map if the player has not half-filled their HP bar. /// - protected override bool DefaultFailCondition => Hits == MaxHits && Health.Value <= 0.5; + protected override bool DefaultFailCondition => JudgedHits == MaxHits && Health.Value <= 0.5; private double hpIncreaseTick; private double hpIncreaseGreat; diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index b321123b74..e8271059ca 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -171,10 +171,10 @@ namespace osu.Game.Rulesets.Scoring public readonly Bindable Mode = new Bindable(); - protected sealed override bool HasCompleted => Hits == MaxHits; + protected sealed override bool HasCompleted => JudgedHits == MaxHits; protected int MaxHits { get; private set; } - protected int Hits { get; private set; } + protected int JudgedHits { get; private set; } private double maxHighestCombo; @@ -259,7 +259,7 @@ namespace osu.Game.Rulesets.Scoring baseScore += judgement.NumericResult; rollingMaxBaseScore += judgement.MaxNumericResult; - Hits++; + JudgedHits++; } else if (judgement.IsHit) bonusScore += judgement.NumericResult; @@ -279,7 +279,7 @@ namespace osu.Game.Rulesets.Scoring baseScore -= judgement.NumericResult; rollingMaxBaseScore -= judgement.MaxNumericResult; - Hits--; + JudgedHits--; } else if (judgement.IsHit) bonusScore -= judgement.NumericResult; @@ -305,14 +305,14 @@ namespace osu.Game.Rulesets.Scoring { if (storeResults) { - MaxHits = Hits; + MaxHits = JudgedHits; maxHighestCombo = HighestCombo; maxBaseScore = baseScore; } base.Reset(storeResults); - Hits = 0; + JudgedHits = 0; baseScore = 0; rollingMaxBaseScore = 0; bonusScore = 0; From daac7494dd67a04e303c1cd235537e706d3750b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 17:48:42 +0900 Subject: [PATCH 561/628] Fix incorrect offset check for DrawableCatchHitObjects --- .../Objects/Drawable/DrawableCatchHitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs index 05ef947e4b..8d56fc1081 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableCatchHitObject.cs @@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { if (CheckPosition == null) return; - if (timeOffset > 0) + if (timeOffset >= 0) AddJudgement(new Judgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss }); } From 3bd42e3c85a72e5c3aa8943b9aad123606dac5ce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 17:48:59 +0900 Subject: [PATCH 562/628] Fix catch never hitting result screen --- .../Objects/Drawable/DrawableJuiceStream.cs | 2 ++ osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs index c8b15aec61..965ca62674 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableJuiceStream.cs @@ -26,6 +26,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable AddNested(getVisualRepresentation?.Invoke(o)); } + protected override bool ProvidesJudgement => false; + protected override void AddNested(DrawableHitObject h) { var catchObject = (DrawableCatchHitObject)h; diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 6df9498881..0a8a53c6f1 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -24,17 +24,13 @@ namespace osu.Game.Rulesets.Catch.Scoring switch (obj) { case JuiceStream stream: - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - foreach (var _ in stream.NestedHitObjects.Cast()) AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); break; case BananaShower shower: - AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); - foreach (var _ in shower.NestedHitObjects.Cast()) AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); break; case Fruit _: AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); From 1d687c470cc83ef7a68e79e0191c120faccb1fd0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 18:49:07 +0900 Subject: [PATCH 563/628] Fix clock not incrementing beyond last frame of replay --- .../Rulesets/Replays/FramedReplayInputHandler.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs index 913214abfb..c245407bbf 100644 --- a/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs +++ b/osu.Game/Rulesets/Replays/FramedReplayInputHandler.cs @@ -102,8 +102,14 @@ namespace osu.Game.Rulesets.Replays if (hasFrames) { - //if we changed frames, we want to execute once *exactly* on the frame's time. - if (currentDirection == time.CompareTo(NextFrame.Time) && advanceFrame()) + // check if the next frame is in the "future" for the current playback direction + if (currentDirection != time.CompareTo(NextFrame.Time)) + { + // if we didn't change frames, we need to ensure we are allowed to run frames in between, else return null. + if (inImportantSection) + return null; + } + else if (advanceFrame()) { // If going backwards, we need to execute once _before_ the frame time to reverse any judgements // that would occur as a result of this frame in forward playback @@ -111,10 +117,6 @@ namespace osu.Game.Rulesets.Replays return currentTime = CurrentFrame.Time - 1; return currentTime = CurrentFrame.Time; } - - //if we didn't change frames, we need to ensure we are allowed to run frames in between, else return null. - if (inImportantSection) - return null; } return currentTime = time; From 71be95f743dc8341a168e6db2157b1a46434c8a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 19:25:22 +0900 Subject: [PATCH 564/628] Bring framework up-to-date --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 90bf49a2df..d89e6cd631 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 90bf49a2df3dbad5994d922df63e4891c622dbc3 +Subproject commit d89e6cd63140c2b73631b79ff83b130a2b9958ed From 468205d450eac1706f46d25eeeb119985f453bd5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Feb 2018 19:22:31 +0900 Subject: [PATCH 565/628] Fix osu!catch autoplay missing bananas when running above 1x playback speed --- osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs | 10 +++++----- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs index 7f56c3bbb1..39b7ffb387 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchPlayfield.cs @@ -35,10 +35,6 @@ namespace osu.Game.Rulesets.Catch.UI ScaledContent.AddRange(new Drawable[] { - content = new Container - { - RelativeSizeAxes = Axes.Both, - }, explodingFruitContainer = new Container { RelativeSizeAxes = Axes.Both, @@ -49,7 +45,11 @@ namespace osu.Game.Rulesets.Catch.UI ExplodingFruitTarget = explodingFruitContainer, Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, - } + }, + content = new Container + { + RelativeSizeAxes = Axes.Both, + }, }); } diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 5252ba294a..7c548f70d4 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -84,9 +84,9 @@ namespace osu.Game.Rulesets.Catch.UI } } - protected override void Update() + protected override void UpdateAfterChildren() { - base.Update(); + base.UpdateAfterChildren(); var state = GetContainingInputManager().CurrentState as CatchFramedReplayInputHandler.CatchReplayState; From 13f16077d452333ac0e62948fa5fa886f0fdab7b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 1 Feb 2018 20:04:41 +0900 Subject: [PATCH 566/628] Implement Catmull-Rom curve approximator --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 34 +++++++++ .../Rulesets/Objects/CatmullApproximator.cs | 70 +++++++++++++++++++ osu.Game/Rulesets/Objects/SliderCurve.cs | 2 + osu.Game/osu.Game.csproj | 1 + 4 files changed, 107 insertions(+) create mode 100644 osu.Game/Rulesets/Objects/CatmullApproximator.cs diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index b8e04de880..ea3ad88cdd 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -19,6 +19,7 @@ using System.Linq; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Tests @@ -71,6 +72,10 @@ namespace osu.Game.Rulesets.Osu.Tests AddStep("Fast Short Slider 6 Repeats", () => testShortHighSpeed(6)); AddStep("Perfect Curve", testCurve); + + AddStep("Catmull", () => testCatmull()); + AddStep("Catmull 1 Repeat", () => testCatmull(1)); + // TODO more curve types? } @@ -131,6 +136,35 @@ namespace osu.Game.Rulesets.Osu.Tests addSlider(slider, 2, 3); } + private void testCatmull(int repeats = 0) => createCatmull(repeats); + + private void createCatmull(int repeats = 0) + { + var repeatSamples = new List>(); + for (int i = 0; i < repeats; i++) + repeatSamples.Add(new List()); + + var slider = new Slider + { + StartTime = Time.Current + 1000, + Position = new Vector2(-100, 0), + ComboColour = Color4.LightSeaGreen, + CurveType = CurveType.Catmull, + ControlPoints = new List + { + new Vector2(-100, 0), + new Vector2(-50, -50), + new Vector2(50, 50), + new Vector2(100, 0) + }, + Distance = 300, + RepeatCount = repeats, + RepeatSamples = repeatSamples + }; + + addSlider(slider, 3, 1); + } + private void addSlider(Slider slider, float circleSize, double speedMultiplier) { var cpi = new ControlPointInfo(); diff --git a/osu.Game/Rulesets/Objects/CatmullApproximator.cs b/osu.Game/Rulesets/Objects/CatmullApproximator.cs new file mode 100644 index 0000000000..364b4e995a --- /dev/null +++ b/osu.Game/Rulesets/Objects/CatmullApproximator.cs @@ -0,0 +1,70 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using OpenTK; + +namespace osu.Game.Rulesets.Objects +{ + public class CatmullApproximator + { + /// + /// The amount of pieces to calculate for each controlpoint quadruplet. + /// + private const int detail = 50; + + private readonly List controlPoints; + + public CatmullApproximator(List controlPoints) + { + this.controlPoints = controlPoints; + } + + + /// + /// Creates a piecewise-linear approximation of a Catmull-Rom spline. + /// + /// A list of vectors representing the piecewise-linear approximation. + public List CreateCatmull() + { + var result = new List(); + + for (int i = 0; i < controlPoints.Count - 1; i++) + { + var v1 = i > 0 ? controlPoints[i - 1] : controlPoints[i]; + var v2 = controlPoints[i]; + var v3 = i < controlPoints.Count - 1 ? controlPoints[i + 1] : v2 + v2 - v1; + var v4 = i < controlPoints.Count - 2 ? controlPoints[i + 2] : v3 + v3 - v2; + + for (int c = 0; c < detail; c++) + { + result.Add(findPoint(ref v1, ref v2, ref v3, ref v4, (float)c / detail)); + result.Add(findPoint(ref v1, ref v2, ref v3, ref v4, (float)(c + 1) / detail)); + } + } + + return result; + } + + /// + /// Finds a point on the spline at the position of a parameter. + /// + /// The first vector. + /// The second vector. + /// The third vector. + /// The fourth vector. + /// The parameter at which to find the point on the spline, in the range [0, 1]. + /// The point on the spline at . + private Vector2 findPoint(ref Vector2 vec1, ref Vector2 vec2, ref Vector2 vec3, ref Vector2 vec4, float t) + { + float t2 = t * t; + float t3 = t * t2; + + Vector2 result; + result.X = 0.5f * (2f * vec2.X + (-vec1.X + vec3.X) * t + (2f * vec1.X - 5f * vec2.X + 4f * vec3.X - vec4.X) * t2 + (-vec1.X + 3f * vec2.X - 3f * vec3.X + vec4.X) * t3); + result.Y = 0.5f * (2f * vec2.Y + (-vec1.Y + vec3.Y) * t + (2f * vec1.Y - 5f * vec2.Y + 4f * vec3.Y - vec4.Y) * t2 + (-vec1.Y + 3f * vec2.Y - 3f * vec3.Y + vec4.Y) * t3); + + return result; + } + } +} diff --git a/osu.Game/Rulesets/Objects/SliderCurve.cs b/osu.Game/Rulesets/Objects/SliderCurve.cs index ae79d62ec8..2b16f463df 100644 --- a/osu.Game/Rulesets/Objects/SliderCurve.cs +++ b/osu.Game/Rulesets/Objects/SliderCurve.cs @@ -41,6 +41,8 @@ namespace osu.Game.Rulesets.Objects break; return subpath; + case CurveType.Catmull: + return new CatmullApproximator(subControlPoints).CreateCatmull(); } return new BezierApproximator(subControlPoints).CreateBezier(); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 12e2f45d76..4944613828 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -340,6 +340,7 @@ + From e08a9350a0d55f4c86eed522a116cffc66ed6b8f Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Thu, 1 Feb 2018 15:19:49 +0100 Subject: [PATCH 567/628] Store and show SSPlus and SPlus statistics --- osu.Game/Overlays/Profile/ProfileHeader.cs | 7 ++++--- osu.Game/Users/UserStatistics.cs | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 937b4efcad..60723ad29e 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -396,16 +396,17 @@ namespace osu.Game.Overlays.Profile scoreText.Add(createScoreText("Replays Watched by Others")); scoreNumberText.Add(createScoreNumberText(user.Statistics.ReplaysWatched.ToString(@"#,0"))); + gradeSSPlus.DisplayCount = user.Statistics.GradesCount.SSPlus; + gradeSSPlus.Show(); gradeSS.DisplayCount = user.Statistics.GradesCount.SS; gradeSS.Show(); + gradeSPlus.DisplayCount = user.Statistics.GradesCount.SPlus; + gradeSPlus.Show(); gradeS.DisplayCount = user.Statistics.GradesCount.S; gradeS.Show(); gradeA.DisplayCount = user.Statistics.GradesCount.A; gradeA.Show(); - gradeSPlus.DisplayCount = 0; - gradeSSPlus.DisplayCount = 0; - rankGraph.User.Value = user; } } diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index 6f814e43bd..73d20eafb9 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -51,9 +51,15 @@ namespace osu.Game.Users public struct Grades { + [JsonProperty(@"ssh")] + public int SSPlus; + [JsonProperty(@"ss")] public int SS; + [JsonProperty(@"sh")] + public int SPlus; + [JsonProperty(@"s")] public int S; From b0fbae9dfce5ce75a0faffe99ef3665ba3ef7b14 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Thu, 1 Feb 2018 16:07:49 +0100 Subject: [PATCH 568/628] Fix PlayerSettingsOverlay not reappearing when Hidden --- osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs index 0f10721425..e6cf1f7982 100644 --- a/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs +++ b/osu.Game/Screens/Play/HUD/PlayerSettingsOverlay.cs @@ -49,6 +49,9 @@ namespace osu.Game.Screens.Play.HUD protected override void PopIn() => this.FadeIn(fade_duration); protected override void PopOut() => this.FadeOut(fade_duration); + //We want to handle keyboard inputs all the time in order to trigger ToggleVisibility() when not visible + public override bool HandleKeyboardInput => true; + protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) { if (args.Repeat) return false; From 39160d895ce7412a5a6f1117f429b70713e5ab06 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 2 Feb 2018 15:18:39 +0900 Subject: [PATCH 569/628] Update design of "revert to default" button Also fixes some inconsistencies in padding --- osu.Game/Overlays/Settings/SettingsItem.cs | 98 ++++++++++++---------- osu.Game/Overlays/SettingsOverlay.cs | 2 +- 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index b58b99f1e3..adb7c509c0 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -7,7 +7,6 @@ using OpenTK.Graphics; using osu.Framework.Configuration; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; @@ -16,6 +15,7 @@ using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using OpenTK; namespace osu.Game.Overlays.Settings { @@ -33,22 +33,10 @@ namespace osu.Game.Overlays.Settings private SpriteText text; - private readonly RestoreDefaultValueButton restoreDefaultValueButton = new RestoreDefaultValueButton(); + private readonly RestoreDefaultValueButton restoreDefaultButton; public bool ShowsDefaultIndicator = true; - private Color4? restoreDefaultValueColour; - - public Color4 RestoreDefaultValueColour - { - get { return restoreDefaultValueColour ?? Color4.White; } - set - { - restoreDefaultValueColour = value; - restoreDefaultValueButton?.SetButtonColour(RestoreDefaultValueColour); - } - } - public virtual string LabelText { get { return text?.Text ?? string.Empty; } @@ -69,10 +57,7 @@ namespace osu.Game.Overlays.Settings public virtual Bindable Bindable { - get - { - return bindable; - } + get { return bindable; } set { @@ -80,8 +65,8 @@ namespace osu.Game.Overlays.Settings controlWithCurrent?.Current.BindTo(bindable); if (ShowsDefaultIndicator) { - restoreDefaultValueButton.Bindable = bindable.GetBoundCopy(); - restoreDefaultValueButton.Bindable.TriggerChange(); + restoreDefaultButton.Bindable = bindable.GetBoundCopy(); + restoreDefaultButton.Bindable.TriggerChange(); } } } @@ -103,38 +88,30 @@ namespace osu.Game.Overlays.Settings AutoSizeAxes = Axes.Y; Padding = new MarginPadding { Right = SettingsOverlay.CONTENT_MARGINS }; - FlowContent = new FillFlowContainer + InternalChildren = new Drawable[] { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Padding = new MarginPadding { Left = SettingsOverlay.CONTENT_MARGINS, Right = 5 }, + restoreDefaultButton = new RestoreDefaultValueButton(), + FlowContent = new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding { Left = SettingsOverlay.CONTENT_MARGINS }, + Child = Control = CreateControl() + }, }; - - if ((Control = CreateControl()) != null) - { - if (controlWithCurrent != null) - controlWithCurrent.Current.DisabledChanged += disabled => { Colour = disabled ? Color4.Gray : Color4.White; }; - FlowContent.Add(Control); - } } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load() { - AddInternal(FlowContent); - - if (restoreDefaultValueButton != null) - { - if (!restoreDefaultValueColour.HasValue) - restoreDefaultValueColour = colours.Yellow; - restoreDefaultValueButton.SetButtonColour(RestoreDefaultValueColour); - AddInternal(restoreDefaultValueButton); - } + if (controlWithCurrent != null) + controlWithCurrent.Current.DisabledChanged += disabled => { Colour = disabled ? Color4.Gray : Color4.White; }; } - private class RestoreDefaultValueButton : Box, IHasTooltip + private class RestoreDefaultValueButton : Container, IHasTooltip { private Bindable bindable; + public Bindable Bindable { get { return bindable; } @@ -157,6 +134,36 @@ namespace osu.Game.Overlays.Settings Alpha = 0f; } + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + buttonColour = colour.Yellow; + + Child = new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + CornerRadius = 3, + Masking = true, + Colour = buttonColour, + EdgeEffect = new EdgeEffectParameters + { + Colour = buttonColour.Opacity(0.1f), + Type = EdgeEffectType.Glow, + Radius = 2, + }, + Size = new Vector2(0.33f, 0.8f), + Child = new Box { RelativeSizeAxes = Axes.Both }, + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + UpdateState(); + } + public string TooltipText => "Revert to default"; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; @@ -193,9 +200,10 @@ namespace osu.Game.Overlays.Settings { if (bindable == null) return; - var colour = bindable.Disabled ? Color4.Gray : buttonColour; - this.FadeTo(bindable.IsDefault ? 0f : hovering && !bindable.Disabled ? 1f : 0.5f, 200, Easing.OutQuint); - this.FadeColour(ColourInfo.GradientHorizontal(colour.Opacity(0.8f), colour.Opacity(0)), 200, Easing.OutQuint); + + this.FadeTo(bindable.IsDefault ? 0f : + hovering && !bindable.Disabled ? 1f : 0.65f, 200, Easing.OutQuint); + this.FadeColour(bindable.Disabled ? Color4.Gray : buttonColour, 200, Easing.OutQuint); } } } diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index 277ed81ce8..c003046242 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays { public abstract class SettingsOverlay : OsuFocusedOverlayContainer { - public const float CONTENT_MARGINS = 10; + public const float CONTENT_MARGINS = 15; public const float TRANSITION_LENGTH = 600; From 75858bd3de8aac60338782c845e4fcf13591287d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 15:41:54 +0900 Subject: [PATCH 570/628] Update in-line with framework changes --- osu.Game/Rulesets/UI/RulesetInputManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 6a978a3eb3..f465d0e202 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -140,7 +140,7 @@ namespace osu.Game.Rulesets.UI if (!base.UpdateSubTree()) return false; - UpdateSubTreeMasking(ScreenSpaceDrawQuad.AABBFloat); + UpdateSubTreeMasking(this, ScreenSpaceDrawQuad.AABBFloat); if (isAttached) { From a0c1662fb7db323ff348aca6c4d1b50f3c868b34 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 17:52:55 +0900 Subject: [PATCH 571/628] Move mania's HitWindows to osu.Game --- osu.Game.Rulesets.Mania/Objects/Note.cs | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 1 - .../Judgements => osu.Game/Rulesets/Objects}/HitWindows.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) rename {osu.Game.Rulesets.Mania/Judgements => osu.Game/Rulesets/Objects}/HitWindows.cs (96%) diff --git a/osu.Game.Rulesets.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs index 9b40a320f9..faeee8d4ee 100644 --- a/osu.Game.Rulesets.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Mania.Judgements; +using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Mania.Objects { diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index b9e7f8e60f..eeaef31874 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -64,7 +64,6 @@ - diff --git a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs similarity index 96% rename from osu.Game.Rulesets.Mania/Judgements/HitWindows.cs rename to osu.Game/Rulesets/Objects/HitWindows.cs index 43078a926e..ab2de7558a 100644 --- a/osu.Game.Rulesets.Mania/Judgements/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -4,7 +4,7 @@ using osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring; -namespace osu.Game.Rulesets.Mania.Judgements +namespace osu.Game.Rulesets.Objects { public class HitWindows { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4944613828..58908570ff 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -339,6 +339,7 @@ + From 558c53a6baa0931e223a47c6f18433602d939e5e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:47:10 +0900 Subject: [PATCH 572/628] Give HitObject some HitWindows --- osu.Game/Rulesets/Objects/HitObject.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/Rulesets/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs index 160d639e8e..ae9ed2b357 100644 --- a/osu.Game/Rulesets/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -49,6 +49,15 @@ namespace osu.Game.Rulesets.Objects [JsonIgnore] public bool Kiai { get; private set; } + private float overallDifficulty = BeatmapDifficulty.DEFAULT_DIFFICULTY; + + private HitWindows hitWindows; + + /// + /// The keypress hit windows for this . + /// + public HitWindows HitWindows => hitWindows ?? (hitWindows = new HitWindows(overallDifficulty)); + private readonly SortedList nestedHitObjects = new SortedList((h1, h2) => h1.StartTime.CompareTo(h2.StartTime)); [JsonIgnore] @@ -75,6 +84,9 @@ namespace osu.Game.Rulesets.Objects Kiai = effectPoint.KiaiMode; SampleControlPoint = samplePoint; + + overallDifficulty = difficulty.OverallDifficulty; + hitWindows = null; } protected virtual void CreateNestedHitObjects() From acf20c079cbd201c6dd77135b581bc625491c184 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:47:54 +0900 Subject: [PATCH 573/628] General improvements around usage of HitWindows for mania --- .../Objects/Drawables/DrawableHoldNote.cs | 10 ++- .../Objects/Drawables/DrawableNote.cs | 10 ++- osu.Game/Rulesets/Objects/HitWindows.cs | 72 +++++++++++-------- 3 files changed, 50 insertions(+), 42 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 57a4888b2b..9d1088f69d 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Linq; using osu.Game.Rulesets.Objects.Drawables; using osu.Framework.Graphics; @@ -212,7 +211,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (!userTriggered) { - if (timeOffset > HitObject.HitWindows.Bad / 2) + if (!HitObject.HitWindows.CanBeHit(timeOffset)) { AddJudgement(new HoldNoteTailJudgement { @@ -224,14 +223,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables return; } - double offset = Math.Abs(timeOffset); - - if (offset > HitObject.HitWindows.Miss / 2) + var result = HitObject.HitWindows.ResultFor(timeOffset); + if (result == null) return; AddJudgement(new HoldNoteTailJudgement { - Result = HitObject.HitWindows.ResultFor(offset) ?? HitResult.Miss, + Result = result.Value, HasBroken = holdNote.hasBroken }); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 101db0205c..a9a0741370 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Input.Bindings; @@ -63,17 +62,16 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables { if (!userTriggered) { - if (timeOffset > HitObject.HitWindows.Bad / 2) + if (!HitObject.HitWindows.CanBeHit(timeOffset)) AddJudgement(new ManiaJudgement { Result = HitResult.Miss }); return; } - double offset = Math.Abs(timeOffset); - - if (offset > HitObject.HitWindows.Miss / 2) + var result = HitObject.HitWindows.ResultFor(timeOffset); + if (result == null) return; - AddJudgement(new ManiaJudgement { Result = HitObject.HitWindows.ResultFor(offset) ?? HitResult.Miss }); + AddJudgement(new ManiaJudgement { Result = result.Value }); } protected override void UpdateState(ArmedState state) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index ab2de7558a..57e3d0a976 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring; @@ -144,57 +145,68 @@ namespace osu.Game.Rulesets.Objects /// /// Retrieves the hit result for a time offset. /// - /// The time offset. - /// The hit result, or null if the time offset results in a miss. - public HitResult? ResultFor(double hitOffset) + /// The time offset. This should always be a positive value indicating the absolute time offset. + /// The hit result, or null if doesn't result in a judgement. + public HitResult? ResultFor(double timeOffset) { - if (hitOffset <= Perfect / 2) + timeOffset = Math.Abs(timeOffset); + + if (timeOffset <= Perfect / 2) return HitResult.Perfect; - if (hitOffset <= Great / 2) + if (timeOffset <= Great / 2) return HitResult.Great; - if (hitOffset <= Good / 2) + if (timeOffset <= Good / 2) return HitResult.Good; - if (hitOffset <= Ok / 2) + if (timeOffset <= Ok / 2) return HitResult.Ok; - if (hitOffset <= Bad / 2) + if (timeOffset <= Bad / 2) return HitResult.Meh; + if (timeOffset <= Miss / 2) + return HitResult.Miss; + return null; } /// - /// Constructs new hit windows which have been multiplied by a value. + /// Given a time offset, whether the can ever be hit in the future. + /// This happens if > . /// - /// The original hit windows. + /// The time offset. + /// Whether the can be hit at any point in the future from this time offset. + public bool CanBeHit(double timeOffset) => timeOffset <= Bad / 2; + + /// + /// Multiplies all hit windows by a value. + /// + /// The hit windows to multiply. /// The value to multiply each hit window by. public static HitWindows operator *(HitWindows windows, double value) { - return new HitWindows - { - Perfect = windows.Perfect * value, - Great = windows.Great * value, - Good = windows.Good * value, - Ok = windows.Ok * value, - Bad = windows.Bad * value, - Miss = windows.Miss * value - }; + windows.Perfect *= value; + windows.Great *= value; + windows.Good *= value; + windows.Ok *= value; + windows.Bad *= value; + windows.Miss *= value; + + return windows; } /// - /// Constructs new hit windows which have been divided by a value. + /// Divides all hit windows by a value. /// - /// The original hit windows. + /// The hit windows to divide. /// The value to divide each hit window by. public static HitWindows operator /(HitWindows windows, double value) { - return new HitWindows - { - Perfect = windows.Perfect / value, - Great = windows.Great / value, - Good = windows.Good / value, - Ok = windows.Ok / value, - Bad = windows.Bad / value, - Miss = windows.Miss / value - }; + windows.Perfect /= value; + windows.Great /= value; + windows.Good /= value; + windows.Ok /= value; + windows.Bad /= value; + windows.Miss /= value; + + return windows; } } } From 70462ebee3b39bc25902a3238a0cb8ca87f16c5d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:53:05 +0900 Subject: [PATCH 574/628] Make HitWindows settable by derived HitObjects --- osu.Game/Rulesets/Objects/HitObject.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs index ae9ed2b357..64dc94fe16 100644 --- a/osu.Game/Rulesets/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -56,7 +56,11 @@ namespace osu.Game.Rulesets.Objects /// /// The keypress hit windows for this . /// - public HitWindows HitWindows => hitWindows ?? (hitWindows = new HitWindows(overallDifficulty)); + public HitWindows HitWindows + { + get => hitWindows ?? (hitWindows = new HitWindows(overallDifficulty)); + protected set => hitWindows = value; + } private readonly SortedList nestedHitObjects = new SortedList((h1, h2) => h1.StartTime.CompareTo(h2.StartTime)); From 15fe1a7966ebc7b654c0311ae35c217bf7442a4e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:53:18 +0900 Subject: [PATCH 575/628] Remove mania's custom storage of HitWindows --- osu.Game.Rulesets.Mania/Objects/Note.cs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Note.cs b/osu.Game.Rulesets.Mania/Objects/Note.cs index faeee8d4ee..438116b363 100644 --- a/osu.Game.Rulesets.Mania/Objects/Note.cs +++ b/osu.Game.Rulesets.Mania/Objects/Note.cs @@ -1,11 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using Newtonsoft.Json; -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Objects; - namespace osu.Game.Rulesets.Mania.Objects { /// @@ -13,17 +8,5 @@ namespace osu.Game.Rulesets.Mania.Objects /// public class Note : ManiaHitObject { - /// - /// The key-press hit window for this note. - /// - [JsonIgnore] - public HitWindows HitWindows { get; protected set; } = new HitWindows(); - - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) - { - base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - - HitWindows = new HitWindows(difficulty.OverallDifficulty); - } } } From 9bc4bf33a6c9f3183b8b7c67a7db28a9a14e3c96 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:53:30 +0900 Subject: [PATCH 576/628] Use HitWindows for taiko --- .../Objects/Drawables/DrawableHit.cs | 17 +++++------- osu.Game.Rulesets.Taiko/Objects/Hit.cs | 26 ------------------- 2 files changed, 7 insertions(+), 36 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 38188f89f3..1b8d95c0cf 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -38,30 +38,27 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { if (!userTriggered) { - if (timeOffset > HitObject.HitWindowGood) + if (!HitObject.HitWindows.CanBeHit(timeOffset)) AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); return; } - double hitOffset = Math.Abs(timeOffset); - - if (hitOffset > HitObject.HitWindowMiss) + var result = HitObject.HitWindows.ResultFor(Math.Abs(timeOffset)); + if (result == null) return; - if (!validKeyPressed) + if (!validKeyPressed || result == HitResult.Miss) AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); - else if (hitOffset < HitObject.HitWindowGood) + else { AddJudgement(new TaikoJudgement { - Result = hitOffset < HitObject.HitWindowGreat ? HitResult.Great : HitResult.Good, + Result = result.Value, Final = !HitObject.IsStrong }); SecondHitAllowed = true; } - else - AddJudgement(new TaikoJudgement { Result = HitResult.Miss }); } public override bool OnPressed(TaikoAction action) @@ -90,7 +87,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables switch (State.Value) { case ArmedState.Idle: - this.Delay(HitObject.HitWindowMiss).Expire(); + this.Delay(HitObject.HitWindows.Miss / 2).Expire(); break; case ArmedState.Miss: this.FadeOut(100) diff --git a/osu.Game.Rulesets.Taiko/Objects/Hit.cs b/osu.Game.Rulesets.Taiko/Objects/Hit.cs index 531f4b82f6..c91a1f1714 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Hit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Hit.cs @@ -1,35 +1,9 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Game.Beatmaps; -using osu.Game.Beatmaps.ControlPoints; - namespace osu.Game.Rulesets.Taiko.Objects { public class Hit : TaikoHitObject { - /// - /// The hit window that results in a "GREAT" hit. - /// - public double HitWindowGreat = 35; - - /// - /// The hit window that results in a "GOOD" hit. - /// - public double HitWindowGood = 80; - - /// - /// The hit window that results in a "MISS". - /// - public double HitWindowMiss = 95; - - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) - { - base.ApplyDefaultsToSelf(controlPointInfo, difficulty); - - HitWindowGreat = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 50, 35, 20); - HitWindowGood = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 120, 80, 50); - HitWindowMiss = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 135, 95, 70); - } } } From d371425c875cbbdddf932b791163d9a688fa2f78 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 18:56:44 +0900 Subject: [PATCH 577/628] BAD -> MEH --- osu.Game/Rulesets/Objects/HitWindows.cs | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 57e3d0a976..a7ffd5eb72 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -64,17 +64,17 @@ namespace osu.Game.Rulesets.Objects private const double ok_max = 254; /// - /// BAD hit window at OD = 10. + /// MEH hit window at OD = 10. /// - private const double bad_min = 242; + private const double meh_min = 242; /// - /// BAD hit window at OD = 5. + /// MEH hit window at OD = 5. /// - private const double bad_mid = 272; + private const double meh_mid = 272; /// - /// BAD hit window at OD = 0. + /// MEH hit window at OD = 0. /// - private const double bad_max = 302; + private const double meh_max = 302; /// /// MISS hit window at OD = 10. @@ -112,9 +112,9 @@ namespace osu.Game.Rulesets.Objects public double Ok = ok_mid; /// - /// Hit window for a BAD hit. + /// Hit window for a MEH hit. /// - public double Bad = bad_mid; + public double Meh = meh_mid; /// /// Hit window for a MISS hit. @@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Objects Great = BeatmapDifficulty.DifficultyRange(difficulty, great_max, great_mid, great_min); Good = BeatmapDifficulty.DifficultyRange(difficulty, good_max, good_mid, good_min); Ok = BeatmapDifficulty.DifficultyRange(difficulty, ok_max, ok_mid, ok_min); - Bad = BeatmapDifficulty.DifficultyRange(difficulty, bad_max, bad_mid, bad_min); + Meh = BeatmapDifficulty.DifficultyRange(difficulty, meh_max, meh_mid, meh_min); Miss = BeatmapDifficulty.DifficultyRange(difficulty, miss_max, miss_mid, miss_min); } @@ -159,7 +159,7 @@ namespace osu.Game.Rulesets.Objects return HitResult.Good; if (timeOffset <= Ok / 2) return HitResult.Ok; - if (timeOffset <= Bad / 2) + if (timeOffset <= Meh / 2) return HitResult.Meh; if (timeOffset <= Miss / 2) return HitResult.Miss; @@ -169,11 +169,11 @@ namespace osu.Game.Rulesets.Objects /// /// Given a time offset, whether the can ever be hit in the future. - /// This happens if > . + /// This happens if > . /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= Bad / 2; + public bool CanBeHit(double timeOffset) => timeOffset <= Meh / 2; /// /// Multiplies all hit windows by a value. @@ -186,7 +186,7 @@ namespace osu.Game.Rulesets.Objects windows.Great *= value; windows.Good *= value; windows.Ok *= value; - windows.Bad *= value; + windows.Meh *= value; windows.Miss *= value; return windows; @@ -203,7 +203,7 @@ namespace osu.Game.Rulesets.Objects windows.Great /= value; windows.Good /= value; windows.Ok /= value; - windows.Bad /= value; + windows.Meh /= value; windows.Miss /= value; return windows; From e45b26c742048cfe825005832e936d7115afa96c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 19:35:44 +0900 Subject: [PATCH 578/628] Cleanup/minify HitWindows --- osu.Game/Beatmaps/BeatmapDifficulty.cs | 12 ++ osu.Game/Rulesets/Objects/HitWindows.cs | 168 +++++++----------------- 2 files changed, 57 insertions(+), 123 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index 5be786a8e2..570faaea0a 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -40,5 +40,17 @@ namespace osu.Game.Beatmaps return mid - (mid - min) * (5 - difficulty) / 5; return mid; } + + /// + /// Maps a difficulty value [0, 10] to a two-piece linear range of values. + /// + /// The difficulty value to be mapped. + /// The values that define the two linear ranges. + /// Minimum of the resulting range which will be achieved by a difficulty value of 0. + /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. + /// Maximum of the resulting range which will be achieved by a difficulty value of 10. + /// Value to which the difficulty value maps in the specified range. + public static double DifficultyRange(double difficulty, (double min, double mid, double max) range) + => DifficultyRange(difficulty, range.min, range.mid, range.max); } } diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index a7ffd5eb72..8fa6bb5e8b 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.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 osu.Game.Beatmaps; using osu.Game.Rulesets.Scoring; @@ -9,124 +10,45 @@ namespace osu.Game.Rulesets.Objects { public class HitWindows { - #region Constants - - /// - /// PERFECT hit window at OD = 10. - /// - private const double perfect_min = 27.8; - /// - /// PERFECT hit window at OD = 5. - /// - private const double perfect_mid = 38.8; - /// - /// PERFECT hit window at OD = 0. - /// - private const double perfect_max = 44.8; - - /// - /// GREAT hit window at OD = 10. - /// - private const double great_min = 68; - /// - /// GREAT hit window at OD = 5. - /// - private const double great_mid = 98; - /// - /// GREAT hit window at OD = 0. - /// - private const double great_max = 128; - - /// - /// GOOD hit window at OD = 10. - /// - private const double good_min = 134; - /// - /// GOOD hit window at OD = 5. - /// - private const double good_mid = 164; - /// - /// GOOD hit window at OD = 0. - /// - private const double good_max = 194; - - /// - /// OK hit window at OD = 10. - /// - private const double ok_min = 194; - /// - /// OK hit window at OD = 5. - /// - private const double ok_mid = 224; - /// - /// OK hit window at OD = 0. - /// - private const double ok_max = 254; - - /// - /// MEH hit window at OD = 10. - /// - private const double meh_min = 242; - /// - /// MEH hit window at OD = 5. - /// - private const double meh_mid = 272; - /// - /// MEH hit window at OD = 0. - /// - private const double meh_max = 302; - - /// - /// MISS hit window at OD = 10. - /// - private const double miss_min = 316; - /// - /// MISS hit window at OD = 5. - /// - private const double miss_mid = 346; - /// - /// MISS hit window at OD = 0. - /// - private const double miss_max = 376; - - #endregion - - /// - /// Hit window for a PERFECT hit. - /// - public double Perfect = perfect_mid; - - /// - /// Hit window for a GREAT hit. - /// - public double Great = great_mid; - - /// - /// Hit window for a GOOD hit. - /// - public double Good = good_mid; - - /// - /// Hit window for an OK hit. - /// - public double Ok = ok_mid; - - /// - /// Hit window for a MEH hit. - /// - public double Meh = meh_mid; - - /// - /// Hit window for a MISS hit. - /// - public double Miss = miss_mid; - - /// - /// Constructs default hit windows. - /// - public HitWindows() + private static readonly IReadOnlyDictionary base_ranges = new Dictionary { - } + { HitResult.Perfect, (44.8, 38.8, 27.8) }, + { HitResult.Great, (128, 98, 68 ) }, + { HitResult.Good, (194, 164, 134) }, + { HitResult.Ok, (254, 224, 194) }, + { HitResult.Meh, (382, 272, 242) }, + { HitResult.Miss, (376, 346, 316) }, + }; + + /// + /// Hit window for a hit. + /// + public double Perfect; + + /// + /// Hit window for a hit. + /// + public double Great; + + /// + /// Hit window for a hit. + /// + public double Good; + + /// + /// Hit window for an hit. + /// + public double Ok; + + /// + /// Hit window for a hit. + /// + public double Meh; + + /// + /// Hit window for a hit. + /// + public double Miss; /// /// Constructs hit windows by fitting a parameter to a 2-part piecewise linear function for each hit window. @@ -134,12 +56,12 @@ namespace osu.Game.Rulesets.Objects /// The parameter. public HitWindows(double difficulty) { - Perfect = BeatmapDifficulty.DifficultyRange(difficulty, perfect_max, perfect_mid, perfect_min); - Great = BeatmapDifficulty.DifficultyRange(difficulty, great_max, great_mid, great_min); - Good = BeatmapDifficulty.DifficultyRange(difficulty, good_max, good_mid, good_min); - Ok = BeatmapDifficulty.DifficultyRange(difficulty, ok_max, ok_mid, ok_min); - Meh = BeatmapDifficulty.DifficultyRange(difficulty, meh_max, meh_mid, meh_min); - Miss = BeatmapDifficulty.DifficultyRange(difficulty, miss_max, miss_mid, miss_min); + Perfect = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Perfect]); + Great = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Great]); + Good = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Good]); + Ok = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Ok]); + Meh = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Meh]); + Miss = BeatmapDifficulty.DifficultyRange(difficulty, base_ranges[HitResult.Miss]); } /// From 6976347d64c2675901e4d95940a7917270da2b74 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 20:28:59 +0900 Subject: [PATCH 579/628] Protect hit window values --- osu.Game/Rulesets/Objects/HitWindows.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 8fa6bb5e8b..1d09a3ad51 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -23,32 +23,32 @@ namespace osu.Game.Rulesets.Objects /// /// Hit window for a hit. /// - public double Perfect; + public double Perfect { get; private set; } /// /// Hit window for a hit. /// - public double Great; + public double Great { get; private set; } /// /// Hit window for a hit. /// - public double Good; + public double Good { get; private set; } /// /// Hit window for an hit. /// - public double Ok; + public double Ok { get; private set; } /// /// Hit window for a hit. /// - public double Meh; + public double Meh { get; private set; } /// /// Hit window for a hit. /// - public double Miss; + public double Miss { get; private set; } /// /// Constructs hit windows by fitting a parameter to a 2-part piecewise linear function for each hit window. From 9225e883c10f036fe8d663a5667e0138e0006a8f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 20:29:50 +0900 Subject: [PATCH 580/628] Add + use HalfHitWindow --- .../Objects/Drawables/DrawableHit.cs | 2 +- osu.Game/Rulesets/Objects/HitWindows.cs | 45 +++++++++++++++---- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 1b8d95c0cf..349e8e8fb0 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -87,7 +87,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables switch (State.Value) { case ArmedState.Idle: - this.Delay(HitObject.HitWindows.Miss / 2).Expire(); + this.Delay(HitObject.HitWindows.HalfWindowFor(HitResult.Miss)).Expire(); break; case ArmedState.Miss: this.FadeOut(100) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 1d09a3ad51..2762be4a54 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -65,37 +65,64 @@ namespace osu.Game.Rulesets.Objects } /// - /// Retrieves the hit result for a time offset. + /// Retrieves the for a time offset. /// - /// The time offset. This should always be a positive value indicating the absolute time offset. + /// The time offset. /// The hit result, or null if doesn't result in a judgement. public HitResult? ResultFor(double timeOffset) { timeOffset = Math.Abs(timeOffset); - if (timeOffset <= Perfect / 2) + if (timeOffset <= HalfWindowFor(HitResult.Perfect)) return HitResult.Perfect; - if (timeOffset <= Great / 2) + if (timeOffset <= HalfWindowFor(HitResult.Great)) return HitResult.Great; - if (timeOffset <= Good / 2) + if (timeOffset <= HalfWindowFor(HitResult.Good)) return HitResult.Good; - if (timeOffset <= Ok / 2) + if (timeOffset <= HalfWindowFor(HitResult.Ok)) return HitResult.Ok; - if (timeOffset <= Meh / 2) + if (timeOffset <= HalfWindowFor(HitResult.Meh)) return HitResult.Meh; - if (timeOffset <= Miss / 2) + if (timeOffset <= HalfWindowFor(HitResult.Miss)) return HitResult.Miss; return null; } + /// + /// Retrieves half the hit window for a . + /// This is useful if the of the hit window for one half of the hittable range of a is required. + /// + /// The expected . + /// One half of the hit window for . + public double HalfWindowFor(HitResult result) + { + switch (result) + { + case HitResult.Perfect: + return Perfect / 2; + case HitResult.Great: + return Great / 2; + case HitResult.Good: + return Good / 2; + case HitResult.Ok: + return Ok / 2; + case HitResult.Meh: + return Meh / 2; + case HitResult.Miss: + return Miss / 2; + default: + throw new ArgumentException(nameof(result)); + } + } + /// /// Given a time offset, whether the can ever be hit in the future. /// This happens if > . /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. - public bool CanBeHit(double timeOffset) => timeOffset <= Meh / 2; + public bool CanBeHit(double timeOffset) => timeOffset <= HalfWindowFor(HitResult.Meh); /// /// Multiplies all hit windows by a value. From b15f184261885ce7ca032737cdf0043fe8895938 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 2 Feb 2018 20:31:39 +0900 Subject: [PATCH 581/628] Make osu! use HitWindows --- .../Objects/Drawables/DrawableHitCircle.cs | 10 ++++-- osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs | 36 ------------------- .../Replays/OsuAutoGenerator.cs | 18 +++++----- 3 files changed, 16 insertions(+), 48 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index fcae41f55b..41f50844ed 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -72,14 +72,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { if (!userTriggered) { - if (timeOffset > HitObject.HitWindowFor(HitResult.Meh)) + if (!HitObject.HitWindows.CanBeHit(timeOffset)) AddJudgement(new OsuJudgement { Result = HitResult.Miss }); return; } + var result = HitObject.HitWindows.ResultFor(timeOffset); + if (result == null) + return; + AddJudgement(new OsuJudgement { - Result = HitObject.ScoreResultForOffset(Math.Abs(timeOffset)), + Result = result.Value, PositionOffset = Vector2.Zero //todo: set to correct value }); } @@ -104,7 +108,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables Expire(true); // override lifetime end as FadeIn may have been changed externally, causing out expiration to be too early. - LifetimeEnd = HitObject.StartTime + HitObject.HitWindowFor(HitResult.Miss); + LifetimeEnd = HitObject.StartTime + HitObject.HitWindows.HalfWindowFor(HitResult.Miss); break; case ArmedState.Miss: ApproachCircle.FadeOut(50); diff --git a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs index f217ae89e9..9b9d88f0f6 100644 --- a/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Rulesets.Osu/Objects/OsuHitObject.cs @@ -7,7 +7,6 @@ using OpenTK; using osu.Game.Rulesets.Objects.Types; using OpenTK.Graphics; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Rulesets.Scoring; namespace osu.Game.Rulesets.Osu.Objects { @@ -15,11 +14,6 @@ namespace osu.Game.Rulesets.Osu.Objects { public const double OBJECT_RADIUS = 64; - private const double hittable_range = 300; - public double HitWindow50 = 150; - public double HitWindow100 = 80; - public double HitWindow300 = 30; - public double TimePreempt = 600; public double TimeFadein = 400; @@ -45,32 +39,6 @@ namespace osu.Game.Rulesets.Osu.Objects public virtual bool NewCombo { get; set; } public int IndexInCurrentCombo { get; set; } - public double HitWindowFor(HitResult result) - { - switch (result) - { - default: - return hittable_range; - case HitResult.Meh: - return HitWindow50; - case HitResult.Good: - return HitWindow100; - case HitResult.Great: - return HitWindow300; - } - } - - public HitResult ScoreResultForOffset(double offset) - { - if (offset < HitWindowFor(HitResult.Great)) - return HitResult.Great; - if (offset < HitWindowFor(HitResult.Good)) - return HitResult.Good; - if (offset < HitWindowFor(HitResult.Meh)) - return HitResult.Meh; - return HitResult.Miss; - } - protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) { base.ApplyDefaultsToSelf(controlPointInfo, difficulty); @@ -78,10 +46,6 @@ namespace osu.Game.Rulesets.Osu.Objects TimePreempt = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1800, 1200, 450); TimeFadein = (float)BeatmapDifficulty.DifficultyRange(difficulty.ApproachRate, 1200, 800, 300); - HitWindow50 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 200, 150, 100); - HitWindow100 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 140, 100, 60); - HitWindow300 = BeatmapDifficulty.DifficultyRange(difficulty.OverallDifficulty, 80, 50, 20); - Scale = (1.0f - 0.7f * (difficulty.CircleSize - 5) / 5) / 2; } } diff --git a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs index a1658a0de2..a22ac6aed1 100644 --- a/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs +++ b/osu.Game.Rulesets.Osu/Replays/OsuAutoGenerator.cs @@ -89,20 +89,20 @@ namespace osu.Game.Rulesets.Osu.Replays double endTime = (prev as IHasEndTime)?.EndTime ?? prev.StartTime; // Make the cursor stay at a hitObject as long as possible (mainly for autopilot). - if (h.StartTime - h.HitWindowFor(HitResult.Miss) > endTime + h.HitWindowFor(HitResult.Meh) + 50) + if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Miss) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50) { - if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindowFor(HitResult.Meh), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); - if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindowFor(HitResult.Miss), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); + if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); + if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); } - else if (h.StartTime - h.HitWindowFor(HitResult.Meh) > endTime + h.HitWindowFor(HitResult.Meh) + 50) + else if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50) { - if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindowFor(HitResult.Meh), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); - if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindowFor(HitResult.Meh), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); + if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); + if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); } - else if (h.StartTime - h.HitWindowFor(HitResult.Good) > endTime + h.HitWindowFor(HitResult.Good) + 50) + else if (h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh) > endTime + h.HitWindows.HalfWindowFor(HitResult.Meh) + 50) { - if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindowFor(HitResult.Good), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); - if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindowFor(HitResult.Good), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); + if (!(prev is Spinner) && h.StartTime - endTime < 1000) AddFrameToReplay(new ReplayFrame(endTime + h.HitWindows.HalfWindowFor(HitResult.Meh), prev.StackedEndPosition.X, prev.StackedEndPosition.Y, ReplayButtonState.None)); + if (!(h is Spinner)) AddFrameToReplay(new ReplayFrame(h.StartTime - h.HitWindows.HalfWindowFor(HitResult.Meh), h.StackedPosition.X, h.StackedPosition.Y, ReplayButtonState.None)); } } From c4f3223e342bf4bc067d3372e19fbece78c7895f Mon Sep 17 00:00:00 2001 From: Imnooby Date: Sat, 3 Feb 2018 18:24:49 -0600 Subject: [PATCH 582/628] Stops non-url text from being hyperlinks Fixed crash when you attempted to click one --- osu.Game/Overlays/Profile/ProfileHeader.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index 60723ad29e..d085800f41 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -433,7 +433,13 @@ namespace osu.Game.Overlays.Profile if (string.IsNullOrEmpty(str)) return; infoTextRight.AddIcon(icon); - infoTextRight.AddLink(" " + str, url); + if (url != null) + { + infoTextRight.AddLink(" " + str, url); + } else + { + infoTextRight.AddText(" " + str); + } infoTextRight.NewLine(); } From 2e3ee79975442f9f2a53bee1e8bc3fe9ee58f19c Mon Sep 17 00:00:00 2001 From: ColdVolcano Date: Sun, 4 Feb 2018 00:02:32 -0600 Subject: [PATCH 583/628] Update submodules --- osu-framework | 2 +- osu-resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu-framework b/osu-framework index 90bf49a2df..d89e6cd631 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 90bf49a2df3dbad5994d922df63e4891c622dbc3 +Subproject commit d89e6cd63140c2b73631b79ff83b130a2b9958ed diff --git a/osu-resources b/osu-resources index 266965f0d7..92ec3d10b1 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit 266965f0d795b94a126e2da302bd2c10eadd642a +Subproject commit 92ec3d10b12c5e9bfc1d3b05d3db174a506efd6d From 6b35ef7063324d2b2b6f4bdf57b8a969575557e6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Feb 2018 16:13:30 +0900 Subject: [PATCH 584/628] Update OpenTK version --- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Desktop/packages.config | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Catch/packages.config | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Mania/packages.config | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Osu/packages.config | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Rulesets.Taiko/packages.config | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game.Tests/packages.config | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.Game/packages.config | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 3cc4e7f943..2ea2199a1f 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -136,7 +136,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index 37014057a0..656e898d8b 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index cdce598ce8..0362a897c2 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config index e67d3e9b34..33cc9e71ef 100644 --- a/osu.Game.Rulesets.Catch/packages.config +++ b/osu.Game.Rulesets.Catch/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index b9e7f8e60f..e9608b819c 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config index e67d3e9b34..33cc9e71ef 100644 --- a/osu.Game.Rulesets.Mania/packages.config +++ b/osu.Game.Rulesets.Mania/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index 97a003513f..e89e465152 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -42,7 +42,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config index e67d3e9b34..33cc9e71ef 100644 --- a/osu.Game.Rulesets.Osu/packages.config +++ b/osu.Game.Rulesets.Osu/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 5795048322..1cfd4de81b 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config index e67d3e9b34..33cc9e71ef 100644 --- a/osu.Game.Rulesets.Taiko/packages.config +++ b/osu.Game.Rulesets.Taiko/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8301f1f734..df8a97de79 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -42,7 +42,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index c16d10bf45..608c6a69d9 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -7,6 +7,6 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 4944613828..6746d0e179 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -148,7 +148,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll True diff --git a/osu.Game/packages.config b/osu.Game/packages.config index 0216c8ae67..e6b4f83ac2 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -67,7 +67,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + From 7e56519d6a65a575cd0742ef72cd22b49b3055f7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Feb 2018 16:13:39 +0900 Subject: [PATCH 585/628] Add setting for absolute input mapping --- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index ab501906dc..16291ccb2a 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -33,6 +33,11 @@ namespace osu.Game.Overlays.Settings.Sections.Input LabelText = "Cursor Sensitivity", Bindable = config.GetBindable(FrameworkSetting.CursorSensitivity) }, + new SettingsCheckbox + { + LabelText = "Map absolute input to window", + Bindable = config.GetBindable(FrameworkSetting.MapAbsoluteInputToWindow) + }, new SettingsEnumDropdown { LabelText = "Confine mouse cursor to window", From cf39236fc15151c8538fbbd7d48ae7b6852b2707 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 5 Feb 2018 18:29:58 +0900 Subject: [PATCH 586/628] Make NUnit tests run locally again --- osu.Game.Tests/osu.Game.Tests.csproj | 23 +++++++++++++++++++++++ osu.Game.Tests/packages.config | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index 8301f1f734..2f8bc5522d 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -45,6 +45,18 @@ $(SolutionDir)\packages\ppy.OpenTK.3.0.11\lib\net45\OpenTK.dll True + + $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll + + + $(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll + + + $(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll + + + $(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll + $(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll @@ -171,4 +183,15 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index c16d10bf45..9b125da215 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -8,5 +8,11 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste + + + + + + \ No newline at end of file From 30b9439263eedf78ddd533dec7def72b85a8ae8c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 5 Feb 2018 20:00:36 +0900 Subject: [PATCH 587/628] Fix default mouse sensitivity not reverting correctly --- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index 16291ccb2a..c368b8fea7 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -93,6 +93,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input // this bindable will still act as the "interactive" bindable displayed during a drag. base.Bindable = new BindableDouble(doubleValue.Value) { + Default = doubleValue.Default, MinValue = doubleValue.MinValue, MaxValue = doubleValue.MaxValue }; From dfc344b47a96d393e213a0e89d81392dea24fab2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 13:47:54 +0900 Subject: [PATCH 588/628] Update OpenTK version --- osu.Desktop/osu.Desktop.csproj | 2 +- osu.Desktop/packages.config | 2 +- osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj | 2 +- osu.Game.Rulesets.Catch/packages.config | 2 +- osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj | 2 +- osu.Game.Rulesets.Mania/packages.config | 2 +- osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj | 2 +- osu.Game.Rulesets.Osu/packages.config | 2 +- osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj | 2 +- osu.Game.Rulesets.Taiko/packages.config | 2 +- osu.Game.Tests/osu.Game.Tests.csproj | 2 +- osu.Game.Tests/packages.config | 2 +- osu.Game/osu.Game.csproj | 2 +- osu.Game/packages.config | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 2ea2199a1f..b0d9ea4e81 100644 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -136,7 +136,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Desktop/packages.config b/osu.Desktop/packages.config index 656e898d8b..b5dc43267d 100644 --- a/osu.Desktop/packages.config +++ b/osu.Desktop/packages.config @@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + diff --git a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj index 0362a897c2..31c225288b 100644 --- a/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj +++ b/osu.Game.Rulesets.Catch/osu.Game.Rulesets.Catch.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Catch/packages.config b/osu.Game.Rulesets.Catch/packages.config index 33cc9e71ef..16fae25086 100644 --- a/osu.Game.Rulesets.Catch/packages.config +++ b/osu.Game.Rulesets.Catch/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj index e9608b819c..38689fb19b 100644 --- a/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj +++ b/osu.Game.Rulesets.Mania/osu.Game.Rulesets.Mania.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Mania/packages.config b/osu.Game.Rulesets.Mania/packages.config index 33cc9e71ef..16fae25086 100644 --- a/osu.Game.Rulesets.Mania/packages.config +++ b/osu.Game.Rulesets.Mania/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj index e89e465152..d734fd70a9 100644 --- a/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj +++ b/osu.Game.Rulesets.Osu/osu.Game.Rulesets.Osu.csproj @@ -42,7 +42,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Osu/packages.config b/osu.Game.Rulesets.Osu/packages.config index 33cc9e71ef..16fae25086 100644 --- a/osu.Game.Rulesets.Osu/packages.config +++ b/osu.Game.Rulesets.Osu/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj index 1cfd4de81b..74859f924d 100644 --- a/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj +++ b/osu.Game.Rulesets.Taiko/osu.Game.Rulesets.Taiko.csproj @@ -41,7 +41,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game.Rulesets.Taiko/packages.config b/osu.Game.Rulesets.Taiko/packages.config index 33cc9e71ef..16fae25086 100644 --- a/osu.Game.Rulesets.Taiko/packages.config +++ b/osu.Game.Rulesets.Taiko/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/osu.Game.Tests/osu.Game.Tests.csproj b/osu.Game.Tests/osu.Game.Tests.csproj index df8a97de79..1c2cc58d26 100644 --- a/osu.Game.Tests/osu.Game.Tests.csproj +++ b/osu.Game.Tests/osu.Game.Tests.csproj @@ -42,7 +42,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game.Tests/packages.config b/osu.Game.Tests/packages.config index 608c6a69d9..c0ac81ed79 100644 --- a/osu.Game.Tests/packages.config +++ b/osu.Game.Tests/packages.config @@ -7,6 +7,6 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 6746d0e179..a5c3fc7f38 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -148,7 +148,7 @@ True - $(SolutionDir)\packages\ppy.OpenTK.3.0.12\lib\net45\OpenTK.dll + $(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll True diff --git a/osu.Game/packages.config b/osu.Game/packages.config index e6b4f83ac2..6d46360b99 100644 --- a/osu.Game/packages.config +++ b/osu.Game/packages.config @@ -67,7 +67,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste - + From dd8955cd90b99293b8321a43b2e8d8ed87349bba Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 14:29:03 +0900 Subject: [PATCH 589/628] Fix skip button not receiving screen-wide input --- osu.Game/Screens/Play/SkipButton.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 827d77a73a..880219cb2c 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -32,6 +32,8 @@ namespace osu.Game.Screens.Play private FadeContainer fadeContainer; private double displayTime; + public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true; + public SkipButton(double startTime) { this.startTime = startTime; From 9bfec9b23335aaafc4f452e07cf207d9f4a5fb0d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 14:30:01 +0900 Subject: [PATCH 590/628] Tidy up state change logic --- osu.Game/Screens/Play/SkipButton.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 880219cb2c..f67a9b801e 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -155,16 +155,11 @@ namespace osu.Game.Screens.Play public Visibility State { - get - { - return state; - } + get { return state; } set { - if (state == value) - return; + bool stateChanged = value != state; - var lastState = state; state = value; scheduledHide?.Cancel(); @@ -172,7 +167,8 @@ namespace osu.Game.Screens.Play switch (state) { case Visibility.Visible: - if (lastState == Visibility.Hidden) + // we may be triggered to become visible mnultiple times but we only want to transform once. + if (stateChanged) this.FadeIn(500, Easing.OutExpo); if (!IsHovered) From 48fd0f23f092688d75cb096aeb1e026732af4659 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 6 Feb 2018 14:30:16 +0900 Subject: [PATCH 591/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d89e6cd631..a584706f13 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d89e6cd63140c2b73631b79ff83b130a2b9958ed +Subproject commit a584706f1303f54cd7f5472240e95b70920ce079 From 60fb78e49d35cf98f09afd122e9d08998e80f093 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 17:46:45 +0900 Subject: [PATCH 592/628] Simplify iteration code --- .../Objects/Drawables/DrawableRepeatPoint.cs | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index daa017477f..c8c90830a7 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -80,25 +79,24 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { Position = isRepeatAtEnd ? end : start; + var curve = drawableSlider.Body.CurrentCurve; - if (curve.Count < 3 || curve.All(p => p == Position)) + + if (curve.Count < 2) return; - int referenceIndex; - //We are looking for the next point in the curve different than our position - //Since there can be more than one point equal to our position, we iterate until one is found - if (isRepeatAtEnd) + + int searchStart = isRepeatAtEnd ? curve.Count - 1 : 0; + int direction = isRepeatAtEnd ? -1 : 1; + + // find the next vector2 in the curve which is not equal to our current position to infer a rotation. + for (int i = searchStart; i >= 0 && i < curve.Count; i += direction) { - referenceIndex = curve.Count - 1; - while (curve[referenceIndex] == Position) - referenceIndex--; + if (curve[i] == Position) + continue; + + Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[i].Y - Position.Y, curve[i].X - Position.X)); + break; } - else - { - referenceIndex = 0; - while (curve[referenceIndex] == Position) - referenceIndex++; - } - Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[referenceIndex].Y - Position.Y, curve[referenceIndex].X - Position.X)); } } } From e417aaa23ff55bbf556f58a5a590ecc9a0f05562 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 17:46:56 +0900 Subject: [PATCH 593/628] Adjust scale out effect --- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs | 2 +- osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index c8c90830a7..dc3660ba5e 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; case ArmedState.Hit: this.FadeOut(animDuration, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, animDuration, Easing.OutQuint); + .ScaleTo(Scale * 1.5f, animDuration, Easing.Out); break; } } diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index c616d15de3..8b3c361945 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -71,7 +71,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables break; case ArmedState.Hit: this.FadeOut(anim_duration, Easing.OutQuint) - .ScaleTo(Scale * 1.5f, anim_duration, Easing.OutQuint); + .ScaleTo(Scale * 1.5f, anim_duration, Easing.Out); break; } } From 27fd42fb17d2b54bba4acd4d9c0b91c48a1963ec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:10:15 +0900 Subject: [PATCH 594/628] Adjust appear animations of repeats and ticks --- .../Objects/Drawables/DrawableRepeatPoint.cs | 7 ++++--- .../Objects/Drawables/DrawableSliderTick.cs | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index dc3660ba5e..dcd191214a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs @@ -54,9 +54,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { animDuration = Math.Min(150, repeatPoint.SpanDuration / 2); - this.FadeIn(animDuration).ScaleTo(1.2f, animDuration / 2) - .Then() - .ScaleTo(1, animDuration / 2, Easing.Out); + this.Animate( + d => d.FadeIn(animDuration), + d => d.ScaleTo(0.5f).ScaleTo(1f, animDuration * 4, Easing.OutElasticHalf) + ); } protected override void UpdateCurrentState(ArmedState state) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs index 8b3c361945..41d73a745a 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -52,9 +52,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables { this.Animate( d => d.FadeIn(anim_duration), - d => d.ScaleTo(0.5f).ScaleTo(1.2f, anim_duration / 2) - ).Then( - d => d.ScaleTo(1, anim_duration / 2, Easing.Out) + d => d.ScaleTo(0.5f).ScaleTo(1f, anim_duration * 4, Easing.OutElasticHalf) ); } From 3d0ef8b3bd03ee3a2f5b1a01e252758b709961a3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:14:08 +0900 Subject: [PATCH 595/628] Move property back to local variable Never used elsewhere --- .../Objects/Drawables/DrawableRepeatPoint.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs index dcd191214a..79a4714e33 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableRepeatPoint.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 osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; using OpenTK; @@ -16,11 +17,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables private readonly RepeatPoint repeatPoint; private readonly DrawableSlider drawableSlider; - /// - /// Whether this repeat point is at the end of the slider's curve. - /// - private bool isRepeatAtEnd => repeatPoint.RepeatIndex % 2 == 0; - private double animDuration; public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider) @@ -79,9 +75,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables public void UpdateSnakingPosition(Vector2 start, Vector2 end) { - Position = isRepeatAtEnd ? end : start; + bool isRepeatAtEnd = repeatPoint.RepeatIndex % 2 == 0; + List curve = drawableSlider.Body.CurrentCurve; - var curve = drawableSlider.Body.CurrentCurve; + Position = isRepeatAtEnd ? end : start; if (curve.Count < 2) return; From 62547dba5178f215d5f5bb772a32f43d1502d879 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 18:15:21 +0900 Subject: [PATCH 596/628] Remove redundant test method --- osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index ba555efb8e..93085df975 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -126,9 +126,7 @@ namespace osu.Game.Rulesets.Osu.Tests addSlider(slider, circleSize, speedMultiplier); } - private void testPerfect(int repeats = 0) => createPerfect(repeats); - - private void createPerfect(int repeats) + private void testPerfect(int repeats = 0) { var slider = new Slider { From e0c52c69cf416cb12332e6caa00810bf5ddc2cf3 Mon Sep 17 00:00:00 2001 From: Shane Woolcock Date: Tue, 6 Feb 2018 22:31:30 +1030 Subject: [PATCH 597/628] Prevent revert-to-default OnHover from hiding visual settings at beatmap load --- osu.Game/Overlays/Settings/SettingsItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsItem.cs b/osu.Game/Overlays/Settings/SettingsItem.cs index adb7c509c0..5afc415d83 100644 --- a/osu.Game/Overlays/Settings/SettingsItem.cs +++ b/osu.Game/Overlays/Settings/SettingsItem.cs @@ -181,7 +181,7 @@ namespace osu.Game.Overlays.Settings { hovering = true; UpdateState(); - return true; + return false; } protected override void OnHoverLost(InputState state) From d86ce816c73a962a5876dcc0400d2ebb1f5ca04d Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Tue, 6 Feb 2018 21:40:52 +0100 Subject: [PATCH 598/628] Add support for country rank --- osu.Game/Users/User.cs | 4 ++-- osu.Game/Users/UserStatistics.cs | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 8379e69869..c305cc004a 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -26,9 +26,9 @@ namespace osu.Game.Users [JsonProperty(@"age")] public int? Age; - public int GlobalRank; + public int GlobalRank { get => Statistics.Ranks.GlobalRank; set => Statistics.Ranks.GlobalRank = value; } - public int CountryRank; + public int CountryRank { get => Statistics.Ranks.CountryRank; set => Statistics.Ranks.CountryRank = value; } //public Team Team; diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index 73d20eafb9..f047bd1980 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -23,7 +23,19 @@ namespace osu.Game.Users public decimal? PP; [JsonProperty(@"pp_rank")] - public int Rank; + public int Rank { get => Ranks.GlobalRank; set => Ranks.GlobalRank = value; } + + [JsonProperty(@"rank")] + public UserRank Ranks; + + public struct UserRank + { + [JsonProperty(@"global")] + public int GlobalRank; + + [JsonProperty(@"country")] + public int CountryRank; + } [JsonProperty(@"ranked_score")] public long RankedScore; From bcd568e6076968f5a9abf2cbfa09f15d57550a53 Mon Sep 17 00:00:00 2001 From: tgi74000 Date: Tue, 6 Feb 2018 23:00:52 +0100 Subject: [PATCH 599/628] Check for possible null ranks --- osu.Game.Tests/Visual/TestCaseUserProfile.cs | 2 +- osu.Game/Users/User.cs | 4 ++-- osu.Game/Users/UserStatistics.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs index da81de6a3a..2c3abe0049 100644 --- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs @@ -42,12 +42,12 @@ namespace osu.Game.Tests.Visual LastVisit = DateTimeOffset.Now, Age = 1, ProfileOrder = new[] { "me" }, - CountryRank = 1, Statistics = new UserStatistics { Rank = 2148, PP = 4567.89m }, + CountryRank = 1, RankHistory = new User.RankHistoryData { Mode = @"osu", diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index c305cc004a..0be9600815 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -26,9 +26,9 @@ namespace osu.Game.Users [JsonProperty(@"age")] public int? Age; - public int GlobalRank { get => Statistics.Ranks.GlobalRank; set => Statistics.Ranks.GlobalRank = value; } + public int GlobalRank { get => Statistics?.Ranks.GlobalRank ?? 0; set => Statistics.Ranks.GlobalRank = value; } - public int CountryRank { get => Statistics.Ranks.CountryRank; set => Statistics.Ranks.CountryRank = value; } + public int CountryRank { get => Statistics?.Ranks.CountryRank ?? 0; set => Statistics.Ranks.CountryRank = value; } //public Team Team; diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index f047bd1980..f26db32cf0 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -23,7 +23,7 @@ namespace osu.Game.Users public decimal? PP; [JsonProperty(@"pp_rank")] - public int Rank { get => Ranks.GlobalRank; set => Ranks.GlobalRank = value; } + public int Rank { get => Ranks.GlobalRank ?? 0; set => Ranks.GlobalRank = value; } [JsonProperty(@"rank")] public UserRank Ranks; @@ -31,10 +31,10 @@ namespace osu.Game.Users public struct UserRank { [JsonProperty(@"global")] - public int GlobalRank; + public int? GlobalRank; [JsonProperty(@"country")] - public int CountryRank; + public int? CountryRank; } [JsonProperty(@"ranked_score")] From 406ec6e92d853dcf6d87a853cf9a21f70355a599 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 13:26:17 +0900 Subject: [PATCH 600/628] Make OsuSliderBar always use number of digits from precision --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 3c3939586e..f9d552042b 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -35,6 +35,7 @@ namespace osu.Game.Graphics.UserInterface var bindableDouble = CurrentNumber as BindableNumber; var bindableFloat = CurrentNumber as BindableNumber; var floatValue = bindableDouble?.Value ?? bindableFloat?.Value; + var floatPrecision = bindableDouble?.Precision ?? bindableFloat?.Precision; if (floatValue != null) { @@ -44,7 +45,11 @@ namespace osu.Game.Graphics.UserInterface if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) return floatValue.Value.ToString("P0"); - return floatValue.Value.ToString("N1"); + // We don't really care about more than 5 decimal digits + var decimalPrecision = normalize(Math.Round((decimal)floatPrecision, 5)); + var precisionDigits = (decimal.GetBits(decimalPrecision)[3] >> 16) & 255; + + return floatValue.Value.ToString($"N{precisionDigits}"); } var bindableInt = CurrentNumber as BindableNumber; @@ -52,6 +57,8 @@ namespace osu.Game.Graphics.UserInterface return bindableInt.Value.ToString("N0"); return Current.Value.ToString(CultureInfo.InvariantCulture); + + decimal normalize(decimal d) => decimal.Parse(d.ToString("0.############################", CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); } } From bd5db6fc8d74c241a670cb508e3b4a1a09327896 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 13:26:41 +0900 Subject: [PATCH 601/628] Make playback speed sliderbar use the tooltip text as its display --- osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs | 4 ++-- osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index 15d8e73a76..3229b022de 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -42,7 +42,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Text = "1x", + Text = "1.00x", Font = @"Exo2.0-Bold", } }, @@ -59,7 +59,7 @@ namespace osu.Game.Screens.Play.PlayerSettings } }; - sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x"; + sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{sliderbar.Bar.TooltipText}x"; } protected override void LoadComplete() diff --git a/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs index 946669e3dd..43fe14cc24 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlayerSliderBar.cs @@ -13,6 +13,8 @@ namespace osu.Game.Screens.Play.PlayerSettings public class PlayerSliderBar : SettingsSlider where T : struct, IEquatable, IComparable, IConvertible { + public OsuSliderBar Bar => (OsuSliderBar)Control; + protected override Drawable CreateControl() => new Sliderbar { Margin = new MarginPadding { Top = 5, Bottom = 5 }, @@ -21,8 +23,6 @@ namespace osu.Game.Screens.Play.PlayerSettings private class Sliderbar : OsuSliderBar { - public override string TooltipText => $"{CurrentNumber.Value}"; - [BackgroundDependencyLoader] private void load(OsuColour colours) { From 8e280b6b0c0b9f580f790246af45680917e9e1ca Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 13:28:10 +0900 Subject: [PATCH 602/628] Use 0.1 precision for playback speed --- osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index 3229b022de..4da13cb872 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -42,7 +42,7 @@ namespace osu.Game.Screens.Play.PlayerSettings { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Text = "1.00x", + Text = "1.0x", Font = @"Exo2.0-Bold", } }, @@ -54,7 +54,7 @@ namespace osu.Game.Screens.Play.PlayerSettings Default = 1, MinValue = 0.5, MaxValue = 2, - Precision = 0.01, + Precision = 0.1, }, } }; From 74016a14825b19343d6ca362b11fa297ae82c96e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 15:57:16 +0900 Subject: [PATCH 603/628] Make sure the import tests exit their hosts --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index ece1f626ec..5398fb3ff3 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -37,6 +37,8 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000); + + host.Exit(); } } @@ -64,6 +66,9 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); + + host.Exit(); + client.Exit(); } } @@ -86,6 +91,8 @@ namespace osu.Game.Tests.Beatmaps.IO File.Delete(temp); Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't"); + + host.Exit(); } } From b66d089400134245656d076f35cfc5dd8e367d78 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 17:12:12 +0900 Subject: [PATCH 604/628] Always put attributes on a separate line to their target --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 8767e5374a..3b62dbe579 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -173,7 +173,9 @@ NEXT_LINE True NEVER + NEVER False + NEVER False True False From 20c00720e5849f39a16244607095ae18915f31c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 17:11:10 +0900 Subject: [PATCH 605/628] Fix formatting --- osu.Game/Users/User.cs | 12 ++++++++++-- osu.Game/Users/UserStatistics.cs | 6 +++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 0be9600815..46c5d9e282 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -26,9 +26,17 @@ namespace osu.Game.Users [JsonProperty(@"age")] public int? Age; - public int GlobalRank { get => Statistics?.Ranks.GlobalRank ?? 0; set => Statistics.Ranks.GlobalRank = value; } + public int GlobalRank + { + get => Statistics?.Ranks.GlobalRank ?? 0; + set => Statistics.Ranks.GlobalRank = value; + } - public int CountryRank { get => Statistics?.Ranks.CountryRank ?? 0; set => Statistics.Ranks.CountryRank = value; } + public int CountryRank + { + get => Statistics?.Ranks.CountryRank ?? 0; + set => Statistics.Ranks.CountryRank = value; + } //public Team Team; diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index f26db32cf0..48012b089b 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -23,7 +23,11 @@ namespace osu.Game.Users public decimal? PP; [JsonProperty(@"pp_rank")] - public int Rank { get => Ranks.GlobalRank ?? 0; set => Ranks.GlobalRank = value; } + public int Rank + { + get => Ranks.GlobalRank ?? 0; + set => Ranks.GlobalRank = value; + } [JsonProperty(@"rank")] public UserRank Ranks; From 23d4c207266c012649c336ce50b2f4fd069021b0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 17:31:18 +0900 Subject: [PATCH 606/628] Apply suggestions to normalisation function --- .../Graphics/UserInterface/OsuSliderBar.cs | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index f9d552042b..8fc0aad55c 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -20,6 +20,11 @@ namespace osu.Game.Graphics.UserInterface public class OsuSliderBar : SliderBar, IHasTooltip, IHasAccentColour where T : struct, IEquatable, IComparable, IConvertible { + /// + /// Maximum number of decimal digits to be displayed in the tooltip. + /// + private const int max_decimal_digits = 5; + private SampleChannel sample; private double lastSampleTime; private T lastSampleValue; @@ -45,11 +50,12 @@ namespace osu.Game.Graphics.UserInterface if (floatMaxValue == 1 && (floatMinValue == 0 || floatMinValue == -1)) return floatValue.Value.ToString("P0"); - // We don't really care about more than 5 decimal digits - var decimalPrecision = normalize(Math.Round((decimal)floatPrecision, 5)); - var precisionDigits = (decimal.GetBits(decimalPrecision)[3] >> 16) & 255; + var decimalPrecision = normalise((decimal)floatPrecision, max_decimal_digits); - return floatValue.Value.ToString($"N{precisionDigits}"); + // Find the number of significant digits (we could have less than 5 after normalize()) + var significantDigits = (decimal.GetBits(decimalPrecision)[3] >> 16) & 255; + + return floatValue.Value.ToString($"N{significantDigits}"); } var bindableInt = CurrentNumber as BindableNumber; @@ -57,8 +63,6 @@ namespace osu.Game.Graphics.UserInterface return bindableInt.Value.ToString("N0"); return Current.Value.ToString(CultureInfo.InvariantCulture); - - decimal normalize(decimal d) => decimal.Parse(d.ToString("0.############################", CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); } } @@ -184,5 +188,14 @@ namespace osu.Game.Graphics.UserInterface { Nub.MoveToX(RangePadding + UsableWidth * value, 250, Easing.OutQuint); } + + /// + /// Removes all non-significant digits, keeping at most a requested number of decimal digits. + /// + /// The decimal to normalize. + /// The maximum number of decimal digits to keep. The final result may have fewer decimal digits than this value. + /// The normalised decimal. + private decimal normalise(decimal d, int sd) + => decimal.Parse(Math.Round(d, sd).ToString(string.Concat("0.", new string('#', sd)), CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); } } From 647cc4bdad78d95c197d5db2001f425e9fe7019a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 18:04:32 +0900 Subject: [PATCH 607/628] Remove in-between properties --- osu.Game.Tests/Visual/TestCaseDrawableRoom.cs | 14 +++++----- osu.Game.Tests/Visual/TestCaseRankGraph.cs | 8 +++--- .../Visual/TestCaseRoomInspector.cs | 22 +++++++-------- osu.Game.Tests/Visual/TestCaseUserProfile.cs | 5 ++-- osu.Game/Overlays/Profile/RankGraph.cs | 6 ++--- .../Screens/Multiplayer/ParticipantInfo.cs | 2 +- osu.Game/Users/User.cs | 12 --------- osu.Game/Users/UserStatistics.cs | 27 +++++++++---------- 8 files changed, 40 insertions(+), 56 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs index 1bb72a5ab4..ec70253118 100644 --- a/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs +++ b/osu.Game.Tests/Visual/TestCaseDrawableRoom.cs @@ -63,8 +63,8 @@ namespace osu.Game.Tests.Visual { Value = new[] { - new User { GlobalRank = 1355 }, - new User { GlobalRank = 8756 }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 1355 } } }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 8756 } } }, }, }, }), @@ -99,10 +99,10 @@ namespace osu.Game.Tests.Visual }, Participants = { - Value = new[] + Value = new[] { - new User { GlobalRank = 578975 }, - new User { GlobalRank = 24554 }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 578975 } } }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 24554 } } }, }, }, }), @@ -116,8 +116,8 @@ namespace osu.Game.Tests.Visual AddStep(@"change beatmap", () => first.Room.Beatmap.Value = null); AddStep(@"change participants", () => first.Room.Participants.Value = new[] { - new User { GlobalRank = 1254 }, - new User { GlobalRank = 123189 }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 1254 } } }, + new User { Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 123189 } } }, }); } diff --git a/osu.Game.Tests/Visual/TestCaseRankGraph.cs b/osu.Game.Tests/Visual/TestCaseRankGraph.cs index 54930c51a2..88631aa982 100644 --- a/osu.Game.Tests/Visual/TestCaseRankGraph.cs +++ b/osu.Game.Tests/Visual/TestCaseRankGraph.cs @@ -65,7 +65,7 @@ namespace osu.Game.Tests.Visual { Statistics = new UserStatistics { - Rank = 123456, + Ranks = new UserStatistics.UserRanks { Global = 123456 }, PP = 12345, } }; @@ -77,7 +77,7 @@ namespace osu.Game.Tests.Visual { Statistics = new UserStatistics { - Rank = 89000, + Ranks = new UserStatistics.UserRanks { Global = 89000 }, PP = 12345, }, RankHistory = new User.RankHistoryData @@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual { Statistics = new UserStatistics { - Rank = 89000, + Ranks = new UserStatistics.UserRanks { Global = 89000 }, PP = 12345, }, RankHistory = new User.RankHistoryData @@ -109,7 +109,7 @@ namespace osu.Game.Tests.Visual { Statistics = new UserStatistics { - Rank = 12000, + Ranks = new UserStatistics.UserRanks { Global = 12000 }, PP = 12345, }, RankHistory = new User.RankHistoryData diff --git a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs index e613d87500..8c4aa02a68 100644 --- a/osu.Game.Tests/Visual/TestCaseRoomInspector.cs +++ b/osu.Game.Tests/Visual/TestCaseRoomInspector.cs @@ -54,12 +54,12 @@ namespace osu.Game.Tests.Visual { Value = new[] { - new User { Username = @"flyte", Id = 3103765, GlobalRank = 1425 }, - new User { Username = @"Cookiezi", Id = 124493, GlobalRank = 5466 }, - new User { Username = @"Angelsim", Id = 1777162, GlobalRank = 2873 }, - new User { Username = @"Rafis", Id = 2558286, GlobalRank = 4687 }, - new User { Username = @"hvick225", Id = 50265, GlobalRank = 3258 }, - new User { Username = @"peppy", Id = 2, GlobalRank = 6251 } + new User { Username = @"flyte", Id = 3103765, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 142 } } }, + new User { Username = @"Cookiezi", Id = 124493, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 546 } } }, + new User { Username = @"Angelsim", Id = 1777162, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 287 } } }, + new User { Username = @"Rafis", Id = 2558286, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 468 } } }, + new User { Username = @"hvick225", Id = 50265, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 325 } } }, + new User { Username = @"peppy", Id = 2, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 625 } } }, } } }; @@ -80,8 +80,8 @@ namespace osu.Game.Tests.Visual AddStep(@"change max participants", () => room.MaxParticipants.Value = null); AddStep(@"change participants", () => room.Participants.Value = new[] { - new User { Username = @"filsdelama", Id = 2831793, GlobalRank = 8542 }, - new User { Username = @"_index", Id = 652457, GlobalRank = 15024 } + new User { Username = @"filsdelama", Id = 2831793, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 854 } } }, + new User { Username = @"_index", Id = 652457, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 150 } } } }); AddStep(@"change room", () => @@ -121,9 +121,9 @@ namespace osu.Game.Tests.Visual { Value = new[] { - new User { Username = @"Angelsim", Id = 1777162, GlobalRank = 4 }, - new User { Username = @"HappyStick", Id = 256802, GlobalRank = 752 }, - new User { Username = @"-Konpaku-", Id = 2258797, GlobalRank = 571 } + new User { Username = @"Angelsim", Id = 1777162, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 4 } } }, + new User { Username = @"HappyStick", Id = 256802, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 752 } } }, + new User { Username = @"-Konpaku-", Id = 2258797, Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 571 } } } } } }; diff --git a/osu.Game.Tests/Visual/TestCaseUserProfile.cs b/osu.Game.Tests/Visual/TestCaseUserProfile.cs index 2c3abe0049..8acc8d1b5b 100644 --- a/osu.Game.Tests/Visual/TestCaseUserProfile.cs +++ b/osu.Game.Tests/Visual/TestCaseUserProfile.cs @@ -44,10 +44,9 @@ namespace osu.Game.Tests.Visual ProfileOrder = new[] { "me" }, Statistics = new UserStatistics { - Rank = 2148, - PP = 4567.89m + Ranks = new UserStatistics.UserRanks { Global = 2148, Country = 1 }, + PP = 4567.89m, }, - CountryRank = 1, RankHistory = new User.RankHistoryData { Mode = @"osu", diff --git a/osu.Game/Overlays/Profile/RankGraph.cs b/osu.Game/Overlays/Profile/RankGraph.cs index 9d3183339e..e7e253df7c 100644 --- a/osu.Game/Overlays/Profile/RankGraph.cs +++ b/osu.Game/Overlays/Profile/RankGraph.cs @@ -105,7 +105,7 @@ namespace osu.Game.Overlays.Profile return; } - int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Rank }; + int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global }; ranks = userRanks.Select((x, index) => new KeyValuePair(index, x)).Where(x => x.Value != 0).ToArray(); if (ranks.Length > 1) @@ -124,9 +124,9 @@ namespace osu.Game.Overlays.Profile private void updateRankTexts() { - rankText.Text = User.Value.Statistics.Rank > 0 ? $"#{User.Value.Statistics.Rank:#,0}" : "no rank"; + rankText.Text = User.Value.Statistics.Ranks.Global > 0 ? $"#{User.Value.Statistics.Ranks.Global:#,0}" : "no rank"; performanceText.Text = User.Value.Statistics.PP != null ? $"{User.Value.Statistics.PP:#,0}pp" : string.Empty; - relativeText.Text = $"{User.Value.Country?.FullName} #{User.Value.CountryRank:#,0}"; + relativeText.Text = $"{User.Value.Country?.FullName} #{User.Value.Statistics.Ranks.Country:#,0}"; } private void showHistoryRankTexts(int dayIndex) diff --git a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs index ff00f53600..0fd4f4d08d 100644 --- a/osu.Game/Screens/Multiplayer/ParticipantInfo.cs +++ b/osu.Game/Screens/Multiplayer/ParticipantInfo.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Multiplayer { set { - var ranks = value.Select(u => u.GlobalRank); + var ranks = value.Select(u => u.Statistics.Ranks.Global); levelRangeLower.Text = ranks.Min().ToString(); levelRangeHigher.Text = ranks.Max().ToString(); } diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 46c5d9e282..777eb7beca 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -26,18 +26,6 @@ namespace osu.Game.Users [JsonProperty(@"age")] public int? Age; - public int GlobalRank - { - get => Statistics?.Ranks.GlobalRank ?? 0; - set => Statistics.Ranks.GlobalRank = value; - } - - public int CountryRank - { - get => Statistics?.Ranks.CountryRank ?? 0; - set => Statistics.Ranks.CountryRank = value; - } - //public Team Team; [JsonProperty(@"profile_colour")] diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index 48012b089b..863293d847 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -23,23 +23,10 @@ namespace osu.Game.Users public decimal? PP; [JsonProperty(@"pp_rank")] - public int Rank - { - get => Ranks.GlobalRank ?? 0; - set => Ranks.GlobalRank = value; - } + private int rank { set => Ranks.Global = value; } [JsonProperty(@"rank")] - public UserRank Ranks; - - public struct UserRank - { - [JsonProperty(@"global")] - public int? GlobalRank; - - [JsonProperty(@"country")] - public int? CountryRank; - } + public UserRanks Ranks; [JsonProperty(@"ranked_score")] public long RankedScore; @@ -82,5 +69,15 @@ namespace osu.Game.Users [JsonProperty(@"a")] public int A; } + + public struct UserRanks + { + [JsonProperty(@"global")] + public int Global; + + [JsonProperty(@"country")] + public int Country; + } + } } From 93c4612f4f4d5229c8b8a5d036d1b01e8f5369d4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 18:18:26 +0900 Subject: [PATCH 608/628] Add comment about deserialising helper --- osu.Game/Users/UserStatistics.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index 863293d847..c29bc91d17 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -22,7 +22,7 @@ namespace osu.Game.Users [JsonProperty(@"pp")] public decimal? PP; - [JsonProperty(@"pp_rank")] + [JsonProperty(@"pp_rank")] // the API sometimes only returns this value in condensed user responses private int rank { set => Ranks.Global = value; } [JsonProperty(@"rank")] From 4c3606f8fb209cbec1056db2ca5fc907ed9165f9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 18:30:38 +0900 Subject: [PATCH 609/628] Handle non-present country rank --- osu.Game/Overlays/Profile/RankGraph.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankGraph.cs b/osu.Game/Overlays/Profile/RankGraph.cs index e7e253df7c..429049c7bc 100644 --- a/osu.Game/Overlays/Profile/RankGraph.cs +++ b/osu.Game/Overlays/Profile/RankGraph.cs @@ -124,9 +124,11 @@ namespace osu.Game.Overlays.Profile private void updateRankTexts() { - rankText.Text = User.Value.Statistics.Ranks.Global > 0 ? $"#{User.Value.Statistics.Ranks.Global:#,0}" : "no rank"; - performanceText.Text = User.Value.Statistics.PP != null ? $"{User.Value.Statistics.PP:#,0}pp" : string.Empty; - relativeText.Text = $"{User.Value.Country?.FullName} #{User.Value.Statistics.Ranks.Country:#,0}"; + var user = User.Value; + + performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty; + rankText.Text = user.Statistics.Ranks.Global > 0 ? $"#{user.Statistics.Ranks.Global:#,0}" : "no rank"; + relativeText.Text = user.Country != null && user.Statistics.Ranks.Country > 0 ? $"{user.Country.FullName} #{user.Statistics.Ranks.Country:#,0}" : "no rank"; } private void showHistoryRankTexts(int dayIndex) From ee93c0bc19a06c9c9a36b83f620411b41896be52 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 20:03:15 +0900 Subject: [PATCH 610/628] Use an endian-independent method to find precision --- .../Graphics/UserInterface/OsuSliderBar.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 8fc0aad55c..8f375d9885 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -53,7 +53,7 @@ namespace osu.Game.Graphics.UserInterface var decimalPrecision = normalise((decimal)floatPrecision, max_decimal_digits); // Find the number of significant digits (we could have less than 5 after normalize()) - var significantDigits = (decimal.GetBits(decimalPrecision)[3] >> 16) & 255; + var significantDigits = findPrecision(decimalPrecision); return floatValue.Value.ToString($"N{significantDigits}"); } @@ -197,5 +197,22 @@ namespace osu.Game.Graphics.UserInterface /// The normalised decimal. private decimal normalise(decimal d, int sd) => decimal.Parse(Math.Round(d, sd).ToString(string.Concat("0.", new string('#', sd)), CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + + /// + /// Finds the number of digits after the decimal. + /// + /// The value to find the number of decimal digits for. + /// The number decimal digits. + private int findPrecision(decimal d) + { + int precision = 0; + while (d != Math.Round(d)) + { + d *= 10; + precision++; + } + + return precision; + } } } From 7a9dffd780b2bb385d106a0d730fc2de3ac71e15 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 22:06:42 +0900 Subject: [PATCH 611/628] Update framework again --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index d89e6cd631..1440ae8538 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit d89e6cd63140c2b73631b79ff83b130a2b9958ed +Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b From a70989cb702075b18f25d110b279781a3f3ff4f0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 11:12:05 +0900 Subject: [PATCH 612/628] Rely on bindable's formatting rather than setting a default --- osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs index 4da13cb872..6878bb098e 100644 --- a/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/PlayerSettings/PlaybackSettings.cs @@ -42,7 +42,6 @@ namespace osu.Game.Screens.Play.PlayerSettings { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Text = "1.0x", Font = @"Exo2.0-Bold", } }, @@ -60,6 +59,7 @@ namespace osu.Game.Screens.Play.PlayerSettings }; sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{sliderbar.Bar.TooltipText}x"; + sliderbar.Bindable.TriggerChange(); } protected override void LoadComplete() From a7aaaf90888e1dc473fa272e59a781048d635117 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 12:43:17 +0900 Subject: [PATCH 613/628] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 1440ae8538..2d6169fc07 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b +Subproject commit 2d6169fc07fdd50b8ce31d3a9124b4ec0123bdd1 From cfdeac64289c8450d4dacf964e789ecc8c63c7d2 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 13:38:31 +0900 Subject: [PATCH 614/628] Make hit windows settable by derived classes --- osu.Game/Rulesets/Objects/HitWindows.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 2762be4a54..6d9461e3b9 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Objects { public class HitWindows { - private static readonly IReadOnlyDictionary base_ranges = new Dictionary + private static readonly IReadOnlyDictionary base_ranges = new Dictionary { { HitResult.Perfect, (44.8, 38.8, 27.8) }, { HitResult.Great, (128, 98, 68 ) }, @@ -23,32 +23,32 @@ namespace osu.Game.Rulesets.Objects /// /// Hit window for a hit. /// - public double Perfect { get; private set; } + public double Perfect { get; protected set; } /// /// Hit window for a hit. /// - public double Great { get; private set; } + public double Great { get; protected set; } /// /// Hit window for a hit. /// - public double Good { get; private set; } + public double Good { get; protected set; } /// /// Hit window for an hit. /// - public double Ok { get; private set; } + public double Ok { get; protected set; } /// /// Hit window for a hit. /// - public double Meh { get; private set; } + public double Meh { get; protected set; } /// /// Hit window for a hit. /// - public double Miss { get; private set; } + public double Miss { get; protected set; } /// /// Constructs hit windows by fitting a parameter to a 2-part piecewise linear function for each hit window. From 802aaefe35f34165e9276078e7ba2f4775970465 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 13:54:08 +0900 Subject: [PATCH 615/628] Give rulesets a way to disable/enable perfect/ok hit results --- .../Objects/ManiaHitObject.cs | 10 +++++++ osu.Game/Rulesets/Objects/HitWindows.cs | 28 +++++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs index 22616fa0f9..be93471bcd 100644 --- a/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs +++ b/osu.Game.Rulesets.Mania/Objects/ManiaHitObject.cs @@ -1,6 +1,8 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Mania.Objects.Types; using osu.Game.Rulesets.Objects; @@ -9,5 +11,13 @@ namespace osu.Game.Rulesets.Mania.Objects public abstract class ManiaHitObject : HitObject, IHasColumn { public virtual int Column { get; set; } + + protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty) + { + base.ApplyDefaultsToSelf(controlPointInfo, difficulty); + + HitWindows.AllowsPerfect = true; + HitWindows.AllowsOk = true; + } } } diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 6d9461e3b9..1b332ee80a 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -21,35 +21,47 @@ namespace osu.Game.Rulesets.Objects }; /// - /// Hit window for a hit. + /// Hit window for a result. + /// The user can only achieve receive this result if is true. /// public double Perfect { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Great { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Good { get; protected set; } /// - /// Hit window for an hit. + /// Hit window for an result. + /// The user can only achieve this result if is true. /// public double Ok { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Meh { get; protected set; } /// - /// Hit window for a hit. + /// Hit window for a result. /// public double Miss { get; protected set; } + /// + /// Whether it's possible to achieve a result. + /// + public bool AllowsPerfect; + + /// + /// Whether it's possible to achieve a result. + /// + public bool AllowsOk; + /// /// Constructs hit windows by fitting a parameter to a 2-part piecewise linear function for each hit window. /// @@ -73,13 +85,13 @@ namespace osu.Game.Rulesets.Objects { timeOffset = Math.Abs(timeOffset); - if (timeOffset <= HalfWindowFor(HitResult.Perfect)) + if (AllowsPerfect && timeOffset <= HalfWindowFor(HitResult.Perfect)) return HitResult.Perfect; if (timeOffset <= HalfWindowFor(HitResult.Great)) return HitResult.Great; if (timeOffset <= HalfWindowFor(HitResult.Good)) return HitResult.Good; - if (timeOffset <= HalfWindowFor(HitResult.Ok)) + if (AllowsOk && timeOffset <= HalfWindowFor(HitResult.Ok)) return HitResult.Ok; if (timeOffset <= HalfWindowFor(HitResult.Meh)) return HitResult.Meh; From 17aa915c77d05581574f48de91d2dcaa972fd069 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 13:57:45 +0900 Subject: [PATCH 616/628] Rename DifficultyRange parameters --- osu.Game/Beatmaps/BeatmapDifficulty.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapDifficulty.cs b/osu.Game/Beatmaps/BeatmapDifficulty.cs index 570faaea0a..3bfa70711b 100644 --- a/osu.Game/Beatmaps/BeatmapDifficulty.cs +++ b/osu.Game/Beatmaps/BeatmapDifficulty.cs @@ -46,11 +46,11 @@ namespace osu.Game.Beatmaps /// /// The difficulty value to be mapped. /// The values that define the two linear ranges. - /// Minimum of the resulting range which will be achieved by a difficulty value of 0. - /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. - /// Maximum of the resulting range which will be achieved by a difficulty value of 10. + /// Minimum of the resulting range which will be achieved by a difficulty value of 0. + /// Midpoint of the resulting range which will be achieved by a difficulty value of 5. + /// Maximum of the resulting range which will be achieved by a difficulty value of 10. /// Value to which the difficulty value maps in the specified range. - public static double DifficultyRange(double difficulty, (double min, double mid, double max) range) - => DifficultyRange(difficulty, range.min, range.mid, range.max); + public static double DifficultyRange(double difficulty, (double od0, double od5, double od10) range) + => DifficultyRange(difficulty, range.od0, range.od5, range.od10); } } From 4f5bfdb888bce2c73afaf1578615d0ac32d83b17 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:03:37 +0900 Subject: [PATCH 617/628] Remove explicit .Exit on IPC test --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 5398fb3ff3..490d4ec4d3 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -68,7 +68,6 @@ namespace osu.Game.Tests.Beatmaps.IO waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); host.Exit(); - client.Exit(); } } From 48918b5324be01a24db5ead9fe7afed46d8ffd63 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 14:07:12 +0900 Subject: [PATCH 618/628] Bring framework up-to-date --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 2d6169fc07..eba12eb4a0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 2d6169fc07fdd50b8ce31d3a9124b4ec0123bdd1 +Subproject commit eba12eb4a0fa6238873dd266deb35bfdece21a6a From 3d167c40ae28ae68c73b375a5b8b85a67a142ec5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:15:47 +0900 Subject: [PATCH 619/628] Remove now unneeded Math.Abs call --- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index 349e8e8fb0..bf327cb491 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; using System.Linq; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Drawables; @@ -43,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables return; } - var result = HitObject.HitWindows.ResultFor(Math.Abs(timeOffset)); + var result = HitObject.HitWindows.ResultFor(timeOffset); if (result == null) return; From a6f1a4689ea59e8448a7fb0c617b213593bc90b5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:16:31 +0900 Subject: [PATCH 620/628] Fix incorrect value copy-pasta --- osu.Game/Rulesets/Objects/HitWindows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 1b332ee80a..1c23505e17 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Objects { HitResult.Great, (128, 98, 68 ) }, { HitResult.Good, (194, 164, 134) }, { HitResult.Ok, (254, 224, 194) }, - { HitResult.Meh, (382, 272, 242) }, + { HitResult.Meh, (302, 272, 242) }, { HitResult.Miss, (376, 346, 316) }, }; From c537af02892415957618bfc4409b89efd10f7a80 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:25:44 +0900 Subject: [PATCH 621/628] Fix/improve commends --- osu.Game/Rulesets/Objects/HitWindows.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index 1c23505e17..e2f95f2cf2 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -103,7 +103,7 @@ namespace osu.Game.Rulesets.Objects /// /// Retrieves half the hit window for a . - /// This is useful if the of the hit window for one half of the hittable range of a is required. + /// This is useful if the hit window for one half of the hittable range of a is required. /// /// The expected . /// One half of the hit window for . @@ -129,8 +129,8 @@ namespace osu.Game.Rulesets.Objects } /// - /// Given a time offset, whether the can ever be hit in the future. - /// This happens if > . + /// Given a time offset, whether the can ever be hit in the future with a non- result. + /// This happens if . /// /// The time offset. /// Whether the can be hit at any point in the future from this time offset. From 46284c61aeee956daa39380e8a64a5a1c7e89e4f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:25:59 +0900 Subject: [PATCH 622/628] Return HitResult.None instead of null --- .../Objects/Drawables/DrawableHoldNote.cs | 4 ++-- osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs | 4 ++-- .../Objects/Drawables/DrawableHitCircle.cs | 4 ++-- osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs | 4 ++-- osu.Game/Rulesets/Objects/HitWindows.cs | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs index 9d1088f69d..5a9ff592bc 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableHoldNote.cs @@ -224,12 +224,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == null) + if (result == HitResult.None) return; AddJudgement(new HoldNoteTailJudgement { - Result = result.Value, + Result = result, HasBroken = holdNote.hasBroken }); } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index a9a0741370..8944978bdd 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -68,10 +68,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == null) + if (result == HitResult.None) return; - AddJudgement(new ManiaJudgement { Result = result.Value }); + AddJudgement(new ManiaJudgement { Result = result }); } protected override void UpdateState(ArmedState state) diff --git a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs index 41f50844ed..959c87bbba 100644 --- a/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs @@ -78,12 +78,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == null) + if (result == HitResult.None) return; AddJudgement(new OsuJudgement { - Result = result.Value, + Result = result, PositionOffset = Vector2.Zero //todo: set to correct value }); } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs index bf327cb491..63e6cfb297 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableHit.cs @@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } var result = HitObject.HitWindows.ResultFor(timeOffset); - if (result == null) + if (result == HitResult.None) return; if (!validKeyPressed || result == HitResult.Miss) @@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables { AddJudgement(new TaikoJudgement { - Result = result.Value, + Result = result, Final = !HitObject.IsStrong }); diff --git a/osu.Game/Rulesets/Objects/HitWindows.cs b/osu.Game/Rulesets/Objects/HitWindows.cs index e2f95f2cf2..0ec8389b4f 100644 --- a/osu.Game/Rulesets/Objects/HitWindows.cs +++ b/osu.Game/Rulesets/Objects/HitWindows.cs @@ -80,8 +80,8 @@ namespace osu.Game.Rulesets.Objects /// Retrieves the for a time offset. /// /// The time offset. - /// The hit result, or null if doesn't result in a judgement. - public HitResult? ResultFor(double timeOffset) + /// The hit result, or if doesn't result in a judgement. + public HitResult ResultFor(double timeOffset) { timeOffset = Math.Abs(timeOffset); @@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Objects if (timeOffset <= HalfWindowFor(HitResult.Miss)) return HitResult.Miss; - return null; + return HitResult.None; } /// From c213e58effd6edd44de3c298f5068616f3c5d80a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:40:35 +0900 Subject: [PATCH 623/628] Make slider tails not play hitsounds --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 3bde7e790b..5dd3d7aa89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -123,9 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects StartTime = EndTime, Position = StackedEndPosition, IndexInCurrentCombo = IndexInCurrentCombo, - ComboColour = ComboColour, - Samples = Samples, - SampleControlPoint = SampleControlPoint + ComboColour = ComboColour }; AddNested(HeadCircle); From cafa605b90e6d34c30bdc687bfd9de0733efbe7a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 14:43:07 +0900 Subject: [PATCH 624/628] Fix visual settings checkboxes playing sounds in bindable binding Move sound binding to much later in the process to avoid programmatic checkbox changes triggering interaction sounds --- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 5e7dda8713..f06313c261 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -76,6 +76,16 @@ namespace osu.Game.Graphics.UserInterface Nub.Current.BindTo(Current); + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Current.ValueChanged += newValue => { if (newValue) @@ -83,11 +93,6 @@ namespace osu.Game.Graphics.UserInterface else sampleUnchecked?.Play(); }; - - Current.DisabledChanged += disabled => - { - Alpha = disabled ? 0.3f : 1; - }; } protected override bool OnHover(InputState state) From 789e25069fb3860b69db9c579b178613dab7b32d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 17:07:18 +0900 Subject: [PATCH 625/628] Fix non-visual tests not cleaning up previous executions --- .../Beatmaps/IO/ImportBeatmapTest.cs | 9 ++++----- osu.Game/Tests/CleanRunHeadlessGameHost.cs | 19 +++++++++++++++++++ osu.Game/Tests/Visual/OsuTestCase.cs | 6 +----- osu.Game/osu.Game.csproj | 1 + 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 osu.Game/Tests/CleanRunHeadlessGameHost.cs diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 490d4ec4d3..1ee8f6728a 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tests.Beatmaps.IO public void TestImportWhenClosed() { //unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenClosed")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenClosed")) { var osu = loadOsu(host); @@ -44,11 +44,10 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] [NonParallelizable] - [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")] public void TestImportOverIPC() { - using (HeadlessGameHost host = new HeadlessGameHost("host", true)) - using (HeadlessGameHost client = new HeadlessGameHost("client", true)) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true)) + using (HeadlessGameHost client = new CleanRunHeadlessGameHost("client", true)) { Assert.IsTrue(host.IsPrimaryInstance); Assert.IsFalse(client.IsPrimaryInstance); @@ -74,7 +73,7 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] public void TestImportWhenFileOpen() { - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenFileOpen")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenFileOpen")) { var osu = loadOsu(host); diff --git a/osu.Game/Tests/CleanRunHeadlessGameHost.cs b/osu.Game/Tests/CleanRunHeadlessGameHost.cs new file mode 100644 index 0000000000..b6ff6dcf84 --- /dev/null +++ b/osu.Game/Tests/CleanRunHeadlessGameHost.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Platform; + +namespace osu.Game.Tests +{ + /// + /// A headless host which cleans up before running (removing any remnants from a previous execution). + /// + public class CleanRunHeadlessGameHost : HeadlessGameHost + { + public CleanRunHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true) + : base(gameName, bindIPC, realtime) + { + Storage.DeleteDirectory(string.Empty); + } + } +} diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index f9f198a5c1..97aada2971 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Game.Tests.Visual @@ -11,11 +10,8 @@ namespace osu.Game.Tests.Visual { public override void RunTest() { - using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) - { - host.Storage.DeleteDirectory(string.Empty); + using (var host = new CleanRunHeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) host.Run(new OsuTestCaseTestRunner(this)); - } } public class OsuTestCaseTestRunner : OsuGameBase diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a5c3fc7f38..bb9925abbc 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -855,6 +855,7 @@ + From d8da68c55fc2bb5dd22ffb22610dc81b81092f70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 17:22:23 +0900 Subject: [PATCH 626/628] Disable test again (accidentally re-enabled) --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 1ee8f6728a..0b49bc8bb9 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -44,6 +44,7 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] [NonParallelizable] + [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")] public void TestImportOverIPC() { using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true)) From 0511728fbe2e3b89ef100353483f0b31253cfd07 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 17:38:46 +0900 Subject: [PATCH 627/628] Remove "keypress" from comment --- osu.Game/Rulesets/Objects/HitObject.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs index 64dc94fe16..75cb65eff0 100644 --- a/osu.Game/Rulesets/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Objects private HitWindows hitWindows; /// - /// The keypress hit windows for this . + /// The hit windows for this . /// public HitWindows HitWindows { From e1075665753ca9c947365deafdfccbd4aa26d562 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 18:05:09 +0900 Subject: [PATCH 628/628] Update user object to match new standardised api --- osu.Game/Users/User.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 777eb7beca..21c59a6aeb 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -56,19 +56,19 @@ namespace osu.Game.Users public int? Id; } - [JsonProperty(@"isAdmin")] + [JsonProperty(@"is_admin")] public bool IsAdmin; - [JsonProperty(@"isSupporter")] + [JsonProperty(@"is_supporter")] public bool IsSupporter; - [JsonProperty(@"isGMT")] + [JsonProperty(@"is_gmt")] public bool IsGMT; - [JsonProperty(@"isQAT")] + [JsonProperty(@"is_qat")] public bool IsQAT; - [JsonProperty(@"isBNG")] + [JsonProperty(@"is_bng")] public bool IsBNG; [JsonProperty(@"is_active")] @@ -107,7 +107,7 @@ namespace osu.Game.Users [JsonProperty(@"playmode")] public string PlayMode; - [JsonProperty(@"profileOrder")] + [JsonProperty(@"profile_order")] public string[] ProfileOrder; [JsonProperty(@"kudosu")]