diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index 880b80edf8..6d9dc6025f 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -11,6 +12,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Menu; using OpenTK; +using OpenTK.Graphics; namespace osu.Game.Tournament.Components { @@ -44,6 +46,28 @@ namespace osu.Game.Tournament.Components } private Container panelContents; + private Container innerPanel; + private Container outerPanel; + + private const float main_width = 0.97f; + + public bool Expanded + { + set + { + if (value) + { + innerPanel.ResizeWidthTo(0.7f, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(main_width, 800, Easing.OutQuint); + } + else + { + innerPanel.ResizeWidthTo(1, 800, Easing.OutQuint); + outerPanel.ResizeWidthTo(0.3f, 800, Easing.OutQuint); + } + } + } + [BackgroundDependencyLoader] private void load() @@ -52,12 +76,20 @@ namespace osu.Game.Tournament.Components InternalChildren = new Drawable[] { - new Container + outerPanel = new Container { Masking = true, + EdgeEffect = new EdgeEffectParameters + { + Colour = Color4.Black.Opacity(0.2f), + Type = EdgeEffectType.Shadow, + Radius = 5, + }, RelativeSizeAxes = Axes.X, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, + RelativePositionAxes = Axes.X, + X = -(1 - main_width) / 2, Y = -10, Width = 0.95f, Height = TournamentBeatmapPanel.HEIGHT, @@ -69,7 +101,7 @@ namespace osu.Game.Tournament.Components RelativeSizeAxes = Axes.Both, Colour = OsuColour.Gray(0.93f), }, - new Container + innerPanel = new Container { Masking = true, CornerRadius = TournamentBeatmapPanel.HEIGHT / 2, diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 168ff80eb7..2ad30db748 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -87,9 +87,8 @@ namespace osu.Game.Tournament.IPC State.Value = (TourneyState)Enum.Parse(typeof(TourneyState), sr.ReadLine()); } } - catch (Exception e) + catch (Exception) { - Logger.Log(e.ToString(), LoggingTarget.Runtime); // file might be in use. } @@ -102,9 +101,8 @@ namespace osu.Game.Tournament.IPC Score2 = int.Parse(sr.ReadLine()); } } - catch (Exception e) + catch (Exception) { - Logger.Log(e.ToString(), LoggingTarget.Runtime); // file might be in use. } }, 250, true); diff --git a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs index 11cbb56b49..4ddd475b6e 100644 --- a/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs +++ b/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs @@ -19,8 +19,8 @@ namespace osu.Game.Tournament.Screens { Add(SongBar = new SongBar { - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight, }); } diff --git a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs index 31c5e9f426..a89200f3a5 100644 --- a/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs +++ b/osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs @@ -54,7 +54,7 @@ namespace osu.Game.Tournament.Screens.Gameplay Colour = Color4.Gray, RelativeSizeAxes = Axes.X, Text = "Toggle warmup", - Action = toggleWarmup + Action = () => warmup.Toggle() } } } @@ -64,6 +64,8 @@ namespace osu.Game.Tournament.Screens.Gameplay State.BindTo(ipc.State); currentMatch.BindTo(ladder.CurrentMatch); + + warmup.BindValueChanged(w => warmupButton.Colour = !w ? Color4.White : Color4.Gray, true); } private void stateChanged(TourneyState state) @@ -77,15 +79,18 @@ namespace osu.Game.Tournament.Screens.Gameplay else currentMatch.Value.Team2Score.Value++; } - } - private void toggleWarmup() - { - warmup.Toggle(); - if (warmup.Value) - warmupButton.Colour = Color4.White; + if (state == TourneyState.Idle) + { + // show chat + SongBar.Expanded = false; + } else - warmupButton.Colour = Color4.Gray; + { + SongBar.Expanded = true; + } + + } } }