Exemplo n.º 1
0
        private void onSkinChanged()
        {
            for (int i = 0; i < stageDefinition.Columns; i++)
            {
                if (i > 0)
                {
                    float spacing = currentSkin.GetConfig <ManiaSkinConfigurationLookup, float>(
                        new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ColumnSpacing, i - 1))
                                    ?.Value ?? Stage.COLUMN_SPACING;

                    columns[i].Margin = new MarginPadding {
                        Left = spacing
                    };
                }

                float?width = currentSkin.GetConfig <ManiaSkinConfigurationLookup, float>(
                    new ManiaSkinConfigurationLookup(LegacyManiaSkinConfigurationLookups.ColumnWidth, i))
                              ?.Value;

                if (width == null)
                {
                    // only used by default skin (legacy skins get defaults set in LegacyManiaSkinConfiguration)
                    columns[i].Width = stageDefinition.IsSpecialColumn(i) ? Column.SPECIAL_COLUMN_WIDTH : Column.COLUMN_WIDTH;
                }
                else
                {
                    columns[i].Width = width.Value;
                }
            }
        }
Exemplo n.º 2
0
        protected override void ApplySkin(ISkinSource skin, bool allowFallback)
        {
            base.ApplySkin(skin, allowFallback);

            if (CurrentSkin == null)
            {
                return;
            }

            if (HitObject == null)
            {
                return;
            }

            var columns      = 9; // todo : get real number
            var column       = 0; // todo : get real number
            var columnHeight = skin.GetConfig <KaraokeSkinConfigurationLookup, float>(new KaraokeSkinConfigurationLookup(columns, LegacyKaraokeSkinConfigurationLookups.ColumnHeight, column))?.Value;

            if (columnHeight != null)
            {
                Height = columnHeight.Value; // todo : might have a better way to assign height.
            }
            var noteSkin = skin.GetConfig <KaraokeSkinLookup, NoteSkin>(new KaraokeSkinLookup(KaraokeSkinConfiguration.NoteStyle, HitObject.ParentLyric?.Singers))?.Value;

            if (noteSkin == null)
            {
                return;
            }

            textPiece.Colour = noteSkin.TextColor;
        }
Exemplo n.º 3
0
        protected override void ApplySkin(ISkinSource skin, bool allowFallback)
        {
            base.ApplySkin(skin, allowFallback);

            if (CurrentSkin == null)
            {
                return;
            }

            skin.GetConfig <KaraokeSkinLookup, KaraokeFont>(new KaraokeSkinLookup(KaraokeSkinConfiguration.LyricStyle, HitObject.FontIndex))?.BindValueChanged(karaokeFont =>
            {
                if (karaokeFont.NewValue != null)
                {
                    ApplyFont(karaokeFont.NewValue);
                }
            }, true);

            skin.GetConfig <KaraokeSkinLookup, KaraokeLayout>(new KaraokeSkinLookup(KaraokeSkinConfiguration.LyricLayout, HitObject.LayoutIndex))?.BindValueChanged(karaokeLayout =>
            {
                if (karaokeLayout.NewValue != null)
                {
                    ApplyLayout(karaokeLayout.NewValue);
                }
            }, true);
        }
