aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt7
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt5
3 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java
index e2c6dd6fa..0d61401ee 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/gui/customscoreboard/DisplayConfig.java
@@ -130,6 +130,11 @@ public class DisplayConfig {
public boolean skyblockTime24hFormat = false;
@Expose
+ @ConfigOption(name = "SkyBlock Time Exact Minutes", desc = "Display the exact minutes in the SkyBlock time, rather than only 10 minute increments.")
+ @ConfigEditorBoolean
+ public boolean skyblockTimeExactMinutes = true;
+
+ @Expose
@ConfigOption(name = "Line Spacing", desc = "The amount of space between each line.")
@ConfigEditorSlider(minValue = 0, maxValue = 20, minStep = 1)
public int lineSpacing = 10;
diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
index 5753a6fd6..a58a7efc4 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardElements.kt
@@ -577,7 +577,12 @@ private fun getTimeDisplayPair(): List<ScoreboardElementType> {
getGroupFromPattern(CustomScoreboard.activeLines, ScoreboardPattern.timePattern, "symbol") ?: ""
return listOf(
"ยง7" + SkyBlockTime.now()
- .formatted(dayAndMonthElement = false, yearElement = false, timeFormat24h = config.display.skyblockTime24hFormat) +
+ .formatted(
+ dayAndMonthElement = false,
+ yearElement = false,
+ timeFormat24h = config.display.skyblockTime24hFormat,
+ exactMinutes = config.display.skyblockTimeExactMinutes,
+ ) +
" $symbol" to HorizontalAlignment.LEFT,
)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
index 201c294e5..b31bb828b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
@@ -105,12 +105,15 @@ object TimeUtils {
yearElement: Boolean = true,
hoursAndMinutesElement: Boolean = true,
timeFormat24h: Boolean = false,
+ exactMinutes: Boolean = true,
): String {
val hour = if (timeFormat24h) this.hour else (this.hour + 11) % 12 + 1
val timeOfDay = if (!timeFormat24h) {
if (this.hour > 11) "pm" else "am"
} else ""
- val minute = this.minute.toString().padStart(2, '0')
+ val minute = this.minute.let {
+ if (exactMinutes) it else it - (it % 10)
+ }.toString().padStart(2, '0')
val month = SkyBlockTime.monthName(this.month)
val day = this.day
val daySuffix = SkyBlockTime.daySuffix(day)