From 5c546fd1d45cb50dddc02c753d4619f2a0913393 Mon Sep 17 00:00:00 2001 From: Robert <43491258+lyzrds@users.noreply.github.com> Date: Fri, 15 Feb 2019 16:17:58 -0600 Subject: [PATCH] Add support for third floor timer to Raids plugin (Challenge Mode) (#7871) --- .../client/plugins/raids/RaidsPlugin.java | 2 +- .../client/plugins/raids/RaidsTimer.java | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index 72a386f5c7..d0c0d7c16c 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -236,7 +236,7 @@ public class RaidsPlugin extends Plugin { if (timer != null) { - timer.timeFloor(); + timer.timeOlm(); timer.setStopped(true); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsTimer.java index 8b40b09e10..8df3087054 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsTimer.java @@ -41,6 +41,7 @@ public class RaidsTimer extends InfoBox private LocalTime time; private LocalTime firstFloorTime; private LocalTime secondFloorTime; + private LocalTime thirdFloorTime; private LocalTime olmTime; @Setter @@ -66,14 +67,20 @@ public class RaidsTimer extends InfoBox { secondFloorTime = LocalTime.ofSecondOfDay(elapsed.getSeconds()); } - else if (olmTime == null) + else if (thirdFloorTime == null) { - olmTime = LocalTime.ofSecondOfDay(elapsed.getSeconds()); + thirdFloorTime = LocalTime.ofSecondOfDay(elapsed.getSeconds()); } floorTime = Instant.now(); } + public void timeOlm() + { + Duration elapsed = Duration.between(floorTime, Instant.now()); + olmTime = LocalTime.ofSecondOfDay(elapsed.getSeconds()); + } + @Override public String getText() { @@ -126,6 +133,12 @@ public class RaidsTimer extends InfoBox builder.append(secondFloorTime.format(DateTimeFormatter.ofPattern("mm:ss"))); } + if (thirdFloorTime != null) + { + builder.append("
Third floor: "); + builder.append(thirdFloorTime.format(DateTimeFormatter.ofPattern("mm:ss"))); + } + if (olmTime != null) { builder.append("
Olm: ");