mirror of
https://github.com/osukey/osukey.git
synced 2025-06-07 20:37:57 +09:00
Fix CI reported warnings
This commit is contained in:
parent
08da948afc
commit
51251e3204
@ -174,7 +174,7 @@ namespace osu.Game.Rulesets.Osu.Statistics
|
|||||||
|
|
||||||
pointGrid.Content = points;
|
pointGrid.Content = points;
|
||||||
|
|
||||||
if (score.HitEvents == null || score.HitEvents.Count == 0)
|
if (score.HitEvents.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Todo: This should probably not be done like this.
|
// Todo: This should probably not be done like this.
|
||||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
{
|
{
|
||||||
var beatmap = decodeAsJson(normal);
|
var beatmap = decodeAsJson(normal);
|
||||||
var meta = beatmap.BeatmapInfo.Metadata;
|
var meta = beatmap.BeatmapInfo.Metadata;
|
||||||
Assert.AreEqual(241526, beatmap.BeatmapInfo.BeatmapSet.OnlineID);
|
Assert.AreEqual(241526, beatmap.BeatmapInfo.BeatmapSet?.OnlineID);
|
||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
var meta = beatmap.Metadata;
|
var meta = beatmap.Metadata;
|
||||||
|
|
||||||
Assert.AreEqual(241526, beatmap.BeatmapInfo.BeatmapSet.OnlineID);
|
Assert.AreEqual(241526, beatmap.BeatmapInfo.BeatmapSet?.OnlineID);
|
||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Rulesets.Osu.Beatmaps;
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Screens.Edit;
|
using osu.Game.Screens.Edit;
|
||||||
@ -30,7 +31,13 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
|
|
||||||
AddStep("add beatmap", () =>
|
AddStep("add beatmap", () =>
|
||||||
{
|
{
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
});
|
||||||
editorBeatmap.HitObjectAdded += h => addedObject = h;
|
editorBeatmap.HitObjectAdded += h => addedObject = h;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -49,7 +56,14 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
EditorBeatmap editorBeatmap = null;
|
EditorBeatmap editorBeatmap = null;
|
||||||
AddStep("add beatmap", () =>
|
AddStep("add beatmap", () =>
|
||||||
{
|
{
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap { HitObjects = { hitCircle } });
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
HitObjects = { hitCircle }
|
||||||
|
});
|
||||||
editorBeatmap.HitObjectRemoved += h => removedObject = h;
|
editorBeatmap.HitObjectRemoved += h => removedObject = h;
|
||||||
});
|
});
|
||||||
AddStep("remove hitobject", () => editorBeatmap.Remove(editorBeatmap.HitObjects.First()));
|
AddStep("remove hitobject", () => editorBeatmap.Remove(editorBeatmap.HitObjects.First()));
|
||||||
@ -71,7 +85,14 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
{
|
{
|
||||||
EditorBeatmap editorBeatmap;
|
EditorBeatmap editorBeatmap;
|
||||||
|
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap { HitObjects = { hitCircle } });
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
HitObjects = { hitCircle }
|
||||||
|
});
|
||||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -91,7 +112,13 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
|
|
||||||
AddStep("add beatmap", () =>
|
AddStep("add beatmap", () =>
|
||||||
{
|
{
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
});
|
||||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -111,7 +138,14 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
public void TestRemovedHitObjectStartTimeChangeEvent()
|
public void TestRemovedHitObjectStartTimeChangeEvent()
|
||||||
{
|
{
|
||||||
var hitCircle = new HitCircle();
|
var hitCircle = new HitCircle();
|
||||||
var editorBeatmap = new EditorBeatmap(new OsuBeatmap { HitObjects = { hitCircle } });
|
var editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
HitObjects = { hitCircle }
|
||||||
|
});
|
||||||
|
|
||||||
HitObject changedObject = null;
|
HitObject changedObject = null;
|
||||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||||
@ -131,6 +165,10 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
{
|
{
|
||||||
var editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
var editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
{
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
HitObjects =
|
HitObjects =
|
||||||
{
|
{
|
||||||
new HitCircle(),
|
new HitCircle(),
|
||||||
@ -156,6 +194,10 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
|
|
||||||
var editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
var editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
{
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
HitObjects =
|
HitObjects =
|
||||||
{
|
{
|
||||||
new HitCircle(),
|
new HitCircle(),
|
||||||
@ -185,7 +227,13 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
{
|
{
|
||||||
updatedObjects.Clear();
|
updatedObjects.Clear();
|
||||||
|
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
@ -220,7 +268,13 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
{
|
{
|
||||||
updatedObjects.Clear();
|
updatedObjects.Clear();
|
||||||
|
|
||||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
Ruleset = new OsuRuleset().RulesetInfo,
|
||||||
|
},
|
||||||
|
});
|
||||||
editorBeatmap.Add(new HitCircle());
|
editorBeatmap.Add(new HitCircle());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -9,11 +9,9 @@ using System.Threading.Tasks;
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.IO.Archives;
|
using osu.Game.IO.Archives;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Rulesets.Osu.Mods;
|
using osu.Game.Rulesets.Osu.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
@ -151,12 +149,8 @@ namespace osu.Game.Tests.Scores.IO
|
|||||||
|
|
||||||
public static async Task<ScoreInfo> LoadScoreIntoOsu(OsuGameBase osu, ScoreInfo score, ArchiveReader archive = null)
|
public static async Task<ScoreInfo> LoadScoreIntoOsu(OsuGameBase osu, ScoreInfo score, ArchiveReader archive = null)
|
||||||
{
|
{
|
||||||
var beatmapManager = osu.Dependencies.Get<BeatmapManager>();
|
|
||||||
|
|
||||||
// clone to avoid attaching the input score to realm.
|
// clone to avoid attaching the input score to realm.
|
||||||
score = score.DeepClone();
|
score = score.DeepClone();
|
||||||
score.BeatmapInfo ??= beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First();
|
|
||||||
score.Ruleset ??= new OsuRuleset().RulesetInfo;
|
|
||||||
|
|
||||||
var scoreManager = osu.Dependencies.Get<ScoreManager>();
|
var scoreManager = osu.Dependencies.Get<ScoreManager>();
|
||||||
await scoreManager.Import(score, archive);
|
await scoreManager.Import(score, archive);
|
||||||
|
@ -70,7 +70,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
var beatmap = new BeatmapInfo
|
var beatmap = new BeatmapInfo
|
||||||
{
|
{
|
||||||
Ruleset = rulesets.GetRuleset(i % 4),
|
Ruleset = rulesets.GetRuleset(i % 4) ?? throw new InvalidOperationException(),
|
||||||
OnlineID = beatmapId,
|
OnlineID = beatmapId,
|
||||||
Length = length,
|
Length = length,
|
||||||
BPM = bpm,
|
BPM = bpm,
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
{
|
{
|
||||||
AddStep("set beatmap", () => advancedStats.BeatmapInfo = new BeatmapInfo
|
AddStep("set beatmap", () => advancedStats.BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
Ruleset = rulesets.GetRuleset(3),
|
Ruleset = rulesets.GetRuleset(3) ?? throw new InvalidOperationException(),
|
||||||
BaseDifficulty = new BeatmapDifficulty
|
BaseDifficulty = new BeatmapDifficulty
|
||||||
{
|
{
|
||||||
CircleSize = 5,
|
CircleSize = 5,
|
||||||
|
@ -81,7 +81,7 @@ namespace osu.Game.Tournament
|
|||||||
|
|
||||||
ladder ??= new LadderInfo();
|
ladder ??= new LadderInfo();
|
||||||
|
|
||||||
ladder.Ruleset.Value = RulesetStore.GetRuleset(ladder.Ruleset.Value?.ShortName)
|
ladder.Ruleset.Value = RulesetStore.GetRuleset(ladder.Ruleset.Value.ShortName)
|
||||||
?? RulesetStore.AvailableRulesets.First();
|
?? RulesetStore.AvailableRulesets.First();
|
||||||
|
|
||||||
bool addedInfo = false;
|
bool addedInfo = false;
|
||||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ScoreInfo CreateScoreInfo(RulesetStore rulesets, BeatmapInfo beatmap = null)
|
public ScoreInfo CreateScoreInfo(RulesetStore rulesets, BeatmapInfo beatmap = null)
|
||||||
{
|
{
|
||||||
var ruleset = rulesets.GetRuleset(RulesetID);
|
var ruleset = rulesets.GetRuleset(RulesetID) ?? throw new InvalidOperationException();
|
||||||
|
|
||||||
var rulesetInstance = ruleset.CreateInstance();
|
var rulesetInstance = ruleset.CreateInstance();
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
{
|
{
|
||||||
TotalScore = TotalScore,
|
TotalScore = TotalScore,
|
||||||
MaxCombo = MaxCombo,
|
MaxCombo = MaxCombo,
|
||||||
BeatmapInfo = beatmap,
|
BeatmapInfo = beatmap ?? new BeatmapInfo(),
|
||||||
User = User,
|
User = User,
|
||||||
Accuracy = Accuracy,
|
Accuracy = Accuracy,
|
||||||
OnlineID = OnlineID,
|
OnlineID = OnlineID,
|
||||||
|
@ -73,7 +73,7 @@ namespace osu.Game.Online.Rooms
|
|||||||
TotalScore = TotalScore,
|
TotalScore = TotalScore,
|
||||||
MaxCombo = MaxCombo,
|
MaxCombo = MaxCombo,
|
||||||
BeatmapInfo = beatmap,
|
BeatmapInfo = beatmap,
|
||||||
Ruleset = rulesets.GetRuleset(playlistItem.RulesetID),
|
Ruleset = rulesets.GetRuleset(playlistItem.RulesetID) ?? throw new InvalidOperationException(),
|
||||||
Statistics = Statistics,
|
Statistics = Statistics,
|
||||||
User = User,
|
User = User,
|
||||||
Accuracy = Accuracy,
|
Accuracy = Accuracy,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// 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 System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@ -131,9 +132,14 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
|
|||||||
Origin = Anchor.CentreRight,
|
Origin = Anchor.CentreRight,
|
||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
Spacing = new Vector2(2),
|
Spacing = new Vector2(2),
|
||||||
Children = Score.Mods.Select(mod => new ModIcon(rulesets.GetRuleset(Score.RulesetID).CreateInstance().CreateModFromAcronym(mod.Acronym))
|
Children = Score.Mods.Select(mod =>
|
||||||
|
{
|
||||||
|
var ruleset = rulesets.GetRuleset(Score.RulesetID) ?? throw new InvalidOperationException();
|
||||||
|
|
||||||
|
return new ModIcon(ruleset.CreateInstance().CreateModFromAcronym(mod.Acronym))
|
||||||
{
|
{
|
||||||
Scale = new Vector2(0.35f)
|
Scale = new Vector2(0.35f)
|
||||||
|
};
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
else if (texture.Width < low_width || texture.Height < low_height)
|
else if (texture.Width < low_width || texture.Height < low_height)
|
||||||
yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);
|
yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);
|
||||||
|
|
||||||
string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(backgroundFile);
|
string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet?.GetPathForFile(backgroundFile);
|
||||||
|
|
||||||
using (Stream stream = context.WorkingBeatmap.GetStream(storagePath))
|
using (Stream stream = context.WorkingBeatmap.GetStream(storagePath))
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the file is set, also make sure it still exists.
|
// If the file is set, also make sure it still exists.
|
||||||
string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(filename);
|
string storagePath = context.Beatmap.BeatmapInfo.BeatmapSet?.GetPathForFile(filename);
|
||||||
if (storagePath != null)
|
if (storagePath != null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
{
|
{
|
||||||
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
||||||
|
|
||||||
|
if (beatmapSet != null)
|
||||||
|
{
|
||||||
foreach (var file in beatmapSet.Files)
|
foreach (var file in beatmapSet.Files)
|
||||||
{
|
{
|
||||||
using (Stream data = context.WorkingBeatmap.GetStream(file.File.GetStoragePath()))
|
using (Stream data = context.WorkingBeatmap.GetStream(file.File.GetStoragePath()))
|
||||||
@ -59,6 +61,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLower().EndsWith);
|
private bool hasAudioExtension(string filename) => audioExtensions.Any(filename.ToLower().EndsWith);
|
||||||
private bool probablyHasAudioData(Stream data) => data.Length > min_bytes_threshold;
|
private bool probablyHasAudioData(Stream data) => data.Length > min_bytes_threshold;
|
||||||
|
@ -21,6 +21,8 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
{
|
{
|
||||||
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
var beatmapSet = context.Beatmap.BeatmapInfo.BeatmapSet;
|
||||||
|
|
||||||
|
if (beatmapSet != null)
|
||||||
|
{
|
||||||
foreach (var file in beatmapSet.Files)
|
foreach (var file in beatmapSet.Files)
|
||||||
{
|
{
|
||||||
using (Stream data = context.WorkingBeatmap.GetStream(file.File.GetStoragePath()))
|
using (Stream data = context.WorkingBeatmap.GetStream(file.File.GetStoragePath()))
|
||||||
@ -30,6 +32,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class IssueTemplateZeroBytes : IssueTemplate
|
public class IssueTemplateZeroBytes : IssueTemplate
|
||||||
{
|
{
|
||||||
|
@ -76,9 +76,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
var difficulty = beatmap.Value.BeatmapInfo.BaseDifficulty;
|
var difficulty = beatmap.Value.BeatmapInfo.BaseDifficulty;
|
||||||
|
|
||||||
if (difficulty == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// generally should always be implemented, else the slider will have a zero default.
|
// generally should always be implemented, else the slider will have a zero default.
|
||||||
if (difficultyBindable.ReadCurrentFromDifficulty == null)
|
if (difficultyBindable.ReadCurrentFromDifficulty == null)
|
||||||
return;
|
return;
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit.Components.Menus
|
|||||||
public BeatmapInfo BeatmapInfo { get; }
|
public BeatmapInfo BeatmapInfo { get; }
|
||||||
|
|
||||||
public DifficultyMenuItem(BeatmapInfo beatmapInfo, bool selected, Action<BeatmapInfo> difficultyChangeFunc)
|
public DifficultyMenuItem(BeatmapInfo beatmapInfo, bool selected, Action<BeatmapInfo> difficultyChangeFunc)
|
||||||
: base(beatmapInfo.DifficultyName ?? "(unnamed)", null)
|
: base(string.IsNullOrEmpty(beatmapInfo.DifficultyName) ? "(unnamed)" : beatmapInfo.DifficultyName, null)
|
||||||
{
|
{
|
||||||
BeatmapInfo = beatmapInfo;
|
BeatmapInfo = beatmapInfo;
|
||||||
State.Value = selected;
|
State.Value = selected;
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Screens.Edit.Compose
|
|||||||
{
|
{
|
||||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
ruleset = parent.Get<IBindable<WorkingBeatmap>>().Value.BeatmapInfo.Ruleset?.CreateInstance();
|
ruleset = parent.Get<IBindable<WorkingBeatmap>>().Value.BeatmapInfo.Ruleset.CreateInstance();
|
||||||
composer = ruleset?.CreateHitObjectComposer();
|
composer = ruleset?.CreateHitObjectComposer();
|
||||||
|
|
||||||
// make the composer available to the timeline and other components in this screen.
|
// make the composer available to the timeline and other components in this screen.
|
||||||
|
@ -599,6 +599,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
if (isNewBeatmap)
|
if (isNewBeatmap)
|
||||||
{
|
{
|
||||||
// confirming exit without save means we should delete the new beatmap completely.
|
// confirming exit without save means we should delete the new beatmap completely.
|
||||||
|
if (playableBeatmap.BeatmapInfo.BeatmapSet != null)
|
||||||
beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet);
|
beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet);
|
||||||
|
|
||||||
// eagerly clear contents before restoring default beatmap to prevent value change callbacks from firing.
|
// eagerly clear contents before restoring default beatmap to prevent value change callbacks from firing.
|
||||||
|
@ -102,7 +102,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
if (beatmapSkin is Skin skin)
|
if (beatmapSkin is Skin skin)
|
||||||
BeatmapSkin = new EditorBeatmapSkin(skin);
|
BeatmapSkin = new EditorBeatmapSkin(skin);
|
||||||
|
|
||||||
beatmapProcessor = playableBeatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateBeatmapProcessor(PlayableBeatmap);
|
beatmapProcessor = playableBeatmap.BeatmapInfo.Ruleset.CreateInstance().CreateBeatmapProcessor(PlayableBeatmap);
|
||||||
|
|
||||||
foreach (var obj in HitObjects)
|
foreach (var obj in HitObjects)
|
||||||
trackStartTime(obj);
|
trackStartTime(obj);
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
new DesignSection(),
|
new DesignSection(),
|
||||||
};
|
};
|
||||||
|
|
||||||
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset?.CreateInstance().CreateEditorSetupSection();
|
var rulesetSpecificSection = beatmap.BeatmapInfo.Ruleset.CreateInstance().CreateEditorSetupSection();
|
||||||
if (rulesetSpecificSection != null)
|
if (rulesetSpecificSection != null)
|
||||||
sectionsEnumerable.Add(rulesetSpecificSection);
|
sectionsEnumerable.Add(rulesetSpecificSection);
|
||||||
|
|
||||||
|
@ -1,7 +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.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -13,7 +12,6 @@ using osu.Framework.Input.Events;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.Placeholders;
|
using osu.Game.Online.Placeholders;
|
||||||
using osu.Game.Rulesets.Mods;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -76,7 +74,7 @@ namespace osu.Game.Screens.Ranking.Statistics
|
|||||||
if (newScore == null)
|
if (newScore == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (newScore.HitEvents == null || newScore.HitEvents.Count == 0)
|
if (newScore.HitEvents.Count == 0)
|
||||||
{
|
{
|
||||||
content.Add(new FillFlowContainer
|
content.Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
@ -104,7 +102,7 @@ namespace osu.Game.Screens.Ranking.Statistics
|
|||||||
// Todo: The placement of this is temporary. Eventually we'll both generate the playable beatmap _and_ run through it in a background task to generate the hit events.
|
// Todo: The placement of this is temporary. Eventually we'll both generate the playable beatmap _and_ run through it in a background task to generate the hit events.
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
playableBeatmap = beatmapManager.GetWorkingBeatmap(newScore.BeatmapInfo).GetPlayableBeatmap(newScore.Ruleset, newScore.Mods ?? Array.Empty<Mod>());
|
playableBeatmap = beatmapManager.GetWorkingBeatmap(newScore.BeatmapInfo).GetPlayableBeatmap(newScore.Ruleset, newScore.Mods);
|
||||||
}, loadCancellation.Token).ContinueWith(t => Schedule(() =>
|
}, loadCancellation.Token).ContinueWith(t => Schedule(() =>
|
||||||
{
|
{
|
||||||
var rows = new FillFlowContainer
|
var rows = new FillFlowContainer
|
||||||
|
@ -324,7 +324,7 @@ namespace osu.Game.Screens.Select
|
|||||||
});
|
});
|
||||||
|
|
||||||
// no difficulty means it can't have a status to show
|
// no difficulty means it can't have a status to show
|
||||||
if (beatmapInfo.DifficultyName == null)
|
if (string.IsNullOrEmpty(beatmapInfo.DifficultyName))
|
||||||
StatusPill.Hide();
|
StatusPill.Hide();
|
||||||
|
|
||||||
addInfoLabels();
|
addInfoLabels();
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Screens.Select
|
|||||||
if (!maximumStars.IsDefault)
|
if (!maximumStars.IsDefault)
|
||||||
criteria.UserStarDifficulty.Max = maximumStars.Value;
|
criteria.UserStarDifficulty.Max = maximumStars.Value;
|
||||||
|
|
||||||
criteria.RulesetCriteria = ruleset.Value.CreateInstance()?.CreateRulesetFilterCriteria();
|
criteria.RulesetCriteria = ruleset.Value.CreateInstance().CreateRulesetFilterCriteria();
|
||||||
|
|
||||||
FilterQueryParser.ApplyQueries(criteria, query);
|
FilterQueryParser.ApplyQueries(criteria, query);
|
||||||
return criteria;
|
return criteria;
|
||||||
|
@ -98,6 +98,8 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
userSkinInfo.Files.Clear();
|
userSkinInfo.Files.Clear();
|
||||||
userSkinInfo.Files.Add(new RealmNamedFileUsage(new RealmFile { Hash = userFile }, userFile));
|
userSkinInfo.Files.Add(new RealmNamedFileUsage(new RealmFile { Hash = userFile }, userFile));
|
||||||
|
|
||||||
|
Debug.Assert(beatmapInfo.BeatmapSet != null);
|
||||||
|
|
||||||
beatmapInfo.BeatmapSet.Files.Clear();
|
beatmapInfo.BeatmapSet.Files.Clear();
|
||||||
beatmapInfo.BeatmapSet.Files.Add(new RealmNamedFileUsage(new RealmFile { Hash = beatmapFile }, beatmapFile));
|
beatmapInfo.BeatmapSet.Files.Add(new RealmNamedFileUsage(new RealmFile { Hash = beatmapFile }, beatmapFile));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user