1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 15:22:55 +08:00

Cleanups.

This commit is contained in:
smoogipooo 2017-05-09 20:55:20 +09:00
parent d852567d1d
commit 5b323ad483
9 changed files with 71 additions and 35 deletions

View File

@ -39,15 +39,23 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
Width = 50,
RelativeCoordinateSpace = new Vector2(1, 10000),
Children = new[]
{
new DrawableNote(new Note
new Container
{
StartTime = 5000
})
{
AccentColour = Color4.Red
Name = "Timing section",
RelativeSizeAxes = Axes.Both,
RelativeCoordinateSpace = new Vector2(1, 10000),
Children = new[]
{
new DrawableNote(new Note
{
StartTime = 5000
})
{
AccentColour = Color4.Red
}
}
}
}
},
@ -58,18 +66,25 @@ namespace osu.Desktop.VisualTests.Tests
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
Width = 50,
RelativeCoordinateSpace = new Vector2(1, 10000),
Children = new[]
{
new DrawableHoldNote(new HoldNote
new Container
{
StartTime = 5000,
Duration = 1000,
Name = "Timing section",
RelativeSizeAxes = Axes.Both,
RelativeCoordinateSpace = new Vector2(1, 10000),
Children = new[]
{
new DrawableHoldNote(new HoldNote
{
StartTime = 5000,
Duration = 1000,
})
{
AccentColour = Color4.Red,
Length = 0.4f
})
{
AccentColour = Color4.Red
}
}
}
}
}

View File

@ -93,7 +93,7 @@ namespace osu.Game.Rulesets.Mania.Judgements
/// Hit window for a PERFECT hit.
/// </summary>
public double Perfect = perfect_mid;
/// <summary>
/// Hit window for a GREAT hit.
/// </summary>

View File

@ -13,11 +13,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
public class DrawableHoldNote : DrawableManiaHitObject<HoldNote>
{
/// <summary>
/// Length of this hold note, relative to its parent.
/// </summary>
public float Length;
private NotePiece headPiece;
private BodyPiece bodyPiece;
private NotePiece tailPiece;
@ -30,6 +25,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
Add(new Drawable[]
{
// For now the body piece covers the entire height of the container
// whereas possibly in the future we don't want to extend under the head/tail.
// This will be fixed when new designs are given or the current design is finalized.
bodyPiece = new BodyPiece
{
Anchor = Anchor.BottomCentre,

View File

@ -34,14 +34,14 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
RelativeSizeAxes = Axes.Both,
Masking = true,
Children = new[]
{
new Box
{
new Box
{
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
RelativeSizeAxes = Axes.Both,
Alpha = 0,
AlwaysPresent = true
}
}
});
}

View File

@ -1,16 +1,18 @@
using System;
using OpenTK.Graphics;
using osu.Framework.Graphics;
// 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
using System;
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{
/// <summary>
/// Represents length-wise portion of a hold note.
/// </summary>
internal class BodyPiece : Container, IHasAccentColour
{
private Box box;

View File

@ -10,6 +10,9 @@ using osu.Game.Graphics;
namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
{
/// <summary>
/// Represents the static hit markers of notes.
/// </summary>
internal class NotePiece : Container, IHasAccentColour
{
private const float head_height = 10;

View File

@ -8,17 +8,24 @@ using osu.Game.Rulesets.Objects.Types;
namespace osu.Game.Rulesets.Mania.Objects
{
/// <summary>
/// Represents a hit object which requires pressing, holding, and releasing a key.
/// </summary>
public class HoldNote : Note, IHasEndTime
{
/// <summary>
/// Lenience of release hit windows.
/// Lenience of release hit windows. This is to make cases where the hold note release
/// is timed alongside presses of other hit objects less awkward.
/// </summary>
private const double release_window_lenience = 1.5;
public double Duration { get; set; }
public double EndTime => StartTime + Duration;
public HitWindows ReleaseHitWindows { get; protected set; } = new HitWindows();
/// <summary>
/// The key-release hit windows for this hold note.
/// </summary>
protected HitWindows ReleaseHitWindows = new HitWindows();
public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty)
{

View File

@ -7,9 +7,15 @@ using osu.Game.Rulesets.Mania.Judgements;
namespace osu.Game.Rulesets.Mania.Objects
{
/// <summary>
/// Represents a hit object which has a single hit press.
/// </summary>
public class Note : ManiaHitObject
{
public HitWindows HitWindows { get; protected set; } = new HitWindows();
/// <summary>
/// The key-press hit window for this note.
/// </summary>
protected HitWindows HitWindows = new HitWindows();
public override void ApplyDefaults(TimingInfo timing, BeatmapDifficulty difficulty)
{

View File

@ -1,11 +1,16 @@
// 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.Types
{
/// <summary>
/// A type of hit object which lies in one of a number of predetermined columns.
/// </summary>
public interface IHasColumn
{
/// <summary>
/// The column which the hit object lies in.
/// </summary>
int Column { get; }
}
}