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

Add Gameplay Accuracy Heatmap #31158

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix unnecessary null check and dangling delegate
  • Loading branch information
normalid-awa committed Jan 9, 2025
commit 9002e540ab361b659847ebed203412ecfa44efd2
10 changes: 10 additions & 0 deletions osu.Game.Rulesets.Osu/Skinning/GameplayAccuracyHeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ protected override void LoadComplete()
scoreProcessor.NewJudgement += updateHeatmap;
}

protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

if (gameplayClockContainer != null)
gameplayClockContainer.OnSeek -= initHeatmap;

scoreProcessor.NewJudgement -= updateHeatmap;
}

private void initHeatmap()
{
ScoreInfo scoreInfo = new ScoreInfo { BeatmapInfo = beatmap.Value.BeatmapInfo, HitEvents = (List<HitEvent>)scoreProcessor.HitEvents };
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public partial class AccuracyHeatmap : CompositeDrawable
private const float rotation = 45;

private BufferedContainer bufferedGrid = null!;
private GridContainer? pointGrid;
private GridContainer pointGrid = null!;

private readonly ScoreInfo score;
private readonly IBeatmap playableBeatmap;
Expand Down Expand Up @@ -234,7 +234,7 @@ private void load()

public void AddPoint(Vector2 start, Vector2 end, Vector2 hitPoint, float radius)
{
if (pointGrid == null || pointGrid.Content.Count == 0)
if (pointGrid.Content.Count == 0)
return;

double angle1 = Math.Atan2(end.Y - hitPoint.Y, hitPoint.X - end.X); // Angle between the end point and the hit point.
Expand Down
Loading