mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 16:03:21 +08:00
Merge branch 'master' into builder
This commit is contained in:
commit
bad501c018
@ -1 +1 @@
|
|||||||
Subproject commit eae237f6a7e2a6e7d7c621b2382bb08de2b470b8
|
Subproject commit 1cd7a165ec42cd1eeb4eee06b5a4a6cdd8c280da
|
@ -1 +1 @@
|
|||||||
Subproject commit 2a3dd3f3dd68fe52b779d0fdded3ce444897efee
|
Subproject commit 51f2b9b37f38cd349a3dd728a78f8fffcb3a54f5
|
@ -71,7 +71,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Add(flow = new FlowContainer
|
Add(flow = new FlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Direction = FlowDirection.VerticalOnly
|
Direction = FlowDirections.Vertical
|
||||||
});
|
});
|
||||||
|
|
||||||
SpriteText loading;
|
SpriteText loading;
|
||||||
|
@ -20,27 +20,22 @@ namespace osu.Desktop.Beatmaps.IO
|
|||||||
public static void Register() => AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path));
|
public static void Register() => AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path));
|
||||||
|
|
||||||
private string basePath { get; set; }
|
private string basePath { get; set; }
|
||||||
private string[] beatmaps { get; set; }
|
|
||||||
private Beatmap firstMap { get; set; }
|
private Beatmap firstMap { get; set; }
|
||||||
|
|
||||||
public LegacyFilesystemReader(string path)
|
public LegacyFilesystemReader(string path)
|
||||||
{
|
{
|
||||||
basePath = path;
|
basePath = path;
|
||||||
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
|
BeatmapFilenames = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
|
||||||
if (beatmaps.Length == 0)
|
if (BeatmapFilenames.Length == 0)
|
||||||
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
||||||
using (var stream = new StreamReader(GetStream(beatmaps[0])))
|
StoryboardFilename = Directory.GetFiles(basePath, @"*.osb").Select(f => Path.GetFileName(f)).FirstOrDefault();
|
||||||
|
using (var stream = new StreamReader(GetStream(BeatmapFilenames[0])))
|
||||||
{
|
{
|
||||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
firstMap = decoder.Decode(stream);
|
firstMap = decoder.Decode(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string[] ReadBeatmaps()
|
|
||||||
{
|
|
||||||
return beatmaps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Stream GetStream(string name)
|
public override Stream GetStream(string name)
|
||||||
{
|
{
|
||||||
return File.OpenRead(Path.Combine(basePath, name));
|
return File.OpenRead(Path.Combine(basePath, name));
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
// 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.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Modes.Objects;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Connects hit objects visually, for example with follow points.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class ConnectionRenderer<T> : Container
|
||||||
|
where T : HitObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Hit objects to create connections for
|
||||||
|
/// </summary>
|
||||||
|
public abstract IEnumerable<T> HitObjects { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
// 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.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
|
||||||
|
{
|
||||||
|
public class FollowPoint : Container
|
||||||
|
{
|
||||||
|
public double StartTime;
|
||||||
|
public double EndTime;
|
||||||
|
public Vector2 EndPosition;
|
||||||
|
|
||||||
|
const float width = 8;
|
||||||
|
|
||||||
|
public FollowPoint()
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
Alpha = 0;
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
AutoSizeAxes = Axes.Both;
|
||||||
|
CornerRadius = width / 2;
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Glow,
|
||||||
|
Colour = Color4.White.Opacity(0.2f),
|
||||||
|
Radius = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Size = new Vector2(width),
|
||||||
|
BlendingMode = BlendingMode.Additive,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Alpha = 0.5f,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
Delay(StartTime);
|
||||||
|
FadeIn(DrawableOsuHitObject.TIME_FADEIN);
|
||||||
|
ScaleTo(1.5f);
|
||||||
|
ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out);
|
||||||
|
MoveTo(EndPosition, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out);
|
||||||
|
|
||||||
|
Delay(EndTime - StartTime);
|
||||||
|
FadeOut(DrawableOsuHitObject.TIME_FADEIN);
|
||||||
|
|
||||||
|
Delay(DrawableOsuHitObject.TIME_FADEIN);
|
||||||
|
Expire(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
// 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 osu.Game.Modes.Osu.Objects.Drawables.Connections;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Osu.Objects.Drawables
|
||||||
|
{
|
||||||
|
public class FollowPointRenderer : ConnectionRenderer<OsuHitObject>
|
||||||
|
{
|
||||||
|
private int pointDistance = 32;
|
||||||
|
/// <summary>
|
||||||
|
/// Determines how much space there is between points.
|
||||||
|
/// </summary>
|
||||||
|
public int PointDistance
|
||||||
|
{
|
||||||
|
get { return pointDistance; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (pointDistance == value) return;
|
||||||
|
pointDistance = value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int preEmpt = 800;
|
||||||
|
/// <summary>
|
||||||
|
/// Follow points to the next hitobject start appearing for this many milliseconds before an hitobject's end time.
|
||||||
|
/// </summary>
|
||||||
|
public int PreEmpt
|
||||||
|
{
|
||||||
|
get { return preEmpt; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (preEmpt == value) return;
|
||||||
|
preEmpt = value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<OsuHitObject> hitObjects;
|
||||||
|
public override IEnumerable<OsuHitObject> HitObjects
|
||||||
|
{
|
||||||
|
get { return hitObjects; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
hitObjects = value;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void update()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
if (hitObjects == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
OsuHitObject prevHitObject = null;
|
||||||
|
foreach (var currHitObject in hitObjects)
|
||||||
|
{
|
||||||
|
if (prevHitObject != null && !currHitObject.NewCombo && !(prevHitObject is Spinner) && !(currHitObject is Spinner))
|
||||||
|
{
|
||||||
|
Vector2 startPosition = prevHitObject.EndPosition;
|
||||||
|
Vector2 endPosition = currHitObject.Position;
|
||||||
|
double startTime = prevHitObject.EndTime;
|
||||||
|
double endTime = currHitObject.StartTime;
|
||||||
|
|
||||||
|
Vector2 distanceVector = endPosition - startPosition;
|
||||||
|
int distance = (int)distanceVector.Length;
|
||||||
|
float rotation = (float)Math.Atan2(distanceVector.Y, distanceVector.X);
|
||||||
|
double duration = endTime - startTime;
|
||||||
|
|
||||||
|
for (int d = (int)(PointDistance * 1.5); d < distance - PointDistance; d += PointDistance)
|
||||||
|
{
|
||||||
|
float fraction = ((float)d / distance);
|
||||||
|
Vector2 pointStartPosition = startPosition + (fraction - 0.1f) * distanceVector;
|
||||||
|
Vector2 pointEndPosition = startPosition + fraction * distanceVector;
|
||||||
|
double fadeOutTime = startTime + fraction * duration;
|
||||||
|
double fadeInTime = fadeOutTime - PreEmpt;
|
||||||
|
|
||||||
|
Add(new FollowPoint()
|
||||||
|
{
|
||||||
|
StartTime = fadeInTime,
|
||||||
|
EndTime = fadeOutTime,
|
||||||
|
Position = pointStartPosition,
|
||||||
|
EndPosition = pointEndPosition,
|
||||||
|
Rotation = rotation,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prevHitObject = currHitObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -24,7 +24,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
Spacing = new Vector2(0, 2);
|
Spacing = new Vector2(0, 2);
|
||||||
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;
|
Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset;
|
||||||
|
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// 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 OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using osu.Game.Modes.Osu.Objects;
|
using osu.Game.Modes.Osu.Objects;
|
||||||
using osu.Game.Modes.Osu.Objects.Drawables;
|
using osu.Game.Modes.Osu.Objects.Drawables;
|
||||||
|
using osu.Game.Modes.Osu.Objects.Drawables.Connections;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
using OpenTK;
|
using System.Linq;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.UI
|
namespace osu.Game.Modes.Osu.UI
|
||||||
{
|
{
|
||||||
@ -15,6 +17,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
{
|
{
|
||||||
private Container approachCircles;
|
private Container approachCircles;
|
||||||
private Container judgementLayer;
|
private Container judgementLayer;
|
||||||
|
private ConnectionRenderer<OsuHitObject> connectionLayer;
|
||||||
|
|
||||||
public override Vector2 Size
|
public override Vector2 Size
|
||||||
{
|
{
|
||||||
@ -36,6 +39,11 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
|
|
||||||
Add(new Drawable[]
|
Add(new Drawable[]
|
||||||
{
|
{
|
||||||
|
connectionLayer = new FollowPointRenderer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Depth = 2,
|
||||||
|
},
|
||||||
judgementLayer = new Container
|
judgementLayer = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -63,6 +71,13 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
base.Add(h);
|
base.Add(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void PostProcess()
|
||||||
|
{
|
||||||
|
connectionLayer.HitObjects = HitObjects.Children
|
||||||
|
.Select(d => (OsuHitObject)d.HitObject)
|
||||||
|
.OrderBy(h => h.StartTime);
|
||||||
|
}
|
||||||
|
|
||||||
private void judgement(DrawableHitObject h, JudgementInfo j)
|
private void judgement(DrawableHitObject h, JudgementInfo j)
|
||||||
{
|
{
|
||||||
HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, (OsuHitObject)h.HitObject);
|
HitExplosion explosion = new HitExplosion((OsuJudgementInfo)j, (OsuHitObject)h.HitObject);
|
||||||
|
@ -46,9 +46,12 @@
|
|||||||
<Compile Include="Objects\BezierApproximator.cs" />
|
<Compile Include="Objects\BezierApproximator.cs" />
|
||||||
<Compile Include="Objects\CircularArcApproximator.cs" />
|
<Compile Include="Objects\CircularArcApproximator.cs" />
|
||||||
<Compile Include="Objects\Drawables\DrawableOsuHitObject.cs" />
|
<Compile Include="Objects\Drawables\DrawableOsuHitObject.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\Connections\ConnectionRenderer.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\Connections\FollowPointRenderer.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
|
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\CirclePiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\DrawableSlider.cs" />
|
<Compile Include="Objects\Drawables\DrawableSlider.cs" />
|
||||||
|
<Compile Include="Objects\Drawables\Connections\FollowPoint.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\ExplodePiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\ExplodePiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\FlashPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\FlashPiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\GlowPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\GlowPiece.cs" />
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
"Soleily - Renatus (MMzz) [Muzukashii].osu",
|
"Soleily - Renatus (MMzz) [Muzukashii].osu",
|
||||||
"Soleily - Renatus (MMzz) [Oni].osu"
|
"Soleily - Renatus (MMzz) [Oni].osu"
|
||||||
};
|
};
|
||||||
var maps = reader.ReadBeatmaps();
|
var maps = reader.BeatmapFilenames;
|
||||||
foreach (var map in expected)
|
foreach (var map in expected)
|
||||||
Assert.Contains(map, maps);
|
Assert.Contains(map, maps);
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding(5),
|
Padding = new MarginPadding(5),
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
@ -93,13 +93,13 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
Padding = new MarginPadding { Left = 5 },
|
Padding = new MarginPadding { Left = 5 },
|
||||||
Spacing = new Vector2(0, 5),
|
Spacing = new Vector2(0, 5),
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Spacing = new Vector2(4, 0),
|
Spacing = new Vector2(4, 0),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
},
|
},
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
|
Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 },
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
@ -113,7 +113,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Depth = -1,
|
Depth = -1,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle
|
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle
|
||||||
Shear = new Vector2(0.8f, 0),
|
Shear = new Vector2(0.8f, 0),
|
||||||
|
@ -7,6 +7,8 @@ using System.IO;
|
|||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
|
using osu.Game.Database;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Formats
|
namespace osu.Game.Beatmaps.Formats
|
||||||
{
|
{
|
||||||
@ -34,6 +36,11 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void Decode(TextReader stream, Beatmap beatmap)
|
||||||
|
{
|
||||||
|
ParseFile(stream, beatmap);
|
||||||
|
}
|
||||||
|
|
||||||
public virtual Beatmap Process(Beatmap beatmap)
|
public virtual Beatmap Process(Beatmap beatmap)
|
||||||
{
|
{
|
||||||
ApplyColours(beatmap);
|
ApplyColours(beatmap);
|
||||||
@ -41,7 +48,23 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
return beatmap;
|
return beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Beatmap ParseFile(TextReader stream);
|
protected virtual Beatmap ParseFile(TextReader stream)
|
||||||
|
{
|
||||||
|
var beatmap = new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects = new List<HitObject>(),
|
||||||
|
ControlPoints = new List<ControlPoint>(),
|
||||||
|
ComboColors = new List<Color4>(),
|
||||||
|
BeatmapInfo = new BeatmapInfo
|
||||||
|
{
|
||||||
|
Metadata = new BeatmapMetadata(),
|
||||||
|
BaseDifficulty = new BaseDifficulty(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
ParseFile(stream, beatmap);
|
||||||
|
return beatmap;
|
||||||
|
}
|
||||||
|
protected abstract void ParseFile(TextReader stream, Beatmap beatmap);
|
||||||
|
|
||||||
public virtual void ApplyColours(Beatmap b)
|
public virtual void ApplyColours(Beatmap b)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
public class ConstructableBeatmapDecoder : BeatmapDecoder
|
public class ConstructableBeatmapDecoder : BeatmapDecoder
|
||||||
{
|
{
|
||||||
protected override Beatmap ParseFile(TextReader stream)
|
protected override void ParseFile(TextReader stream, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
@ -233,20 +233,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Beatmap ParseFile(TextReader stream)
|
protected override void ParseFile(TextReader stream, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
|
||||||
{
|
|
||||||
HitObjects = new List<HitObject>(),
|
|
||||||
ControlPoints = new List<ControlPoint>(),
|
|
||||||
ComboColors = new List<Color4>(),
|
|
||||||
BeatmapInfo = new BeatmapInfo
|
|
||||||
{
|
|
||||||
Metadata = new BeatmapMetadata(),
|
|
||||||
BaseDifficulty = new BaseDifficulty(),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
HitObjectParser parser = null;
|
HitObjectParser parser = null;
|
||||||
|
|
||||||
var section = Section.None;
|
var section = Section.None;
|
||||||
@ -309,8 +297,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return beatmap;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,10 +39,17 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
/// Reads the beatmap metadata from this archive.
|
/// Reads the beatmap metadata from this archive.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract BeatmapMetadata ReadMetadata();
|
public abstract BeatmapMetadata ReadMetadata();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of beatmap file names.
|
/// Gets a list of beatmap file names.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract string[] ReadBeatmaps();
|
public string[] BeatmapFilenames { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The storyboard filename. Null if no storyboard is present.
|
||||||
|
/// </summary>
|
||||||
|
public string StoryboardFilename { get; protected set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens a stream for reading a specific file from this archive.
|
/// Opens a stream for reading a specific file from this archive.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -25,29 +25,25 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
|
|
||||||
private Stream archiveStream;
|
private Stream archiveStream;
|
||||||
private ZipFile archive;
|
private ZipFile archive;
|
||||||
private string[] beatmaps;
|
|
||||||
private Beatmap firstMap;
|
private Beatmap firstMap;
|
||||||
|
|
||||||
public OszArchiveReader(Stream archiveStream)
|
public OszArchiveReader(Stream archiveStream)
|
||||||
{
|
{
|
||||||
this.archiveStream = archiveStream;
|
this.archiveStream = archiveStream;
|
||||||
archive = ZipFile.Read(archiveStream);
|
archive = ZipFile.Read(archiveStream);
|
||||||
beatmaps = archive.Entries.Where(e => e.FileName.EndsWith(@".osu"))
|
BeatmapFilenames = archive.Entries.Where(e => e.FileName.EndsWith(@".osu"))
|
||||||
.Select(e => e.FileName).ToArray();
|
.Select(e => e.FileName).ToArray();
|
||||||
if (beatmaps.Length == 0)
|
if (BeatmapFilenames.Length == 0)
|
||||||
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
||||||
using (var stream = new StreamReader(GetStream(beatmaps[0])))
|
StoryboardFilename = archive.Entries.Where(e => e.FileName.EndsWith(@".osb"))
|
||||||
|
.Select(e => e.FileName).FirstOrDefault();
|
||||||
|
using (var stream = new StreamReader(GetStream(BeatmapFilenames[0])))
|
||||||
{
|
{
|
||||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
firstMap = decoder.Decode(stream);
|
firstMap = decoder.Decode(stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string[] ReadBeatmaps()
|
|
||||||
{
|
|
||||||
return beatmaps;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override Stream GetStream(string name)
|
public override Stream GetStream(string name)
|
||||||
{
|
{
|
||||||
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
|
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
|
||||||
|
@ -18,6 +18,8 @@ namespace osu.Game.Beatmaps
|
|||||||
public readonly BeatmapSetInfo BeatmapSetInfo;
|
public readonly BeatmapSetInfo BeatmapSetInfo;
|
||||||
private readonly BeatmapDatabase database;
|
private readonly BeatmapDatabase database;
|
||||||
|
|
||||||
|
public readonly bool WithStoryboard;
|
||||||
|
|
||||||
private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo);
|
private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo);
|
||||||
|
|
||||||
private Texture background;
|
private Texture background;
|
||||||
@ -58,8 +60,19 @@ namespace osu.Game.Beatmaps
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var reader = getReader())
|
using (var reader = getReader())
|
||||||
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path)))
|
{
|
||||||
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream);
|
BeatmapDecoder decoder;
|
||||||
|
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path)))
|
||||||
|
{
|
||||||
|
decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
|
beatmap = decoder?.Decode(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (WithStoryboard && beatmap != null && BeatmapSetInfo.StoryboardFile != null)
|
||||||
|
using (var stream = new StreamReader(reader.GetStream(BeatmapSetInfo.StoryboardFile)))
|
||||||
|
decoder?.Decode(stream, beatmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|
||||||
@ -103,11 +116,12 @@ namespace osu.Game.Beatmaps
|
|||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database)
|
public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database, bool withStoryboard = false)
|
||||||
{
|
{
|
||||||
BeatmapInfo = beatmapInfo;
|
BeatmapInfo = beatmapInfo;
|
||||||
BeatmapSetInfo = beatmapSetInfo;
|
BeatmapSetInfo = beatmapSetInfo;
|
||||||
this.database = database;
|
this.database = database;
|
||||||
|
this.WithStoryboard = withStoryboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isDisposed;
|
private bool isDisposed;
|
||||||
|
@ -125,7 +125,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
using (var reader = ArchiveReader.GetReader(storage, path))
|
using (var reader = ArchiveReader.GetReader(storage, path))
|
||||||
{
|
{
|
||||||
string[] mapNames = reader.ReadBeatmaps();
|
string[] mapNames = reader.BeatmapFilenames;
|
||||||
foreach (var name in mapNames)
|
foreach (var name in mapNames)
|
||||||
{
|
{
|
||||||
using (var stream = new StreamReader(reader.GetStream(name)))
|
using (var stream = new StreamReader(reader.GetStream(name)))
|
||||||
@ -139,6 +139,7 @@ namespace osu.Game.Database
|
|||||||
|
|
||||||
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
beatmapSet.Beatmaps.Add(beatmap.BeatmapInfo);
|
||||||
}
|
}
|
||||||
|
beatmapSet.StoryboardFile = reader.StoryboardFilename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ namespace osu.Game.Database
|
|||||||
return Query<BeatmapSetInfo>().FirstOrDefault(s => s.OnlineBeatmapSetID == id);
|
return Query<BeatmapSetInfo>().FirstOrDefault(s => s.OnlineBeatmapSetID == id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null)
|
public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap previous = null, bool withStoryboard = false)
|
||||||
{
|
{
|
||||||
var beatmapSetInfo = Query<BeatmapSetInfo>().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID);
|
var beatmapSetInfo = Query<BeatmapSetInfo>().FirstOrDefault(s => s.ID == beatmapInfo.BeatmapSetInfoID);
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ namespace osu.Game.Database
|
|||||||
if (beatmapInfo.Metadata == null)
|
if (beatmapInfo.Metadata == null)
|
||||||
beatmapInfo.Metadata = beatmapSetInfo.Metadata;
|
beatmapInfo.Metadata = beatmapSetInfo.Metadata;
|
||||||
|
|
||||||
var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this);
|
var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this, withStoryboard);
|
||||||
|
|
||||||
previous?.TransferTo(working);
|
previous?.TransferTo(working);
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ namespace osu.Game.Database
|
|||||||
public string Hash { get; set; }
|
public string Hash { get; set; }
|
||||||
|
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
public string StoryboardFile { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -83,6 +83,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
Playfield.Add(drawableObject);
|
Playfield.Add(drawableObject);
|
||||||
}
|
}
|
||||||
|
Playfield.PostProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onJudgement(DrawableHitObject o, JudgementInfo j) => TriggerOnJudgement(j);
|
private void onJudgement(DrawableHitObject o, JudgementInfo j) => TriggerOnJudgement(j);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// 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 OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
using OpenTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
@ -32,6 +32,10 @@ namespace osu.Game.Modes.UI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void PostProcess()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public class ScaledContainer : Container
|
public class ScaledContainer : Container
|
||||||
{
|
{
|
||||||
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
protected override Vector2 DrawScale => new Vector2(DrawSize.X / 512);
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Online.Chat.Drawables
|
|||||||
{
|
{
|
||||||
flow = new FlowContainer
|
flow = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Spacing = new Vector2(1, 1)
|
Spacing = new Vector2(1, 1)
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
sections = new FlowContainer<NotificationSection>
|
sections = new FlowContainer<NotificationSection>
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Children = new []
|
Children = new []
|
||||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
|
|
||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
Items = new KeyValuePair<string, T>[0];
|
Items = new KeyValuePair<string, T>[0];
|
||||||
|
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
|
|
||||||
public OptionSlider()
|
public OptionSlider()
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Padding = new MarginPadding { Right = 5 };
|
Padding = new MarginPadding { Right = 5 };
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
FlowContent = new FlowContainer
|
FlowContent = new FlowContainer
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = header_size + header_margin },
|
Margin = new MarginPadding { Top = header_size + header_margin },
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Spacing = new Vector2(0, 30),
|
Spacing = new Vector2(0, 30),
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
AddInternal(new Drawable[]
|
AddInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
},
|
},
|
||||||
content = new FlowContainer
|
content = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Spacing = new Vector2(0, 5),
|
Spacing = new Vector2(0, 5),
|
||||||
|
@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Options.Sections.General
|
|||||||
private void load(APIAccess api, OsuConfigManager config)
|
private void load(APIAccess api, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.api = api;
|
this.api = api;
|
||||||
Direction = FlowDirection.VerticalOnly;
|
Direction = FlowDirections.Vertical;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Spacing = new Vector2(0, 5);
|
Spacing = new Vector2(0, 5);
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Direction = FlowDirection.VerticalOnly
|
Direction = FlowDirections.Vertical
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -82,7 +82,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -103,7 +103,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Children = sections,
|
Children = sections,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
foreach (OptionsSection section in sections)
|
foreach (OptionsSection section in sections)
|
||||||
{
|
{
|
||||||
float distance = Math.Abs(scrollContainer.GetChildYInContent(section) - currentScroll);
|
float distance = Math.Abs(scrollContainer.GetChildPosInContent(section) - currentScroll);
|
||||||
if (distance < bestDistance)
|
if (distance < bestDistance)
|
||||||
{
|
{
|
||||||
bestDistance = distance;
|
bestDistance = distance;
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Spacing = new Vector2(0f, 50f),
|
Spacing = new Vector2(0f, 50f),
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -113,7 +113,7 @@ namespace osu.Game.Overlays.Pause
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Spacing = new Vector2(0f, 20f),
|
Spacing = new Vector2(0f, 20f),
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
new ToolbarBackground(),
|
new ToolbarBackground(),
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
},
|
},
|
||||||
Flow = new FlowContainer
|
Flow = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
|
Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 },
|
||||||
@ -107,7 +107,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
},
|
},
|
||||||
tooltipContainer = new FlowContainer
|
tooltipContainer = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
|
RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
|
||||||
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
|
Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight,
|
||||||
Origin = TooltipAnchor,
|
Origin = TooltipAnchor,
|
||||||
|
@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Padding = new MarginPadding { Left = 10, Right = 10 },
|
Padding = new MarginPadding { Left = 10, Right = 10 },
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Screens
|
|||||||
},
|
},
|
||||||
childModeButtons = new FlowContainer
|
childModeButtons = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Shadow = true,
|
Shadow = true,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
TextSize = 16,
|
TextSize = 16,
|
||||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
},
|
},
|
||||||
buttonFlow = new FlowContainerWithOrigin
|
buttonFlow = new FlowContainerWithOrigin
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Spacing = new Vector2(-WEDGE_WIDTH, 0),
|
Spacing = new Vector2(-WEDGE_WIDTH, 0),
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
public KeyCounterCollection()
|
public KeyCounterCollection()
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly;
|
Direction = FlowDirections.Horizontal;
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ namespace osu.Game.Screens.Play
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Beatmap == null)
|
if (Beatmap == null)
|
||||||
Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo);
|
Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo, withStoryboard: true);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -237,11 +237,10 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Delay(250, true);
|
Content.Delay(250);
|
||||||
Content.FadeIn(250);
|
Content.FadeIn(250);
|
||||||
|
|
||||||
Delay(500, true);
|
Delay(750);
|
||||||
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
sourceClock.Start();
|
sourceClock.Start();
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
|
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
|
Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 },
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Select
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 10 },
|
Margin = new MarginPadding { Top = 10 },
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new []
|
Children = new []
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Width = 0.4f, // TODO: InnerWidth property or something
|
Width = 0.4f, // TODO: InnerWidth property or something
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirections.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X },
|
searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X },
|
||||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
@ -207,7 +207,7 @@ namespace osu.Game.Screens.Select
|
|||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
|
@ -94,14 +94,14 @@ namespace osu.Game.Screens.Select
|
|||||||
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
|
Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0),
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Spacing = new Vector2(padding, 0),
|
Spacing = new Vector2(padding, 0),
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
|
||||||
buttons = new FlowContainer
|
buttons = new FlowContainer
|
||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirections.Horizontal,
|
||||||
Spacing = new Vector2(0.2f, 0),
|
Spacing = new Vector2(0.2f, 0),
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user