Skip to content

Commit

Permalink
Display the user creative map's time limit
Browse files Browse the repository at this point in the history
  • Loading branch information
qutrits committed Jun 30, 2023
1 parent d689862 commit 0e77f5b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Views/Overlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -867,14 +867,23 @@ private void UpdateInfo() {
if (this.lastRound.UseShareCode && this.lastRound.CreativeTimeLimitSeconds == 0) {
this.lastRound.CreativeTimeLimitSeconds = this.StatsForm.GetTimeLimitSecondsFromShareCode(this.lastRound.ShowNameId);
}
this.lblDuration.Text = this.lastRound.UseShareCode && this.lastRound.CreativeTimeLimitSeconds > 0
? $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds):m\\:ss}):"
: $"{Multilingual.GetWord("overlay_duration")} :";
// this.lblDuration.Text = this.lastRound.UseShareCode && this.lastRound.CreativeTimeLimitSeconds > 0
// ? $"{Multilingual.GetWord("overlay_duration")} ({TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds):m\\:ss}):"
// : $"{Multilingual.GetWord("overlay_duration")} :";

if (end != DateTime.MinValue) {
// if (this.lastRound.UseShareCode && this.lastRound.CreativeTimeLimitSeconds > 0) {
// this.lblDuration.TextRight = $"{TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds) - (end - start):m\\:ss\\.ff}";
// } else {
// this.lblDuration.TextRight = $"{end - start:m\\:ss\\.ff}";
// }
this.lblDuration.TextRight = $"{end - start:m\\:ss\\.ff}";
} else if (this.lastRound.Playing && Stats.IsPlaying) {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{DateTime.UtcNow - startTime:m\\:ss}" : $"{DateTime.UtcNow - start:m\\:ss}";
if (this.lastRound.UseShareCode && this.lastRound.CreativeTimeLimitSeconds > 0) {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds) - (DateTime.UtcNow - startTime):m\\:ss}" : $"{TimeSpan.FromSeconds(this.lastRound.CreativeTimeLimitSeconds) - (DateTime.UtcNow - start):m\\:ss}";
} else {
this.lblDuration.TextRight = start > DateTime.UtcNow ? $"{DateTime.UtcNow - startTime:m\\:ss}" : $"{DateTime.UtcNow - start:m\\:ss}";
}
} else {
this.lblDuration.TextRight = "-";
}
Expand Down

0 comments on commit 0e77f5b

Please sign in to comment.