/// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="availableItems"></param>
        /// <param name="poolSize"></param>
        /// <param name="poolStartingIndex"></param>
        /// <param name="size"></param>
        /// <param name="contentSize"></param>
        /// <param name="startFromBottom"></param>
        public LobbyMatchScrollContainer(LobbyScreen screen, List <MultiplayerGame> availableItems, int poolSize,
                                         int poolStartingIndex, ScalableVector2 size, ScalableVector2 contentSize, bool startFromBottom = false)
            : base(availableItems, poolSize, poolStartingIndex, size, contentSize, startFromBottom)
        {
            Screen = screen;
            Tint   = Color.Black;
            Alpha  = 0.75f;

            Scrollbar.Tint       = ColorHelper.HexToColor("#eeeeee");
            Scrollbar.Width      = 6;
            Scrollbar.X          = 14;
            ScrollSpeed          = 150;
            EasingType           = Easing.OutQuint;
            TimeToCompleteScroll = 1500;

            NoMatchesFound = new SpriteTextBitmap(FontsBitmap.GothamRegular, "No Matches Found. What are you waiting for? Create one!")
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                FontSize  = 16,
                Visible   = false
            };

            AddBorder(Color.White, 2);
            Border.Alpha = 1f;

            CreatePool();
        }
Esempio n. 2
0
        /// <summary>
        ///     Creates the text that displays the name of the player
        /// </summary>
        private void CreatePlayerName()
        {
            var text = OnlineManager.CurrentGame != null ? "Match Played on" : $"Played By: {Screen.Replay.PlayerName} on";

            switch (Screen.ResultsType)
            {
            case ResultScreenType.Gameplay:
                var now  = DateTime.Now;
                var time = string.Format("{0:hh:mm:ss tt}", now);
                text += $" {now.ToShortDateString()} @ {time}";
                break;

            case ResultScreenType.Score:
            case ResultScreenType.Replay:
                var replayTime = string.Format("{0:hh:mm:ss tt}", Screen.Replay.Date);
                text += $" {Screen.Replay.Date.ToShortDateString()} @ {replayTime}";
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            PlayedBy = new SpriteTextBitmap(FontsBitmap.GothamRegular, text)
            {
                Parent   = this,
                X        = SongTitle.X,
                Y        = MapCreator.Y + MapCreator.Height + 10,
                FontSize = 17
            };

            PlayedBy.Visible = true;
        }
Esempio n. 3
0
 /// <summary>
 ///     Creates the text that displays that there are no scores available.
 /// </summary>
 private void CreateNoScoresAvailableText() => NoScoresAvailableText = new SpriteTextBitmap(FontsBitmap.GothamBold, " ")
 {
     Parent    = this,
     Alignment = Alignment.MidCenter,
     Visible   = false,
     FontSize  = 16
 };
Esempio n. 4
0
 /// <summary>
 /// </summary>
 private void CreateHitsoundName() => HitsoundName = new SpriteTextBitmap(FontsBitmap.AllerRegular, Name)
 {
     Parent    = this,
     FontSize  = 16,
     Alignment = Alignment.MidLeft,
     X         = SpriteIcon.X + SpriteIcon.Width + 10,
 };
        public MultiplayerGameHeader()
            : base(new ScalableVector2(650, 36), new ScalableVector2(650, 36))
        {
            Alpha = 0;

            PausePlayButton = new PausePlayButton
            {
                Parent    = this,
                Alignment = Alignment.TopRight,
                Size      = new ScalableVector2(20, 20)
            };

            RoomName = new SpriteTextBitmap(FontsBitmap.GothamRegular, OnlineManager.CurrentGame.Name)
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                FontSize  = 16,
                Tint      = Colors.SecondaryAccent
            };

            AddContainedDrawable(RoomName);

            // ReSharper disable once ObjectCreationAsStatement
            new Sprite
            {
                Parent    = this,
                Alignment = Alignment.BotLeft,
                Size      = new ScalableVector2(Width, 2),
                Y         = -6,
                Alpha     = 0.85f
            };

            OnlineManager.Client.OnGameNameChanged += OnGameNameChanged;
        }
