From 5ea6e8e247a27c4df8a754ecc65a52ee2c33be20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Jan 2019 14:22:38 +0900 Subject: [PATCH] Allow full osu!direct usage regardless of supporter status for now --- osu.Game/Beatmaps/BeatmapManager.cs | 11 ---- .../Graphics/Containers/LinkFlowContainer.cs | 12 ++-- .../Containers/OsuTextFlowContainer.cs | 3 +- osu.Game/Screens/Menu/Disclaimer.cs | 63 +++++++++++++++---- 4 files changed, 60 insertions(+), 29 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 73fd5da22c..bcf6a95e70 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -17,7 +17,6 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps.Formats; using osu.Game.Database; -using osu.Game.Graphics; using osu.Game.IO.Archives; using osu.Game.Online.API; using osu.Game.Online.API.Requests; @@ -147,16 +146,6 @@ namespace osu.Game.Beatmaps if (existing != null || api == null) return false; - if (!api.LocalUser.Value.IsSupporter) - { - PostNotification?.Invoke(new SimpleNotification - { - Icon = FontAwesome.fa_superpowers, - Text = "You gotta be an osu!supporter to download for now 'yo" - }); - return false; - } - var downloadNotification = new DownloadNotification { CompletionText = $"Imported {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}!", diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index e4c18dfb3d..f794dedcab 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -61,21 +61,21 @@ namespace osu.Game.Graphics.Containers AddText(text.Substring(previousLinkEnd)); } - public void AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action creationParameters = null) + public IEnumerable AddLink(string text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action creationParameters = null) => createLink(AddText(text, creationParameters), text, url, linkType, linkArgument, tooltipText); - public void AddLink(string text, Action action, string tooltipText = null, Action creationParameters = null) + public IEnumerable AddLink(string text, Action action, string tooltipText = null, Action creationParameters = null) => createLink(AddText(text, creationParameters), text, tooltipText: tooltipText, action: action); - public void AddLink(IEnumerable text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) + public IEnumerable AddLink(IEnumerable text, string url, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null) { foreach (var t in text) AddArbitraryDrawable(t); - createLink(text, null, url, linkType, linkArgument, tooltipText); + return createLink(text, null, url, linkType, linkArgument, tooltipText); } - private void createLink(IEnumerable drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null) + private IEnumerable createLink(IEnumerable drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null) { AddInternal(new DrawableLinkCompiler(drawables.OfType().ToList()) { @@ -122,6 +122,8 @@ namespace osu.Game.Graphics.Containers } }), }); + + return drawables; } // We want the compilers to always be visible no matter where they are, so RelativeSizeAxes is used. diff --git a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs b/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs index e77e075fe2..004c49adb8 100644 --- a/osu.Game/Graphics/Containers/OsuTextFlowContainer.cs +++ b/osu.Game/Graphics/Containers/OsuTextFlowContainer.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.Framework.Graphics.Sprites; @@ -19,6 +20,6 @@ namespace osu.Game.Graphics.Containers public void AddArbitraryDrawable(Drawable drawable) => AddInternal(drawable); - public void AddIcon(FontAwesome icon, Action creationParameters = null) => AddText(((char)icon).ToString(), creationParameters); + public IEnumerable AddIcon(FontAwesome icon, Action creationParameters = null) => AddText(((char)icon).ToString(), creationParameters); } } diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index c9ad519897..22261f328a 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -1,8 +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.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Containers; @@ -24,7 +28,10 @@ namespace osu.Game.Screens.Menu public override bool CursorVisible => false; - private const float icon_y = -0.09f; + private readonly List supporterDrawables = new List(); + private Drawable heart; + + private const float icon_y = -85; public Disclaimer() { @@ -42,7 +49,6 @@ namespace osu.Game.Screens.Menu Origin = Anchor.Centre, Icon = FontAwesome.fa_warning, Size = new Vector2(30), - RelativePositionAxes = Axes.Both, Y = icon_y, }, textFlow = new LinkFlowContainer @@ -51,8 +57,9 @@ namespace osu.Game.Screens.Menu AutoSizeAxes = Axes.Y, Padding = new MarginPadding(50), TextAnchor = Anchor.TopCentre, + Y = -110, Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Origin = Anchor.TopCentre, Spacing = new Vector2(0, 2), } }; @@ -68,14 +75,37 @@ namespace osu.Game.Screens.Menu t.Font = @"Exo2.0-SemiBold"; }); - textFlow.AddParagraph("Don't expect everything to work perfectly."); - textFlow.AddParagraph(""); - textFlow.AddParagraph("Detailed bug reports are welcomed via github issues."); - textFlow.AddParagraph(""); + textFlow.AddParagraph("Things may not work as expected", t => t.TextSize = 20); + textFlow.NewParagraph(); - textFlow.AddText("Visit "); - textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy"); - textFlow.AddText(" if you want to help out or follow progress!"); + Action format = t => + { + t.TextSize = 15; + t.Font = @"Exo2.0-SemiBold"; + }; + + textFlow.AddParagraph("Detailed bug reports are welcomed via github issues.", format); + textFlow.NewParagraph(); + + textFlow.AddText("Visit ", format); + textFlow.AddLink("discord.gg/ppy", "https://discord.gg/ppy", creationParameters:format); + textFlow.AddText(" to help out or follow progress!", format); + + textFlow.NewParagraph(); + textFlow.NewParagraph(); + textFlow.NewParagraph(); + + supporterDrawables.AddRange(textFlow.AddText("Consider becoming an ", format)); + supporterDrawables.AddRange(textFlow.AddLink("osu!supporter", "https://osu.ppy.sh/home/support", creationParameters: format)); + supporterDrawables.AddRange(textFlow.AddText(" to help support the game", format)); + + supporterDrawables.Add(heart = textFlow.AddIcon(FontAwesome.fa_heart, t => + { + t.Padding = new MarginPadding { Left = 5 }; + t.TextSize = 12; + t.Colour = colours.Pink; + t.Origin = Anchor.Centre; + }).First()); iconColour = colours.Yellow; } @@ -90,8 +120,15 @@ namespace osu.Game.Screens.Menu { base.OnEntering(last); - icon.Delay(1500).FadeColour(iconColour, 200, Easing.OutQuint); - icon.Delay(1500).MoveToY(icon_y * 1.1f, 100, Easing.OutCirc).Then().MoveToY(icon_y, 100, Easing.InCirc); + icon.Delay(1000).FadeColour(iconColour, 200, Easing.OutQuint); + icon.Delay(1000) + .MoveToY(icon_y * 1.1f, 160, Easing.OutCirc) + .RotateTo(-10, 160, Easing.OutCirc) + .Then() + .MoveToY(icon_y, 160, Easing.InCirc) + .RotateTo(0, 160, Easing.InCirc); + + supporterDrawables.ForEach(d => d.FadeOut().Delay(2000).FadeIn(500)); Content .FadeInFromZero(500) @@ -99,6 +136,8 @@ namespace osu.Game.Screens.Menu .FadeOut(250) .ScaleTo(0.9f, 250, Easing.InQuint) .Finally(d => Push(intro)); + + heart.FlashColour(Color4.White, 750, Easing.OutQuint).Loop(); } } }