Ejemplo n.º 1
0
        private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;
            Direction        = FillDirection.Vertical;
            Padding          = new MarginPadding {
                Top = 20, Bottom = 30
            };

            var modes = new List <Drawable>();

            foreach (var ruleset in rulesets.AvailableRulesets)
            {
                var icon = new ConstrainedIconContainer
                {
                    Icon   = ruleset.CreateInstance().CreateIcon(),
                    Colour = Color4.Gray,
                    Size   = new Vector2(20),
                };

                modes.Add(icon);
            }

            Children = new Drawable[]
            {
                new FillFlowContainer
                {
                    Anchor       = Anchor.TopCentre,
                    Origin       = Anchor.TopCentre,
                    Direction    = FillDirection.Full,
                    AutoSizeAxes = Axes.Both,
                    Children     = modes,
                    Spacing      = new Vector2(5),
                    Padding      = new MarginPadding {
                        Bottom = 10
                    },
                },
                new OsuSpriteText
                {
                    Anchor   = Anchor.TopCentre,
                    Origin   = Anchor.TopCentre,
                    Text     = game.Name,
                    TextSize = 18,
                    Font     = @"Exo2.0-Bold",
                },
                new OsuSpriteText
                {
                    Anchor   = Anchor.TopCentre,
                    Origin   = Anchor.TopCentre,
                    TextSize = 14,
                    Text     = game.Version,
                    Colour   = DebugUtils.IsDebug ? colours.Red : Color4.White,
                },
            };
        }
Ejemplo n.º 2
0
        private void load(OsuGameBase game, OsuColour colours, RulesetStore rulesets)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;
            Direction        = FillDirection.Vertical;
            Padding          = new MarginPadding {
                Top = 20, Bottom = 30, Horizontal = SettingsPanel.CONTENT_MARGINS
            };

            var modes = new List <Drawable>();

            foreach (var ruleset in rulesets.AvailableRulesets)
            {
                var icon = new ConstrainedIconContainer
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Icon   = ruleset.CreateInstance().CreateIcon(),
                    Colour = Colour4.Gray,
                    Size   = new Vector2(20),
                };

                modes.Add(icon);
            }

            Children = new Drawable[]
            {
                new FillFlowContainer
                {
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    Direction        = FillDirection.Full,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Children         = modes,
                    Spacing          = new Vector2(5),
                    Padding          = new MarginPadding {
                        Bottom = 10
                    },
                },
                new OsuSpriteText
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Text   = game.Name,
                    Font   = OsuFont.GetFont(size: 18, weight: FontWeight.Bold),
                },
                new BuildDisplay(game.Version, DebugUtils.IsDebugBuild)
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                }
            };
        }
            public DirectRulesetTabItem(RulesetInfo value)
                : base(value)
            {
                AutoSizeAxes = Axes.Both;

                Children = new Drawable[]
                {
                    iconContainer = new ConstrainedIconContainer
                    {
                        Icon = value.CreateInstance().CreateIcon(),
                        Size = new Vector2(32),
                    },
                    new HoverClickSounds()
                };
            }
Ejemplo n.º 4
0
 public TestCaseRulesetIcon()
 {
     Child = new ConstrainedIconContainer
     {
         Anchor     = Anchor.Centre,
         Origin     = Anchor.Centre,
         Icon       = new KaraokeRuleset().CreateIcon(),
         EdgeEffect = new EdgeEffectParameters
         {
             Type      = EdgeEffectType.Glow,
             Colour    = new Color4(255, 194, 224, 100),
             Radius    = 15,
             Roundness = 15,
         },
         Size = new Vector2(40)
     };
 }
Ejemplo n.º 5
0
            public RulesetToggleButton(Bindable <RulesetInfo> bindable, RulesetInfo ruleset)
            {
                this.bindable = bindable;
                AutoSizeAxes  = Axes.Both;

                Children = new[]
                {
                    iconContainer = new ConstrainedIconContainer
                    {
                        Origin = Anchor.TopLeft,
                        Anchor = Anchor.TopLeft,
                        Size   = new Vector2(32),
                    }
                };

                Ruleset = ruleset;
                bindable.ValueChanged += Bindable_ValueChanged;
                Bindable_ValueChanged(bindable.Value);
                Action = () => bindable.Value = Ruleset;
            }
Ejemplo n.º 6
0
                private void load(RulesetStore rulesets)
                {
                    var modes = new List <Drawable>();

                    foreach (var ruleset in rulesets.AvailableRulesets)
                    {
                        var icon = new ConstrainedIconContainer
                        {
                            Icon = ruleset.CreateInstance().CreateIcon(),
                            Size = new Vector2(30),
                        };

                        modes.Add(icon);
                    }

                    AutoSizeAxes = Axes.Both;
                    Children     = modes;

                    Anchor = Anchor.Centre;
                    Origin = Anchor.Centre;
                }