mirror of
https://github.com/ppy/osu
synced 2025-03-05 02:49:30 +00:00
make ScreenTitle abstract and properties protected
This commit is contained in:
parent
f3ab5070b9
commit
f91e4a1fdd
@ -9,24 +9,24 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class ScreenTitle : CompositeDrawable, IHasAccentColour
|
||||
public abstract class ScreenTitle : CompositeDrawable, IHasAccentColour
|
||||
{
|
||||
private readonly SpriteIcon iconSprite;
|
||||
private readonly OsuSpriteText titleText, pageText;
|
||||
|
||||
public FontAwesome Icon
|
||||
protected FontAwesome Icon
|
||||
{
|
||||
get => iconSprite.Icon;
|
||||
set => iconSprite.Icon = value;
|
||||
}
|
||||
|
||||
public string Title
|
||||
protected string Title
|
||||
{
|
||||
get => titleText.Text;
|
||||
set => titleText.Text = value;
|
||||
}
|
||||
|
||||
public string Section
|
||||
protected string Section
|
||||
{
|
||||
get => pageText.Text;
|
||||
set => pageText.Text = value;
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
set => pageText.Colour = value;
|
||||
}
|
||||
|
||||
public ScreenTitle()
|
||||
protected ScreenTitle()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
public Header(ScreenStack stack)
|
||||
{
|
||||
ScreenTitle title;
|
||||
MultiHeaderTitle title;
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = HEIGHT;
|
||||
|
||||
@ -42,8 +42,6 @@ namespace osu.Game.Screens.Multi
|
||||
{
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Icon = FontAwesome.fa_osu_multi,
|
||||
Title = "multiplayer",
|
||||
},
|
||||
breadcrumbs = new HeaderBreadcrumbControl(stack)
|
||||
{
|
||||
@ -58,7 +56,7 @@ namespace osu.Game.Screens.Multi
|
||||
breadcrumbs.Current.ValueChanged += screen =>
|
||||
{
|
||||
if (screen.NewValue is IMultiplayerSubScreen multiScreen)
|
||||
title.Section = multiScreen.ShortTitle.ToLowerInvariant();
|
||||
title.Screen = multiScreen;
|
||||
};
|
||||
|
||||
breadcrumbs.Current.TriggerChange();
|
||||
@ -72,9 +70,16 @@ namespace osu.Game.Screens.Multi
|
||||
|
||||
private class MultiHeaderTitle : ScreenTitle
|
||||
{
|
||||
public IMultiplayerSubScreen Screen
|
||||
{
|
||||
set => Section = value.ShortTitle.ToLowerInvariant();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Title = "multiplayer";
|
||||
Icon = FontAwesome.fa_osu_multi;
|
||||
AccentColour = colours.Yellow;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user