Skip to content

Commit

Permalink
Use better way to get the config manager
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Mar 2, 2023
1 parent e062da5 commit 8b82d9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osu.Game.Rulesets.Karaoke/Mods/KaraokeModFlashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ public override void ApplyToDrawableRuleset(DrawableRuleset<KaraokeHitObject> dr
{
base.ApplyToDrawableRuleset(drawableRuleset);

var notePlayfield = (drawableRuleset as DrawableKaraokeRuleset)?.Playfield?.NotePlayfield;
var drawableKaraokeRuleset = drawableRuleset as DrawableKaraokeRuleset;

var notePlayfield = drawableKaraokeRuleset?.Playfield?.NotePlayfield;
if (notePlayfield == null)
return;

var flashlight = drawableRuleset.KeyBindingInputManager.Children.OfType<KaraokeFlashlight>().FirstOrDefault();
var flashlight = drawableKaraokeRuleset?.KeyBindingInputManager.Children.OfType<KaraokeFlashlight>().FirstOrDefault();
if (flashlight == null)
return;

Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Karaoke/UI/DrawableKaraokeRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public partial class DrawableKaraokeRuleset : DrawableScrollingRuleset<KaraokeHi

public new KaraokeRulesetConfigManager Config => (KaraokeRulesetConfigManager)base.Config;

public new KaraokeInputManager KeyBindingInputManager => (KaraokeInputManager)base.KeyBindingInputManager;

private readonly Bindable<KaraokeScrollingDirection> configDirection = new();

[Cached(typeof(INotePositionInfo))]
Expand Down

0 comments on commit 8b82d9e

Please sign in to comment.