mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 14:02:55 +08:00
Move Header breadcrumbs to a subclass.
This commit is contained in:
parent
d20011ba58
commit
ebfbe58abb
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Multi
|
||||
public const float HEIGHT = 121;
|
||||
|
||||
private readonly OsuSpriteText screenTitle;
|
||||
private readonly ScreenBreadcrumbControl breadcrumbs;
|
||||
private readonly HeaderBreadcrumbControl breadcrumbs;
|
||||
|
||||
public Header(Screen initialScreen)
|
||||
{
|
||||
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Multi
|
||||
},
|
||||
},
|
||||
},
|
||||
breadcrumbs = new ScreenBreadcrumbControl(initialScreen)
|
||||
breadcrumbs = new HeaderBreadcrumbControl(initialScreen)
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
@ -85,8 +85,6 @@ namespace osu.Game.Screens.Multi
|
||||
},
|
||||
};
|
||||
|
||||
breadcrumbs.OnLoadComplete = d => breadcrumbs.AccentColour = Color4.White;
|
||||
|
||||
breadcrumbs.Current.ValueChanged += s => screenTitle.Text = s.ToString();
|
||||
breadcrumbs.Current.TriggerChange();
|
||||
}
|
||||
@ -97,5 +95,18 @@ namespace osu.Game.Screens.Multi
|
||||
screenTitle.Colour = colours.Yellow;
|
||||
breadcrumbs.StripColour = colours.Green;
|
||||
}
|
||||
|
||||
private class HeaderBreadcrumbControl : ScreenBreadcrumbControl
|
||||
{
|
||||
public HeaderBreadcrumbControl(Screen initialScreen) : base(initialScreen)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
AccentColour = Color4.White;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user