Exemplo n.º 4
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string lightImage = skin.GetConfig <LegacyManiaSkinConfigurationLookup, string>(
                new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.LightImage, 0))?.Value
                                ?? "mania-stage-light";

            float leftLineWidth = skin.GetConfig <LegacyManiaSkinConfigurationLookup, float>(
                new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.LeftLineWidth, column.Index))
                                  ?.Value ?? 1;
            float rightLineWidth = skin.GetConfig <LegacyManiaSkinConfigurationLookup, float>(
                new LegacyManiaSkinConfigurationLookup(stage?.Columns.Count ?? 4, LegacyManiaSkinConfigurationLookups.RightLineWidth, column.Index))
                                   ?.Value ?? 1;

            bool hasLeftLine  = leftLineWidth > 0;
            bool hasRightLine = rightLineWidth > 0 && skin.GetConfig <LegacySkinConfiguration.LegacySetting, decimal>(LegacySkinConfiguration.LegacySetting.Version)?.Value >= 2.4m ||
                                stage == null || column.Index == stage.Columns.Count - 1;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black
                },
                new Box
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = leftLineWidth,
                    Alpha            = hasLeftLine ? 1 : 0
                },
                new Box
                {
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    RelativeSizeAxes = Axes.Y,
                    Width            = rightLineWidth,
                    Alpha            = hasRightLine ? 1 : 0
                },
                lightContainer = new Container
                {
                    Origin           = Anchor.BottomCentre,
                    RelativeSizeAxes = Axes.Both,
                    Child            = light = new Sprite
                    {
                        Anchor           = Anchor.BottomCentre,
                        Origin           = Anchor.BottomCentre,
                        Texture          = skin.GetTexture(lightImage),
                        RelativeSizeAxes = Axes.X,
                        Width            = 1,
                        Alpha            = 0
                    }
                }
            };

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
Exemplo n.º 5
0
        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            base.SkinChanged(skin, allowFallback);

            Body.BorderSize  = skin.GetConfig <OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderBorderSize)?.Value ?? SliderBody.DEFAULT_BORDER_SIZE;
            sliderPathRadius = skin.GetConfig <OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderPathRadius)?.Value ?? OsuHitObject.OBJECT_RADIUS;
            updatePathRadius();

            Body.AccentColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderTrackOverride)?.Value ?? AccentColour.Value;
            Body.BorderColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;
        }
Exemplo n.º 6
0
        private void load(ISkinSource source)
        {
            spinnerBlink = source.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value != true;

            AddRangeInternal(new[]
            {
                new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-background"),
                    Colour  = source.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SpinnerBackground)?.Value ?? new Color4(100, 100, 100, 255),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = SPINNER_Y_CENTRE,
                },
                disc = new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-circle"),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = SPINNER_Y_CENTRE,
                },
                metre = new Container
                {
                    AutoSizeAxes = Axes.Both,
                    // this anchor makes no sense, but that's what stable uses.
                    Anchor = Anchor.TopLeft,
                    Origin = Anchor.TopLeft,
                    Margin = new MarginPadding {
                        Top = SPINNER_TOP_OFFSET
                    },
                    Masking = true,
                    Child   = metreSprite = new Sprite
                    {
                        Texture = source.GetTexture("spinner-metre"),
                        Anchor  = Anchor.TopLeft,
                        Origin  = Anchor.TopLeft,
                        Scale   = new Vector2(SPRITE_SCALE)
                    }
                },
                ApproachCircle = new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-approachcircle"),
                    Scale   = new Vector2(SPRITE_SCALE * 1.86f),
                    Y       = SPINNER_Y_CENTRE,
                }
            });
        }
Exemplo n.º 7
0
        public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup)
        {
            if (skin != null)
            {
                if (lookup is GlobalSkinColours || lookup is SkinCustomColourLookup)
                {
                    return(lookupWithFallback <TLookup, TValue>(lookup, AllowColourLookup));
                }

                return(lookupWithFallback <TLookup, TValue>(lookup, AllowConfigurationLookup));
            }

            return(fallbackSource?.GetConfig <TLookup, TValue>(lookup));
        }
Exemplo n.º 8
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;
            });
        }
Exemplo n.º 9
0
        private void load(OsuColour colours, ISkinSource skin)
        {
            currentSkin = skin;
            columnFlow.Children.ForEach(x => x.Colour = x.IsSpecial ? colours.Gray9 : colours.Gray0);

            skin.SourceChanged += onSkinChanged;
            onSkinChanged();

            Direction.BindValueChanged(dir =>
            {
                var judgementAreaPercentage = skin.GetConfig <KaraokeSkinConfigurationLookup, float>(
                    new KaraokeSkinConfigurationLookup(Columns, LegacyKaraokeSkinConfigurationLookups.JudgementAresPrecentage, 0))
                                              ?.Value ?? 0.4f;

                switch (dir.NewValue)
                {
                case ScrollingDirection.Left:
                    OnDirectionChanged(KaraokeScrollingDirection.Left, judgementAreaPercentage);
                    break;

                case ScrollingDirection.Right:
                    OnDirectionChanged(KaraokeScrollingDirection.Right, judgementAreaPercentage);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(dir.NewValue));
                }
            });
        }
