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 Traceable option to display sliderbody in a default way #29600

Closed
wants to merge 1 commit into from
Closed
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/Mods/OsuModTraceable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
Expand All @@ -16,6 +18,9 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModTraceable : ModWithVisibilityAdjustment, IRequiresApproachCircles
{
[SettingSource("Default Slider Body Display", "Body of the slider will have the same looks as without Traceable.")]
public Bindable<bool> DefaultSliderBodyDisplay { get; } = new BindableBool();

public override string Name => "Traceable";
public override string Acronym => "TC";
public override ModType Type => ModType.Fun;
Expand Down Expand Up @@ -72,6 +77,9 @@ private void applyCirclePieceState(DrawableOsuHitObject hitObject, IDrawable? hi

private void applySliderState(DrawableSlider slider)
{
if (DefaultSliderBodyDisplay.Value)
return;

((PlaySliderBody)slider.Body.Drawable).AccentColour = slider.AccentColour.Value.Opacity(0);
((PlaySliderBody)slider.Body.Drawable).BorderColour = slider.AccentColour.Value;
}
Expand Down
Loading