mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Merge branch 'master' of github.com:ppy/osu into peppy/hitcircle-revision-2
# Conflicts: # osu.Desktop.VisualTests/Tests/TestCasePlayer.cs # osu.Game/Beatmaps/Objects/Osu/Drawable/DrawableCircle.cs
This commit is contained in:
Submodule osu-framework updated: 2b9a56e8b3...ed33cc4899
Submodule osu-resources updated: c0781d1d55...5ce2639887
@ -57,10 +57,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
Add(new Player
|
Add(new Player
|
||||||
{
|
{
|
||||||
Beatmap = new WorkingBeatmap
|
Beatmap = new WorkingBeatmap(b)
|
||||||
{
|
|
||||||
Beatmap = b
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Desktop.Beatmaps.IO
|
|||||||
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
|
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
|
||||||
if (beatmaps.Length == 0)
|
if (beatmaps.Length == 0)
|
||||||
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
||||||
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
|
using (var stream = new StreamReader(GetStream(beatmaps[0])))
|
||||||
{
|
{
|
||||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
firstMap = decoder.Decode(stream);
|
firstMap = decoder.Decode(stream);
|
||||||
@ -41,7 +41,7 @@ namespace osu.Desktop.Beatmaps.IO
|
|||||||
return beatmaps;
|
return beatmaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Stream ReadFile(string name)
|
public override Stream GetStream(string name)
|
||||||
{
|
{
|
||||||
return File.OpenRead(Path.Combine(basePath, name));
|
return File.OpenRead(Path.Combine(basePath, name));
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
|
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
|
||||||
{
|
{
|
||||||
var reader = new OszArchiveReader(osz);
|
var reader = new OszArchiveReader(osz);
|
||||||
using (var stream = new StreamReader(
|
using (var stream = new StreamReader(
|
||||||
reader.GetStream("Soleily - Renatus (Deif) [Platter].osu")))
|
reader.GetStream("Soleily - Renatus (Deif) [Platter].osu")))
|
||||||
{
|
{
|
||||||
Assert.AreEqual("osu file format v13", stream.ReadLine().Trim());
|
Assert.AreEqual("osu file format v13", stream.ReadLine().Trim());
|
||||||
|
@ -52,7 +52,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
header.State = PanelSelectedState.Selected;
|
header.State = PanelSelectedState.Selected;
|
||||||
break;
|
break;
|
||||||
case BeatmapGroupState.Collapsed:
|
case BeatmapGroupState.Collapsed:
|
||||||
FadeTo(0.5f, 250);
|
FadeTo(0.8f, 250);
|
||||||
|
|
||||||
header.State = PanelSelectedState.NotSelected;
|
header.State = PanelSelectedState.NotSelected;
|
||||||
difficulties.Hide();
|
difficulties.Hide();
|
||||||
@ -61,7 +61,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BeatmapGroup(BeatmapSetInfo beatmapSet)
|
public BeatmapGroup(BeatmapSetInfo beatmapSet, WorkingBeatmap working)
|
||||||
{
|
{
|
||||||
this.beatmapSet = beatmapSet;
|
this.beatmapSet = beatmapSet;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirection.VerticalOnly,
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
header = new BeatmapSetHeader(beatmapSet)
|
header = new BeatmapSetHeader(beatmapSet, working)
|
||||||
{
|
{
|
||||||
GainedSelection = headerGainedSelection,
|
GainedSelection = headerGainedSelection,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
public BeatmapPanel(BeatmapInfo beatmap)
|
public BeatmapPanel(BeatmapInfo beatmap)
|
||||||
{
|
{
|
||||||
Beatmap = beatmap;
|
Beatmap = beatmap;
|
||||||
Height *= 0.75f;
|
Height *= 0.60f;
|
||||||
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
@ -44,12 +44,20 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
Padding = new MarginPadding(5),
|
Padding = new MarginPadding(5),
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirection.HorizontalOnly,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255)),
|
new DifficultyIcon(FontAwesome.dot_circle_o, new Color4(159, 198, 0, 255))
|
||||||
|
{
|
||||||
|
Scale = new Vector2(1.8f),
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
},
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
Padding = new MarginPadding { Left = 10 },
|
Padding = new MarginPadding { Left = 5 },
|
||||||
|
Spacing = new Vector2(0, 5),
|
||||||
Direction = FlowDirection.VerticalOnly,
|
Direction = FlowDirection.VerticalOnly,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
@ -58,17 +66,32 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
{
|
{
|
||||||
Direction = FlowDirection.HorizontalOnly,
|
Direction = FlowDirection.HorizontalOnly,
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Spacing = new Vector2(4, 0),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Font = @"Exo2.0-Medium",
|
||||||
Text = beatmap.Version,
|
Text = beatmap.Version,
|
||||||
TextSize = 20,
|
TextSize = 20,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
Text = $" mapped by {(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",
|
Font = @"Exo2.0-Medium",
|
||||||
|
Text = "mapped by",
|
||||||
TextSize = 16,
|
TextSize = 16,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft
|
||||||
|
},
|
||||||
|
new SpriteText
|
||||||
|
{
|
||||||
|
Font = @"Exo2.0-MediumItalic",
|
||||||
|
Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",
|
||||||
|
TextSize = 16,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -31,26 +31,17 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
Width = 0.8f;
|
Width = 0.8f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BeatmapSetHeader(BeatmapSetInfo beatmapSet)
|
public BeatmapSetHeader(BeatmapSetInfo beatmapSet, WorkingBeatmap working)
|
||||||
{
|
{
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
new Box
|
working.Background == null ? new Box{ RelativeSizeAxes = Axes.Both, Colour = new Color4(20, 20, 20, 255) } : new Sprite
|
||||||
{
|
{
|
||||||
Colour = new Color4(85, 85, 85, 255),
|
Texture = working.Background,
|
||||||
RelativeSizeAxes = Axes.Both,
|
Anchor = Anchor.Centre,
|
||||||
},
|
Origin = Anchor.Centre,
|
||||||
new Container
|
Scale = new Vector2(0.5f),
|
||||||
{
|
Colour = new Color4(200, 200, 200, 255),
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
|
||||||
{
|
|
||||||
new Box // TODO: Gradient
|
|
||||||
{
|
|
||||||
Colour = new Color4(0, 0, 0, 100),
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
@ -60,14 +51,15 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
// TODO: Make these italic
|
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Font = @"Exo2.0-SemiBoldItalic",
|
||||||
Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
|
Text = beatmapSet.Metadata.Title ?? beatmapSet.Metadata.TitleUnicode,
|
||||||
TextSize = 20
|
TextSize = 22
|
||||||
},
|
},
|
||||||
new SpriteText
|
new SpriteText
|
||||||
{
|
{
|
||||||
|
Font = @"Exo2.0-MediumItalic",
|
||||||
Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
|
Text = beatmapSet.Metadata.Artist ?? beatmapSet.Metadata.ArtistUnicode,
|
||||||
TextSize = 16
|
TextSize = 16
|
||||||
},
|
},
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.Drawable
|
namespace osu.Game.Beatmaps.Drawable
|
||||||
@ -69,7 +70,13 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 0);
|
BorderColour = new Color4(BorderColour.R, BorderColour.G, BorderColour.B, 0);
|
||||||
BorderThickness = 0;
|
BorderThickness = 0;
|
||||||
|
|
||||||
EdgeEffect = new EdgeEffect { Type = EdgeEffectType.None };
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Offset = new Vector2(1),
|
||||||
|
Radius = 10,
|
||||||
|
Colour = new Color4(0, 0, 0, 100),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnClick(InputState state)
|
protected override bool OnClick(InputState state)
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using osu.Framework.IO.Stores;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps.IO
|
namespace osu.Game.Beatmaps.IO
|
||||||
{
|
{
|
||||||
public abstract class ArchiveReader : IDisposable
|
public abstract class ArchiveReader : IDisposable, IResourceStore<byte[]>
|
||||||
{
|
{
|
||||||
private class Reader
|
private class Reader
|
||||||
{
|
{
|
||||||
@ -42,8 +43,23 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
/// <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>
|
||||||
public abstract Stream ReadFile(string name);
|
public abstract Stream GetStream(string name);
|
||||||
|
|
||||||
public abstract void Dispose();
|
public abstract void Dispose();
|
||||||
|
|
||||||
|
public virtual byte[] Get(string name)
|
||||||
|
{
|
||||||
|
using (Stream input = GetStream(name))
|
||||||
|
{
|
||||||
|
if (input == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
using (MemoryStream ms = new MemoryStream())
|
||||||
|
{
|
||||||
|
input.CopyTo(ms);
|
||||||
|
return ms.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -33,7 +33,7 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
.Select(e => e.FileName).ToArray();
|
.Select(e => e.FileName).ToArray();
|
||||||
if (beatmaps.Length == 0)
|
if (beatmaps.Length == 0)
|
||||||
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
throw new FileNotFoundException(@"This directory contains no beatmaps");
|
||||||
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
|
using (var stream = new StreamReader(GetStream(beatmaps[0])))
|
||||||
{
|
{
|
||||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
firstMap = decoder.Decode(stream);
|
firstMap = decoder.Decode(stream);
|
||||||
@ -45,7 +45,7 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
return beatmaps;
|
return beatmaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Stream ReadFile(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);
|
||||||
if (entry == null)
|
if (entry == null)
|
||||||
|
@ -171,7 +171,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Alpha = 0.5f
|
Alpha = 0.5f
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -222,7 +222,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
|||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Additive = true;
|
BlendingMode = BlendingMode.Additive;
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
@ -244,7 +244,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
|||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Additive = true;
|
BlendingMode = BlendingMode.Additive;
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
|
|
||||||
Children = new Framework.Graphics.Drawable[]
|
Children = new Framework.Graphics.Drawable[]
|
||||||
@ -283,7 +283,7 @@ namespace osu.Game.Beatmaps.Objects.Osu.Drawable
|
|||||||
},
|
},
|
||||||
triangles = new Triangles
|
triangles = new Triangles
|
||||||
{
|
{
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -13,6 +13,11 @@ namespace osu.Game.Beatmaps.Timing
|
|||||||
{
|
{
|
||||||
public double BeatLength;
|
public double BeatLength;
|
||||||
|
|
||||||
|
public TimingChange(double beatLength)
|
||||||
|
{
|
||||||
|
BeatLength = beatLength;
|
||||||
|
}
|
||||||
|
|
||||||
public double BPM => 60000 / BeatLength;
|
public double BPM => 60000 / BeatLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Beatmaps.Formats;
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osu.Game.Beatmaps.IO;
|
using osu.Game.Beatmaps.IO;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
@ -12,9 +13,30 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
public class WorkingBeatmap : IDisposable
|
public class WorkingBeatmap : IDisposable
|
||||||
{
|
{
|
||||||
public BeatmapInfo BeatmapInfo;
|
public readonly BeatmapInfo BeatmapInfo;
|
||||||
|
|
||||||
public readonly ArchiveReader Reader;
|
public readonly BeatmapSetInfo BeatmapSetInfo;
|
||||||
|
private readonly BeatmapDatabase database;
|
||||||
|
|
||||||
|
private ArchiveReader reader => database.GetReader(BeatmapSetInfo);
|
||||||
|
|
||||||
|
private Texture background;
|
||||||
|
public Texture Background
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (background != null) return background;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
background = new TextureStore(new RawTextureLoaderStore(reader)).Get(BeatmapInfo.Metadata.BackgroundFile);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
return background;
|
||||||
|
}
|
||||||
|
set { background = value; }
|
||||||
|
}
|
||||||
|
|
||||||
private Beatmap beatmap;
|
private Beatmap beatmap;
|
||||||
public Beatmap Beatmap
|
public Beatmap Beatmap
|
||||||
@ -25,7 +47,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var stream = new StreamReader(Reader.ReadFile(BeatmapInfo.Path)))
|
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path)))
|
||||||
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream);
|
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
@ -44,7 +66,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var trackData = Reader.ReadFile(BeatmapInfo.Metadata.AudioFile);
|
var trackData = reader.GetStream(BeatmapInfo.Metadata.AudioFile);
|
||||||
if (trackData != null)
|
if (trackData != null)
|
||||||
track = new AudioTrackBass(trackData);
|
track = new AudioTrackBass(trackData);
|
||||||
}
|
}
|
||||||
@ -55,10 +77,16 @@ namespace osu.Game.Beatmaps
|
|||||||
set { track = value; }
|
set { track = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkingBeatmap(BeatmapInfo beatmapInfo = null, ArchiveReader reader = null)
|
public WorkingBeatmap(Beatmap beatmap)
|
||||||
|
{
|
||||||
|
this.beatmap = beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WorkingBeatmap(BeatmapInfo beatmapInfo, BeatmapSetInfo beatmapSetInfo, BeatmapDatabase database)
|
||||||
{
|
{
|
||||||
this.BeatmapInfo = beatmapInfo;
|
this.BeatmapInfo = beatmapInfo;
|
||||||
Reader = reader;
|
this.BeatmapSetInfo = beatmapSetInfo;
|
||||||
|
this.database = database;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isDisposed;
|
private bool isDisposed;
|
||||||
@ -68,7 +96,7 @@ namespace osu.Game.Beatmaps
|
|||||||
if (!isDisposed)
|
if (!isDisposed)
|
||||||
{
|
{
|
||||||
track?.Dispose();
|
track?.Dispose();
|
||||||
Reader?.Dispose();
|
reader?.Dispose();
|
||||||
isDisposed = true;
|
isDisposed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Database
|
|||||||
string[] mapNames = reader.ReadBeatmaps();
|
string[] mapNames = reader.ReadBeatmaps();
|
||||||
foreach (var name in mapNames)
|
foreach (var name in mapNames)
|
||||||
{
|
{
|
||||||
using (var stream = new StreamReader(reader.ReadFile(name)))
|
using (var stream = new StreamReader(reader.GetStream(name)))
|
||||||
{
|
{
|
||||||
var decoder = BeatmapDecoder.GetDecoder(stream);
|
var decoder = BeatmapDecoder.GetDecoder(stream);
|
||||||
Beatmap beatmap = decoder.Decode(stream);
|
Beatmap beatmap = decoder.Decode(stream);
|
||||||
@ -149,12 +149,10 @@ namespace osu.Game.Database
|
|||||||
if (beatmapSetInfo == null)
|
if (beatmapSetInfo == null)
|
||||||
throw new InvalidOperationException($@"Beatmap set {beatmapInfo.BeatmapSetID} is not in the local database.");
|
throw new InvalidOperationException($@"Beatmap set {beatmapInfo.BeatmapSetID} is not in the local database.");
|
||||||
|
|
||||||
var reader = GetReader(beatmapSetInfo);
|
|
||||||
|
|
||||||
if (beatmapInfo.Metadata == null)
|
if (beatmapInfo.Metadata == null)
|
||||||
beatmapInfo.Metadata = beatmapSetInfo.Metadata;
|
beatmapInfo.Metadata = beatmapSetInfo.Metadata;
|
||||||
|
|
||||||
var working = new WorkingBeatmap(beatmapInfo, reader);
|
var working = new WorkingBeatmap(beatmapInfo, beatmapSetInfo, this);
|
||||||
|
|
||||||
previous?.TransferTo(working);
|
previous?.TransferTo(working);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ namespace osu.Game.GameModes
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Colour = getColourFor(GetType()),
|
Colour = getColourFor(GetType()),
|
||||||
Alpha = 1,
|
Alpha = 1,
|
||||||
Additive = false
|
BlendingMode = BlendingMode.Additive,
|
||||||
},
|
},
|
||||||
textContainer = new Container
|
textContainer = new Container
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
logo = new OsuLogo()
|
logo = new OsuLogo()
|
||||||
{
|
{
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Interactive = false,
|
Interactive = false,
|
||||||
Colour = Color4.DarkGray,
|
Colour = Color4.DarkGray,
|
||||||
Ripple = false
|
Ripple = false
|
||||||
|
@ -83,7 +83,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Alpha = 0.05f
|
Alpha = 0.05f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Size = logo.Size,
|
Size = logo.Size,
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Alpha = 0.2f,
|
Alpha = 0.2f,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,10 @@ namespace osu.Game.GameModes.Play
|
|||||||
beatmapSet = database.GetWithChildren<BeatmapSetInfo>(beatmapSet.BeatmapSetID);
|
beatmapSet = database.GetWithChildren<BeatmapSetInfo>(beatmapSet.BeatmapSetID);
|
||||||
beatmapSet.Beatmaps.ForEach(b => database.GetChildren(b));
|
beatmapSet.Beatmaps.ForEach(b => database.GetChildren(b));
|
||||||
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty).ToList();
|
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty).ToList();
|
||||||
var group = new BeatmapGroup(beatmapSet) { SelectionChanged = selectionChanged };
|
|
||||||
|
var working = database.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault());
|
||||||
|
|
||||||
|
var group = new BeatmapGroup(beatmapSet, working) { SelectionChanged = selectionChanged };
|
||||||
|
|
||||||
group.Preload(Game, g =>
|
group.Preload(Game, g =>
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ using OpenTK.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Graphics.Textures;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Background
|
namespace osu.Game.Graphics.Background
|
||||||
{
|
{
|
||||||
@ -27,8 +26,6 @@ namespace osu.Game.Graphics.Background
|
|||||||
Depth = float.MinValue;
|
Depth = float.MinValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture texture;
|
|
||||||
|
|
||||||
protected override void Load(BaseGame game)
|
protected override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
|
@ -65,9 +65,21 @@ namespace osu.Game
|
|||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBoldItalic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Bold"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
|
||||||
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));
|
||||||
|
|
||||||
API = new APIAccess()
|
API = new APIAccess()
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Overlays
|
|||||||
new ScrollContainer
|
new ScrollContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
ScrollDraggerOnLeft = true,
|
ScrollDraggerAnchor = Anchor.TopLeft,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Overlays
|
|||||||
HoverBackground = new Box
|
HoverBackground = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Additive = true,
|
BlendingMode = BlendingMode.Additive,
|
||||||
Colour = new Color4(60, 60, 60, 255),
|
Colour = new Color4(60, 60, 60, 255),
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user