Exemplo n.º 10
0
        private void load(ISkinSource skinSource, ILyricEditorState state)
        {
            var layoutDictionary = skinSource.GetConfig <KaraokeIndexLookup, IDictionary <int, string> >(KaraokeIndexLookup.Layout)?.Value;

            if (layoutDictionary == null)
            {
                return;
            }

            foreach (var layoutIndex in layoutDictionary)
            {
                var layout = skinSource?.GetConfig <KaraokeSkinLookup, LyricLayout>(new KaraokeSkinLookup(KaraokeSkinConfiguration.LyricLayout, layoutIndex.Key)).Value;
                Content.Add(new LayoutSelectionItem(layout));
            }

            state.BindableCaretPosition.BindValueChanged(e =>
            {
                var lyric = e.NewValue?.Lyric;
                var layoutSelectionItems = Content.Children.OfType <LayoutSelectionItem>();

                foreach (var item in layoutSelectionItems)
                {
                    item.Lyric = lyric;
                }
            }, true);
        }
Exemplo n.º 11
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,
                },
            };
        }
Exemplo n.º 12
0
        private void load(ISkinSource skin, OsuConfigManager config)
        {
            Texture       = skin.GetTexture("cursortrail");
            disjointTrail = skin.GetTexture("cursormiddle") == null;

            if (disjointTrail)
            {
                bool centre = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorCentre)?.Value ?? true;

                TrailOrigin = centre ? Anchor.Centre : Anchor.TopLeft;
                Blending    = BlendingParameters.Inherit;
            }
            else
            {
                Blending = BlendingParameters.Additive;
            }

            if (Texture != null)
            {
                // stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
                Texture.ScaleAdjust *= 1.6f;
            }

            cursorSize = config.GetBindable <float>(OsuSetting.GameplayCursorSize).GetBoundCopy();
        }
Exemplo n.º 13
0
        private void load(ISkinSource skin, TauRulesetConfigManager config)
        {
            path.Colour = skin.GetConfig <TauSkinColour, Color4>(TauSkinColour.Slider)?.Value ?? Color4.White;
            config?.BindWith(TauRulesetSettings.KiaiEffect, effect);

            Tracking.BindValueChanged(updateSlidingSample);
        }
Exemplo n.º 14
0
        private void load(ISkinSource skin)
        {
            var texture           = skin.GetTexture("star2");
            var starBreakAdditive = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.StarBreakAdditive)?.Value ?? new Color4(255, 182, 193, 255);

            if (texture != null)
            {
                // stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
                texture.ScaleAdjust *= 1.6f;
            }

            InternalChildren = new[]
            {
                breakSpewer = new LegacyCursorParticleSpewer(texture, 20)
                {
                    Anchor    = Anchor.Centre,
                    Origin    = Anchor.Centre,
                    Colour    = starBreakAdditive,
                    Direction = SpewDirection.None,
                },
                kiaiSpewer = new LegacyCursorParticleSpewer(texture, 60)
                {
                    Anchor    = Anchor.Centre,
                    Origin    = Anchor.Centre,
                    Colour    = starBreakAdditive,
                    Direction = SpewDirection.None,
                },
            };

            if (player != null)
            {
                ((IBindable <bool>)breakSpewer.Active).BindTo(player.IsBreakTime);
            }
        }
        private void updateComboColour()
        {
            if (!(HitObject is IHasComboInformation combo))
            {
                return;
            }

            var comboColours = skin.GetConfig <GlobalSkinColours, IReadOnlyList <Color4> >(GlobalSkinColours.ComboColours)?.Value ?? Array.Empty <Color4>();
            var comboColour  = combo.GetComboColour(comboColours);

            if (HitObject is IHasDuration)
            {
                mainComponents.Colour = ColourInfo.GradientHorizontal(comboColour, Color4.White);
            }
            else
            {
                mainComponents.Colour = comboColour;
            }

            var   col        = mainComponents.Colour.TopLeft.Linear;
            float brightness = col.R + col.G + col.B;

            // decide the combo index colour based on brightness?
            comboIndexText.Colour = brightness > 0.5f ? Color4.Black : Color4.White;
        }
            private void load(DrawableHitObject drawableObject, ISkinSource skin)
            {
                var slider = (DrawableSlider)drawableObject;

                RelativeSizeAxes = Axes.Both;

                float radius = skin.GetConfig <OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderPathRadius)?.Value ?? OsuHitObject.OBJECT_RADIUS;

                InternalChild = new CircularContainer
                {
                    Masking          = true,
                    RelativeSizeAxes = Axes.Both,
                    Scale            = new Vector2(radius / OsuHitObject.OBJECT_RADIUS),
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    Blending         = BlendingParameters.Additive,
                    BorderThickness  = 10,
                    BorderColour     = Color4.White,
                    Alpha            = 1,
                    Child            = box = new Box
                    {
                        Blending         = BlendingParameters.Additive,
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.White,
                        AlwaysPresent    = true,
                        Alpha            = 0
                    }
                };

                slider.Tracking.BindValueChanged(trackingChanged, true);
            }
