mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add temporary means of getting the user which is responsible for a resulting play.
This commit is contained in:
@ -12,6 +12,7 @@ using System.Diagnostics;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu
|
namespace osu.Game.Rulesets.Osu
|
||||||
{
|
{
|
||||||
@ -27,6 +28,11 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
|
User = new User
|
||||||
|
{
|
||||||
|
Username = @"Autoplay",
|
||||||
|
};
|
||||||
|
|
||||||
createAutoReplay();
|
createAutoReplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,14 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Replays
|
namespace osu.Game.Rulesets.Replays
|
||||||
{
|
{
|
||||||
public class Replay
|
public class Replay
|
||||||
{
|
{
|
||||||
|
public User User;
|
||||||
|
|
||||||
public List<ReplayFrame> Frames = new List<ReplayFrame>();
|
public List<ReplayFrame> Frames = new List<ReplayFrame>();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,6 +9,7 @@ using osu.Game.Rulesets.Judgements;
|
|||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Scoring
|
namespace osu.Game.Rulesets.Scoring
|
||||||
{
|
{
|
||||||
|
@ -91,11 +91,17 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
protected virtual FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new FramedReplayInputHandler(replay);
|
protected virtual FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new FramedReplayInputHandler(replay);
|
||||||
|
|
||||||
|
public Replay Replay { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets a replay to be used, overriding local input.
|
/// Sets a replay to be used, overriding local input.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="replay">The replay, null for local input.</param>
|
/// <param name="replay">The replay, null for local input.</param>
|
||||||
public void SetReplay(Replay replay) => InputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null;
|
public void SetReplay(Replay replay)
|
||||||
|
{
|
||||||
|
Replay = replay;
|
||||||
|
InputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -22,6 +22,7 @@ using System.Linq;
|
|||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -266,7 +267,9 @@ namespace osu.Game.Screens.Play
|
|||||||
Delay(1000);
|
Delay(1000);
|
||||||
onCompletionEvent = Schedule(delegate
|
onCompletionEvent = Schedule(delegate
|
||||||
{
|
{
|
||||||
Push(new Results(scoreProcessor.CreateScore()));
|
var score = scoreProcessor.CreateScore();
|
||||||
|
score.User = HitRenderer.Replay?.User ?? (Game as OsuGame)?.API?.LocalUser?.Value;
|
||||||
|
Push(new Results(score));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user