2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-06-06 11:29:52 +08:00
|
|
|
|
|
2018-12-17 13:44:54 +08:00
|
|
|
|
using System;
|
|
|
|
|
using Humanizer;
|
2018-06-06 11:53:24 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2018-12-20 14:17:33 +08:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
2018-06-06 11:29:52 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics;
|
2018-06-06 11:53:24 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2018-06-06 13:38:09 +08:00
|
|
|
|
using osu.Game.Online.Multiplayer;
|
2018-06-06 16:20:03 +08:00
|
|
|
|
using osu.Game.Overlays.SearchableList;
|
2018-11-26 15:29:56 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-06-06 11:29:52 +08:00
|
|
|
|
|
2018-12-10 18:20:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Multi.Match.Components
|
2018-06-06 11:29:52 +08:00
|
|
|
|
{
|
2018-12-26 15:11:40 +08:00
|
|
|
|
public class MatchSettingsOverlay : FocusedOverlayContainer
|
2018-06-06 11:29:52 +08:00
|
|
|
|
{
|
2018-08-25 06:11:52 +08:00
|
|
|
|
private const float transition_duration = 350;
|
2018-06-06 16:20:03 +08:00
|
|
|
|
private const float field_padding = 45;
|
2018-12-22 14:00:35 +08:00
|
|
|
|
private const float disabled_alpha = 0.2f;
|
2018-06-06 11:29:52 +08:00
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
private readonly RoomBindings bindings = new RoomBindings();
|
2018-06-06 13:38:09 +08:00
|
|
|
|
|
2018-06-06 16:38:43 +08:00
|
|
|
|
private readonly Container content;
|
2018-12-06 17:16:17 +08:00
|
|
|
|
|
2018-06-07 11:39:16 +08:00
|
|
|
|
private readonly OsuSpriteText typeLabel;
|
2018-06-06 13:38:09 +08:00
|
|
|
|
|
2018-08-14 22:31:20 +08:00
|
|
|
|
protected readonly OsuTextBox NameField, MaxParticipantsField;
|
2018-12-17 13:44:54 +08:00
|
|
|
|
protected readonly OsuDropdown<TimeSpan> DurationField;
|
2018-08-14 22:31:20 +08:00
|
|
|
|
protected readonly RoomAvailabilityPicker AvailabilityPicker;
|
|
|
|
|
protected readonly GameTypePicker TypePicker;
|
|
|
|
|
protected readonly TriangleButton ApplyButton;
|
2018-12-10 15:50:00 +08:00
|
|
|
|
protected readonly OsuPasswordTextBox PasswordField;
|
2018-06-07 10:30:17 +08:00
|
|
|
|
|
2018-12-26 17:38:58 +08:00
|
|
|
|
protected readonly OsuSpriteText ErrorText;
|
|
|
|
|
|
2018-12-26 19:45:56 +08:00
|
|
|
|
private readonly ProcessingOverlay processingOverlay;
|
|
|
|
|
|
2018-12-17 13:44:54 +08:00
|
|
|
|
private readonly Room room;
|
2018-12-11 18:07:40 +08:00
|
|
|
|
|
2018-12-17 13:44:54 +08:00
|
|
|
|
[Resolved(CanBeNull = true)]
|
2018-12-25 10:45:50 +08:00
|
|
|
|
private IRoomManager manager { get; set; }
|
2018-12-10 17:25:32 +08:00
|
|
|
|
|
2018-12-26 15:11:40 +08:00
|
|
|
|
public MatchSettingsOverlay(Room room)
|
2018-06-06 11:29:52 +08:00
|
|
|
|
{
|
2018-12-17 13:44:54 +08:00
|
|
|
|
this.room = room;
|
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.Room = room;
|
|
|
|
|
|
2018-06-06 15:27:53 +08:00
|
|
|
|
Masking = true;
|
|
|
|
|
|
|
|
|
|
Child = content = new Container
|
2018-06-06 11:29:52 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
RelativePositionAxes = Axes.Y,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = OsuColour.FromHex(@"28242d"),
|
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new GridContainer
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2018-12-26 14:23:57 +08:00
|
|
|
|
RowDimensions = new[]
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Dimension(GridSizeMode.Distributed),
|
|
|
|
|
new Dimension(GridSizeMode.AutoSize),
|
|
|
|
|
},
|
|
|
|
|
Content = new[]
|
|
|
|
|
{
|
|
|
|
|
new Drawable[]
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new ScrollContainer
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
2019-01-24 19:42:35 +08:00
|
|
|
|
Padding = new MarginPadding
|
|
|
|
|
{
|
2019-01-25 13:10:59 +08:00
|
|
|
|
Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING,
|
2019-01-24 19:42:35 +08:00
|
|
|
|
Vertical = 10
|
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Children = new[]
|
2018-06-06 13:25:08 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Container
|
2018-06-07 11:39:16 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING },
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new Drawable[]
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new SectionContainer
|
2018-06-07 11:39:16 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Padding = new MarginPadding { Right = field_padding / 2 },
|
|
|
|
|
Children = new[]
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Section("Room name")
|
|
|
|
|
{
|
|
|
|
|
Child = NameField = new SettingsTextBox
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
|
OnCommit = (sender, text) => apply(),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new Section("Room visibility")
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Alpha = disabled_alpha,
|
|
|
|
|
Child = AvailabilityPicker = new RoomAvailabilityPicker(),
|
2018-12-26 14:03:35 +08:00
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Section("Game type")
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Alpha = disabled_alpha,
|
|
|
|
|
Child = new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(7),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
TypePicker = new GameTypePicker
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
},
|
|
|
|
|
typeLabel = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
TextSize = 14,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2018-12-26 14:03:35 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2018-06-07 11:39:16 +08:00
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new SectionContainer
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
Padding = new MarginPadding { Left = field_padding / 2 },
|
|
|
|
|
Children = new[]
|
2018-12-26 14:03:35 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Section("Max participants")
|
|
|
|
|
{
|
|
|
|
|
Alpha = disabled_alpha,
|
|
|
|
|
Child = MaxParticipantsField = new SettingsNumberTextBox
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
|
OnCommit = (sender, text) => apply(),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new Section("Duration")
|
|
|
|
|
{
|
|
|
|
|
Child = DurationField = new DurationDropdown
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Items = new[]
|
|
|
|
|
{
|
|
|
|
|
TimeSpan.FromMinutes(30),
|
|
|
|
|
TimeSpan.FromHours(1),
|
|
|
|
|
TimeSpan.FromHours(2),
|
|
|
|
|
TimeSpan.FromHours(4),
|
|
|
|
|
TimeSpan.FromHours(8),
|
|
|
|
|
TimeSpan.FromHours(12),
|
2018-12-27 20:59:08 +08:00
|
|
|
|
//TimeSpan.FromHours(16),
|
2018-12-26 14:23:57 +08:00
|
|
|
|
TimeSpan.FromHours(24),
|
2019-01-02 15:33:52 +08:00
|
|
|
|
TimeSpan.FromDays(3),
|
|
|
|
|
TimeSpan.FromDays(7)
|
2018-12-26 14:23:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new Section("Password (optional)")
|
|
|
|
|
{
|
|
|
|
|
Alpha = disabled_alpha,
|
|
|
|
|
Child = PasswordField = new SettingsPasswordTextBox
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
TabbableContentContainer = this,
|
|
|
|
|
OnCommit = (sender, text) => apply()
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2018-12-26 14:03:35 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
}
|
2018-06-06 12:29:36 +08:00
|
|
|
|
},
|
2018-06-06 11:53:24 +08:00
|
|
|
|
},
|
2018-12-20 14:17:33 +08:00
|
|
|
|
},
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Drawable[]
|
2018-12-20 14:17:33 +08:00
|
|
|
|
{
|
2018-12-26 14:23:57 +08:00
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
Y = 2,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = OsuColour.FromHex(@"28242d").Darken(0.5f).Opacity(1f),
|
|
|
|
|
},
|
2018-12-26 17:38:58 +08:00
|
|
|
|
new FillFlowContainer
|
2018-12-26 14:23:57 +08:00
|
|
|
|
{
|
2018-12-26 17:38:58 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 20),
|
2018-12-26 14:23:57 +08:00
|
|
|
|
Margin = new MarginPadding { Vertical = 20 },
|
2019-01-25 13:10:59 +08:00
|
|
|
|
Padding = new MarginPadding { Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING },
|
2018-12-26 17:38:58 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
ApplyButton = new CreateRoomButton
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
|
Size = new Vector2(230, 55),
|
|
|
|
|
Action = apply,
|
|
|
|
|
},
|
|
|
|
|
ErrorText = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
Depth = 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-26 14:23:57 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-20 14:17:33 +08:00
|
|
|
|
}
|
2018-12-26 19:45:56 +08:00
|
|
|
|
},
|
|
|
|
|
processingOverlay = new ProcessingOverlay { Alpha = 0 }
|
2018-06-06 11:29:52 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
2018-06-06 16:38:43 +08:00
|
|
|
|
|
2018-08-14 22:31:20 +08:00
|
|
|
|
TypePicker.Current.ValueChanged += t => typeLabel.Text = t.Name;
|
2018-06-07 11:39:16 +08:00
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.Name.BindValueChanged(n => NameField.Text = n, true);
|
|
|
|
|
bindings.Availability.BindValueChanged(a => AvailabilityPicker.Current.Value = a, true);
|
|
|
|
|
bindings.Type.BindValueChanged(t => TypePicker.Current.Value = t, true);
|
|
|
|
|
bindings.MaxParticipants.BindValueChanged(m => MaxParticipantsField.Text = m?.ToString(), true);
|
|
|
|
|
bindings.Duration.BindValueChanged(d => DurationField.Current.Value = d, true);
|
2018-06-06 11:29:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-07 11:39:16 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
typeLabel.Colour = colours.Yellow;
|
2018-12-26 17:38:58 +08:00
|
|
|
|
ErrorText.Colour = colours.RedDark;
|
2018-12-10 15:50:00 +08:00
|
|
|
|
|
2018-12-10 17:25:32 +08:00
|
|
|
|
MaxParticipantsField.ReadOnly = true;
|
|
|
|
|
PasswordField.ReadOnly = true;
|
2018-12-22 14:00:35 +08:00
|
|
|
|
AvailabilityPicker.Enabled.Value = false;
|
|
|
|
|
TypePicker.Enabled.Value = false;
|
2018-12-10 17:25:32 +08:00
|
|
|
|
ApplyButton.Enabled.Value = false;
|
2018-12-10 15:50:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-10 17:25:32 +08:00
|
|
|
|
protected override void Update()
|
2018-12-04 14:25:41 +08:00
|
|
|
|
{
|
2018-12-10 17:25:32 +08:00
|
|
|
|
base.Update();
|
2018-12-04 14:25:41 +08:00
|
|
|
|
|
2018-12-10 17:25:32 +08:00
|
|
|
|
ApplyButton.Enabled.Value = hasValidSettings;
|
2018-12-04 14:25:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-26 19:45:56 +08:00
|
|
|
|
private bool hasValidSettings => bindings.Room.RoomID.Value == null && NameField.Text.Length > 0 && bindings.Playlist.Count > 0;
|
2018-12-10 17:25:32 +08:00
|
|
|
|
|
2018-06-06 11:29:52 +08:00
|
|
|
|
protected override void PopIn()
|
|
|
|
|
{
|
2018-06-06 15:27:53 +08:00
|
|
|
|
content.MoveToY(0, transition_duration, Easing.OutQuint);
|
2018-06-06 11:29:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void PopOut()
|
|
|
|
|
{
|
2018-06-06 15:27:53 +08:00
|
|
|
|
content.MoveToY(-1, transition_duration, Easing.InSine);
|
2018-06-06 11:29:52 +08:00
|
|
|
|
}
|
2018-06-06 11:53:24 +08:00
|
|
|
|
|
2018-06-07 11:25:16 +08:00
|
|
|
|
private void apply()
|
|
|
|
|
{
|
2018-12-26 17:38:58 +08:00
|
|
|
|
hideError();
|
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.Name.Value = NameField.Text;
|
|
|
|
|
bindings.Availability.Value = AvailabilityPicker.Current.Value;
|
|
|
|
|
bindings.Type.Value = TypePicker.Current.Value;
|
2018-08-25 06:27:16 +08:00
|
|
|
|
|
|
|
|
|
if (int.TryParse(MaxParticipantsField.Text, out int max))
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.MaxParticipants.Value = max;
|
2018-08-25 06:27:16 +08:00
|
|
|
|
else
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.MaxParticipants.Value = null;
|
2018-06-07 11:25:16 +08:00
|
|
|
|
|
2018-12-22 13:01:06 +08:00
|
|
|
|
bindings.Duration.Value = DurationField.Current.Value;
|
2018-12-19 09:51:54 +08:00
|
|
|
|
|
2018-12-26 19:45:56 +08:00
|
|
|
|
manager?.CreateRoom(room, onSuccess, onError);
|
|
|
|
|
|
|
|
|
|
processingOverlay.Show();
|
2018-12-26 17:38:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void hideError() => ErrorText.FadeOut(50);
|
|
|
|
|
|
2018-12-26 20:10:31 +08:00
|
|
|
|
private void onSuccess(Room room) => processingOverlay.Hide();
|
2018-12-26 19:45:56 +08:00
|
|
|
|
|
|
|
|
|
private void onError(string text)
|
2018-12-26 17:38:58 +08:00
|
|
|
|
{
|
|
|
|
|
ErrorText.Text = text;
|
|
|
|
|
ErrorText.FadeIn(50);
|
2018-12-26 19:45:56 +08:00
|
|
|
|
|
|
|
|
|
processingOverlay.Hide();
|
2018-06-07 11:25:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-06 12:29:36 +08:00
|
|
|
|
private class SettingsTextBox : OsuTextBox
|
|
|
|
|
{
|
|
|
|
|
protected override Color4 BackgroundUnfocused => Color4.Black;
|
|
|
|
|
protected override Color4 BackgroundFocused => Color4.Black;
|
2018-08-14 23:08:00 +08:00
|
|
|
|
}
|
2018-06-06 12:29:36 +08:00
|
|
|
|
|
2018-08-25 06:19:16 +08:00
|
|
|
|
private class SettingsNumberTextBox : SettingsTextBox
|
|
|
|
|
{
|
|
|
|
|
protected override bool CanAddCharacter(char character) => char.IsNumber(character);
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-14 23:08:00 +08:00
|
|
|
|
private class SettingsPasswordTextBox : OsuPasswordTextBox
|
|
|
|
|
{
|
|
|
|
|
protected override Color4 BackgroundUnfocused => Color4.Black;
|
|
|
|
|
protected override Color4 BackgroundFocused => Color4.Black;
|
2018-06-06 12:29:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-06-06 11:53:24 +08:00
|
|
|
|
private class SectionContainer : FillFlowContainer<Section>
|
|
|
|
|
{
|
|
|
|
|
public SectionContainer()
|
|
|
|
|
{
|
2018-12-26 14:03:35 +08:00
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
2018-06-06 16:20:03 +08:00
|
|
|
|
Width = 0.5f;
|
2018-06-06 11:53:24 +08:00
|
|
|
|
Direction = FillDirection.Vertical;
|
2018-06-06 16:20:03 +08:00
|
|
|
|
Spacing = new Vector2(field_padding);
|
2018-06-06 11:53:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class Section : Container
|
|
|
|
|
{
|
|
|
|
|
private readonly Container content;
|
|
|
|
|
|
|
|
|
|
protected override Container<Drawable> Content => content;
|
|
|
|
|
|
|
|
|
|
public Section(string title)
|
|
|
|
|
{
|
2018-06-06 12:29:36 +08:00
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2018-06-06 11:53:24 +08:00
|
|
|
|
|
|
|
|
|
InternalChild = new FillFlowContainer
|
|
|
|
|
{
|
2018-06-06 12:29:36 +08:00
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2018-06-06 11:53:24 +08:00
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(5),
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
TextSize = 12,
|
|
|
|
|
Font = @"Exo2.0-Bold",
|
|
|
|
|
Text = title.ToUpper(),
|
|
|
|
|
},
|
|
|
|
|
content = new Container
|
|
|
|
|
{
|
2018-06-06 12:29:36 +08:00
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2018-06-06 11:53:24 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-17 12:55:39 +08:00
|
|
|
|
private class CreateRoomButton : TriangleButton
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
2018-12-17 12:55:39 +08:00
|
|
|
|
public CreateRoomButton()
|
2018-06-06 11:53:24 +08:00
|
|
|
|
{
|
2018-12-17 12:55:39 +08:00
|
|
|
|
Text = "Create";
|
2018-06-06 11:53:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
BackgroundColour = colours.Yellow;
|
2018-06-06 15:32:04 +08:00
|
|
|
|
Triangles.ColourLight = colours.YellowLight;
|
|
|
|
|
Triangles.ColourDark = colours.YellowDark;
|
2018-06-06 11:53:24 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-12-17 13:44:54 +08:00
|
|
|
|
|
|
|
|
|
private class DurationDropdown : OsuDropdown<TimeSpan>
|
|
|
|
|
{
|
|
|
|
|
public DurationDropdown()
|
|
|
|
|
{
|
|
|
|
|
Menu.MaxHeight = 100;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string GenerateItemText(TimeSpan item)
|
|
|
|
|
{
|
|
|
|
|
return item.Humanize();
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-06 11:29:52 +08:00
|
|
|
|
}
|
|
|
|
|
}
|