1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 10:42:54 +08:00
osu-lazer/osu.Game/Skinning/LegacyManiaSkinConfiguration.cs
2020-04-08 18:17:45 +09:00

61 lines
2.0 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps.Formats;
using osuTK.Graphics;
namespace osu.Game.Skinning
{
public class LegacyManiaSkinConfiguration : IHasCustomColours
{
/// <summary>
/// Conversion factor from converting legacy positioning values (based in x480 dimensions) to x768.
/// </summary>
public const float POSITION_SCALE_FACTOR = 1.6f;
/// <summary>
/// Size of a legacy column in the default skin, used for determining relative scale factors.
/// </summary>
public const float DEFAULT_COLUMN_SIZE = 30 * POSITION_SCALE_FACTOR;
public readonly int Keys;
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
public Dictionary<string, string> ImageLookups = new Dictionary<string, string>();
public readonly float[] ColumnLineWidth;
public readonly float[] ColumnSpacing;
public readonly float[] ColumnWidth;
public readonly float[] ExplosionWidth;
public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR;
public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR;
public bool ShowJudgementLine = true;
public LegacyManiaSkinConfiguration(int keys)
{
Keys = keys;
ColumnLineWidth = new float[keys + 1];
ColumnSpacing = new float[keys - 1];
ColumnWidth = new float[keys];
ExplosionWidth = new float[keys];
ColumnLineWidth.AsSpan().Fill(2);
ColumnWidth.AsSpan().Fill(DEFAULT_COLUMN_SIZE);
}
private float? minimumColumnWidth;
public float MinimumColumnWidth
{
get => minimumColumnWidth ?? ColumnWidth.Min();
set => minimumColumnWidth = value;
}
}
}