public override void OnInitialize()
        {
            RelativePosition = new FPoint(0, 0);
            Size             = new FSize(12 * GDConstants.TILE_WIDTH, 5 * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTER;

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(8 * GDConstants.TILE_WIDTH, 2 * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_LVLED_BTN_DELLEVEL,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 75,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Alizarin, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Pomegranate, 16),

                Click = DoDelete,
            });
        }
Example #2
0
        public override void OnInitialize()
        {
            RelativePosition = new FPoint(0, 0);
            Size             = new FSize(14 * GDConstants.TILE_WIDTH, 7 * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTER;

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, -1.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(12 * GDConstants.TILE_WIDTH, 2 * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_LVLED_BTN_SAVE,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 75,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = DoSave,
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, +1.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(12 * GDConstants.TILE_WIDTH, 2 * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_LVLED_BTN_DISCARD,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 75,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Concrete, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Asbestos, 16),

                Click = DoDiscard,
            });
        }
Example #3
0
        private void SetInfoBox(string text)
        {
            _infobox?.Remove();

            _hud.AddElement(_infobox = new HUDInfoBox
            {
                Text             = text,
                Alignment        = HUDAlignment.ABSOLUTE_BOTHCENTERED,
                RelativePosition = _screen.TranslateGameToHUDCoordinates(8 * GDConstants.TILE_WIDTH, 9 * GDConstants.TILE_WIDTH),
                FontSize         = 40,
                Font             = Textures.HUDFontRegular,
                TextColor        = Color.Black,
                Alpha            = 1f,
                TextPadding      = new FSize(8, 8),
                MaxWidth         = 8 * GDConstants.TILE_WIDTH,
                WordWrap         = HUDWordWrap.WrapByWordTrusted,

                Background = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Concrete, 4f),
            });
        }
		public override void OnInitialize()
		{
			base.OnInitialize();

			AddElement(new HUDLabel(1)
			{
				TextAlignment = HUDAlignment.CENTER,
				Alignment = HUDAlignment.TOPLEFT,
				RelativePosition = new FPoint(0, 0),
				Size = new FSize(WIDTH, 96),

				Font = Textures.HUDFontBold,
				FontSize = 64,

				L10NText = L10NImpl.STR_MENU_CAP_SEARCH,
				TextColor = FlatColors.Clouds,
			});

			AddElement(new MultiplayerConnectionStateControl(_server)
			{
				Alignment = HUDAlignment.TOPLEFT,
				RelativePosition = new FPoint(16, 16)
			});

			AddElement(new HUDImage
			{
				Alignment = HUDAlignment.CENTER,
				RelativePosition = new FPoint(0, (-FOOTER_HEIGHT/2) + (96/2f)),
				Image = Textures.CannonCogBig,
				RotationSpeed = 0.35f,
				Color = FlatColors.Clouds,
				Size = new FSize(192, 192)
			});

			AddElement(new HUDRectangle(0)
			{
				Alignment = HUDAlignment.BOTTOMRIGHT,
				Size = new FSize(WIDTH, FOOTER_HEIGHT),

				Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
			});
			
			AddElement(new HUDTextButton(2)
			{
				Alignment = HUDAlignment.BOTTOMLEFT,
				RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
				Size = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

				L10NText = L10NImpl.STR_MENU_CANCEL,
				TextColor = Color.White,
				Font = Textures.HUDFontBold,
				FontSize = 55,
				TextAlignment = HUDAlignment.CENTER,
				TextPadding = 8,

				BackgroundNormal = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Asbestos, 16),
				BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.MidnightBlue, 16),

				Click = OnClickCancel,
			});
		}
        public override void OnInitialize()
        {
            base.OnInitialize();

            string txt = "?";

            if (_showMultiplayer)
            {
                txt = L10N.T(L10NImpl.STR_HSP_MULTIPLAYERRANKING);
            }
            else if (_focus == null)
            {
                txt = L10N.T(L10NImpl.STR_HSP_GLOBALRANKING);
            }
            else
            {
                txt = L10N.TF(L10NImpl.STR_HSP_RANKINGFOR, L10N.T(Levels.WORLD_NAMES[_focus.ID]));
            }

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = (_showMultiplayer || _focus == null) ? HUDAlignment.CENTER : HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(TAB_WIDTH, TEXT_HEIGHT_REAL),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                Text      = txt,
                TextColor = FlatColors.Clouds,
            });

            if (MainGame.Inst.Profile.HasMultiplayerGames)
            {
                if (!_showMultiplayer)
                {
                    AddElement(_btn = new HUDTextButton(1)
                    {
                        Alignment        = HUDAlignment.TOPRIGHT,
                        RelativePosition = FPoint.Zero,
                        Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 48),

                        L10NText      = L10NImpl.STR_WORLD_MULTIPLAYER,
                        TextColor     = FlatColors.Foreground,
                        Font          = Textures.HUDFontBold,
                        FontSize      = 42,
                        TextAlignment = HUDAlignment.CENTER,
                        TextPadding   = 8,

                        BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Amethyst, 16, false, true, false, false),
                        BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Wisteria, 16, false, true, false, false),

                        Click = ShowMultiplayer,

                        IsVisible = false,
                    });
                }
                else
                {
                    AddElement(_btn = new HUDTextButton(1)
                    {
                        Alignment        = HUDAlignment.TOPRIGHT,
                        RelativePosition = FPoint.Zero,
                        Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 48),

                        L10NText      = L10NImpl.STR_WORLD_SINGLEPLAYER,
                        TextColor     = FlatColors.Foreground,
                        Font          = Textures.HUDFontBold,
                        FontSize      = 42,
                        TextAlignment = HUDAlignment.CENTER,
                        TextPadding   = 8,

                        BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Amethyst, 16, false, true, false, false),
                        BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Wisteria, 16, false, true, false, false),

                        Click = ShowSingleplayer,

                        IsVisible = false,
                    });
                }
            }

            _loader = new HUDImage
            {
                RelativePosition = new FPoint(0, TEXT_HEIGHT / 2f),
                Alignment        = HUDAlignment.CENTER,
                Size             = new FSize(2 * GDConstants.TILE_WIDTH, 2 * GDConstants.TILE_WIDTH),
                Color            = FlatColors.Clouds,
                Image            = Textures.CannonCogBig,

                RotationSpeed = 0.1f,

                IsVisible = true,
            };
            AddElement(_loader);

            _table = new HUDScrollTable
            {
                RelativePosition = new FPoint(0, TEXT_HEIGHT / 2f),
                Alignment        = HUDAlignment.CENTER,
                Size             = new FSize(TAB_WIDTH, TAB_HEIGHT),

                Background       = FlatColors.BackgroundHUD2,
                Foreground       = FlatColors.TextHUD,
                LineColor        = Color.Black,
                HeaderBackground = FlatColors.Asbestos,
                HeaderForeground = Color.Black,
                ScrollThumbColor = FlatColors.Silver,
                ScrollWidth      = 16,
                ScrollHeight     = 64,
                LineWidth        = 2 * HUD.PixelWidth,
                FontSize         = 32,

                IsVisible = false,
            };
            _table.FixHeightToMultipleOfRowHeight();
            AddElement(_table);

            _table.AddColumn("", 100);
            _table.AddColumn(L10N.T(L10NImpl.STR_TAB_NAME), null);
            _table.AddColumn(L10N.T(L10NImpl.STR_TAB_POINTS), 100);
            if (!_showMultiplayer)
            {
                _table.AddColumn(L10N.T(L10NImpl.STR_TAB_TIME), 175);
            }

            LoadHighscore().EnsureNoError();
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 96),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = _server.ConnType == MultiplayerConnectionType.PROXY ? L10NImpl.STR_MENU_CAP_CGAME_PROX : L10NImpl.STR_MENU_CAP_CGAME_P2P,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new MultiplayerConnectionStateControl(_server)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(16, 16)
            });

            var screen = new GDGameScreen_Display(MainGame.Inst, MainGame.Inst.Graphics, _currentLevel);

            AddElement(_displayScreen = new HUDSubScreenProxyRenderer(screen)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((2 / 3f) * GDConstants.TILE_WIDTH, 3.25f * GDConstants.TILE_WIDTH),
                Size             = new FSize(6 * GDConstants.TILE_WIDTH, 3.75f * GDConstants.TILE_WIDTH),
            });


            AddElement(new HUDImageButton
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((5 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),
                Size             = new FSize(32, 48),

                Image        = Textures.TexHUDIconChevronLeft,
                ImagePadding = 4,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 8f, true, false, true, false),
                BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 8f, true, false, true, false),

                Click = (s, a) => ChangeID1(-1),
            });

            AddElement(_lblLevelID1 = new HUDClickableLabel
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((8 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),

                Size     = new FSize(96, 48),
                FontSize = 48,
                Font     = Textures.HUDFontRegular,

                Text          = "?",
                TextAlignment = HUDAlignment.CENTER,
                TextColor     = FlatColors.Clouds,

                Background = HUDBackgroundDefinition.CreateSimple(FlatColors.BackgroundHUD2),

                Click      = (s, a) => ChangeID1(+1),
                ClickSound = true,
            });

            AddElement(new HUDImageButton
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((17 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),
                Size             = new FSize(32, 48),

                Image        = Textures.TexHUDIconChevronRight,
                ImagePadding = 4,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 8f, false, true, false, true),
                BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 8f, false, true, false, true),

                Click = (s, a) => ChangeID1(+1),
            });


            AddElement(new HUDImageButton
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((24 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),
                Size             = new FSize(32, 48),

                Image        = Textures.TexHUDIconChevronLeft,
                ImagePadding = 4,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 8f, true, false, true, false),
                BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 8f, true, false, true, false),

                Click = (s, a) => ChangeID2(-1),
            });

            AddElement(_lblLevelID2 = new HUDClickableLabel
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((27 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),

                Size     = new FSize(96, 48),
                FontSize = 48,
                Font     = Textures.HUDFontRegular,

                Text          = "?",
                TextAlignment = HUDAlignment.CENTER,
                TextColor     = FlatColors.Clouds,

                Background = HUDBackgroundDefinition.CreateSimple(FlatColors.BackgroundHUD2),

                Click      = (s, a) => ChangeID2(+1),
                ClickSound = true,
            });

            AddElement(new HUDImageButton
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint((36 / 6f) * GDConstants.TILE_WIDTH, 2.25f * GDConstants.TILE_WIDTH),
                Size             = new FSize(32, 48),

                Image        = Textures.TexHUDIconChevronRight,
                ImagePadding = 4,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonHUD, 8f, false, true, false, true),
                BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.ButtonPressedHUD, 8f, false, true, false, true),

                Click = (s, a) => ChangeID2(+1),
            });


            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.BOTTOMLEFT,
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(100 + 8, 375),
                Size             = new FSize(200, 32),

                Font     = Textures.HUDFontRegular,
                FontSize = 32,

                Lambda    = () => L10N.TF(L10NImpl.STR_MENU_MP_LOBBY_USER_FMT, _levelUserCount),
                TextColor = Color.White,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.BOTTOMLEFT,
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(100 + 8, 331),
                Size             = new FSize(200, 32),

                Font     = Textures.HUDFontRegular,
                FontSize = 32,

                L10NText  = L10NImpl.STR_MENU_MP_MUSIC,
                TextColor = Color.White,
            });

            int initialMusic = FloatMath.GetRangedIntRandom(5);

            AddElement(_music1 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(37, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 0,
                Selected         = initialMusic == 0,
            });

            AddElement(_music2 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(109, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 1,
                Selected         = initialMusic == 1,
            });

            AddElement(_music3 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(179, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 2,
                Selected         = initialMusic == 2,
            });

            AddElement(_music4 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(249, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 3,
                Selected         = initialMusic == 3,
            });

            AddElement(_music5 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(319, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 4,
                Selected         = initialMusic == 4,
            });

            AddElement(_music6 = new HUDRadioMusicButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(389, 261),
                Size             = new FSize(62, 62),
                MusicIndex       = 5,
                Selected         = initialMusic == 5,
            });

            _music1.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };
            _music2.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };
            _music3.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };
            _music4.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };
            _music5.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };
            _music6.RadioGroup = new List <HUDRadioMusicButton> {
                _music1, _music2, _music3, _music4, _music5, _music6
            };

            var initialSpeed = MainGame.Inst.Profile.LastMultiplayerHostedSpeed;

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.BOTTOMLEFT,
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(100 + 8, 221),
                Size             = new FSize(200, 32),

                Font     = Textures.HUDFontRegular,
                FontSize = 32,

                L10NText  = L10NImpl.STR_MENU_MP_GAMESPEED,
                TextColor = Color.White,
            });

            AddElement(_speed1 = new HUDRadioSpeedButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(37, 150),
                Size             = new FSize(62, 62),
                Speed            = GameSpeedModes.SUPERSLOW,
                Selected         = initialSpeed == GameSpeedModes.SUPERSLOW,
            });

            AddElement(_speed2 = new HUDRadioSpeedButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(109, 150),
                Size             = new FSize(62, 62),
                Speed            = GameSpeedModes.SLOW,
                Selected         = initialSpeed == GameSpeedModes.SLOW,
            });

            AddElement(_speed3 = new HUDRadioSpeedButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(179, 150),
                Size             = new FSize(62, 62),
                Speed            = GameSpeedModes.NORMAL,
                Selected         = initialSpeed == GameSpeedModes.NORMAL,
            });

            AddElement(_speed4 = new HUDRadioSpeedButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(249, 150),
                Size             = new FSize(62, 62),
                Speed            = GameSpeedModes.FAST,
                Selected         = initialSpeed == GameSpeedModes.FAST,
            });

            AddElement(_speed5 = new HUDRadioSpeedButton
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(319, 150),
                Size             = new FSize(62, 62),
                Speed            = GameSpeedModes.SUPERFAST,
                Selected         = initialSpeed == GameSpeedModes.SUPERFAST,
            });

            _speed1.RadioGroup = new List <HUDRadioSpeedButton> {
                _speed1, _speed2, _speed3, _speed4, _speed5
            };
            _speed2.RadioGroup = new List <HUDRadioSpeedButton> {
                _speed1, _speed2, _speed3, _speed4, _speed5
            };
            _speed3.RadioGroup = new List <HUDRadioSpeedButton> {
                _speed1, _speed2, _speed3, _speed4, _speed5
            };
            _speed4.RadioGroup = new List <HUDRadioSpeedButton> {
                _speed1, _speed2, _speed3, _speed4, _speed5
            };
            _speed5.RadioGroup = new List <HUDRadioSpeedButton> {
                _speed1, _speed2, _speed3, _speed4, _speed5
            };

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(_btnCreate = new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                Icon = null,
                IconRotationSpeed = 0.25f,

                L10NText      = L10NImpl.STR_MENU_MP_CREATE,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickCreateLobby,
            });

            AddElement(new HUDTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_MENU_CANCEL,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Asbestos, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.MidnightBlue, 16),

                Click = OnClickCancel,
            });

            //---------------------

            if (!Levels.LEVELS.TryGetValue(MainGame.Inst.Profile.LastMultiplayerHostedLevel, out _currentLevel))
            {
                _currentLevel = Levels.LEVELS[Levels.LEVELID_1_3];
            }

            _currentWorld = Levels.WORLDS_MULTIPLAYER.FirstOrDefault(w => w.AllNodes.Any(n => n.ConnectionID == _currentLevel.UniqueID));
            if (_currentWorld == null)
            {
                _currentWorld = Levels.WORLD_001;
                _currentLevel = Levels.LEVELS[Levels.LEVELID_1_3];
            }

            UpdateLabels();
        }
