Ejemplo n.º 1
0
        private void OnClickFinishPrev(HUDTextButton sender, HUDButtonEventArgs args)
        {
            if (_unlockWorldNumber == 0)
            {
                MainGame.Inst.SetTutorialLevelScreen();
                return;
            }

            int missPoints = UnlockManager.PointsForUnlock(_id) - MainGame.Inst.Profile.TotalPoints;

            HUD.ShowToast("WPP::HINT", L10N.TF(L10NImpl.STR_PREV_MISS_TOAST, missPoints, _worldNumber), 32, FlatColors.Orange, FlatColors.Foreground, 4f);

            MainGame.Inst.SetWorldMapScreenZoomedOut(Levels.WORLDS_BY_NUMBER[_unlockWorldNumber]);
        }
Ejemplo n.º 2
0
        public override void OnInitialize()
        {
            base.OnInitialize();

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

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

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

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

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

                Click = OnClickBuy,
            });

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

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

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

                Click = OnClickFinishPrev,
            });

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

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

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

                Image = Textures.TexIconScore,
            });

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

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