diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-18 11:04:53 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-18 11:04:53 +0100 |
| commit | 2cb22a74aed80e2cce68f16b0821a690c7c05b7a (patch) | |
| tree | 6a7a254662ebf795358d971f271e7a7f41484bb6 /Penguloon/Levels/LevelBase.cs | |
| parent | aa6972a5d052d1f57dfda3dadb79fcd5d8ded30b (diff) | |
new levels, auto round start
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); |
