Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framework upgrades #1876

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Karaoke/Edit/Setup/KaraokeSetupSection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ public partial class KaraokeSetupSection : RulesetSetupSection
private LabelledSwitchButton scorable;
private LabelledSingerList singerList;

[Cached(typeof(IKaraokeBeatmapResourcesProvider))]
private KaraokeBeatmapResourcesProvider karaokeBeatmapResourcesProvider;

public KaraokeSetupSection()
: base(new KaraokeRuleset().RulesetInfo)
{
AddInternal(karaokeBeatmapResourcesProvider = new KaraokeBeatmapResourcesProvider());
}

[BackgroundDependencyLoader]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class KaraokeLyricHitWindows : KaraokeHitWindows
private static readonly DifficultyRange[] lyric_ranges =
{
new(DEFAULT_HIT_RESULT, 40, 20, 10),
new(HitResult.Miss, 400, 200, 100),
};

public override bool IsHitResultAllowed(HitResult result) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public bool OnPressed(KeyBindingPressEvent<KaraokeEditAction> e)
{
var caretPosition = lyricCaretState.CaretPosition;
if (caretPosition is not TimeTagCaretPosition timeTagCaretPosition)
throw new NotSupportedException(nameof(caretPosition));
throw new NotSupportedException(caretPosition?.GetType().Name ?? "(null)");

var currentTimeTag = timeTagCaretPosition.TimeTag;

Expand Down
8 changes: 3 additions & 5 deletions osu.Game.Rulesets.Karaoke/Skinning/Tools/SkinConverterTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ public static ICustomizedShader[] ConvertRightSideShader(ShaderManager? shaderMa

private static void attachShaders(ShaderManager shaderManager, IEnumerable<ICustomizedShader> shaders)
{
// TODO: StepShader should not inherit from ICustomizedShader
foreach (var shader in shaders)
{
switch (shader)
{
case InternalShader internalShader:
shaderManager.AttachShader(internalShader);
break;

case StepShader stepShader:
attachShaders(shaderManager, stepShader.StepShaders.ToArray());
break;
Expand All @@ -53,7 +50,8 @@ private static void attachShaders(ShaderManager shaderManager, IEnumerable<ICust
throw new InvalidCastException("shader cannot be null.");

default:
throw new InvalidCastException($"{shader.GetType()} cannot attach shader.");
shaderManager.AttachShader(shader);
break;
}
}
}
Expand Down