Merge branch 'master' into osu-fontusage

This commit is contained in:
Dean Herbert
2019-02-22 18:09:23 +09:00
committed by GitHub
286 changed files with 837 additions and 876 deletions

View File

@ -3,7 +3,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
@ -108,7 +108,7 @@ namespace osu.Game.Screens.Multi.Match.Components
},
};
CurrentItem.BindValueChanged(i => modDisplay.Current.Value = i?.RequiredMods, true);
CurrentItem.BindValueChanged(e => modDisplay.Current.Value = e.NewValue?.RequiredMods, true);
beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
}
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader]
private void load()
{
roomId.BindValueChanged(v => this.FadeTo(v.HasValue ? 0 : 1), true);
roomId.BindValueChanged(e => this.FadeTo(e.NewValue.HasValue ? 0 : 1), true);
}
}

View File

@ -1,7 +1,7 @@
// 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 osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
@ -43,7 +43,7 @@ namespace osu.Game.Screens.Multi.Match.Components
}
};
Host.BindValueChanged(updateHost);
Host.BindValueChanged(e => updateHost(e.NewValue));
}
private void updateHost(User host)

View File

@ -92,10 +92,10 @@ namespace osu.Game.Screens.Multi.Match.Components
},
};
CurrentItem.BindValueChanged(item =>
CurrentItem.BindValueChanged(e =>
{
viewBeatmapButton.Beatmap.Value = item?.Beatmap;
readyButton.Beatmap.Value = item?.Beatmap;
viewBeatmapButton.Beatmap.Value = e.NewValue?.Beatmap;
readyButton.Beatmap.Value = e.NewValue?.Beatmap;
}, true);
hostInfo.Host.BindTo(Host);

View File

@ -2,7 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Game.Online.Chat;
using osu.Game.Online.Multiplayer;
@ -28,13 +28,13 @@ namespace osu.Game.Screens.Multi.Match.Components
{
base.LoadComplete();
roomId.BindValueChanged(v => updateChannel(), true);
roomId.BindValueChanged(_ => updateChannel(), true);
}
private void updateChannel()
{
if (roomId.Value != null)
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
}
}
}

View File

@ -4,7 +4,7 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
@ -23,9 +23,9 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader]
private void load()
{
roomId.BindValueChanged(id =>
roomId.BindValueChanged(e =>
{
if (id == null)
if (e.NewValue == null)
return;
Scores = null;

View File

@ -1,7 +1,7 @@
// 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 osu.Framework.Configuration;
using osu.Framework.Bindables;
namespace osu.Game.Screens.Multi.Match.Components
{

View File

@ -4,7 +4,7 @@
using System;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -264,12 +264,12 @@ namespace osu.Game.Screens.Multi.Match.Components
processingOverlay = new ProcessingOverlay { Alpha = 0 }
};
TypePicker.Current.BindValueChanged(t => typeLabel.Text = t?.Name ?? string.Empty, true);
Name.BindValueChanged(n => NameField.Text = n, true);
Availability.BindValueChanged(a => AvailabilityPicker.Current.Value = a, true);
Type.BindValueChanged(t => TypePicker.Current.Value = t, true);
MaxParticipants.BindValueChanged(m => MaxParticipantsField.Text = m?.ToString(), true);
Duration.BindValueChanged(d => DurationField.Current.Value = d, true);
TypePicker.Current.BindValueChanged(e => typeLabel.Text = e.NewValue?.Name ?? string.Empty, true);
Name.BindValueChanged(e => NameField.Text = e.NewValue, true);
Availability.BindValueChanged(e => AvailabilityPicker.Current.Value = e.NewValue, true);
Type.BindValueChanged(e => TypePicker.Current.Value = e.NewValue, true);
MaxParticipants.BindValueChanged(e => MaxParticipantsField.Text = e.NewValue?.ToString(), true);
Duration.BindValueChanged(e => DurationField.Current.Value = e.NewValue, true);
}
protected override void Update()
@ -296,7 +296,7 @@ namespace osu.Game.Screens.Multi.Match.Components
Duration.Value = DurationField.Current.Value;
manager?.CreateRoom(currentRoom, onSuccess, onError);
manager?.CreateRoom(currentRoom.Value, onSuccess, onError);
processingOverlay.Show();
}

View File

@ -2,7 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
@ -26,9 +26,9 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader]
private void load()
{
roomId.BindValueChanged(v =>
roomId.BindValueChanged(e =>
{
if (v.HasValue)
if (e.NewValue.HasValue)
{
Items.ForEach(t => t.Enabled.Value = !(t is SettingsMatchPage));
Current.Value = new RoomMatchPage();
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Multi.Match.Components
: base(value)
{
enabled.BindTo(value.Enabled);
enabled.BindValueChanged(v => Colour = v ? Color4.White : Color4.Gray);
enabled.BindValueChanged(e => Colour = e.NewValue ? Color4.White : Color4.Gray);
}
protected override bool OnClick(ClickEvent e)

View File

@ -50,9 +50,9 @@ namespace osu.Game.Screens.Multi.Match.Components
},
};
Participants.BindValueChanged(v =>
Participants.BindValueChanged(e =>
{
usersFlow.Children = v.Select(u => new UserPanel(u)
usersFlow.Children = e.NewValue.Select(u => new UserPanel(u)
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,

View File

@ -4,7 +4,7 @@
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{
beatmaps.ItemAdded += beatmapAdded;
Beatmap.BindValueChanged(updateBeatmap, true);
Beatmap.BindValueChanged(e => updateBeatmap(e.NewValue), true);
}
private void updateBeatmap(BeatmapInfo beatmap)
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Multi.Match.Components
return;
}
bool hasEnoughTime = DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate;
bool hasEnoughTime = DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate.Value;
Enabled.Value = hasBeatmap && hasEnoughTime;
}

View File

@ -2,7 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osuTK;
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Match.Components
private void load()
{
if (osuGame != null)
Beatmap.BindValueChanged(updateAction, true);
Beatmap.BindValueChanged(e => updateAction(e.NewValue), true);
}
private void updateAction(BeatmapInfo beatmap)