mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix line endings.
This commit is contained in:
@ -1,18 +1,21 @@
|
|||||||
using osu.Game.Beatmaps.ControlPoints;
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
namespace osu.Game.Rulesets.Mania.Objects
|
|
||||||
{
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
public class BarLine : ManiaHitObject
|
|
||||||
{
|
namespace osu.Game.Rulesets.Mania.Objects
|
||||||
/// <summary>
|
{
|
||||||
/// The control point which this bar line is part of.
|
public class BarLine : ManiaHitObject
|
||||||
/// </summary>
|
{
|
||||||
public TimingControlPoint ControlPoint;
|
/// <summary>
|
||||||
|
/// The control point which this bar line is part of.
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// The index of the beat which this bar line represents within the control point.
|
public TimingControlPoint ControlPoint;
|
||||||
/// This is a "major" bar line if <see cref="BeatIndex"/> % <see cref="TimingControlPoint.TimeSignature"/> == 0.
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public int BeatIndex;
|
/// The index of the beat which this bar line represents within the control point.
|
||||||
}
|
/// This is a "major" bar line if <see cref="BeatIndex"/> % <see cref="TimingControlPoint.TimeSignature"/> == 0.
|
||||||
|
/// </summary>
|
||||||
|
public int BeatIndex;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,74 +1,74 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Visualises a <see cref="BarLine"/>. Although this derives DrawableManiaHitObject,
|
/// Visualises a <see cref="BarLine"/>. Although this derives DrawableManiaHitObject,
|
||||||
/// this does not handle input/sound like a normal hit object.
|
/// this does not handle input/sound like a normal hit object.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawableBarLine : DrawableManiaHitObject<BarLine>
|
public class DrawableBarLine : DrawableManiaHitObject<BarLine>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Height of major bar line triangles.
|
/// Height of major bar line triangles.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float triangle_height = 12;
|
private const float triangle_height = 12;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Offset of the major bar line triangles from the sides of the bar line.
|
/// Offset of the major bar line triangles from the sides of the bar line.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float triangle_offset = 9;
|
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 = 1;
|
Height = 1;
|
||||||
|
|
||||||
Add(new Box
|
Add(new Box
|
||||||
{
|
{
|
||||||
Name = "Bar line",
|
Name = "Bar line",
|
||||||
Anchor = Anchor.BottomCentre,
|
Anchor = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
});
|
});
|
||||||
|
|
||||||
bool isMajor = barLine.BeatIndex % (int)barLine.ControlPoint.TimeSignature == 0;
|
bool isMajor = barLine.BeatIndex % (int)barLine.ControlPoint.TimeSignature == 0;
|
||||||
|
|
||||||
if (isMajor)
|
if (isMajor)
|
||||||
{
|
{
|
||||||
Add(new EquilateralTriangle
|
Add(new EquilateralTriangle
|
||||||
{
|
{
|
||||||
Name = "Left triangle",
|
Name = "Left triangle",
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Size = new Vector2(triangle_height),
|
Size = new Vector2(triangle_height),
|
||||||
X = -triangle_offset,
|
X = -triangle_offset,
|
||||||
Rotation = 90
|
Rotation = 90
|
||||||
});
|
});
|
||||||
|
|
||||||
Add(new EquilateralTriangle
|
Add(new EquilateralTriangle
|
||||||
{
|
{
|
||||||
Name = "Right triangle",
|
Name = "Right triangle",
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Size = new Vector2(triangle_height),
|
Size = new Vector2(triangle_height),
|
||||||
X = triangle_offset,
|
X = triangle_offset,
|
||||||
Rotation = -90
|
Rotation = -90
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMajor && barLine.BeatIndex % 2 == 1)
|
if (!isMajor && barLine.BeatIndex % 2 == 1)
|
||||||
Alpha = 0.2f;
|
Alpha = 0.2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void UpdateState(ArmedState state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user