示例#1
0
        public OverworldHUD(GDOverworldScreen scrn, bool firstShow) : base(scrn, Textures.HUDFontRegular)
        {
            AddElement(Settings = new SettingsButton());

            ScoreDispMan = new ScoreDisplayManager(this, firstShow);

#if FALSE
            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, -200),

                AutoSize = true,

                Background = HUDBackgroundDefinition.CreateSimple(Color.LightBlue),
                TextColor  = Color.Red,

                FontSize = 64,
                Text     = "INTERNAL ALPHA VERSION 4",
            });
#endif
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Header

            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 48),

                TextAlignment = HUDAlignment.CENTER,
                Text          = _level.FullName,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 48,
            });

            #endregion

            #region Icons

            AddElement(_diffButton0 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_0, () => SelectDiff(FractionDifficulty.DIFF_0))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(_level.CustomMeta_LevelID, FractionDifficulty.DIFF_0),
                Selected = FractionDifficulty.DIFF_0 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton1 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_1, () => SelectDiff(FractionDifficulty.DIFF_1))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(_level.CustomMeta_LevelID, FractionDifficulty.DIFF_1),
                Selected = FractionDifficulty.DIFF_1 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton2 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_2, () => SelectDiff(FractionDifficulty.DIFF_2))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(_level.CustomMeta_LevelID, FractionDifficulty.DIFF_2),
                Selected = FractionDifficulty.DIFF_2 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton3 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_3, () => SelectDiff(FractionDifficulty.DIFF_3))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(_level.CustomMeta_LevelID, FractionDifficulty.DIFF_3),
                Selected = FractionDifficulty.DIFF_3 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN + 32)
            });

            #endregion

            #region Buttons

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, 3.50f * TW),
                Size             = new FSize(3.5f * TW, 60),

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

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

                Click = (s, a) => MainGame.Inst.SetOverworldScreenWithSCCM(SCCMMainPanel.SCCMTab.Hot),
            });

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 3.50f * TW),
                Size             = new FSize(3.5f * TW, 60),

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

                BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.Orange, 16),
                BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.SunFlower, 16),

                Click = (s, a) => Replay(SelectedDifficulty),
            });

            #endregion

            #region Footer

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

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

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_POINTS,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDIncrementIndicatorLabel(MainGame.Inst.Profile.ScoreSCCM.ToString(), "", 2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 16),
                Size             = new FSize(WIDTH / 3f, 60),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            #endregion
        }
        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();
        }
