mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Merge branch 'master' into discord-dnd-fix
This commit is contained in:
commit
a8fd74c919
@ -44,7 +44,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
|||||||
|
|
||||||
SnakingOut.BindTo(configSnakingOut);
|
SnakingOut.BindTo(configSnakingOut);
|
||||||
|
|
||||||
BorderSize = skin.GetConfig<OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderBorderSize)?.Value ?? 1;
|
|
||||||
BorderColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;
|
BorderColour = skin.GetConfig<OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,29 +23,35 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|||||||
|
|
||||||
private partial class LegacyDrawableSliderPath : DrawableSliderPath
|
private partial class LegacyDrawableSliderPath : DrawableSliderPath
|
||||||
{
|
{
|
||||||
private const float shadow_portion = 1 - (OsuLegacySkinTransformer.LEGACY_CIRCLE_RADIUS / OsuHitObject.OBJECT_RADIUS);
|
|
||||||
|
|
||||||
protected new float CalculatedBorderPortion
|
|
||||||
// Roughly matches osu!stable's slider border portions.
|
|
||||||
=> base.CalculatedBorderPortion * 0.77f;
|
|
||||||
|
|
||||||
protected override Color4 ColourAt(float position)
|
protected override Color4 ColourAt(float position)
|
||||||
{
|
{
|
||||||
float realBorderPortion = shadow_portion + CalculatedBorderPortion;
|
// https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Renderers/MmSliderRendererGL.cs#L99
|
||||||
float realGradientPortion = 1 - realBorderPortion;
|
// float aaWidth = Math.Min(Math.Max(0.5f / PathRadius, 3.0f / 256.0f), 1.0f / 16.0f);
|
||||||
|
// applying the aa_width constant from stable makes sliders blurry, especially on CS>5. set to zero for now.
|
||||||
if (position <= shadow_portion)
|
// this might be related to SmoothPath applying AA internally, but disabling that does not seem to have much of an effect.
|
||||||
return new Color4(0f, 0f, 0f, 0.25f * position / shadow_portion);
|
const float aa_width = 0f;
|
||||||
|
|
||||||
if (position <= realBorderPortion)
|
|
||||||
return BorderColour;
|
|
||||||
|
|
||||||
position -= realBorderPortion;
|
|
||||||
|
|
||||||
|
Color4 shadow = new Color4(0, 0, 0, 0.25f);
|
||||||
Color4 outerColour = AccentColour.Darken(0.1f);
|
Color4 outerColour = AccentColour.Darken(0.1f);
|
||||||
Color4 innerColour = lighten(AccentColour, 0.5f);
|
Color4 innerColour = lighten(AccentColour, 0.5f);
|
||||||
|
|
||||||
return LegacyUtils.InterpolateNonLinear(position / realGradientPortion, outerColour, innerColour, 0, 1);
|
// https://github.com/peppy/osu-stable-reference/blob/3ea48705eb67172c430371dcfc8a16a002ed0d3d/osu!/Graphics/Renderers/MmSliderRendererGL.cs#L59-L70
|
||||||
|
const float shadow_portion = 1 - (OsuLegacySkinTransformer.LEGACY_CIRCLE_RADIUS / OsuHitObject.OBJECT_RADIUS);
|
||||||
|
const float border_portion = 0.1875f;
|
||||||
|
|
||||||
|
if (position <= shadow_portion - aa_width)
|
||||||
|
return LegacyUtils.InterpolateNonLinear(position, Color4.Black.Opacity(0f), shadow, 0, shadow_portion - aa_width);
|
||||||
|
|
||||||
|
if (position <= shadow_portion + aa_width)
|
||||||
|
return LegacyUtils.InterpolateNonLinear(position, shadow, BorderColour, shadow_portion - aa_width, shadow_portion + aa_width);
|
||||||
|
|
||||||
|
if (position <= border_portion - aa_width)
|
||||||
|
return BorderColour;
|
||||||
|
|
||||||
|
if (position <= border_portion + aa_width)
|
||||||
|
return LegacyUtils.InterpolateNonLinear(position, BorderColour, outerColour, border_portion - aa_width, border_portion + aa_width);
|
||||||
|
|
||||||
|
return LegacyUtils.InterpolateNonLinear(position, outerColour, innerColour, border_portion + aa_width, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -5,7 +5,6 @@ namespace osu.Game.Rulesets.Osu.Skinning
|
|||||||
{
|
{
|
||||||
public enum OsuSkinConfiguration
|
public enum OsuSkinConfiguration
|
||||||
{
|
{
|
||||||
SliderBorderSize,
|
|
||||||
SliderPathRadius,
|
SliderPathRadius,
|
||||||
CursorCentre,
|
CursorCentre,
|
||||||
CursorExpand,
|
CursorExpand,
|
||||||
|
Loading…
Reference in New Issue
Block a user