Пример #1
0
        private void load(SentakkiRulesetConfigManager sentakkiConfigs)
        {
            sentakkiConfigs?.BindWith(SentakkiRulesetSettings.TouchAnimationDuration, AnimationDuration);

            Size   = new Vector2(105);
            Origin = Anchor.Centre;
            Anchor = Anchor.Centre;
            Alpha  = 0;
            AddRangeInternal(new Drawable[] {
                touchBody = new TouchBody(),
                explosion = new HitExplosion()
            });

            trackedKeys.BindValueChanged(x =>
            {
                if (AllJudged)
                {
                    return;
                }

                UpdateResult(true);
            });

            AccentColour.BindValueChanged(c =>
            {
                explosion.Colour = c.NewValue;
            }, true);
        }
Пример #2
0
        private void load(OsuConfigManager config, ISkinSource skin)
        {
            positionBindable.BindValueChanged(_ => Position    = HitObject.StackedPosition);
            stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
            scaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue));

            positionBindable.BindTo(HitObject.PositionBindable);
            stackHeightBindable.BindTo(HitObject.StackHeightBindable);
            scaleBindable.BindTo(HitObject.ScaleBindable);

            AccentColour.BindValueChanged(colour =>
            {
                foreach (var drawableHitObject in NestedHitObjects)
                {
                    drawableHitObject.AccentColour.Value = colour.NewValue;
                }
            }, true);

            config.BindWith(OsuSetting.ColourSliderBalls, colorSliderBallBindable);

            colorSliderBallBindable.BindValueChanged(value =>
            {
                bool allowBallTint = (skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.AllowSliderBallTint)?.Value ?? false) && value.NewValue;
                Ball.Colour        = allowBallTint ? AccentColour.Value : Color4.White;
            });
        }
Пример #3
0
        private void load()
        {
            config?.BindWith(OsuRulesetSetting.SnakingInSliders, Body.SnakingIn);
            config?.BindWith(OsuRulesetSetting.SnakingOutSliders, Body.SnakingOut);

            positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
            scaleBindable.BindValueChanged(scale =>
            {
                Body.PathRadius = scale.NewValue * 64;
                Ball.Scale      = new Vector2(scale.NewValue);
            });

            positionBindable.BindTo(HitObject.PositionBindable);
            scaleBindable.BindTo(HitObject.ScaleBindable);
            pathBindable.BindTo(slider.PathBindable);

            pathBindable.BindValueChanged(_ => Body.Refresh());

            AccentColour.BindValueChanged(colour =>
            {
                Body.AccentColour = colour.NewValue;
                Ball.AccentColour = colour.NewValue;

                foreach (var drawableHitObject in NestedHitObjects)
                {
                    drawableHitObject.AccentColour.Value = colour.NewValue;
                }
            }, true);
        }
        public DrawableHoldNote(HoldNote hitObject)
            : base(hitObject)
        {
            RelativeSizeAxes = Axes.X;

            AddRangeInternal(new Drawable[]
            {
                bodyPiece = new BodyPiece {
                    RelativeSizeAxes = Axes.X
                },
                tickContainer = new Container <DrawableHoldNoteTick> {
                    RelativeSizeAxes = Axes.Both
                },
                headContainer = new Container <DrawableHeadNote> {
                    RelativeSizeAxes = Axes.Both
                },
                tailContainer = new Container <DrawableTailNote> {
                    RelativeSizeAxes = Axes.Both
                },
            });

            AccentColour.BindValueChanged(colour =>
            {
                bodyPiece.AccentColour = colour.NewValue;
            }, true);
        }
Пример #5
0
        private void load(TextureStore textures)
        {
            sprite.Texture  = textures.Get("cherry");
            overlay.Texture = textures.Get("cherry-overlay");
            branch.Texture  = textures.Get("cherry-branch");

            AccentColour.BindValueChanged(accent => sprite.Colour = accent.NewValue, true);
        }
Пример #6
0
        private void load()
        {
            AddInternal(pulp = new Pulp {
                Size = Size
            });

            AccentColour.BindValueChanged(colour => { pulp.AccentColour = colour.NewValue; }, true);
        }
Пример #7
0
        private void load()
        {
            Alpha = 0;
            Scale = Vector2.Zero;

            Origin            = Anchor.Centre;
            Size              = new Vector2(IWannaExtensions.CHERRY_DIAMETER);
            AddInternal(piece = new CherryPiece());

            AccentColour.BindValueChanged(c => piece.Colour = c.NewValue);
            PositionBindable.BindValueChanged(p => Position = p.NewValue);
        }
