From ecc0d0b11c14073f9f7a675cc4825aaeac861d7c Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Tue, 30 May 2017 12:49:06 -0400 Subject: [PATCH 01/10] Daycore mod --- osu.Game.Rulesets.Catch/CatchRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Catch/Mods/CatchMod.cs | 5 +++++ osu.Game.Rulesets.Mania/ManiaRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 5 +++++ osu.Game.Rulesets.Osu/Mods/OsuMod.cs | 5 +++++ osu.Game.Rulesets.Osu/OsuRuleset.cs | 9 ++++++++- osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs | 5 +++++ osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 9 ++++++++- osu.Game/Rulesets/Mods/ModDaycore.cs | 25 ++++++++++++++++++++++++ osu.Game/Rulesets/Mods/ModHalfTime.cs | 2 +- osu.Game/osu.Game.csproj | 1 + 11 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 osu.Game/Rulesets/Mods/ModDaycore.cs diff --git a/osu.Game.Rulesets.Catch/CatchRuleset.cs b/osu.Game.Rulesets.Catch/CatchRuleset.cs index 53449fd5f5..df212f7df7 100644 --- a/osu.Game.Rulesets.Catch/CatchRuleset.cs +++ b/osu.Game.Rulesets.Catch/CatchRuleset.cs @@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Catch { new CatchModEasy(), new CatchModNoFail(), - new CatchModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new CatchModHalfTime(), + new CatchModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs index 64a0c51b72..b0880d7e1d 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchMod.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchMod.cs @@ -32,6 +32,11 @@ namespace osu.Game.Rulesets.Catch.Mods } + public class CatchModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class CatchModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.06; diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index 30d1846746..0af8825208 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -27,7 +27,14 @@ namespace osu.Game.Rulesets.Mania { new ManiaModEasy(), new ManiaModNoFail(), - new ManiaModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new ManiaModHalfTime(), + new ManiaModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index b402d3a010..f64f96e6c2 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -34,6 +34,11 @@ namespace osu.Game.Rulesets.Mania.Mods } + public class ManiaModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class ManiaModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.0; diff --git a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs index cc06946d38..3b0cfc1ef1 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuMod.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuMod.cs @@ -39,6 +39,11 @@ namespace osu.Game.Rulesets.Osu.Mods public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); } + public class OsuModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class OsuModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.12; diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index af4a099e0d..bfed889b36 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -46,7 +46,14 @@ namespace osu.Game.Rulesets.Osu { new OsuModEasy(), new OsuModNoFail(), - new OsuModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new OsuModHalfTime(), + new OsuModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs index 8b7a099b9a..abaa8c1bc1 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoMod.cs @@ -37,6 +37,11 @@ namespace osu.Game.Rulesets.Taiko.Mods } + public class TaikoModDaycore : ModDaycore + { + public override double ScoreMultiplier => 0.5; + } + public class TaikoModDoubleTime : ModDoubleTime { public override double ScoreMultiplier => 1.12; diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index 7c169f820b..303d936fb9 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -28,7 +28,14 @@ namespace osu.Game.Rulesets.Taiko { new TaikoModEasy(), new TaikoModNoFail(), - new TaikoModHalfTime(), + new MultiMod + { + Mods = new Mod[] + { + new TaikoModHalfTime(), + new TaikoModDaycore(), + }, + }, }; case ModType.DifficultyIncrease: diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs new file mode 100644 index 0000000000..2853a7372f --- /dev/null +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -0,0 +1,25 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Audio; +using osu.Framework.Timing; +using osu.Game.Graphics; + +namespace osu.Game.Rulesets.Mods +{ + public abstract class ModDaycore : ModHalfTime + { + public override string Name => "Daycore"; + public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; + public override string Description => "whoaaaaa"; + + public override void ApplyToClock(IAdjustableClock clock) + { + var pitchAdjust = clock as IHasPitchAdjust; + if (pitchAdjust != null) + pitchAdjust.PitchAdjust = 0.75; + else + base.ApplyToClock(clock); + } + } +} \ No newline at end of file diff --git a/osu.Game/Rulesets/Mods/ModHalfTime.cs b/osu.Game/Rulesets/Mods/ModHalfTime.cs index 207a6ec2a1..14aede0809 100644 --- a/osu.Game/Rulesets/Mods/ModHalfTime.cs +++ b/osu.Game/Rulesets/Mods/ModHalfTime.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mods public override double ScoreMultiplier => 1.12; - public void ApplyToClock(IAdjustableClock clock) + public virtual void ApplyToClock(IAdjustableClock clock) { clock.Rate = 0.75; } diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 0ec0624978..09b7784d47 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -125,6 +125,7 @@ + From cb5fcf2572856d449eadcff83af7008d7bb237a7 Mon Sep 17 00:00:00 2001 From: Shawdooow Date: Tue, 30 May 2017 13:27:10 -0400 Subject: [PATCH 02/10] change mania multiplier --- osu.Game.Rulesets.Mania/Mods/ManiaMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs index f64f96e6c2..f44ad6fd60 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaMod.cs @@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Mods public class ManiaModDaycore : ModDaycore { - public override double ScoreMultiplier => 0.5; + public override double ScoreMultiplier => 0.3; } public class ManiaModDoubleTime : ModDoubleTime From 5b80c8ac49628e892c892d1e87892c422a143a81 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 1 Jun 2017 18:29:34 +0900 Subject: [PATCH 03/10] Load initial channel content asynchronously Quite often, the first time loading a chat channel will be loading font characters (textures) that were previously never displayed. This stops the game from stuttering in such a scenario. --- osu.Game/Overlays/Chat/DrawableChannel.cs | 13 +++++++---- osu.Game/Overlays/ChatOverlay.cs | 28 +++++++++++++++-------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Chat/DrawableChannel.cs b/osu.Game/Overlays/Chat/DrawableChannel.cs index 50c849f00e..0cd6b8dd3a 100644 --- a/osu.Game/Overlays/Chat/DrawableChannel.cs +++ b/osu.Game/Overlays/Chat/DrawableChannel.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Linq; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Online.Chat; @@ -43,11 +44,15 @@ namespace osu.Game.Overlays.Chat channel.NewMessagesArrived += newMessagesArrived; } + [BackgroundDependencyLoader] + private void load() + { + newMessagesArrived(Channel.Messages); + } + protected override void LoadComplete() { base.LoadComplete(); - - newMessagesArrived(Channel.Messages); scrollToEnd(); } @@ -59,13 +64,13 @@ namespace osu.Game.Overlays.Chat private void newMessagesArrived(IEnumerable newMessages) { - if (!IsLoaded) return; - var displayMessages = newMessages.Skip(Math.Max(0, newMessages.Count() - Channel.MAX_HISTORY)); //up to last Channel.MAX_HISTORY messages flow.Add(displayMessages.Select(m => new ChatLine(m))); + if (!IsLoaded) return; + if (scroll.IsScrolledToEnd(10) || !flow.Children.Any()) scrollToEnd(); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a9970e5e95..f81c0ea922 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -266,20 +266,30 @@ namespace osu.Game.Overlays if (channelTabs.ChannelSelectorActive) return; - if (currentChannel != null) - currentChannelContainer.Clear(false); - currentChannel = value; + inputTextBox.Current.Disabled = currentChannel.ReadOnly; + channelTabs.Current.Value = value; + var loaded = loadedChannels.Find(d => d.Channel == value); if (loaded == null) - loadedChannels.Add(loaded = new DrawableChannel(currentChannel)); + { + currentChannelContainer.FadeOut(500, EasingTypes.OutQuint); - inputTextBox.Current.Disabled = currentChannel.ReadOnly; - - currentChannelContainer.Add(loaded); - - channelTabs.Current.Value = value; + loaded = new DrawableChannel(currentChannel); + loadedChannels.Add(loaded); + LoadComponentAsync(loaded, l => + { + currentChannelContainer.Clear(false); + currentChannelContainer.Add(l); + currentChannelContainer.FadeIn(500, EasingTypes.OutQuint); + }); + } + else + { + currentChannelContainer.Clear(false); + currentChannelContainer.Add(loaded); + } } } From a43890ffb40f3b7876c6d062d505e68ecaef522e Mon Sep 17 00:00:00 2001 From: Jorolf Date: Sat, 3 Jun 2017 14:50:35 +0200 Subject: [PATCH 04/10] update osu to use the framework's TooltipContainer --- .../Tests/TestCaseTooltip.cs | 1 + .../Graphics/Cursor/OsuTooltipContainer.cs | 97 +++++++++++ osu.Game/Graphics/Cursor/TooltipContainer.cs | 157 ------------------ osu.Game/Graphics/IHasTooltip.cs | 15 -- .../Graphics/UserInterface/OsuSliderBar.cs | 1 + osu.Game/OsuGameBase.cs | 2 +- osu.Game/Overlays/Mods/ModButton.cs | 2 +- osu.Game/osu.Game.csproj | 3 +- 8 files changed, 102 insertions(+), 176 deletions(-) create mode 100644 osu.Game/Graphics/Cursor/OsuTooltipContainer.cs delete mode 100644 osu.Game/Graphics/Cursor/TooltipContainer.cs delete mode 100644 osu.Game/Graphics/IHasTooltip.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs index c536672314..bc3a48fcab 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs @@ -9,6 +9,7 @@ using osu.Game.Graphics.UserInterface; using osu.Framework.Configuration; using OpenTK; using osu.Game.Graphics; +using osu.Framework.Graphics.Cursor; namespace osu.Desktop.VisualTests.Tests { diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs new file mode 100644 index 0000000000..902e92e880 --- /dev/null +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Input; +using osu.Framework.Threading; +using osu.Game.Graphics.Sprites; +using System.Linq; + +namespace osu.Game.Graphics.Cursor +{ + public class OsuTooltipContainer : TooltipContainer + { + protected override Tooltip CreateTooltip() => new OsuTooltip(); + + public OsuTooltipContainer(CursorContainer cursor) : base(cursor) + { + } + + public class OsuTooltip : Tooltip + { + private readonly Box background; + private readonly OsuSpriteText text; + + public override string TooltipText + { + set + { + if (value == text.Text) return; + + text.Text = value; + if (Alpha > 0) + { + AutoSizeDuration = 250; + background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint); + } + else + AutoSizeDuration = 0; + } + } + + private const float text_size = 16; + + public OsuTooltip() + { + AutoSizeEasing = EasingTypes.OutQuint; + + CornerRadius = 5; + Masking = true; + EdgeEffect = new EdgeEffect + { + Type = EdgeEffectType.Shadow, + Colour = Color4.Black.Opacity(40), + Radius = 5, + }; + Children = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.9f, + }, + text = new OsuSpriteText + { + TextSize = text_size, + Padding = new MarginPadding(5), + Font = @"Exo2.0-Regular", + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colour) + { + background.Colour = colour.Gray3; + } + + protected override void PopIn() + { + FadeIn(500, EasingTypes.OutQuint); + } + + protected override void PopOut() + { + using (BeginDelayedSequence(150)) + FadeOut(500, EasingTypes.OutQuint); + } + } + } +} diff --git a/osu.Game/Graphics/Cursor/TooltipContainer.cs b/osu.Game/Graphics/Cursor/TooltipContainer.cs deleted file mode 100644 index c5b8382816..0000000000 --- a/osu.Game/Graphics/Cursor/TooltipContainer.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; -using osu.Framework.Threading; -using osu.Game.Graphics.Sprites; -using System.Linq; - -namespace osu.Game.Graphics.Cursor -{ - public class TooltipContainer : Container - { - private readonly CursorContainer cursor; - private readonly Tooltip tooltip; - - private ScheduledDelegate findTooltipTask; - private UserInputManager inputManager; - - private const int default_appear_delay = 220; - - private IHasTooltip currentlyDisplayed; - - public TooltipContainer(CursorContainer cursor) - { - this.cursor = cursor; - AlwaysPresent = true; - RelativeSizeAxes = Axes.Both; - Add(tooltip = new Tooltip { Alpha = 0 }); - } - - [BackgroundDependencyLoader] - private void load(UserInputManager input) - { - inputManager = input; - } - - protected override void Update() - { - if (tooltip.IsPresent) - { - if (currentlyDisplayed != null) - tooltip.TooltipText = currentlyDisplayed.TooltipText; - - //update the position of the displayed tooltip. - tooltip.Position = ToLocalSpace(cursor.ActiveCursor.ScreenSpaceDrawQuad.Centre) + new Vector2(10); - } - } - - protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) - { - updateTooltipState(state); - return base.OnMouseUp(state, args); - } - - protected override bool OnMouseMove(InputState state) - { - updateTooltipState(state); - return base.OnMouseMove(state); - } - - private void updateTooltipState(InputState state) - { - if (currentlyDisplayed?.Hovering != true) - { - if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed) - { - tooltip.Delay(150); - tooltip.FadeOut(500, EasingTypes.OutQuint); - currentlyDisplayed = null; - } - - findTooltipTask?.Cancel(); - findTooltipTask = Scheduler.AddDelayed(delegate - { - var tooltipTarget = inputManager.HoveredDrawables.OfType().FirstOrDefault(); - - if (tooltipTarget == null) return; - - tooltip.TooltipText = tooltipTarget.TooltipText; - tooltip.FadeIn(500, EasingTypes.OutQuint); - - currentlyDisplayed = tooltipTarget; - }, (1 - tooltip.Alpha) * default_appear_delay); - } - } - - public class Tooltip : Container - { - private readonly Box background; - private readonly OsuSpriteText text; - - public string TooltipText - { - set - { - if (value == text.Text) return; - - text.Text = value; - if (Alpha > 0) - { - AutoSizeDuration = 250; - background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint); - } - else - AutoSizeDuration = 0; - } - } - - public override bool HandleInput => false; - - private const float text_size = 16; - - public Tooltip() - { - AutoSizeEasing = EasingTypes.OutQuint; - AutoSizeAxes = Axes.Both; - - CornerRadius = 5; - Masking = true; - EdgeEffect = new EdgeEffect - { - Type = EdgeEffectType.Shadow, - Colour = Color4.Black.Opacity(40), - Radius = 5, - }; - Children = new Drawable[] - { - background = new Box - { - RelativeSizeAxes = Axes.Both, - Alpha = 0.9f, - }, - text = new OsuSpriteText - { - TextSize = text_size, - Padding = new MarginPadding(5), - Font = @"Exo2.0-Regular", - } - }; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colour) - { - background.Colour = colour.Gray3; - } - } - } -} diff --git a/osu.Game/Graphics/IHasTooltip.cs b/osu.Game/Graphics/IHasTooltip.cs deleted file mode 100644 index dd51d68c41..0000000000 --- a/osu.Game/Graphics/IHasTooltip.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics; - -namespace osu.Game.Graphics -{ - public interface IHasTooltip : IDrawable - { - /// - /// Tooltip that shows when hovering the drawable - /// - string TooltipText { get; } - } -} diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index 6cf7b2dfa5..c8be085b51 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Graphics.UserInterface { diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 2c39a82245..b228b6485a 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -158,7 +158,7 @@ namespace osu.Game Children = new Drawable[] { Cursor = new MenuCursor(), - new TooltipContainer(Cursor) { Depth = -1 }, + new OsuTooltipContainer(Cursor) { Depth = -1 }, } }, } diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index f7df67b66d..dd135e43ef 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -16,7 +16,7 @@ using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using System; using System.Linq; -using osu.Game.Graphics; +using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Mods { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index b58e2f8c41..6b3b4d01ba 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -105,7 +105,6 @@ - @@ -118,7 +117,7 @@ - + From 50158a1cd2b95f33319b9515e70cc9bd78364cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 16:34:00 +0200 Subject: [PATCH 05/10] Fix incorrect proportions of menu cursor --- osu-framework | 2 +- osu.Game/Graphics/Cursor/MenuCursor.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/osu-framework b/osu-framework index e5f0cf73c1..8e1aa80d64 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit e5f0cf73c1e0bbcbd04194bf175d73af47fc850a +Subproject commit 8e1aa80d64094f9c2590278b990ba17c2fb38f0b diff --git a/osu.Game/Graphics/Cursor/MenuCursor.cs b/osu.Game/Graphics/Cursor/MenuCursor.cs index b48ab879a6..82ae424ab0 100644 --- a/osu.Game/Graphics/Cursor/MenuCursor.cs +++ b/osu.Game/Graphics/Cursor/MenuCursor.cs @@ -93,6 +93,7 @@ namespace osu.Game.Graphics.Cursor { private Container cursorContainer; private Bindable cursorScale; + private const float base_scale = 0.15f; public Sprite AdditiveLayer; @@ -108,17 +109,15 @@ namespace osu.Game.Graphics.Cursor { cursorContainer = new Container { - Size = new Vector2(32), + AutoSizeAxes = Axes.Both, Children = new Drawable[] { new Sprite { - FillMode = FillMode.Fit, Texture = textures.Get(@"Cursor/menu-cursor"), }, AdditiveLayer = new Sprite { - FillMode = FillMode.Fit, BlendingMode = BlendingMode.Additive, Colour = colour.Pink, Alpha = 0, @@ -129,7 +128,7 @@ namespace osu.Game.Graphics.Cursor }; cursorScale = config.GetBindable(OsuSetting.MenuCursorSize); - cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale); + cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale); cursorScale.TriggerChange(); } } From b2bbf65e39df25328ce642108f70b0cf37f12069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:01:21 +0200 Subject: [PATCH 06/10] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 8e1aa80d64..c76d8b811b 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8e1aa80d64094f9c2590278b990ba17c2fb38f0b +Subproject commit c76d8b811b93d0c0862f342ebbab70a461006e13 From 9c6ce230bca4a6c131b3cd849cb888c610b7c85f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:17:56 +0200 Subject: [PATCH 07/10] Fix compile error --- osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs index 2b52b06abc..89b4a90010 100644 --- a/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs +++ b/osu.Game/Graphics/Containers/ReverseDepthFillFlowContainer.cs @@ -11,6 +11,6 @@ namespace osu.Game.Graphics.Containers public class ReverseDepthFillFlowContainer : FillFlowContainer where T : Drawable { protected override IComparer DepthComparer => new ReverseCreationOrderDepthComparer(); - protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); + protected override IEnumerable FlowingChildren => base.FlowingChildren.Reverse(); } } From 3daae480d22ef7620a67e45d9c9cfbf3b919c040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:28:34 +0200 Subject: [PATCH 08/10] Remove TestCaseTooltip --- .../Tests/TestCaseTooltip.cs | 93 ------------------- .../osu.Desktop.VisualTests.csproj | 1 - 2 files changed, 94 deletions(-) delete mode 100644 osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs b/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs deleted file mode 100644 index bc3a48fcab..0000000000 --- a/osu.Desktop.VisualTests/Tests/TestCaseTooltip.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Testing; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Framework.Configuration; -using OpenTK; -using osu.Game.Graphics; -using osu.Framework.Graphics.Cursor; - -namespace osu.Desktop.VisualTests.Tests -{ - internal class TestCaseTooltip : TestCase - { - public override string Description => "tests tooltips on various elements"; - - public override void Reset() - { - base.Reset(); - OsuSliderBar slider; - OsuSliderBar sliderDouble; - - const float width = 400; - - Children = new Drawable[] - { - new FillFlowContainer - { - RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Spacing = new Vector2(0, 10), - Children = new Drawable[] - { - new TooltipTextContainer("text with a tooltip"), - new TooltipTextContainer("more text with another tooltip"), - new TooltipTextbox - { - Text = "a textbox with a tooltip", - Size = new Vector2(width,30), - }, - slider = new OsuSliderBar - { - Width = width, - }, - sliderDouble = new OsuSliderBar - { - Width = width, - }, - }, - }, - }; - - slider.Current.BindTo(new BindableInt(5) - { - MaxValue = 10, - MinValue = 0 - }); - - sliderDouble.Current.BindTo(new BindableDouble(0.5) - { - MaxValue = 1, - MinValue = 0 - }); - } - - private class TooltipTextContainer : Container, IHasTooltip - { - private readonly OsuSpriteText text; - - public string TooltipText => text.Text; - - public TooltipTextContainer(string tooltipText) - { - AutoSizeAxes = Axes.Both; - Children = new[] - { - text = new OsuSpriteText - { - Text = tooltipText, - } - }; - } - } - - private class TooltipTextbox : OsuTextBox, IHasTooltip - { - public string TooltipText => Text; - } - } -} diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 5a532d7234..850c38cc24 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -208,7 +208,6 @@ - From 2c5979ea8ae954a3bfcbf70dd4c56bfff614d69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 3 Jun 2017 17:29:20 +0200 Subject: [PATCH 09/10] Remove unnecessary usings --- osu.Game/Graphics/Cursor/OsuTooltipContainer.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs index 902e92e880..46addf5ac2 100644 --- a/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuTooltipContainer.cs @@ -1,7 +1,6 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; @@ -9,10 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; -using osu.Framework.Input; -using osu.Framework.Threading; using osu.Game.Graphics.Sprites; -using System.Linq; namespace osu.Game.Graphics.Cursor { From 52bb2df69b402510c5b57b0d731f64c5aea18132 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 5 Jun 2017 09:40:22 +0900 Subject: [PATCH 10/10] Change to fa_question for now, pending flyte redesign. --- osu.Game/Rulesets/Mods/ModDaycore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/ModDaycore.cs b/osu.Game/Rulesets/Mods/ModDaycore.cs index 2853a7372f..3e878d7104 100644 --- a/osu.Game/Rulesets/Mods/ModDaycore.cs +++ b/osu.Game/Rulesets/Mods/ModDaycore.cs @@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Mods public abstract class ModDaycore : ModHalfTime { public override string Name => "Daycore"; - public override FontAwesome Icon => FontAwesome.fa_osu_mod_nightcore; + public override FontAwesome Icon => FontAwesome.fa_question; public override string Description => "whoaaaaa"; public override void ApplyToClock(IAdjustableClock clock)