2020-03-30 16:18:09 +08:00
|
|
|
|
// 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;
|
2020-04-02 16:56:12 +08:00
|
|
|
|
using System.Collections.Generic;
|
2020-04-07 15:07:18 +08:00
|
|
|
|
using System.Linq;
|
2020-04-02 16:56:12 +08:00
|
|
|
|
using osu.Game.Beatmaps.Formats;
|
|
|
|
|
using osuTK.Graphics;
|
2020-03-30 16:18:09 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
|
{
|
2020-04-02 16:56:12 +08:00
|
|
|
|
public class LegacyManiaSkinConfiguration : IHasCustomColours
|
2020-03-30 16:18:09 +08:00
|
|
|
|
{
|
2020-04-02 13:24:09 +08:00
|
|
|
|
/// <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;
|
|
|
|
|
|
2020-03-30 16:18:09 +08:00
|
|
|
|
public readonly int Keys;
|
|
|
|
|
|
2020-08-31 23:48:36 +08:00
|
|
|
|
public Dictionary<string, Color4> CustomColours { get; } = new Dictionary<string, Color4>();
|
2020-04-02 16:56:12 +08:00
|
|
|
|
|
2020-04-06 18:04:02 +08:00
|
|
|
|
public Dictionary<string, string> ImageLookups = new Dictionary<string, string>();
|
|
|
|
|
|
2023-02-10 18:18:41 +08:00
|
|
|
|
public float WidthForNoteHeightScale;
|
|
|
|
|
|
2020-03-30 16:18:09 +08:00
|
|
|
|
public readonly float[] ColumnLineWidth;
|
|
|
|
|
public readonly float[] ColumnSpacing;
|
|
|
|
|
public readonly float[] ColumnWidth;
|
2020-04-02 13:29:16 +08:00
|
|
|
|
public readonly float[] ExplosionWidth;
|
2020-08-26 19:21:41 +08:00
|
|
|
|
public readonly float[] HoldNoteLightWidth;
|
2020-03-30 16:18:09 +08:00
|
|
|
|
|
2020-04-02 13:24:09 +08:00
|
|
|
|
public float HitPosition = (480 - 402) * POSITION_SCALE_FACTOR;
|
|
|
|
|
public float LightPosition = (480 - 413) * POSITION_SCALE_FACTOR;
|
2020-12-14 00:43:36 +08:00
|
|
|
|
public float ScorePosition = 300 * POSITION_SCALE_FACTOR;
|
2020-03-31 11:26:31 +08:00
|
|
|
|
public bool ShowJudgementLine = true;
|
2020-08-26 14:37:16 +08:00
|
|
|
|
public bool KeysUnderNotes;
|
2023-10-19 01:56:17 +08:00
|
|
|
|
public int LightFramePerSecond = 60;
|
2020-03-30 16:18:09 +08:00
|
|
|
|
|
2023-02-10 18:30:41 +08:00
|
|
|
|
public LegacyNoteBodyStyle? NoteBodyStyle;
|
|
|
|
|
|
2020-03-30 16:18:09 +08:00
|
|
|
|
public LegacyManiaSkinConfiguration(int keys)
|
|
|
|
|
{
|
|
|
|
|
Keys = keys;
|
|
|
|
|
|
|
|
|
|
ColumnLineWidth = new float[keys + 1];
|
|
|
|
|
ColumnSpacing = new float[keys - 1];
|
|
|
|
|
ColumnWidth = new float[keys];
|
2020-04-02 13:29:16 +08:00
|
|
|
|
ExplosionWidth = new float[keys];
|
2020-08-26 19:21:41 +08:00
|
|
|
|
HoldNoteLightWidth = new float[keys];
|
2020-03-30 16:18:09 +08:00
|
|
|
|
|
|
|
|
|
ColumnLineWidth.AsSpan().Fill(2);
|
2020-04-02 13:24:09 +08:00
|
|
|
|
ColumnWidth.AsSpan().Fill(DEFAULT_COLUMN_SIZE);
|
2020-03-30 16:18:09 +08:00
|
|
|
|
}
|
2020-04-07 15:07:18 +08:00
|
|
|
|
|
2023-02-13 16:50:32 +08:00
|
|
|
|
public float MinimumColumnWidth => ColumnWidth.Min();
|
2020-03-30 16:18:09 +08:00
|
|
|
|
}
|
|
|
|
|
}
|