示例#4
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Footer

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

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


            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_LEVEL,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = Level.Name,
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_MPPOINTS,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDIncrementIndicatorLabel(profile.MultiplayerPoints.ToString(), (successScreen ? "+" : "-") + Math.Abs(_deltaPoints), 2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(_loadingCog = new HUDImage(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 16),
                Size             = new FSize(WIDTH / 3f, 80),

                Image          = Textures.CannonCogBig,
                RotationSpeed  = 0.3f,
                Color          = FlatColors.TextHUD,
                ImageAlignment = HUDImageAlignment.UNDERSCALE,

                IsVisible = false,
            });

            #endregion

            #region Buttons

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 60),

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

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

                Click = (s, a) => { _server.KillSession(); _server.Stop(); GDScreen.ExitToMap(); },
            });

            if (_server.SessionUserID == 0 && _server.Mode != SAMNetworkConnection.ServerMode.Stopped && _server.Mode != SAMNetworkConnection.ServerMode.Error)
            {
                AddElement(_btnRand = new HUDIconTextButton(2)
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(24, FOOTER_HEIGHT + 90),
                    Size             = new FSize(6f * GDConstants.TILE_WIDTH, 60),

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

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

                    Click = (s, a) => OnRandomLevel(),
                });

                AddElement(_btnNext = new HUDIconTextButton(2)
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                    Size             = new FSize(6f * GDConstants.TILE_WIDTH, 60),

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

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.SunFlower, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.Orange, 16),

                    Click = (s, a) => OnNextLevel(),
                });
            }

            #endregion

            #region Icons

            AddElement(new HUDMultiplayerDifficultyButton(2, successScreen, 0)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDMultiplayerDifficultyButton(2, successScreen, 1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDMultiplayerDifficultyButton(2, successScreen, 2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDMultiplayerDifficultyButton(2, successScreen, 3)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            #endregion
        }
        public GDMultiplayerGameHUD(GDGameScreen scrn, GDMultiplayerCommon mp) : base(scrn, Textures.HUDFontRegular)
        {
            AddElement(new HUDPauseButton(false, false, true));

            _backgroundRect = new HUDRectangle(-10)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = FPoint.Zero,
                Definition       = HUDBackgroundDefinition.CreateSimple(Color.Black * 0.3f),
                Size             = new FSize(100, 100),
            };
            AddElement(_backgroundRect);

            var mpcsc = new MultiplayerConnectionStateControl(mp)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(4, 4),
                TextColor        = FlatColors.Clouds,
            };

            AddElement(mpcsc);
            _cornerElements.Add(mpcsc);

            if (mp.SessionUserID == 0)
            {
                if (mp.SessionCapacity == 2)
                {
                    var lbl = new HUDLambdaLabel
                    {
                        Alignment        = HUDAlignment.TOPLEFT,
                        RelativePosition = new FPoint(4, 44),
                        Font             = Textures.HUDFontBold,
                        FontSize         = 32,
                        Size             = new FSize(200, 32),
                        TextColor        = FlatColors.Clouds,
                        AutoSize         = true,

                        Lambda = () => (mp.ConnState == SAMNetworkConnection.ConnectionState.Offline) ? "Ping: -" : $"Ping: {(int) (mp.UserConn[1].InGamePing.Value * 1000)}ms",
                    };
                    AddElement(lbl);
                    _cornerElements.Add(lbl);
                }
                else
                {
                    int idx = 0;
                    for (int i = 1; i < mp.SessionCapacity; i++)
                    {
                        int uid = i;

                        var lbl = new HUDLambdaLabel
                        {
                            Alignment        = HUDAlignment.TOPLEFT,
                            RelativePosition = new FPoint(4, 44 + 40 * idx),
                            Font             = Textures.HUDFontBold,
                            FontSize         = 32,
                            Size             = new FSize(200, 32),
                            TextColor        = Color.White,
                            AutoSize         = true,

                            Lambda = () => $"Ping[{uid}]: {(int) (mp.UserConn[uid].InGamePing.Value * 1000)}ms",
                        };
                        AddElement(lbl);
                        _cornerElements.Add(lbl);

                        idx++;
                    }
                }
            }
            else
            {
                var lbl = new HUDLambdaLabel
                {
                    Alignment        = HUDAlignment.TOPLEFT,
                    RelativePosition = new FPoint(4, 44),
                    Font             = Textures.HUDFontBold,
                    FontSize         = 32,
                    Size             = new FSize(200, 32),
                    TextColor        = Color.White,
                    AutoSize         = true,

                    Lambda = () => $"Ping: {(int) (mp.UserConn[0].InGamePing.Value * 1000)}ms",
                };

                AddElement(lbl);
                _cornerElements.Add(lbl);
            }

            _countdown = new HUDImage(100)
            {
                Alignment      = HUDAlignment.CENTER,
                Image          = Textures.TexTitleNumber[3],
                ImageAlignment = HUDImageAlignmentAlgorithm.CENTER,
                ImageScale     = HUDImageScaleAlgorithm.UNDERSCALE,

                Size = new FSize(320, 320),
            };
            AddElement(_countdown);

            var x = _cornerElements.Max(e => e.Right);
            var y = _cornerElements.Max(e => e.Bottom);

            _backgroundRect.Size = new FSize(x + 4f, y + 4f);
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Footer

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

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


            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });


            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_LEVEL,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_POINTS,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_TIME_BEST,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                L10NText      = L10NImpl.STR_HSP_TUTORIAL,
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(new HUDIncrementIndicatorLabel(profile.TotalPoints.ToString(), increasePoints == 0 ? "" : "+" + increasePoints, 2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = profile.GetLevelData(Levels.LEVEL_TUTORIAL).GetTimeString(FractionDifficulty.DIFF_0, true),
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            #endregion

            #region Buttons

            //AddElement(btnMenu = new HUDIconTextButton(2)
            //{
            //	Alignment = HUDAlignment.BOTTOMLEFT,
            //	RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
            //	Size = new FSize(3.5f * GDConstants.TILE_WIDTH, 60),
            //
            //	Text = "Back",
            //	TextColor = Color.White,
            //	Font = Textures.HUDFontRegular,
            //	FontSize = 55,
            //	TextAlignment = HUDAlignment.CENTER,
            //	TextPadding = 8,
            //	Icon = Textures.TexIconBack,
            //	BackgroundType = HUDBackgroundType.Rounded,
            //	Color = FlatColors.ButtonHUD,
            //	ColorPressed = FlatColors.ButtonPressedHUD,
            //});
            //btnMenu.ButtonClick += (s, a) => MainGame.Inst.SetWorldMapScreen(GDScreen.WorldBlueprint, GDScreen.Blueprint.UniqueID);


            AddElement(btnPlay = new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(7f * GDConstants.TILE_WIDTH, 60),

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

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

                Click = (s, a) => MainGame.Inst.SetWorldMapScreenWithTransition(Levels.WORLD_001),
            });

            #endregion

            #region Icons

            AddElement(new HUDTutorialDifficultyButton(2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDTutorialDifficultyButton(2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDTutorialDifficultyButton(2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDTutorialDifficultyButton(2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN)
            });

            #endregion
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Footer

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

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


            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_TIME_YOU,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = TimeExtension.FormatMilliseconds(Time, false),
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            #endregion

            #region Buttons

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 60),

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

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

                Click = (s, a) => { MainGame.Inst.SetLevelEditorScreen(SCCMData); },
            });

            if (CanUpload)
            {
                var w = L10N.LANGUAGE == L10N.LANG_EN_US ? 3.5f : 5.0f;
                AddElement(new HUDIconTextButton(2)
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                    Size             = new FSize(w * GDConstants.TILE_WIDTH, 60),

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

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

                    Click = DoUpload,
                });
            }
            else
            {
                var w = L10N.LANGUAGE == L10N.LANG_EN_US ? 3.5f : 5.0f;
                AddElement(new HUDIconTextButton(2)
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                    Size             = new FSize(w * GDConstants.TILE_WIDTH, 60),

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

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.Orange, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.SunFlower, 16),

                    Click = (s, a) => ((GDGameScreen)HUD.Screen).RestartLevel(false),
                });
            }

            #endregion

            #region Icons

            AddElement(new HUDSCCMUploadDifficultyButton(2, CanUpload, 0)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDSCCMUploadDifficultyButton(2, CanUpload, 1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDSCCMUploadDifficultyButton(2, CanUpload, 2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            AddElement(new HUDSCCMUploadDifficultyButton(2, CanUpload, 3)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN),
                IsEnabled        = false,
            });

            #endregion
        }
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Footer

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

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


            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_LEVEL,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_POINTS,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(LabelTime1 = new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_TIME_NOW,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = _level.Name,
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(new HUDIncrementIndicatorLabel(_profile.TotalPoints.ToString(), _increasePoints == 0 ? "" : "+" + _increasePoints, 2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(LabelTime2 = new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = TimeExtension.FormatMilliseconds(_leveltime, false),
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            #endregion

            #region Buttons

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 60),

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

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

                Click = (s, a) => GDScreen.ExitToMap(false),
            });

            if (_successScreen)
            {
                var next = GetNextNode();

                if (next != null)
                {
                    AddElement(new HUDIconTextButton(2)
                    {
                        Alignment        = HUDAlignment.BOTTOMRIGHT,
                        RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                        Size             = new FSize(3.5f * GDConstants.TILE_WIDTH, 60),

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

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

                        Click = (s, a) => MainGame.Inst.SetLevelScreen(next.Item1, next.Item2, GDScreen.WorldBlueprint),
                    });
                }
            }
            else
            {
                var w = L10N.LANGUAGE == L10N.LANG_EN_US ? 3.5f : 5.0f;

                AddElement(new HUDIconTextButton(2)
                {
                    Alignment        = HUDAlignment.BOTTOMRIGHT,
                    RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                    Size             = new FSize(w * GDConstants.TILE_WIDTH, 60),

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

                    BackgroundNormal  = HUDBackgroundDefinition.CreateRounded(FlatColors.Orange, 16),
                    BackgroundPressed = HUDBackgroundDefinition.CreateRounded(FlatColors.SunFlower, 16),

                    Click = (s, a) => ((GDGameScreen)HUD.Screen).RestartLevel(false),
                });
            }

            #endregion

            #region Icons

            var finDiff0 = _profile.GetLevelData(this.GDHUD().GDOwner.Blueprint.UniqueID).HasCompletedOrBetter(FractionDifficulty.KI_EASY);
            var finDiff1 = _profile.GetLevelData(this.GDHUD().GDOwner.Blueprint.UniqueID).HasCompletedOrBetter(FractionDifficulty.KI_NORMAL);
            var finDiff2 = _profile.GetLevelData(this.GDHUD().GDOwner.Blueprint.UniqueID).HasCompletedOrBetter(FractionDifficulty.KI_HARD);
            var finDiff3 = _profile.GetLevelData(this.GDHUD().GDOwner.Blueprint.UniqueID).HasCompletedOrBetter(FractionDifficulty.KI_IMPOSSIBLE);


            var modeDiff0 =
                finDiff0 ?
                (_gainLevel.Contains(FractionDifficulty.KI_EASY) ?
                 HUDDifficultyButton.HUDDifficultyButtonMode.UNLOCKANIMATION :
                 HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED) :
                HUDDifficultyButton.HUDDifficultyButtonMode.DEACTIVATED;

            var modeDiff1 =
                finDiff1 ?
                (_gainLevel.Contains(FractionDifficulty.KI_NORMAL) ?
                 HUDDifficultyButton.HUDDifficultyButtonMode.UNLOCKANIMATION :
                 HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED) :
                HUDDifficultyButton.HUDDifficultyButtonMode.DEACTIVATED;

            var modeDiff2 =
                finDiff2 ?
                (_gainLevel.Contains(FractionDifficulty.KI_HARD) ?
                 HUDDifficultyButton.HUDDifficultyButtonMode.UNLOCKANIMATION :
                 HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED) :
                HUDDifficultyButton.HUDDifficultyButtonMode.DEACTIVATED;

            var modeDiff3 =
                finDiff3 ?
                (_gainLevel.Contains(FractionDifficulty.KI_IMPOSSIBLE) ?
                 HUDDifficultyButton.HUDDifficultyButtonMode.UNLOCKANIMATION :
                 HUDDifficultyButton.HUDDifficultyButtonMode.ACTIVATED) :
                HUDDifficultyButton.HUDDifficultyButtonMode.DEACTIVATED;

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_EASY, modeDiff0)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_NORMAL, modeDiff1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_HARD, modeDiff2)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN)
            });

            AddElement(new HUDDifficultyButton(2, FractionDifficulty.KI_IMPOSSIBLE, modeDiff3)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN)
            });

            #endregion

            if (_successScreen)
            {
                AddHUDOperation(new HUDScorePanelTimeDisplayOperation(
                                    L10NImpl.STR_HSP_TIME_NOW, TimeExtension.FormatMilliseconds(_leveltime, false),
                                    L10NImpl.STR_HSP_TIME_BEST, _profile.GetLevelData(_level.UniqueID).GetTimeString(_levelDifficulty, false)));
            }
            else
            {
                LabelTime1.L10NText = L10NImpl.STR_HSP_TIME_BEST;
                LabelTime2.Text     = _profile.GetLevelData(_level.UniqueID).GetTimeString(_levelDifficulty, false);
            }
        }
