Example #1
0
        public new void Setup() => Schedule(() =>
        {
            SelectedRoom.Value = new Room {
                RoomID = { Value = 3 }
            };

            Child = new MatchLeaderboard
            {
                Origin = Anchor.Centre,
                Anchor = Anchor.Centre,
                Size   = new Vector2(550f, 450f),
                Scope  = MatchLeaderboardScope.Overall,
            };
        });
Example #2
0
        public MatchSubScreen(Room room, Action <Screen> pushGameplayScreen)
        {
            this.room = room;
            this.pushGameplayScreen = pushGameplayScreen;

            bindings.Room = room;

            MatchChatDisplay chat;

            Components.Header header;
            Info                 info;
            GridContainer        bottomRow;
            MatchSettingsOverlay settings;

            Children = new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Content          = new[]
                    {
                        new Drawable[] { header = new Components.Header(room)
                                         {
                                             Depth = -1
                                         } },
                        new Drawable[] { info = new Info(room)
                                         {
                                             OnStart = onStart
                                         } },
                        new Drawable[]
                        {
                            bottomRow = new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                Content          = new[]
                                {
                                    new Drawable[]
                                    {
                                        leaderboard = new MatchLeaderboard
                                        {
                                            Padding          = new MarginPadding(10),
                                            RelativeSizeAxes = Axes.Both,
                                            Room             = room
                                        },
                                        new Container
                                        {
                                            Padding          = new MarginPadding(10),
                                            RelativeSizeAxes = Axes.Both,
                                            Child            = chat = new MatchChatDisplay(room)
                                            {
                                                RelativeSizeAxes = Axes.Both
                                            }
                                        },
                                    },
                                },
                            }
                        },
                    },
                    RowDimensions = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.Distributed),
                    }
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = Components.Header.HEIGHT
                    },
                    Child = settings = new MatchSettingsOverlay(room)
                    {
                        RelativeSizeAxes = Axes.Both
                    },
                },
            };

            header.OnRequestSelectBeatmap = () => Push(new MatchSongSelect {
                Selected = addPlaylistItem
            });
            header.Tabs.Current.ValueChanged += t =>
            {
                const float fade_duration = 500;
                if (t is SettingsMatchPage)
                {
                    settings.Show();
                    info.FadeOut(fade_duration, Easing.OutQuint);
                    bottomRow.FadeOut(fade_duration, Easing.OutQuint);
                }
                else
                {
                    settings.Hide();
                    info.FadeIn(fade_duration, Easing.OutQuint);
                    bottomRow.FadeIn(fade_duration, Easing.OutQuint);
                }
            };

            chat.Exit += Exit;
        }
Example #3
0
        private void load()
        {
            Components.Header header;
            Info                 info;
            GridContainer        bottomRow;
            MatchSettingsOverlay settings;

            InternalChildren = new Drawable[]
            {
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Content          = new[]
                    {
                        new Drawable[]
                        {
                            header = new Components.Header
                            {
                                Depth = -1,
                                RequestBeatmapSelection = () =>
                                {
                                    this.Push(new MatchSongSelect
                                    {
                                        Selected = item =>
                                        {
                                            Playlist.Clear();
                                            Playlist.Add(item);
                                        }
                                    });
                                }
                            }
                        },
                        new Drawable[] { info = new Info {
                                             OnStart = onStart
                                         } },
                        new Drawable[]
                        {
                            bottomRow = new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                Content          = new[]
                                {
                                    new Drawable[]
                                    {
                                        leaderboard = new MatchLeaderboard
                                        {
                                            Padding = new MarginPadding
                                            {
                                                Left     = 10 + HORIZONTAL_OVERFLOW_PADDING,
                                                Right    = 10,
                                                Vertical = 10,
                                            },
                                            RelativeSizeAxes = Axes.Both
                                        },
                                        new Container
                                        {
                                            Padding = new MarginPadding
                                            {
                                                Left     = 10,
                                                Right    = 10 + HORIZONTAL_OVERFLOW_PADDING,
                                                Vertical = 10,
                                            },
                                            RelativeSizeAxes = Axes.Both,
                                            Child            = new MatchChatDisplay
                                            {
                                                RelativeSizeAxes = Axes.Both
                                            }
                                        },
                                    },
                                },
                            }
                        },
                    },
                    RowDimensions = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.Distributed),
                    }
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = Components.Header.HEIGHT
                    },
                    Child = settings = new MatchSettingsOverlay {
                        RelativeSizeAxes = Axes.Both
                    },
                },
            };

            header.Tabs.Current.BindValueChanged(tab =>
            {
                const float fade_duration = 500;

                var settingsDisplayed = tab.NewValue is SettingsMatchPage;

                header.ShowBeatmapPanel.Value = !settingsDisplayed;
                settings.State.Value          = settingsDisplayed ? Visibility.Visible : Visibility.Hidden;
                info.FadeTo(settingsDisplayed ? 0 : 1, fade_duration, Easing.OutQuint);
                bottomRow.FadeTo(settingsDisplayed ? 0 : 1, fade_duration, Easing.OutQuint);
            }, true);

            beatmapManager.ItemAdded += beatmapAdded;
        }
