mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add support to use legacy combo fonts for the counter on legacy skins
This commit is contained in:
@ -13,6 +13,7 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
Droplet,
|
Droplet,
|
||||||
CatcherIdle,
|
CatcherIdle,
|
||||||
CatcherFail,
|
CatcherFail,
|
||||||
CatcherKiai
|
CatcherKiai,
|
||||||
|
CatchComboCounter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
using static osu.Game.Skinning.LegacySkinConfiguration;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Skinning
|
namespace osu.Game.Rulesets.Catch.Skinning
|
||||||
{
|
{
|
||||||
@ -51,6 +52,16 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
|||||||
case CatchSkinComponents.CatcherKiai:
|
case CatchSkinComponents.CatcherKiai:
|
||||||
return this.GetAnimation("fruit-catcher-kiai", true, true, true) ??
|
return this.GetAnimation("fruit-catcher-kiai", true, true, true) ??
|
||||||
this.GetAnimation("fruit-ryuuta", true, true, true);
|
this.GetAnimation("fruit-ryuuta", true, true, true);
|
||||||
|
|
||||||
|
case CatchSkinComponents.CatchComboCounter:
|
||||||
|
var comboFont = GetConfig<LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score";
|
||||||
|
var fontOverlap = GetConfig<LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? -2f;
|
||||||
|
|
||||||
|
// For simplicity, let's use legacy combo font texture existence as a way to identify legacy skins from default.
|
||||||
|
if (HasFont(comboFont))
|
||||||
|
return new LegacyComboCounter(Source, comboFont, fontOverlap);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -94,7 +94,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
var font = GetConfig<OsuSkinConfiguration, string>(OsuSkinConfiguration.HitCirclePrefix)?.Value ?? "default";
|
var font = GetConfig<OsuSkinConfiguration, string>(OsuSkinConfiguration.HitCirclePrefix)?.Value ?? "default";
|
||||||
var overlap = GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.HitCircleOverlap)?.Value ?? -2;
|
var overlap = GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.HitCircleOverlap)?.Value ?? -2;
|
||||||
|
|
||||||
return !hasFont(font)
|
return !HasFont(font)
|
||||||
? null
|
? null
|
||||||
: new LegacySpriteText(Source, font)
|
: new LegacySpriteText(Source, font)
|
||||||
{
|
{
|
||||||
@ -145,7 +145,5 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
|
|
||||||
return Source.GetConfig<TLookup, TValue>(lookup);
|
return Source.GetConfig<TLookup, TValue>(lookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool hasFont(string fontName) => Source.GetTexture($"{fontName}-0") != null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,8 @@ namespace osu.Game.Skinning
|
|||||||
public enum LegacySetting
|
public enum LegacySetting
|
||||||
{
|
{
|
||||||
Version,
|
Version,
|
||||||
|
ComboPrefix,
|
||||||
|
ComboOverlap,
|
||||||
AnimationFramerate,
|
AnimationFramerate,
|
||||||
LayeredHitSounds,
|
LayeredHitSounds,
|
||||||
}
|
}
|
||||||
|
@ -47,5 +47,7 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup);
|
public abstract IBindable<TValue> GetConfig<TLookup, TValue>(TLookup lookup);
|
||||||
|
|
||||||
|
protected bool HasFont(string fontPrefix) => GetTexture($"{fontPrefix}-0") != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user