コード例 #1
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public LobbyScreenView(LobbyScreen screen) : base(screen)
        {
            LobbyScreen = screen;

            CreateBackground();
            CreateHeader();
            CreateFooter();

            Visualizer = new MenuAudioVisualizer((int)WindowManager.Width, 400, 150, 5)
            {
                Parent    = Container,
                Alignment = Alignment.BotLeft,
                Y         = -Footer.Height
            };

            Visualizer.Bars.ForEach(x =>
            {
                x.Alpha = 0.30f;
            });

            CreateSearchBox();
            CreateMatchContainer();

            Jukebox = new Jukebox(true);

            FilterBackground = new Sprite()
            {
                Parent   = Container,
                Position = new ScalableVector2(-Searchbox.X, Searchbox.Y),
                Size     = new ScalableVector2(762, Searchbox.Height),
                Tint     = Color.Black,
                Alpha    = 0.75f
            };

            FilterBackground.AddBorder(Color.White, 2);

            const float spacing = 60f;

            var locked = new LabelledCheckbox("Display Locked", ConfigManager.LobbyFilterHasPassword)
            {
                Parent    = FilterBackground,
                Alignment = Alignment.MidLeft,
                X         = 14
            };

            var full = new LabelledCheckbox("Display Full", ConfigManager.LobbyFilterFullGame)
            {
                Parent    = FilterBackground,
                Alignment = Alignment.MidLeft,
                X         = locked.X + locked.Width + spacing
            };

            var owned = new LabelledCheckbox("Map Downloaded", ConfigManager.LobbyFilterOwnsMap)
            {
                Parent    = FilterBackground,
                Alignment = Alignment.MidLeft,
                X         = full.X + full.Width + spacing
            };

            var friends = new LabelledCheckbox("Friends In Game", ConfigManager.LobbyFilterHasFriends)
            {
                Parent    = FilterBackground,
                Alignment = Alignment.MidLeft,
                X         = owned.X + owned.Width + spacing
            };

            ConfigManager.LobbyFilterHasPassword.ValueChanged += RefilterGames;
            ConfigManager.LobbyFilterFullGame.ValueChanged    += RefilterGames;
            ConfigManager.LobbyFilterOwnsMap.ValueChanged     += RefilterGames;
            ConfigManager.LobbyFilterHasFriends.ValueChanged  += RefilterGames;
        }
コード例 #2
0
        /// <summary>
        /// </summary>
        private void CreateFooter()
        {
            Footer = new MenuFooter(new List <ButtonText>
            {
                new ButtonText(FontsBitmap.GothamRegular, "back to menu", 14, (o, e) => LobbyScreen.ExitToMenu()),
                new ButtonText(FontsBitmap.GothamRegular, "options menu", 14, (o, e) => DialogManager.Show(new SettingsDialog()))
            }, new List <ButtonText>
            {
                new ButtonText(FontsBitmap.GothamRegular, "quick match", 14, (o, e) => { }),
                new ButtonText(FontsBitmap.GothamRegular, "create match", 14, (o, e) => DialogManager.Show(new CreateGameDialog())),
            }, Colors.MainAccent)
            {
                Parent    = Container,
                Alignment = Alignment.BotLeft
            };

            Footer.Y = Footer.Height;
            Footer.MoveToY(0, Easing.OutQuint, 600);
        }