Skip to content

Commit

Permalink
framework upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Mar 19, 2023
1 parent c635514 commit 316e8a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
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

0 comments on commit 316e8a5

Please sign in to comment.