Пример #1
0
        private void load(ISkinSource skin, DrawableHitObject drawableObject)
        {
            var ballColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? Color4.White;

            InternalChildren = new[]
            {
                layerNd = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Texture = skin.GetTexture("sliderb-nd"),
                    Colour  = new Color4(5, 5, 5, 255),
                },
                LegacyColourCompatibility.ApplyWithDoubledAlpha(animationContent.With(d =>
                {
                    d.Anchor = Anchor.Centre;
                    d.Origin = Anchor.Centre;
                }), ballColour),
                layerSpec = new Sprite
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                    Texture  = skin.GetTexture("sliderb-spec"),
                    Blending = BlendingParameters.Additive,
                },
            };
        }
Пример #2
0
            private void load(ISkinSource skin)
            {
                float leftLineWidth  = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.LeftLineWidth, columnIndex)?.Value ?? 1;
                float rightLineWidth = skin.GetManiaSkinConfig <float>(LegacyManiaSkinConfigurationLookups.RightLineWidth, columnIndex)?.Value ?? 1;

                bool hasLeftLine  = leftLineWidth > 0;
                bool hasRightLine = rightLineWidth > 0 && skin.GetConfig <SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version)?.Value >= 2.4m ||
                                    isLastColumn;

                Color4 lineColour       = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.ColumnLineColour, columnIndex)?.Value ?? Color4.White;
                Color4 backgroundColour = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.ColumnBackgroundColour, columnIndex)?.Value ?? Color4.Black;

                InternalChildren = new Drawable[]
                {
                    LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box
                    {
                        RelativeSizeAxes = Axes.Both
                    }, backgroundColour),
                    new HitTargetInsetContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children         = new[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Y,
                                Width            = leftLineWidth,
                                Scale            = new Vector2(0.740f, 1),
                                Alpha            = hasLeftLine ? 1 : 0,
                                Child            = LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box
                                {
                                    RelativeSizeAxes = Axes.Both
                                }, lineColour)
                            },
                            new Container
                            {
                                Anchor           = Anchor.TopRight,
                                Origin           = Anchor.TopRight,
                                RelativeSizeAxes = Axes.Y,
                                Width            = rightLineWidth,
                                Scale            = new Vector2(0.740f, 1),
                                Alpha            = hasRightLine ? 1 : 0,
                                Child            = LegacyColourCompatibility.ApplyWithDoubledAlpha(new Box
                                {
                                    RelativeSizeAxes = Axes.Both
                                }, lineColour)
                            },
                        }
                    }
                };
            }