mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 13:32:54 +08:00
Merge branch 'master' into fix-cursor-in-scale-container
This commit is contained in:
commit
d1c18c52ab
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
{
|
{
|
||||||
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
|
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
|
||||||
{
|
{
|
||||||
protected override Score CreateReplayScore(Beatmap<CatchHitObject> beatmap) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!salad!" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!salad!" } },
|
||||||
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
||||||
|
@ -6,17 +6,20 @@ using System.Linq;
|
|||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Replays
|
namespace osu.Game.Rulesets.Catch.Replays
|
||||||
{
|
{
|
||||||
internal class CatchAutoGenerator : AutoGenerator<CatchHitObject>
|
internal class CatchAutoGenerator : AutoGenerator
|
||||||
{
|
{
|
||||||
public const double RELEASE_DELAY = 20;
|
public const double RELEASE_DELAY = 20;
|
||||||
|
|
||||||
public CatchAutoGenerator(Beatmap<CatchHitObject> beatmap)
|
public new CatchBeatmap Beatmap => (CatchBeatmap)base.Beatmap;
|
||||||
|
|
||||||
|
public CatchAutoGenerator(IBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
Replay = new Replay();
|
Replay = new Replay();
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Mania.Mods
|
|||||||
{
|
{
|
||||||
public class ManiaModAutoplay : ModAutoplay<ManiaHitObject>
|
public class ManiaModAutoplay : ModAutoplay<ManiaHitObject>
|
||||||
{
|
{
|
||||||
protected override Score CreateReplayScore(Beatmap<ManiaHitObject> beatmap) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!topus!" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "osu!topus!" } },
|
||||||
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),
|
Replay = new ManiaAutoGenerator((ManiaBeatmap)beatmap).Generate(),
|
||||||
|
@ -5,13 +5,12 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Replays
|
namespace osu.Game.Rulesets.Mania.Replays
|
||||||
{
|
{
|
||||||
internal class ManiaAutoGenerator : AutoGenerator<ManiaHitObject>
|
internal class ManiaAutoGenerator : AutoGenerator
|
||||||
{
|
{
|
||||||
public const double RELEASE_DELAY = 20;
|
public const double RELEASE_DELAY = 20;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
path = new SmoothPath
|
path = new SmoothPath
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
PathWidth = 1
|
PathRadius = 1
|
||||||
},
|
},
|
||||||
marker = new CircularContainer
|
marker = new CircularContainer
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
InternalChild = body = new ManualSliderBody
|
InternalChild = body = new ManualSliderBody
|
||||||
{
|
{
|
||||||
AccentColour = Color4.Transparent,
|
AccentColour = Color4.Transparent,
|
||||||
PathWidth = slider.Scale * 64
|
PathRadius = slider.Scale * 64
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
body.BorderColour = colours.Yellow;
|
body.BorderColour = colours.Yellow;
|
||||||
|
|
||||||
PositionBindable.BindValueChanged(_ => updatePosition(), true);
|
PositionBindable.BindValueChanged(_ => updatePosition(), true);
|
||||||
ScaleBindable.BindValueChanged(scale => body.PathWidth = scale.NewValue * 64, true);
|
ScaleBindable.BindValueChanged(scale => body.PathRadius = scale.NewValue * 64, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePosition() => Position = slider.StackedPosition;
|
private void updatePosition() => Position = slider.StackedPosition;
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).Append(typeof(OsuModSpunOut)).ToArray();
|
||||||
|
|
||||||
protected override Score CreateReplayScore(Beatmap<OsuHitObject> beatmap) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "Autoplay" } },
|
||||||
Replay = new OsuAutoGenerator(beatmap).Generate()
|
Replay = new OsuAutoGenerator(beatmap).Generate()
|
||||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
Body = new SnakingSliderBody(s)
|
Body = new SnakingSliderBody(s)
|
||||||
{
|
{
|
||||||
PathWidth = s.Scale * 64,
|
PathRadius = s.Scale * 64,
|
||||||
},
|
},
|
||||||
ticks = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
|
ticks = new Container<DrawableSliderTick> { RelativeSizeAxes = Axes.Both },
|
||||||
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
|
repeatPoints = new Container<DrawableRepeatPoint> { RelativeSizeAxes = Axes.Both },
|
||||||
@ -105,7 +105,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
|
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
|
||||||
scaleBindable.BindValueChanged(scale =>
|
scaleBindable.BindValueChanged(scale =>
|
||||||
{
|
{
|
||||||
Body.PathWidth = scale.NewValue * 64;
|
Body.PathRadius = scale.NewValue * 64;
|
||||||
Ball.Scale = new Vector2(scale.NewValue);
|
Ball.Scale = new Vector2(scale.NewValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -19,10 +19,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
|
|||||||
|
|
||||||
private readonly BufferedContainer container;
|
private readonly BufferedContainer container;
|
||||||
|
|
||||||
public float PathWidth
|
public float PathRadius
|
||||||
{
|
{
|
||||||
get => path.PathWidth;
|
get => path.PathRadius;
|
||||||
set => path.PathWidth = value;
|
set => path.PathRadius = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -10,12 +10,15 @@ using System.Linq;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Replays
|
namespace osu.Game.Rulesets.Osu.Replays
|
||||||
{
|
{
|
||||||
public class OsuAutoGenerator : OsuAutoGeneratorBase
|
public class OsuAutoGenerator : OsuAutoGeneratorBase
|
||||||
{
|
{
|
||||||
|
public new OsuBeatmap Beatmap => (OsuBeatmap)base.Beatmap;
|
||||||
|
|
||||||
#region Parameters
|
#region Parameters
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -42,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
|
|
||||||
#region Construction / Initialisation
|
#region Construction / Initialisation
|
||||||
|
|
||||||
public OsuAutoGenerator(Beatmap<OsuHitObject> beatmap)
|
public OsuAutoGenerator(IBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
// Already superhuman, but still somewhat realistic
|
// Already superhuman, but still somewhat realistic
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
@ -12,7 +11,7 @@ using osu.Game.Rulesets.Replays;
|
|||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Replays
|
namespace osu.Game.Rulesets.Osu.Replays
|
||||||
{
|
{
|
||||||
public abstract class OsuAutoGeneratorBase : AutoGenerator<OsuHitObject>
|
public abstract class OsuAutoGeneratorBase : AutoGenerator
|
||||||
{
|
{
|
||||||
#region Constants
|
#region Constants
|
||||||
|
|
||||||
@ -35,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
|||||||
protected Replay Replay;
|
protected Replay Replay;
|
||||||
protected List<ReplayFrame> Frames => Replay.Frames;
|
protected List<ReplayFrame> Frames => Replay.Frames;
|
||||||
|
|
||||||
protected OsuAutoGeneratorBase(Beatmap<OsuHitObject> beatmap)
|
protected OsuAutoGeneratorBase(IBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
Replay = new Replay();
|
Replay = new Replay();
|
||||||
|
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
{
|
{
|
||||||
private int currentIndex;
|
private int currentIndex;
|
||||||
|
|
||||||
private Shader shader;
|
private IShader shader;
|
||||||
private Texture texture;
|
private Texture texture;
|
||||||
|
|
||||||
private Vector2 size => texture.Size * Scale;
|
private Vector2 size => texture.Size * Scale;
|
||||||
@ -35,7 +35,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
public override bool IsPresent => true;
|
public override bool IsPresent => true;
|
||||||
|
|
||||||
private readonly TrailDrawNodeSharedData trailDrawNodeSharedData = new TrailDrawNodeSharedData();
|
|
||||||
private const int max_sprites = 2048;
|
private const int max_sprites = 2048;
|
||||||
|
|
||||||
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
private readonly TrailPart[] parts = new TrailPart[max_sprites];
|
||||||
@ -55,7 +54,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
tNode.Texture = texture;
|
tNode.Texture = texture;
|
||||||
tNode.Size = size;
|
tNode.Size = size;
|
||||||
tNode.Time = time;
|
tNode.Time = time;
|
||||||
tNode.Shared = trailDrawNodeSharedData;
|
|
||||||
|
|
||||||
for (int i = 0; i < parts.Length; ++i)
|
for (int i = 0; i < parts.Length; ++i)
|
||||||
if (parts[i].InvalidationID > tNode.Parts[i].InvalidationID)
|
if (parts[i].InvalidationID > tNode.Parts[i].InvalidationID)
|
||||||
@ -81,7 +79,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ShaderManager shaders, TextureStore textures)
|
private void load(ShaderManager shaders, TextureStore textures)
|
||||||
{
|
{
|
||||||
shader = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
|
shader = shaders.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
|
||||||
texture = textures.Get(@"Cursor/cursortrail");
|
texture = textures.Get(@"Cursor/cursortrail");
|
||||||
Scale = new Vector2(1 / texture.ScaleAdjust);
|
Scale = new Vector2(1 / texture.ScaleAdjust);
|
||||||
}
|
}
|
||||||
@ -167,22 +165,18 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
public bool WasUpdated;
|
public bool WasUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TrailDrawNodeSharedData
|
|
||||||
{
|
|
||||||
public VertexBuffer<TexturedTrailVertex> VertexBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TrailDrawNode : DrawNode
|
private class TrailDrawNode : DrawNode
|
||||||
{
|
{
|
||||||
public Shader Shader;
|
public IShader Shader;
|
||||||
public Texture Texture;
|
public Texture Texture;
|
||||||
|
|
||||||
public float Time;
|
public float Time;
|
||||||
public TrailDrawNodeSharedData Shared;
|
|
||||||
|
|
||||||
public readonly TrailPart[] Parts = new TrailPart[max_sprites];
|
public readonly TrailPart[] Parts = new TrailPart[max_sprites];
|
||||||
public Vector2 Size;
|
public Vector2 Size;
|
||||||
|
|
||||||
|
private readonly VertexBuffer<TexturedTrailVertex> vertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
|
||||||
|
|
||||||
public TrailDrawNode()
|
public TrailDrawNode()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < max_sprites; i++)
|
for (int i = 0; i < max_sprites; i++)
|
||||||
@ -194,9 +188,6 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
|
|
||||||
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
||||||
{
|
{
|
||||||
if (Shared.VertexBuffer == null)
|
|
||||||
Shared.VertexBuffer = new QuadVertexBuffer<TexturedTrailVertex>(max_sprites, BufferUsageHint.DynamicDraw);
|
|
||||||
|
|
||||||
Shader.GetUniform<float>("g_FadeClock").UpdateValue(ref Time);
|
Shader.GetUniform<float>("g_FadeClock").UpdateValue(ref Time);
|
||||||
|
|
||||||
int updateStart = -1, updateEnd = 0;
|
int updateStart = -1, updateEnd = 0;
|
||||||
@ -218,7 +209,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y),
|
new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y),
|
||||||
DrawColourInfo.Colour,
|
DrawColourInfo.Colour,
|
||||||
null,
|
null,
|
||||||
v => Shared.VertexBuffer.Vertices[end++] = new TexturedTrailVertex
|
v => vertexBuffer.Vertices[end++] = new TexturedTrailVertex
|
||||||
{
|
{
|
||||||
Position = v.Position,
|
Position = v.Position,
|
||||||
TexturePosition = v.TexturePosition,
|
TexturePosition = v.TexturePosition,
|
||||||
@ -230,24 +221,31 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
|
|||||||
}
|
}
|
||||||
else if (updateStart != -1)
|
else if (updateStart != -1)
|
||||||
{
|
{
|
||||||
Shared.VertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
|
vertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
|
||||||
updateStart = -1;
|
updateStart = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update all remaining vertices that have been changed.
|
// Update all remaining vertices that have been changed.
|
||||||
if (updateStart != -1)
|
if (updateStart != -1)
|
||||||
Shared.VertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
|
vertexBuffer.UpdateRange(updateStart * 4, updateEnd * 4);
|
||||||
|
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
|
|
||||||
Shader.Bind();
|
Shader.Bind();
|
||||||
|
|
||||||
Texture.TextureGL.Bind();
|
Texture.TextureGL.Bind();
|
||||||
Shared.VertexBuffer.Draw();
|
vertexBuffer.Draw();
|
||||||
|
|
||||||
Shader.Unbind();
|
Shader.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
vertexBuffer.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
{
|
{
|
||||||
public class TaikoModAutoplay : ModAutoplay<TaikoHitObject>
|
public class TaikoModAutoplay : ModAutoplay<TaikoHitObject>
|
||||||
{
|
{
|
||||||
protected override Score CreateReplayScore(Beatmap<TaikoHitObject> beatmap) => new Score
|
public override Score CreateReplayScore(IBeatmap beatmap) => new Score
|
||||||
{
|
{
|
||||||
ScoreInfo = new ScoreInfo { User = new User { Username = "mekkadosu!" } },
|
ScoreInfo = new ScoreInfo { User = new User { Username = "mekkadosu!" } },
|
||||||
Replay = new TaikoAutoGenerator(beatmap).Generate(),
|
Replay = new TaikoAutoGenerator(beatmap).Generate(),
|
||||||
|
@ -9,14 +9,17 @@ using osu.Game.Replays;
|
|||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Taiko.Objects;
|
using osu.Game.Rulesets.Taiko.Objects;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
using osu.Game.Rulesets.Taiko.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Taiko.Replays
|
namespace osu.Game.Rulesets.Taiko.Replays
|
||||||
{
|
{
|
||||||
public class TaikoAutoGenerator : AutoGenerator<TaikoHitObject>
|
public class TaikoAutoGenerator : AutoGenerator
|
||||||
{
|
{
|
||||||
|
public new TaikoBeatmap Beatmap => (TaikoBeatmap)base.Beatmap;
|
||||||
|
|
||||||
private const double swell_hit_speed = 50;
|
private const double swell_hit_speed = 50;
|
||||||
|
|
||||||
public TaikoAutoGenerator(Beatmap<TaikoHitObject> beatmap)
|
public TaikoAutoGenerator(IBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
Replay = new Replay();
|
Replay = new Replay();
|
||||||
|
@ -113,6 +113,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
|
|
||||||
[TestCase(normal)]
|
[TestCase(normal)]
|
||||||
[TestCase(marathon)]
|
[TestCase(marathon)]
|
||||||
|
[Ignore("temporarily disabled pending DeepEqual fix (https://github.com/jamesfoster/DeepEqual/pull/35)")]
|
||||||
// Currently fails:
|
// Currently fails:
|
||||||
// [TestCase(with_sb)]
|
// [TestCase(with_sb)]
|
||||||
public void TestParity(string beatmap)
|
public void TestParity(string beatmap)
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tests.Visual
|
||||||
@ -14,15 +16,27 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
protected override Player CreatePlayer(Ruleset ruleset)
|
protected override Player CreatePlayer(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
// We create a dummy RulesetContainer just to get the replay - we don't want to use mods here
|
var beatmap = Beatmap.Value.GetPlayableBeatmap(ruleset.RulesetInfo);
|
||||||
// to simulate setting a replay rather than having the replay already set for us
|
|
||||||
Beatmap.Value.Mods.Value = Beatmap.Value.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
|
|
||||||
var dummyRulesetContainer = ruleset.CreateRulesetContainerWith(Beatmap.Value);
|
|
||||||
|
|
||||||
// Reset the mods
|
return new ScoreAccessibleReplayPlayer(ruleset.GetAutoplayMod().CreateReplayScore(beatmap));
|
||||||
Beatmap.Value.Mods.Value = Beatmap.Value.Mods.Value.Where(m => !(m is ModAutoplay));
|
}
|
||||||
|
|
||||||
return new ReplayPlayer(dummyRulesetContainer.ReplayScore);
|
protected override void AddCheckSteps(Func<Player> player)
|
||||||
|
{
|
||||||
|
base.AddCheckSteps(player);
|
||||||
|
AddUntilStep(() => ((ScoreAccessibleReplayPlayer)player()).ScoreProcessor.TotalScore.Value > 0, "score above zero");
|
||||||
|
AddUntilStep(() => ((ScoreAccessibleReplayPlayer)player()).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 0), "key counter counted keys");
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ScoreAccessibleReplayPlayer : ReplayPlayer
|
||||||
|
{
|
||||||
|
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
|
||||||
|
public new HUDOverlay HUDOverlay => base.HUDOverlay;
|
||||||
|
|
||||||
|
public ScoreAccessibleReplayPlayer(Score score)
|
||||||
|
: base(score)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
public class TestCaseUpdateableBeatmapBackgroundSprite : OsuTestCase
|
public class TestCaseUpdateableBeatmapBackgroundSprite : OsuTestCase
|
||||||
{
|
{
|
||||||
private UpdateableBeatmapBackgroundSprite backgroundSprite;
|
private TestUpdateableBeatmapBackgroundSprite backgroundSprite;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmaps { get; set; }
|
private BeatmapManager beatmaps { get; set; }
|
||||||
@ -28,30 +28,36 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
var imported = ImportBeatmapTest.LoadOszIntoOsu(osu);
|
var imported = ImportBeatmapTest.LoadOszIntoOsu(osu);
|
||||||
|
|
||||||
Child = backgroundSprite = new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both };
|
Child = backgroundSprite = new TestUpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
backgroundSprite.Beatmap.BindTo(beatmapBindable);
|
backgroundSprite.Beatmap.BindTo(beatmapBindable);
|
||||||
|
|
||||||
var req = new GetBeatmapSetRequest(1);
|
var req = new GetBeatmapSetRequest(1);
|
||||||
api.Queue(req);
|
api.Queue(req);
|
||||||
|
|
||||||
AddStep("null", () => beatmapBindable.Value = null);
|
AddStep("load null beatmap", () => beatmapBindable.Value = null);
|
||||||
|
AddUntilStep(() => backgroundSprite.ChildCount == 1, "wait for cleanup...");
|
||||||
AddStep("imported", () => beatmapBindable.Value = imported.Beatmaps.First());
|
AddStep("load imported beatmap", () => beatmapBindable.Value = imported.Beatmaps.First());
|
||||||
|
AddUntilStep(() => backgroundSprite.ChildCount == 1, "wait for cleanup...");
|
||||||
|
|
||||||
if (api.IsLoggedIn)
|
if (api.IsLoggedIn)
|
||||||
{
|
{
|
||||||
AddUntilStep(() => req.Result != null, "wait for api response");
|
AddUntilStep(() => req.Result != null, "wait for api response");
|
||||||
|
AddStep("load online beatmap", () => beatmapBindable.Value = new BeatmapInfo
|
||||||
AddStep("online", () => beatmapBindable.Value = new BeatmapInfo
|
|
||||||
{
|
{
|
||||||
BeatmapSet = req.Result?.ToBeatmapSet(rulesets)
|
BeatmapSet = req.Result?.ToBeatmapSet(rulesets)
|
||||||
});
|
});
|
||||||
|
AddUntilStep(() => backgroundSprite.ChildCount == 1, "wait for cleanup...");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddStep("online (login first)", () => { });
|
AddStep("online (login first)", () => { });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class TestUpdateableBeatmapBackgroundSprite : UpdateableBeatmapBackgroundSprite
|
||||||
|
{
|
||||||
|
public int ChildCount => InternalChildren.Count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
namespace osu.Game.Beatmaps.Drawables
|
namespace osu.Game.Beatmaps.Drawables
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display a baetmap background from a local source, but fallback to online source if not available.
|
/// Display a beatmap background from a local source, but fallback to online source if not available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo>
|
public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo>
|
||||||
{
|
{
|
||||||
@ -18,23 +18,51 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private BeatmapManager beatmaps { get; set; }
|
private BeatmapManager beatmaps { get; set; }
|
||||||
|
|
||||||
public UpdateableBeatmapBackgroundSprite()
|
private readonly BeatmapSetCoverType beatmapSetCoverType;
|
||||||
|
|
||||||
|
public UpdateableBeatmapBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
||||||
{
|
{
|
||||||
Beatmap.BindValueChanged(b => Model = b.NewValue);
|
Beatmap.BindValueChanged(b => Model = b.NewValue);
|
||||||
|
this.beatmapSetCoverType = beatmapSetCoverType;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BeatmapInfo lastModel;
|
||||||
|
|
||||||
|
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Drawable content, double timeBeforeLoad)
|
||||||
|
{
|
||||||
|
return new DelayedLoadUnloadWrapper(() =>
|
||||||
|
{
|
||||||
|
// If DelayedLoadUnloadWrapper is attempting to RELOAD the same content (Beatmap), that means that it was
|
||||||
|
// previously UNLOADED and thus its children have been disposed of, so we need to recreate them here.
|
||||||
|
if (lastModel == Beatmap.Value && Beatmap.Value != null)
|
||||||
|
return CreateDrawable(Beatmap.Value);
|
||||||
|
|
||||||
|
// If the model has changed since the previous unload (or if there was no load), then we can safely use the given content
|
||||||
|
lastModel = Beatmap.Value;
|
||||||
|
return content;
|
||||||
|
}, timeBeforeLoad, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(BeatmapInfo model)
|
protected override Drawable CreateDrawable(BeatmapInfo model)
|
||||||
{
|
|
||||||
return new DelayedLoadUnloadWrapper(() =>
|
|
||||||
{
|
{
|
||||||
Drawable drawable;
|
Drawable drawable;
|
||||||
|
|
||||||
var localBeatmap = beatmaps.GetWorkingBeatmap(model);
|
var localBeatmap = beatmaps.GetWorkingBeatmap(model);
|
||||||
|
|
||||||
if (localBeatmap.BeatmapInfo.ID == 0 && model?.BeatmapSet?.OnlineInfo != null)
|
if (model?.BeatmapSet?.OnlineInfo != null)
|
||||||
drawable = new BeatmapSetCover(model.BeatmapSet);
|
{
|
||||||
else
|
drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
|
||||||
|
}
|
||||||
|
else if (localBeatmap.BeatmapInfo.ID != 0)
|
||||||
|
{
|
||||||
|
// Fall back to local background if one exists
|
||||||
drawable = new BeatmapBackgroundSprite(localBeatmap);
|
drawable = new BeatmapBackgroundSprite(localBeatmap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use the default background if somehow an online set does not exist and we don't have a local copy.
|
||||||
|
drawable = new BeatmapBackgroundSprite(beatmaps.DefaultBeatmap);
|
||||||
|
}
|
||||||
|
|
||||||
drawable.RelativeSizeAxes = Axes.Both;
|
drawable.RelativeSizeAxes = Axes.Both;
|
||||||
drawable.Anchor = Anchor.Centre;
|
drawable.Anchor = Anchor.Centre;
|
||||||
@ -43,9 +71,6 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
drawable.OnLoadComplete = d => d.FadeInFromZero(400);
|
drawable.OnLoadComplete = d => d.FadeInFromZero(400);
|
||||||
|
|
||||||
return drawable;
|
return drawable;
|
||||||
}, 500, 10000);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override double FadeDuration => 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
private readonly SortedList<TriangleParticle> parts = new SortedList<TriangleParticle>(Comparer<TriangleParticle>.Default);
|
private readonly SortedList<TriangleParticle> parts = new SortedList<TriangleParticle>(Comparer<TriangleParticle>.Default);
|
||||||
|
|
||||||
private Shader shader;
|
private IShader shader;
|
||||||
private readonly Texture texture;
|
private readonly Texture texture;
|
||||||
|
|
||||||
public Triangles()
|
public Triangles()
|
||||||
@ -75,7 +75,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ShaderManager shaders)
|
private void load(ShaderManager shaders)
|
||||||
{
|
{
|
||||||
shader = shaders?.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
|
shader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -180,8 +180,6 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
|
|
||||||
protected override DrawNode CreateDrawNode() => new TrianglesDrawNode();
|
protected override DrawNode CreateDrawNode() => new TrianglesDrawNode();
|
||||||
|
|
||||||
private readonly TrianglesDrawNodeSharedData sharedData = new TrianglesDrawNodeSharedData();
|
|
||||||
|
|
||||||
protected override void ApplyDrawNode(DrawNode node)
|
protected override void ApplyDrawNode(DrawNode node)
|
||||||
{
|
{
|
||||||
base.ApplyDrawNode(node);
|
base.ApplyDrawNode(node);
|
||||||
@ -191,27 +189,21 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
trianglesNode.Shader = shader;
|
trianglesNode.Shader = shader;
|
||||||
trianglesNode.Texture = texture;
|
trianglesNode.Texture = texture;
|
||||||
trianglesNode.Size = DrawSize;
|
trianglesNode.Size = DrawSize;
|
||||||
trianglesNode.Shared = sharedData;
|
|
||||||
|
|
||||||
trianglesNode.Parts.Clear();
|
trianglesNode.Parts.Clear();
|
||||||
trianglesNode.Parts.AddRange(parts);
|
trianglesNode.Parts.AddRange(parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TrianglesDrawNodeSharedData
|
|
||||||
{
|
|
||||||
public readonly LinearBatch<TexturedVertex2D> VertexBatch = new LinearBatch<TexturedVertex2D>(100 * 3, 10, PrimitiveType.Triangles);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class TrianglesDrawNode : DrawNode
|
private class TrianglesDrawNode : DrawNode
|
||||||
{
|
{
|
||||||
public Shader Shader;
|
public IShader Shader;
|
||||||
public Texture Texture;
|
public Texture Texture;
|
||||||
|
|
||||||
public TrianglesDrawNodeSharedData Shared;
|
|
||||||
|
|
||||||
public readonly List<TriangleParticle> Parts = new List<TriangleParticle>();
|
public readonly List<TriangleParticle> Parts = new List<TriangleParticle>();
|
||||||
public Vector2 Size;
|
public Vector2 Size;
|
||||||
|
|
||||||
|
private readonly LinearBatch<TexturedVertex2D> vertexBatch = new LinearBatch<TexturedVertex2D>(100 * 3, 10, PrimitiveType.Triangles);
|
||||||
|
|
||||||
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
||||||
{
|
{
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
@ -239,12 +231,19 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
triangle,
|
triangle,
|
||||||
colourInfo,
|
colourInfo,
|
||||||
null,
|
null,
|
||||||
Shared.VertexBatch.AddAction,
|
vertexBatch.AddAction,
|
||||||
Vector2.Divide(localInflationAmount, size));
|
Vector2.Divide(localInflationAmount, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
Shader.Unbind();
|
Shader.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
vertexBatch.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected struct TriangleParticle : IComparable<TriangleParticle>
|
protected struct TriangleParticle : IComparable<TriangleParticle>
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Masking = true,
|
Masking = true,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathWidth = 1 }
|
Child = path = new SmoothPath { RelativeSizeAxes = Axes.Both, PathRadius = 1 }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,9 +102,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
for (int i = 0; i < values.Length; i++)
|
for (int i = 0; i < values.Length; i++)
|
||||||
{
|
{
|
||||||
float x = (i + count - values.Length) / (float)(count - 1) * DrawWidth - 1;
|
// Make sure that we are accounting for path width when calculating vertex positions
|
||||||
float y = GetYPosition(values[i]) * DrawHeight - 1;
|
// We need to apply 2x the path radius to account for it because the full diameter of the line accounts into height
|
||||||
// the -1 is for inner offset in path (actually -PathWidth)
|
float x = (i + count - values.Length) / (float)(count - 1) * (DrawWidth - 2 * path.PathRadius);
|
||||||
|
float y = GetYPosition(values[i]) * (DrawHeight - 2 * path.PathRadius);
|
||||||
path.AddVertex(new Vector2(x, y));
|
path.AddVertex(new Vector2(x, y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
|
if (other.Host.Value != null && Host.Value?.Id != other.Host.Value.Id)
|
||||||
Host.Value = other.Host.Value;
|
Host.Value = other.Host.Value;
|
||||||
|
|
||||||
|
ChannelId.Value = other.ChannelId.Value;
|
||||||
Status.Value = other.Status.Value;
|
Status.Value = other.Status.Value;
|
||||||
Availability.Value = other.Availability.Value;
|
Availability.Value = other.Availability.Value;
|
||||||
Type.Value = other.Type.Value;
|
Type.Value = other.Type.Value;
|
||||||
|
@ -14,10 +14,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToRulesetContainer<T>
|
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToRulesetContainer<T>
|
||||||
where T : HitObject
|
where T : HitObject
|
||||||
{
|
{
|
||||||
protected virtual Score CreateReplayScore(Beatmap<T> beatmap) => new Score { Replay = new Replay() };
|
|
||||||
|
|
||||||
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
|
|
||||||
|
|
||||||
public virtual void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer) => rulesetContainer.SetReplayScore(CreateReplayScore(rulesetContainer.Beatmap));
|
public virtual void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer) => rulesetContainer.SetReplayScore(CreateReplayScore(rulesetContainer.Beatmap));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,5 +27,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public override double ScoreMultiplier => 1;
|
public override double ScoreMultiplier => 1;
|
||||||
public bool AllowFail => false;
|
public bool AllowFail => false;
|
||||||
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
|
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) };
|
||||||
|
|
||||||
|
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;
|
||||||
|
|
||||||
|
public virtual Score CreateReplayScore(IBeatmap beatmap) => new Score { Replay = new Replay() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public abstract class Flashlight : Drawable
|
public abstract class Flashlight : Drawable
|
||||||
{
|
{
|
||||||
internal BindableInt Combo;
|
internal BindableInt Combo;
|
||||||
private Shader shader;
|
private IShader shader;
|
||||||
|
|
||||||
protected override DrawNode CreateDrawNode() => new FlashlightDrawNode();
|
protected override DrawNode CreateDrawNode() => new FlashlightDrawNode();
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
private class FlashlightDrawNode : DrawNode
|
private class FlashlightDrawNode : DrawNode
|
||||||
{
|
{
|
||||||
public Shader Shader;
|
public IShader Shader;
|
||||||
public Quad ScreenSpaceDrawQuad;
|
public Quad ScreenSpaceDrawQuad;
|
||||||
public Vector2 FlashlightPosition;
|
public Vector2 FlashlightPosition;
|
||||||
public Vector2 FlashlightSize;
|
public Vector2 FlashlightSize;
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Rulesets.Objects;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Replays;
|
using osu.Game.Replays;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Replays
|
namespace osu.Game.Rulesets.Replays
|
||||||
{
|
{
|
||||||
public abstract class AutoGenerator<T> : IAutoGenerator
|
public abstract class AutoGenerator : IAutoGenerator
|
||||||
where T : HitObject
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the auto replay and returns it.
|
/// Creates the auto replay and returns it.
|
||||||
@ -21,11 +19,11 @@ namespace osu.Game.Rulesets.Replays
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The beatmap we're making.
|
/// The beatmap we're making.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected Beatmap<T> Beatmap;
|
protected IBeatmap Beatmap;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
protected AutoGenerator(Beatmap<T> beatmap)
|
protected AutoGenerator(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
Beatmap = beatmap;
|
Beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// <returns>An enumerable of constructed <see cref="Mod"/>s</returns>
|
/// <returns>An enumerable of constructed <see cref="Mod"/>s</returns>
|
||||||
public virtual IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods) => new Mod[] { };
|
public virtual IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods) => new Mod[] { };
|
||||||
|
|
||||||
public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
|
public ModAutoplay GetAutoplayMod() => GetAllMods().OfType<ModAutoplay>().First();
|
||||||
|
|
||||||
protected Ruleset(RulesetInfo rulesetInfo = null)
|
protected Ruleset(RulesetInfo rulesetInfo = null)
|
||||||
{
|
{
|
||||||
|
@ -89,7 +89,7 @@ namespace osu.Game.Screens
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShaderPrecompiler : Drawable
|
public class ShaderPrecompiler : Drawable
|
||||||
{
|
{
|
||||||
private readonly List<Shader> loadTargets = new List<Shader>();
|
private readonly List<IShader> loadTargets = new List<IShader>();
|
||||||
|
|
||||||
public bool FinishedCompiling { get; private set; }
|
public bool FinishedCompiling { get; private set; }
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ namespace osu.Game.Screens
|
|||||||
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
|
loadTargets.Add(manager.Load(VertexShaderDescriptor.TEXTURE_3, FragmentShaderDescriptor.TEXTURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool AllLoaded => loadTargets.All(s => s.Loaded);
|
protected virtual bool AllLoaded => loadTargets.All(s => s.IsLoaded);
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private readonly float[] frequencyAmplitudes = new float[256];
|
private readonly float[] frequencyAmplitudes = new float[256];
|
||||||
|
|
||||||
private Shader shader;
|
private IShader shader;
|
||||||
private readonly Texture texture;
|
private readonly Texture texture;
|
||||||
|
|
||||||
public LogoVisualisation()
|
public LogoVisualisation()
|
||||||
@ -131,8 +131,6 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
protected override DrawNode CreateDrawNode() => new VisualisationDrawNode();
|
protected override DrawNode CreateDrawNode() => new VisualisationDrawNode();
|
||||||
|
|
||||||
private readonly VisualiserSharedData sharedData = new VisualiserSharedData();
|
|
||||||
|
|
||||||
protected override void ApplyDrawNode(DrawNode node)
|
protected override void ApplyDrawNode(DrawNode node)
|
||||||
{
|
{
|
||||||
base.ApplyDrawNode(node);
|
base.ApplyDrawNode(node);
|
||||||
@ -142,29 +140,23 @@ namespace osu.Game.Screens.Menu
|
|||||||
visNode.Shader = shader;
|
visNode.Shader = shader;
|
||||||
visNode.Texture = texture;
|
visNode.Texture = texture;
|
||||||
visNode.Size = DrawSize.X;
|
visNode.Size = DrawSize.X;
|
||||||
visNode.Shared = sharedData;
|
|
||||||
visNode.Colour = AccentColour;
|
visNode.Colour = AccentColour;
|
||||||
visNode.AudioData = frequencyAmplitudes;
|
visNode.AudioData = frequencyAmplitudes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class VisualiserSharedData
|
|
||||||
{
|
|
||||||
public readonly QuadBatch<TexturedVertex2D> VertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class VisualisationDrawNode : DrawNode
|
private class VisualisationDrawNode : DrawNode
|
||||||
{
|
{
|
||||||
public Shader Shader;
|
public IShader Shader;
|
||||||
public Texture Texture;
|
public Texture Texture;
|
||||||
|
|
||||||
public VisualiserSharedData Shared;
|
|
||||||
|
|
||||||
//Asuming the logo is a circle, we don't need a second dimension.
|
//Asuming the logo is a circle, we don't need a second dimension.
|
||||||
public float Size;
|
public float Size;
|
||||||
|
|
||||||
public Color4 Colour;
|
public Color4 Colour;
|
||||||
public float[] AudioData;
|
public float[] AudioData;
|
||||||
|
|
||||||
|
private readonly QuadBatch<TexturedVertex2D> vertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
|
||||||
|
|
||||||
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
public override void Draw(Action<TexturedVertex2D> vertexAction)
|
||||||
{
|
{
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
@ -209,7 +201,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
rectangle,
|
rectangle,
|
||||||
colourInfo,
|
colourInfo,
|
||||||
null,
|
null,
|
||||||
Shared.VertexBatch.AddAction,
|
vertexBatch.AddAction,
|
||||||
//barSize by itself will make it smooth more in the X axis than in the Y axis, this reverts that.
|
//barSize by itself will make it smooth more in the X axis than in the Y axis, this reverts that.
|
||||||
Vector2.Divide(inflation, barSize.Yx));
|
Vector2.Divide(inflation, barSize.Yx));
|
||||||
}
|
}
|
||||||
@ -218,6 +210,13 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
Shader.Unbind();
|
Shader.Unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
vertexBatch.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,13 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
{
|
{
|
||||||
public class MultiplayerBackgroundSprite : MultiplayerComposite
|
public class MultiplayerBackgroundSprite : MultiplayerComposite
|
||||||
{
|
{
|
||||||
|
private readonly BeatmapSetCoverType beatmapSetCoverType;
|
||||||
|
|
||||||
|
public MultiplayerBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
||||||
|
{
|
||||||
|
this.beatmapSetCoverType = beatmapSetCoverType;
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -19,6 +26,6 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
|
CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both };
|
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite(beatmapSetCoverType) { RelativeSizeAxes = Axes.Both };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
@ -137,7 +138,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Width = cover_width,
|
Width = cover_width,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Margin = new MarginPadding { Left = side_strip_width },
|
Margin = new MarginPadding { Left = side_strip_width },
|
||||||
Child = new MultiplayerBackgroundSprite { RelativeSizeAxes = Axes.Both }
|
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
|
@ -28,13 +28,15 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
roomId.BindValueChanged(_ => updateChannel(), true);
|
channelId.BindValueChanged(_ => updateChannel(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateChannel()
|
private void updateChannel()
|
||||||
{
|
{
|
||||||
if (roomId.Value != null)
|
if (roomId.Value == null || channelId.Value == 0)
|
||||||
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#mp_{roomId.Value}" });
|
return;
|
||||||
|
|
||||||
|
Channel.Value = channelManager?.JoinChannel(new Channel { Id = channelId.Value, Type = ChannelType.Multiplayer, Name = $"#lazermp_{roomId.Value}" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,12 @@ namespace osu.Game.Screens.Select
|
|||||||
if (base.OnExiting(next))
|
if (base.OnExiting(next))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value?.Beatmap);
|
if (CurrentItem.Value != null)
|
||||||
Beatmap.Value.Mods.Value = selectedMods.Value = CurrentItem.Value?.RequiredMods;
|
{
|
||||||
Ruleset.Value = CurrentItem.Value?.Ruleset;
|
Ruleset.Value = CurrentItem.Value.Ruleset;
|
||||||
|
Beatmap.Value = beatmaps.GetWorkingBeatmap(CurrentItem.Value.Beatmap);
|
||||||
|
Beatmap.Value.Mods.Value = selectedMods.Value = CurrentItem.Value.RequiredMods;
|
||||||
|
}
|
||||||
|
|
||||||
Beatmap.Disabled = true;
|
Beatmap.Disabled = true;
|
||||||
Ruleset.Disabled = true;
|
Ruleset.Disabled = true;
|
||||||
|
@ -20,14 +20,14 @@ namespace osu.Game.Utils
|
|||||||
|
|
||||||
private readonly List<Task> tasks = new List<Task>();
|
private readonly List<Task> tasks = new List<Task>();
|
||||||
|
|
||||||
private Exception lastException;
|
|
||||||
|
|
||||||
public RavenLogger(OsuGame game)
|
public RavenLogger(OsuGame game)
|
||||||
{
|
{
|
||||||
raven.Release = game.Version;
|
raven.Release = game.Version;
|
||||||
|
|
||||||
if (!game.IsDeployedBuild) return;
|
if (!game.IsDeployedBuild) return;
|
||||||
|
|
||||||
|
Exception lastException = null;
|
||||||
|
|
||||||
Logger.NewEntry += entry =>
|
Logger.NewEntry += entry =>
|
||||||
{
|
{
|
||||||
if (entry.Level < LogLevel.Verbose) return;
|
if (entry.Level < LogLevel.Verbose) return;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.301.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.307.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,12 +105,12 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.301.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.307.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.301.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.307.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.208.0" ExcludeAssets="all" />
|
<PackageReference Include="ppy.osu.Framework.NativeLibs" Version="2019.307.0" ExcludeAssets="all" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -262,6 +262,7 @@
|
|||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IL/@EntryIndexedValue">IL</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IL/@EntryIndexedValue">IL</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IPC/@EntryIndexedValue">IPC</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JIT/@EntryIndexedValue">JIT</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LTRB/@EntryIndexedValue">LTRB</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LTRB/@EntryIndexedValue">LTRB</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD5</s:String>
|
||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NS/@EntryIndexedValue">NS</s:String>
|
||||||
|
Loading…
Reference in New Issue
Block a user