Beispiel #1
0
        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            base.SkinChanged(skin, allowFallback);

            Body.AccentColour = skin.GetValue <SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : Body.AccentColour);
            Body.BorderColour = skin.GetValue <SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : Body.BorderColour);
            Ball.AccentColour = skin.GetValue <SkinConfiguration, Color4>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : Ball.AccentColour);
        }
Beispiel #2
0
        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            base.SkinChanged(skin, allowFallback);

            Body.BorderSize   = skin.GetValue <SkinConfiguration, float?>(s => s.SliderBorderSize) ?? SliderBody.DEFAULT_BORDER_SIZE;
            Body.AccentColour = skin.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderTrackOverride") ? s.CustomColours["SliderTrackOverride"] : (Color4?)null) ?? AccentColour.Value;
            Body.BorderColour = skin.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBorder") ? s.CustomColours["SliderBorder"] : (Color4?)null) ?? Color4.White;
            Ball.AccentColour = skin.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? AccentColour.Value;
        }
Beispiel #3
0
        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            base.SkinChanged(skin, allowFallback);

            if (HitObject is IHasComboInformation combo)
            {
                AccentColour = skin.GetValue <SkinConfiguration, Color4?>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
            }
        }
        public TValue GetValue <TConfiguration, TValue>(Func <TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
        {
            TValue val;

            if (AllowConfigurationLookup && skin != null && (val = skin.GetValue(query)) != null)
            {
                return(val);
            }

            return(fallbackSource == null ? default : fallbackSource.GetValue(query));
        }
        public TValue GetValue <TConfiguration, TValue>(Func <TConfiguration, TValue> query) where TConfiguration : SkinConfiguration
        {
            TValue val;

            if ((skin as Skin)?.Configuration is TConfiguration conf)
            {
                if (beatmapSkins.Value && (val = query.Invoke(conf)) != null)
                {
                    return(val);
                }
            }

            return(fallbackSource == null ? default : fallbackSource.GetValue(query));
        }
Beispiel #6
0
            private void load(ISkinSource skin, DrawableHitObject drawableObject)
            {
                animationContent.Colour = skin.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Color4.White;

                InternalChildren = new[]
                {
                    new Sprite
                    {
                        Texture = skin.GetTexture("sliderb-nd"),
                        Colour  = new Color4(5, 5, 5, 255),
                    },
                    animationContent,
                    new Sprite
                    {
                        Texture  = skin.GetTexture("sliderb-spec"),
                        Blending = BlendingParameters.Additive,
                    },
                };
            }
Beispiel #7
0
 private void load(ISkinSource skin)
 {
     Texture = skin.GetTexture("sliderb");
     Colour  = skin.GetValue <SkinConfiguration, Color4?>(s => s.CustomColours.ContainsKey("SliderBall") ? s.CustomColours["SliderBall"] : (Color4?)null) ?? Color4.White;
 }
Beispiel #8
0
 protected override void SkinChanged(ISkinSource skin, bool allowFallback)
 {
     cursorExpand = skin.GetValue <SkinConfiguration, bool>(s => s.CursorExpand ?? true);
 }