Added Render Time and Time Left display to GuiVideoRenderer

This commit is contained in:
CrushedPixel
2015-06-01 16:31:17 +02:00
parent 5f4cddcfbc
commit a2da85e9f0
3 changed files with 79 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
package eu.crushedpixel.replaymod.utils;
public class DurationUtils {
public static String convertSecondsToString(int seconds) {
int hours = seconds/(60*60);
int min = seconds/60 - hours*60;
int sec = seconds - ((min*60) + (hours*60*60));
StringBuilder builder = new StringBuilder();
if(hours > 0) builder.append(hours).append("h ");
if(min > 0 || hours > 0) builder.append(min).append("min ");
builder.append(sec).append("sec");
return builder.toString();
}
}