mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:47:51 +08:00
Merge branch 'master' into taiko_hit_drawables
This commit is contained in:
commit
73d2f91086
@ -29,7 +29,7 @@ namespace osu.Game.Modes.Osu
|
||||
createAutoReplay();
|
||||
}
|
||||
|
||||
internal class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
|
||||
private class LegacyReplayFrameComparer : IComparer<LegacyReplayFrame>
|
||||
{
|
||||
public int Compare(LegacyReplayFrame f1, LegacyReplayFrame f2)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Database
|
||||
|
||||
using (var lzma = new LzmaStream(properties, replayInStream, compressedSize, outSize))
|
||||
using (var reader = new StreamReader(lzma))
|
||||
score.Replay = new LegacyReplay(reader);
|
||||
score.Replay = score.CreateLegacyReplayFrom(reader);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,13 +46,13 @@ namespace osu.Game.Modes
|
||||
}
|
||||
}
|
||||
|
||||
public override ReplayInputHandler GetInputHandler() => new LegacyReplayInputHandler(Frames);
|
||||
public override ReplayInputHandler CreateInputHandler() => new LegacyReplayInputHandler(Frames);
|
||||
|
||||
/// <summary>
|
||||
/// The ReplayHandler will take a replay and handle the propagation of updates to the input stack.
|
||||
/// It handles logic of any frames which *must* be executed.
|
||||
/// </summary>
|
||||
public class LegacyReplayInputHandler : ReplayInputHandler
|
||||
protected class LegacyReplayInputHandler : ReplayInputHandler
|
||||
{
|
||||
private readonly List<LegacyReplayFrame> replayContent;
|
||||
|
||||
@ -163,7 +163,7 @@ namespace osu.Game.Modes
|
||||
return currentTime = time;
|
||||
}
|
||||
|
||||
private class ReplayMouseState : MouseState
|
||||
protected class ReplayMouseState : MouseState
|
||||
{
|
||||
public ReplayMouseState(Vector2 position, IEnumerable<MouseButton> list)
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace osu.Game.Modes
|
||||
}
|
||||
}
|
||||
|
||||
private class ReplayKeyboardState : KeyboardState
|
||||
protected class ReplayKeyboardState : KeyboardState
|
||||
{
|
||||
public ReplayKeyboardState(List<Key> keys)
|
||||
{
|
||||
@ -182,7 +182,7 @@ namespace osu.Game.Modes
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum LegacyButtonState
|
||||
protected enum LegacyButtonState
|
||||
{
|
||||
None = 0,
|
||||
Left1 = 1,
|
||||
@ -192,7 +192,7 @@ namespace osu.Game.Modes
|
||||
Smoke = 16
|
||||
}
|
||||
|
||||
public class LegacyReplayFrame
|
||||
protected class LegacyReplayFrame
|
||||
{
|
||||
public Vector2 Position => new Vector2(MouseX, MouseY);
|
||||
|
||||
|
@ -157,7 +157,7 @@ namespace osu.Game.Modes.Mods
|
||||
|
||||
public void Apply(HitRenderer<T> hitRenderer)
|
||||
{
|
||||
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.GetInputHandler();
|
||||
hitRenderer.InputManager.ReplayInputHandler = CreateReplayScore(hitRenderer.Beatmap)?.Replay?.CreateInputHandler();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,6 @@ namespace osu.Game.Modes
|
||||
{
|
||||
public abstract class Replay
|
||||
{
|
||||
public virtual ReplayInputHandler GetInputHandler() => null;
|
||||
public virtual ReplayInputHandler CreateInputHandler() => null;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ using Newtonsoft.Json;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Modes.Mods;
|
||||
using osu.Game.Users;
|
||||
using System.IO;
|
||||
|
||||
namespace osu.Game.Modes.Scoring
|
||||
{
|
||||
@ -43,6 +44,13 @@ namespace osu.Game.Modes.Scoring
|
||||
[JsonProperty(@"date")]
|
||||
public DateTime Date;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a legacy replay which is read from a stream.
|
||||
/// </summary>
|
||||
/// <param name="reader">The stream reader.</param>
|
||||
/// <returns>The replay.</returns>
|
||||
public virtual Replay CreateLegacyReplayFrom(StreamReader reader) => new LegacyReplay(reader);
|
||||
|
||||
// [JsonProperty(@"count50")] 0,
|
||||
//[JsonProperty(@"count100")] 0,
|
||||
//[JsonProperty(@"count300")] 100,
|
||||
|
@ -126,7 +126,7 @@ namespace osu.Game
|
||||
|
||||
Beatmap.Value = BeatmapDatabase.GetWorkingBeatmap(s.Beatmap);
|
||||
|
||||
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.GetInputHandler() }));
|
||||
menu.Push(new PlayerLoader(new Player { ReplayInputHandler = s.Replay.CreateInputHandler() }));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
Loading…
Reference in New Issue
Block a user