diff --git a/osu-framework b/osu-framework index 8591632d90..5dc6a02088 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8591632d904e83fd408a378bb753e884c82d6308 +Subproject commit 5dc6a02088d0fac39810fc2da26ac0de72551939 diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index 121cb20d12..9c404e7241 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -6,7 +6,6 @@ using System.Collections.Generic; using osu.Framework.GameModes; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Graphics.UserInterface; diff --git a/osu.Game/GameModes/Menu/Button.cs b/osu.Game/GameModes/Menu/Button.cs index 261af9e78b..91cf7c473f 100644 --- a/osu.Game/GameModes/Menu/Button.cs +++ b/osu.Game/GameModes/Menu/Button.cs @@ -4,7 +4,6 @@ using OpenTK.Input; using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; @@ -21,7 +20,7 @@ namespace osu.Game.GameModes.Menu public class Button : AutoSizeContainer, IStateful { private Container iconText; - private WedgedBox box; + private Box box; private Color4 colour; private TextAwesome icon; private string internalName; @@ -31,7 +30,10 @@ namespace osu.Game.GameModes.Menu private Key triggerKey; private string text; - public override Quad ScreenSpaceInputQuad => box.ScreenSpaceInputQuad; + public override bool Contains(Vector2 screenSpacePos) + { + return box.Contains(screenSpacePos); + } public Button(string text, string internalName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown) { @@ -49,14 +51,18 @@ namespace osu.Game.GameModes.Menu base.Load(game); Alpha = 0; + Vector2 boxSize = new Vector2(ButtonSystem.button_width + Math.Abs(extraWidth), ButtonSystem.button_area_height); + Children = new Drawable[] { - box = new WedgedBox(new Vector2(ButtonSystem.button_width + Math.Abs(extraWidth), ButtonSystem.button_area_height), ButtonSystem.wedge_width) + box = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = colour, - Scale = new Vector2(0, 1) + Scale = new Vector2(0, 1), + Size = boxSize, + Shear = new Vector2(ButtonSystem.wedge_width / boxSize.Y, 0), }, iconText = new AutoSizeContainer { @@ -267,42 +273,6 @@ namespace osu.Game.GameModes.Menu } } } - - /// - /// ________ - /// / / - /// / / - /// /_______/ - /// - class WedgedBox : Box - { - float wedgeWidth; - - public WedgedBox(Vector2 boxSize, float wedgeWidth) - { - Size = boxSize; - this.wedgeWidth = wedgeWidth; - } - - /// - /// Custom DrawQuad used to create the slanted effect. - /// - protected override Quad DrawQuad - { - get - { - Quad q = base.DrawQuad; - - //Will become infinite if we don't limit its maximum size. - float wedge = Math.Min(q.Width, wedgeWidth / Scale.X); - - q.TopLeft.X += wedge; - q.BottomRight.X -= wedge; - - return q; - } - } - } } public enum ButtonState diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index b4911928a4..2f1d84b3ab 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -6,13 +6,10 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; -using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; using osu.Game.Graphics; -using osu.Game.Graphics.Containers; using OpenTK; using OpenTK.Graphics; using OpenTK.Input; diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs index fef80e6b4a..a9c781c138 100644 --- a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs index 53de8221eb..ed21c52e81 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index e232a2af40..b18666cef3 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -3,9 +3,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using OpenTK; using osu.Framework; +using osu.Framework.Graphics.Sprites; namespace osu.Game.GameModes.Play.Osu { diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 0f2ab70727..18e22ffd02 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -3,7 +3,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 92146be0b2..3f1152064e 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -5,7 +5,6 @@ using System; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game/Overlays/ChatConsole.cs b/osu.Game/Overlays/ChatConsole.cs index 2876fa19cc..ed52ddef24 100644 --- a/osu.Game/Overlays/ChatConsole.cs +++ b/osu.Game/Overlays/ChatConsole.cs @@ -9,7 +9,6 @@ using OpenTK.Graphics; using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Threading; diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index 1031de5084..8855b5bfc0 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -7,7 +7,7 @@ using OpenTK.Input; using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index 34861046be..1797554410 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -7,11 +7,11 @@ using OpenTK.Graphics; using osu.Framework; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Transformations; using osu.Game.Configuration; using osu.Game.GameModes.Play; using osu.Game.Graphics; +using osu.Framework.Graphics.Sprites; namespace osu.Game.Overlays { diff --git a/osu.Game/Overlays/ToolbarButton.cs b/osu.Game/Overlays/ToolbarButton.cs index 79cd79aee0..3d74f7724e 100644 --- a/osu.Game/Overlays/ToolbarButton.cs +++ b/osu.Game/Overlays/ToolbarButton.cs @@ -4,7 +4,6 @@ using System; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using osu.Framework.Input; using osu.Game.Graphics; diff --git a/osu.Game/Overlays/ToolbarModeSelector.cs b/osu.Game/Overlays/ToolbarModeSelector.cs index d73c7dc8a9..7f82ab3e90 100644 --- a/osu.Game/Overlays/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/ToolbarModeSelector.cs @@ -6,12 +6,12 @@ using System.Linq; using osu.Framework.Cached; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Transformations; using osu.Game.GameModes.Play; using OpenTK; using OpenTK.Graphics; using osu.Framework; +using osu.Framework.Graphics.Sprites; namespace osu.Game.Overlays { diff --git a/osu.Game/VolumeMeter.cs b/osu.Game/VolumeMeter.cs index 121059a380..a9afe62820 100644 --- a/osu.Game/VolumeMeter.cs +++ b/osu.Game/VolumeMeter.cs @@ -1,7 +1,6 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input;