summaryrefslogtreecommitdiff
path: root/Penguloon/Levels/LevelBase.cs
diff options
context:
space:
mode:
authoraldrikboy <aldrikboy@gmail.com>2018-01-18 11:04:53 +0100
committeraldrikboy <aldrikboy@gmail.com>2018-01-18 11:04:53 +0100
commit2cb22a74aed80e2cce68f16b0821a690c7c05b7a (patch)
tree6a7a254662ebf795358d971f271e7a7f41484bb6 /Penguloon/Levels/LevelBase.cs
parentaa6972a5d052d1f57dfda3dadb79fcd5d8ded30b (diff)
new levels, auto round start
Diffstat (limited to 'Penguloon/Levels/LevelBase.cs')
-rw-r--r--Penguloon/Levels/LevelBase.cs13
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);