Пример #8
0
        private void load()
        {
            positionBindable.BindValueChanged(_ => Position              = HitObject.StackedPosition);
            stackHeightBindable.BindValueChanged(_ => Position           = HitObject.StackedPosition);
            scaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true);

            positionBindable.BindTo(HitObject.PositionBindable);
            stackHeightBindable.BindTo(HitObject.StackHeightBindable);
            scaleBindable.BindTo(HitObject.ScaleBindable);

            AccentColour.BindValueChanged(accent => ApproachCircle.Colour = accent.NewValue, true);
        }
Пример #9
0
        public DrawableHoldNote(HoldNote hitObject)
            : base(hitObject)
        {
            Container <DrawableHoldNoteTick> tickContainer;

            RelativeSizeAxes = Axes.X;

            AddRangeInternal(new Drawable[]
            {
                bodyPiece = new BodyPiece
                {
                    RelativeSizeAxes = Axes.X,
                },
                tickContainer = new Container <DrawableHoldNoteTick>
                {
                    RelativeSizeAxes   = Axes.Both,
                    ChildrenEnumerable = HitObject.NestedHitObjects.OfType <HoldNoteTick>().Select(tick => new DrawableHoldNoteTick(tick)
                    {
                        HoldStartTime = () => holdStartTime
                    })
                },
                Head = new DrawableHeadNote(this)
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre
                },
                Tail = new DrawableTailNote(this)
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre
                }
            });

            foreach (var tick in tickContainer)
            {
                AddNested(tick);
            }

            AddNested(Head);
            AddNested(Tail);

            AccentColour.BindValueChanged(colour =>
            {
                bodyPiece.AccentColour  = colour.NewValue;
                Head.AccentColour.Value = colour.NewValue;
                Tail.AccentColour.Value = colour.NewValue;
                tickContainer.ForEach(t => t.AccentColour.Value = colour.NewValue);
            }, true);
        }
Пример #10
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            AccentColour.BindValueChanged(colour =>
            {
                glowContainer.EdgeEffect = new EdgeEffectParameters
                {
                    Type      = EdgeEffectType.Glow,
                    Radius    = 2f,
                    Roundness = 15f,
                    Colour    = colour.NewValue.Opacity(0.3f)
                };
            }, true);
        }
Пример #11
0
        private void load()
        {
            Origin = Anchor.Centre;

            InternalChildren = new Drawable[]
            {
                scaleContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Origin           = Anchor.Centre,
                    Anchor           = Anchor.Centre,
                    Children         = new Drawable[]
                    {
                        HitArea = new HitReceptor
                        {
                            Hit = () =>
                            {
                                if (AllJudged)
                                {
                                    return(false);
                                }

                                UpdateResult(true);
                                return(true);
                            },
                        },
                        CirclePiece = new SkinnableDrawable(new OsuSkinComponent(CirclePieceComponent), _ => new MainCirclePiece())
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                        },
                        ApproachCircle = new ApproachCircle
                        {
                            Alpha = 0,
                            Scale = new Vector2(4),
                        }
                    }
                },
            };

            Size = HitArea.DrawSize;

            PositionBindable.BindValueChanged(_ => Position               = HitObject.StackedPosition);
            StackHeightBindable.BindValueChanged(_ => Position            = HitObject.StackedPosition);
            ScaleBindable.BindValueChanged(scale => scaleContainer.Scale  = new Vector2(scale.NewValue));
            AccentColour.BindValueChanged(accent => ApproachCircle.Colour = accent.NewValue);
        }
Пример #12
0
        private void load()
        {
            InternalChildren = new Drawable[]
            {
                Body          = new SkinnableDrawable(new OsuSkinComponent(OsuSkinComponents.SliderBody), _ => new DefaultSliderBody(), confineMode: ConfineMode.NoScaling),
                tailContainer = new Container <DrawableSliderTail> {
                    RelativeSizeAxes = Axes.Both
                },
                tickContainer = new Container <DrawableSliderTick> {
                    RelativeSizeAxes = Axes.Both
                },
                repeatContainer = new Container <DrawableSliderRepeat> {
                    RelativeSizeAxes = Axes.Both
                },
                headContainer = new Container <DrawableSliderHead> {
                    RelativeSizeAxes = Axes.Both
                },
                OverlayElementContainer = new Container {
                    RelativeSizeAxes = Axes.Both,
                },
                Ball = new SliderBall(this)
                {
                    GetInitialHitAction = () => HeadCircle.HitAction,
                    BypassAutoSizeAxes  = Axes.Both,
                    AlwaysPresent       = true,
                    Alpha = 0
                },
                slidingSample = new PausableSkinnableSound {
                    Looping = true
                }
            };

            PositionBindable.BindValueChanged(_ => Position    = HitObject.StackedPosition);
            StackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
            ScaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue));

            AccentColour.BindValueChanged(colour =>
            {
                foreach (var drawableHitObject in NestedHitObjects)
                {
                    drawableHitObject.AccentColour.Value = colour.NewValue;
                }
                updateBallTint();
            }, true);

            Tracking.BindValueChanged(updateSlidingSample);
        }
