1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 16:52:55 +08:00

Add interface for the multiplayer screen short title

This commit is contained in:
smoogipoo 2018-12-04 17:43:44 +09:00
parent b251129c59
commit a7ac544e12
5 changed files with 20 additions and 8 deletions

View File

@ -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(); breadcrumbs.Current.TriggerChange();
} }

View 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; }
}
}

View File

@ -28,9 +28,10 @@ namespace osu.Game.Screens.Multi.Screens.Match
protected override Container<Drawable> TransitionContent => participants; protected override Container<Drawable> TransitionContent => participants;
public override string Type => "room";
public override string Title => room.Name.Value; public override string Title => room.Name.Value;
public override string ShortTitle => "room";
public Match(Room room) public Match(Room room)
{ {
this.room = room; this.room = room;

View File

@ -8,14 +8,11 @@ using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Multi.Screens namespace osu.Game.Screens.Multi.Screens
{ {
public abstract class MultiplayerScreen : OsuScreen public abstract class MultiplayerScreen : OsuScreen, IMultiplayerScreen
{ {
protected virtual Container<Drawable> TransitionContent => Content; protected virtual Container<Drawable> TransitionContent => Content;
/// <summary> public virtual string ShortTitle => Title;
/// The type to display in the title of the <see cref="Header"/>.
/// </summary>
public virtual string Type => Title;
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)
{ {

View File

@ -1,10 +1,14 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Screens.Multi.Screens;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
public class MatchSongSelect : SongSelect public class MatchSongSelect : SongSelect, IMultiplayerScreen
{ {
public string ShortTitle => "song selection";
protected override bool OnStart() protected override bool OnStart()
{ {
if (IsCurrentScreen) Exit(); if (IsCurrentScreen) Exit();