Esempio n. 6
0
        /// <summary>
        ///     Creates the text that lets the user know the score is submitting.
        /// </summary>
        private void CreateSubmittingText()
        {
            // Scores aren't submitted if the user has all misses
            if (Screen.ScoreProcessor.TotalJudgementCount == Screen.ScoreProcessor.CurrentJudgements[Judgement.Miss])
            {
                return;
            }

            TextSubmittingScore = new SpriteTextBitmap(FontsBitmap.GothamRegular, "SUBMITTING SCORE")
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                FontSize  = 18
            };

            SubmittingLoadingWheel = new Sprite()
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                Size      = new ScalableVector2(TextSubmittingScore.Height, TextSubmittingScore.Height),
                Image     = UserInterface.LoadingWheel,
                X         = TextSubmittingScore.Width / 2f + 20
            };

            AddContainedDrawable(TextSubmittingScore);
            AddContainedDrawable(SubmittingLoadingWheel);
        }
Esempio n. 7
0
        public MultiplayerEndGameWaitTime()
        {
            Image            = UserInterface.WaitingPanel;
            Size             = new ScalableVector2(450, 134);
            Alpha            = 0;
            SetChildrenAlpha = true;

            Icon = new Sprite
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Image     = FontAwesome.Get(FontAwesomeIcon.fa_information_button),
                Y         = 18,
                Size      = new ScalableVector2(24, 24)
            };

            // ReSharper disable once ObjectCreationAsStatement
            var text = new SpriteTextBitmap(FontsBitmap.AllerRegular, "Waiting for other players to finish!")
            {
                Parent    = this,
                FontSize  = 20,
                Y         = Icon.Y + Icon.Height + 10,
                Alignment = Alignment.TopCenter
            };

            LoadingWheel = new Sprite()
            {
                Parent    = this,
                Size      = new ScalableVector2(40, 40),
                Image     = UserInterface.LoadingWheel,
                Alignment = Alignment.TopCenter,
                Y         = text.Y + text.Height + 10
            };
        }
 /// <summary>
 ///     Creates the heading text that says "search"
 /// </summary>
 private void CreateTextSearch() => TextSearch = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Search:")
 {
     Parent   = this,
     X        = 15,
     Y        = 15,
     FontSize = 16
 };
Esempio n. 9
0
 /// <summary>
 /// </summary>
 private void CreateNoMatchSelectedText() => NoMatchSelected = new SpriteTextBitmap(FontsBitmap.GothamRegular,
                                                                                    "No Match Selected!")
 {
     Parent    = ContentContainer,
     Alignment = Alignment.MidCenter,
     FontSize  = 16
 };
Esempio n. 10
0
        /// <summary>
        /// </summary>
        public PlayerListHeader(MultiplayerGame game)
        {
            Game  = game;
            Size  = new ScalableVector2(590, 36);
            Tint  = Color.Black;
            Alpha = 0f;

            Count = new SpriteTextBitmap(FontsBitmap.GothamRegular, "(0/16) Players")
            {
                Parent    = this,
                Alignment = Alignment.TopRight,
                FontSize  = 16,
            };

            Status = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Waiting to start")
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                FontSize  = 16,
            };

            // ReSharper disable once ObjectCreationAsStatement
            new Sprite
            {
                Parent    = this,
                Alignment = Alignment.TopCenter,
                Size      = new ScalableVector2(Width, 2),
                Y         = Status.Y + Status.Height + 12,
                Alpha     = 0.85f
            };
        }
Esempio n. 11
0
 /// <summary>
 /// </summary>
 private void CreateTextMapsetsFound() => TextMapsetsFound = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Searching...")
 {
     Parent   = this,
     X        = TextSearch.X,
     Y        = SearchBox.Y + SearchBox.Height + 8,
     FontSize = 16
 };
        /// <summary>
        /// </summary>
        /// <param name="width"></param>
        public ResultMultiplayerScoreboardTableHeader(int width)
        {
            Size  = new ScalableVector2(width, 46);
            Tint  = Color.Black;
            Alpha = 0.45f;
            Y     = 2;
            X     = 2;

            Ruleset = new SpriteTextBitmap(FontsBitmap.GothamRegular,
                                           OnlineManager.CurrentGame.Ruleset.ToString().Replace("_", " "))
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                X         = 20,
                FontSize  = 16,
                Tint      = Colors.MainAccent,
            };

            CreateHeaders();

            // ReSharper disable once ObjectCreationAsStatement
            new Sprite
            {
                Parent    = this,
                Alignment = Alignment.BotLeft,
                Size      = new ScalableVector2(Width, 1),
                Alpha     = 0.6f
            };
        }
