mirror of
https://github.com/ppy/osu
synced 2024-12-17 04:15:37 +00:00
Merge branch 'master' into fix-editor-spinner-looping-too-long
This commit is contained in:
commit
3ec3624ac5
@ -1,20 +0,0 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="osu! (legacy osuTK)" type="DotNetProject" factoryName=".NET Project" folderName="osu!" activateToolWindowBeforeRun="false">
|
||||
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/net5.0/osu!.dll" />
|
||||
<option name="PROGRAM_PARAMETERS" value="--tk" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/net5.0" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="USE_MONO" value="0" />
|
||||
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||
<option name="PROJECT_TFM" value="net5.0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
@ -52,6 +52,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.317.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2021.323.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
|
||||
Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
|
||||
Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
|
||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
|
||||
Assert.AreEqual(3000, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
|
||||
Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Special1), "Special1 has not been pressed");
|
||||
Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Special1), "Special1 has not been released");
|
||||
}
|
||||
@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
Assert.IsTrue(generated.Frames.Count == frame_offset + 2, "Replay must have 3 frames");
|
||||
|
||||
Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect hit time");
|
||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
|
||||
Assert.AreEqual(3000, generated.Frames[frame_offset + 1].Time, "Incorrect release time");
|
||||
|
||||
Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
||||
Assert.IsFalse(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
|
||||
@ -148,9 +148,9 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
|
||||
Assert.IsTrue(generated.Frames.Count == frame_offset + 4, "Replay must have 4 generated frames");
|
||||
Assert.AreEqual(1000, generated.Frames[frame_offset].Time, "Incorrect first note hit time");
|
||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 2].Time, "Incorrect first note release time");
|
||||
Assert.AreEqual(3000, generated.Frames[frame_offset + 2].Time, "Incorrect first note release time");
|
||||
Assert.AreEqual(2000, generated.Frames[frame_offset + 1].Time, "Incorrect second note hit time");
|
||||
Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[frame_offset + 3].Time, "Incorrect second note release time");
|
||||
Assert.AreEqual(4000, generated.Frames[frame_offset + 3].Time, "Incorrect second note release time");
|
||||
Assert.IsTrue(checkContains(generated.Frames[frame_offset], ManiaAction.Key1), "Key1 has not been pressed");
|
||||
Assert.IsTrue(checkContains(generated.Frames[frame_offset + 1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
||||
Assert.IsFalse(checkContains(generated.Frames[frame_offset + 2], ManiaAction.Key1), "Key1 has not been released");
|
||||
@ -168,7 +168,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
// | | |
|
||||
|
||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 - ManiaAutoGenerator.RELEASE_DELAY });
|
||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
||||
beatmap.HitObjects.Add(new Note { StartTime = 3000, Column = 1 });
|
||||
|
||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Replays;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
|
||||
@ -85,20 +86,28 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
{
|
||||
var currentObject = Beatmap.HitObjects[i];
|
||||
var nextObjectInColumn = GetNextObject(i); // Get the next object that requires pressing the same button
|
||||
|
||||
double endTime = currentObject.GetEndTime();
|
||||
|
||||
bool canDelayKeyUp = nextObjectInColumn == null ||
|
||||
nextObjectInColumn.StartTime > endTime + RELEASE_DELAY;
|
||||
|
||||
double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextObjectInColumn.StartTime - endTime) * 0.9;
|
||||
var releaseTime = calculateReleaseTime(currentObject, nextObjectInColumn);
|
||||
|
||||
yield return new HitPoint { Time = currentObject.StartTime, Column = currentObject.Column };
|
||||
|
||||
yield return new ReleasePoint { Time = endTime + calculatedDelay, Column = currentObject.Column };
|
||||
yield return new ReleasePoint { Time = releaseTime, Column = currentObject.Column };
|
||||
}
|
||||
}
|
||||
|
||||
private double calculateReleaseTime(HitObject currentObject, HitObject nextObject)
|
||||
{
|
||||
double endTime = currentObject.GetEndTime();
|
||||
|
||||
if (currentObject is HoldNote)
|
||||
// hold note releases must be timed exactly.
|
||||
return endTime;
|
||||
|
||||
bool canDelayKeyUpFully = nextObject == null ||
|
||||
nextObject.StartTime > endTime + RELEASE_DELAY;
|
||||
|
||||
return endTime + (canDelayKeyUpFully ? RELEASE_DELAY : (nextObject.StartTime - endTime) * 0.9);
|
||||
}
|
||||
|
||||
protected override HitObject GetNextObject(int currentIndex)
|
||||
{
|
||||
int desiredColumn = Beatmap.HitObjects[currentIndex].Column;
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
{
|
||||
public class LegacyHitExplosion : LegacyManiaColumnElement, IHitExplosion
|
||||
{
|
||||
public const double FADE_IN_DURATION = 80;
|
||||
|
||||
private readonly IBindable<ScrollingDirection> direction = new Bindable<ScrollingDirection>();
|
||||
|
||||
private Drawable explosion;
|
||||
@ -72,7 +74,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
|
||||
(explosion as IFramedAnimation)?.GotoFrame(0);
|
||||
|
||||
explosion?.FadeInFromZero(80)
|
||||
explosion?.FadeInFromZero(FADE_IN_DURATION)
|
||||
.Then().FadeOut(120);
|
||||
}
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
||||
{
|
||||
if (action == column.Action.Value)
|
||||
{
|
||||
upSprite.FadeTo(1);
|
||||
downSprite.FadeTo(0);
|
||||
upSprite.Delay(LegacyHitExplosion.FADE_IN_DURATION).FadeTo(1);
|
||||
downSprite.Delay(LegacyHitExplosion.FADE_IN_DURATION).FadeTo(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,13 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";
|
||||
|
||||
[TestCase(6.9311451172608853d, "diffcalc-test")]
|
||||
[TestCase(1.0736587013228804d, "zero-length-sliders")]
|
||||
[TestCase(6.9311451172574934d, "diffcalc-test")]
|
||||
[TestCase(1.0736586907780401d, "zero-length-sliders")]
|
||||
public void Test(double expected, string name)
|
||||
=> base.Test(expected, name);
|
||||
|
||||
[TestCase(8.6228371119393064d, "diffcalc-test")]
|
||||
[TestCase(1.2864585434597433d, "zero-length-sliders")]
|
||||
[TestCase(8.6228371119271454d, "diffcalc-test")]
|
||||
[TestCase(1.2864585280364178d, "zero-length-sliders")]
|
||||
public void TestClockRateAdjusted(double expected, string name)
|
||||
=> Test(expected, name, new OsuModDoubleTime());
|
||||
|
||||
|
@ -8,6 +8,6 @@ namespace osu.Game.Online.Rooms
|
||||
public class APIScoreToken
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int ID { get; set; }
|
||||
public long ID { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
new SpriteIcon
|
||||
{
|
||||
Icon = FontAwesome.Solid.Trash,
|
||||
Icon = FontAwesome.Regular.TrashAlt,
|
||||
Size = new Vector2(14),
|
||||
},
|
||||
countText = new OsuSpriteText
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
||||
|
||||
protected readonly PlaylistItem PlaylistItem;
|
||||
|
||||
protected int? Token { get; private set; }
|
||||
protected long? Token { get; private set; }
|
||||
|
||||
[Resolved]
|
||||
private IAPIProvider api { get; set; }
|
||||
|
@ -7,7 +7,6 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
@ -462,7 +461,7 @@ namespace osu.Game.Skinning
|
||||
var sample = Samples?.Get(lookup);
|
||||
|
||||
if (sample != null)
|
||||
return new LegacySkinSample(sample, this);
|
||||
return sample;
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -505,78 +504,5 @@ namespace osu.Game.Skinning
|
||||
Textures?.Dispose();
|
||||
Samples?.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A sample wrapper which keeps a reference to the contained skin to avoid finalizer garbage collection of the managing SampleStore.
|
||||
/// </summary>
|
||||
private class LegacySkinSample : ISample, IDisposable
|
||||
{
|
||||
private readonly Sample sample;
|
||||
|
||||
[UsedImplicitly]
|
||||
private readonly LegacySkin skin;
|
||||
|
||||
public LegacySkinSample(Sample sample, LegacySkin skin)
|
||||
{
|
||||
this.sample = sample;
|
||||
this.skin = skin;
|
||||
}
|
||||
|
||||
public SampleChannel Play()
|
||||
{
|
||||
return sample.Play();
|
||||
}
|
||||
|
||||
public SampleChannel GetChannel()
|
||||
{
|
||||
return sample.GetChannel();
|
||||
}
|
||||
|
||||
public double Length => sample.Length;
|
||||
|
||||
public Bindable<int> PlaybackConcurrency => sample.PlaybackConcurrency;
|
||||
public BindableNumber<double> Volume => sample.Volume;
|
||||
|
||||
public BindableNumber<double> Balance => sample.Balance;
|
||||
|
||||
public BindableNumber<double> Frequency => sample.Frequency;
|
||||
|
||||
public BindableNumber<double> Tempo => sample.Tempo;
|
||||
|
||||
public void BindAdjustments(IAggregateAudioAdjustment component)
|
||||
{
|
||||
sample.BindAdjustments(component);
|
||||
}
|
||||
|
||||
public void UnbindAdjustments(IAggregateAudioAdjustment component)
|
||||
{
|
||||
sample.UnbindAdjustments(component);
|
||||
}
|
||||
|
||||
public void AddAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
|
||||
{
|
||||
sample.AddAdjustment(type, adjustBindable);
|
||||
}
|
||||
|
||||
public void RemoveAdjustment(AdjustableProperty type, IBindable<double> adjustBindable)
|
||||
{
|
||||
sample.RemoveAdjustment(type, adjustBindable);
|
||||
}
|
||||
|
||||
public void RemoveAllAdjustments(AdjustableProperty type)
|
||||
{
|
||||
sample.RemoveAllAdjustments(type);
|
||||
}
|
||||
|
||||
public IBindable<double> AggregateVolume => sample.AggregateVolume;
|
||||
|
||||
public IBindable<double> AggregateBalance => sample.AggregateBalance;
|
||||
|
||||
public IBindable<double> AggregateFrequency => sample.AggregateFrequency;
|
||||
|
||||
public IBindable<double> AggregateTempo => sample.AggregateTempo;
|
||||
|
||||
public void Dispose() => sample.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.NETCore.Targets" Version="3.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2021.317.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2021.323.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||
<PackageReference Include="Sentry" Version="3.0.7" />
|
||||
<PackageReference Include="SharpCompress" Version="0.28.1" />
|
||||
|
@ -70,7 +70,7 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.317.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2021.323.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2021.211.1" />
|
||||
</ItemGroup>
|
||||
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
|
||||
@ -93,7 +93,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2021.317.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2021.323.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.28.1" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user