mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Fix regression in legacy dual stage handling logic
This commit is contained in:
@ -71,11 +71,11 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
case TrianglesSkin:
|
case TrianglesSkin:
|
||||||
return new ManiaTrianglesSkinTransformer(skin);
|
return new ManiaTrianglesSkinTransformer(skin);
|
||||||
|
|
||||||
case LegacySkin:
|
|
||||||
return new ManiaLegacySkinTransformer(skin);
|
|
||||||
|
|
||||||
case ArgonSkin:
|
case ArgonSkin:
|
||||||
return new ManiaArgonSkinTransformer(skin);
|
return new ManiaArgonSkinTransformer(skin);
|
||||||
|
|
||||||
|
case LegacySkin:
|
||||||
|
return new ManiaLegacySkinTransformer(skin, beatmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -9,6 +9,7 @@ using osu.Framework.Audio.Sample;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Objects.Legacy;
|
using osu.Game.Rulesets.Objects.Legacy;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -56,9 +57,13 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly Lazy<bool> hasKeyTexture;
|
private readonly Lazy<bool> hasKeyTexture;
|
||||||
|
|
||||||
public ManiaLegacySkinTransformer(ISkin skin)
|
private readonly ManiaBeatmap beatmap;
|
||||||
|
|
||||||
|
public ManiaLegacySkinTransformer(ISkin skin, IBeatmap beatmap)
|
||||||
: base(skin)
|
: base(skin)
|
||||||
{
|
{
|
||||||
|
this.beatmap = (ManiaBeatmap)beatmap;
|
||||||
|
|
||||||
isLegacySkin = new Lazy<bool>(() => GetConfig<SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version) != null);
|
isLegacySkin = new Lazy<bool>(() => GetConfig<SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version) != null);
|
||||||
hasKeyTexture = new Lazy<bool>(() =>
|
hasKeyTexture = new Lazy<bool>(() =>
|
||||||
{
|
{
|
||||||
@ -144,7 +149,7 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
|
|||||||
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
public override IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup)
|
||||||
{
|
{
|
||||||
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
if (lookup is ManiaSkinConfigurationLookup maniaLookup)
|
||||||
return base.GetConfig<LegacyManiaSkinConfigurationLookup, TValue>(new LegacyManiaSkinConfigurationLookup(maniaLookup.StageDefinition.Columns, maniaLookup.Lookup, maniaLookup.ColumnIndex));
|
return base.GetConfig<LegacyManiaSkinConfigurationLookup, TValue>(new LegacyManiaSkinConfigurationLookup(beatmap.TotalColumns, maniaLookup.Lookup, maniaLookup.ColumnIndex));
|
||||||
|
|
||||||
return base.GetConfig<TLookup, TValue>(lookup);
|
return base.GetConfig<TLookup, TValue>(lookup);
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
public class LegacyManiaSkinConfigurationLookup
|
public class LegacyManiaSkinConfigurationLookup
|
||||||
{
|
{
|
||||||
public readonly int Keys;
|
/// <summary>
|
||||||
|
/// Total columns across all stages.
|
||||||
|
/// </summary>
|
||||||
|
public readonly int TotalColumns;
|
||||||
|
|
||||||
public readonly LegacyManiaSkinConfigurationLookups Lookup;
|
public readonly LegacyManiaSkinConfigurationLookups Lookup;
|
||||||
public readonly int? TargetColumn;
|
public readonly int? TargetColumn;
|
||||||
|
|
||||||
public LegacyManiaSkinConfigurationLookup(int keys, LegacyManiaSkinConfigurationLookups lookup, int? targetColumn = null)
|
public LegacyManiaSkinConfigurationLookup(int totalColumns, LegacyManiaSkinConfigurationLookups lookup, int? targetColumn = null)
|
||||||
{
|
{
|
||||||
Keys = keys;
|
TotalColumns = totalColumns;
|
||||||
Lookup = lookup;
|
Lookup = lookup;
|
||||||
TargetColumn = targetColumn;
|
TargetColumn = targetColumn;
|
||||||
}
|
}
|
||||||
|
@ -128,8 +128,8 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
private IBindable<TValue>? lookupForMania<TValue>(LegacyManiaSkinConfigurationLookup maniaLookup)
|
private IBindable<TValue>? lookupForMania<TValue>(LegacyManiaSkinConfigurationLookup maniaLookup)
|
||||||
{
|
{
|
||||||
if (!maniaConfigurations.TryGetValue(maniaLookup.Keys, out var existing))
|
if (!maniaConfigurations.TryGetValue(maniaLookup.TotalColumns, out var existing))
|
||||||
maniaConfigurations[maniaLookup.Keys] = existing = new LegacyManiaSkinConfiguration(maniaLookup.Keys);
|
maniaConfigurations[maniaLookup.TotalColumns] = existing = new LegacyManiaSkinConfiguration(maniaLookup.TotalColumns);
|
||||||
|
|
||||||
switch (maniaLookup.Lookup)
|
switch (maniaLookup.Lookup)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user