Esempio n. 1
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 ToolbarDirectButton(),
                        new ToolbarChatButton(),
                        new ToolbarSocialButton(),
                        new ToolbarMusicButton(),
                        //new ToolbarButton
                        //{
                        //    Icon = FontAwesome.fa_search
                        //},
                        userArea = new ToolbarUserArea(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

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

            if (osuGame != null)
            {
                overlayActivationMode.BindTo(osuGame.OverlayActivationMode);
            }
        }
Esempio n. 2
0
File: Toolbar.cs Progetto: ekisu/osu
        public Toolbar()
        {
            AlwaysReceiveInput = true;

            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()
                        },
                        modeSelector = new ToolbarModeSelector
                        {
                            OnPlayModeChange = mode =>
                            {
                                OnPlayModeChange?.Invoke(mode);
                            }
                        }
                    }
                },
                new FillFlowContainer
                {
                    AlwaysReceiveInput = true,
                    Anchor             = Anchor.TopRight,
                    Origin             = Anchor.TopRight,
                    Direction          = FillDirection.Horizontal,
                    RelativeSizeAxes   = Axes.Y,
                    AutoSizeAxes       = Axes.X,
                    Children           = new Drawable[]
                    {
                        new ToolbarMusicButton(),
                        new ToolbarButton
                        {
                            Icon = FontAwesome.fa_search
                        },
                        userArea = new ToolbarUserArea(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

            RelativeSizeAxes = Axes.X;
            Size             = new Vector2(1, HEIGHT);
        }
Esempio n. 3
0
        public Toolbar()
        {
            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 ToolbarDirectButton(),
                        new ToolbarChatButton(),
                        new ToolbarSocialButton(),
                        new ToolbarMusicButton(),
                        //new ToolbarButton
                        //{
                        //    Icon = FontAwesome.fa_search
                        //},
                        userArea = new ToolbarUserArea(),
                        new ToolbarNotificationButton(),
                    }
                }
            };

            RelativeSizeAxes = Axes.X;
            Size             = new Vector2(1, HEIGHT);
        }