1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 23:12:55 +08:00

Avoid initial fade of dim layer

This commit is contained in:
Dean Herbert 2022-04-14 21:16:54 +09:00
parent f19208a245
commit 9240148c8e

View File

@ -25,6 +25,8 @@ namespace osu.Game.Overlays.Settings
private Box dim; private Box dim;
private const float inactive_alpha = 0.8f;
public abstract Drawable CreateIcon(); public abstract Drawable CreateIcon();
public abstract LocalisableString Header { get; } public abstract LocalisableString Header { get; }
@ -110,7 +112,7 @@ namespace osu.Game.Overlays.Settings
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background5, Colour = colourProvider.Background5,
Alpha = 0f, Alpha = inactive_alpha,
}, },
} }
}, },
@ -152,7 +154,9 @@ namespace osu.Game.Overlays.Settings
float dimFade = 0; float dimFade = 0;
if (!isCurrentSection) if (!isCurrentSection)
dimFade = IsHovered ? 0.5f : 0.8f; {
dimFade = IsHovered ? 0.5f : inactive_alpha;
}
dim.FadeTo(dimFade, 300, Easing.OutQuint); dim.FadeTo(dimFade, 300, Easing.OutQuint);
} }