protected override void OnDraw(IBatchRenderer sbatch) { Color col; float alpha = 1; if (_diff == FractionDifficulty.NEUTRAL) { if (_spawnPercentage >= 1) { alpha = 1 - (_movementTime * SPEED / (_pipe.Length / 2)); } col = FlatColors.Asbestos; } else { col = FractionDifficultyHelper.GetColor(_diff); } if (alpha < 0) { return; } sbatch.DrawCentered(Textures.TexParticle[14], Position, DIAMETER * _spawnPercentage, DIAMETER * _spawnPercentage, col * alpha); }
public HUDDifficultyButton(int depth, FractionDifficulty diff, HUDDifficultyButtonMode mode) { Depth = depth; difficulty = diff; icon = FractionDifficultyHelper.GetIcon(diff); switch (mode) { case HUDDifficultyButtonMode.DEACTIVATED: BackgroundColor = FlatColors.ButtonHUD; ForegroundColor = FlatColors.BackgroundHUD; break; case HUDDifficultyButtonMode.UNLOCKANIMATION: BackgroundColor = FlatColors.ButtonHUD; ForegroundColor = FractionDifficultyHelper.GetColor(diff); AddHUDOperation(new HUDDifficultyButtonGainOperation()); AddHUDOperation(new HUDDifficultyButtonBlinkingIconOperation()); break; case HUDDifficultyButtonMode.ACTIVATED: BackgroundColor = FlatColors.BackgroundHUD2; ForegroundColor = FractionDifficultyHelper.GetColor(diff); AddHUDOperation(new HUDDifficultyButtonBlinkingIconOperation()); break; default: SAMLog.Error("HDB::EnumSwitch_CTR", "value: " + mode); break; } }
private void StartDownload() { _btnPlay0.ImageRotation = 0f; _btnPlay0.ImageRotationSpeed = 0.25f; _btnPlay0.Image = Textures.CannonCogBig; _btnPlay0.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0); _btnPlay0.ImagePadding = 8; _btnPlay1.ImageRotation = 0f; _btnPlay1.ImageRotationSpeed = 0.25f; _btnPlay1.Image = Textures.CannonCogBig; _btnPlay1.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1); _btnPlay1.ImagePadding = 8; _btnPlay2.ImageRotation = 0f; _btnPlay2.ImageRotationSpeed = 0.25f; _btnPlay2.Image = Textures.CannonCogBig; _btnPlay2.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2); _btnPlay2.ImagePadding = 8; _btnPlay3.ImageRotation = 0f; _btnPlay3.ImageRotationSpeed = 0.25f; _btnPlay3.Image = Textures.CannonCogBig; _btnPlay3.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3); _btnPlay3.ImagePadding = 8; StartDownloadLevel().RunAsync(); _downloadState = DownloadState.Downloading; }
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); }
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); }
private void OnDownloadSuccess() { _downloadState = DownloadState.Finished; AddOperationDelayed(new SingleLambdaOperation <SCCMLevelPreviewDialog>("FinishButton0", e => { _btnPlay0.ImageRotation = 0f; _btnPlay0.ImageRotationSpeed = 0f; _btnPlay0.Image = Textures.TexDifficultyLine0; _btnPlay0.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0); _btnPlay0.ImagePadding = 8; }), 0 * 0.150f); AddOperationDelayed(new SingleLambdaOperation <SCCMLevelPreviewDialog>("FinishButton1", e => { _btnPlay1.ImageRotation = 0f; _btnPlay1.ImageRotationSpeed = 0f; _btnPlay1.Image = Textures.TexDifficultyLine1; _btnPlay1.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1); _btnPlay1.ImagePadding = 8; }), 1 * 0.150f); AddOperationDelayed(new SingleLambdaOperation <SCCMLevelPreviewDialog>("FinishButton2", e => { _btnPlay2.ImageRotation = 0f; _btnPlay2.ImageRotationSpeed = 0f; _btnPlay2.Image = Textures.TexDifficultyLine2; _btnPlay2.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2); _btnPlay2.ImagePadding = 8; }), 2 * 0.150f); AddOperationDelayed(new SingleLambdaOperation <SCCMLevelPreviewDialog>("FinishButton3", e => { _btnPlay3.ImageRotation = 0f; _btnPlay3.ImageRotationSpeed = 0f; _btnPlay3.Image = Textures.TexDifficultyLine3; _btnPlay3.ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3); _btnPlay3.ImagePadding = 8; }), 3 * 0.150f); }
public override void OnInitialize() { #region Header AddElement(new HUDRectangle(-99) { Alignment = HUDAlignment.TOPCENTER, RelativePosition = FPoint.Zero, Size = new FSize(WIDTH, 1.40f * TW), Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD.Darken(0.9f), 16, true, true, false, false), }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTER, Alignment = HUDAlignment.TOPCENTER, RelativePosition = new FPoint(0, 0), Size = new FSize(WIDTH, 1.40f * TW), Font = Textures.HUDFontBold, FontSize = TW, Text = _meta?.LevelName ?? _blueprint.FullName, WordWrap = HUDWordWrap.Ellipsis, TextColor = Color.White, }); var starred = MainGame.Inst.Profile.HasCustomLevelStarred(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID); var mylevel = ((_meta?.UserID ?? _blueprint.CustomMeta_UserID) == MainGame.Inst.Profile.OnlineUserID); AddElement(_btnStar = new HUDEllipseImageButton { Alignment = HUDAlignment.TOPRIGHT, RelativePosition = new FPoint(0, 0), Size = new FSize(64, 64), Image = Textures.TexIconStar, BackgroundNormal = Color.Transparent, BackgroundPressed = FlatColors.ButtonPressedHUD, ImageColor = (starred || mylevel) ? FlatColors.SunFlower : FlatColors.Silver, ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, Click = (s, a) => ToggleStar(), IsEnabled = ((_meta?.UserID ?? _blueprint.CustomMeta_UserID) != MainGame.Inst.Profile.OnlineUserID) && (MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID)), }); AddElement(_lblStar = new HUDLabel { Alignment = HUDAlignment.TOPRIGHT, RelativePosition = new FPoint(0, 55), Size = new FSize(64, 32), Font = Textures.HUDFontRegular, FontSize = 24, Text = (_meta == null) ? "?" : _meta.Stars.ToString(), WordWrap = HUDWordWrap.NoWrap, TextColor = (starred || mylevel) ? FlatColors.SunFlower : FlatColors.Silver, TextAlignment = HUDAlignment.TOPCENTER, }); #endregion #region Tab Header AddElement(new HUDLabel { TextAlignment = HUDAlignment.BOTTOMLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(1 * TW, 1 * TW), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontBold, FontSize = 32, L10NText = L10NImpl.STR_INF_YOU, WordWrap = HUDWordWrap.Ellipsis, TextColor = FlatColors.Clouds, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.BOTTOMLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(4 * TW, 1 * TW), Size = new FSize(6 * TW, TW), Font = Textures.HUDFontBold, FontSize = 32, L10NText = L10NImpl.STR_INF_HIGHSCORE, WordWrap = HUDWordWrap.Ellipsis, TextColor = FlatColors.Clouds, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.BOTTOMLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(10 * TW, 1 * TW), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontBold, FontSize = 32, L10NText = L10NImpl.STR_INF_CLEARS, WordWrap = HUDWordWrap.Ellipsis, TextColor = FlatColors.Clouds, }); #endregion #region Tab Col Images AddElement(new HUDImage { Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(8, 2 * TW + 16 + (48 + 16) * 0 + 8), Size = new FSize(48, 48), Image = Textures.TexDifficultyLine0, Color = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0) : FlatColors.Silver, ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, }); AddElement(new HUDImage { Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(8, 2 * TW + 16 + (48 + 16) * 1 + 8), Size = new FSize(48, 48), Image = Textures.TexDifficultyLine1, Color = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1) : FlatColors.Silver, ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, }); AddElement(new HUDImage { Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(8, 2 * TW + 16 + (48 + 16) * 2 + 8), Size = new FSize(48, 48), Image = Textures.TexDifficultyLine2, Color = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2) : FlatColors.Silver, ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, }); AddElement(new HUDImage { Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(8, 2 * TW + 16 + (48 + 16) * 3 + 8), Size = new FSize(48, 48), Image = Textures.TexDifficultyLine3, Color = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3) : FlatColors.Silver, ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, }); #endregion #region Tab Col 1 AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(1 * TW, 2 * TW + 16 + (48 + 16) * 0), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = MainGame.Inst.Profile.GetCustomLevelTimeString(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_0), WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(1 * TW, 2 * TW + 16 + (48 + 16) * 1), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = MainGame.Inst.Profile.GetCustomLevelTimeString(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_1), WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(1 * TW, 2 * TW + 16 + (48 + 16) * 2), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = MainGame.Inst.Profile.GetCustomLevelTimeString(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_2), WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(1 * TW, 2 * TW + 16 + (48 + 16) * 3), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = MainGame.Inst.Profile.GetCustomLevelTimeString(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_3), WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3) : FlatColors.TextHUD, }); #endregion #region Tab Col 2 AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(4 * TW, 2 * TW + 16 + (48 + 16) * 0), Size = new FSize(6 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_0].FormatHighscoreCell() ?? "", WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(4 * TW, 2 * TW + 16 + (48 + 16) * 1), Size = new FSize(6 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_1].FormatHighscoreCell() ?? "", WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(4 * TW, 2 * TW + 16 + (48 + 16) * 2), Size = new FSize(6 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_2].FormatHighscoreCell() ?? "", WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(4 * TW, 2 * TW + 16 + (48 + 16) * 3), Size = new FSize(6 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_3].FormatHighscoreCell() ?? "", WordWrap = HUDWordWrap.Ellipsis, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3) : FlatColors.TextHUD, }); #endregion #region Tab Col 3 AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(10 * TW, 2 * TW + 16 + (48 + 16) * 0), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_0].FormatGlobalClearsCell() ?? "", WordWrap = HUDWordWrap.NoWrap, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_0) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(10 * TW, 2 * TW + 16 + (48 + 16) * 1), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_1].FormatGlobalClearsCell() ?? "", WordWrap = HUDWordWrap.NoWrap, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_1) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(10 * TW, 2 * TW + 16 + (48 + 16) * 2), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_2].FormatGlobalClearsCell() ?? "", WordWrap = HUDWordWrap.NoWrap, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_2) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2) : FlatColors.TextHUD, }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.CENTERLEFT, Alignment = HUDAlignment.TOPLEFT, RelativePosition = new FPoint(10 * TW, 2 * TW + 16 + (48 + 16) * 3), Size = new FSize(3 * TW, TW), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Highscores[(int)FractionDifficulty.DIFF_3].FormatGlobalClearsCell() ?? "", WordWrap = HUDWordWrap.NoWrap, TextColor = MainGame.Inst.Profile.HasCustomLevelBeaten(_meta?.OnlineID ?? _blueprint.CustomMeta_LevelID, FractionDifficulty.DIFF_3) ? FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3) : FlatColors.TextHUD, }); #endregion #region Footer AddElement(new HUDRectangle { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = FPoint.Zero, Size = new FSize(WIDTH, 1.5f * TW), Definition = HUDBackgroundDefinition.CreateRounded(FlatColors.BackgroundHUD2, 16, false, false, true, true), }); AddElement(new HUDSeperator(HUDOrientation.Horizontal, 3) { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = new FPoint(0, 1.5f * TW), Size = new FSize(WIDTH, HUD.PixelWidth), Color = FlatColors.SeperatorHUD, }); AddElement(_btnPlay0 = new HUDEllipseImageButton { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = new FPoint(-84 / 2 - 16 - 84 - 32, 6), Size = new FSize(84, 84), Image = Textures.TexDifficultyLine0, BackgroundNormal = FlatColors.ButtonHUD, BackgroundPressed = FlatColors.ButtonPressedHUD, ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_0), ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, Click = (s, a) => Play(FractionDifficulty.DIFF_0), }); AddElement(_btnPlay1 = new HUDEllipseImageButton { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = new FPoint(-84 / 2 - 16, 6), Size = new FSize(84, 84), Image = Textures.TexDifficultyLine1, BackgroundNormal = FlatColors.ButtonHUD, BackgroundPressed = FlatColors.ButtonPressedHUD, ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_1), ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, Click = (s, a) => Play(FractionDifficulty.DIFF_1), }); AddElement(_btnPlay2 = new HUDEllipseImageButton { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = new FPoint(+84 / 2 + 16, 6), Size = new FSize(84, 84), Image = Textures.TexDifficultyLine2, BackgroundNormal = FlatColors.ButtonHUD, BackgroundPressed = FlatColors.ButtonPressedHUD, ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_2), ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, Click = (s, a) => Play(FractionDifficulty.DIFF_2), }); AddElement(_btnPlay3 = new HUDEllipseImageButton { Alignment = HUDAlignment.BOTTOMCENTER, RelativePosition = new FPoint(+84 / 2 + 16 + 84 + 32, 6), Size = new FSize(84, 84), Image = Textures.TexDifficultyLine3, BackgroundNormal = FlatColors.ButtonHUD, BackgroundPressed = FlatColors.ButtonPressedHUD, ImageColor = FractionDifficultyHelper.GetColor(FractionDifficulty.DIFF_3), ImageAlignment = HUDImageAlignmentAlgorithm.CENTER, ImageScale = HUDImageScaleAlgorithm.STRETCH, Click = (s, a) => Play(FractionDifficulty.DIFF_3), }); AddElement(new HUDLabel { TextAlignment = HUDAlignment.BOTTOMRIGHT, Alignment = HUDAlignment.BOTTOMRIGHT, RelativePosition = new FPoint(4, 4), Size = new FSize(236, 32), Font = Textures.HUDFontRegular, FontSize = 32, Text = _meta?.Username ?? "???", WordWrap = HUDWordWrap.Ellipsis, TextColor = FlatColors.GreenSea, }); #endregion if (_blueprint == null && _meta != null) { StartDownload(); } else if (_blueprint != null && _meta == null) { StartMetaUpdate(); } else if (_blueprint != null && _meta != null) { _downloadState = DownloadState.Finished; } else { SAMLog.Error("SCCMLPD::EnumSwitch_OI", $"_blueprint: '{_blueprint}' | _meta = '{_meta}'"); } }