private void load(DrawableHitObject drawableHitObject, ISkinSource source)
        {
            RelativeSizeAxes = Axes.Both;

            DrawableSpinner = (DrawableSpinner)drawableHitObject;

            AddRangeInternal(new[]
            {
                spin = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Depth   = float.MinValue,
                    Texture = source.GetTexture("spinner-spin"),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = 120 - 45 // offset temporarily to avoid overlapping default spin counter
                },
                clear = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Depth   = float.MinValue,
                    Alpha   = 0,
                    Texture = source.GetTexture("spinner-clear"),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = -60
                },
            });
        }
Beispiel #2
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,
                },
            };
        }
Beispiel #3
0
        private void load(ISkinSource skin)
        {
            string leftImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.LeftStageImage)?.Value
                               ?? "mania-stage-left";

            string rightImage = skin.GetManiaSkinConfig <string>(LegacyManiaSkinConfigurationLookups.RightStageImage)?.Value
                                ?? "mania-stage-right";

            InternalChildren = new[]
            {
                leftSprite = new Sprite
                {
                    Anchor  = Anchor.TopLeft,
                    Origin  = Anchor.TopRight,
                    X       = 0.05f,
                    Texture = skin.GetTexture(leftImage),
                },
                rightSprite = new Sprite
                {
                    Anchor  = Anchor.TopRight,
                    Origin  = Anchor.TopLeft,
                    X       = -0.05f,
                    Texture = skin.GetTexture(rightImage)
                }
            };
        }
Beispiel #4
0
            private void load(DrawableHitObject drawableObject, ISkinSource skin)
            {
                Sprite hitCircleSprite;

                InternalChildren = new Drawable[]
                {
                    hitCircleSprite = new Sprite
                    {
                        Texture = skin.GetTexture("hitcircle"),
                        Colour  = drawableObject.AccentColour.Value,
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                    },
                    new SkinnableSpriteText("Play/osu/number-text", _ => new OsuSpriteText
                    {
                        Font = OsuFont.Numeric.With(size: 40),
                        UseFullGlyphHeight = false,
                    }, confineMode: ConfineMode.NoScaling)
                    {
                        Text = (((IHasComboInformation)drawableObject.HitObject).IndexInCurrentCombo + 1).ToString()
                    },
                    new Sprite
                    {
                        Texture = skin.GetTexture("hitcircleoverlay"),
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                    }
                };

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

                accentColour.BindTo(drawableObject.AccentColour);
                accentColour.BindValueChanged(colour => hitCircleSprite.Colour = colour.NewValue, true);
            }
        private void load(ISkinSource source, DrawableHitObject drawableObject)
        {
            drawableSpinner = (DrawableSpinner)drawableObject;

            Scale = new Vector2(final_scale);

            InternalChildren = new Drawable[]
            {
                discBottom = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-bottom")
                },
                discTop = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-top")
                },
                fixedMiddle = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-middle")
                },
                spinningMiddle = new Sprite
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Texture = source.GetTexture("spinner-middle2")
                }
            };
        }
Beispiel #6
0
        private void load(ISkinSource skin)
        {
            RelativeSizeAxes = Axes.Both;

            InternalChildren = new Drawable[]
            {
                line = new Sprite
                {
                    EdgeSmoothness   = new Vector2(1f),
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    FillMode         = FillMode.Fit,
                    RelativeSizeAxes = Axes.Both,
                    Texture          = skin.GetTexture($"{TauRuleset.SHORT_NAME}-handle-line")
                },
                handle = new Sprite
                {
                    RelativePositionAxes = Axes.Both,
                    RelativeSizeAxes     = Axes.Both,
                    Y        = -.25f,
                    Size     = new Vector2(.03f),
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                    FillMode = FillMode.Fit,
                    Texture  = skin.GetTexture($"{TauRuleset.SHORT_NAME}-handle")
                }
            };
        }
Beispiel #7
0
        private void load(DrawableHitObject drawableHitObject, ISkinSource source)
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            // osu!stable positions spinner components in window-space (as opposed to gamefield-space). This is a 640x480 area taking up the entire screen.
            // In lazer, the gamefield-space positional transformation is applied in OsuPlayfieldAdjustmentContainer, which is inverted here to make this area take up the entire window space.
            Size     = new Vector2(640, 480);
            Position = new Vector2(0, -8f);

            DrawableSpinner = (DrawableSpinner)drawableHitObject;

            AddRangeInternal(new[]
            {
                spin = new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.Centre,
                    Depth   = float.MinValue,
                    Texture = source.GetTexture("spinner-spin"),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = SPINNER_TOP_OFFSET + 335,
                },
                clear = new Sprite
                {
                    Alpha   = 0,
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.Centre,
                    Depth   = float.MinValue,
                    Texture = source.GetTexture("spinner-clear"),
                    Scale   = new Vector2(SPRITE_SCALE),
                    Y       = SPINNER_TOP_OFFSET + 115,
                },
            });
        }