Example #7
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_FAP_ACCOUNT,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 100),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                L10NText = L10NImpl.STR_FAP_USERNAME,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20 + (WIDTH - 60) / 2 + 20, 100),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                Text = MainGame.Inst.Profile.OnlineUsername,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 200),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                L10NText = L10NImpl.STR_FAP_SCORE,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20 + (WIDTH - 60) / 2 + 20, 200),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                Text = MainGame.Inst.Profile.TotalPoints.ToString(),
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize(4 * GDConstants.TILE_WIDTH, 64),

                L10NText      = L10NImpl.STR_FAP_LOGOUT,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16),

                Click = OnLogout,
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 64),

                L10NText      = L10NImpl.STR_FAP_CHANGEPW,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16),

                Click = OnChangePassword,
            });
        }
Example #8
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 96),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_UNLOCK,
                TextColor = FlatColors.Clouds,
            });

            var gridDisplay = new HUDFixedUniformGrid
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 96),
                GridWidth        = 8,
                GridHeight       = 1,
                ColumnWidth      = 64,
                RowHeight        = 64,
                Padding          = 10,
            };

            AddElement(gridDisplay);

            for (int i = 0; i < 8; i++)
            {
                CharDisp[i] = new HUDCharacterControl(1)
                {
                    Background = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Clouds, Color.Black, 4f),

                    TextPadding = 2,
                    TextColor   = Color.Black
                };

                gridDisplay.AddElement(i, 0, CharDisp[i]);
            }

            var pad = new HUDKeypad(3, 4, 64, 24)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 176 / 2f),

                ButtonTextAlignment = HUDAlignment.CENTER,

                ButtonFont     = Textures.HUDFontBold,
                ButtonFontSize = 48,

                ButtonTextColor = FlatColors.Foreground,

                ButtonBackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ControlHighlight, 4f),
                ButtonBackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Background, 4f),
            };

            AddElement(pad);

            pad.AddKey('1', 0, 0);
            pad.AddKey('2', 1, 0);
            pad.AddKey('3', 2, 0);

            pad.AddKey('4', 0, 1);
            pad.AddKey('5', 1, 1);
            pad.AddKey('6', 2, 1);

            pad.AddKey('7', 0, 2);
            pad.AddKey('8', 1, 2);
            pad.AddKey('9', 2, 2);

            pad.AddKey('#', 0, 3);
            pad.AddKey('0', 1, 3);
            pad.AddKey('*', 2, 3);

            pad.PadClick += DoClick;
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_MENU_CAP_MULTIPLAYER,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new HUDSeperator(HUDOrientation.Horizontal)
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 100),
                Size             = new FSize(WIDTH, 1),
                SeperatorWidth   = 2,
                Color            = FlatColors.BackgroundHUD2,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 50),
                Size             = new FSize(1, HEIGHT - 100),
                SeperatorWidth   = 2,
                Color            = FlatColors.BackgroundHUD2,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.TOPLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(12, 112),
                Size             = new FSize(300, 32),

                Font     = Textures.HUDFontBold,
                FontSize = 32,

                L10NText  = L10NImpl.STR_MENU_MP_LOCAL_CLASSIC,
                TextColor = Color.White,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.TOPLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(WIDTH / 2 + 12, 112),
                Size             = new FSize(300, 32),

                Font     = Textures.HUDFontBold,
                FontSize = 32,

                L10NText  = L10NImpl.STR_MENU_MP_ONLINE,
                TextColor = Color.White,
            });

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.TOPCENTER,
                Image            = Textures.TexIconBluetoothClassic,
                Size             = new FSize(128, 128),
                Color            = ColorMath.Blend(Color.White, FlatColors.BackgroundHUD, 0.5f),
                RelativePosition = new FPoint(-WIDTH / 4f, (100 + 12 + 32 + 12) + (HEIGHT - (100 + 12 + 32 + 12) - (32 + 64 + 32 + 64 + 32)) / 2 - 64)
            });

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.TOPCENTER,
                Image            = Textures.TexIconInternet,
                Size             = new FSize(128, 128),
                Color            = ColorMath.Blend(Color.White, FlatColors.BackgroundHUD, 0.5f),
                RelativePosition = new FPoint(+WIDTH / 4f, (100 + 12 + 32 + 12) + (HEIGHT - (100 + 12 + 32 + 12) - (32 + 64 + 32 + 64 + 32)) / 2 - 64)
            });

            AddElement(new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 128),
                Size             = new FSize(320, 64),

                L10NText      = L10NImpl.STR_MENU_MP_JOIN,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickJoinBluetooth,
            });

            AddElement(new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 128),
                Size             = new FSize(320, 64),

                L10NText      = L10NImpl.STR_MENU_MP_JOIN,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickJoinOnline,
            });

            if (_ustate == WorldUnlockState.OpenAndUnlocked)
            {
                AddElement(new HUDTextButton
                {
                    Alignment        = HUDAlignment.BOTTOMLEFT,
                    RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 32),
                    Size             = new FSize(320, 64),

                    L10NText      = L10NImpl.STR_MENU_MP_HOST,
                    TextColor     = Color.White,
                    Font          = Textures.HUDFontBold,
                    FontSize      = 55,
                    TextAlignment = HUDAlignment.CENTER,
                    TextPadding   = 8,

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Wisteria, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Amethyst, 16),

                    Click = OnClickHostBluetooth,
                });

                AddElement(new HUDTextButton
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 32),
                    Size             = new FSize(320, 64),

                    L10NText      = L10NImpl.STR_MENU_MP_HOST,
                    TextColor     = Color.White,
                    Font          = Textures.HUDFontBold,
                    FontSize      = 55,
                    TextAlignment = HUDAlignment.CENTER,
                    TextPadding   = 8,

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Wisteria, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Amethyst, 16),

                    Click = OnClickHostOnline,
                });
            }
            else
            {
                AddElement(new HUDTextButton
                {
                    Alignment        = HUDAlignment.BOTTOMLEFT,
                    RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 32),
                    Size             = new FSize(320, 64),

                    L10NText      = L10NImpl.STR_MENU_MP_HOST,
                    TextColor     = Color.White,
                    Font          = Textures.HUDFontBold,
                    FontSize      = 55,
                    TextAlignment = HUDAlignment.CENTER,
                    TextPadding   = 8,

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.Asbestos, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.WetAsphalt, 16),

                    Click = OnClickUnlock,
                });

                AddElement(new HUDTextButton
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint((WIDTH / 2 - 320) / 2, 32),
                    Size             = new FSize(320, 64),

                    L10NText      = L10NImpl.STR_MENU_MP_HOST,
                    TextColor     = Color.White,
                    Font          = Textures.HUDFontBold,
                    FontSize      = 55,
                    TextAlignment = HUDAlignment.CENTER,
                    TextPadding   = 8,

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.Asbestos, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.WetAsphalt, 16),

                    Click = OnClickUnlock,
                });
            }
        }
