mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 02:33:25 +08:00
Merge remote-tracking branch 'refs/remotes/ppy/master' into beatmap-video
This commit is contained in:
commit
d9beee926a
@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
|
|
||||||
return !hasFont(font)
|
return !hasFont(font)
|
||||||
? null
|
? 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
|
// 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),
|
Scale = new Vector2(0.96f),
|
||||||
@ -110,13 +110,13 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
return null;
|
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
|
public TValue GetValue<TConfiguration, TValue>(Func<TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
|
||||||
=> configuration.Value is TConfiguration conf ? query.Invoke(conf) : default;
|
=> 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Skinning
|
|||||||
public DefaultSkin()
|
public DefaultSkin()
|
||||||
: base(SkinInfo.Default)
|
: base(SkinInfo.Default)
|
||||||
{
|
{
|
||||||
Configuration = new SkinConfiguration();
|
Configuration = new DefaultSkinConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Drawable GetDrawableComponent(string componentName) => null;
|
public override Drawable GetDrawableComponent(string componentName) => null;
|
||||||
|
28
osu.Game/Skinning/DefaultSkinConfiguration.cs
Normal file
28
osu.Game/Skinning/DefaultSkinConfiguration.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Skinning
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A skin configuration pre-populated with sane defaults.
|
||||||
|
/// </summary>
|
||||||
|
public class DefaultSkinConfiguration : SkinConfiguration
|
||||||
|
{
|
||||||
|
public DefaultSkinConfiguration()
|
||||||
|
{
|
||||||
|
HitCircleFont = "default";
|
||||||
|
|
||||||
|
ComboColours.AddRange(new[]
|
||||||
|
{
|
||||||
|
new Color4(17, 136, 170, 255),
|
||||||
|
new Color4(102, 136, 0, 255),
|
||||||
|
new Color4(204, 102, 0, 255),
|
||||||
|
new Color4(121, 9, 13, 255)
|
||||||
|
});
|
||||||
|
|
||||||
|
CursorExpand = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -34,7 +34,7 @@ namespace osu.Game.Skinning
|
|||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
Configuration = new LegacySkinDecoder().Decode(reader);
|
Configuration = new LegacySkinDecoder().Decode(reader);
|
||||||
else
|
else
|
||||||
Configuration = new SkinConfiguration();
|
Configuration = new DefaultSkinConfiguration();
|
||||||
|
|
||||||
Samples = audioManager.GetSampleStore(storage);
|
Samples = audioManager.GetSampleStore(storage);
|
||||||
Textures = new TextureStore(new TextureLoaderStore(storage));
|
Textures = new TextureStore(new TextureLoaderStore(storage));
|
||||||
|
@ -5,14 +5,14 @@ using osu.Game.Beatmaps.Formats;
|
|||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
public class LegacySkinDecoder : LegacyDecoder<SkinConfiguration>
|
public class LegacySkinDecoder : LegacyDecoder<DefaultSkinConfiguration>
|
||||||
{
|
{
|
||||||
public LegacySkinDecoder()
|
public LegacySkinDecoder()
|
||||||
: base(1)
|
: base(1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
|
protected override void ParseLine(DefaultSkinConfiguration skin, Section section, string line)
|
||||||
{
|
{
|
||||||
line = StripComments(line);
|
line = StripComments(line);
|
||||||
|
|
||||||
|
@ -7,21 +7,18 @@ using osuTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Skinning
|
namespace osu.Game.Skinning
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty skin configuration.
|
||||||
|
/// </summary>
|
||||||
public class SkinConfiguration : IHasComboColours, IHasCustomColours
|
public class SkinConfiguration : IHasComboColours, IHasCustomColours
|
||||||
{
|
{
|
||||||
public readonly SkinInfo SkinInfo = new SkinInfo();
|
public readonly SkinInfo SkinInfo = new SkinInfo();
|
||||||
|
|
||||||
public List<Color4> ComboColours { get; set; } = new List<Color4>
|
public List<Color4> ComboColours { get; set; } = new List<Color4>();
|
||||||
{
|
|
||||||
new Color4(17, 136, 170, 255),
|
|
||||||
new Color4(102, 136, 0, 255),
|
|
||||||
new Color4(204, 102, 0, 255),
|
|
||||||
new Color4(121, 9, 13, 255)
|
|
||||||
};
|
|
||||||
|
|
||||||
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
|
public Dictionary<string, Color4> CustomColours { get; set; } = new Dictionary<string, Color4>();
|
||||||
|
|
||||||
public string HitCircleFont { get; set; } = "default";
|
public string HitCircleFont { get; set; }
|
||||||
|
|
||||||
public int HitCircleOverlap { get; set; }
|
public int HitCircleOverlap { get; set; }
|
||||||
|
|
||||||
@ -29,6 +26,6 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
public float? SliderPathRadius { get; set; }
|
public float? SliderPathRadius { get; set; }
|
||||||
|
|
||||||
public bool? CursorExpand { get; set; } = true;
|
public bool? CursorExpand { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user