Beispiel #8
0
        private void load(ISkinSource skin, OsuColour colours)
        {
            InternalChildren = new Drawable[]
            {
                end = new Sprite
                {
                    Anchor           = Anchor.CentreRight,
                    Origin           = Anchor.CentreLeft,
                    RelativeSizeAxes = Axes.Both,
                    Texture          = skin.GetTexture("taiko-roll-end", WrapMode.ClampToEdge, WrapMode.ClampToEdge),
                    FillMode         = FillMode.Fit,
                },
                body = new Sprite
                {
                    RelativeSizeAxes = Axes.Both,
                    Texture          = skin.GetTexture("taiko-roll-middle", WrapMode.ClampToEdge, WrapMode.ClampToEdge),
                },
                headCircle = new LegacyCirclePiece
                {
                    RelativeSizeAxes = Axes.Y,
                },
            };

            AccentColour = colours.YellowDark;
        }
        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();
        }
Beispiel #10
0
        private void load(ISkinSource skin, TauRulesetConfigManager config)
        {
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;

            AddRangeInternal(new Drawable[]
            {
                background = new Sprite
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                    FillMode         = FillMode.Fit,
                    Texture          = skin.GetTexture($"{TauRuleset.SHORT_NAME}-field-background")
                },
                new Sprite
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.Both,
                    FillMode         = FillMode.Fit,
                    Texture          = skin.GetTexture($"{TauRuleset.SHORT_NAME}-ring-overlay")
                }
            });

            config?.BindWith(TauRulesetSettings.PlayfieldDim, playfieldDimLevel);
            playfieldDimLevel.BindValueChanged(v => { background.FadeTo(v.NewValue, 100); }, true);
        }
Beispiel #11
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string upImage = GetManiaSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.KeyImage)?.Value
                             ?? $"mania-key{FallbackColumnIndex}";

            string downImage = GetManiaSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.KeyImageDown)?.Value
                               ?? $"mania-key{FallbackColumnIndex}D";

            InternalChild = directionContainer = new Container
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Children         = new Drawable[]
                {
                    upSprite = new Sprite
                    {
                        Origin           = Anchor.BottomCentre,
                        Texture          = skin.GetTexture(upImage),
                        RelativeSizeAxes = Axes.X,
                        Width            = 1
                    },
                    downSprite = new Sprite
                    {
                        Origin           = Anchor.BottomCentre,
                        Texture          = skin.GetTexture(downImage),
                        RelativeSizeAxes = Axes.X,
                        Width            = 1,
                        Alpha            = 0
                    }
                }
            };

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
        private void load(ISkinSource skin)
        {
            RelativeSizeAxes = Axes.Both;

            InternalChild = content = new Container
            {
                RelativeSizeAxes = Axes.Both,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Children         = new Drawable[]
                {
                    new Sprite
                    {
                        Texture = skin.GetTexture("approachcircle"),
                        Scale   = new Vector2(0.73f),
                        Alpha   = 0.47f, // eyeballed to match stable
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                    },
                    new Sprite
                    {
                        Texture = skin.GetTexture("taikobigcircle"),
                        Scale   = new Vector2(0.7f),
                        Alpha   = 0.22f, // eyeballed to match stable
                        Anchor  = Anchor.Centre,
                        Origin  = Anchor.Centre,
                    },
                }
            };
        }
Beispiel #13
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}"));
            }
        }
Beispiel #14
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)
                        }
                    }
                }
            };
        }
