示例#1
0
        public override void OnInitialize()
        {
            RelativePosition = new FPoint(GDConstants.TILE_WIDTH, 0);
            Size             = new FSize(HUD.Width - 6 * GDConstants.TILE_WIDTH, HUD.Height - 2 * GDConstants.TILE_WIDTH);
            Alignment        = HUDAlignment.CENTERLEFT;

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 0)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlID = new HUDLabel(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 0)),
                Size             = new FSize(512, 64),

                Text          = "000000000000",
                TextColor     = Color.Black,
                Font          = Textures.HUDFontRegular,
                FontSize      = 48,
                TextAlignment = HUDAlignment.CENTER,

                Background = HUDBackgroundDefinition.CreateSimpleOutline(Color.White, Color.Black, HUD.PixelWidth),
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 1)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlName = new HUDSimpleTextBox(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 1)),
                Size             = new FSize(512, 64),

                ColorText = Color.Black,
                Font      = Textures.HUDFontRegular,
                FontSize  = 48,

                MaxLength = SCCMLevelData.MaxNameLength,

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(Color.White, Color.Black, HUD.PixelWidth),
                BackgroundFocused = HUDBackgroundDefinition.CreateSimpleOutline(Color.White, Color.Black, HUD.PixelWidth),

                Changed = UpdateText,
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 2)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlSize = new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 2)),
                Size             = new FSize(512, 64),

                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 48,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonHUD, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonPressedHUD, Color.Black, HUD.PixelWidth),

                Click = ToggleSize,
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 3)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlView = new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 3)),
                Size             = new FSize(512, 64),

                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 48,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonHUD, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonPressedHUD, Color.Black, HUD.PixelWidth),

                Click = ToggleView,
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 4)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlGeometry = new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 4)),
                Size             = new FSize(512, 64),

                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 48,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonHUD, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonPressedHUD, Color.Black, HUD.PixelWidth),

                Click = ToggleGeometry,
            });

            AddElement(new HUDLabel(1)
            {
                TextAlignment    = HUDAlignment.CENTERLEFT,
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(32, 32 + (96 * 5)),
                Size             = new FSize(384, 64),

                Font     = Textures.HUDFontBold,
                FontSize = 64,

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

            AddElement(_ctrlMusic = new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.TOPLEFT,
                RelativePosition = new FPoint(416, 32 + (96 * 5)),
                Size             = new FSize(512, 64),

                TextColor     = Color.White,
                Font          = Textures.HUDFontRegular,
                FontSize      = 48,
                TextAlignment = HUDAlignment.CENTER,
                TextPadding   = 8,

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonHUD, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.ButtonPressedHUD, Color.Black, HUD.PixelWidth),

                Click = ToggleMusic,
            });

            //------

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24 + 384 + 24, 16 + 75 * 0),
                Size             = new FSize(384, 64),

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

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Pomegranate, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Alizarin, Color.Black, HUD.PixelWidth),

                Click = Abort,
            });

            AddElement(new HUDTextButton(1)
            {
                Alignment        = HUDAlignment.BOTTOMRIGHT,
                RelativePosition = new FPoint(24, 16 + 75 * 0),
                Size             = new FSize(384, 64),

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

                BackgroundNormal  = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Emerald, Color.Black, HUD.PixelWidth),
                BackgroundPressed = HUDBackgroundDefinition.CreateSimpleOutline(FlatColors.Nephritis, Color.Black, HUD.PixelWidth),

                Click = Close,
            });

            RefreshControls();
        }
        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,
            });
        }
示例#3
0
 private void UpdateText(HUDTextBox sender, EventArgs e)
 {
     _name = _ctrlName.Text;
 }
示例#4
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,
            });
        }