mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Adjust timeline ticks to be more visible
This commit is contained in:
parent
0736679016
commit
9be7981e0d
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics.Colour;
|
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -48,7 +47,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// <param name="beatDivisor">The beat divisor.</param>
|
/// <param name="beatDivisor">The beat divisor.</param>
|
||||||
/// <param name="colours">The set of colours.</param>
|
/// <param name="colours">The set of colours.</param>
|
||||||
/// <returns>The applicable colour from <paramref name="colours"/> for <paramref name="beatDivisor"/>.</returns>
|
/// <returns>The applicable colour from <paramref name="colours"/> for <paramref name="beatDivisor"/>.</returns>
|
||||||
public static ColourInfo GetColourFor(int beatDivisor, OsuColour colours)
|
public static Color4 GetColourFor(int beatDivisor, OsuColour colours)
|
||||||
{
|
{
|
||||||
switch (beatDivisor)
|
switch (beatDivisor)
|
||||||
{
|
{
|
||||||
|
@ -132,7 +132,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
var colour = BindableBeatDivisor.GetColourFor(BindableBeatDivisor.GetDivisorForBeatIndex(beatIndex + placementIndex + 1, beatDivisor.Value), Colours);
|
var colour = BindableBeatDivisor.GetColourFor(BindableBeatDivisor.GetDivisorForBeatIndex(beatIndex + placementIndex + 1, beatDivisor.Value), Colours);
|
||||||
|
|
||||||
int repeatIndex = placementIndex / beatDivisor.Value;
|
int repeatIndex = placementIndex / beatDivisor.Value;
|
||||||
return colour.MultiplyAlpha(0.5f / (repeatIndex + 1));
|
return ColourInfo.SingleColour(colour).MultiplyAlpha(0.5f / (repeatIndex + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,9 @@ using System.Linq;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Caching;
|
using osu.Framework.Caching;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
||||||
@ -124,25 +126,28 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
if (beat == 0 && i == 0)
|
if (beat == 0 && i == 0)
|
||||||
nextMinTick = float.MinValue;
|
nextMinTick = float.MinValue;
|
||||||
|
|
||||||
var indexInBar = beat % ((int)point.TimeSignature * beatDivisor.Value);
|
int indexInBar = beat % ((int)point.TimeSignature * beatDivisor.Value);
|
||||||
|
|
||||||
var divisor = BindableBeatDivisor.GetDivisorForBeatIndex(beat, beatDivisor.Value);
|
var divisor = BindableBeatDivisor.GetDivisorForBeatIndex(beat, beatDivisor.Value);
|
||||||
var colour = BindableBeatDivisor.GetColourFor(divisor, colours);
|
var colour = BindableBeatDivisor.GetColourFor(divisor, colours);
|
||||||
|
|
||||||
|
bool isMainBeat = indexInBar == 0;
|
||||||
|
|
||||||
// even though "bar lines" take up the full vertical space, we render them in two pieces because it allows for less anchor/origin churn.
|
// even though "bar lines" take up the full vertical space, we render them in two pieces because it allows for less anchor/origin churn.
|
||||||
var height = indexInBar == 0 ? 0.5f : 0.1f - (float)divisor / highestDivisor * 0.08f;
|
float height = isMainBeat ? 0.5f : 0.4f - (float)divisor / highestDivisor * 0.2f;
|
||||||
|
float gradientOpacity = isMainBeat ? 1 : 0;
|
||||||
|
|
||||||
var topPoint = getNextUsablePoint();
|
var topPoint = getNextUsablePoint();
|
||||||
topPoint.X = xPos;
|
topPoint.X = xPos;
|
||||||
topPoint.Colour = colour;
|
|
||||||
topPoint.Height = height;
|
topPoint.Height = height;
|
||||||
|
topPoint.Colour = ColourInfo.GradientVertical(colour, colour.Opacity(gradientOpacity));
|
||||||
topPoint.Anchor = Anchor.TopLeft;
|
topPoint.Anchor = Anchor.TopLeft;
|
||||||
topPoint.Origin = Anchor.TopCentre;
|
topPoint.Origin = Anchor.TopCentre;
|
||||||
|
|
||||||
var bottomPoint = getNextUsablePoint();
|
var bottomPoint = getNextUsablePoint();
|
||||||
bottomPoint.X = xPos;
|
bottomPoint.X = xPos;
|
||||||
bottomPoint.Colour = colour;
|
|
||||||
bottomPoint.Anchor = Anchor.BottomLeft;
|
bottomPoint.Anchor = Anchor.BottomLeft;
|
||||||
|
bottomPoint.Colour = ColourInfo.GradientVertical(colour.Opacity(gradientOpacity), colour);
|
||||||
bottomPoint.Origin = Anchor.BottomCentre;
|
bottomPoint.Origin = Anchor.BottomCentre;
|
||||||
bottomPoint.Height = height;
|
bottomPoint.Height = height;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user