Exemplo n.º 17
0
            protected override void ApplySkin(ISkinSource skin, bool allowFallback)
            {
                // Get layout
                layout = skin?.GetConfig <KaraokeSkinLookup, KaraokeLayout>(new KaraokeSkinLookup(KaraokeSkinConfiguration.LyricLayout, HitObject.LayoutIndex))?.Value;

                base.ApplySkin(skin, allowFallback);
            }
Exemplo n.º 18
0
        protected override void ApplySkin(ISkinSource skin, bool allowFallback)
        {
            base.ApplySkin(skin, allowFallback);

            bool allowBallTint = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.AllowSliderBallTint)?.Value ?? false;

            Ball.Colour = allowBallTint ? AccentColour.Value : Color4.White;
        }
Exemplo n.º 19
0
        private void load(DrawableHitObject drawableObject, ISkinSource skin)
        {
            OsuHitObject osuObject = (OsuHitObject)drawableObject.HitObject;

            Sprite hitCircleSprite;
            SkinnableSpriteText hitCircleText;

            InternalChildren = new Drawable[]
            {
                hitCircleSprite = new Sprite
                {
                    Texture = getTextureWithFallback(string.Empty),
                    Colour  = drawableObject.AccentColour.Value,
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                },
                hitCircleText = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
                {
                    Font = OsuFont.Numeric.With(size: 40),
                    UseFullGlyphHeight = false,
                }, confineMode: ConfineMode.NoScaling),
                new Sprite
                {
                    Texture = getTextureWithFallback("overlay"),
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                }
            };

            bool overlayAboveNumber = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.HitCircleOverlayAboveNumber)?.Value ?? true;

            if (!overlayAboveNumber)
            {
                ChangeInternalChildDepth(hitCircleText, -float.MaxValue);
            }

            state.BindTo(drawableObject.State);
            state.BindValueChanged(updateState, true);

            accentColour.BindTo(drawableObject.AccentColour);
            accentColour.BindValueChanged(colour => hitCircleSprite.Colour = colour.NewValue, true);

            indexInCurrentCombo.BindTo(osuObject.IndexInCurrentComboBindable);
            indexInCurrentCombo.BindValueChanged(index => hitCircleText.Text = (index.NewValue + 1).ToString(), true);

            Texture getTextureWithFallback(string name)
            {
                Texture tex = null;

                if (!string.IsNullOrEmpty(priorityLookup))
                {
                    tex = skin.GetTexture($"{priorityLookup}{name}");
                }

                return(tex ?? skin.GetTexture($"hitcircle{name}"));
            }
        }
Exemplo n.º 20
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 => updateAccentColour(skin, accent.NewValue), true);

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

            BorderSize   = skin.GetConfig <OsuSkinConfiguration, float>(OsuSkinConfiguration.SliderBorderSize)?.Value ?? 1;
            BorderColour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBorder)?.Value ?? Color4.White;
        }
