diff --git a/osu-framework b/osu-framework index 3f68cf9d03..4d78fdfbe0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 3f68cf9d03d47d07d4c804027f45d32432e08ee6 +Subproject commit 4d78fdfbe01e3ecb213c19a3f3243c80a71bb668 diff --git a/osu-resources b/osu-resources index fd4a3dd522..cc107f9bcf 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit fd4a3dd5223af6eb1c261af070b4220c9ff9ec2d +Subproject commit cc107f9bcfc8efeeff88f19c2df8cec9755eda39 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs index 3305cdcf85..353ad4f9f1 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseChatDisplay.cs @@ -54,7 +54,7 @@ namespace osu.Desktop.Tests flow = new FlowContainer { Direction = FlowDirection.VerticalOnly, - SizeMode = InheritMode.X, + RelativeSizeAxes = Axes.X, LayoutDuration = 100, LayoutEasing = EasingTypes.Out, Padding = new Vector2(1, 1) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs index 2786cecd44..085100acf9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs @@ -31,8 +31,10 @@ namespace osu.Desktop.Tests { base.Reset(); - ///create a new clock offset to 0. - localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime }; + //ensure we are at offset 0 + if (localClock == null) + localClock = new FramedOffsetClock(base.Clock); + localClock.Offset = -base.Clock.CurrentTime; List objects = new List(); diff --git a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs index ace1daf205..d7aba30c3e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseTextAwesome.cs @@ -30,7 +30,7 @@ namespace osu.Desktop.Tests Add(flow = new FlowContainer() { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f), Anchor = Anchor.Centre, Origin = Anchor.Centre diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index 3637fcdd3d..4bca922b22 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -33,7 +33,7 @@ namespace osu.Game.GameModes popButton.Alpha = 1; Content.Alpha = 0; - textContainer.Position = new Vector2(ActualSize.X / 16, 0); + textContainer.Position = new Vector2(Size.X / 16, 0); Content.Delay(300); textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo); @@ -43,14 +43,14 @@ namespace osu.Game.GameModes protected override double OnExiting(GameMode next) { - textContainer.MoveTo(new Vector2((ActualSize.X / 16), 0), transition_time, EasingTypes.OutExpo); + textContainer.MoveTo(new Vector2((Size.X / 16), 0), transition_time, EasingTypes.OutExpo); Content.FadeOut(transition_time, EasingTypes.OutExpo); return transition_time; } protected override double OnSuspending(GameMode next) { - textContainer.MoveTo(new Vector2(-(ActualSize.X / 16), 0), transition_time, EasingTypes.OutExpo); + textContainer.MoveTo(new Vector2(-(Size.X / 16), 0), transition_time, EasingTypes.OutExpo); Content.FadeOut(transition_time, EasingTypes.OutExpo); return transition_time; } @@ -70,7 +70,7 @@ namespace osu.Game.GameModes { new Box { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Size = new Vector2(0.7f), Anchor = Anchor.Centre, Origin = Anchor.Centre, @@ -103,7 +103,7 @@ namespace osu.Game.GameModes popButton = new Button { Text = @"Back", - SizeMode = InheritMode.X, + RelativeSizeAxes = Axes.X, Size = new Vector2(0.1f, 40), Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, @@ -118,7 +118,7 @@ namespace osu.Game.GameModes Direction = FlowDirection.VerticalOnly, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Size = new Vector2(0.1f, 1) } }; @@ -130,7 +130,7 @@ namespace osu.Game.GameModes childModeButtons.Add(new Button { Text = $@"{t.Name}", - SizeMode = InheritMode.X, + RelativeSizeAxes = Axes.X, Size = new Vector2(1, 40), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 671a08d2a0..a4fbf37886 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -19,7 +19,7 @@ using OpenTK.Input; namespace osu.Game.GameModes.Menu { - public class ButtonSystem : LargeContainer + public class ButtonSystem : Container { public Action OnEdit; public Action OnExit; @@ -58,6 +58,11 @@ namespace osu.Game.GameModes.Menu Exit, } + public ButtonSystem() + { + RelativeSizeAxes = Axes.Both; + } + public override void Load() { base.Load(); @@ -68,14 +73,14 @@ namespace osu.Game.GameModes.Menu { Anchor = Anchor.Centre, Origin = Anchor.Centre, - SizeMode = InheritMode.X, + RelativeSizeAxes = Axes.X, Size = new Vector2(1, button_area_height), Alpha = 0, Children = new Drawable[] { buttonAreaBackground = new Box { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Size = new Vector2(2, 1), Colour = new Color4(50, 50, 50, 255), Anchor = Anchor.Centre, @@ -279,7 +284,7 @@ namespace osu.Game.GameModes.Menu private MenuVisualisation vis; private Action clickAction; - public float SizeForFlow => logo == null ? 0 : logo.ActualSize.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f; + public float SizeForFlow => logo == null ? 0 : logo.Size.X * logo.Scale.X * logoBounceContainer.Scale.X * 0.8f; public override void Load() { diff --git a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs index 645354629f..0c42039af0 100644 --- a/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs +++ b/osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs @@ -66,10 +66,10 @@ namespace osu.Game.GameModes.Play.Catch //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"menu-osu"), + Texture = Game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), - PositionMode = InheritMode.Y, + RelativePositionAxes = Axes.Y, Position = new Vector2(h.Position, -0.1f) }; diff --git a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs index 5f148f7606..97979319e2 100644 --- a/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs +++ b/osu.Game/GameModes/Play/Catch/CatchPlayfield.cs @@ -14,7 +14,7 @@ namespace osu.Game.GameModes.Play.Catch { public CatchPlayfield() { - SizeMode = InheritMode.Y; + RelativeSizeAxes = Axes.Y; Size = new Vector2(512, 0.9f); Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; @@ -24,7 +24,7 @@ namespace osu.Game.GameModes.Play.Catch { base.Load(); - Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); } } } \ No newline at end of file diff --git a/osu.Game/GameModes/Play/HitRenderer.cs b/osu.Game/GameModes/Play/HitRenderer.cs index 3268789a6a..4a03e7b060 100644 --- a/osu.Game/GameModes/Play/HitRenderer.cs +++ b/osu.Game/GameModes/Play/HitRenderer.cs @@ -11,15 +11,20 @@ using OpenTK; namespace osu.Game.GameModes.Play { - public abstract class HitRenderer : LargeContainer + public abstract class HitRenderer : Container { public abstract List Objects { set; } + public HitRenderer() + { + RelativeSizeAxes = Axes.Both; + } + public override void Load() { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = new Vector2(0.99f) }); + Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.1f, Scale = new Vector2(0.99f) }); } } } diff --git a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs index 551d94d2b6..e001626974 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs @@ -72,10 +72,10 @@ namespace osu.Game.GameModes.Play.Mania //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"menu-osu"), + Texture = Game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f) }; diff --git a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs index 81639e237f..287db8777b 100644 --- a/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs +++ b/osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs @@ -17,7 +17,7 @@ namespace osu.Game.GameModes.Play.Mania public ManiaPlayfield(int columns) { this.columns = columns; - SizeMode = InheritMode.XY; + RelativeSizeAxes = Axes.Both; Size = new Vector2(columns / 20f, 1f); Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; @@ -27,14 +27,14 @@ namespace osu.Game.GameModes.Play.Mania { base.Load(); - Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box() { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); for (int i = 0; i < columns; i++) Add(new Box() { - SizeMode = InheritMode.Y, + RelativeSizeAxes = Axes.Y, Size = new Vector2(2, 1), - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2((float)i / columns, 0), Alpha = 0.5f, Colour = Color4.Black diff --git a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs index 8dd49807c0..d2f72fd85f 100644 --- a/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs +++ b/osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs @@ -44,7 +44,7 @@ namespace osu.Game.GameModes.Play.Osu //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"menu-osu"), + Texture = Game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.1f), Alpha = 0, diff --git a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs index 4deb012a09..dd3348d8e1 100644 --- a/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs +++ b/osu.Game/GameModes/Play/Osu/OsuPlayfield.cs @@ -12,7 +12,7 @@ namespace osu.Game.GameModes.Play.Osu { public OsuPlayfield() { - SizeMode = InheritMode.None; + RelativeSizeAxes = Axes.None; Size = new Vector2(512, 384); Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -26,7 +26,7 @@ namespace osu.Game.GameModes.Play.Osu { Anchor = Anchor.Centre, Origin = Anchor.Centre, - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); } diff --git a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs index e1d3b2e5aa..7315614c8d 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs @@ -65,10 +65,10 @@ namespace osu.Game.GameModes.Play.Taiko //render stuff! Sprite s = new Sprite { - Texture = Game.Textures.Get(@"menu-osu"), + Texture = Game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2(1.1f, 0.5f) }; diff --git a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs index 03c33c2c9b..e99914c1c2 100644 --- a/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs +++ b/osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs @@ -14,7 +14,7 @@ namespace osu.Game.GameModes.Play.Taiko { public TaikoPlayfield() { - SizeMode = InheritMode.X; + RelativeSizeAxes = Axes.X; Size = new Vector2(1, 100); Anchor = Anchor.Centre; Origin = Anchor.Centre; @@ -24,14 +24,14 @@ namespace osu.Game.GameModes.Play.Taiko { base.Load(); - Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f }); + Add(new Box { RelativeSizeAxes = Axes.Both, Alpha = 0.5f }); Add(new Sprite { - Texture = Game.Textures.Get(@"menu-osu"), + Texture = Game.Textures.Get(@"Menu/logo"), Origin = Anchor.Centre, Scale = new Vector2(0.2f), - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2(0.1f, 0.5f), Colour = Color4.Gray }); diff --git a/osu.Game/Graphics/Background/Background.cs b/osu.Game/Graphics/Background/Background.cs index 13ce516559..f9bcc0bd15 100644 --- a/osu.Game/Graphics/Background/Background.cs +++ b/osu.Game/Graphics/Background/Background.cs @@ -11,10 +11,15 @@ using osu.Framework.Graphics.Containers; namespace osu.Game.Graphics.Background { - class Background : LargeContainer + class Background : Container { protected Sprite BackgroundSprite; + public Background() + { + RelativeSizeAxes = Axes.Both; + } + public override void Load() { base.Load(); @@ -31,7 +36,7 @@ namespace osu.Game.Graphics.Background protected override void Update() { base.Update(); - BackgroundSprite.Scale = new Vector2(Math.Max(ActualSize.X / BackgroundSprite.Size.X, ActualSize.Y / BackgroundSprite.Size.Y)); + BackgroundSprite.Scale = new Vector2(Math.Max(Size.X / BackgroundSprite.Size.X, Size.Y / BackgroundSprite.Size.Y)); } } } diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 64ca079eec..3c6cb18162 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -5,14 +5,20 @@ using OpenTK; namespace osu.Game.Graphics.Containers { - class ParallaxContainer : LargeContainer + class ParallaxContainer : Container { public float ParallaxAmount = 0.02f; public override bool Contains(Vector2 screenSpacePos) => true; - private Container content = new LargeContainer() + public ParallaxContainer() { + RelativeSizeAxes = Axes.Both; + } + + private Container content = new Container() + { + RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre }; @@ -27,7 +33,7 @@ namespace osu.Game.Graphics.Containers protected override bool OnMouseMove(InputState state) { - content.Position = (state.Mouse.Position - ActualSize / 2) * ParallaxAmount; + content.Position = (state.Mouse.Position - Size / 2) * ParallaxAmount; return base.OnMouseMove(state); } diff --git a/osu.Game/Graphics/Processing/RatioAdjust.cs b/osu.Game/Graphics/Processing/RatioAdjust.cs index 47ad9d36da..9c74f0fc66 100644 --- a/osu.Game/Graphics/Processing/RatioAdjust.cs +++ b/osu.Game/Graphics/Processing/RatioAdjust.cs @@ -4,17 +4,23 @@ using System; using osu.Framework.Graphics.Containers; using OpenTK; +using osu.Framework.Graphics; namespace osu.Game.Graphics.Processing { - class RatioAdjust : LargeContainer + class RatioAdjust : Container { public override bool Contains(Vector2 screenSpacePos) => true; + public RatioAdjust() + { + RelativeSizeAxes = Axes.Both; + } + protected override void Update() { base.Update(); - Vector2 parent = Parent.ActualSize; + Vector2 parent = Parent.Size; Scale = new Vector2(Math.Min(parent.Y / 768f, parent.X / 1024f)); Size = new Vector2(1 / Scale.X); diff --git a/osu.Game/Graphics/UserInterface/KeyCounter.cs b/osu.Game/Graphics/UserInterface/KeyCounter.cs index d715c7c0fd..480476ed00 100644 --- a/osu.Game/Graphics/UserInterface/KeyCounter.cs +++ b/osu.Game/Graphics/UserInterface/KeyCounter.cs @@ -80,7 +80,7 @@ namespace osu.Game.Graphics.UserInterface { Anchor = Anchor.Centre, Origin = Anchor.Centre, - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Children = new Drawable[] { new SpriteText @@ -88,7 +88,7 @@ namespace osu.Game.Graphics.UserInterface Text = Name, Anchor = Anchor.Centre, Origin = Anchor.Centre, - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2(0, -0.25f), Colour = KeyUpTextColor }, @@ -97,7 +97,7 @@ namespace osu.Game.Graphics.UserInterface Text = Count.ToString(@"#,0"), Anchor = Anchor.Centre, Origin = Anchor.Centre, - PositionMode = InheritMode.XY, + RelativePositionAxes = Axes.Both, Position = new Vector2(0, 0.25f), Colour = KeyUpTextColor } diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 7e11aeb068..aa75107c09 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -25,11 +25,11 @@ namespace osu.Game.Online.Chat.Display { base.Load(); - SizeMode = InheritMode.X; + RelativeSizeAxes = Axes.X; Add(new Box { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Colour = Color4.Aqua, Alpha = 0.2f }); @@ -44,16 +44,16 @@ namespace osu.Game.Online.Chat.Display { Text = msg.User.Name, Origin = Anchor.TopRight, - PositionMode = InheritMode.X, + RelativePositionAxes = Axes.X, Position = new Vector2(0.14f,0), }); Add(new SpriteText { Text = msg.Content, - PositionMode = InheritMode.X, + RelativePositionAxes = Axes.X, Position = new Vector2(0.15f, 0), - SizeMode = InheritMode.X, + RelativeSizeAxes = Axes.X, Size = new Vector2(0.85f, 1), }); } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b7c4edd9d2..9ba587a195 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -29,6 +29,8 @@ namespace osu.Game { base.Load(); + ShowPerformanceOverlay = true; + Add(new Drawable[] { new ParallaxContainer { @@ -47,8 +49,8 @@ namespace osu.Game if (Parent != null) { - Config.Set(OsuConfig.Width, ActualSize.X); - Config.Set(OsuConfig.Height, ActualSize.Y); + Config.Set(OsuConfig.Width, Size.X); + Config.Set(OsuConfig.Height, Size.Y); } return true; } diff --git a/osu.Game/Overlays/Options.cs b/osu.Game/Overlays/Options.cs index 284b4ff3d0..4eb2b0f235 100644 --- a/osu.Game/Overlays/Options.cs +++ b/osu.Game/Overlays/Options.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays base.Load(); Depth = float.MaxValue; - SizeMode = InheritMode.Y; + RelativeSizeAxes = Axes.Y; Size = new Vector2(width, 1); Position = new Vector2(-width, 0); @@ -29,7 +29,7 @@ namespace osu.Game.Overlays { new Box { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f) } }; diff --git a/osu.Game/Overlays/Toolbar.cs b/osu.Game/Overlays/Toolbar.cs index 3aa86272dd..2db9f1ba96 100644 --- a/osu.Game/Overlays/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar.cs @@ -22,15 +22,14 @@ namespace osu.Game.Overlays { base.Load(); - Depth = float.MaxValue; - SizeMode = InheritMode.X; + RelativeSizeAxes = Axes.X; Size = new Vector2(1, height); Children = new Drawable[] { new Box { - SizeMode = InheritMode.XY, + RelativeSizeAxes = Axes.Both, Colour = new Color4(0.1f, 0.1f, 0.1f, 0.9f) } };