Beispiel #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,
                },
            };
        }
        protected override void LoadComplete()
        {
            base.LoadComplete();

            var hitObject = (DrawablePalpableCatchHitObject)DrawableHitObject;

            if (hitObject != null)
            {
                AccentColour.BindTo(hitObject.AccentColour);
                HyperDash.BindTo(hitObject.HyperDash);
            }

            hyperSprite.Colour = Skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
                                 Skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
                                 Catcher.DEFAULT_HYPER_DASH_COLOUR;

            AccentColour.BindValueChanged(colour =>
            {
                colouredSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue);
            }, true);

            HyperDash.BindValueChanged(hyper =>
            {
                hyperSprite.Alpha = hyper.NewValue ? 0.7f : 0;
            }, true);
        }
        public override IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup)
        {
            switch (lookup)
            {
            case CatchSkinColour colour:
                var result = (Bindable <Color4>)base.GetConfig <SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour));
                if (result == null)
                {
                    return(null);
                }

                result.Value = LegacyColourCompatibility.DisallowZeroAlpha(result.Value);
                return((IBindable <TValue>)result);

            case CatchSkinConfiguration config:
                switch (config)
                {
                case CatchSkinConfiguration.FlipCatcherPlate:
                    // Don't flip catcher plate contents if the catcher is provided by this legacy skin.
                    if (GetDrawableComponent(new CatchSkinComponent(CatchSkinComponents.Catcher)) != null)
                    {
                        return((IBindable <TValue>) new Bindable <bool>());
                    }

                    break;
                }

                break;
            }

            return(base.GetConfig <TLookup, TValue>(lookup));
        }
Beispiel #4
0
 private void load()
 {
     AccentColour = LegacyColourCompatibility.DisallowZeroAlpha(
         component == TaikoSkinComponents.CentreHit
             ? new Colour4(235, 69, 44, 255)
             : new Colour4(67, 142, 172, 255));
 }
Beispiel #5
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            state.BindValueChanged(updateState, true);
            accentColour.BindValueChanged(colour => hitCircleSprite.Colour   = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
            indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
        }
        protected override void LoadComplete()
        {
            base.LoadComplete();

            accentColour.BindValueChanged(colour => hitCircleSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
            if (hasNumber)
            {
                indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);
            }

            drawableObject.ApplyCustomUpdateState += updateStateTransforms;
            updateStateTransforms(drawableObject, drawableObject.State.Value);
        }
Beispiel #7
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)
                            },
                        }
                    }
                };
            }
Beispiel #8
0
        public override IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup)
        {
            switch (lookup)
            {
            case CatchSkinColour colour:
                var result = (Bindable <Color4>)Source.GetConfig <SkinCustomColourLookup, TValue>(new SkinCustomColourLookup(colour));
                if (result == null)
                {
                    return(null);
                }

                result.Value = LegacyColourCompatibility.DisallowZeroAlpha(result.Value);
                return((IBindable <TValue>)result);
            }

            return(Source.GetConfig <TLookup, TValue>(lookup));
        }
        protected override void LoadComplete()
        {
            base.LoadComplete();

            AccentColour.BindTo(ObjectState.AccentColour);
            HyperDash.BindTo(ObjectState.HyperDash);

            hyperSprite.Colour = Skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
                                 Skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
                                 Catcher.DEFAULT_HYPER_DASH_COLOUR;

            AccentColour.BindValueChanged(colour =>
            {
                colouredSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue);
            }, true);

            HyperDash.BindValueChanged(hyper =>
            {
                hyperSprite.Alpha = hyper.NewValue ? 0.7f : 0;
            }, true);
        }
Beispiel #10
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string targetImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.HitTargetImage)?.Value
                                 ?? "mania-stage-hint";

            bool showJudgementLine = skin.GetManiaSkinConfig <bool>(LegacyManiaSkinConfigurationLookups.ShowJudgementLine)?.Value
                                     ?? true;

            Color4 lineColour = skin.GetManiaSkinConfig <Color4>(LegacyManiaSkinConfigurationLookups.JudgementLineColour)?.Value
                                ?? Color4.White;

            InternalChild = directionContainer = new Container
            {
                Origin           = Anchor.CentreLeft,
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Children         = new Drawable[]
                {
                    new Sprite
                    {
                        Texture          = skin.GetTexture(targetImage),
                        Scale            = new Vector2(1, 0.9f * 1.6025f),
                        RelativeSizeAxes = Axes.X,
                        Width            = 1
                    },
                    new Box
                    {
                        Anchor           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.X,
                        Height           = 1,
                        Colour           = LegacyColourCompatibility.DisallowZeroAlpha(lineColour),
                        Alpha            = showJudgementLine ? 0.9f : 0
                    }
                }
            };

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
Beispiel #11
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string lightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LightImage)?.Value
                                ?? "mania-stage-light";

            float lightPosition = GetColumnSkinConfig <float>(skin, LegacyManiaSkinConfigurationLookups.LightPosition)?.Value
                                  ?? 0;

            Color4 lightColour = GetColumnSkinConfig <Color4>(skin, LegacyManiaSkinConfigurationLookups.ColumnLightColour)?.Value
                                 ?? Color4.White;

            InternalChildren = new[]
            {
                lightContainer = new Container
                {
                    Origin           = Anchor.BottomCentre,
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Bottom = lightPosition
                    },
                    Child = light = new Sprite
                    {
                        Anchor           = Anchor.BottomCentre,
                        Origin           = Anchor.BottomCentre,
                        Colour           = LegacyColourCompatibility.DisallowZeroAlpha(lightColour),
                        Texture          = skin.GetTexture(lightImage),
                        RelativeSizeAxes = Axes.X,
                        Width            = 1,
                        Alpha            = 0
                    }
                }
            };

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
Beispiel #12
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            accentColour.BindValueChanged(colour => colouredSprite.Colour = LegacyColourCompatibility.DisallowZeroAlpha(colour.NewValue), true);
        }