-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade the package and fix the compile error
- Loading branch information
1 parent
4a5305a
commit 62a1e8c
Showing
4 changed files
with
32 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Linq; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
|
@@ -14,10 +15,12 @@ | |
using osu.Game.Rulesets.Karaoke.Objects; | ||
using osu.Game.Rulesets.Karaoke.Objects.Drawables; | ||
using osu.Game.Rulesets.Karaoke.Replays; | ||
using osu.Game.Rulesets.Karaoke.Scoring; | ||
using osu.Game.Rulesets.Karaoke.UI.Components; | ||
using osu.Game.Rulesets.Karaoke.UI.Position; | ||
using osu.Game.Rulesets.Karaoke.UI.Scrolling; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Rulesets.UI; | ||
using osu.Game.Skinning; | ||
using osuTK; | ||
|
@@ -33,6 +36,7 @@ public partial class NotePlayfield : ScrollingNotePlayfield, IKeyBindingHandler< | |
|
||
private readonly Container judgementArea; | ||
private readonly JudgementContainer<DrawableNoteJudgement> judgements; | ||
private readonly JudgementPooler<DrawableNoteJudgement> judgementPooler; | ||
private readonly Drawable judgementLine; | ||
private readonly ScoringMarker scoringMarker; | ||
|
||
|
@@ -121,6 +125,9 @@ public NotePlayfield(int columns) | |
}); | ||
|
||
AddInternal(scoringStatus = new ScoringStatus(ScoringStatusMode.NotInitialized)); | ||
|
||
var hitWindows = new KaraokeNoteHitWindows(); | ||
AddInternal(judgementPooler = new JudgementPooler<DrawableNoteJudgement>(Enum.GetValues<HitResult>().Where(r => hitWindows.IsHitResultAllowed(r)))); | ||
} | ||
|
||
protected override void OnDirectionChanged(KaraokeScrollingDirection direction, float judgementAreaPercentage) | ||
|
@@ -186,12 +193,14 @@ internal void OnNewResult(DrawableHitObject judgedObject, JudgementResult result | |
return; | ||
|
||
judgements.Clear(); | ||
judgements.Add(new DrawableNoteJudgement(result, judgedObject) | ||
judgements.Add(judgementPooler.Get(result.Type, j => | ||
{ | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
Y = notePositionInfo.Calculator.YPositionAt(note.HitObject.Tone + 2), | ||
}); | ||
j.Apply(result, judgedObject); | ||
|
||
j.Y = notePositionInfo.Calculator.YPositionAt(note.HitObject.Tone + 2); | ||
j.Anchor = Anchor.Centre; | ||
j.Origin = Anchor.Centre; | ||
})!); | ||
|
||
// Add hit explosion | ||
if (!result.IsHit) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters