1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:43:01 +08:00

Adjust argon graph to use a non-gray colour range

This commit is contained in:
Dean Herbert 2023-06-12 15:52:25 +09:00
parent c9f9569e4a
commit 84670d4c90

View File

@ -4,8 +4,10 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
using osu.Game.Graphics.UserInterface;
@ -13,6 +15,10 @@ namespace osu.Game.Screens.Play.HUD
{
public partial class ArgonSongProgressGraph : SegmentedGraph<int>
{
private const int tier_count = 5;
private const int display_granularity = 200;
private IEnumerable<HitObject>? objects;
public IEnumerable<HitObject> Objects
@ -21,8 +27,7 @@ namespace osu.Game.Screens.Play.HUD
{
objects = value;
const int granularity = 200;
int[] values = new int[granularity];
int[] values = new int[display_granularity];
if (!objects.Any())
return;
@ -32,7 +37,7 @@ namespace osu.Game.Screens.Play.HUD
if (lastHit == 0)
lastHit = objects.Last().StartTime;
double interval = (lastHit - firstHit + 1) / granularity;
double interval = (lastHit - firstHit + 1) / display_granularity;
foreach (var h in objects)
{
@ -51,12 +56,12 @@ namespace osu.Game.Screens.Play.HUD
}
public ArgonSongProgressGraph()
: base(5)
: base(tier_count)
{
var colours = new List<Colour4>();
for (int i = 0; i < 5; i++)
colours.Add(Colour4.White.Darken(1 + 1 / 5f).Opacity(1 / 5f));
for (int i = 0; i < tier_count; i++)
colours.Add(OsuColour.Gray(0.2f).Opacity(0.1f));
TierColours = colours;
}