Skip to content

Commit

Permalink
Add countdown mode to events system
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Sep 20, 2020
1 parent f52e3b1 commit f4854ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions ClockLib/OWClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void OnGUI()
}
Resolution currentRes = Screen.currentResolution;
float yPos = currentRes.height - 60f;
float xPos = currentRes.width * 4/5;
float xPos = currentRes.width * 4/5 - 20f;
float elapsed = TimeLoop.GetSecondsElapsed();
if (elapsed < 1f)
{
Expand Down Expand Up @@ -101,9 +101,17 @@ private void OnGUI()
style.normal.textColor = Color.Lerp(Color.red, Color.white, scaleFactor);
count++;
yPos -= 20;
string timestring;
if (CountUp)
{
timestring = ParseTime(timeEvent.Timestamp);
} else
{
timestring = ParseTime(timeEvent.Timestamp - elapsed);
}
GUI.Label(new Rect(xPos, yPos, 200f, 20f), string.Concat(new object[]
{
ParseTime(timeEvent.Timestamp),
timestring,
" - ",
timeEvent.Name
}), style);
Expand Down
2 changes: 1 addition & 1 deletion ClockLib/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"filename": "Clock.dll",
"author": "clubby789",
"name": "Clock",
"uniqueName": "OWClock",
"uniqueName": "clubby789.OWClock",
"description": "Add a clock overlay",
"version": "0.1.0",
"owmlVersion": "0.7.3"
Expand Down

0 comments on commit f4854ef

Please sign in to comment.