Пример #13
0
        private void load()
        {
            positionBindable.BindValueChanged(_ => Position    = HitObject.StackedPosition);
            stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
            scaleBindable.BindValueChanged(scale => Ball.Scale = new Vector2(scale.NewValue));

            positionBindable.BindTo(HitObject.PositionBindable);
            stackHeightBindable.BindTo(HitObject.StackHeightBindable);
            scaleBindable.BindTo(HitObject.ScaleBindable);

            AccentColour.BindValueChanged(colour =>
            {
                foreach (var drawableHitObject in NestedHitObjects)
                {
                    drawableHitObject.AccentColour.Value = colour.NewValue;
                }
            }, true);
        }
Пример #14
0
        private void load()
        {
            positionBindable.BindValueChanged(_ => Position              = HitObject.StackedPosition);
            stackHeightBindable.BindValueChanged(_ => Position           = HitObject.StackedPosition);
            scaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true);

            positionBindable.BindTo(HitObject.PositionBindable);
            stackHeightBindable.BindTo(HitObject.StackHeightBindable);
            scaleBindable.BindTo(HitObject.ScaleBindable);

            AccentColour.BindValueChanged(colour =>
            {
                explode.Colour        = colour.NewValue;
                glow.Colour           = colour.NewValue;
                circle.Colour         = colour.NewValue;
                ApproachCircle.Colour = colour.NewValue;
            }, true);
        }
        public DrawableHoldNoteTick(HoldNoteTick hitObject)
            : base(hitObject)
        {
            Container glowContainer;

            Anchor = Anchor.TopCentre;
            Origin = Anchor.TopCentre;

            RelativeSizeAxes = Axes.X;
            Size             = new Vector2(1);

            AddRangeInternal(new[]
            {
                glowContainer = new CircularContainer
                {
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Alpha            = 0,
                            AlwaysPresent    = true
                        }
                    }
                }
            });

            AccentColour.BindValueChanged(colour =>
            {
                glowContainer.EdgeEffect = new EdgeEffectParameters
                {
                    Type      = EdgeEffectType.Glow,
                    Radius    = 2f,
                    Roundness = 15f,
                    Colour    = colour.NewValue.Opacity(0.3f)
                };
            }, true);
        }
Пример #16
0
        public DrawableNote(Note hitObject)
            : base(hitObject)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            CornerRadius = 5;
            Masking      = true;

            AddInternal(headPiece = new NotePiece());

            AccentColour.BindValueChanged(colour =>
            {
                headPiece.AccentColour = colour.NewValue;

                EdgeEffect = new EdgeEffectParameters
                {
                    Type   = EdgeEffectType.Glow,
                    Colour = colour.NewValue.Lighten(1f).Opacity(0.2f),
                    Radius = 10,
                };
            }, true);
        }
Пример #17
0
        private void load(SentakkiRulesetConfigManager sentakkiConfigs)
        {
            sentakkiConfigs?.BindWith(SentakkiRulesetSettings.TouchAnimationDuration, AnimationDuration);

            Size   = new Vector2(130);
            Origin = Anchor.Centre;
            Anchor = Anchor.Centre;
            Alpha  = 0;
            AddRangeInternal(new Drawable[] {
                touchBody = new TouchBody(),
                flash     = new TouchFlashPiece {
                    RelativeSizeAxes = Axes.None,
                    Size             = new Vector2(105)
                },
                explode = new ExplodePiece {
                    RelativeSizeAxes = Axes.None,
                    Size             = new Vector2(105)
                },
            });

            trackedKeys.BindValueChanged(x =>
            {
                if (AllJudged)
                {
                    return;
                }

                UpdateResult(true);
            });

            AccentColour.BindValueChanged(c =>
            {
                flash.Colour   = c.NewValue;
                explode.Colour = c.NewValue;
            }, true);
        }
Пример #18
0
 private void load()
 {
     AccentColour.BindValueChanged(evt => capStar.UpdateColour(evt.NewValue), true);
 }