mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 01:33:22 +08:00
Rename bool and make property for legibility
This commit is contained in:
parent
df4de4a090
commit
23068034b1
@ -100,7 +100,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
if (SelectedTab.Value == null && !externalDimRequested)
|
||||
if (SelectedTab.Value == null && !allStreamsDimmed)
|
||||
{
|
||||
expandingBar.Expand();
|
||||
expandingBar.FadeTo(1, transition_duration, Easing.OutQuint);
|
||||
@ -113,21 +113,22 @@ namespace osu.Game.Overlays.Changelog
|
||||
expandingBar.IsCollapsed = !shouldExpand;
|
||||
expandingBar.FadeTo(shouldExpand ? 1 : 0.5f, transition_duration, Easing.OutQuint);
|
||||
|
||||
text.FadeTo(IsHovered || (Active.Value && !externalDimRequested) ? 1 : 0.5f, transition_duration, Easing.OutQuint);
|
||||
text.FadeTo(IsHovered || (Active.Value && !allStreamsDimmed) ? 1 : 0.5f, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private bool externalDimRequested;
|
||||
private bool allStreamsDimmed;
|
||||
|
||||
public void EnableDim()
|
||||
public bool AllStreamsDimmed
|
||||
{
|
||||
externalDimRequested = true;
|
||||
updateState();
|
||||
}
|
||||
get => allStreamsDimmed;
|
||||
set
|
||||
{
|
||||
if (value == allStreamsDimmed)
|
||||
return;
|
||||
|
||||
public void DisableDim()
|
||||
{
|
||||
externalDimRequested = false;
|
||||
updateState();
|
||||
allStreamsDimmed = value;
|
||||
updateState();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
streamBadge.EnableDim();
|
||||
streamBadge.AllStreamsDimmed = true;
|
||||
|
||||
return base.OnHover(e);
|
||||
}
|
||||
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Changelog
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
|
||||
streamBadge.DisableDim();
|
||||
streamBadge.AllStreamsDimmed = false;
|
||||
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user