mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 17:02:58 +08:00
Tournament highlight active screen (#6764)
Tournament highlight active screen Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
commit
7c2400ca29
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
using osu.Game.Tournament.Models;
|
using osu.Game.Tournament.Models;
|
||||||
using osu.Game.Tournament.Screens;
|
using osu.Game.Tournament.Screens;
|
||||||
@ -35,6 +36,7 @@ namespace osu.Game.Tournament
|
|||||||
private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay();
|
private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay();
|
||||||
|
|
||||||
private Container chatContainer;
|
private Container chatContainer;
|
||||||
|
private FillFlowContainer buttons;
|
||||||
|
|
||||||
public TournamentSceneManager()
|
public TournamentSceneManager()
|
||||||
{
|
{
|
||||||
@ -100,29 +102,32 @@ namespace osu.Game.Tournament
|
|||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
buttons = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
|
Spacing = new Vector2(2),
|
||||||
|
Padding = new MarginPadding(2),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Setup", Action = () => SetScreen(typeof(SetupScreen)) },
|
new ScreenButton(typeof(SetupScreen)) { Text = "Setup", RequestSelection = SetScreen },
|
||||||
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
new Separator(),
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Team Editor", Action = () => SetScreen(typeof(TeamEditorScreen)) },
|
new ScreenButton(typeof(TeamEditorScreen)) { Text = "Team Editor", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Rounds Editor", Action = () => SetScreen(typeof(RoundEditorScreen)) },
|
new ScreenButton(typeof(RoundEditorScreen)) { Text = "Rounds Editor", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Bracket Editor", Action = () => SetScreen(typeof(LadderEditorScreen)) },
|
new ScreenButton(typeof(LadderEditorScreen)) { Text = "Bracket Editor", RequestSelection = SetScreen },
|
||||||
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
new Separator(),
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => SetScreen(typeof(DrawingsScreen)) },
|
new ScreenButton(typeof(ScheduleScreen)) { Text = "Schedule", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => SetScreen(typeof(ShowcaseScreen)) },
|
new ScreenButton(typeof(LadderScreen)) { Text = "Bracket", RequestSelection = SetScreen },
|
||||||
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
new Separator(),
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Schedule", Action = () => SetScreen(typeof(ScheduleScreen)) },
|
new ScreenButton(typeof(TeamIntroScreen)) { Text = "TeamIntro", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => SetScreen(typeof(LadderScreen)) },
|
new Separator(),
|
||||||
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
new ScreenButton(typeof(MapPoolScreen)) { Text = "MapPool", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => SetScreen(typeof(TeamIntroScreen)) },
|
new ScreenButton(typeof(GameplayScreen)) { Text = "Gameplay", RequestSelection = SetScreen },
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => SetScreen(typeof(MapPoolScreen)) },
|
new Separator(),
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => SetScreen(typeof(GameplayScreen)) },
|
new ScreenButton(typeof(TeamWinScreen)) { Text = "Win", RequestSelection = SetScreen },
|
||||||
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
new Separator(),
|
||||||
new TourneyButton { RelativeSizeAxes = Axes.X, Text = "Win", Action = () => SetScreen(typeof(TeamWinScreen)) },
|
new ScreenButton(typeof(DrawingsScreen)) { Text = "Drawings", RequestSelection = SetScreen },
|
||||||
|
new ScreenButton(typeof(ShowcaseScreen)) { Text = "Showcase", RequestSelection = SetScreen },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -162,6 +167,50 @@ namespace osu.Game.Tournament
|
|||||||
chatContainer.FadeOut(100);
|
chatContainer.FadeOut(100);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var s in buttons.OfType<ScreenButton>())
|
||||||
|
s.IsSelected = screenType == s.Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Separator : CompositeDrawable
|
||||||
|
{
|
||||||
|
public Separator()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Height = 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ScreenButton : TourneyButton
|
||||||
|
{
|
||||||
|
public readonly Type Type;
|
||||||
|
|
||||||
|
public ScreenButton(Type type)
|
||||||
|
{
|
||||||
|
Type = type;
|
||||||
|
BackgroundColour = OsuColour.Gray(0.2f);
|
||||||
|
Action = () => RequestSelection(type);
|
||||||
|
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isSelected;
|
||||||
|
|
||||||
|
public Action<Type> RequestSelection;
|
||||||
|
|
||||||
|
public bool IsSelected
|
||||||
|
{
|
||||||
|
get => isSelected;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == isSelected)
|
||||||
|
return;
|
||||||
|
|
||||||
|
isSelected = value;
|
||||||
|
BackgroundColour = isSelected ? Color4.SkyBlue : OsuColour.Gray(0.2f);
|
||||||
|
SpriteText.Colour = isSelected ? Color4.Black : Color4.White;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user