1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 04:22:55 +08:00

Revert "Woopsie! I accidentally added one too many semi-colons, so I moved it here into the commit instead ;"

This reverts commit 582ffcfc97.

Revert "Mod customisation header's color is now based on the state of the panel rather than the hover of the container."

This reverts commit e3457d8501.
This commit is contained in:
Dean Herbert 2024-09-04 17:25:36 +09:00
parent 582ffcfc97
commit 86309f4b46
No known key found for this signature in database

View File

@ -1,6 +1,7 @@
// 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 System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -19,7 +20,7 @@ using static osu.Game.Overlays.Mods.ModCustomisationPanel;
namespace osu.Game.Overlays.Mods
{
public partial class ModCustomisationHeader : OsuClickableContainer
public partial class ModCustomisationHeader : OsuHoverContainer
{
private Box background = null!;
private Box backgroundFlash = null!;
@ -28,6 +29,8 @@ namespace osu.Game.Overlays.Mods
[Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!;
protected override IEnumerable<Drawable> EffectTargets => new[] { background };
public readonly Bindable<ModCustomisationPanelState> ExpandedState = new Bindable<ModCustomisationPanelState>(ModCustomisationPanelState.Collapsed);
private readonly ModCustomisationPanel panel;
@ -49,7 +52,6 @@ namespace osu.Game.Overlays.Mods
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Dark3,
},
backgroundFlash = new Box
{
@ -82,6 +84,9 @@ namespace osu.Game.Overlays.Mods
}
}
};
IdleColour = colourProvider.Dark3;
HoverColour = colourProvider.Light4;
}
protected override void LoadComplete()
@ -105,20 +110,6 @@ namespace osu.Game.Overlays.Mods
{
icon.ScaleTo(v.NewValue > ModCustomisationPanelState.Collapsed ? new Vector2(1, -1) : Vector2.One, 300, Easing.OutQuint);
}, true);
panel.ExpandedState.BindValueChanged(v =>
{
switch (v.NewValue)
{
case ModCustomisationPanelState.Expanded:
case ModCustomisationPanelState.ExpandedByMod:
fadeBackgroundColor(colourProvider.Light4);
break;
default:
fadeBackgroundColor(colourProvider.Dark3);
break;
}
}, false);
}
protected override bool OnHover(HoverEvent e)
@ -128,10 +119,5 @@ namespace osu.Game.Overlays.Mods
return base.OnHover(e);
}
private void fadeBackgroundColor(Color4 color)
{
background.FadeColour(color, 500, Easing.OutQuint);
}
}
}