mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
Remove match header
This commit is contained in:
parent
47d4a2e97f
commit
c66abf85f7
@ -1,106 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osuTK;
|
||||
using FontWeight = osu.Game.Graphics.FontWeight;
|
||||
using OsuColour = osu.Game.Graphics.OsuColour;
|
||||
using OsuFont = osu.Game.Graphics.OsuFont;
|
||||
|
||||
namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
|
||||
{
|
||||
public class MultiplayerMatchHeader : OnlinePlayComposite
|
||||
{
|
||||
public const float HEIGHT = 50;
|
||||
|
||||
public Action OpenSettings;
|
||||
|
||||
private UpdateableAvatar avatar;
|
||||
private LinkFlowContainer hostText;
|
||||
private Button openSettingsButton;
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
||||
public MultiplayerMatchHeader()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = HEIGHT;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(10, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
avatar = new UpdateableAvatar
|
||||
{
|
||||
Size = new Vector2(50),
|
||||
Masking = true,
|
||||
CornerRadius = 10,
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 30),
|
||||
Current = { BindTarget = RoomName }
|
||||
},
|
||||
hostText = new LinkFlowContainer(s => s.Font = OsuFont.GetFont(size: 20))
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
openSettingsButton = new PurpleTriangleButton
|
||||
{
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Size = new Vector2(150, HEIGHT),
|
||||
Text = "Open settings",
|
||||
Action = () => OpenSettings?.Invoke(),
|
||||
Alpha = 0
|
||||
}
|
||||
};
|
||||
|
||||
Host.BindValueChanged(host =>
|
||||
{
|
||||
avatar.User = host.NewValue;
|
||||
|
||||
hostText.Clear();
|
||||
|
||||
if (host.NewValue != null)
|
||||
{
|
||||
hostText.AddText("hosted by ");
|
||||
hostText.AddUserLink(host.NewValue, s => s.Font = s.Font.With(weight: FontWeight.SemiBold));
|
||||
}
|
||||
|
||||
openSettingsButton.Alpha = host.NewValue?.Equals(api.LocalUser.Value) == true ? 1 : 0;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
}
|
@ -59,8 +59,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
[CanBeNull]
|
||||
private IDisposable readyClickOperation;
|
||||
|
||||
// private GridContainer mainContent;
|
||||
|
||||
public MultiplayerMatchSubScreen(Room room)
|
||||
: base(room)
|
||||
{
|
||||
@ -130,20 +128,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
Child = new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RowDimensions = new[]
|
||||
{
|
||||
new Dimension(GridSizeMode.AutoSize),
|
||||
new Dimension(),
|
||||
},
|
||||
Content = new[]
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
new MultiplayerMatchHeader
|
||||
{
|
||||
OpenSettings = () => SettingsOverlay.Show()
|
||||
}
|
||||
},
|
||||
new Drawable[]
|
||||
{
|
||||
new Container
|
||||
|
Loading…
Reference in New Issue
Block a user