Esempio n. 1
0
        public BeatmapSetOverlay()
            : base(OverlayColourScheme.Blue)
        {
            Info            info;
            CommentsSection comments;

            Child = new FillFlowContainer
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Direction        = FillDirection.Vertical,
                Spacing          = new Vector2(0, 20),
                Children         = new Drawable[]
                {
                    info = new Info(),
                    new ScoresContainer
                    {
                        Beatmap = { BindTarget = Header.HeaderContent.Picker.Beatmap }
                    },
                    comments = new CommentsSection()
                }
            };

            Header.BeatmapSet.BindTo(beatmapSet);
            info.BeatmapSet.BindTo(beatmapSet);
            comments.BeatmapSet.BindTo(beatmapSet);

            Header.HeaderContent.Picker.Beatmap.ValueChanged += b =>
            {
                info.BeatmapInfo = b.NewValue;
                ScrollFlow.ScrollToStart();
            };
        }
Esempio n. 2
0
 protected void LoadDisplay(Drawable display)
 {
     ScrollFlow.ScrollToStart();
     LoadComponentAsync(display, loaded =>
     {
         content.Child = loaded;
         Loading.Hide();
     }, (cancellationToken = new CancellationTokenSource()).Token);
 }
Esempio n. 3
0
        private void recreatePanels(PanelDisplayStyle displayStyle)
        {
            clearPanels();

            if (Users == null)
            {
                return;
            }

            var newPanels = new FillFlowContainer <SocialPanel>
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(10f),
                Margin           = new MarginPadding {
                    Top = 10
                },
                ChildrenEnumerable = Users.Select(u =>
                {
                    SocialPanel panel;
                    switch (displayStyle)
                    {
                    case PanelDisplayStyle.Grid:
                        panel = new SocialGridPanel(u)
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre
                        };
                        break;

                    default:
                        panel = new SocialListPanel(u);
                        break;
                    }
                    panel.Status.BindTo(u.Status);
                    return(panel);
                })
            };

            LoadComponentAsync(newPanels, f =>
            {
                if (panels != null)
                {
                    ScrollFlow.Remove(panels);
                }

                ScrollFlow.Add(panels = newPanels);
            });
        }
Esempio n. 4
0
        protected override void Update()
        {
            base.Update();

            const int pagination_scroll_distance = 500;

            bool shouldShowMore = panelLoadTask?.IsCompleted != false &&
                                  Time.Current - lastFetchDisplayedTime > time_between_fetches &&
                                  (ScrollFlow.ScrollableExtent > 0 && ScrollFlow.IsScrolledToEnd(pagination_scroll_distance));

            if (shouldShowMore)
            {
                filterControl.FetchNextPage();
            }
        }
Esempio n. 5
0
        private void recreatePanels(PanelDisplayStyle displayStyle)
        {
            if (panels != null)
            {
                panels.FadeOut(200);
                panels.Expire();
                panels = null;
            }

            if (BeatmapSets == null)
            {
                return;
            }

            var newPanels = new FillFlowContainer <DirectPanel>
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(panel_padding),
                Margin           = new MarginPadding {
                    Top = 10
                },
                ChildrenEnumerable = BeatmapSets.Select <BeatmapSetInfo, DirectPanel>(b =>
                {
                    switch (displayStyle)
                    {
                    case PanelDisplayStyle.Grid:
                        return(new DirectGridPanel(b)
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                        });

                    default:
                        return(new DirectListPanel(b));
                    }
                })
            };

            LoadComponentAsync(newPanels, p =>
            {
                if (panels != null)
                {
                    ScrollFlow.Remove(panels);
                }
                ScrollFlow.Add(panels = newPanels);
            });
        }
Esempio n. 6
0
 private void onTypingStarted()
 {
     // temporary until the textbox/header is updated to always stay on screen.
     ScrollFlow.ScrollToStart();
 }
Esempio n. 7
0
        private void recreatePanels(PanelDisplayStyle displayStyle)
        {
            if (panels != null)
            {
                panels.FadeOut(200);
                panels.Expire();
                panels = null;

                if (playing != null)
                {
                    playing.PreviewPlaying.Value = false;
                    playing = null;
                }
            }

            if (BeatmapSets == null)
            {
                return;
            }

            var newPanels = new FillFlowContainer <DirectPanel>
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Spacing          = new Vector2(panel_padding),
                Margin           = new MarginPadding {
                    Top = 10
                },
                ChildrenEnumerable = BeatmapSets.Select <BeatmapSetInfo, DirectPanel>(b =>
                {
                    switch (displayStyle)
                    {
                    case PanelDisplayStyle.Grid:
                        return(new DirectGridPanel(b)
                        {
                            Width = 400
                        });

                    default:
                        return(new DirectListPanel(b));
                    }
                })
            };

            LoadComponentAsync(newPanels, p =>
            {
                if (panels != null)
                {
                    ScrollFlow.Remove(panels);
                }
                ScrollFlow.Add(panels = newPanels);

                foreach (DirectPanel panel in p.Children)
                {
                    panel.PreviewPlaying.ValueChanged += newValue =>
                    {
                        if (newValue)
                        {
                            if (playing != null && playing != panel)
                            {
                                playing.PreviewPlaying.Value = false;
                            }
                            playing = panel;
                        }
                    }
                }
                ;
            });
        }