Ejemplo n.º 1
0
        private void onHitObjectApplied(DrawableHitObject obj)
        {
            var drawableSlider = (DrawableSlider)obj;

            if (drawableSlider.HitObject == null)
            {
                return;
            }

            // When not tracking the follow circle, unbind from the config and forcefully disable snaking out - it looks better that way.
            if (!drawableSlider.HeadCircle.TrackFollowCircle)
            {
                SnakingOut.UnbindFrom(configSnakingOut);
                SnakingOut.Value = false;
            }
        }
Ejemplo n.º 2
0
        private void load(ISkinSource skin, DrawableHitObject drawableObject)
        {
            var drawableSlider = (DrawableSlider)drawableObject;

            scaleBindable = drawableSlider.ScaleBindable.GetBoundCopy();
            scaleBindable.BindValueChanged(scale => PathRadius = OsuHitObject.OBJECT_RADIUS * scale.NewValue, true);

            pathVersion = drawableSlider.PathVersion.GetBoundCopy();
            pathVersion.BindValueChanged(_ => Refresh());

            accentColour = drawableObject.AccentColour.GetBoundCopy();
            accentColour.BindValueChanged(accent => AccentColour = GetBodyAccentColour(skin, accent.NewValue), true);

            config?.BindWith(OsuRulesetSetting.SnakingInSliders, SnakingIn);
            config?.BindWith(OsuRulesetSetting.SnakingOutSliders, configSnakingOut);

            SnakingOut.BindTo(configSnakingOut);

            BorderSize   = skin.GetConfig <OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderBorderSize)?.Value ?? 1;
            BorderColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;

            drawableObject.HitObjectApplied += onHitObjectApplied;
        }