mirror of https://github.com/ppy/osu
Add a bit of logging around medal awarding
Might help with https://github.com/ppy/osu/issues/29119.
This commit is contained in:
parent
60271fb0f7
commit
1e39af8ac5
|
@ -30,7 +30,8 @@ public partial class MedalAnimation : VisibilityContainer
|
|||
|
||||
private const float border_width = 5;
|
||||
|
||||
private readonly Medal medal;
|
||||
public readonly Medal Medal;
|
||||
|
||||
private readonly Box background;
|
||||
private readonly Container backgroundStrip, particleContainer;
|
||||
private readonly BackgroundStrip leftStrip, rightStrip;
|
||||
|
@ -44,7 +45,7 @@ public partial class MedalAnimation : VisibilityContainer
|
|||
|
||||
public MedalAnimation(Medal medal)
|
||||
{
|
||||
this.medal = medal;
|
||||
Medal = medal;
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
Child = content = new Container
|
||||
|
@ -168,7 +169,7 @@ protected override void LoadComplete()
|
|||
{
|
||||
base.LoadComplete();
|
||||
|
||||
LoadComponentAsync(drawableMedal = new DrawableMedal(medal)
|
||||
LoadComponentAsync(drawableMedal = new DrawableMedal(Medal)
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Online.API;
|
||||
|
@ -81,7 +82,10 @@ private void handleMedalMessages(SocketMessage obj)
|
|||
};
|
||||
|
||||
var medalAnimation = new MedalAnimation(medal);
|
||||
|
||||
queuedMedals.Enqueue(medalAnimation);
|
||||
Logger.Log($"Queueing medal unlock for \"{medal.Name}\" ({queuedMedals.Count} to display)");
|
||||
|
||||
if (OverlayActivationMode.Value == OverlayActivation.All)
|
||||
Scheduler.AddOnce(Show);
|
||||
}
|
||||
|
@ -95,10 +99,12 @@ protected override void Update()
|
|||
|
||||
if (!queuedMedals.TryDequeue(out lastAnimation))
|
||||
{
|
||||
Logger.Log("All queued medals have been displayed!");
|
||||
Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Log($"Preparing to display \"{lastAnimation.Medal.Name}\"");
|
||||
LoadComponentAsync(lastAnimation, medalContainer.Add);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue