mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Use bindable for DrawableDroplet HyperDash state
This commit is contained in:
@ -21,7 +21,17 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
ScaleContainer.Child = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.Droplet), _ => new DropletPiece());
|
HyperDash.BindValueChanged(_ => updatePiece(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePiece()
|
||||||
|
{
|
||||||
|
ScaleContainer.Child = new SkinnableDrawable(
|
||||||
|
new CatchSkinComponent(CatchSkinComponents.Droplet),
|
||||||
|
_ => new DropletPiece
|
||||||
|
{
|
||||||
|
HyperDash = { BindTarget = HyperDash }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateInitialTransforms()
|
protected override void UpdateInitialTransforms()
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
@ -11,6 +12,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables.Pieces
|
|||||||
{
|
{
|
||||||
public class DropletPiece : CompositeDrawable
|
public class DropletPiece : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
public readonly Bindable<bool> HyperDash = new Bindable<bool>();
|
||||||
|
|
||||||
public DropletPiece()
|
public DropletPiece()
|
||||||
{
|
{
|
||||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS / 2);
|
Size = new Vector2(CatchHitObject.OBJECT_RADIUS / 2);
|
||||||
@ -19,15 +22,13 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables.Pieces
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(DrawableHitObject drawableObject)
|
private void load(DrawableHitObject drawableObject)
|
||||||
{
|
{
|
||||||
var drawableCatchObject = (DrawablePalpableCatchHitObject)drawableObject;
|
|
||||||
|
|
||||||
InternalChild = new Pulp
|
InternalChild = new Pulp
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
AccentColour = { BindTarget = drawableObject.AccentColour }
|
AccentColour = { BindTarget = drawableObject.AccentColour }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (drawableCatchObject.HitObject.HyperDash)
|
if (HyperDash.Value)
|
||||||
{
|
{
|
||||||
AddInternal(new HyperDropletBorderPiece());
|
AddInternal(new HyperDropletBorderPiece());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user