Exemplo n.º 21
0
        private void load(ISkinSource source, DrawableHitObject drawableObject)
        {
            spinnerBlink = source.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.SpinnerNoBlink)?.Value != true;

            drawableSpinner = (DrawableSpinner)drawableObject;

            RelativeSizeAxes = Axes.Both;

            InternalChild = new Container
            {
                // the old-style spinner relied heavily on absolute screen-space coordinate values.
                // wrap everything in a container simulating absolute coords to preserve alignment
                // as there are skins that depend on it.
                Width    = 640,
                Height   = 480,
                Anchor   = Anchor.Centre,
                Origin   = Anchor.Centre,
                Children = new Drawable[]
                {
                    new Sprite
                    {
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-background"),
                        Scale   = new Vector2(sprite_scale)
                    },
                    disc = new Sprite
                    {
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-circle"),
                        Scale   = new Vector2(sprite_scale)
                    },
                    metre = new Container
                    {
                        AutoSizeAxes = Axes.Both,
                        // this anchor makes no sense, but that's what stable uses.
                        Anchor = Anchor.TopLeft,
                        Origin = Anchor.TopLeft,
                        // adjustment for stable (metre has additional offset)
                        Margin = new MarginPadding {
                            Top = 20
                        },
                        Masking = true,
                        Child   = metreSprite = new Sprite
                        {
                            Texture = source.GetTexture("spinner-metre"),
                            Anchor  = Anchor.TopLeft,
                            Origin  = Anchor.TopLeft,
                            Scale   = new Vector2(0.625f)
                        }
                    }
                }
            };
        }
Exemplo n.º 22
0
        private void load(DrawableHitObject drawableObject, ISkinSource skin)
        {
            var drawableCatchObject = (DrawablePalpableCatchHitObject)drawableObject;

            accentColour.BindTo(drawableCatchObject.AccentColour);
            hyperDash.BindTo(drawableCatchObject.HyperDash);

            InternalChildren = new Drawable[]
            {
                colouredSprite = new Sprite
                {
                    Texture = skin.GetTexture(lookupName),
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                },
                new Sprite
                {
                    Texture = skin.GetTexture($"{lookupName}-overlay"),
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                },
            };

            if (hyperDash.Value)
            {
                var hyperDashOverlay = new Sprite
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                    Blending = BlendingParameters.Additive,
                    Depth    = 1,
                    Alpha    = 0.7f,
                    Scale    = new Vector2(1.2f),
                    Texture  = skin.GetTexture(lookupName),
                    Colour   = skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDashFruit)?.Value ??
                               skin.GetConfig <CatchSkinColour, Color4>(CatchSkinColour.HyperDash)?.Value ??
                               Catcher.DEFAULT_HYPER_DASH_COLOUR,
                };

                AddInternal(hyperDashOverlay);
            }
        }
Exemplo n.º 23
0
        private void load(ISkinSource skin)
        {
            Child = content = new Container
            {
                Size     = new Vector2(180, 200),
                Children = new Drawable[]
                {
                    new Sprite
                    {
                        Texture = skin.GetTexture("taiko-bar-left")
                    },
                    left = new LegacyHalfDrum(false)
                    {
                        Name             = "Left Half",
                        RelativeSizeAxes = Axes.Both,
                        RimAction        = TaikoAction.LeftRim,
                        CentreAction     = TaikoAction.LeftCentre
                    },
                    right = new LegacyHalfDrum(true)
                    {
                        Name             = "Right Half",
                        RelativeSizeAxes = Axes.Both,
                        Origin           = Anchor.TopRight,
                        Scale            = new Vector2(-1, 1),
                        RimAction        = TaikoAction.RightRim,
                        CentreAction     = TaikoAction.RightCentre
                    }
                }
            };

            // this will be used in the future for stable skin alignment. keeping here for reference.
            const float taiko_bar_y = 0;

            // stable things
            const float ratio = 1.6f;

            // because the right half is flipped, we need to position using width - position to get the true "topleft" origin position
            float negativeScaleAdjust = content.Width / ratio;

            if (skin.GetConfig <SkinConfiguration.LegacySetting, decimal>(SkinConfiguration.LegacySetting.Version)?.Value >= 2.1m)
            {
                left.Centre.Position  = new Vector2(0, taiko_bar_y) * ratio;
                right.Centre.Position = new Vector2(negativeScaleAdjust - 56, taiko_bar_y) * ratio;
                left.Rim.Position     = new Vector2(0, taiko_bar_y) * ratio;
                right.Rim.Position    = new Vector2(negativeScaleAdjust - 56, taiko_bar_y) * ratio;
            }
            else
            {
                left.Centre.Position  = new Vector2(18, taiko_bar_y + 31) * ratio;
                right.Centre.Position = new Vector2(negativeScaleAdjust - 54, taiko_bar_y + 31) * ratio;
                left.Rim.Position     = new Vector2(8, taiko_bar_y + 23) * ratio;
                right.Rim.Position    = new Vector2(negativeScaleAdjust - 53, taiko_bar_y + 23) * ratio;
            }
        }
