mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 21:37:59 +09:00
Merge pull request #16939 from peppy/fix-intro-import-failure-ruleset-test-projects
Add safeties to skip attempted import of the intro beatmap when osu! ruleset not present
This commit is contained in:
commit
0cfb85f3bb
@ -19,6 +19,7 @@ using osu.Game.Database;
|
|||||||
using osu.Game.IO.Archives;
|
using osu.Game.IO.Archives;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -71,6 +72,9 @@ namespace osu.Game.Screens.Menu
|
|||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private readonly Func<OsuScreen> createNextScreen;
|
private readonly Func<OsuScreen> createNextScreen;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private RulesetStore rulesets { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the <see cref="Track"/> is provided by osu! resources, rather than a user beatmap.
|
/// Whether the <see cref="Track"/> is provided by osu! resources, rather than a user beatmap.
|
||||||
/// Only valid during or after <see cref="LogoArriving"/>.
|
/// Only valid during or after <see cref="LogoArriving"/>.
|
||||||
@ -117,7 +121,11 @@ namespace osu.Game.Screens.Menu
|
|||||||
// we generally want a song to be playing on startup, so use the intro music even if a user has specified not to if no other track is available.
|
// we generally want a song to be playing on startup, so use the intro music even if a user has specified not to if no other track is available.
|
||||||
if (initialBeatmap == null)
|
if (initialBeatmap == null)
|
||||||
{
|
{
|
||||||
if (!loadThemedIntro())
|
// Intro beatmaps are generally made using the osu! ruleset.
|
||||||
|
// It might not be present in test projects for other rulesets.
|
||||||
|
bool osuRulesetPresent = rulesets.GetRuleset(0) != null;
|
||||||
|
|
||||||
|
if (!loadThemedIntro() && osuRulesetPresent)
|
||||||
{
|
{
|
||||||
// if we detect that the theme track or beatmap is unavailable this is either first startup or things are in a bad state.
|
// if we detect that the theme track or beatmap is unavailable this is either first startup or things are in a bad state.
|
||||||
// this could happen if a user has nuked their files store. for now, reimport to repair this.
|
// this could happen if a user has nuked their files store. for now, reimport to repair this.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user