Example #10
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_CPP_CHANGEPW,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 100),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                L10NText = L10NImpl.STR_CPP_USERNAME,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20 + (WIDTH - 60) / 2 + 20, 100),
                Size             = new FSize((WIDTH - 60) / 2, 80),

                Font      = Textures.HUDFontRegular,
                FontSize  = 64,
                TextColor = FlatColors.Clouds,

                Text = MainGame.Inst.Profile.OnlineUsername,
            });

            AddElement(editPassword = new HUDIconTextBox(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 200),
                Size             = new FSize(WIDTH - 40, 80),

                Font     = Textures.HUDFontRegular,
                FontSize = 40,

                Placeholder = L10N.T(L10NImpl.STR_CPP_NEWPW),
                IsPassword  = true,

                BackgoundCornerSize = 8,
                ColorPadLeft        = FlatColors.ControlHighlight,
                WidthPadLeft        = 80,
                IconColor           = FlatColors.Asbestos,
                Icon     = Textures.TexHUDIconPassword,
                IconSize = new FSize(50, 50),
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize((WIDTH - 2 * 24), 64),

                L10NText      = L10NImpl.STR_CPP_CHANGE,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16),

                Click = OnChangePassword,
            });
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_AAP_HEADER,
                TextColor = FlatColors.Clouds,
            });

            AddElement(editUsername = new HUDIconTextBox(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 100),
                Size             = new FSize(WIDTH - 40, 80),

                Font     = Textures.HUDFontRegular,
                FontSize = 40,

                Placeholder = L10N.T(L10NImpl.STR_AAP_USERNAME),
                MaxLength   = 16,

                BackgoundCornerSize = 8,
                ColorPadLeft        = FlatColors.ControlHighlight,
                WidthPadLeft        = 80,
                IconColor           = FlatColors.Asbestos,
                Icon     = Textures.TexHUDIconUser,
                IconSize = new FSize(50, 50),
            });

            AddElement(editPassword = new HUDIconTextBox(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 200),
                Size             = new FSize(WIDTH - 40, 80),

                Font     = Textures.HUDFontRegular,
                FontSize = 40,

                Placeholder = L10N.T(L10NImpl.STR_AAP_PASSWORD),
                IsPassword  = true,

                BackgoundCornerSize = 8,
                ColorPadLeft        = FlatColors.ControlHighlight,
                WidthPadLeft        = 80,
                IconColor           = FlatColors.Asbestos,
                Icon     = Textures.TexHUDIconPassword,
                IconSize = new FSize(50, 50),
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize((WIDTH - 3 * 24) / 2, 64),

                L10NText          = L10NImpl.STR_AAP_CREATEACCOUNT,
                TextColor         = Color.White,
                Font              = Textures.HUDFontRegular,
                FontSize          = 55,
                TextAlignment     = HUDAlignment.CENTER,
                TextPadding       = 8,
                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16f),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16f),

                Click = OnCreateAccount,
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize((WIDTH - 3 * 24) / 2, 64),

                L10NText          = L10NImpl.STR_AAP_LOGIN,
                TextColor         = Color.White,
                Font              = Textures.HUDFontRegular,
                FontSize          = 55,
                TextAlignment     = HUDAlignment.CENTER,
                TextPadding       = 8,
                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16f),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16f),

                Click = OnLogin,
            });
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_AAP_HEADER,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(20, 100),
                Size             = new FSize(WIDTH - 40, 200),

                Font          = Textures.HUDFontRegular,
                FontSize      = 32,
                TextColor     = ColorMath.Blend(FlatColors.Clouds, FlatColors.Background, 0.2f),
                WordWrap      = HUDWordWrap.WrapByWordTrusted,
                MaxWidth      = WIDTH - 40,
                TextAlignment = HUDAlignment.CENTER,

                L10NText = L10NImpl.STR_ACCOUNT_REMINDER,
            });

            AddElement(_buttonYes = new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize((WIDTH - 3 * 24) / 2, 64),

                L10NText      = L10NImpl.STR_BTN_YES,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Emerald, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickYes,
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 32),
                Size             = new FSize((WIDTH - 3 * 24) / 2, 64),

                L10NText      = L10NImpl.STR_BTN_NO,
                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonHUD, 16f),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.ButtonPressedHUD, 16f),

                Click = OnClickNo,
            });
        }
