示例#1
0
        /// <summary>
        /// </summary>
        private void CreateFooter()
        {
            Footer = new MenuFooterMultiplayer(new List <ButtonText>
            {
                new ButtonText(FontsBitmap.GothamRegular, "leave", 14, (o, e) => MultiplayerScreen.LeaveGame()),
                new ButtonText(FontsBitmap.GothamRegular, "options", 14, (o, e) => DialogManager.Show(new SettingsDialog())),
                new MenuFooterButtonGameChat(FontsBitmap.GothamRegular, "game chat", 14, (o, e) => ChatManager.ToggleChatOverlay(true)),
                new ButtonText(FontsBitmap.GothamRegular, "match history", 14, (o, e) => BrowserHelper.OpenURL($"https://quavergame.com/multiplayer/game/{OnlineManager.CurrentGame.GameId}")),
                new ButtonText(FontsBitmap.GothamRegular, "commands", 14, (o, e) => BrowserHelper.OpenURL("https://quavergame.com/wiki/Multiplayer/Commands"))
            }, new List <ButtonText>
            {
            }, Colors.MainAccent)
            {
                Parent    = Container,
                Alignment = Alignment.BotLeft
            };

            Footer.Y = Footer.Height;
            Footer.MoveToY(0, Easing.OutQuint, 600);
        }
示例#2
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="screen"></param>
        public MultiplayerScreenView(MultiplayerScreen screen) : base(screen)
        {
            MultiplayerScreen = 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;
            });

            CreateGameTitleHeader();
            CreateMap();
            CreateSettings();

            PlayerListHeader = new PlayerListHeader(MultiplayerScreen.Game)
            {
                Parent    = Container,
                Alignment = Alignment.TopRight,
                X         = -24,
                Y         = Header.Height + 20
            };

            // Get a list of all the online users in the game from the player ids.
            var players = new List <OnlineUser>();

            MultiplayerScreen.Game.PlayerIds.ForEach(x =>
            {
                if (!players.Contains(OnlineManager.OnlineUsers[x].OnlineUser))
                {
                    players.Add(OnlineManager.OnlineUsers[x].OnlineUser);
                }
            });

            PlayerList = new PlayerList(players, int.MaxValue, 0,
                                        new ScalableVector2(PlayerListHeader.Width, 600),
                                        new ScalableVector2(PlayerListHeader.Width, 600))
            {
                Parent    = Container,
                Alignment = Alignment.TopRight,
                Position  = new ScalableVector2(-24, PlayerListHeader.Y + PlayerListHeader.Height + 10)
            };

            Feed = new MultiplayerFeed()
            {
                Parent    = Container,
                Alignment = Alignment.BotLeft,
                Position  = new ScalableVector2(24, -Footer.Height - 24)
            };

            OnlineManager.Client.OnUserJoinedGame      += OnUserJoinedGame;
            OnlineManager.Client.OnUserLeftGame        += OnUserLeftGame;
            OnlineManager.Client.OnChatMessageReceived += OnChatMessageReceived;
            BackgroundHelper.Blurred += OnBackgroundBlurred;
        }