mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +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;
|
public const float HEIGHT = 121;
|
||||||
|
|
||||||
private readonly OsuSpriteText screenTitle;
|
private readonly OsuSpriteText screenTitle;
|
||||||
private readonly ScreenBreadcrumbControl breadcrumbs;
|
private readonly HeaderBreadcrumbControl breadcrumbs;
|
||||||
|
|
||||||
public Header(Screen initialScreen)
|
public Header(Screen initialScreen)
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
breadcrumbs = new ScreenBreadcrumbControl(initialScreen)
|
breadcrumbs = new HeaderBreadcrumbControl(initialScreen)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = 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.ValueChanged += s => screenTitle.Text = s.ToString();
|
||||||
breadcrumbs.Current.TriggerChange();
|
breadcrumbs.Current.TriggerChange();
|
||||||
}
|
}
|
||||||
@ -97,5 +95,18 @@ namespace osu.Game.Screens.Multi
|
|||||||
screenTitle.Colour = colours.Yellow;
|
screenTitle.Colour = colours.Yellow;
|
||||||
breadcrumbs.StripColour = colours.Green;
|
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