Esempio n. 1
0
        public HUDDifficultyButton(int depth, FractionDifficulty diff, HUDDifficultyButtonMode mode, Action a)
        {
            Depth      = depth;
            difficulty = diff;

            icon   = FractionDifficultyHelper.GetIcon(diff);
            action = a;

            switch (mode)
            {
            case HUDDifficultyButtonMode.DEACTIVATED:
                BackgroundColor = FlatColors.ButtonHUD;
                ForegroundColor = FlatColors.BackgroundHUD;
                break;

            case HUDDifficultyButtonMode.UNLOCKANIMATION:
                BackgroundColor = FlatColors.ButtonHUD;
                ForegroundColor = FlatColors.SunFlower;
                AddOperation(new HUDDifficultyButtonGainOperation());
                AddOperation(new HUDDifficultyButtonBlinkingIconOperation());
                break;

            case HUDDifficultyButtonMode.ACTIVATED:
                BackgroundColor = FlatColors.BackgroundHUD2;
                ForegroundColor = FlatColors.SunFlower;
                AddOperation(new HUDDifficultyButtonBlinkingIconOperation());
                break;

            default:
                SAMLog.Error("HDB::EnumSwitch_CTR", "value: " + mode);
                break;
            }
        }
        public EnhancedHUDDifficultyButton(int depth, FractionDifficulty diff, Action a)
        {
            Depth = depth;

            icon   = FractionDifficultyHelper.GetIcon(diff);
            action = a;
        }
Esempio n. 3
0
        private void DrawInfoLine(IBatchRenderer sbatch, FractionDifficulty d, int idx, string strTime, bool colorize)
        {
            var p1 = Position + new Vector2(32, HEADER_HEIGHT + 40 + 56 * idx);
            var p2 = Position + new Vector2(64, HEADER_HEIGHT + 40 + 56 * idx);
            var p3 = Position + new Vector2(224, HEADER_HEIGHT + 40 + 56 * idx);

            var ic = (node.LevelData.HasCompletedOrBetter(d) ? FractionDifficultyHelper.GetColor(d) : FlatColors.Concrete) * progressDisplay;
            var tc = (node.LevelData.HasCompletedOrBetter(d) ? FlatColors.TextHUD : FlatColors.Asbestos) * progressDisplay;

            if (colorize && node.LevelData.Data[d].GlobalBestUserID >= 0 && node.LevelData.Data[d].GlobalBestUserID == MainGame.Inst.Profile.OnlineUserID)
            {
                tc = FlatColors.SunFlower * progressDisplay;
            }

            sbatch.DrawCentered(Textures.TexCircle, p1, 48, 48, FlatColors.WetAsphalt * progressDisplay);
            sbatch.DrawCentered(FractionDifficultyHelper.GetIcon(d), p1, 32, 32, ic);
            FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontRegular, 32, FractionDifficultyHelper.GetDescription(d), tc, p2);
            FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontRegular, 32, strTime, tc, p3);
        }
Esempio n. 4
0
        protected override void DoDraw(IBatchRenderer sbatch, FRectangle bounds)
        {
            var bottomrect = bounds.ToSubRectangleSouth(25);

            {             // background
                SimpleRenderHelper.DrawSimpleRect(sbatch, bounds, FlatColors.Clouds);
                SimpleRenderHelper.DrawSimpleRect(sbatch, bottomrect, FlatColors.Concrete);
            }

            {             // difficulty
                var tex = (PersonalBest == null) ? Textures.TexDifficultyLineNone : FractionDifficultyHelper.GetIcon(PersonalBest.Value);
                var col = (PersonalBest == null) ? FlatColors.Silver : FractionDifficultyHelper.GetColor(PersonalBest.Value);
                sbatch.DrawCentered(tex, new FPoint(bounds.Left + 5 + 16, bounds.Top + (Height - 25 - 32) / 2 + 16), 32, 32, col);
            }

            {             // name
                FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 32, _meta.LevelName, FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5, bounds.Top + (bounds.Height - 25) / 2));
            }

            {             // user
                sbatch.DrawCentered(Textures.TexHUDIconGenericUser, new FPoint(bottomrect.Left + 5 + 32 + 5, bottomrect.CenterY), 20, 20, FlatColors.WetAsphalt);
                FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 20, _meta.Username ?? "Unknown", FlatColors.Foreground, new FPoint(bounds.Left + 5 + 32 + 5 + 16, bounds.Bottom - 12.5f));
            }


            if (_meta.GridSize != SCCMLevelData.SIZES[0])             // [XL] marker
            {
                var rr = bounds.ToSubRectangleSouthWest(32, 20);
                SimpleRenderHelper.DrawSimpleRect(sbatch, rr, FlatColors.Amethyst);
                FontRenderHelper.DrawSingleLineInBox(sbatch, Textures.HUDFontRegular, "XL", rr, 0, true, FlatColors.Foreground);
            }

            {             // star counter
                var pointPos = new FPoint(bottomrect.Right - 100, bottomrect.CenterY);
                sbatch.DrawCentered(Textures.TexIconStar, pointPos, 20, 20, FlatColors.SunFlower);
                FontRenderHelper.DrawTextVerticallyCentered(sbatch, Textures.HUDFontBold, 24, _meta.Stars.ToString(), FlatColors.MidnightBlue, pointPos + new Vector2(16, 0));
            }

            SimpleRenderHelper.DrawSimpleRectOutline(sbatch, bounds, HUD.PixelWidth, Color.Black);
        }