Example #4
0
            private void load()
            {
                MatchChatDisplay chat;

                Components.Header header;
                Info                 info;
                GridContainer        bottomRow;
                MatchSettingsOverlay settings;

                InternalChildren = new Drawable[]
                {
                    new GridContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Content          = new[]
                        {
                            new Drawable[]
                            {
                                header = new Components.Header
                                {
                                    Depth = -1,
                                    RequestBeatmapSelection = () => RequestBeatmapSelection?.Invoke()
                                }
                            },
                            new Drawable[] { info = new Info {
                                                 OnStart = onStart
                                             } },
                            new Drawable[]
                            {
                                bottomRow = new GridContainer
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Content          = new[]
                                    {
                                        new Drawable[]
                                        {
                                            leaderboard = new MatchLeaderboard
                                            {
                                                Padding = new MarginPadding
                                                {
                                                    Left     = 10 + OsuScreen.HORIZONTAL_OVERFLOW_PADDING,
                                                    Right    = 10,
                                                    Vertical = 10,
                                                },
                                                RelativeSizeAxes = Axes.Both
                                            },
                                            new Container
                                            {
                                                Padding = new MarginPadding
                                                {
                                                    Left     = 10,
                                                    Right    = 10 + OsuScreen.HORIZONTAL_OVERFLOW_PADDING,
                                                    Vertical = 10,
                                                },
                                                RelativeSizeAxes = Axes.Both,
                                                Child            = chat = new MatchChatDisplay
                                                {
                                                    RelativeSizeAxes = Axes.Both
                                                }
                                            },
                                        },
                                    },
                                }
                            },
                        },
                        RowDimensions = new[]
                        {
                            new Dimension(GridSizeMode.AutoSize),
                            new Dimension(GridSizeMode.AutoSize),
                            new Dimension(GridSizeMode.Distributed),
                        }
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = Components.Header.HEIGHT
                        },
                        Child = settings = new MatchSettingsOverlay {
                            RelativeSizeAxes = Axes.Both
                        },
                    },
                };

                header.Tabs.Current.BindValueChanged(t =>
                {
                    const float fade_duration = 500;
                    if (t is SettingsMatchPage)
                    {
                        settings.Show();
                        info.FadeOut(fade_duration, Easing.OutQuint);
                        bottomRow.FadeOut(fade_duration, Easing.OutQuint);
                    }
                    else
                    {
                        settings.Hide();
                        info.FadeIn(fade_duration, Easing.OutQuint);
                        bottomRow.FadeIn(fade_duration, Easing.OutQuint);
                    }
                }, true);

                chat.Exit += () => RequestExit?.Invoke();

                beatmapManager.ItemAdded += beatmapAdded;
            }