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

@ -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.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
@ -22,7 +22,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
{
private readonly bool noVideo;
public string TooltipText => button.Enabled ? "Download this beatmap" : "Login to download";
public string TooltipText => button.Enabled.Value ? "Download this beatmap" : "Login to download";
private readonly IBindable<User> localUser = new Bindable<User>();
@ -83,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
},
}
},
new DownloadProgressBar(BeatmapSet)
new DownloadProgressBar(BeatmapSet.Value)
{
Depth = -2,
Anchor = Anchor.BottomLeft,
@ -101,16 +101,16 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
return;
}
beatmaps.Download(BeatmapSet, noVideo);
beatmaps.Download(BeatmapSet.Value, noVideo);
};
localUser.BindTo(api.LocalUser);
localUser.BindValueChanged(userChanged, true);
button.Enabled.BindValueChanged(enabledChanged, true);
State.BindValueChanged(state =>
State.BindValueChanged(e =>
{
switch (state)
switch (e.NewValue)
{
case DownloadState.Downloading:
textSprites.Children = new Drawable[]
@ -155,8 +155,8 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
}, true);
}
private void userChanged(User user) => button.Enabled.Value = !(user is GuestUser);
private void userChanged(ValueChangedEvent<User> e) => button.Enabled.Value = !(e.NewValue is GuestUser);
private void enabledChanged(bool enabled) => this.FadeColour(enabled ? Color4.White : Color4.Gray, 200, Easing.OutQuint);
private void enabledChanged(ValueChangedEvent<bool> e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint);
}
}