From c9e2ee8f5623c229248b4618022d7024b05b0448 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 16 Nov 2018 18:14:42 +0900 Subject: [PATCH] Fix masking of song bar --- osu.Game.Tournament/Components/SongBar.cs | 39 ++++++++++++------- .../Components/TournamentBeatmapPanel.cs | 2 +- .../Screens/Gameplay/GameplayScreen.cs | 6 +++ 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index d145544b76..94848b9130 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -48,14 +48,23 @@ namespace osu.Game.Tournament.Components private Container panelContents; private Container innerPanel; private Container outerPanel; + private TournamentBeatmapPanel panel; + + private float panelWidth => expanded ? 0.6f : 1; private const float main_width = 0.97f; + private bool expanded; + public bool Expanded { + get => expanded; set { - if (value) + expanded = value; + panel.ResizeWidthTo(panelWidth, 800, Easing.OutQuint); + + if (expanded) { innerPanel.ResizeWidthTo(0.7f, 800, Easing.OutQuint); outerPanel.ResizeWidthTo(main_width, 800, Easing.OutQuint); @@ -63,7 +72,7 @@ namespace osu.Game.Tournament.Components else { innerPanel.ResizeWidthTo(1, 800, Easing.OutQuint); - outerPanel.ResizeWidthTo(0.3f, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(0.2f, 800, Easing.OutQuint); } } } @@ -91,7 +100,7 @@ namespace osu.Game.Tournament.Components RelativePositionAxes = Axes.X, X = -(1 - main_width) / 2, Y = -10, - Width = 0.95f, + Width = main_width, Height = TournamentBeatmapPanel.HEIGHT, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, Children = new Drawable[] @@ -101,6 +110,15 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.93f), }, + new OsuLogo + { + Triangles = false, + Colour = OsuColour.Gray(0.33f), + Scale = new Vector2(0.08f), + Margin = new MarginPadding(50), + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + }, innerPanel = new Container { Masking = true, @@ -121,15 +139,6 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, } } - }, - new OsuLogo - { - Triangles = false, - Colour = OsuColour.Gray(0.33f), - Scale = new Vector2(0.08f), - Margin = new MarginPadding(50), - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, } } } @@ -193,10 +202,12 @@ namespace osu.Game.Tournament.Components Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight }, - new TournamentBeatmapPanel(beatmap) + panel = new TournamentBeatmapPanel(beatmap) { Anchor = Anchor.Centre, - Origin = Anchor.Centre + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(panelWidth, 1) } }; } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index d2bc790b16..4456abb48e 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -44,7 +44,7 @@ namespace osu.Game.Tournament.Components currentMatch.BindValueChanged(matchChanged); currentMatch.BindTo(ladder.CurrentMatch); - CornerRadius = 25; + CornerRadius = HEIGHT / 2; Masking = true; AddRangeInternal(new Drawable[] diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index a86c47839b..d3fd08bb8b 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -91,6 +91,12 @@ namespace osu.Game.Tournament.Screens.Gameplay RelativeSizeAxes = Axes.X, Text = "Toggle warmup", Action = () => warmup.Toggle() + }, + new TriangleButton + { + RelativeSizeAxes = Axes.X, + Text = "Toggle chat", + Action = () => { State.Value = State.Value == TourneyState.Idle ? TourneyState.Playing : TourneyState.Idle; } } } }