Skip to content

Commit

Permalink
Reduce repeated label code
Browse files Browse the repository at this point in the history
  • Loading branch information
clubby789 committed Sep 20, 2020
1 parent f4854ef commit d2c9f15
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions ClockLib/OWClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,8 @@ private void OnGUI()
style.normal.textColor = Color.white;
style.font = hudFont;
style.fontSize = 30;
if (CountUp)
{
GUI.Label(new Rect(xPos, yPos, 200f, 60f), string.Concat(new object[]
{
"Time Elapsed: ",
ParseTime(elapsed)
}), style) ;
}
else
{
float remaining = TimeLoop.GetSecondsRemaining();
GUI.Label(new Rect(xPos, yPos, 200f, 60f), string.Concat(new object[]
{
"Time Remaining: ",
ParseTime(remaining)
}), style) ;
}
string timestamp = CountUp ? "Time Elapsed: " + ParseTime(elapsed) : "Time Remaining: " + ParseTime(TimeLoop.GetSecondsRemaining());
GUI.Label(new Rect(xPos, yPos, 200f, 60f), timestamp, style) ;
int count = 0;
style.fontSize = 20;
foreach (TimeEvent timeEvent in Save.eventList)
Expand Down

0 comments on commit d2c9f15

Please sign in to comment.