1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Move combo font retrieval inside the legacy component

This commit is contained in:
Salman Ahmed 2020-08-23 10:28:05 +03:00
parent fafdbb0a81
commit 0e9242ee9a
2 changed files with 5 additions and 5 deletions

View File

@ -55,11 +55,10 @@ namespace osu.Game.Rulesets.Catch.Skinning
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 (this.HasFont(comboFont))
return new LegacyComboCounter(Source, comboFont, fontOverlap);
return new LegacyComboCounter(Source);
break;
}

View File

@ -13,6 +13,7 @@ using osu.Game.Screens.Play;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
using static osu.Game.Skinning.LegacySkinConfiguration;
namespace osu.Game.Rulesets.Catch.Skinning
{
@ -28,12 +29,12 @@ namespace osu.Game.Rulesets.Catch.Skinning
private readonly LegacyRollingCounter counter;
public LegacyComboCounter(ISkin skin, string fontName, float fontOverlap)
public LegacyComboCounter(ISkin skin)
{
this.skin = skin;
this.fontName = fontName;
this.fontOverlap = fontOverlap;
fontName = skin.GetConfig<LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score";
fontOverlap = skin.GetConfig<LegacySetting, float>(LegacySetting.ComboOverlap)?.Value ?? -2f;
AutoSizeAxes = Axes.Both;