1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Move alpha management closer to screen level

Felt bad messing with alpha at the column level.
This commit is contained in:
Bartłomiej Dach 2022-05-08 15:13:29 +02:00
parent 38c004d734
commit 6bdcf893b7
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
2 changed files with 8 additions and 6 deletions

View File

@ -350,7 +350,6 @@ namespace osu.Game.Overlays.Mods
}
allFiltered.Value = panelFlow.All(panel => panel.Filtered.Value);
Alpha = allFiltered.Value ? 0 : 1;
if (toggleAllCheckbox != null && !SelectionAnimationRunning)
{

View File

@ -580,17 +580,20 @@ namespace osu.Game.Overlays.Mods
protected override void LoadComplete()
{
base.LoadComplete();
Active.BindValueChanged(_ => updateDim(), true);
Active.BindValueChanged(_ => updateState());
Column.AllFiltered.BindValueChanged(_ => updateState(), true);
FinishTransforms();
}
protected override bool RequiresChildrenUpdate => base.RequiresChildrenUpdate || Column.SelectionAnimationRunning;
private void updateDim()
private void updateState()
{
Colour4 targetColour;
if (Active.Value)
Column.Alpha = Column.AllFiltered.Value ? 0 : 1;
if (Column.Active.Value)
targetColour = Colour4.White;
else
targetColour = IsHovered ? colours.GrayC : colours.Gray8;
@ -609,14 +612,14 @@ namespace osu.Game.Overlays.Mods
protected override bool OnHover(HoverEvent e)
{
base.OnHover(e);
updateDim();
updateState();
return Active.Value;
}
protected override void OnHoverLost(HoverLostEvent e)
{
base.OnHoverLost(e);
updateDim();
updateState();
}
}