示例#9
0
        public override void OnInitialize()
        {
            base.OnInitialize();

            #region Header

            AddElement(new HUDLabel
            {
                Alignment        = HUDAlignment.TOPCENTER,
                RelativePosition = new FPoint(0, 0),
                Size             = new FSize(WIDTH, 48),

                TextAlignment = HUDAlignment.CENTER,
                Text          = LevelMeta.LevelName,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 48,
            });

            #endregion

            #region Icons

            AddElement(_diffButton0 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_0, () => SelectDiff(FractionDifficulty.DIFF_0))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(LevelMeta.OnlineID, FractionDifficulty.DIFF_0),
                Selected = FractionDifficulty.DIFF_0 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(1 * ICON_MARGIN + 0 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton1 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_1, () => SelectDiff(FractionDifficulty.DIFF_1))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(LevelMeta.OnlineID, FractionDifficulty.DIFF_1),
                Selected = FractionDifficulty.DIFF_1 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(3 * ICON_MARGIN + 1 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton2 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_2, () => SelectDiff(FractionDifficulty.DIFF_2))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(LevelMeta.OnlineID, FractionDifficulty.DIFF_2),
                Selected = FractionDifficulty.DIFF_2 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(5 * ICON_MARGIN + 2 * ICON_SIZE, ICON_MARGIN + 32)
            });

            AddElement(_diffButton3 = new EnhancedHUDDifficultyButton(2, FractionDifficulty.DIFF_3, () => SelectDiff(FractionDifficulty.DIFF_3))
            {
                Active   = MainGame.Inst.Profile.HasCustomLevelBeaten(LevelMeta.OnlineID, FractionDifficulty.DIFF_3),
                Selected = FractionDifficulty.DIFF_3 == SelectedDifficulty,

                Alignment        = HUDAlignment.TOPLEFT,
                Size             = new FSize(ICON_SIZE, ICON_SIZE),
                RelativePosition = new FPoint(7 * ICON_MARGIN + 3 * ICON_SIZE, ICON_MARGIN + 32)
            });

            #endregion

            #region Buttons

            AddElement(new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(3.5f * TW, 60),

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

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

                Click = (s, a) => MainGame.Inst.SetOverworldScreenWithSCCM(SCCMMainPanel.SCCMTab.Hot),
            });

            AddElement(_btnReplay = new HUDIconTextButton(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, FOOTER_HEIGHT + 24),
                Size             = new FSize(3.5f * TW, 60),

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

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

                Click = (s, a) => Replay(SelectedDifficulty),
            });

            #endregion

            #region Star

            AddElement(_btnStar = new HUDEllipseImageButton
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 4.25f),
                Size             = new FSize(3f * TW, 3f * TW),

                Image        = Textures.TexIconStar,
                ImageColor   = (MainGame.Inst.Profile.HasCustomLevelStarred(LevelMeta.OnlineID) || LevelMeta.UserID == MainGame.Inst.Profile.OnlineUserID) ? FlatColors.SunFlower : FlatColors.BackgroundHUD,
                ImagePadding = 16f,

                BackgroundNormal  = FlatColors.ButtonHUD,
                BackgroundPressed = FlatColors.ButtonPressedHUD,

                IsEnabled = (LevelMeta.UserID != MainGame.Inst.Profile.OnlineUserID),
                Click     = (s, a) => ToggleStar(),
            });

            AddElement(_lblStarCount = new HUDLabel(4)
            {
                Alignment        = HUDAlignment.CENTER,
                RelativePosition = new FPoint(0, 4),
                Size             = new FSize(4 * TW, 4 * TW),

                TextAlignment = HUDAlignment.CENTER,
                Text          = LevelMeta.Stars.ToString(),
                TextColor     = FlatColors.Foreground,
                Font          = Textures.HUDFontBold,
                FontSize      = 48,
            });

            #endregion

            #region Footer

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

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

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Nephritis),
            });

            AddElement(new HUDRectangle(1)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 2f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.PeterRiver),
            });

            AddElement(new HUDRectangle(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, FOOTER_HEIGHT - FOOTER_COLBAR_HEIGHT),
                Size             = new FSize(WIDTH / 3f, FOOTER_COLBAR_HEIGHT),

                Definition = HUDBackgroundDefinition.CreateSimple(FlatColors.Pomegranate),
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDSeperator(HUDOrientation.Vertical, 3)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(WIDTH / 3f, 0),
                Size             = new FSize(1, FOOTER_HEIGHT),

                Color = FlatColors.SeperatorHUD,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_AUTHOR,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_POINTS,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(LabelTimeHeader = new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 77),
                Size             = new FSize(WIDTH / 3f, 40),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                L10NText      = L10NImpl.STR_HSP_TIME_NOW,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontRegular,
                FontSize      = 35,
            });

            AddElement(new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMLEFT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = LevelMeta.Username ?? "Unknown",
                WordWrap      = HUDWordWrap.Ellipsis,
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,

                AutoFontSizeShrink = true,
            });

            AddElement(new HUDIncrementIndicatorLabel(MainGame.Inst.Profile.ScoreSCCM.ToString(), _scoreGain == 0 ? "" : "+" + _scoreGain, 2)
            {
                Alignment        = HUDAlignment.BOTTOMCENTER,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            AddElement(LabelTimeValue = new HUDLabel(2)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(0, 15),
                Size             = new FSize(WIDTH / 3f, 60),

                Text          = TimeExtension.FormatMilliseconds(PersonalTimes[(int)SelectedDifficulty] ?? -1, false),
                TextAlignment = HUDAlignment.BOTTOMCENTER,
                TextColor     = FlatColors.TextHUD,
                Font          = Textures.HUDFontBold,
                FontSize      = 57,
            });

            #endregion

            AddOperation(new HUDSCCMScorePanelTimeDisplayOperation());
            UpdateTDMLabels();
        }