2020-03-31 14:10:15 +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.
|
|
|
|
|
2022-10-04 17:24:49 +08:00
|
|
|
using System;
|
2020-03-31 14:10:15 +08:00
|
|
|
using osu.Framework.Allocation;
|
2020-03-31 17:08:05 +08:00
|
|
|
using osu.Framework.Bindables;
|
2020-03-31 14:10:15 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2020-03-31 22:58:04 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2020-03-31 14:10:15 +08:00
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2020-03-31 17:08:05 +08:00
|
|
|
using osu.Game.Skinning;
|
2020-03-31 14:10:15 +08:00
|
|
|
|
2020-12-07 11:32:52 +08:00
|
|
|
namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
2020-03-31 14:10:15 +08:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// A <see cref="CompositeDrawable"/> which is placed somewhere within a <see cref="Column"/>.
|
|
|
|
/// </summary>
|
2020-06-13 23:06:25 +08:00
|
|
|
public partial class LegacyManiaColumnElement : CompositeDrawable
|
2020-03-31 14:10:15 +08:00
|
|
|
{
|
|
|
|
[Resolved]
|
2022-11-09 12:37:04 +08:00
|
|
|
protected Column Column { get; private set; } = null!;
|
2020-03-31 14:10:15 +08:00
|
|
|
|
2022-10-04 17:24:49 +08:00
|
|
|
[Resolved]
|
2022-11-09 12:37:04 +08:00
|
|
|
private StageDefinition stage { get; set; } = null!;
|
2022-10-04 17:24:49 +08:00
|
|
|
|
2020-03-31 14:10:15 +08:00
|
|
|
/// <summary>
|
2020-03-31 22:58:04 +08:00
|
|
|
/// The column type identifier to use for texture lookups, in the case of no user-provided configuration.
|
2020-03-31 14:10:15 +08:00
|
|
|
/// </summary>
|
2022-11-09 12:37:04 +08:00
|
|
|
protected string FallbackColumnIndex { get; private set; } = null!;
|
2020-03-31 14:10:15 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2022-10-04 17:24:49 +08:00
|
|
|
if (Column.IsSpecial)
|
|
|
|
FallbackColumnIndex = "S";
|
|
|
|
else
|
2020-04-01 10:59:34 +08:00
|
|
|
{
|
2022-10-04 17:24:49 +08:00
|
|
|
int distanceToEdge = Math.Min(Column.Index, (stage.Columns - 1) - Column.Index);
|
|
|
|
FallbackColumnIndex = distanceToEdge % 2 == 0 ? "1" : "2";
|
2020-04-01 10:59:34 +08:00
|
|
|
}
|
2020-03-31 14:10:15 +08:00
|
|
|
}
|
2020-03-31 17:08:05 +08:00
|
|
|
|
2022-11-09 12:37:04 +08:00
|
|
|
protected IBindable<T>? GetColumnSkinConfig<T>(ISkin skin, LegacyManiaSkinConfigurationLookups lookup) where T : notnull
|
2022-10-06 13:10:39 +08:00
|
|
|
=> skin.GetManiaSkinConfig<T>(lookup, Column.Index);
|
2020-03-31 14:10:15 +08:00
|
|
|
}
|
|
|
|
}
|