Exemplo n.º 24
0
        private void load(ISkinSource skin, TauRulesetConfigManager config)
        {
            config?.BindWith(TauRulesetSettings.KiaiEffect, effect);
            ACCENT_COLOR.Value = skin?.GetConfig <TauSkinColour, Color4>(TauSkinColour.Accent)?.Value ?? Color4Extensions.FromHex(@"FF0040");

            RegisterPool <Beat, DrawableBeat>(10);
            RegisterPool <HardBeat, DrawableHardBeat>(5);

            RegisterPool <Slider, DrawableSlider>(3);
            RegisterPool <SliderHeadBeat, DrawableSliderHead>(3);
        }
Exemplo n.º 25
0
#pragma warning restore 618

        #endregion

        protected override void SkinChanged(ISkinSource skin, bool allowFallback)
        {
            base.SkinChanged(skin, allowFallback);

            if (HitObject is IHasComboInformation combo)
            {
                var comboColours = skin.GetConfig <GlobalSkinConfiguration, List <Color4> >(GlobalSkinConfiguration.ComboColours)?.Value;

                AccentColour.Value = comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White;
            }
        }
Exemplo n.º 26
0
        private void applySingerStyle(ISkinSource skin, int[] singers)
        {
            var noteSkin = skin?.GetConfig <KaraokeSkinLookup, NoteSkin>(new KaraokeSkinLookup(KaraokeSkinConfiguration.NoteStyle, singers))?.Value;

            if (noteSkin == null)
            {
                return;
            }

            AccentColour.Value = noteSkin.NoteColor;
            HitColour.Value    = noteSkin.BlinkColor;
        }
Exemplo n.º 27
0
        private void onSkinChanged()
        {
            for (int i = 0; i < Columns; i++)
            {
                // apply column height from skin.
                float?height = currentSkin.GetConfig <KaraokeSkinConfigurationLookup, float>(
                    new KaraokeSkinConfigurationLookup(Columns, LegacyKaraokeSkinConfigurationLookups.ColumnHeight, i))
                               ?.Value;

                columnFlow[i].Height = height ?? DefaultColumnBackground.COLUMN_HEIGHT;
            }
        }
Exemplo n.º 28
0
        private void load(ISkinSource skin)
        {
            bool centre = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorCentre)?.Value ?? true;

            spin = skin.GetConfig <OsuSkinConfiguration, bool>(OsuSkinConfiguration.CursorRotate)?.Value ?? true;

            InternalChildren = new[]
            {
                ExpandTarget = new NonPlayfieldSprite
                {
                    Texture = skin.GetTexture("cursor"),
                    Anchor  = Anchor.Centre,
                    Origin  = centre ? Anchor.Centre : Anchor.TopLeft,
                },
                new NonPlayfieldSprite
                {
                    Texture = skin.GetTexture("cursormiddle"),
                    Anchor  = Anchor.Centre,
                    Origin  = centre ? Anchor.Centre : Anchor.TopLeft,
                },
            };
        }
        public IBindable <TValue> GetConfig <TLookup, TValue>(TLookup lookup)
        {
            if (AllowConfigurationLookup && skin != null)
            {
                var bindable = skin.GetConfig <TLookup, TValue>(lookup);
                if (bindable != null)
                {
                    return(bindable);
                }
            }

            return(fallbackSource?.GetConfig <TLookup, TValue>(lookup));
        }
Exemplo n.º 30
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)
                            },
                        }
                    }
                };
            }