mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 07:42:55 +08:00
Merge branch 'master' into fix-retry-sound
This commit is contained in:
commit
8b9cfadd64
@ -12,6 +12,7 @@ using osu.Game.Rulesets.Mods;
|
|||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -41,6 +42,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
scoreProcessor.Health.ValueChanged += health => { blinds.AnimateClosedness((float)health.NewValue); };
|
scoreProcessor.Health.ValueChanged += health => { blinds.AnimateClosedness((float)health.NewValue); };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Element for the Blinds mod drawing 2 black boxes covering the whole screen which resize inside a restricted area with some leniency.
|
/// Element for the Blinds mod drawing 2 black boxes covering the whole screen which resize inside a restricted area with some leniency.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3,12 +3,13 @@
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Audio;
|
using osu.Framework.Graphics.Audio;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Editor
|
namespace osu.Game.Tests.Visual.Editor
|
||||||
@ -16,35 +17,38 @@ namespace osu.Game.Tests.Visual.Editor
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseWaveform : OsuTestCase
|
public class TestCaseWaveform : OsuTestCase
|
||||||
{
|
{
|
||||||
|
private WorkingBeatmap waveformBeatmap;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Beatmap.Value = new WaveformTestBeatmap();
|
waveformBeatmap = new WaveformTestBeatmap();
|
||||||
|
}
|
||||||
|
|
||||||
FillFlowContainer flow;
|
[TestCase(1f)]
|
||||||
Child = flow = new FillFlowContainer
|
[TestCase(1f / 2)]
|
||||||
|
[TestCase(1f / 4)]
|
||||||
|
[TestCase(1f / 8)]
|
||||||
|
[TestCase(1f / 16)]
|
||||||
|
[TestCase(0f)]
|
||||||
|
public void TestResolution(float resolution)
|
||||||
|
{
|
||||||
|
TestWaveformGraph graph = null;
|
||||||
|
|
||||||
|
AddStep("add graph", () =>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
Child = new Container
|
||||||
Direction = FillDirection.Vertical,
|
|
||||||
Spacing = new Vector2(0, 10),
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int i = 1; i <= 16; i *= 2)
|
|
||||||
{
|
|
||||||
var newDisplay = new WaveformGraph
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Resolution = 1f / i,
|
|
||||||
Waveform = Beatmap.Value.Waveform,
|
|
||||||
};
|
|
||||||
|
|
||||||
flow.Add(new Container
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Height = 100,
|
Height = 100,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
newDisplay,
|
graph = new TestWaveformGraph
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Resolution = resolution,
|
||||||
|
Waveform = waveformBeatmap.Waveform,
|
||||||
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -62,13 +66,42 @@ namespace osu.Game.Tests.Visual.Editor
|
|||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Text = $"Resolution: {1f / i:0.00}"
|
Text = $"Resolution: {resolution:0.00}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for load", () => graph.ResampledWaveform != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestDefaultBeatmap()
|
||||||
|
{
|
||||||
|
TestWaveformGraph graph = null;
|
||||||
|
|
||||||
|
AddStep("add graph", () =>
|
||||||
|
{
|
||||||
|
Child = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = 100,
|
||||||
|
Child = graph = new TestWaveformGraph
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Waveform = new DummyWorkingBeatmap().Waveform,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for load", () => graph.ResampledWaveform != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TestWaveformGraph : WaveformGraph
|
||||||
|
{
|
||||||
|
public new Waveform ResampledWaveform => base.ResampledWaveform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ using osu.Framework.Screens;
|
|||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
@ -96,6 +97,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
Applied = true;
|
Applied = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestPlayer : Player
|
private class TestPlayer : Player
|
||||||
|
@ -8,5 +8,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
public class APIMod : IMod
|
public class APIMod : IMod
|
||||||
{
|
{
|
||||||
public string Acronym { get; set; }
|
public string Acronym { get; set; }
|
||||||
|
|
||||||
|
public bool Equals(IMod other) => Acronym == other?.Acronym;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,17 +134,17 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
|
|
||||||
DetailsVisible.BindValueChanged(visible =>
|
DetailsVisible.BindValueChanged(visible =>
|
||||||
{
|
{
|
||||||
hiddenDetailContainer.Alpha = visible.NewValue ? 1 : 0;
|
hiddenDetailContainer.FadeTo(visible.NewValue ? 0 : 1, 200, Easing.OutQuint);
|
||||||
expandedDetailContainer.Alpha = visible.NewValue ? 0 : 1;
|
expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||||
}, true);
|
});
|
||||||
|
|
||||||
User.BindValueChanged(user => updateDisplay(user.NewValue));
|
User.BindValueChanged(user => updateDisplay(user.NewValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDisplay(User user)
|
private void updateDisplay(User user)
|
||||||
{
|
{
|
||||||
hiddenDetailGlobal.Content = user?.Statistics?.Ranks.Global?.ToString("#,##0") ?? "-";
|
hiddenDetailGlobal.Content = user?.Statistics?.Ranks.Global?.ToString("\\##,##0") ?? "-";
|
||||||
hiddenDetailCountry.Content = user?.Statistics?.Ranks.Country?.ToString("#,##0") ?? "-";
|
hiddenDetailCountry.Content = user?.Statistics?.Ranks.Country?.ToString("\\##,##0") ?? "-";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TooltipText => User.Value?.Statistics?.Ranks.Global == null ? "" : $"{ranks[dayIndex].Value:#,##0}|{ranked_days - ranks[dayIndex].Key + 1}";
|
public string TooltipText => User.Value?.Statistics?.Ranks.Global == null ? "" : $"#{ranks[dayIndex].Value:#,##0}|{ranked_days - ranks[dayIndex].Key + 1}";
|
||||||
|
|
||||||
public ITooltip GetCustomTooltip() => new RankGraphTooltip();
|
public ITooltip GetCustomTooltip() => new RankGraphTooltip();
|
||||||
|
|
||||||
|
@ -26,14 +26,40 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
private OverlinedInfoContainer ppInfo;
|
private OverlinedInfoContainer ppInfo;
|
||||||
private OverlinedInfoContainer detailGlobalRank;
|
private OverlinedInfoContainer detailGlobalRank;
|
||||||
private OverlinedInfoContainer detailCountryRank;
|
private OverlinedInfoContainer detailCountryRank;
|
||||||
|
private FillFlowContainer fillFlow;
|
||||||
private RankGraph rankGraph;
|
private RankGraph rankGraph;
|
||||||
|
|
||||||
public readonly Bindable<User> User = new Bindable<User>();
|
public readonly Bindable<User> User = new Bindable<User>();
|
||||||
|
|
||||||
|
private bool expanded = true;
|
||||||
|
|
||||||
|
public bool Expanded
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (expanded == value) return;
|
||||||
|
|
||||||
|
expanded = value;
|
||||||
|
|
||||||
|
if (fillFlow == null) return;
|
||||||
|
|
||||||
|
fillFlow.ClearTransforms();
|
||||||
|
|
||||||
|
if (expanded)
|
||||||
|
fillFlow.AutoSizeAxes = Axes.Y;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fillFlow.AutoSizeAxes = Axes.None;
|
||||||
|
fillFlow.ResizeHeightTo(0, 200, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
User.ValueChanged += e => updateDisplay(e.NewValue);
|
User.ValueChanged += e => updateDisplay(e.NewValue);
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
@ -43,10 +69,13 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = colours.CommunityUserGrayGreenDarkest,
|
Colour = colours.CommunityUserGrayGreenDarkest,
|
||||||
},
|
},
|
||||||
new FillFlowContainer
|
fillFlow = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = expanded ? Axes.Y : Axes.None,
|
||||||
|
AutoSizeDuration = 200,
|
||||||
|
AutoSizeEasing = Easing.OutQuint,
|
||||||
|
Masking = true,
|
||||||
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
Padding = new MarginPadding { Horizontal = UserProfileOverlay.CONTENT_X_MARGIN, Vertical = 10 },
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Spacing = new Vector2(0, 20),
|
Spacing = new Vector2(0, 20),
|
||||||
@ -148,8 +177,8 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
foreach (var scoreRankInfo in scoreRankInfos)
|
foreach (var scoreRankInfo in scoreRankInfos)
|
||||||
scoreRankInfo.Value.RankCount = user?.Statistics?.GradesCount[scoreRankInfo.Key] ?? 0;
|
scoreRankInfo.Value.RankCount = user?.Statistics?.GradesCount[scoreRankInfo.Key] ?? 0;
|
||||||
|
|
||||||
detailGlobalRank.Content = user?.Statistics?.Ranks.Global?.ToString("#,##0") ?? "-";
|
detailGlobalRank.Content = user?.Statistics?.Ranks.Global?.ToString("\\##,##0") ?? "-";
|
||||||
detailCountryRank.Content = user?.Statistics?.Ranks.Country?.ToString("#,##0") ?? "-";
|
detailCountryRank.Content = user?.Statistics?.Ranks.Country?.ToString("\\##,##0") ?? "-";
|
||||||
|
|
||||||
rankGraph.User.Value = user;
|
rankGraph.User.Value = user;
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Overlays.Profile
|
|||||||
infoTabControl.AddItem("Info");
|
infoTabControl.AddItem("Info");
|
||||||
infoTabControl.AddItem("Modding");
|
infoTabControl.AddItem("Modding");
|
||||||
|
|
||||||
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Alpha = visible.NewValue ? 1 : 0, true);
|
centreHeaderContainer.DetailsVisible.BindValueChanged(visible => detailHeaderContainer.Expanded = visible.NewValue, true);
|
||||||
User.ValueChanged += e => updateDisplay(e.NewValue);
|
User.ValueChanged += e => updateDisplay(e.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
@ -10,6 +11,14 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IApplicableToScoreProcessor : IApplicableMod
|
public interface IApplicableToScoreProcessor : IApplicableMod
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provide a <see cref="ScoreProcessor"/> to a mod. Called once on initialisation of a play instance.
|
||||||
|
/// </summary>
|
||||||
void ApplyToScoreProcessor(ScoreProcessor scoreProcessor);
|
void ApplyToScoreProcessor(ScoreProcessor scoreProcessor);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called every time a rank calculation is requested. Allows mods to adjust the final rank.
|
||||||
|
/// </summary>
|
||||||
|
ScoreRank AdjustRank(ScoreRank rank, double accuracy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public interface IMod
|
public interface IMod : IEquatable<IMod>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The shortened name of this mod.
|
/// The shortened name of this mod.
|
||||||
|
@ -70,5 +70,7 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
/// Creates a copy of this <see cref="Mod"/> initialised to a default state.
|
/// Creates a copy of this <see cref="Mod"/> initialised to a default state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual Mod CreateCopy() => (Mod)Activator.CreateInstance(GetType());
|
public virtual Mod CreateCopy() => (Mod)Activator.CreateInstance(GetType());
|
||||||
|
|
||||||
|
public bool Equals(IMod other) => GetType() == other?.GetType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ using osu.Game.Graphics;
|
|||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -46,6 +47,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
Combo.BindTo(scoreProcessor.Combo);
|
Combo.BindTo(scoreProcessor.Combo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
|
||||||
|
|
||||||
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
||||||
{
|
{
|
||||||
var flashlight = CreateFlashlight();
|
var flashlight = CreateFlashlight();
|
||||||
|
@ -8,10 +8,12 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
public abstract class ModHidden : Mod, IReadFromConfig, IApplicableToDrawableHitObjects
|
public abstract class ModHidden : Mod, IReadFromConfig, IApplicableToDrawableHitObjects, IApplicableToScoreProcessor
|
||||||
{
|
{
|
||||||
public override string Name => "Hidden";
|
public override string Name => "Hidden";
|
||||||
public override string Acronym => "HD";
|
public override string Acronym => "HD";
|
||||||
@ -32,6 +34,25 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
d.ApplyCustomUpdateState += ApplyHiddenState;
|
d.ApplyCustomUpdateState += ApplyHiddenState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||||
|
{
|
||||||
|
// Default value of ScoreProcessor's Rank in Hidden Mod should be SS+
|
||||||
|
scoreProcessor.Rank.Value = ScoreRank.XH;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy)
|
||||||
|
{
|
||||||
|
switch (rank)
|
||||||
|
{
|
||||||
|
case ScoreRank.X:
|
||||||
|
return ScoreRank.XH;
|
||||||
|
case ScoreRank.S:
|
||||||
|
return ScoreRank.SH;
|
||||||
|
default:
|
||||||
|
return rank;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void ApplyHiddenState(DrawableHitObject hitObject, ArmedState state)
|
protected virtual void ApplyHiddenState(DrawableHitObject hitObject, ArmedState state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ using System;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
namespace osu.Game.Rulesets.Mods
|
||||||
{
|
{
|
||||||
@ -24,6 +25,8 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
scoreProcessor.FailConditions += FailCondition;
|
scoreProcessor.FailConditions += FailCondition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;
|
||||||
|
|
||||||
protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value == 0;
|
protected virtual bool FailCondition(ScoreProcessor scoreProcessor) => scoreProcessor.Combo.Value == 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Extensions;
|
|||||||
using osu.Framework.Extensions.TypeExtensions;
|
using osu.Framework.Extensions.TypeExtensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
@ -60,6 +61,11 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly BindableInt Combo = new BindableInt();
|
public readonly BindableInt Combo = new BindableInt();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current selected mods
|
||||||
|
/// </summary>
|
||||||
|
public readonly Bindable<IReadOnlyList<Mod>> Mods = new Bindable<IReadOnlyList<Mod>>(Array.Empty<Mod>());
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a <see cref="HitWindows"/> for this processor.
|
/// Create a <see cref="HitWindows"/> for this processor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -98,7 +104,12 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
protected ScoreProcessor()
|
protected ScoreProcessor()
|
||||||
{
|
{
|
||||||
Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); };
|
Combo.ValueChanged += delegate { HighestCombo.Value = Math.Max(HighestCombo.Value, Combo.Value); };
|
||||||
Accuracy.ValueChanged += delegate { Rank.Value = rankFrom(Accuracy.Value); };
|
Accuracy.ValueChanged += delegate
|
||||||
|
{
|
||||||
|
Rank.Value = rankFrom(Accuracy.Value);
|
||||||
|
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
||||||
|
Rank.Value = mod.AdjustRank(Rank.Value, Accuracy.Value);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScoreRank rankFrom(double acc)
|
private ScoreRank rankFrom(double acc)
|
||||||
|
@ -177,6 +177,8 @@ namespace osu.Game.Scoring
|
|||||||
protected class DeserializedMod : IMod
|
protected class DeserializedMod : IMod
|
||||||
{
|
{
|
||||||
public string Acronym { get; set; }
|
public string Acronym { get; set; }
|
||||||
|
|
||||||
|
public bool Equals(IMod other) => Acronym == other?.Acronym;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString() => $"{User} playing {Beatmap}";
|
public override string ToString() => $"{User} playing {Beatmap}";
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Multi.Play
|
|||||||
if (ruleset.Value.ID != playlistItem.Ruleset.ID)
|
if (ruleset.Value.ID != playlistItem.Ruleset.ID)
|
||||||
throw new InvalidOperationException("Current Ruleset does not match PlaylistItem's Ruleset");
|
throw new InvalidOperationException("Current Ruleset does not match PlaylistItem's Ruleset");
|
||||||
|
|
||||||
if (!playlistItem.RequiredMods.All(m => Mods.Value.Contains(m)))
|
if (!playlistItem.RequiredMods.All(m => Mods.Value.Any(m.Equals)))
|
||||||
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
|
throw new InvalidOperationException("Current Mods do not match PlaylistItem's RequiredMods");
|
||||||
|
|
||||||
var req = new CreateRoomScoreRequest(roomId.Value ?? 0, playlistItem.ID);
|
var req = new CreateRoomScoreRequest(roomId.Value ?? 0, playlistItem.ID);
|
||||||
|
@ -106,6 +106,8 @@ namespace osu.Game.Screens.Play
|
|||||||
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
showStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
|
|
||||||
ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
|
ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
|
||||||
|
ScoreProcessor.Mods.BindTo(Mods);
|
||||||
|
|
||||||
if (!ScoreProcessor.Mode.Disabled)
|
if (!ScoreProcessor.Mode.Disabled)
|
||||||
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
|
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
|
||||||
|
|
||||||
|
@ -38,6 +38,10 @@ namespace osu.Game.Screens.Play
|
|||||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
|
||||||
protected override bool BlockPositionalInput => false;
|
protected override bool BlockPositionalInput => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Displays a skip overlay, giving the user the ability to skip forward.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="startTime">The time at which gameplay begins to appear.</param>
|
||||||
public SkipOverlay(double startTime)
|
public SkipOverlay(double startTime)
|
||||||
{
|
{
|
||||||
this.startTime = startTime;
|
this.startTime = startTime;
|
||||||
@ -87,16 +91,21 @@ namespace osu.Game.Screens.Play
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private const double skip_required_cutoff = 3000;
|
/// <summary>
|
||||||
|
/// Duration before gameplay start time required before skip button displays.
|
||||||
|
/// </summary>
|
||||||
|
private const double skip_buffer = 1000;
|
||||||
|
|
||||||
private const double fade_time = 300;
|
private const double fade_time = 300;
|
||||||
|
|
||||||
private double beginFadeTime => startTime - skip_required_cutoff - fade_time;
|
private double beginFadeTime => startTime - fade_time;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (startTime < skip_required_cutoff)
|
// skip is not required if there is no extra "empty" time to skip.
|
||||||
|
if (Clock.CurrentTime > beginFadeTime - skip_buffer)
|
||||||
{
|
{
|
||||||
Alpha = 0;
|
Alpha = 0;
|
||||||
Expire();
|
Expire();
|
||||||
@ -107,7 +116,7 @@ namespace osu.Game.Screens.Play
|
|||||||
using (BeginAbsoluteSequence(beginFadeTime))
|
using (BeginAbsoluteSequence(beginFadeTime))
|
||||||
this.FadeOut(fade_time);
|
this.FadeOut(fade_time);
|
||||||
|
|
||||||
button.Action = () => RequestSeek?.Invoke(startTime - skip_required_cutoff - fade_time);
|
button.Action = () => RequestSeek?.Invoke(beginFadeTime);
|
||||||
|
|
||||||
displayTime = Time.Current;
|
displayTime = Time.Current;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.3" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.427.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.502.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,8 +105,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.427.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.502.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.427.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.502.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user