diff options
Diffstat (limited to 'Penguloon/Levels/LevelBase.cs')
| -rw-r--r-- | Penguloon/Levels/LevelBase.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Penguloon/Levels/LevelBase.cs b/Penguloon/Levels/LevelBase.cs index f2d8234..933b817 100644 --- a/Penguloon/Levels/LevelBase.cs +++ b/Penguloon/Levels/LevelBase.cs @@ -74,10 +74,15 @@ namespace Penguloon.Levels string time = ""; - if (!Finished) - time = (DateTime.Now - StartDate).ToString("hh':'mm':'ss"); - else - time = (EndDate - StartDate).ToString("hh':'mm':'ss"); + TimeSpan span = (DateTime.Now - StartDate); + if (Finished) + span = (EndDate - StartDate); + + string format = "mm':'ss"; + if (span.TotalHours > 1) + format = "hh':'mm':'ss"; + + time = span.ToString(format); ParentScene.DrawText(ContentManager.GetFont("Fonts/GWENT/36"), time, new Vector2(10, StaticUIValues.ScreenViewport.Y - ContentManager.GetFont("Fonts/GWENT/36").MeasureString("XD").Y - 10), new Vector2(), TextAllignment.LeftTop, Color.White, Color.Black, 2); |