Esempio n. 13
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public DrawableMapset(MapsetScrollContainer container)
        {
            Container = container;
            Size      = new ScalableVector2(410, HEIGHT);
            Image     = UserInterface.SelectButtonBackground;

            Title = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                Position  = new ScalableVector2(15, 12),
                FontSize  = 18
            };

            Artist = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent    = this,
                Alignment = Alignment.TopLeft,
                Position  = new ScalableVector2(Title.X, Title.Y + Title.Height + 3),
                FontSize  = 16
            };

            Creator = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent    = this,
                Alignment = Alignment.TopRight,
                Position  = new ScalableVector2(-10, Artist.Y + Artist.Height + 6),
                FontSize  = 14
            };

            Clicked += OnClicked;
        }
Esempio n. 14
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="text"></param>
        /// <param name="selected"></param>
        /// <param name="action"></param>
        public LeaderboardSelectorItem(string text, bool selected = false, EventHandler action = null)
        {
            Selected = selected;
            Size     = new ScalableVector2(145, 40);
            Tint     = Color.Black;
            Alpha    = Selected ? 0.25f: 0;

            ItemText = new SpriteTextBitmap(FontsBitmap.GothamRegular, text)
            {
                Parent    = this,
                Alignment = Alignment.MidCenter,
                FontSize  = 18
            };

            BottomLine = new Sprite()
            {
                Parent    = this,
                Alignment = Alignment.BotCenter,
                Size      = new ScalableVector2(Selected ? Width : 0, 3)
            };

            if (action != null)
            {
                Clicked += action;
            }
        }
Esempio n. 15
0
        public SpectatorCount()
        {
            SetChildrenVisibility = true;

            Eye = new Sprite
            {
                Parent = this,
                Size   = new ScalableVector2(20, 20),
                Image  = FontAwesome.Get(FontAwesomeIcon.fa_eye_open),
                SetChildrenVisibility = true
            };

            SpectatorsText = new SpriteTextBitmap(FontsBitmap.GothamRegular,
                                                  $" ")
            {
                Parent    = Eye,
                Alignment = Alignment.MidLeft,
                FontSize  = 14,
                X         = Eye.X + Eye.Width + 10
            };

            UpdateSpectatorText();

            Size = new ScalableVector2(Eye.X + Eye.Width + 10 + SpectatorsText.Width, SpectatorsText.Height);

            OnlineManager.Client.OnSpectatorJoined += OnSpectatorJoined;
            OnlineManager.Client.OnSpectatorLeft   += OnSpectatorLeft;
        }
Esempio n. 16
0
 /// <summary>
 /// </summary>
 private void CreateTextKey(string key) => TextKey = new SpriteTextBitmap(FontsBitmap.GothamRegular, key)
 {
     Parent    = this,
     Alignment = Type == ResultKeyValueItemType.Vertical ? Alignment.TopCenter : Alignment.TopLeft,
     Tint      = Colors.SecondaryAccent,
     FontSize  = 15
 };
Esempio n. 17
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        public DrawableDifficulty(DifficultyScrollContainer container)
        {
            Container = container;

            Size  = new ScalableVector2(410, HEIGHT);
            Image = UserInterface.SelectButtonBackground;

            DifficultyName = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent   = this,
                Position = new ScalableVector2(15, 12),
                FontSize = 18
            };

            TextDifficultyRating = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent   = this,
                Position = new ScalableVector2(DifficultyName.X, DifficultyName.Y + DifficultyName.Height + 4),
                Tint     = ColorHelper.DifficultyToColor(19.12f),
                FontSize = 16
            };

            Creator = new SpriteTextBitmap(FontsBitmap.GothamRegular, " ")
            {
                Parent    = this,
                Alignment = Alignment.TopRight,
                Position  = new ScalableVector2(-5, TextDifficultyRating.Y + TextDifficultyRating.Height + 6),
                FontSize  = 14
            };

            Clicked += OnClicked;
            ModManager.ModsChanged += OnModsChanged;
        }
Esempio n. 18
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="dialog"></param>
        /// <param name="container"></param>
        /// <param name="item"></param>
        /// <param name="index"></param>
        public MenuDialogItem(MenuDialog dialog, PoolableScrollContainer <IMenuDialogOption> container, IMenuDialogOption item, int index)
            : base(container, item, index)
        {
            Size  = new ScalableVector2(Container.Width, HEIGHT);
            Alpha = 0;

            Button = new MenuDialogItemButton(Container, (o, e) =>
            {
                Item.ClickAction();
                DialogManager.Dismiss(dialog);
            })
            {
                Parent = this,
                Size   = Size,
                Alpha  = 0
            };

            Name = new SpriteTextBitmap(FontsBitmap.GothamRegular, Item.Name)
            {
                Parent    = this,
                Alignment = Alignment.MidLeft,
                X         = 15,
                FontSize  = 14,
                Tint      = Item.Color
            };
        }
