mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Make Column.AccentColour
bindable
This commit is contained in:
@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
[Resolved]
|
||||
private Column column { get; set; }
|
||||
|
||||
private Bindable<Color4> accentColour;
|
||||
|
||||
public DefaultColumnBackground()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
@ -55,9 +57,13 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
}
|
||||
};
|
||||
|
||||
background.Colour = column.AccentColour.Darken(5);
|
||||
brightColour = column.AccentColour.Opacity(0.6f);
|
||||
dimColour = column.AccentColour.Opacity(0);
|
||||
accentColour = column.AccentColour.GetBoundCopy();
|
||||
accentColour.BindValueChanged(colour =>
|
||||
{
|
||||
background.Colour = colour.NewValue.Darken(5);
|
||||
brightColour = colour.NewValue.Opacity(0.6f);
|
||||
dimColour = colour.NewValue.Opacity(0);
|
||||
}, true);
|
||||
|
||||
direction.BindTo(scrollingInfo.Direction);
|
||||
direction.BindValueChanged(onDirectionChanged, true);
|
||||
|
@ -25,6 +25,8 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
private Container hitTargetLine;
|
||||
private Drawable hitTargetBar;
|
||||
|
||||
private Bindable<Color4> accentColour;
|
||||
|
||||
[Resolved]
|
||||
private Column column { get; set; }
|
||||
|
||||
@ -54,12 +56,16 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
},
|
||||
};
|
||||
|
||||
hitTargetLine.EdgeEffect = new EdgeEffectParameters
|
||||
accentColour = column.AccentColour.GetBoundCopy();
|
||||
accentColour.BindValueChanged(colour =>
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 5,
|
||||
Colour = column.AccentColour.Opacity(0.5f),
|
||||
};
|
||||
hitTargetLine.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 5,
|
||||
Colour = colour.NewValue.Opacity(0.5f),
|
||||
};
|
||||
}, true);
|
||||
|
||||
direction.BindTo(scrollingInfo.Direction);
|
||||
direction.BindValueChanged(onDirectionChanged, true);
|
||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
private Container keyIcon;
|
||||
private Drawable gradient;
|
||||
|
||||
private Bindable<Color4> accentColour;
|
||||
|
||||
[Resolved]
|
||||
private Column column { get; set; }
|
||||
|
||||
@ -75,15 +77,19 @@ namespace osu.Game.Rulesets.Mania.UI.Components
|
||||
}
|
||||
};
|
||||
|
||||
keyIcon.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 5,
|
||||
Colour = column.AccentColour.Opacity(0.5f),
|
||||
};
|
||||
|
||||
direction.BindTo(scrollingInfo.Direction);
|
||||
direction.BindValueChanged(onDirectionChanged, true);
|
||||
|
||||
accentColour = column.AccentColour.GetBoundCopy();
|
||||
accentColour.BindValueChanged(colour =>
|
||||
{
|
||||
keyIcon.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Glow,
|
||||
Radius = 5,
|
||||
Colour = colour.NewValue.Opacity(0.5f),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private void onDirectionChanged(ValueChangedEvent<ScrollingDirection> direction)
|
||||
|
Reference in New Issue
Block a user