Beispiel #15
0
        private void load(DrawableHitObject drawableHitObject, ISkinSource source)
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            // osu!stable positions spinner components in window-space (as opposed to gamefield-space). This is a 640x480 area taking up the entire screen.
            // In lazer, the gamefield-space positional transformation is applied in OsuPlayfieldAdjustmentContainer, which is inverted here to make this area take up the entire window space.
            Size     = new Vector2(640, 480);
            Position = new Vector2(0, -8f);

            DrawableSpinner = (DrawableSpinner)drawableHitObject;

            Container overlayContainer;

            AddInternal(overlayContainer = new Container
            {
                Depth            = float.MinValue,
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    spin = new Sprite
                    {
                        Anchor  = Anchor.TopCentre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-spin"),
                        Scale   = new Vector2(SPRITE_SCALE),
                        Y       = SPINNER_TOP_OFFSET + 335,
                    },
                    clear = new Sprite
                    {
                        Alpha   = 0,
                        Anchor  = Anchor.TopCentre,
                        Origin  = Anchor.Centre,
                        Texture = source.GetTexture("spinner-clear"),
                        Scale   = new Vector2(SPRITE_SCALE),
                        Y       = SPINNER_TOP_OFFSET + 115,
                    },
                }
            });

            bonusCounter = (source.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText)) as LegacySpriteText)?.With(c =>
            {
                c.Alpha  = 0f;
                c.Anchor = Anchor.TopCentre;
                c.Origin = Anchor.Centre;
                c.Font   = c.Font.With(fixedWidth: false);
                c.Scale  = new Vector2(SPRITE_SCALE);
                c.Y      = SPINNER_TOP_OFFSET + 299;
            });

            if (bonusCounter != null)
            {
                overlayContainer.Add(bonusCounter);
            }
        }
Beispiel #16
0
        private void load(ISkinSource skin)
        {
            Texture       = skin.GetTexture("cursortrail");
            disjointTrail = skin.GetTexture("cursormiddle") == null;

            if (Texture != null)
            {
                // stable "magic ratio". see OsuPlayfieldAdjustmentContainer for full explanation.
                Texture.ScaleAdjust *= 1.6f;
            }
        }
Beispiel #17
0
        private void load(ISkinSource skin, OsuConfigManager config)
        {
            Texture       = skin.GetTexture("cursortrail");
            disjointTrail = skin.GetTexture("cursormiddle") == null;

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

            cursorSize = config.GetBindable <float>(OsuSetting.GameplayCursorSize).GetBoundCopy();
        }
Beispiel #18
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,
                }
            });
        }
Beispiel #19
0
            private void load(ISkinSource skin)
            {
                var rng     = new Random();
                var kiai    = skin.GetTexture($"{TauRuleset.SHORT_NAME}-kiai");
                var kiaiBig = skin.GetTexture($"{TauRuleset.SHORT_NAME}-kiai-big");

                if (circular)
                {
                    for (int i = 0; i < particleAmount; i++)
                    {
                        particles.Add((kiaiBig != null ? new Sprite() : new Triangle()).With(d =>
                        {
                            d.RelativePositionAxes = Axes.Both;

                            d.Position = Extensions.GetCircularPosition(inversed ? (((float)(rng.NextDouble() * 0.15f) * 0.15f) + 0.5f) : ((float)(rng.NextDouble() * 0.15f) * 0.15f) + 0.5f,
                                                                        (float)rng.NextDouble() * 360f);

                            d.Rotation = (float)rng.NextDouble() * 360f;
                            d.Anchor   = Anchor.Centre;
                            d.Origin   = Anchor.BottomCentre;
                            d.Size     = new Vector2(rng.Next(5, 15));
                            d.Colour   = colour;
                            d.Alpha    = RNG.NextSingle(0.25f, 1f);
                            d.Texture  = kiaiBig ?? Texture.WhitePixel;
                        }));
                    }
                }
                else
                {
                    for (int i = 0; i < particleAmount; i++)
                    {
                        particles.Add((kiai != null ? new Sprite() : new Triangle()).With(d =>
                        {
                            d.RelativePositionAxes = Axes.Both;
                            d.Position             = Extensions.GetCircularPosition((float)(rng.NextDouble() * 0.15f) * 0.15f, ((float)rng.NextDouble() / 10 * 10) + (Angle - 20));
                            d.Rotation             = (float)rng.NextDouble() * 360f;
                            d.Anchor  = Anchor.Centre;
                            d.Origin  = Anchor.BottomCentre;
                            d.Size    = new Vector2(rng.Next(5, 15));
                            d.Colour  = colour;
                            d.Alpha   = RNG.NextSingle(0.25f, 1f);
                            d.Texture = kiai ?? Texture.WhitePixel;
                        }));
                    }
                }

                AddRangeInternal(particles.ToArray());
            }
        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);
            }
        }
