Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qubqub committed Sep 9, 2023
1 parent ed95908 commit 3ce566a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Controls/TransparentLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
9 changes: 4 additions & 5 deletions Views/Overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,21 @@ 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;
this.lblPlayersSwitch.DrawVisible = false;
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) {
Expand Down Expand Up @@ -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")} :";
Expand Down

0 comments on commit 3ce566a

Please sign in to comment.