From 3ce566ac3c09d3b90d9909306b9416bf7b05fc93 Mon Sep 17 00:00:00 2001 From: eunma Date: Sat, 9 Sep 2023 18:21:28 +0900 Subject: [PATCH] Bug fix --- Controls/TransparentLabel.cs | 3 ++- Views/Overlay.cs | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Controls/TransparentLabel.cs b/Controls/TransparentLabel.cs index 1f6bb2640..8e2d90f02 100644 --- a/Controls/TransparentLabel.cs +++ b/Controls/TransparentLabel.cs @@ -31,6 +31,7 @@ public TransparentLabel() { public Image RoundIcon { get; set; } public bool UseShareCode { get; set; } public int SecondProgress { get; set; } + public int SecondProgressLines { get; set; } public void Draw(Graphics g) { if (!this.DrawVisible) { return; } if (this.PlatformIcon != null) { @@ -86,7 +87,7 @@ public void Draw(Graphics g) { if (!string.IsNullOrEmpty(this.Text)) { if (this.Name.Equals("lblPlayers")) { - if (this.SecondProgress > 0) this.FillRoundedRectangleF(g, new Pen(this.GetComplementaryColor(brFore.Color, 127)), new SolidBrush(this.GetComplementaryColor(brFore.Color, 127)), this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width * this.SecondProgress / 60f, this.ClientRectangle.Height * 2 - 1, 4f); + if (this.SecondProgress > 0 && this.SecondProgressLines > 0) this.FillRoundedRectangleF(g, new Pen(this.GetComplementaryColor(brFore.Color, 127)), new SolidBrush(this.GetComplementaryColor(brFore.Color, 127)), this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width * this.SecondProgress / 60f, this.ClientRectangle.Height * this.SecondProgressLines, 4f); } this.DrawOutlineText(g, this.ClientRectangle, null, brFore, this.Font.FontFamily, this.Font.Style, this.Font.Size * this.GetFontSizeFactor(), this.Text, stringFormat); } diff --git a/Views/Overlay.cs b/Views/Overlay.cs index 6c8636847..ccb6fd06f 100644 --- a/Views/Overlay.cs +++ b/Views/Overlay.cs @@ -619,7 +619,7 @@ private void SetFastestLabel(StatSummary levelInfo, LevelType type) { } } private void SetPlayersLabel() { - if (!Stats.IsPrePlaying) { + if (!Stats.IsPrePlaying && !this.StatsForm.CurrentSettings.HideRoundInfo) { this.lblPlayers.Image = null; this.lblPlayersPs.DrawVisible = false; this.lblPlayersXbox.DrawVisible = false; @@ -627,11 +627,13 @@ private void SetPlayersLabel() { this.lblPlayersPc.DrawVisible = false; this.lblCountryIcon.DrawVisible = false; this.lblPingIcon.DrawVisible = false; + this.lblPlayers.SecondProgressLines = this.StatsForm.CurrentSettings.HideRoundInfo ? 0 : this.StatsForm.CurrentSettings.HideTimeInfo ? 1 : 2; this.lblPlayers.SecondProgress = DateTime.Now.Second; this.lblPlayers.Text = $"{Multilingual.GetWord("overlay_current_time")} :"; //this.lblPlayers.Text = $@"{DateTime.Now.ToString(Multilingual.GetWord("level_date_format"))}"; this.lblPlayers.TextRight = $"{DateTime.Now:HH\\:mm\\:ss}"; } else { + this.lblPlayers.SecondProgressLines = 0; this.lblPlayers.SecondProgress = 0; int playersSwitchCount = this.switchCount; if (!this.StatsForm.CurrentSettings.SwitchBetweenPlayers) { @@ -881,13 +883,10 @@ private void UpdateInfo() { this.lastRound.CreativeTimeLimitSeconds = this.StatsForm.GetTimeLimitSecondsFromShareCode(this.lastRound.ShowNameId, levelType); } - if (!Stats.IsPrePlaying) { - this.lblDuration.SecondProgress = DateTime.Now.Second; + if (!Stats.IsPrePlaying && !this.StatsForm.CurrentSettings.HideRoundInfo) { this.lblDuration.Text = ""; this.lblDuration.TextRight = $@"{DateTime.Now.ToString(Multilingual.GetWord("level_date_format"))}"; } else { - this.lblPlayers.SecondProgress = 0; - if (this.lastRound.UseShareCode) { this.lblDuration.Text = this.lastRound.CreativeTimeLimitSeconds > 0 ? $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds):m\\:ss}) :" : $"{Multilingual.GetWord("overlay_duration")} :";