Beispiel #21
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string targetImage = GetManiaSkinConfig <string>(skin, LegacyManiaSkinConfigurationLookups.HitTargetImage)?.Value
                                 ?? "mania-stage-hint";

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

            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,
                        Alpha            = showJudgementLine ? 0.9f : 0
                    }
                }
            };

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
Beispiel #22
0
 private void load(ISkinSource skin)
 {
     Children = new Drawable[]
     {
         new Sprite
         {
             Texture = skin.GetTexture("taiko-bar-left")
         },
         new LegacyHalfDrum(false)
         {
             Name             = "Left Half",
             RelativeSizeAxes = Axes.Both,
             Width            = 0.5f,
             RimAction        = TaikoAction.LeftRim,
             CentreAction     = TaikoAction.LeftCentre
         },
         new LegacyHalfDrum(true)
         {
             Name             = "Right Half",
             Anchor           = Anchor.TopRight,
             RelativeSizeAxes = Axes.Both,
             Width            = 0.5f,
             Scale            = new Vector2(-1, 1),
             RimAction        = TaikoAction.RightRim,
             CentreAction     = TaikoAction.RightCentre
         }
     };
 }
Beispiel #23
0
        private void load(ISkinSource skin, IScrollingInfo scrollingInfo)
        {
            string lightImage = GetKaraokeSkinConfig <string>(skin, LegacyKaraokeSkinConfigurationLookups.LightImage)?.Value
                                ?? GetTextureName();

            float leftLineWidth = GetKaraokeSkinConfig <float>(skin, LegacyKaraokeSkinConfigurationLookups.UpLineWidth)
                                  ?.Value ?? 1;
            float rightLineWidth = GetKaraokeSkinConfig <float>(skin, LegacyKaraokeSkinConfigurationLookups.DownLineWidth)
                                   ?.Value ?? 1;

            bool hasLeftLine  = false;
            bool hasRightLine = false;

            float lightPosition = GetKaraokeSkinConfig <float>(skin, LegacyKaraokeSkinConfigurationLookups.LightPosition)?.Value
                                  ?? 0;

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

            direction.BindTo(scrollingInfo.Direction);
            direction.BindValueChanged(onDirectionChanged, true);
        }
Beispiel #24
0
 private void load(ISkinSource source)
 {
     AddInternal(scaleContainer = new Container
     {
         Scale            = new Vector2(SPRITE_SCALE),
         Anchor           = Anchor.TopCentre,
         Origin           = Anchor.Centre,
         RelativeSizeAxes = Axes.Both,
         Y        = SPINNER_Y_CENTRE,
         Children = new Drawable[]
         {
             glow = new Sprite
             {
                 Anchor   = Anchor.Centre,
                 Origin   = Anchor.Centre,
                 Texture  = source.GetTexture("spinner-glow"),
                 Blending = BlendingParameters.Additive,
                 Colour   = glowColour,
             },
             discBottom = new Sprite
             {
                 Anchor  = Anchor.Centre,
                 Origin  = Anchor.Centre,
                 Texture = source.GetTexture("spinner-bottom")
             },
             discTop = new Sprite
             {
                 Anchor  = Anchor.Centre,
                 Origin  = Anchor.Centre,
                 Texture = source.GetTexture("spinner-top")
             },
             fixedMiddle = new Sprite
             {
                 Anchor  = Anchor.Centre,
                 Origin  = Anchor.Centre,
                 Texture = source.GetTexture("spinner-middle")
             },
             spinningMiddle = new Sprite
             {
                 Anchor  = Anchor.Centre,
                 Origin  = Anchor.Centre,
                 Texture = source.GetTexture("spinner-middle2")
             }
         }
     });
 }
Beispiel #25
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);
        }
 private void load(ISkinSource skin)
 {
     InternalChildren = new Drawable[]
     {
         new NonPlayfieldSprite
         {
             Texture = skin.GetTexture("cursormiddle"),
             Anchor  = Anchor.Centre,
             Origin  = Anchor.Centre,
         },
         new NonPlayfieldSprite
         {
             Texture = skin.GetTexture("cursor"),
             Anchor  = Anchor.Centre,
             Origin  = Anchor.Centre,
         }
     };
 }
Beispiel #27
0
        private void load(ISkinSource skin)
        {
            Texture texture;

            if ((texture = skin.GetTexture("paddle")) != null)
            {
                paddle.Texture = texture;
            }
        }
Beispiel #28
0
        private void load(ISkinSource skin, DrawableHitObject drawableObject)
        {
            animationContent.Colour = skin.GetConfig <OsuSkinColour, Color4>(OsuSkinColour.SliderBall)?.Value ?? 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,
                },
            };
        }
        public Texture GetTexture(string componentName)
        {
            Texture sourceTexture;

            if (beatmapSkins && (sourceTexture = source.GetTexture(componentName)) != null)
            {
                return(sourceTexture);
            }
            return(fallbackSource.GetTexture(componentName));
        }
Beispiel #30
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,
                    },
                };
            }