예제 #1
0
        public JumpTo()
            : base(LocalisationManager.GetString(OsuString.JumpToDialog_Title), true)
        {
            spriteManager.Add(new pBox(new Vector2(PADDING, 79), new Vector2(GameBase.WindowManager.WidthScaled - (PADDING * 2), 1), 1, Color.White));
            spriteManager.Add(new pBox(new Vector2(PADDING, 440), new Vector2(GameBase.WindowManager.WidthScaled - (PADDING * 2), 1), 1, Color.White));
            Rectangle scrollableArea = new Rectangle(PADDING, 80, (int)(640 * GameBase.WindowManager.WidthWidescreenRatio) - (PADDING * 2), 360);

            scrollableView = new pScrollableArea(scrollableArea, Vector2.Zero, true, 0, defaultTargetType);
            mapManager     = new SpriteManager(true);
            topLayer       = new SpriteManager(true);
            mapManager.SetWidescreen(GameBase.WindowManager.IsWidescreen);
            collectionLabel = new pText(LocalisationManager.GetString(OsuString.SongSelection_Collections) + ":", 20, new Vector2(PADDING, 30), 2, true, new Color(254, 220, 97));
            collections     = new pDropdown(topLayer, "All", new Vector2(PADDING, 55), 140, 3);
            searchBox       = new pSearchBox(20, new Vector2(PADDING, 50), 20, Graphics.Renderers.TextAlignment.Right);
            searchTime      = -1;
            spriteManager.Add(searchBox.SpriteCollection);
            spriteManager.Add(collectionLabel);
            scrollableView.AddChild(mapManager);

            searchBox.OnChange += delegate(pTextBox sender, bool newText)
            {
                if (!newText)
                {
                    return;
                }

                if (searchBox.IsDefault && searchBox.textBeforeCommit.Length == 1)
                {
                    searchTime = GameBase.Time;
                }
                else if (!searchBox.IsDefault)
                {
                    searchTime = GameBase.Time + 300;
                }
            };

            Closed += delegate
            {
                MusicControl.ClearPool();
            };

            collections.AddOption("All", "All");
            collections.SetSelected("All", true);

            foreach (string c in CollectionManager.Collections.Keys)
            {
                collections.AddOption(c, c);
            }

            collections.OnSelect += collections_OnSelect;

            SelectedMap = BeatmapManager.Current;

            layout();
        }
예제 #2
0
        protected virtual void PopupRecord()
        {
            if (rankingDialog == null || rankingDialog.IsDisplayed)
            {
                return;
            }

            rankingDialog.Display();
            rankingDialog.DisplayAfter();

            rankingDialog.spriteManager.BaseOffset = new Vector2(0, GameBase.WindowManager.HeightScaled);
            scrollableArea.AddChild(rankingDialog.spriteManager);
        }
예제 #3
0
        private void DoLayout()
        {
            int i = 0;

            foreach (Chart c in charts)
            {
                if (c.Visible)
                {
                    c.spriteManager.ViewOffset.Y = -i * (Chart.HEIGHT + 10);
                    i++;
                }

                if (!sa_chartList.Children.Contains(c.spriteManager))
                {
                    sa_chartList.AddChild(c.spriteManager);
                }
            }

            sa_chartList.SetContentDimensions(new Vector2(0, (Chart.HEIGHT + 10) * i));
        }