Esempio n. 19
0
 /// <summary>
 ///     Creates the text that says "Now Playing"
 /// </summary>
 private void CreateNowPlayingText() => NowPlayingText = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Now Playing")
 {
     Parent    = TitleBackground,
     Alignment = Alignment.MidCenter,
     X         = 0,
     FontSize  = 16
 };
 /// <summary>
 ///     Creates the text that displays "Order By:"
 /// </summary>
 private void CreateTextOrderBy() => OrderBy = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Order By:")
 {
     Parent   = this,
     X        = TextSearch.X,
     Y        = TextSearch.Y + TextSearch.Height + 24,
     FontSize = 16
 };
Esempio n. 21
0
 /// <summary>
 /// </summary>
 private void CreateTextFilters() => TextFilter = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Filter")
 {
     Parent   = this,
     Y        = 15,
     X        = 15,
     Tint     = Colors.MainAccent,
     FontSize = 18
 };
 /// <summary>
 /// </summary>
 private void CreateTextCreator() => Creator = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Created By: ")
 {
     Parent   = this,
     X        = Status.X,
     Y        = Artist.Y + Artist.Height + 15,
     Alpha    = 0,
     FontSize = 14
 };
 /// <summary>
 /// </summary>
 private void CreateTextArtist() => Artist = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Artist")
 {
     Parent   = this,
     X        = Status.X,
     Y        = Title.Y + Title.Height + 15,
     Alpha    = 0,
     FontSize = 14
 };
Esempio n. 24
0
 /// <summary>
 /// </summary>
 private void CreatePlaybackRate() => PlaybackRate = new SpriteTextBitmap(FontsBitmap.AllerRegular,
                                                                          $"Playback Speed: 1.0x")
 {
     Parent   = this,
     X        = TextBeatSnap.X,
     Y        = TextBeatSnap.Y + TextBeatSnap.Height + 14,
     FontSize = 16,
 };
Esempio n. 25
0
 /// <summary>
 /// </summary>
 private void CreateTextBeatSnap() => TextBeatSnap = new SpriteTextBitmap(FontsBitmap.AllerRegular,
                                                                          $"Beat Snap: 1/{StringHelper.AddOrdinal(Screen.BeatSnap.Value)}")
 {
     Parent   = this,
     X        = 10,
     Y        = ObjectCount.Y + ObjectCount.Height + 14,
     FontSize = 16
 };
Esempio n. 26
0
 /// <summary>
 /// </summary>
 private void CreateTextObjectCount() => ObjectCount = new SpriteTextBitmap(FontsBitmap.AllerRegular,
                                                                            $"Object Count: {Screen.WorkingMap.HitObjects.Count:n0}")
 {
     Parent   = this,
     X        = 10,
     Y        = HeaderBackground.Height + 10,
     FontSize = 16
 };
 /// <summary>
 /// </summary>
 private void CreateTextDownloadStatus() => Status = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Mapset Information")
 {
     Parent   = this,
     Y        = 15,
     X        = 15,
     Tint     = Colors.MainAccent,
     FontSize = 18
 };
 /// <summary>
 /// </summary>
 private void CreateTextTitle() => Title = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Title")
 {
     Parent   = this,
     X        = Status.X,
     Y        = MapBanner.Y + MapBanner.Height + 15,
     Alpha    = 0,
     FontSize = 14
 };
Esempio n. 29
0
 /// <summary>
 /// </summary>
 private void CreateTextSearch() => TextSearch = new SpriteTextBitmap(FontsBitmap.GothamRegular, "Search")
 {
     Parent   = this,
     Y        = 15,
     X        = 15,
     Tint     = Colors.MainAccent,
     FontSize = 18
 };
Esempio n. 30
0
 /// <summary>
 /// </summary>
 private void CreateLayerName() => LayerName = new SpriteTextBitmap(FontsBitmap.AllerRegular, Item.Name)
 {
     Parent    = this,
     FontSize  = 16,
     Alignment = Alignment.MidLeft,
     X         = EditLayerNameButton.X + EditLayerNameButton.Width + 10,
     Tint      = ColorHelper.ToXnaColor(Item.GetColor())
 };