mirror of https://github.com/ppy/osu
Merge pull request #5910 from peppy/fix-legacy-skin-text
Fix legacy skin text reading from the wrong source
This commit is contained in:
commit
ee4869647f
|
@ -99,7 +99,7 @@ public Drawable GetDrawableComponent(string componentName)
|
|||
|
||||
return !hasFont(font)
|
||||
? null
|
||||
: new LegacySpriteText(this, font)
|
||||
: new LegacySpriteText(source, font)
|
||||
{
|
||||
// Spacing value was reverse-engineered from the ratio of the rendered sprite size in the visual inspector vs the actual texture size
|
||||
Scale = new Vector2(0.96f),
|
||||
|
@ -110,13 +110,13 @@ public Drawable GetDrawableComponent(string componentName)
|
|||
return null;
|
||||
}
|
||||
|
||||
public Texture GetTexture(string componentName) => null;
|
||||
public Texture GetTexture(string componentName) => source.GetTexture(componentName);
|
||||
|
||||
public SampleChannel GetSample(ISampleInfo sample) => null;
|
||||
public SampleChannel GetSample(ISampleInfo sample) => source.GetSample(sample);
|
||||
|
||||
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
|
||||
=> configuration.Value is TConfiguration conf ? query.Invoke(conf) : source.GetValue(query);
|
||||
|
||||
private bool hasFont(string fontName) => GetTexture($"{fontName}-0") != null;
|
||||
private bool hasFont(string fontName) => source.GetTexture($"{fontName}-0") != null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue