Beispiel #1
0
        private void load(OsuGame osuGame, Bindable <RulesetInfo> parentRuleset)
        {
            Children = new Drawable[]
            {
                new ToolbarBackground(),
                new FillFlowContainer
                {
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarSettingsButton(),
                        new ToolbarHomeButton
                        {
                            Action = () => OnHome?.Invoke()
                        },
                        rulesetSelector = new ToolbarRulesetSelector()
                    }
                },
                new FillFlowContainer
                {
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarChangelogButton(),
                        new ToolbarDirectButton(),
                        new ToolbarChatButton(),
                        new ToolbarSocialButton(),
                        new ToolbarMusicButton(),
                        //new ToolbarButton
                        //{
                        //    Icon = FontAwesome.Solid.search
                        //},
                        userButton = new ToolbarUserButton(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

            // Bound after the selector is added to the hierarchy to give it a chance to load the available rulesets
            rulesetSelector.Current.BindTo(parentRuleset);

            State.ValueChanged += visibility =>
            {
                if (overlayActivationMode.Value == OverlayActivation.Disabled)
                {
                    Hide();
                }
            };

            if (osuGame != null)
            {
                overlayActivationMode.BindTo(osuGame.OverlayActivationMode);
            }
        }
Beispiel #2
0
        private void load(OsuGame osuGame)
        {
            Children = new Drawable[]
            {
                new ToolbarBackground(),
                new FillFlowContainer
                {
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarSettingsButton(),
                        new ToolbarHomeButton
                        {
                            Action = () => OnHome?.Invoke()
                        },
                        new ToolbarRulesetSelector()
                    }
                },
                new FillFlowContainer
                {
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarChangelogButton(),
                        new ToolbarDirectButton(),
                        new ToolbarChatButton(),
                        new ToolbarSocialButton(),
                        new ToolbarMusicButton(),
                        //new ToolbarButton
                        //{
                        //    Icon = FontAwesome.Solid.search
                        //},
                        userButton = new ToolbarUserButton(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

            StateChanged += visibility =>
            {
                if (overlayActivationMode.Value == OverlayActivation.Disabled)
                {
                    State = Visibility.Hidden;
                }
            };

            if (osuGame != null)
            {
                overlayActivationMode.BindTo(osuGame.OverlayActivationMode);
            }
        }
Beispiel #3
0
        private void load(OsuGame osuGame)
        {
            Children = new Drawable[]
            {
                new ToolbarBackground(),
                new FillFlowContainer
                {
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarSettingsButton(),
                        new ToolbarHomeButton
                        {
                            Action = () => OnHome?.Invoke()
                        },
                        rulesetSelector = new ToolbarRulesetSelector()
                    }
                },
                new FillFlowContainer
                {
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Direction        = FillDirection.Horizontal,
                    RelativeSizeAxes = Axes.Y,
                    AutoSizeAxes     = Axes.X,
                    Children         = new Drawable[]
                    {
                        new ToolbarNewsButton(),
                        new ToolbarChangelogButton(),
                        new ToolbarRankingsButton(),
                        new ToolbarBeatmapListingButton(),
                        new ToolbarChatButton(),
                        new ToolbarSocialButton(),
                        new ToolbarWikiButton(),
                        new ToolbarMusicButton(),
                        //new ToolbarButton
                        //{
                        //    Icon = FontAwesome.Solid.search
                        //},
                        userButton = new ToolbarUserButton(),
                        new ToolbarClock(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

            if (osuGame != null)
            {
                OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
            }
        }
Beispiel #4
0
        private void load(OsuGame osuGame)
        {
            Children = new Drawable[]
            {
                new ToolbarBackground(),
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ColumnDimensions = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(),
                        new Dimension(GridSizeMode.AutoSize)
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                Name             = "Left buttons",
                                RelativeSizeAxes = Axes.Y,
                                AutoSizeAxes     = Axes.X,
                                Depth            = float.MinValue,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        Colour           = OsuColour.Gray(0.1f),
                                        RelativeSizeAxes = Axes.Both,
                                    },
                                    new FillFlowContainer
                                    {
                                        Direction        = FillDirection.Horizontal,
                                        RelativeSizeAxes = Axes.Y,
                                        AutoSizeAxes     = Axes.X,
                                        Children         = new Drawable[]
                                        {
                                            new ToolbarSettingsButton(),
                                            new ToolbarHomeButton
                                            {
                                                Action = () => OnHome?.Invoke()
                                            },
                                        },
                                    },
                                }
                            },
                            new Container
                            {
                                Name             = "Ruleset selector",
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new OsuScrollContainer(Direction.Horizontal)
                                    {
                                        ScrollbarVisible = false,
                                        RelativeSizeAxes = Axes.Both,
                                        Masking          = false,
                                        Children         = new Drawable[]
                                        {
                                            rulesetSelector = new ToolbarRulesetSelector()
                                        }
                                    },
                                    new Box
                                    {
                                        Colour           = ColourInfo.GradientHorizontal(OsuColour.Gray(0.1f).Opacity(0), OsuColour.Gray(0.1f)),
                                        Width            = 50,
                                        RelativeSizeAxes = Axes.Y,
                                        Anchor           = Anchor.TopRight,
                                        Origin           = Anchor.TopRight,
                                    },
                                }
                            },
                            new Container
                            {
                                Name             = "Right buttons",
                                RelativeSizeAxes = Axes.Y,
                                AutoSizeAxes     = Axes.X,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        Colour           = OsuColour.Gray(0.1f),
                                        RelativeSizeAxes = Axes.Both,
                                    },
                                    new FillFlowContainer
                                    {
                                        Anchor           = Anchor.TopRight,
                                        Origin           = Anchor.TopRight,
                                        Direction        = FillDirection.Horizontal,
                                        RelativeSizeAxes = Axes.Y,
                                        AutoSizeAxes     = Axes.X,
                                        Children         = new Drawable[]
                                        {
                                            new ToolbarNewsButton(),
                                            new ToolbarChangelogButton(),
                                            new ToolbarRankingsButton(),
                                            new ToolbarBeatmapListingButton(),
                                            new ToolbarChatButton(),
                                            new ToolbarSocialButton(),
                                            new ToolbarWikiButton(),
                                            new ToolbarMusicButton(),
                                            //new ToolbarButton
                                            //{
                                            //    Icon = FontAwesome.Solid.search
                                            //},
                                            userButton = new ToolbarUserButton(),
                                            new ToolbarClock(),
                                            new ToolbarNotificationButton(),
                                        }
                                    },
                                }
                            },
                        },
                    }
                }
            };

            if (osuGame != null)
            {
                OverlayActivationMode.BindTo(osuGame.OverlayActivationMode);
            }
        }