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: case CatchSkinComponents.CatchComboCounter:
var comboFont = GetConfig<LegacySetting, string>(LegacySetting.ComboPrefix)?.Value ?? "score"; 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. // For simplicity, let's use legacy combo font texture existence as a way to identify legacy skins from default.
if (this.HasFont(comboFont)) if (this.HasFont(comboFont))
return new LegacyComboCounter(Source, comboFont, fontOverlap); return new LegacyComboCounter(Source);
break; break;
} }

View File

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