mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Add interface for the multiplayer screen short title
This commit is contained in:
parent
b251129c59
commit
a7ac544e12
@ -86,7 +86,7 @@ namespace osu.Game.Screens.Multi
|
||||
},
|
||||
};
|
||||
|
||||
breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLowerInvariant();
|
||||
breadcrumbs.Current.ValueChanged += s => screenType.Text = ((IMultiplayerScreen)s).ShortTitle.ToLowerInvariant();
|
||||
breadcrumbs.Current.TriggerChange();
|
||||
}
|
||||
|
||||
|
10
osu.Game/Screens/Multi/Screens/IMultiplayerScreen.cs
Normal file
10
osu.Game/Screens/Multi/Screens/IMultiplayerScreen.cs
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Screens.Multi.Screens
|
||||
{
|
||||
public interface IMultiplayerScreen
|
||||
{
|
||||
string ShortTitle { get; }
|
||||
}
|
||||
}
|
@ -28,9 +28,10 @@ namespace osu.Game.Screens.Multi.Screens.Match
|
||||
|
||||
protected override Container<Drawable> TransitionContent => participants;
|
||||
|
||||
public override string Type => "room";
|
||||
public override string Title => room.Name.Value;
|
||||
|
||||
public override string ShortTitle => "room";
|
||||
|
||||
public Match(Room room)
|
||||
{
|
||||
this.room = room;
|
||||
|
@ -8,14 +8,11 @@ using osu.Game.Graphics.Containers;
|
||||
|
||||
namespace osu.Game.Screens.Multi.Screens
|
||||
{
|
||||
public abstract class MultiplayerScreen : OsuScreen
|
||||
public abstract class MultiplayerScreen : OsuScreen, IMultiplayerScreen
|
||||
{
|
||||
protected virtual Container<Drawable> TransitionContent => Content;
|
||||
|
||||
/// <summary>
|
||||
/// The type to display in the title of the <see cref="Header"/>.
|
||||
/// </summary>
|
||||
public virtual string Type => Title;
|
||||
public virtual string ShortTitle => Title;
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
{
|
||||
|
@ -1,10 +1,14 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Screens.Multi.Screens;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
public class MatchSongSelect : SongSelect
|
||||
public class MatchSongSelect : SongSelect, IMultiplayerScreen
|
||||
{
|
||||
public string ShortTitle => "song selection";
|
||||
|
||||
protected override bool OnStart()
|
||||
{
|
||||
if (IsCurrentScreen) Exit();
|
||||
|
Loading…
Reference in New Issue
Block a user