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

Apply same changes to "argon" osu!taiko barline design that were applies to osu!mania #25222

Merged
merged 1 commit into from
Oct 25, 2023
Merged
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
85 changes: 42 additions & 43 deletions osu.Game.Rulesets.Taiko/Skinning/Argon/ArgonBarLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Objects.Drawables;
Expand All @@ -14,53 +15,54 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Argon
{
public partial class ArgonBarLine : CompositeDrawable
{
private Container majorEdgeContainer = null!;

private Bindable<bool> major = null!;

private Box mainLine = null!;
private Drawable topAnchor = null!;
private Drawable bottomAnchor = null!;

[BackgroundDependencyLoader]
private void load(DrawableHitObject drawableHitObject)
{
RelativeSizeAxes = Axes.Both;

const float line_offset = 8;
var majorPieceSize = new Vector2(6, 20);
// Avoid flickering due to no anti-aliasing of boxes by default.
var edgeSmoothness = new Vector2(0.3f);

AddInternal(mainLine = new Box
{
Name = "Bar line",
EdgeSmoothness = edgeSmoothness,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
});

const float major_extension = 10;

AddInternal(topAnchor = new Box
{
Name = "Top anchor",
EdgeSmoothness = edgeSmoothness,
Blending = BlendingParameters.Additive,
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Height = major_extension,
RelativeSizeAxes = Axes.X,
Colour = ColourInfo.GradientVertical(Colour4.Transparent, Colour4.White),
});

InternalChildren = new Drawable[]
AddInternal(bottomAnchor = new Box
{
line = new Box
{
RelativeSizeAxes = Axes.Both,
EdgeSmoothness = new Vector2(0.5f, 0),
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
majorEdgeContainer = new Container
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Children = new[]
{
new Circle
{
Name = "Top line",
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Size = majorPieceSize,
Y = -line_offset,
},
new Circle
{
Name = "Bottom line",
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Size = majorPieceSize,
Y = line_offset,
},
}
}
};
Name = "Bottom anchor",
EdgeSmoothness = edgeSmoothness,
Blending = BlendingParameters.Additive,
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Height = major_extension,
RelativeSizeAxes = Axes.X,
Colour = ColourInfo.GradientVertical(Colour4.White, Colour4.Transparent),
});

major = ((DrawableBarLine)drawableHitObject).Major.GetBoundCopy();
}
Expand All @@ -71,13 +73,10 @@ protected override void LoadComplete()
major.BindValueChanged(updateMajor, true);
}

private Box line = null!;

private void updateMajor(ValueChangedEvent<bool> major)
{
line.Alpha = major.NewValue ? 1f : 0.5f;
line.Width = major.NewValue ? 1 : 0.5f;
majorEdgeContainer.Alpha = major.NewValue ? 1 : 0;
mainLine.Alpha = major.NewValue ? 1f : 0.5f;
topAnchor.Alpha = bottomAnchor.Alpha = major.NewValue ? mainLine.Alpha * 0.3f : 0;
}
}
}