mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Merge branch 'master' into fix-ef-issues
This commit is contained in:
@ -18,6 +18,7 @@ using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Beatmaps.IO;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.IPC;
|
||||
using osu.Game.Online.API;
|
||||
@ -52,6 +53,11 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
public event Action<BeatmapInfo> BeatmapRestored;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a beatmap download begins.
|
||||
/// </summary>
|
||||
public event Action<DownloadBeatmapSetRequest> BeatmapDownloadBegan;
|
||||
|
||||
/// <summary>
|
||||
/// A default representation of a WorkingBeatmap to use when no beatmap is available.
|
||||
/// </summary>
|
||||
@ -221,21 +227,29 @@ namespace osu.Game.Beatmaps
|
||||
/// Downloads a beatmap.
|
||||
/// </summary>
|
||||
/// <param name="beatmapSetInfo">The <see cref="BeatmapSetInfo"/> to be downloaded.</param>
|
||||
/// <returns>A new <see cref="DownloadBeatmapSetRequest"/>, or an existing one if a download is already in progress.</returns>
|
||||
public DownloadBeatmapSetRequest Download(BeatmapSetInfo beatmapSetInfo)
|
||||
/// <param name="noVideo">Whether the beatmap should be downloaded without video. Defaults to false.</param>
|
||||
public void Download(BeatmapSetInfo beatmapSetInfo, bool noVideo = false)
|
||||
{
|
||||
var existing = GetExistingDownload(beatmapSetInfo);
|
||||
|
||||
if (existing != null) return existing;
|
||||
if (existing != null || api == null) return;
|
||||
|
||||
if (api == null) return null;
|
||||
if (!api.LocalUser.Value.IsSupporter)
|
||||
{
|
||||
PostNotification?.Invoke(new SimpleNotification
|
||||
{
|
||||
Icon = FontAwesome.fa_superpowers,
|
||||
Text = "You gotta be a supporter to download for now 'yo"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
ProgressNotification downloadNotification = new ProgressNotification
|
||||
{
|
||||
Text = $"Downloading {beatmapSetInfo.Metadata.Artist} - {beatmapSetInfo.Metadata.Title}",
|
||||
};
|
||||
|
||||
var request = new DownloadBeatmapSetRequest(beatmapSetInfo);
|
||||
var request = new DownloadBeatmapSetRequest(beatmapSetInfo, noVideo);
|
||||
|
||||
request.DownloadProgressed += progress =>
|
||||
{
|
||||
@ -280,8 +294,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
// don't run in the main api queue as this is a long-running task.
|
||||
Task.Factory.StartNew(() => request.Perform(api), TaskCreationOptions.LongRunning);
|
||||
|
||||
return request;
|
||||
BeatmapDownloadBegan?.Invoke(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -64,11 +64,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}
|
||||
)
|
||||
{
|
||||
TimeBeforeLoad = 300,
|
||||
},
|
||||
}, 300),
|
||||
new FillFlowContainer
|
||||
{
|
||||
Direction = FillDirection.Vertical,
|
||||
|
@ -12,13 +12,16 @@ namespace osu.Game.Online.API.Requests
|
||||
|
||||
public Action<float> DownloadProgressed;
|
||||
|
||||
public DownloadBeatmapSetRequest(BeatmapSetInfo set)
|
||||
private readonly bool noVideo;
|
||||
|
||||
public DownloadBeatmapSetRequest(BeatmapSetInfo set, bool noVideo)
|
||||
{
|
||||
this.noVideo = noVideo;
|
||||
BeatmapSet = set;
|
||||
|
||||
Progress += (current, total) => DownloadProgressed?.Invoke((float) current / total);
|
||||
}
|
||||
|
||||
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download";
|
||||
protected override string Target => $@"beatmapsets/{BeatmapSet.OnlineBeatmapSetID}/download{(noVideo ? "?noVideo=1" : "")}";
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,11 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
private readonly Container noVideoButtons;
|
||||
private readonly FillFlowContainer videoButtons;
|
||||
private readonly AuthorInfo author;
|
||||
private readonly Container downloadButtonsContainer;
|
||||
public Details Details;
|
||||
|
||||
private BeatmapManager beatmaps;
|
||||
|
||||
private DelayedLoadWrapper cover;
|
||||
|
||||
public readonly BeatmapPicker Picker;
|
||||
@ -48,24 +51,22 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
title.Text = BeatmapSet.Metadata.Title;
|
||||
artist.Text = BeatmapSet.Metadata.Artist;
|
||||
|
||||
downloadButtonsContainer.FadeIn();
|
||||
noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration);
|
||||
videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration);
|
||||
|
||||
cover?.FadeOut(400, Easing.Out);
|
||||
coverContainer.Add(cover = new DelayedLoadWrapper(new BeatmapSetCover(BeatmapSet)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d =>
|
||||
coverContainer.Add(cover = new DelayedLoadWrapper(
|
||||
new BeatmapSetCover(BeatmapSet)
|
||||
{
|
||||
d.FadeInFromZero(400, Easing.Out);
|
||||
},
|
||||
})
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}, 300)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
TimeBeforeLoad = 300
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -164,7 +165,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FavouriteButton(),
|
||||
new Container
|
||||
downloadButtonsContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Left = buttons_height + buttons_spacing },
|
||||
@ -174,7 +175,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = 0f,
|
||||
Child = new DownloadButton("Download", @""),
|
||||
Child = new DownloadButton("Download", @"")
|
||||
{
|
||||
Action = () => download(false),
|
||||
},
|
||||
},
|
||||
videoButtons = new FillFlowContainer
|
||||
{
|
||||
@ -183,8 +187,14 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
Alpha = 0f,
|
||||
Children = new[]
|
||||
{
|
||||
new DownloadButton("Download", "with Video"),
|
||||
new DownloadButton("Download", "without Video"),
|
||||
new DownloadButton("Download", "with Video")
|
||||
{
|
||||
Action = () => download(false),
|
||||
},
|
||||
new DownloadButton("Download", "without Video")
|
||||
{
|
||||
Action = () => download(true),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -208,9 +218,39 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OsuColour colours, BeatmapManager beatmaps)
|
||||
{
|
||||
tabsBg.Colour = colours.Gray3;
|
||||
this.beatmaps = beatmaps;
|
||||
|
||||
beatmaps.BeatmapSetAdded += handleBeatmapAdd;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
if (beatmaps != null) beatmaps.BeatmapSetAdded -= handleBeatmapAdd;
|
||||
}
|
||||
|
||||
private void handleBeatmapAdd(BeatmapSetInfo beatmap)
|
||||
{
|
||||
if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID)
|
||||
downloadButtonsContainer.FadeOut(transition_duration);
|
||||
}
|
||||
|
||||
private void download(bool noVideo)
|
||||
{
|
||||
if (beatmaps.GetExistingDownload(BeatmapSet) != null)
|
||||
{
|
||||
downloadButtonsContainer.MoveToX(-5, 50, Easing.OutSine).Then()
|
||||
.MoveToX(5, 100, Easing.InOutSine).Then()
|
||||
.MoveToX(-5, 100, Easing.InOutSine).Then()
|
||||
.MoveToX(0, 50, Easing.InSine).Then();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
beatmaps.Download(BeatmapSet, noVideo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,7 @@ using osu.Game.Graphics.Sprites;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Audio.Track;
|
||||
@ -35,10 +33,8 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
private Container content;
|
||||
|
||||
private APIAccess api;
|
||||
private ProgressBar progressBar;
|
||||
private BeatmapManager beatmaps;
|
||||
private NotificationOverlay notifications;
|
||||
private BeatmapSetOverlay beatmapSetOverlay;
|
||||
|
||||
public Track Preview => PlayButton.Preview;
|
||||
@ -71,11 +67,9 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
|
||||
[BackgroundDependencyLoader(permitNulls: true)]
|
||||
private void load(APIAccess api, BeatmapManager beatmaps, OsuColour colours, NotificationOverlay notifications, BeatmapSetOverlay beatmapSetOverlay)
|
||||
private void load(BeatmapManager beatmaps, OsuColour colours, BeatmapSetOverlay beatmapSetOverlay)
|
||||
{
|
||||
this.api = api;
|
||||
this.beatmaps = beatmaps;
|
||||
this.notifications = notifications;
|
||||
this.beatmapSetOverlay = beatmapSetOverlay;
|
||||
|
||||
AddInternal(content = new Container
|
||||
@ -109,6 +103,14 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
if (downloadRequest != null)
|
||||
attachDownload(downloadRequest);
|
||||
|
||||
beatmaps.BeatmapDownloadBegan += attachDownload;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
beatmaps.BeatmapDownloadBegan -= attachDownload;
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
@ -151,16 +153,6 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
protected void StartDownload()
|
||||
{
|
||||
if (!api.LocalUser.Value.IsSupporter)
|
||||
{
|
||||
notifications.Post(new SimpleNotification
|
||||
{
|
||||
Icon = FontAwesome.fa_superpowers,
|
||||
Text = "You gotta be a supporter to download for now 'yo"
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (beatmaps.GetExistingDownload(SetInfo) != null)
|
||||
{
|
||||
// we already have an active download running.
|
||||
@ -172,13 +164,14 @@ namespace osu.Game.Overlays.Direct
|
||||
return;
|
||||
}
|
||||
|
||||
var request = beatmaps.Download(SetInfo);
|
||||
|
||||
attachDownload(request);
|
||||
beatmaps.Download(SetInfo);
|
||||
}
|
||||
|
||||
private void attachDownload(DownloadBeatmapSetRequest request)
|
||||
{
|
||||
if (request.BeatmapSet.OnlineBeatmapSetID != SetInfo.OnlineBeatmapSetID)
|
||||
return;
|
||||
|
||||
progressBar.FadeIn(400, Easing.OutQuint);
|
||||
progressBar.ResizeHeightTo(4, 400, Easing.OutQuint);
|
||||
|
||||
@ -219,21 +212,21 @@ namespace osu.Game.Overlays.Direct
|
||||
return icons;
|
||||
}
|
||||
|
||||
protected Drawable CreateBackground() => new DelayedLoadWrapper(new BeatmapSetCover(SetInfo)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d =>
|
||||
protected Drawable CreateBackground() => new DelayedLoadWrapper(
|
||||
new BeatmapSetCover(SetInfo)
|
||||
{
|
||||
d.FadeInFromZero(400, Easing.Out);
|
||||
BlackBackground.Delay(400).FadeOut();
|
||||
},
|
||||
})
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d =>
|
||||
{
|
||||
d.FadeInFromZero(400, Easing.Out);
|
||||
BlackBackground.Delay(400).FadeOut();
|
||||
},
|
||||
}, 300)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
TimeBeforeLoad = 300
|
||||
};
|
||||
|
||||
public class Statistic : FillFlowContainer
|
||||
|
@ -146,18 +146,17 @@ namespace osu.Game.Overlays.Direct
|
||||
|
||||
loading = true;
|
||||
|
||||
Add(new AsyncLoadWrapper(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3")
|
||||
{
|
||||
OnLoadComplete = d =>
|
||||
LoadComponentAsync(trackLoader = new TrackLoader($"https://b.ppy.sh/preview/{BeatmapSet.OnlineBeatmapSetID}.mp3"),
|
||||
d =>
|
||||
{
|
||||
// we may have been replaced by another loader
|
||||
// We may have been replaced by another loader
|
||||
if (trackLoader != d) return;
|
||||
|
||||
Preview = (d as TrackLoader)?.Preview;
|
||||
Preview = d?.Preview;
|
||||
Playing.TriggerChange();
|
||||
loading = false;
|
||||
},
|
||||
}));
|
||||
Add(trackLoader);
|
||||
});
|
||||
}
|
||||
|
||||
private class TrackLoader : Drawable
|
||||
|
@ -316,19 +316,16 @@ namespace osu.Game.Overlays.Profile
|
||||
|
||||
private void loadUser()
|
||||
{
|
||||
coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||
LoadComponentAsync(new UserCoverBackground(user)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(200)
|
||||
})
|
||||
{
|
||||
Masking = true,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Depth = float.MaxValue
|
||||
});
|
||||
OnLoadComplete = d => d.FadeInFromZero(200),
|
||||
Depth = float.MaxValue,
|
||||
},
|
||||
coverContainer.Add);
|
||||
|
||||
if (user.IsSupporter) supporterTag.Show();
|
||||
|
||||
|
134
osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
Normal file
134
osu.Game/Overlays/Profile/Sections/Kudosu/KudosuInfo.cs
Normal file
@ -0,0 +1,134 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
||||
{
|
||||
public class KudosuInfo : Container
|
||||
{
|
||||
private readonly Bindable<User> user = new Bindable<User>();
|
||||
|
||||
public KudosuInfo(Bindable<User> user)
|
||||
{
|
||||
this.user.BindTo(user);
|
||||
|
||||
CountSection total;
|
||||
CountSection avaliable;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Masking = true;
|
||||
CornerRadius = 3;
|
||||
EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Offset = new Vector2(0f, 1f),
|
||||
Radius = 3f,
|
||||
Colour = Color4.Black.Opacity(0.2f),
|
||||
};
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.Gray(0.2f)
|
||||
},
|
||||
new FillFlowContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Children = new[]
|
||||
{
|
||||
total = new CountSection(
|
||||
"Total Kudosu Earned",
|
||||
"Based on how much of a contribution the user has made to beatmap moderation. See this link for more information."
|
||||
),
|
||||
avaliable = new CountSection(
|
||||
"Kudosu Avaliable",
|
||||
"Kudosu can be traded for kudosu stars, which will help your beatmap get more attention. This is the number of kudosu you haven't traded in yet."
|
||||
),
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.user.ValueChanged += newUser =>
|
||||
{
|
||||
total.Count = newUser?.Kudosu.Total ?? 0;
|
||||
avaliable.Count = newUser?.Kudosu.Available ?? 0;
|
||||
};
|
||||
}
|
||||
|
||||
protected override bool OnClick(InputState state) => true;
|
||||
|
||||
private class CountSection : Container
|
||||
{
|
||||
private readonly OsuSpriteText valueText;
|
||||
|
||||
public int Count
|
||||
{
|
||||
set { valueText.Text = value.ToString(); }
|
||||
}
|
||||
|
||||
public CountSection(string header, string description)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Width = 0.5f;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
Padding = new MarginPadding { Horizontal = 10, Top = 10, Bottom = 20 };
|
||||
Child = new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Y,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Direction = FillDirection.Vertical,
|
||||
Spacing = new Vector2(0, 5),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(5, 0),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Text = header + ":",
|
||||
TextSize = 20,
|
||||
Font = @"Exo2.0-RegularItalic",
|
||||
},
|
||||
valueText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.BottomLeft,
|
||||
Text = "0",
|
||||
TextSize = 40,
|
||||
UseFullGlyphHeight = false,
|
||||
Font = @"Exo2.0-RegularItalic"
|
||||
}
|
||||
}
|
||||
},
|
||||
new TextFlowContainer(t => { t.TextSize = 19; })
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Text = description
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Overlays.Profile.Sections.Kudosu;
|
||||
|
||||
namespace osu.Game.Overlays.Profile.Sections
|
||||
{
|
||||
public class KudosuSection : ProfileSection
|
||||
@ -8,5 +10,13 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
public override string Title => "Kudosu!";
|
||||
|
||||
public override string Identifier => "kudosu";
|
||||
|
||||
public KudosuSection()
|
||||
{
|
||||
Children = new[]
|
||||
{
|
||||
new KudosuInfo(User),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ namespace osu.Game.Overlays
|
||||
//new MedalsSection(),
|
||||
new HistoricalSection(),
|
||||
new BeatmapsSection(),
|
||||
//new KudosuSection()
|
||||
new KudosuSection()
|
||||
};
|
||||
tabs = new ProfileTabControl
|
||||
{
|
||||
|
@ -228,16 +228,16 @@ namespace osu.Game.Screens.Multiplayer
|
||||
if (value != null)
|
||||
{
|
||||
coverContainer.FadeIn(transition_duration);
|
||||
coverContainer.Children = new[]
|
||||
|
||||
|
||||
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
},
|
||||
coverContainer.Add);
|
||||
|
||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||
beatmapDash.Text = @" - ";
|
||||
|
@ -329,17 +329,16 @@ namespace osu.Game.Screens.Multiplayer
|
||||
if (value != null)
|
||||
{
|
||||
coverContainer.FadeIn(transition_duration);
|
||||
coverContainer.Children = new[]
|
||||
|
||||
LoadComponentAsync(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
new AsyncLoadWrapper(new BeatmapSetCover(value.BeatmapSet)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
}) { RelativeSizeAxes = Axes.Both },
|
||||
};
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
|
||||
},
|
||||
coverContainer.Add);
|
||||
|
||||
beatmapTitle.Current = localisation.GetUnicodePreference(value.Metadata.TitleUnicode, value.Metadata.Title);
|
||||
beatmapDash.Text = @" - ";
|
||||
|
@ -248,7 +248,10 @@ namespace osu.Game.Screens.Play
|
||||
storyboard = beatmap.Storyboard.CreateDrawable(Beatmap.Value);
|
||||
storyboard.Masking = true;
|
||||
|
||||
storyboardContainer.Add(asyncLoad ? new AsyncLoadWrapper(storyboard) { RelativeSizeAxes = Axes.Both } : (Drawable)storyboard);
|
||||
if (asyncLoad)
|
||||
LoadComponentAsync(storyboard, storyboardContainer.Add);
|
||||
else
|
||||
storyboardContainer.Add(storyboard);
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
private Box background;
|
||||
private Container content;
|
||||
private Container avatar;
|
||||
private Drawable avatar;
|
||||
private DrawableRank scoreRank;
|
||||
private OsuSpriteText nameLabel;
|
||||
private GlowingSpriteText scoreLabel;
|
||||
@ -97,7 +97,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding(edge_margin),
|
||||
Children = new Drawable[]
|
||||
Children = new[]
|
||||
{
|
||||
avatar = new DelayedLoadWrapper(
|
||||
new Avatar(Score.User)
|
||||
@ -114,7 +114,6 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
},
|
||||
})
|
||||
{
|
||||
TimeBeforeLoad = 500,
|
||||
RelativeSizeAxes = Axes.None,
|
||||
Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
|
||||
},
|
||||
@ -211,7 +210,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
foreach (var d in new Drawable[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer })
|
||||
foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer })
|
||||
d.FadeOut();
|
||||
|
||||
Alpha = 0;
|
||||
|
@ -23,8 +23,6 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected Player Player;
|
||||
|
||||
public override string Description => @"Showing everything to play the game.";
|
||||
|
||||
/// <summary>
|
||||
/// Create a TestCase which runs through the Player screen.
|
||||
/// </summary>
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Users
|
||||
/// </summary>
|
||||
public class UpdateableAvatar : Container
|
||||
{
|
||||
private Container displayedAvatar;
|
||||
private Drawable displayedAvatar;
|
||||
|
||||
private User user;
|
||||
|
||||
@ -40,11 +40,13 @@ namespace osu.Game.Users
|
||||
{
|
||||
displayedAvatar?.FadeOut(300);
|
||||
displayedAvatar?.Expire();
|
||||
Add(displayedAvatar = new DelayedLoadWrapper(new Avatar(user)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
OnLoadComplete = d => d.FadeInFromZero(200),
|
||||
}));
|
||||
Add(displayedAvatar = new DelayedLoadWrapper(
|
||||
new Avatar(user)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
OnLoadComplete = d => d.FadeInFromZero(200),
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,14 +58,14 @@ namespace osu.Game.Users
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||
new DelayedLoadWrapper(new UserCoverBackground(user)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
FillMode = FillMode.Fill,
|
||||
OnLoadComplete = d => d.FadeInFromZero(200),
|
||||
}) { RelativeSizeAxes = Axes.Both },
|
||||
}, 0) { RelativeSizeAxes = Axes.Both },
|
||||
new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
@ -292,6 +292,7 @@
|
||||
<Compile Include="Overlays\BeatmapSet\Scores\ScoresContainer.cs" />
|
||||
<Compile Include="Online\API\Requests\GetUserBeatmapsRequest.cs" />
|
||||
<Compile Include="Overlays\Profile\Sections\Beatmaps\PaginatedBeatmapContainer.cs" />
|
||||
<Compile Include="Overlays\Profile\Sections\Kudosu\KudosuInfo.cs" />
|
||||
<Compile Include="Overlays\Profile\Sections\PaginatedContainer.cs" />
|
||||
<Compile Include="Overlays\Profile\Sections\Ranks\DrawablePerformanceScore.cs" />
|
||||
<Compile Include="Overlays\Profile\Sections\Ranks\PaginatedScoreContainer.cs" />
|
||||
|
Reference in New Issue
Block a user