Example #13
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 2f * GDConstants.TILE_WIDTH),

                Image = Textures.TexTitle_SCCM,
            });

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 5.5f * GDConstants.TILE_WIDTH),

                Image = Textures.TexCircle,
                Color = Color.Black * 0.1f,
            });

            AddElement(new HUDTetroAnimation
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(5f * GDConstants.TILE_WIDTH, 5f * GDConstants.TILE_WIDTH),

                Foreground = FlatColors.Silver,
            });

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 2f * GDConstants.TILE_WIDTH),
                Size             = new FSize(WIDTH, 3f * GDConstants.TILE_WIDTH),

                Image          = Textures.TexDescription_SCCM,
                ImageAlignment = HUDImageAlignmentAlgorithm.TOPLEFT,
                ImageScale     = HUDImageScaleAlgorithm.UNDERSCALE,
            });

            AddElement(_button = new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_PREV_BUYNOW,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickBuy,
            });

            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_PREV_OR,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
            });

            AddElement(new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                Text          = L10N.T(L10NImpl.STR_PREV_FINISHGAME),
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Turquoise, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.GreenSea, 16),

                Click = OnClickFinishPrev,
            });
        }
Example #14
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_MENU_CAP_LOBBY,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new MultiplayerConnectionStateControl(_server)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(16, 16)
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 0 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_PING,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 1 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_USER,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 2 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_LEVEL,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 3 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_MUSIC,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 4 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_SPEED,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 5 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_COLOR,
                TextColor        = FlatColors.Clouds,
            });



            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 0 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => $"{(int)(_server.ProxyPing.Value * 1000)}ms",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 1 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => $"{_server.SessionCount} / {_server.SessionCapacity}",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 2 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => _server.LevelID != null ? Levels.LEVELS[_server.LevelID.Value].FullName : ("?"),
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 3 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => _server.MusicIndex != null ? (_server.MusicIndex.Value + 1).ToString() : "?",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 4 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => _server.Speed != null ? Fmt(_server.Speed.Value) : "?",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(_lblFraction = new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 5 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => fracName != null ? fracName : "?",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });


            AddElement(new HUDImage
            {
                Image         = Textures.CannonCogBig,
                RotationSpeed = 0.3f,
                Color         = FlatColors.BackgroundHUD2,

                Size = new FSize(196, 196),

                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(WIDTH / 4f, -64)
            });

            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(6.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_MENU_DISCONNECT,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Asbestos, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.MidnightBlue, 16),

                Click = OnClickCancel,
            });
        }
