diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java index 2015415b0..370254665 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/GUIConfig.java @@ -60,6 +60,11 @@ public class GUIConfig { public boolean realTime = false; @Expose + @ConfigOption(name = "Real Time 12h Format", desc = "Display the current computer time in 12hr Format rather than 24h Format.") + @ConfigEditorBoolean + public boolean realTimeFormatToggle = false; + + @Expose public Position realTimePosition = new Position(10, 10, false, true); @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt index 4f23411a0..6e6aa029f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt @@ -20,7 +20,8 @@ class TimeFeatures { private val config get() = SkyHanniMod.feature.gui private val winterConfig get() = SkyHanniMod.feature.event.winter - private val format = SimpleDateFormat("HH:mm:ss") + private val timeFormat24h = SimpleDateFormat("HH:mm:ss") + private val timeFormat12h = SimpleDateFormat("hh:mm:ss a") private val startOfNextYear = RecalculatingValue(1.seconds) { SkyBlockTime(year = SkyBlockTime.now().year + 1).asTimeMark() @@ -31,7 +32,8 @@ class TimeFeatures { if (!LorenzUtils.inSkyBlock) return if (config.realTime) { - config.realTimePosition.renderString(format.format(System.currentTimeMillis()), posLabel = "Real Time") + val currentTime = (if (config.realTimeFormatToggle) timeFormat12h else timeFormat24h).format(System.currentTimeMillis()) + config.realTimePosition.renderString(currentTime, posLabel = "Real Time") } if (winterConfig.islandCloseTime && IslandType.WINTER.isInIsland()) { |