1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Privatise tick to TickContainer

This commit is contained in:
smoogipoo 2018-03-19 19:52:17 +09:00
parent 7182442b21
commit 070db63157
4 changed files with 23 additions and 35 deletions

View File

@ -14,7 +14,6 @@ namespace osu.Game.Tests.Visual
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(BeatSnapVisualiser),
typeof(Tick),
typeof(TickContainer)
};

View File

@ -1,33 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using OpenTK;
namespace osu.Game.Screens.Edit.Screens.Compose.BeatSnap
{
public class Tick : Box
{
private readonly int divisor;
public Tick(int divisor)
{
this.divisor = divisor;
Size = new Vector2(2, 10);
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
if (divisor >= 16)
Colour = colours.Red;
else if (divisor >= 8)
Colour = colours.Yellow;
else
Colour = colours.Gray4;
}
}
}

View File

@ -65,5 +65,28 @@ namespace osu.Game.Screens.Edit.Screens.Compose.BeatSnap
private void updatePosition() => marker.X = getTickPosition(Array.IndexOf(availableDivisors, Divisor.Value));
private float getTickPosition(int index) => (index + 1) * tickSpacing;
private class Tick : Box
{
private readonly int divisor;
public Tick(int divisor)
{
this.divisor = divisor;
Size = new Vector2(2, 10);
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
if (divisor >= 16)
Colour = colours.Red;
else if (divisor >= 8)
Colour = colours.Yellow;
else
Colour = colours.Gray4;
}
}
}
}

View File

@ -381,7 +381,6 @@
<Compile Include="Rulesets\Scoring\Legacy\LegacyScoreParser.cs" />
<Compile Include="Rulesets\UI\JudgementContainer.cs" />
<Compile Include="Screens\Edit\Screens\Compose\BeatSnap\BeatSnapVisualiser.cs" />
<Compile Include="Screens\Edit\Screens\Compose\BeatSnap\Tick.cs" />
<Compile Include="Screens\Edit\Screens\Compose\BeatSnap\TickContainer.cs" />
<Compile Include="Screens\Edit\Screens\Compose\Layers\BorderLayer.cs" />
<Compile Include="Screens\Edit\Screens\Compose\Layers\HitObjectMaskLayer.cs" />