1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:43:19 +08:00

Merge branch 'master' into fix-combo-colours

This commit is contained in:
ekrctb 2018-08-16 10:45:54 +09:00 committed by GitHub
commit cf4cb934cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 18 deletions

View File

@ -168,7 +168,6 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
{ {
StartTime = obj.StartTime, StartTime = obj.StartTime,
Samples = obj.Samples, Samples = obj.Samples,
IsStrong = strong,
Duration = endTimeData.Duration, Duration = endTimeData.Duration,
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier) RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier)
}; };

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2018 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 System;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Taiko.Objects namespace osu.Game.Rulesets.Taiko.Objects
@ -16,6 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// </summary> /// </summary>
public int RequiredHits = 10; public int RequiredHits = 10;
public override bool IsStrong { set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject."); }
protected override void CreateNestedHitObjects() protected override void CreateNestedHitObjects()
{ {
base.CreateNestedHitObjects(); base.CreateNestedHitObjects();

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
/// Whether this HitObject is a "strong" type. /// Whether this HitObject is a "strong" type.
/// Strong hit objects give more points for hitting the hit object with both keys. /// Strong hit objects give more points for hitting the hit object with both keys.
/// </summary> /// </summary>
public bool IsStrong; public virtual bool IsStrong { get; set; }
protected override void CreateNestedHitObjects() protected override void CreateNestedHitObjects()
{ {

View File

@ -3,6 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using JetBrains.Annotations;
using NUnit.Framework; using NUnit.Framework;
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
@ -116,7 +117,7 @@ namespace osu.Game.Tests.Visual
private void testNullBeatmap() private void testNullBeatmap()
{ {
selectNullBeatmap(); selectBeatmap(null);
AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text)); AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text));
AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title); AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title);
AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist); AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist);
@ -124,28 +125,19 @@ namespace osu.Game.Tests.Visual
AddAssert("check no info labels", () => !infoWedge.Info.InfoLabelContainer.Children.Any()); AddAssert("check no info labels", () => !infoWedge.Info.InfoLabelContainer.Children.Any());
} }
private void selectBeatmap(IBeatmap b) private void selectBeatmap([CanBeNull] IBeatmap b)
{ {
BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null; BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null;
AddStep($"select {b.Metadata.Title} beatmap", () => AddStep($"select {b?.Metadata.Title ?? "null"} beatmap", () =>
{ {
infoBefore = infoWedge.Info; infoBefore = infoWedge.Info;
infoWedge.Beatmap = Beatmap.Value = new TestWorkingBeatmap(b); infoWedge.Beatmap = Beatmap.Value = b == null ? Beatmap.Default : new TestWorkingBeatmap(b);
}); });
AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load"); AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load");
} }
private void selectNullBeatmap()
{
AddStep("select null beatmap", () =>
{
Beatmap.Value = Beatmap.Default;
infoWedge.Beatmap = Beatmap;
});
}
private IBeatmap createTestBeatmap(RulesetInfo ruleset) private IBeatmap createTestBeatmap(RulesetInfo ruleset)
{ {
List<HitObject> objects = new List<HitObject>(); List<HitObject> objects = new List<HitObject>();

View File

@ -329,7 +329,7 @@ namespace osu.Game.Beatmaps
return; return;
} }
await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs")), TaskCreationOptions.LongRunning); await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning);
} }
/// <summary> /// <summary>

View File

@ -412,7 +412,7 @@ namespace osu.Game.Database
private ArchiveReader getReaderFrom(string path) private ArchiveReader getReaderFrom(string path)
{ {
if (ZipUtils.IsZipArchive(path)) if (ZipUtils.IsZipArchive(path))
return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); return new ZipArchiveReader(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read), Path.GetFileName(path));
if (Directory.Exists(path)) if (Directory.Exists(path))
return new LegacyFilesystemReader(path); return new LegacyFilesystemReader(path);
throw new InvalidFormatException($"{path} is not a valid archive"); throw new InvalidFormatException($"{path} is not a valid archive");

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.1" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="2018.806.0" /> <PackageReference Include="ppy.osu.Framework" Version="2018.815.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" /> <PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.10.1" /> <PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />