forked from SteamWar/SteamWar
Improve color gradient
This commit is contained in:
@@ -63,8 +63,12 @@ public class CheckCommand extends SWCommand {
|
|||||||
|
|
||||||
public static Message getWaitTime(SchematicNode schematic) {
|
public static Message getWaitTime(SchematicNode schematic) {
|
||||||
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
|
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
|
||||||
String ce = waitedMillis > 86400000 ? "c" : "e";
|
String color;
|
||||||
String color = waitedMillis > 14400000 ? ce : "a";
|
if (waitedMillis > 48L * 60 * 60 * 1000) color = "4";
|
||||||
|
else if (waitedMillis > 24L * 60 * 60 * 1000) color = "c";
|
||||||
|
else if (waitedMillis > 12L * 60 * 60 * 1000) color = "6";
|
||||||
|
else if (waitedMillis > 4L * 60 * 60 * 1000) color = "e";
|
||||||
|
else color = "a";
|
||||||
long hours = waitedMillis / 3600000;
|
long hours = waitedMillis / 3600000;
|
||||||
long minutes = (waitedMillis - hours * 3600000) / 60000;
|
long minutes = (waitedMillis - hours * 3600000) / 60000;
|
||||||
return new Message("CHECK_LIST_WAIT", color, hours, (minutes < 10) ? "0" + minutes : minutes);
|
return new Message("CHECK_LIST_WAIT", color, hours, (minutes < 10) ? "0" + minutes : minutes);
|
||||||
|
|||||||
Reference in New Issue
Block a user