Example #15
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            var prev = new GDGameScreen_Preview(MainGame.Inst, MainGame.Inst.Graphics, this, _blueprints, 0, _worldNumber);

            AddElement(_proxy = new HUDSubScreenProxyRenderer(prev)
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(INNER_WIDTH, INNER_HEIGHT),
            });

            AddElement(_button = new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_PREV_BUYNOW,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.PeterRiver, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.BelizeHole, 16),

                Click = OnClickBuy,
            });

            AddElement(new HUDTextButton
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                Text          = L10N.TF(L10NImpl.STR_PREV_FINISHWORLD, _unlockWorldNumber),
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Turquoise, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.GreenSea, 16),

                Click = OnClickFinishPrev,
            });

            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 0.75f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.5f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_PREV_OR,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
            });

            AddElement(new HUDImage
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.125f * GDConstants.TILE_WIDTH),
                Size             = new FSize(0.75f * GDConstants.TILE_WIDTH, 0.75f * GDConstants.TILE_WIDTH),

                Image = Textures.TexIconScore,
            });

            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(1.5f * GDConstants.TILE_WIDTH, 0.125f * GDConstants.TILE_WIDTH),
                Size             = new FSize(4.25f * GDConstants.TILE_WIDTH, 0.75f * GDConstants.TILE_WIDTH),

                Text          = $"{MainGame.Inst.Profile.TotalPoints} / {UnlockManager.PointsForUnlock(_id)}",
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 50,
                TextAlignment = HUDAlignment.CENTERLEFT,
            });
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTER,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 100),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

                L10NText  = L10NImpl.STR_MENU_CAP_LOBBY,
                TextColor = FlatColors.Clouds,
            });

            AddElement(new MultiplayerConnectionStateControl(_server)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(16, 16)
            });

            if (_server.ConnType == MultiplayerConnectionType.PROXY)
            {
                var gridDisplay = new HUDFixedUniformGrid
                {
                    Alignment        = HUDAlignment.TOPCENTER,
                    RelativePosition = new FPoint(0, 100),
                    GridWidth        = 8,
                    GridHeight       = 1,
                    ColumnWidth      = 84,
                    RowHeight        = 84,
                    Padding          = 16,
                };
                AddElement(gridDisplay);

                for (int i = 0; i < 8; i++)
                {
                    CharDisp[i] = new HUDCharacterControl(1)
                    {
                        Background = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Clouds, Color.Black, 4f),

                        TextPadding = 2,
                        TextColor   = Color.Black
                    };

                    gridDisplay.AddElement(i, 0, CharDisp[i]);
                }

                var scode = KiddieCryptography.SpiralHexEncode(_server.SessionID, _server.SessionSecret);
                for (int i = 0; i < 8; i++)
                {
                    if (i < scode.Length)
                    {
                        CharDisp[i].Character = scode[i];
                    }
                }

                AddOperation(new CharacterControlWaveOperation(CharDisp));

                AddElement(new HUDLabel
                {
                    TextAlignment    = HUDAlignment.BOTTOMRIGHT,
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(16, FOOTER_HEIGHT + 16),
                    Size             = new FSize(320, 128),
                    MaxWidth         = 320,
                    WordWrap         = HUDWordWrap.WrapByWordTrusted,

                    Font     = Textures.HUDFontRegular,
                    FontSize = 32,

                    L10NText  = L10NImpl.STR_MENU_MP_LOBBYINFO,
                    TextColor = ColorMath.Blend(FlatColors.Clouds, FlatColors.Background, 0.5f),
                });
            }

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 0 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_PING,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 1 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_USER,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 2 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_LEVEL,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 3 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_MUSIC,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 4 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_SPEED,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C1_LEFT, 208 + 5 * 32),
                Size             = new FSize(INFO_C1_WIDTH, 32),
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = L10NImpl.STR_MENU_MP_LOBBY_COLOR,
                TextColor        = FlatColors.Clouds,
            });



            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 0 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => $"{(int)(_server.ProxyPing.Value * 1000)}ms",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLambdaLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 1 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Lambda           = () => $"{_server.SessionCount} / {_server.SessionCapacity}",
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 2 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Text             = Levels.LEVELS[_server.LevelID].FullName,
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 3 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Text             = (_server.MusicIndex + 1).ToString(),
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 4 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                Text             = Fmt(_server.Speed),
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = FlatColors.Clouds,
            });

            AddElement(new HUDLabel
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(INFO_C2_LEFT, 208 + 5 * 32),
                Size             = new FSize(INFO_C2_WIDTH, 32),
                MaxWidth         = INFO_C2_WIDTH,
                Font             = Textures.HUDFontRegular,
                FontSize         = 32,
                L10NText         = Fraction.NAME_PLAYER,
                WordWrap         = HUDWordWrap.Ellipsis,
                TextColor        = Fraction.COLOR_PLAYER,
            });



            AddElement(new HUDRectangle(0)
            {
                Alignment = HUDAlignment.BOTTOMRIGHT,
                Size      = new FSize(WIDTH, FOOTER_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true),
            });

            AddElement(new HUDTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(6.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_MENU_DISCONNECT,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Asbestos, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.MidnightBlue, 16),

                Click = OnClickCancel,
            });

            AddElement(_btnStart = new HUDTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0.5f * GDConstants.TILE_WIDTH, 0.5f * GDConstants.TILE_WIDTH),
                Size             = new FSize(5.5f * GDConstants.TILE_WIDTH, 1.0f * GDConstants.TILE_WIDTH),

                L10NText      = L10NImpl.STR_MENU_MP_START,
                TextColor     = Color.White,
                Font          = Textures.HUDFontBold,
                FontSize      = 55,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Emerald, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRoundedBlur(FlatColors.Nephritis, 16),

                IsVisible = false,

                Click = OnClickStart,
            });
        }