mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 23:23:18 +08:00
Merge branch 'master' into better-notification-delays
This commit is contained in:
commit
3bfa6bd9fd
@ -1 +1 @@
|
|||||||
Subproject commit 46d4704b0a3f140fa8ad10ca0b1553b67d8385ab
|
Subproject commit 10cae790c6f1d559c326f9438958d0b012d61dc6
|
@ -1 +1 @@
|
|||||||
Subproject commit 4287ee8043fb1419017359bc3a5db5dc06bc643f
|
Subproject commit e01f71160fb9b3167efcd177c7d7dba9e5d36604
|
@ -135,8 +135,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SharpCompress, Version=0.18.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
<Reference Include="SharpCompress, Version=0.18.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
||||||
|
@ -6,7 +6,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" />
|
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" />
|
||||||
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
|
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
||||||
<package id="Splat" version="2.0.0" targetFramework="net45" />
|
<package id="Splat" version="2.0.0" targetFramework="net45" />
|
||||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -36,8 +36,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -37,8 +37,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -2,7 +2,6 @@
|
|||||||
// 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.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
@ -13,7 +12,7 @@ namespace osu.Game.Rulesets.Taiko.Audio
|
|||||||
public class DrumSampleMapping
|
public class DrumSampleMapping
|
||||||
{
|
{
|
||||||
private readonly ControlPointInfo controlPoints;
|
private readonly ControlPointInfo controlPoints;
|
||||||
private readonly Dictionary<SampleControlPoint, DrumSample> mappings = new Dictionary<SampleControlPoint, DrumSample>();
|
private readonly Dictionary<double, DrumSample> mappings = new Dictionary<double, DrumSample>();
|
||||||
|
|
||||||
public DrumSampleMapping(ControlPointInfo controlPoints, AudioManager audio)
|
public DrumSampleMapping(ControlPointInfo controlPoints, AudioManager audio)
|
||||||
{
|
{
|
||||||
@ -26,17 +25,17 @@ namespace osu.Game.Rulesets.Taiko.Audio
|
|||||||
else
|
else
|
||||||
samplePoints = controlPoints.SamplePoints;
|
samplePoints = controlPoints.SamplePoints;
|
||||||
|
|
||||||
foreach (var s in samplePoints.Distinct())
|
foreach (var s in samplePoints)
|
||||||
{
|
{
|
||||||
mappings[s] = new DrumSample
|
mappings[s.Time] = new DrumSample
|
||||||
{
|
{
|
||||||
Centre = s.GetSampleInfo().GetChannel(audio.Sample),
|
Centre = s.GetSampleInfo().GetChannel(audio.Sample, "Taiko"),
|
||||||
Rim = s.GetSampleInfo(SampleInfo.HIT_CLAP).GetChannel(audio.Sample)
|
Rim = s.GetSampleInfo(SampleInfo.HIT_CLAP).GetChannel(audio.Sample, "Taiko")
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrumSample SampleAt(double time) => mappings[controlPoints.SamplePointAt(time)];
|
public DrumSample SampleAt(double time) => mappings[controlPoints.SamplePointAt(time).Time];
|
||||||
|
|
||||||
public class DrumSample
|
public class DrumSample
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
|||||||
// Normal and clap samples are handled by the drum
|
// Normal and clap samples are handled by the drum
|
||||||
protected override IEnumerable<SampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != SampleInfo.HIT_NORMAL && s.Name != SampleInfo.HIT_CLAP);
|
protected override IEnumerable<SampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != SampleInfo.HIT_NORMAL && s.Name != SampleInfo.HIT_CLAP);
|
||||||
|
|
||||||
|
protected override string SampleNamespace => "Taiko";
|
||||||
|
|
||||||
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece();
|
protected virtual TaikoPiece CreateMainPiece() => new CirclePiece();
|
||||||
|
|
||||||
public abstract bool OnPressed(TaikoAction action);
|
public abstract bool OnPressed(TaikoAction action);
|
||||||
|
@ -3,9 +3,6 @@
|
|||||||
|
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Game.Audio;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
|
||||||
@ -75,13 +72,7 @@ namespace osu.Game.Rulesets.Taiko.Objects
|
|||||||
FirstTick = first,
|
FirstTick = first,
|
||||||
TickSpacing = tickSpacing,
|
TickSpacing = tickSpacing,
|
||||||
StartTime = t,
|
StartTime = t,
|
||||||
IsStrong = IsStrong,
|
IsStrong = IsStrong
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
|
||||||
{
|
|
||||||
Bank = s.Bank,
|
|
||||||
Name = @"slidertick",
|
|
||||||
Volume = s.Volume
|
|
||||||
}))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
first = false;
|
first = false;
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
|||||||
{
|
{
|
||||||
foreach (var tick in drumRoll.NestedHitObjects.OfType<DrumRollTick>())
|
foreach (var tick in drumRoll.NestedHitObjects.OfType<DrumRollTick>())
|
||||||
{
|
{
|
||||||
Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Left1 : ReplayButtonState.Left2));
|
Frames.Add(new ReplayFrame(tick.StartTime, null, null, hitButton ? ReplayButtonState.Right1 : ReplayButtonState.Right2));
|
||||||
hitButton = !hitButton;
|
hitButton = !hitButton;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
44
osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs
Normal file
44
osu.Game.Rulesets.Taiko/Tests/TestCaseInputDrum.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using OpenTK;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Rulesets.Taiko.Audio;
|
||||||
|
using osu.Game.Rulesets.Taiko.UI;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Taiko.Tests
|
||||||
|
{
|
||||||
|
[Ignore("getting CI working")]
|
||||||
|
public class TestCaseInputDrum : OsuTestCase
|
||||||
|
{
|
||||||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(InputDrum),
|
||||||
|
typeof(DrumSampleMapping),
|
||||||
|
typeof(SampleInfo),
|
||||||
|
typeof(SampleControlPoint)
|
||||||
|
};
|
||||||
|
|
||||||
|
public TestCaseInputDrum()
|
||||||
|
{
|
||||||
|
Add(new TaikoInputManager(new RulesetInfo { ID = 1 })
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Size = new Vector2(200),
|
||||||
|
Child = new InputDrum(new ControlPointInfo())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -152,14 +152,14 @@ namespace osu.Game.Rulesets.Taiko.UI
|
|||||||
target = centreHit;
|
target = centreHit;
|
||||||
back = centre;
|
back = centre;
|
||||||
|
|
||||||
drumSample.Centre.Play();
|
drumSample.Centre?.Play();
|
||||||
}
|
}
|
||||||
else if (action == RimAction)
|
else if (action == RimAction)
|
||||||
{
|
{
|
||||||
target = rimHit;
|
target = rimHit;
|
||||||
back = rim;
|
back = rim;
|
||||||
|
|
||||||
drumSample.Rim.Play();
|
drumSample.Rim?.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target != null)
|
if (target != null)
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@ -83,6 +83,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
|
<Compile Include="Scoring\TaikoScoreProcessor.cs" />
|
||||||
<Compile Include="TaikoInputManager.cs" />
|
<Compile Include="TaikoInputManager.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseInputDrum.cs" />
|
||||||
<Compile Include="Tests\TestCasePerformancePoints.cs" />
|
<Compile Include="Tests\TestCasePerformancePoints.cs" />
|
||||||
<Compile Include="Tests\TestCaseTaikoPlayfield.cs" />
|
<Compile Include="Tests\TestCaseTaikoPlayfield.cs" />
|
||||||
<Compile Include="UI\HitTarget.cs" />
|
<Compile Include="UI\HitTarget.cs" />
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -1,6 +1,7 @@
|
|||||||
// 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 System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -16,6 +17,15 @@ namespace osu.Game.Tests.Visual
|
|||||||
private readonly NotificationOverlay manager;
|
private readonly NotificationOverlay manager;
|
||||||
private readonly List<ProgressNotification> progressingNotifications = new List<ProgressNotification>();
|
private readonly List<ProgressNotification> progressingNotifications = new List<ProgressNotification>();
|
||||||
|
|
||||||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(Notification),
|
||||||
|
typeof(ProgressNotification),
|
||||||
|
typeof(ProgressCompletionNotification),
|
||||||
|
typeof(SimpleNotification),
|
||||||
|
typeof(IHasCompletionTarget),
|
||||||
|
};
|
||||||
|
|
||||||
public TestCaseNotificationOverlay()
|
public TestCaseNotificationOverlay()
|
||||||
{
|
{
|
||||||
progressingNotifications.Clear();
|
progressingNotifications.Clear();
|
||||||
|
@ -37,8 +37,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
@ -6,6 +6,6 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="DeepEqual" version="1.6.0.0" targetFramework="net461" />
|
<package id="DeepEqual" version="1.6.0.0" targetFramework="net461" />
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
||||||
</packages>
|
</packages>
|
@ -2,6 +2,7 @@
|
|||||||
// 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 System;
|
||||||
|
using System.IO;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
|
|
||||||
namespace osu.Game.Audio
|
namespace osu.Game.Audio
|
||||||
@ -14,10 +15,20 @@ namespace osu.Game.Audio
|
|||||||
public const string HIT_NORMAL = @"hitnormal";
|
public const string HIT_NORMAL = @"hitnormal";
|
||||||
public const string HIT_CLAP = @"hitclap";
|
public const string HIT_CLAP = @"hitclap";
|
||||||
|
|
||||||
public SampleChannel GetChannel(SampleManager manager)
|
public SampleChannel GetChannel(SampleManager manager, string resourceNamespace = null)
|
||||||
{
|
{
|
||||||
var channel = manager.Get($"Gameplay/{Bank}-{Name}");
|
SampleChannel channel = null;
|
||||||
|
|
||||||
|
if (resourceNamespace != null)
|
||||||
|
channel = manager.Get(Path.Combine("Gameplay", resourceNamespace, $"{Bank}-{Name}"));
|
||||||
|
|
||||||
|
// try without namespace as a fallback.
|
||||||
|
if (channel == null)
|
||||||
|
channel = manager.Get(Path.Combine("Gameplay", $"{Bank}-{Name}"));
|
||||||
|
|
||||||
|
if (channel != null)
|
||||||
channel.Volume.Value = Volume / 100.0;
|
channel.Volume.Value = Volume / 100.0;
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The default sample volume at this control point.
|
/// The default sample volume at this control point.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SampleVolume;
|
public int SampleVolume = 100;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a SampleInfo based on the sample settings in this control point.
|
/// Create a SampleInfo based on the sample settings in this control point.
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Screens;
|
|||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
@ -222,15 +223,7 @@ namespace osu.Game
|
|||||||
Depth = -6,
|
Depth = -6,
|
||||||
}, overlayContent.Add);
|
}, overlayContent.Add);
|
||||||
|
|
||||||
Logger.NewEntry += entry =>
|
forwardLoggedErrorsToNotifications();
|
||||||
{
|
|
||||||
if (entry.Level < LogLevel.Important) return;
|
|
||||||
|
|
||||||
notifications.Post(new SimpleNotification
|
|
||||||
{
|
|
||||||
Text = $@"{entry.Level}: {entry.Message}"
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
dependencies.Cache(settings);
|
dependencies.Cache(settings);
|
||||||
dependencies.Cache(social);
|
dependencies.Cache(social);
|
||||||
@ -307,6 +300,36 @@ namespace osu.Game
|
|||||||
Cursor.State = Visibility.Hidden;
|
Cursor.State = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void forwardLoggedErrorsToNotifications()
|
||||||
|
{
|
||||||
|
int recentErrorCount = 0;
|
||||||
|
|
||||||
|
const double debounce = 5000;
|
||||||
|
|
||||||
|
Logger.NewEntry += entry =>
|
||||||
|
{
|
||||||
|
if (entry.Level < LogLevel.Error || entry.Target == null) return;
|
||||||
|
|
||||||
|
if (recentErrorCount < 2)
|
||||||
|
{
|
||||||
|
notifications.Post(new SimpleNotification
|
||||||
|
{
|
||||||
|
Icon = FontAwesome.fa_bomb,
|
||||||
|
Text = (recentErrorCount == 0 ? entry.Message : "Subsequent errors occurred and have been logged.") + "\nClick to view log files.",
|
||||||
|
Activated = () =>
|
||||||
|
{
|
||||||
|
Host.Storage.GetStorageForDirectory("logs").OpenInNativeExplorer();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Interlocked.Increment(ref recentErrorCount);
|
||||||
|
|
||||||
|
Scheduler.AddDelayed(() => Interlocked.Decrement(ref recentErrorCount), debounce);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private Task asyncLoadStream;
|
private Task asyncLoadStream;
|
||||||
|
|
||||||
private void loadComponentSingleFile<T>(T d, Action<T> add)
|
private void loadComponentSingleFile<T>(T d, Action<T> add)
|
||||||
|
@ -177,8 +177,7 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
catch (MigrationFailedException e)
|
catch (MigrationFailedException e)
|
||||||
{
|
{
|
||||||
Logger.Log((e.InnerException ?? e).ToString(), LoggingTarget.Database, LogLevel.Error);
|
Logger.Error(e.InnerException ?? e, "Migration failed! We'll be starting with a fresh database.", LoggingTarget.Database);
|
||||||
Logger.Log("Migration failed! We'll be starting with a fresh database.", LoggingTarget.Database, LogLevel.Error);
|
|
||||||
|
|
||||||
// if we failed, let's delete the database and start fresh.
|
// if we failed, let's delete the database and start fresh.
|
||||||
// todo: we probably want a better (non-destructive) migrations/recovery process at a later point than this.
|
// todo: we probably want a better (non-destructive) migrations/recovery process at a later point than this.
|
||||||
|
@ -111,10 +111,13 @@ namespace osu.Game.Overlays
|
|||||||
private int runningDepth;
|
private int runningDepth;
|
||||||
|
|
||||||
private void notificationClosed()
|
private void notificationClosed()
|
||||||
|
{
|
||||||
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
// hide ourselves if all notifications have been dismissed.
|
// hide ourselves if all notifications have been dismissed.
|
||||||
if (totalCount == 0)
|
if (totalCount == 0)
|
||||||
State = Visibility.Hidden;
|
State = Visibility.Hidden;
|
||||||
|
});
|
||||||
|
|
||||||
updateCounts();
|
updateCounts();
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,6 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Padding = new MarginPadding
|
Padding = new MarginPadding
|
||||||
{
|
{
|
||||||
Top = 5,
|
|
||||||
Left = 45,
|
Left = 45,
|
||||||
Right = 30
|
Right = 30
|
||||||
},
|
},
|
||||||
|
@ -95,8 +95,8 @@ namespace osu.Game.Overlays.Notifications
|
|||||||
|
|
||||||
protected virtual void Completed()
|
protected virtual void Completed()
|
||||||
{
|
{
|
||||||
base.Close();
|
|
||||||
CompletionTarget?.Invoke(CreateCompletionNotification());
|
CompletionTarget?.Invoke(CreateCompletionNotification());
|
||||||
|
base.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool DisplayOnTop => false;
|
public override bool DisplayOnTop => false;
|
||||||
|
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Log($"Could not load this beatmap sucessfully ({e})!", LoggingTarget.Runtime, LogLevel.Error);
|
Logger.Error(e, "Could not load beatmap sucessfully!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,6 +74,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
protected List<SampleChannel> Samples = new List<SampleChannel>();
|
protected List<SampleChannel> Samples = new List<SampleChannel>();
|
||||||
protected virtual IEnumerable<SampleInfo> GetSamples() => HitObject.Samples;
|
protected virtual IEnumerable<SampleInfo> GetSamples() => HitObject.Samples;
|
||||||
|
|
||||||
|
// Todo: Rulesets should be overriding the resources instead, but we need to figure out where/when to apply overrides first
|
||||||
|
protected virtual string SampleNamespace => null;
|
||||||
|
|
||||||
public readonly Bindable<ArmedState> State = new Bindable<ArmedState>();
|
public readonly Bindable<ArmedState> State = new Bindable<ArmedState>();
|
||||||
|
|
||||||
protected DrawableHitObject(TObject hitObject)
|
protected DrawableHitObject(TObject hitObject)
|
||||||
@ -101,7 +104,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
Volume = s.Volume > 0 ? s.Volume : HitObject.SampleControlPoint.SampleVolume
|
Volume = s.Volume > 0 ? s.Volume : HitObject.SampleControlPoint.SampleVolume
|
||||||
};
|
};
|
||||||
|
|
||||||
SampleChannel channel = localSampleInfo.GetChannel(audio.Sample);
|
SampleChannel channel = localSampleInfo.GetChannel(audio.Sample, SampleNamespace);
|
||||||
|
|
||||||
if (channel == null)
|
if (channel == null)
|
||||||
continue;
|
continue;
|
||||||
|
@ -47,6 +47,8 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
if (Beatmap.Value == null)
|
if (Beatmap.Value == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Beatmap.Value.Track.Length == double.PositiveInfinity) return;
|
||||||
|
|
||||||
float markerPos = MathHelper.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth);
|
float markerPos = MathHelper.Clamp(ToLocalSpace(screenPosition).X, 0, DrawWidth);
|
||||||
seekTo(markerPos / DrawWidth * Beatmap.Value.Track.Length);
|
seekTo(markerPos / DrawWidth * Beatmap.Value.Track.Length);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,8 @@ namespace osu.Game.Screens.Play
|
|||||||
public bool HasFailed { get; private set; }
|
public bool HasFailed { get; private set; }
|
||||||
|
|
||||||
public bool AllowPause { get; set; } = true;
|
public bool AllowPause { get; set; } = true;
|
||||||
|
public bool AllowLeadIn { get; set; } = true;
|
||||||
|
public bool AllowResults { get; set; } = true;
|
||||||
|
|
||||||
public int RestartCount;
|
public int RestartCount;
|
||||||
|
|
||||||
@ -125,7 +127,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Logger.Log($"Could not load this beatmap sucessfully ({e})!", LoggingTarget.Runtime, LogLevel.Error);
|
Logger.Error(e, "Could not load beatmap sucessfully!");
|
||||||
|
|
||||||
//couldn't load, hard abort!
|
//couldn't load, hard abort!
|
||||||
Exit();
|
Exit();
|
||||||
@ -136,7 +138,10 @@ namespace osu.Game.Screens.Play
|
|||||||
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
decoupledClock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
||||||
|
|
||||||
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
|
var firstObjectTime = RulesetContainer.Objects.First().StartTime;
|
||||||
decoupledClock.Seek(Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn)));
|
decoupledClock.Seek(AllowLeadIn
|
||||||
|
? Math.Min(0, firstObjectTime - Math.Max(beatmap.ControlPointInfo.TimingPointAt(firstObjectTime).BeatLength * 4, beatmap.BeatmapInfo.AudioLeadIn))
|
||||||
|
: firstObjectTime);
|
||||||
|
|
||||||
decoupledClock.ProcessFrame();
|
decoupledClock.ProcessFrame();
|
||||||
|
|
||||||
offsetClock = new FramedOffsetClock(decoupledClock);
|
offsetClock = new FramedOffsetClock(decoupledClock);
|
||||||
@ -273,6 +278,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
ValidForResume = false;
|
ValidForResume = false;
|
||||||
|
|
||||||
|
if (!AllowResults) return;
|
||||||
|
|
||||||
using (BeginDelayedSequence(1000))
|
using (BeginDelayedSequence(1000))
|
||||||
{
|
{
|
||||||
onCompletionEvent = Schedule(delegate
|
onCompletionEvent = Schedule(delegate
|
||||||
|
@ -250,7 +250,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
},
|
},
|
||||||
new MetadataLine("Mapper", metadata.Author.Username)
|
new MetadataLine("Mapper", metadata.AuthorString)
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -444,7 +444,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false)
|
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false)
|
||||||
Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo);
|
Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo);
|
||||||
else
|
else if (Carousel.SelectedBeatmapSet == null)
|
||||||
Carousel.SelectNextRandom();
|
Carousel.SelectNextRandom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,6 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
|
|
||||||
protected override Beatmap GetBeatmap() => beatmap;
|
protected override Beatmap GetBeatmap() => beatmap;
|
||||||
protected override Texture GetBackground() => null;
|
protected override Texture GetBackground() => null;
|
||||||
protected override Track GetTrack() => null;
|
protected override Track GetTrack() => new TrackVirtual();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
protected Player Player;
|
protected Player Player;
|
||||||
|
|
||||||
|
private TestWorkingBeatmap working;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a TestCase which runs through the Player screen.
|
/// Create a TestCase which runs through the Player screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -75,7 +77,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
var instance = r.CreateInstance();
|
var instance = r.CreateInstance();
|
||||||
|
|
||||||
WorkingBeatmap working = new TestWorkingBeatmap(beatmap);
|
working = new TestWorkingBeatmap(beatmap);
|
||||||
working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) };
|
working.Mods.Value = new[] { instance.GetAllMods().First(m => m is ModNoFail) };
|
||||||
|
|
||||||
if (Player != null)
|
if (Player != null)
|
||||||
@ -88,10 +90,21 @@ namespace osu.Game.Tests.Visual
|
|||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
if (working != null)
|
||||||
|
// note that this will override any mod rate application
|
||||||
|
working.Track.Rate = Clock.Rate;
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
|
protected virtual Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) => new Player
|
||||||
{
|
{
|
||||||
InitialBeatmap = beatmap,
|
InitialBeatmap = beatmap,
|
||||||
AllowPause = false
|
AllowPause = false,
|
||||||
|
AllowLeadIn = false,
|
||||||
|
AllowResults = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
private const string test_beatmap_data =
|
private const string test_beatmap_data =
|
||||||
|
@ -143,8 +143,8 @@
|
|||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
|
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
||||||
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00009\lib\net20\OpenTK.dll</HintPath>
|
<HintPath>$(SolutionDir)\packages\OpenTK.3.0.0-git00021\lib\net20\OpenTK.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Remotion.Linq, Version=2.1.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
|
<Reference Include="Remotion.Linq, Version=2.1.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
|
||||||
|
@ -66,7 +66,7 @@ Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/maste
|
|||||||
<package id="Microsoft.Extensions.Primitives" version="2.0.0" targetFramework="net461" />
|
<package id="Microsoft.Extensions.Primitives" version="2.0.0" targetFramework="net461" />
|
||||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
||||||
<package id="OpenTK" version="3.0.0-git00009" targetFramework="net461" />
|
<package id="OpenTK" version="3.0.0-git00021" targetFramework="net461" />
|
||||||
<package id="Remotion.Linq" version="2.1.2" targetFramework="net461" />
|
<package id="Remotion.Linq" version="2.1.2" targetFramework="net461" />
|
||||||
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
||||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
||||||
|
Loading…
Reference in New Issue
Block a user