mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:43:01 +08:00
Merge branch 'master' into fix-spinner-rewind-crash
This commit is contained in:
commit
692ca87bec
@ -52,6 +52,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.1001.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.1004.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
if (!result.Type.AffectsCombo() || !result.HasResult)
|
||||
return;
|
||||
|
||||
if (result.Type == HitResult.Miss)
|
||||
if (!result.IsHit)
|
||||
{
|
||||
updateCombo(0, null);
|
||||
return;
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -13,7 +14,8 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
{
|
||||
public class TestSceneHoldNote : ManiaHitObjectTestScene
|
||||
{
|
||||
public TestSceneHoldNote()
|
||||
[Test]
|
||||
public void TestHoldNote()
|
||||
{
|
||||
AddToggleStep("toggle hitting", v =>
|
||||
{
|
||||
|
@ -28,25 +28,33 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
[TestFixture]
|
||||
public class TestSceneNotes : OsuTestScene
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
[Test]
|
||||
public void TestVariousNotes()
|
||||
{
|
||||
Child = new FillFlowContainer
|
||||
DrawableNote note1 = null;
|
||||
DrawableNote note2 = null;
|
||||
DrawableHoldNote holdNote1 = null;
|
||||
DrawableHoldNote holdNote2 = null;
|
||||
|
||||
AddStep("create notes", () =>
|
||||
{
|
||||
Clock = new FramedClock(new ManualClock()),
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(20),
|
||||
Children = new[]
|
||||
Child = new FillFlowContainer
|
||||
{
|
||||
createNoteDisplay(ScrollingDirection.Down, 1, out var note1),
|
||||
createNoteDisplay(ScrollingDirection.Up, 2, out var note2),
|
||||
createHoldNoteDisplay(ScrollingDirection.Down, 1, out var holdNote1),
|
||||
createHoldNoteDisplay(ScrollingDirection.Up, 2, out var holdNote2),
|
||||
}
|
||||
};
|
||||
Clock = new FramedClock(new ManualClock()),
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Horizontal,
|
||||
Spacing = new Vector2(20),
|
||||
Children = new[]
|
||||
{
|
||||
createNoteDisplay(ScrollingDirection.Down, 1, out note1),
|
||||
createNoteDisplay(ScrollingDirection.Up, 2, out note2),
|
||||
createHoldNoteDisplay(ScrollingDirection.Down, 1, out holdNote1),
|
||||
createHoldNoteDisplay(ScrollingDirection.Up, 2, out holdNote2),
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
AddAssert("note 1 facing downwards", () => verifyAnchors(note1, Anchor.y2));
|
||||
AddAssert("note 2 facing upwards", () => verifyAnchors(note2, Anchor.y0));
|
||||
|
@ -2,10 +2,40 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Judgements
|
||||
{
|
||||
public class ManiaJudgement : Judgement
|
||||
{
|
||||
protected override double HealthIncreaseFor(HitResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case HitResult.LargeTickHit:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
|
||||
case HitResult.LargeTickMiss:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
|
||||
case HitResult.Meh:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.Ok:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.3;
|
||||
|
||||
case HitResult.Good:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
|
||||
case HitResult.Great:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.8;
|
||||
|
||||
case HitResult.Perfect:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
default:
|
||||
return base.HealthIncreaseFor(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
endHold();
|
||||
}
|
||||
|
||||
if (Tail.Result.Type == HitResult.Miss)
|
||||
if (Tail.Judged && !Tail.IsHit)
|
||||
HasBroken = true;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ using osu.Framework.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
{
|
||||
@ -136,7 +135,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
/// <summary>
|
||||
/// Causes this <see cref="DrawableManiaHitObject"/> to get missed, disregarding all conditions in implementations of <see cref="DrawableHitObject.CheckForResult"/>.
|
||||
/// </summary>
|
||||
public void MissForcefully() => ApplyResult(r => r.Type = HitResult.Miss);
|
||||
public void MissForcefully() => ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
}
|
||||
|
||||
public abstract class DrawableManiaHitObject<TObject> : DrawableManiaHitObject
|
||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
private int depthIndex;
|
||||
|
||||
public TestSceneHitCircle()
|
||||
[Test]
|
||||
public void TestVariousHitCircles()
|
||||
{
|
||||
AddStep("Miss Big Single", () => SetContents(() => testSingle(2)));
|
||||
AddStep("Miss Medium Single", () => SetContents(() => testSingle(5)));
|
||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
HitObjects = { new HitCircle { Position = new Vector2(256, 192) } }
|
||||
},
|
||||
PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset < -hitWindows.WindowFor(HitResult.Meh) && Player.Results[0].Type == HitResult.Miss
|
||||
PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset < -hitWindows.WindowFor(HitResult.Meh) && !Player.Results[0].IsHit
|
||||
});
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
Autoplay = false,
|
||||
Beatmap = beatmap,
|
||||
PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset >= hitWindows.WindowFor(HitResult.Meh) && Player.Results[0].Type == HitResult.Miss
|
||||
PassCondition = () => Player.Results.Count > 0 && Player.Results[0].TimeOffset >= hitWindows.WindowFor(HitResult.Meh) && !Player.Results[0].IsHit
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
{
|
||||
private int depthIndex;
|
||||
|
||||
public TestSceneSlider()
|
||||
[Test]
|
||||
public void TestVariousSliders()
|
||||
{
|
||||
AddStep("Big Single", () => SetContents(() => testSimpleBig()));
|
||||
AddStep("Medium Single", () => SetContents(() => testSimpleMedium()));
|
||||
|
@ -314,11 +314,11 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
|
||||
private bool assertMaxJudge() => judgementResults.Any() && judgementResults.All(t => t.Type == t.Judgement.MaxResult);
|
||||
|
||||
private bool assertHeadMissTailTracked() => judgementResults[^2].Type == HitResult.IgnoreHit && judgementResults.First().Type == HitResult.Miss;
|
||||
private bool assertHeadMissTailTracked() => judgementResults[^2].Type == HitResult.SmallTickHit && !judgementResults.First().IsHit;
|
||||
|
||||
private bool assertMidSliderJudgements() => judgementResults[^2].Type == HitResult.IgnoreHit;
|
||||
private bool assertMidSliderJudgements() => judgementResults[^2].Type == HitResult.SmallTickHit;
|
||||
|
||||
private bool assertMidSliderJudgementFail() => judgementResults[^2].Type == HitResult.IgnoreMiss;
|
||||
private bool assertMidSliderJudgementFail() => judgementResults[^2].Type == HitResult.SmallTickMiss;
|
||||
|
||||
private ScoreAccessibleReplayPlayer currentPlayer;
|
||||
|
||||
|
@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
var circleResult = (OsuHitCircleJudgementResult)r;
|
||||
|
||||
// Todo: This should also consider misses, but they're a little more interesting to handle, since we don't necessarily know the position at the time of a miss.
|
||||
if (result != HitResult.Miss)
|
||||
if (result.IsHit())
|
||||
{
|
||||
var localMousePosition = ToLocalSpace(inputManager.CurrentState.Mouse.Position);
|
||||
circleResult.CursorPositionAtHit = HitObject.StackedPosition + (localMousePosition - DrawSize / 2);
|
||||
|
@ -8,7 +8,6 @@ using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Osu.Judgements;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
@ -68,7 +67,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
/// <summary>
|
||||
/// Causes this <see cref="DrawableOsuHitObject"/> to get missed, disregarding all conditions in implementations of <see cref="DrawableHitObject.CheckForResult"/>.
|
||||
/// </summary>
|
||||
public void MissForcefully() => ApplyResult(r => r.Type = HitResult.Miss);
|
||||
public void MissForcefully() => ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
|
||||
protected override JudgementResult CreateResult(Judgement judgement) => new OsuJudgementResult(HitObject, judgement);
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ using osu.Game.Configuration;
|
||||
using osuTK;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -67,7 +66,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
if (JudgedObject != null)
|
||||
{
|
||||
lightingColour = JudgedObject.AccentColour.GetBoundCopy();
|
||||
lightingColour.BindValueChanged(colour => Lighting.Colour = Result.Type == HitResult.Miss ? Color4.Transparent : colour.NewValue, true);
|
||||
lightingColour.BindValueChanged(colour => Lighting.Colour = Result.IsHit ? colour.NewValue : Color4.Transparent, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -13,7 +13,6 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Osu.Skinning;
|
||||
using osu.Game.Rulesets.Osu.UI;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK.Graphics;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
@ -250,7 +249,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
// rather than doing it this way, we should probably attach the sample to the tail circle.
|
||||
// this can only be done after we stop using LegacyLastTick.
|
||||
if (TailCircle.Result.Type != HitResult.Miss)
|
||||
if (TailCircle.IsHit)
|
||||
base.PlaySamples();
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
else if (Progress > .75)
|
||||
r.Type = HitResult.Meh;
|
||||
else if (Time.Current >= Spinner.EndTime)
|
||||
r.Type = HitResult.Miss;
|
||||
r.Type = r.Judgement.MinResult;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
|
||||
public class SliderTailJudgement : OsuJudgement
|
||||
{
|
||||
public override HitResult MaxResult => HitResult.IgnoreHit;
|
||||
public override HitResult MaxResult => HitResult.SmallTickHit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -30,8 +29,8 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
||||
|
||||
private readonly Random rng = new Random(1337);
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
[Test]
|
||||
public void TestVariousHits()
|
||||
{
|
||||
AddStep("Hit", () => addHitJudgement(false));
|
||||
AddStep("Strong hit", () => addStrongHitJudgement(false));
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Taiko.Judgements
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case HitResult.Great:
|
||||
case HitResult.SmallTickHit:
|
||||
return 0.15;
|
||||
|
||||
default:
|
||||
|
@ -107,7 +107,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
if (!(obj is DrawableDrumRollTick))
|
||||
return;
|
||||
|
||||
if (result.Type > HitResult.Miss)
|
||||
if (result.IsHit)
|
||||
rollingHits++;
|
||||
else
|
||||
rollingHits--;
|
||||
@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
ApplyResult(r => r.Type = countHit >= HitObject.RequiredGreatHits ? HitResult.Great : HitResult.Ok);
|
||||
}
|
||||
else
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
}
|
||||
|
||||
protected override void UpdateStateTransforms(ArmedState state)
|
||||
|
@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
if (!userTriggered)
|
||||
{
|
||||
if (!HitObject.HitWindows.CanBeHit(timeOffset))
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
return;
|
||||
|
||||
if (!validActionPressed)
|
||||
ApplyResult(r => r.Type = HitResult.Miss);
|
||||
ApplyResult(r => r.Type = r.Judgement.MinResult);
|
||||
else
|
||||
ApplyResult(r => r.Type = result);
|
||||
}
|
||||
|
@ -211,9 +211,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
tick.TriggerResult(false);
|
||||
}
|
||||
|
||||
var hitResult = numHits > HitObject.RequiredHits / 2 ? HitResult.Ok : HitResult.Miss;
|
||||
|
||||
ApplyResult(r => r.Type = hitResult);
|
||||
ApplyResult(r => r.Type = numHits > HitObject.RequiredHits / 2 ? HitResult.Ok : r.Judgement.MinResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
||||
private double hpMultiplier;
|
||||
|
||||
/// <summary>
|
||||
/// HP multiplier for a <see cref="HitResult.Miss"/>.
|
||||
/// HP multiplier for a <see cref="HitResult"/> that does not satisfy <see cref="HitResultExtensions.IsHit"/>.
|
||||
/// </summary>
|
||||
private double hpMissMultiplier;
|
||||
|
||||
@ -45,6 +45,6 @@ namespace osu.Game.Rulesets.Taiko.Scoring
|
||||
}
|
||||
|
||||
protected override double GetHealthIncreaseFor(JudgementResult result)
|
||||
=> base.GetHealthIncreaseFor(result) * (result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier);
|
||||
=> base.GetHealthIncreaseFor(result) * (result.IsHit ? hpMultiplier : hpMissMultiplier);
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning
|
||||
if (r?.Type.AffectsCombo() == false)
|
||||
return;
|
||||
|
||||
passing = r == null || r.Type > HitResult.Miss;
|
||||
passing = r == null || r.IsHit;
|
||||
|
||||
foreach (var sprite in InternalChildren.OfType<ScrollerSprite>())
|
||||
sprite.Passing = passing;
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Taiko.UI
|
||||
Alpha = 0.15f;
|
||||
Masking = true;
|
||||
|
||||
if (result == HitResult.Miss)
|
||||
if (!result.IsHit())
|
||||
return;
|
||||
|
||||
bool isRim = (judgedObject.HitObject as Hit)?.Type == HitType.Rim;
|
||||
|
39
osu.Game.Tests/NonVisual/GameplayClockTest.cs
Normal file
39
osu.Game.Tests/NonVisual/GameplayClockTest.cs
Normal file
@ -0,0 +1,39 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Tests.NonVisual
|
||||
{
|
||||
[TestFixture]
|
||||
public class GameplayClockTest
|
||||
{
|
||||
[TestCase(0)]
|
||||
[TestCase(1)]
|
||||
public void TestTrueGameplayRateWithZeroAdjustment(double underlyingClockRate)
|
||||
{
|
||||
var framedClock = new FramedClock(new ManualClock { Rate = underlyingClockRate });
|
||||
var gameplayClock = new TestGameplayClock(framedClock);
|
||||
|
||||
gameplayClock.MutableNonGameplayAdjustments.Add(new BindableDouble());
|
||||
|
||||
Assert.That(gameplayClock.TrueGameplayRate, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
private class TestGameplayClock : GameplayClock
|
||||
{
|
||||
public List<Bindable<double>> MutableNonGameplayAdjustments { get; } = new List<Bindable<double>>();
|
||||
|
||||
public override IEnumerable<Bindable<double>> NonGameplayAdjustments => MutableNonGameplayAdjustments;
|
||||
|
||||
public TestGameplayClock(IFrameBasedClock underlyingClock)
|
||||
: base(underlyingClock)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,8 @@ using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
@ -22,6 +24,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
|
||||
protected override bool EditorComponentsReady => Editor.ChildrenOfType<SetupScreen>().SingleOrDefault()?.IsLoaded == true;
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmapManager { get; set; }
|
||||
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
AddStep("set dummy", () => Beatmap.Value = new DummyWorkingBeatmap(Audio, null));
|
||||
@ -38,6 +43,15 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
{
|
||||
AddStep("save beatmap", () => Editor.Save());
|
||||
AddAssert("new beatmap persisted", () => EditorBeatmap.BeatmapInfo.ID > 0);
|
||||
AddAssert("new beatmap in database", () => beatmapManager.QueryBeatmapSet(s => s.ID == EditorBeatmap.BeatmapInfo.BeatmapSet.ID)?.DeletePending == false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestExitWithoutSave()
|
||||
{
|
||||
AddStep("exit without save", () => Editor.Exit());
|
||||
AddUntilStep("wait for exit", () => !Editor.IsCurrentScreen());
|
||||
AddAssert("new beatmap not persisted", () => beatmapManager.QueryBeatmapSet(s => s.ID == EditorBeatmap.BeatmapInfo.BeatmapSet.ID)?.DeletePending == true);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -109,40 +109,40 @@ namespace osu.Game.Rulesets.Judgements
|
||||
return 0;
|
||||
|
||||
case HitResult.SmallTickHit:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.SmallTickMiss:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.LargeTickHit:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
case HitResult.LargeTickMiss:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
case HitResult.Miss:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
case HitResult.Meh:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.05;
|
||||
|
||||
case HitResult.Ok:
|
||||
return -DEFAULT_MAX_HEALTH_INCREASE * 0.3;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.Good:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.75;
|
||||
|
||||
case HitResult.Great:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.8;
|
||||
|
||||
case HitResult.Perfect:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||
|
||||
case HitResult.Perfect:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 1.05;
|
||||
|
||||
case HitResult.SmallBonus:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.1;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.5;
|
||||
|
||||
case HitResult.LargeBonus:
|
||||
return DEFAULT_MAX_HEALTH_INCREASE * 0.2;
|
||||
return DEFAULT_MAX_HEALTH_INCREASE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -506,19 +506,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
|
||||
Result.TimeOffset = Math.Min(HitObject.HitWindows.WindowFor(HitResult.Miss), Time.Current - endTime);
|
||||
|
||||
switch (Result.Type)
|
||||
{
|
||||
case HitResult.None:
|
||||
break;
|
||||
|
||||
case HitResult.Miss:
|
||||
updateState(ArmedState.Miss);
|
||||
break;
|
||||
|
||||
default:
|
||||
updateState(ArmedState.Hit);
|
||||
break;
|
||||
}
|
||||
if (Result.HasResult)
|
||||
updateState(Result.IsHit ? ArmedState.Hit : ArmedState.Miss);
|
||||
|
||||
OnNewResult?.Invoke(this, Result);
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private DependencyContainer dependencies;
|
||||
|
||||
private bool isNewBeatmap;
|
||||
|
||||
protected override UserActivity InitialActivity => new UserActivity.Editing(Beatmap.Value.BeatmapInfo);
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
@ -113,8 +115,6 @@ namespace osu.Game.Screens.Edit
|
||||
// todo: remove caching of this and consume via editorBeatmap?
|
||||
dependencies.Cache(beatDivisor);
|
||||
|
||||
bool isNewBeatmap = false;
|
||||
|
||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||
{
|
||||
isNewBeatmap = true;
|
||||
@ -287,6 +287,9 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
protected void Save()
|
||||
{
|
||||
// no longer new after first user-triggered save.
|
||||
isNewBeatmap = false;
|
||||
|
||||
// apply any set-level metadata changes.
|
||||
beatmapManager.Update(playableBeatmap.BeatmapInfo.BeatmapSet);
|
||||
|
||||
@ -435,10 +438,20 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
if (!exitConfirmed && dialogOverlay != null && HasUnsavedChanges && !(dialogOverlay.CurrentDialog is PromptForSaveDialog))
|
||||
if (!exitConfirmed)
|
||||
{
|
||||
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
||||
return true;
|
||||
// if the confirm dialog is already showing (or we can't show it, ie. in tests) exit without save.
|
||||
if (dialogOverlay == null || dialogOverlay.CurrentDialog is PromptForSaveDialog)
|
||||
{
|
||||
confirmExit();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isNewBeatmap || HasUnsavedChanges)
|
||||
{
|
||||
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Background.FadeColour(Color4.White, 500);
|
||||
@ -456,6 +469,12 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
private void confirmExit()
|
||||
{
|
||||
if (isNewBeatmap)
|
||||
{
|
||||
// confirming exit without save means we should delete the new beatmap completely.
|
||||
beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet);
|
||||
}
|
||||
|
||||
exitConfirmed = true;
|
||||
this.Exit();
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Framework.Utils;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
@ -47,7 +48,12 @@ namespace osu.Game.Screens.Play
|
||||
double baseRate = Rate;
|
||||
|
||||
foreach (var adjustment in NonGameplayAdjustments)
|
||||
{
|
||||
if (Precision.AlmostEquals(adjustment.Value, 0))
|
||||
return 0;
|
||||
|
||||
baseRate /= adjustment.Value;
|
||||
}
|
||||
|
||||
return baseRate;
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
@ -106,7 +105,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
public void Flash(JudgementResult result)
|
||||
{
|
||||
if (result.Type == HitResult.Miss)
|
||||
if (!result.IsHit)
|
||||
return;
|
||||
|
||||
Scheduler.AddOnce(flash);
|
||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
/// <param name="hitEvents">The <see cref="HitEvent"/>s to display the timing distribution of.</param>
|
||||
public HitEventTimingDistributionGraph(IReadOnlyList<HitEvent> hitEvents)
|
||||
{
|
||||
this.hitEvents = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result != HitResult.Miss).ToList();
|
||||
this.hitEvents = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result.IsHit()).ToList();
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -20,7 +20,7 @@ namespace osu.Game.Screens.Ranking.Statistics
|
||||
public UnstableRate(IEnumerable<HitEvent> hitEvents)
|
||||
: base("Unstable Rate")
|
||||
{
|
||||
var timeOffsets = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result != HitResult.Miss)
|
||||
var timeOffsets = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result.IsHit())
|
||||
.Select(ev => ev.TimeOffset).ToArray();
|
||||
Value = 10 * standardDeviation(timeOffsets);
|
||||
}
|
||||
|
@ -24,7 +24,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="2020.1001.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.1004.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||
<PackageReference Include="Sentry" Version="2.1.6" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
|
@ -70,7 +70,7 @@
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Label="Package References">
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.1001.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.1004.0" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.904.0" />
|
||||
</ItemGroup>
|
||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||
@ -80,7 +80,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="2020.1001.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2020.1004.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user