mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
Merge branch 'master' into notification-fling
This commit is contained in:
commit
802c5629c0
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -1,5 +1,8 @@
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
inspect-code:
|
inspect-code:
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Extensions.EnumExtensions;
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
@ -33,7 +31,7 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
{
|
{
|
||||||
public class CatchRuleset : Ruleset, ILegacyRuleset
|
public class CatchRuleset : Ruleset, ILegacyRuleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new DrawableCatchRuleset(this, beatmap, mods);
|
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableCatchRuleset(this, beatmap, mods);
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor();
|
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor();
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mania.Configuration
|
|||||||
{
|
{
|
||||||
public class ManiaRulesetConfigManager : RulesetConfigManager<ManiaRulesetSetting>
|
public class ManiaRulesetConfigManager : RulesetConfigManager<ManiaRulesetSetting>
|
||||||
{
|
{
|
||||||
public ManiaRulesetConfigManager(SettingsStore settings, RulesetInfo ruleset, int? variant = null)
|
public ManiaRulesetConfigManager(SettingsStore? settings, RulesetInfo ruleset, int? variant = null)
|
||||||
: base(settings, ruleset, variant)
|
: base(settings, ruleset, variant)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -48,7 +46,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const int MAX_STAGE_KEYS = 10;
|
public const int MAX_STAGE_KEYS = 10;
|
||||||
|
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new DrawableManiaRuleset(this, beatmap, mods);
|
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableManiaRuleset(this, beatmap, mods);
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
|
public override ScoreProcessor CreateScoreProcessor() => new ManiaScoreProcessor();
|
||||||
|
|
||||||
@ -285,7 +283,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
|
|
||||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();
|
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new ManiaReplayFrame();
|
||||||
|
|
||||||
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new ManiaRulesetConfigManager(settings, RulesetInfo);
|
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new ManiaRulesetConfigManager(settings, RulesetInfo);
|
||||||
|
|
||||||
public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this);
|
public override RulesetSettingsSubsection CreateSettings() => new ManiaSettingsSubsection(this);
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -53,6 +54,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
private IBindable<Vector2> sliderPosition;
|
private IBindable<Vector2> sliderPosition;
|
||||||
private IBindable<float> sliderScale;
|
private IBindable<float> sliderScale;
|
||||||
|
|
||||||
|
[UsedImplicitly]
|
||||||
|
private readonly IBindable<int> sliderVersion;
|
||||||
|
|
||||||
public PathControlPointPiece(Slider slider, PathControlPoint controlPoint)
|
public PathControlPointPiece(Slider slider, PathControlPoint controlPoint)
|
||||||
{
|
{
|
||||||
this.slider = slider;
|
this.slider = slider;
|
||||||
@ -61,7 +65,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
// we don't want to run the path type update on construction as it may inadvertently change the slider.
|
// we don't want to run the path type update on construction as it may inadvertently change the slider.
|
||||||
cachePoints(slider);
|
cachePoints(slider);
|
||||||
|
|
||||||
slider.Path.Version.BindValueChanged(_ =>
|
sliderVersion = slider.Path.Version.GetBoundCopy();
|
||||||
|
sliderVersion.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
cachePoints(slider);
|
cachePoints(slider);
|
||||||
updatePathType();
|
updatePathType();
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -44,7 +42,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
{
|
{
|
||||||
public class OsuRuleset : Ruleset, ILegacyRuleset
|
public class OsuRuleset : Ruleset, ILegacyRuleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new DrawableOsuRuleset(this, beatmap, mods);
|
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableOsuRuleset(this, beatmap, mods);
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
|
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
|
||||||
|
|
||||||
@ -239,7 +237,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
|
|
||||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();
|
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new OsuReplayFrame();
|
||||||
|
|
||||||
public override IRulesetConfigManager CreateConfig(SettingsStore settings) => new OsuRulesetConfigManager(settings, RulesetInfo);
|
public override IRulesetConfigManager CreateConfig(SettingsStore? settings) => new OsuRulesetConfigManager(settings, RulesetInfo);
|
||||||
|
|
||||||
protected override IEnumerable<HitResult> GetValidHitResults()
|
protected override IEnumerable<HitResult> GetValidHitResults()
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -37,7 +35,7 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
{
|
{
|
||||||
public class TaikoRuleset : Ruleset, ILegacyRuleset
|
public class TaikoRuleset : Ruleset, ILegacyRuleset
|
||||||
{
|
{
|
||||||
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null) => new DrawableTaikoRuleset(this, beatmap, mods);
|
public override DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null) => new DrawableTaikoRuleset(this, beatmap, mods);
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor();
|
public override ScoreProcessor CreateScoreProcessor() => new TaikoScoreProcessor();
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System.Diagnostics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -45,7 +46,10 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
Dependencies.Cache(EditorBeatmap);
|
Dependencies.Cache(EditorBeatmap);
|
||||||
Dependencies.CacheAs<IBeatSnapProvider>(EditorBeatmap);
|
Dependencies.CacheAs<IBeatSnapProvider>(EditorBeatmap);
|
||||||
|
|
||||||
Composer = playable.BeatmapInfo.Ruleset.CreateInstance().CreateHitObjectComposer().With(d => d.Alpha = 0);
|
Composer = playable.BeatmapInfo.Ruleset.CreateInstance().CreateHitObjectComposer();
|
||||||
|
Debug.Assert(Composer != null);
|
||||||
|
|
||||||
|
Composer.Alpha = 0;
|
||||||
|
|
||||||
Add(new OsuContextMenuContainer
|
Add(new OsuContextMenuContainer
|
||||||
{
|
{
|
||||||
|
@ -280,12 +280,15 @@ namespace osu.Game.Beatmaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IBeatmapProcessor processor = rulesetInstance.CreateBeatmapProcessor(converted);
|
var processor = rulesetInstance.CreateBeatmapProcessor(converted);
|
||||||
|
|
||||||
|
if (processor != null)
|
||||||
|
{
|
||||||
foreach (var mod in mods.OfType<IApplicableToBeatmapProcessor>())
|
foreach (var mod in mods.OfType<IApplicableToBeatmapProcessor>())
|
||||||
mod.ApplyToBeatmapProcessor(processor);
|
mod.ApplyToBeatmapProcessor(processor);
|
||||||
|
|
||||||
processor?.PreProcess();
|
processor.PreProcess();
|
||||||
|
}
|
||||||
|
|
||||||
// Compute default values for hitobjects, including creating nested hitobjects in-case they're needed
|
// Compute default values for hitobjects, including creating nested hitobjects in-case they're needed
|
||||||
foreach (var obj in converted.HitObjects)
|
foreach (var obj in converted.HitObjects)
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Online.API
|
|||||||
|
|
||||||
public Mod ToMod(Ruleset ruleset)
|
public Mod ToMod(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
Mod resultMod = ruleset.CreateModFromAcronym(Acronym);
|
Mod? resultMod = ruleset.CreateModFromAcronym(Acronym);
|
||||||
|
|
||||||
if (resultMod == null)
|
if (resultMod == null)
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -93,7 +94,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
t.Colour = entryColour;
|
t.Colour = entryColour;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(entry.Repository))
|
if (!string.IsNullOrEmpty(entry.Repository) && !string.IsNullOrEmpty(entry.GithubUrl))
|
||||||
addRepositoryReference(title, entryColour);
|
addRepositoryReference(title, entryColour);
|
||||||
|
|
||||||
if (entry.GithubUser != null)
|
if (entry.GithubUser != null)
|
||||||
@ -104,17 +105,22 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
private void addRepositoryReference(LinkFlowContainer title, Color4 entryColour)
|
private void addRepositoryReference(LinkFlowContainer title, Color4 entryColour)
|
||||||
{
|
{
|
||||||
|
Debug.Assert(!string.IsNullOrEmpty(entry.Repository));
|
||||||
|
Debug.Assert(!string.IsNullOrEmpty(entry.GithubUrl));
|
||||||
|
|
||||||
title.AddText(" (", t =>
|
title.AddText(" (", t =>
|
||||||
{
|
{
|
||||||
t.Font = fontLarge;
|
t.Font = fontLarge;
|
||||||
t.Colour = entryColour;
|
t.Colour = entryColour;
|
||||||
});
|
});
|
||||||
|
|
||||||
title.AddLink($"{entry.Repository.Replace("ppy/", "")}#{entry.GithubPullRequestId}", entry.GithubUrl,
|
title.AddLink($"{entry.Repository.Replace("ppy/", "")}#{entry.GithubPullRequestId}", entry.GithubUrl,
|
||||||
t =>
|
t =>
|
||||||
{
|
{
|
||||||
t.Font = fontLarge;
|
t.Font = fontLarge;
|
||||||
t.Colour = entryColour;
|
t.Colour = entryColour;
|
||||||
});
|
});
|
||||||
|
|
||||||
title.AddText(")", t =>
|
title.AddText(")", t =>
|
||||||
{
|
{
|
||||||
t.Font = fontLarge;
|
t.Font = fontLarge;
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SettingsSubsection section = ruleset.CreateSettings();
|
SettingsSubsection? section = ruleset.CreateSettings();
|
||||||
|
|
||||||
if (section != null)
|
if (section != null)
|
||||||
Add(section);
|
Add(section);
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets
|
namespace osu.Game.Rulesets
|
||||||
{
|
{
|
||||||
public interface ILegacyRuleset
|
public interface ILegacyRuleset
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Extensions.EnumExtensions;
|
using osu.Framework.Extensions.EnumExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -100,7 +97,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// Returns a fresh instance of the mod matching the specified acronym.
|
/// Returns a fresh instance of the mod matching the specified acronym.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="acronym">The acronym to query for .</param>
|
/// <param name="acronym">The acronym to query for .</param>
|
||||||
public Mod CreateModFromAcronym(string acronym)
|
public Mod? CreateModFromAcronym(string acronym)
|
||||||
{
|
{
|
||||||
return AllMods.FirstOrDefault(m => m.Acronym == acronym)?.CreateInstance();
|
return AllMods.FirstOrDefault(m => m.Acronym == acronym)?.CreateInstance();
|
||||||
}
|
}
|
||||||
@ -108,7 +105,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a fresh instance of the mod matching the specified type.
|
/// Returns a fresh instance of the mod matching the specified type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public T CreateMod<T>()
|
public T? CreateMod<T>()
|
||||||
where T : Mod
|
where T : Mod
|
||||||
{
|
{
|
||||||
return AllMods.FirstOrDefault(m => m is T)?.CreateInstance() as T;
|
return AllMods.FirstOrDefault(m => m is T)?.CreateInstance() as T;
|
||||||
@ -122,7 +119,6 @@ namespace osu.Game.Rulesets
|
|||||||
/// then the proper behaviour is to return an empty enumerable.
|
/// then the proper behaviour is to return an empty enumerable.
|
||||||
/// <see langword="null"/> mods should not be present in the returned enumerable.
|
/// <see langword="null"/> mods should not be present in the returned enumerable.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[ItemNotNull]
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -202,10 +198,9 @@ namespace osu.Game.Rulesets
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CanBeNull]
|
public ModAutoplay? GetAutoplayMod() => CreateMod<ModAutoplay>();
|
||||||
public ModAutoplay GetAutoplayMod() => CreateMod<ModAutoplay>();
|
|
||||||
|
|
||||||
public virtual ISkin CreateLegacySkinProvider([NotNull] ISkin skin, IBeatmap beatmap) => null;
|
public virtual ISkin? CreateLegacySkinProvider(ISkin skin, IBeatmap beatmap) => null;
|
||||||
|
|
||||||
protected Ruleset()
|
protected Ruleset()
|
||||||
{
|
{
|
||||||
@ -225,7 +220,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// <param name="beatmap">The beatmap to create the hit renderer for.</param>
|
/// <param name="beatmap">The beatmap to create the hit renderer for.</param>
|
||||||
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
|
/// <param name="mods">The <see cref="Mod"/>s to apply.</param>
|
||||||
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
|
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
|
||||||
public abstract DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod> mods = null);
|
public abstract DrawableRuleset CreateDrawableRulesetWith(IBeatmap beatmap, IReadOnlyList<Mod>? mods = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a <see cref="ScoreProcessor"/> for this <see cref="Ruleset"/>.
|
/// Creates a <see cref="ScoreProcessor"/> for this <see cref="Ruleset"/>.
|
||||||
@ -251,7 +246,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="beatmap">The <see cref="IBeatmap"/> to be processed.</param>
|
/// <param name="beatmap">The <see cref="IBeatmap"/> to be processed.</param>
|
||||||
/// <returns>The <see cref="IBeatmapProcessor"/>.</returns>
|
/// <returns>The <see cref="IBeatmapProcessor"/>.</returns>
|
||||||
public virtual IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => null;
|
public virtual IBeatmapProcessor? CreateBeatmapProcessor(IBeatmap beatmap) => null;
|
||||||
|
|
||||||
public abstract DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap);
|
public abstract DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap);
|
||||||
|
|
||||||
@ -259,12 +254,11 @@ namespace osu.Game.Rulesets
|
|||||||
/// Optionally creates a <see cref="PerformanceCalculator"/> to generate performance data from the provided score.
|
/// Optionally creates a <see cref="PerformanceCalculator"/> to generate performance data from the provided score.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A performance calculator instance for the provided score.</returns>
|
/// <returns>A performance calculator instance for the provided score.</returns>
|
||||||
[CanBeNull]
|
public virtual PerformanceCalculator? CreatePerformanceCalculator() => null;
|
||||||
public virtual PerformanceCalculator CreatePerformanceCalculator() => null;
|
|
||||||
|
|
||||||
public virtual HitObjectComposer CreateHitObjectComposer() => null;
|
public virtual HitObjectComposer? CreateHitObjectComposer() => null;
|
||||||
|
|
||||||
public virtual IBeatmapVerifier CreateBeatmapVerifier() => null;
|
public virtual IBeatmapVerifier? CreateBeatmapVerifier() => null;
|
||||||
|
|
||||||
public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.QuestionCircle };
|
public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.QuestionCircle };
|
||||||
|
|
||||||
@ -272,13 +266,13 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public abstract string Description { get; }
|
public abstract string Description { get; }
|
||||||
|
|
||||||
public virtual RulesetSettingsSubsection CreateSettings() => null;
|
public virtual RulesetSettingsSubsection? CreateSettings() => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the <see cref="IRulesetConfigManager"/> for this <see cref="Ruleset"/>.
|
/// Creates the <see cref="IRulesetConfigManager"/> for this <see cref="Ruleset"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="settings">The <see cref="SettingsStore"/> to store the settings.</param>
|
/// <param name="settings">The <see cref="SettingsStore"/> to store the settings.</param>
|
||||||
public virtual IRulesetConfigManager CreateConfig(SettingsStore settings) => null;
|
public virtual IRulesetConfigManager? CreateConfig(SettingsStore? settings) => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A unique short name to reference this ruleset in online requests.
|
/// A unique short name to reference this ruleset in online requests.
|
||||||
@ -314,7 +308,7 @@ namespace osu.Game.Rulesets
|
|||||||
/// for conversion use.
|
/// for conversion use.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>An empty frame for the current ruleset, or null if unsupported.</returns>
|
/// <returns>An empty frame for the current ruleset, or null if unsupported.</returns>
|
||||||
public virtual IConvertibleReplayFrame CreateConvertibleReplayFrame() => null;
|
public virtual IConvertibleReplayFrame? CreateConvertibleReplayFrame() => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the statistics for a <see cref="ScoreInfo"/> to be displayed in the results screen.
|
/// Creates the statistics for a <see cref="ScoreInfo"/> to be displayed in the results screen.
|
||||||
@ -322,7 +316,6 @@ namespace osu.Game.Rulesets
|
|||||||
/// <param name="score">The <see cref="ScoreInfo"/> to create the statistics for. The score is guaranteed to have <see cref="ScoreInfo.HitEvents"/> populated.</param>
|
/// <param name="score">The <see cref="ScoreInfo"/> to create the statistics for. The score is guaranteed to have <see cref="ScoreInfo.HitEvents"/> populated.</param>
|
||||||
/// <param name="playableBeatmap">The <see cref="IBeatmap"/>, converted for this <see cref="Ruleset"/> with all relevant <see cref="Mod"/>s applied.</param>
|
/// <param name="playableBeatmap">The <see cref="IBeatmap"/>, converted for this <see cref="Ruleset"/> with all relevant <see cref="Mod"/>s applied.</param>
|
||||||
/// <returns>The <see cref="StatisticRow"/>s to display. Each <see cref="StatisticRow"/> may contain 0 or more <see cref="StatisticItem"/>.</returns>
|
/// <returns>The <see cref="StatisticRow"/>s to display. Each <see cref="StatisticRow"/> may contain 0 or more <see cref="StatisticItem"/>.</returns>
|
||||||
[NotNull]
|
|
||||||
public virtual StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap) => Array.Empty<StatisticRow>();
|
public virtual StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap) => Array.Empty<StatisticRow>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -375,13 +368,11 @@ namespace osu.Game.Rulesets
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates ruleset-specific beatmap filter criteria to be used on the song select screen.
|
/// Creates ruleset-specific beatmap filter criteria to be used on the song select screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[CanBeNull]
|
public virtual IRulesetFilterCriteria? CreateRulesetFilterCriteria() => null;
|
||||||
public virtual IRulesetFilterCriteria CreateRulesetFilterCriteria() => null;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Can be overridden to add a ruleset-specific section to the editor beatmap setup screen.
|
/// Can be overridden to add a ruleset-specific section to the editor beatmap setup screen.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[CanBeNull]
|
public virtual RulesetSetupSection? CreateEditorSetupSection() => null;
|
||||||
public virtual RulesetSetupSection CreateEditorSetupSection() => null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -18,7 +16,7 @@ namespace osu.Game.Rulesets
|
|||||||
private readonly RealmAccess realm;
|
private readonly RealmAccess realm;
|
||||||
private readonly RulesetStore rulesets;
|
private readonly RulesetStore rulesets;
|
||||||
|
|
||||||
private readonly Dictionary<string, IRulesetConfigManager> configCache = new Dictionary<string, IRulesetConfigManager>();
|
private readonly Dictionary<string, IRulesetConfigManager?> configCache = new Dictionary<string, IRulesetConfigManager?>();
|
||||||
|
|
||||||
public RulesetConfigCache(RealmAccess realm, RulesetStore rulesets)
|
public RulesetConfigCache(RealmAccess realm, RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
@ -42,7 +40,7 @@ namespace osu.Game.Rulesets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IRulesetConfigManager GetConfigFor(Ruleset ruleset)
|
public IRulesetConfigManager? GetConfigFor(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
throw new InvalidOperationException($@"Cannot retrieve {nameof(IRulesetConfigManager)} before {nameof(RulesetConfigCache)} has loaded");
|
throw new InvalidOperationException($@"Cannot retrieve {nameof(IRulesetConfigManager)} before {nameof(RulesetConfigCache)} has loaded");
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System.Diagnostics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -84,6 +85,7 @@ namespace osu.Game.Screens.Play
|
|||||||
foreach (var frame in bundle.Frames)
|
foreach (var frame in bundle.Frames)
|
||||||
{
|
{
|
||||||
IConvertibleReplayFrame convertibleFrame = GameplayState.Ruleset.CreateConvertibleReplayFrame();
|
IConvertibleReplayFrame convertibleFrame = GameplayState.Ruleset.CreateConvertibleReplayFrame();
|
||||||
|
Debug.Assert(convertibleFrame != null);
|
||||||
convertibleFrame.FromLegacy(frame, GameplayState.Beatmap);
|
convertibleFrame.FromLegacy(frame, GameplayState.Beatmap);
|
||||||
|
|
||||||
var convertedFrame = (ReplayFrame)convertibleFrame;
|
var convertedFrame = (ReplayFrame)convertibleFrame;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Configuration;
|
using osu.Game.Rulesets.Configuration;
|
||||||
@ -14,8 +12,8 @@ namespace osu.Game.Tests.Rulesets
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class TestRulesetConfigCache : IRulesetConfigCache
|
public class TestRulesetConfigCache : IRulesetConfigCache
|
||||||
{
|
{
|
||||||
private readonly ConcurrentDictionary<string, IRulesetConfigManager> configCache = new ConcurrentDictionary<string, IRulesetConfigManager>();
|
private readonly ConcurrentDictionary<string, IRulesetConfigManager?> configCache = new ConcurrentDictionary<string, IRulesetConfigManager?>();
|
||||||
|
|
||||||
public IRulesetConfigManager GetConfigFor(Ruleset ruleset) => configCache.GetOrAdd(ruleset.ShortName, _ => ruleset.CreateConfig(null));
|
public IRulesetConfigManager? GetConfigFor(Ruleset ruleset) => configCache.GetOrAdd(ruleset.ShortName, _ => ruleset.CreateConfig(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user