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

Fix slider repeats not properly respecting "show hit markers" setting #31354

Merged
merged 1 commit into from
Jan 2, 2025
Merged
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
8 changes: 8 additions & 0 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,21 @@ internal void SuppressHitAnimations()
{
UpdateState(ArmedState.Idle);
HeadCircle.SuppressHitAnimations();

foreach (var repeat in repeatContainer)
repeat.SuppressHitAnimations();

TailCircle.SuppressHitAnimations();
}

internal void RestoreHitAnimations()
{
UpdateState(ArmedState.Hit);
HeadCircle.RestoreHitAnimations();

foreach (var repeat in repeatContainer)
repeat.RestoreHitAnimations();

TailCircle.RestoreHitAnimations();
}

Expand Down
33 changes: 33 additions & 0 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderRepeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using osu.Game.Rulesets.Osu.Skinning.Default;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;

namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
Expand Down Expand Up @@ -163,5 +164,37 @@ public void UpdateSnakingPosition(Vector2 start, Vector2 end)
Arrow.Rotation = Interpolation.ValueAt(Math.Clamp(Clock.ElapsedFrameTime, 0, 100), Arrow.Rotation, aimRotation, 0, 50, Easing.OutQuint);
}
}

#region FOR EDITOR USE ONLY, DO NOT USE FOR ANY OTHER PURPOSE

internal void SuppressHitAnimations()
{
UpdateState(ArmedState.Idle);
UpdateComboColour();

// This method is called every frame in editor contexts, thus the lack of need for transforms.

bool hit = Time.Current >= HitStateUpdateTime;

if (hit)
{
// More or less matches stable (see https://github.com/peppy/osu-stable-reference/blob/bb57924c1552adbed11ee3d96cdcde47cf96f2b6/osu!/GameplayElements/HitObjects/Osu/HitCircleOsu.cs#L336-L338)
AccentColour.Value = Color4.White;
Alpha = Interpolation.ValueAt(Time.Current, 1f, 0f, HitStateUpdateTime, HitStateUpdateTime + 700);
}

Arrow.Alpha = hit ? 0 : 1;

LifetimeEnd = HitStateUpdateTime + 700;
}

internal void RestoreHitAnimations()
{
UpdateState(ArmedState.Hit);
UpdateComboColour();
Arrow.Alpha = 1;
}

#endregion
}
}
Loading