mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 22:22:59 +08:00
Merge pull request #19642 from peppy/barline-less-present
Adjust visuals of osu!mania barlines to be less present
This commit is contained in:
commit
2f0e80e726
52
osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneBarLine.cs
Normal file
52
osu.Game.Rulesets.Mania.Tests/Skinning/TestSceneBarLine.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
|
using osu.Game.Rulesets.Mania.UI;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||||
|
{
|
||||||
|
public class TestSceneBarLine : ManiaSkinnableTestScene
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestMinor()
|
||||||
|
{
|
||||||
|
AddStep("Create barlines", () => recreate());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void recreate(Func<IEnumerable<BarLine>>? createBarLines = null)
|
||||||
|
{
|
||||||
|
var stageDefinitions = new List<StageDefinition>
|
||||||
|
{
|
||||||
|
new StageDefinition { Columns = 4 },
|
||||||
|
};
|
||||||
|
|
||||||
|
SetContents(_ => new ManiaPlayfield(stageDefinitions).With(s =>
|
||||||
|
{
|
||||||
|
if (createBarLines != null)
|
||||||
|
{
|
||||||
|
var barLines = createBarLines();
|
||||||
|
|
||||||
|
foreach (var b in barLines)
|
||||||
|
s.Add(b);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
|
s.Add(new BarLine
|
||||||
|
{
|
||||||
|
StartTime = Time.Current + i * 500,
|
||||||
|
Major = i % 4 == 0,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||||
{
|
{
|
||||||
@ -16,21 +13,11 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawableBarLine : DrawableManiaHitObject<BarLine>
|
public class DrawableBarLine : DrawableManiaHitObject<BarLine>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Height of major bar line triangles.
|
|
||||||
/// </summary>
|
|
||||||
private const float triangle_height = 12;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Offset of the major bar line triangles from the sides of the bar line.
|
|
||||||
/// </summary>
|
|
||||||
private const float triangle_offset = 9;
|
|
||||||
|
|
||||||
public DrawableBarLine(BarLine barLine)
|
public DrawableBarLine(BarLine barLine)
|
||||||
: base(barLine)
|
: base(barLine)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = 2f;
|
Height = barLine.Major ? 1.7f : 1.2f;
|
||||||
|
|
||||||
AddInternal(new Box
|
AddInternal(new Box
|
||||||
{
|
{
|
||||||
@ -38,34 +25,33 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = new Color4(255, 204, 33, 255),
|
Alpha = barLine.Major ? 0.5f : 0.2f
|
||||||
});
|
});
|
||||||
|
|
||||||
if (barLine.Major)
|
if (barLine.Major)
|
||||||
{
|
{
|
||||||
AddInternal(new EquilateralTriangle
|
Vector2 size = new Vector2(22, 6);
|
||||||
|
const float line_offset = 4;
|
||||||
|
|
||||||
|
AddInternal(new Circle
|
||||||
{
|
{
|
||||||
Name = "Left triangle",
|
Name = "Left line",
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.CentreRight,
|
||||||
Size = new Vector2(triangle_height),
|
|
||||||
X = -triangle_offset,
|
Size = size,
|
||||||
Rotation = 90
|
X = -line_offset,
|
||||||
});
|
});
|
||||||
|
|
||||||
AddInternal(new EquilateralTriangle
|
AddInternal(new Circle
|
||||||
{
|
{
|
||||||
Name = "Right triangle",
|
Name = "Right line",
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.CentreRight,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.CentreLeft,
|
||||||
Size = new Vector2(triangle_height),
|
Size = size,
|
||||||
X = triangle_offset,
|
X = line_offset,
|
||||||
Rotation = -90
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!barLine.Major)
|
|
||||||
Alpha = 0.2f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateInitialTransforms()
|
protected override void UpdateInitialTransforms()
|
||||||
|
Loading…
Reference in New Issue
Block a user