mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Use bindable flow for transfer of accent colour from columns to hit objects
This fixes the case where changing a skin during gameplay runtime does not correctly convey colour information to off-screen `DrawableHitObject`s.
This commit is contained in:
parent
d35bb56d55
commit
4b772643e9
@ -73,13 +73,6 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
skin.SourceChanged += onSourceChanged;
|
skin.SourceChanged += onSourceChanged;
|
||||||
onSourceChanged();
|
onSourceChanged();
|
||||||
|
|
||||||
AccentColour.BindValueChanged(colour =>
|
|
||||||
{
|
|
||||||
// Manual transfer as hit objects may be moved between column and unbinding is non-trivial.
|
|
||||||
foreach (var obj in HitObjectContainer.Objects)
|
|
||||||
obj.AccentColour.Value = colour.NewValue;
|
|
||||||
}, true);
|
|
||||||
|
|
||||||
Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
|
Drawable background = new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.ColumnBackground), _ => new DefaultColumnBackground())
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
@ -142,7 +135,7 @@ namespace osu.Game.Rulesets.Mania.UI
|
|||||||
|
|
||||||
DrawableManiaHitObject maniaObject = (DrawableManiaHitObject)drawableHitObject;
|
DrawableManiaHitObject maniaObject = (DrawableManiaHitObject)drawableHitObject;
|
||||||
|
|
||||||
maniaObject.AccentColour.Value = AccentColour.Value;
|
maniaObject.AccentColour.BindTo(AccentColour);
|
||||||
maniaObject.CheckHittable = hitPolicy.IsHittable;
|
maniaObject.CheckHittable = hitPolicy.IsHittable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user