Exemplo n.º 1
0
        public OptionsOverlay()
        {
            var sections = new OptionsSection[]
            {
                new GeneralSection(),
                new GraphicsSection(),
                new GameplaySection(),
                new AudioSection(),
                new SkinSection(),
                new InputSection(),
                new EditorSection(),
                new OnlineSection(),
                new MaintenanceSection(),
            };

            RelativeSizeAxes = Axes.Y;
            AutoSizeAxes     = Axes.X;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black,
                    Alpha            = 0.6f,
                },
                scrollContainer = new ScrollContainer
                {
                    ScrollbarOverlapsContent = false,
                    ScrollDraggerAnchor      = Anchor.TopLeft,
                    RelativeSizeAxes         = Axes.Y,
                    Width  = width,
                    Margin = new MarginPadding {
                        Left = sidebar_width
                    },
                    Children = new[]
                    {
                        new FlowContainer
                        {
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Direction        = FlowDirection.VerticalOnly,

                            Children = new Drawable[]
                            {
                                new SpriteText
                                {
                                    Text     = "settings",
                                    TextSize = 40,
                                    Margin   = new MarginPadding {
                                        Left = CONTENT_MARGINS, Top = 30
                                    },
                                },
                                new SpriteText
                                {
                                    Colour   = new Color4(235, 117, 139, 255),
                                    Text     = "Change the way osu! behaves",
                                    TextSize = 18,
                                    Margin   = new MarginPadding {
                                        Left = CONTENT_MARGINS, Bottom = 30
                                    },
                                },
                                new FlowContainer
                                {
                                    AutoSizeAxes     = Axes.Y,
                                    RelativeSizeAxes = Axes.X,
                                    Direction        = FlowDirection.VerticalOnly,
                                    Children         = sections,
                                }
                            }
                        }
                    }
                },
                sidebar = new OptionsSidebar
                {
                    Width    = sidebar_width,
                    Children = sections.Select(section =>
                                               new OptionsSidebar.SidebarButton
                    {
                        Icon   = section.Icon,
                        Header = section.Header,
                        Action = () => scrollContainer.ScrollIntoView(section),
                    }
                                               )
                }
            };
        }
Exemplo n.º 2
0
        public OptionsOverlay()
        {
            sections = new OptionsSection[]
            {
                new GeneralSection(),
                new GraphicsSection(),
                new GameplaySection(),
                new AudioSection(),
                new SkinSection(),
                new InputSection(),
                new EditorSection(),
                new OnlineSection(),
                new MaintenanceSection(),
            };

            RelativeSizeAxes = Axes.Y;
            AutoSizeAxes     = Axes.X;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black,
                    Alpha            = 0.6f,
                },
                scrollContainer = new ScrollContainer
                {
                    ScrollDraggerVisible = false,
                    RelativeSizeAxes     = Axes.Y,
                    Width  = width,
                    Margin = new MarginPadding {
                        Left = SIDEBAR_WIDTH
                    },
                    Children = new[]
                    {
                        new FlowContainer
                        {
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Direction        = FlowDirection.VerticalOnly,

                            Children = new Drawable[]
                            {
                                new SpriteText
                                {
                                    Text     = "settings",
                                    TextSize = 40,
                                    Margin   = new MarginPadding {
                                        Left = CONTENT_MARGINS, Top = 30
                                    },
                                },
                                new SpriteText
                                {
                                    Colour   = new Color4(255, 102, 170, 255),
                                    Text     = "Change the way osu! behaves",
                                    TextSize = 18,
                                    Margin   = new MarginPadding {
                                        Left = CONTENT_MARGINS, Bottom = 30
                                    },
                                },
                                new FlowContainer
                                {
                                    AutoSizeAxes     = Axes.Y,
                                    RelativeSizeAxes = Axes.X,
                                    Direction        = FlowDirection.VerticalOnly,
                                    Children         = sections,
                                }
                            }
                        }
                    }
                },
                sidebar = new OptionsSidebar
                {
                    Width    = SIDEBAR_WIDTH,
                    Children = sidebarButtons = sections.Select(section =>
                                                                new SidebarButton
                    {
                        Selected = sections[0] == section,
                        Section  = section,
                        Action   = () => scrollContainer.ScrollIntoView(section),
                    }
                                                                ).ToArray()
                }
            };
        }