aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github
diff options
context:
space:
mode:
authorMadeleaan <70163122+Madeleaan@users.noreply.github.com>2024-07-06 13:20:59 +0200
committerGitHub <noreply@github.com>2024-07-06 21:20:59 +1000
commitd6167228ce52a7793e4766ddf674727277073ca8 (patch)
tree0299ac42428a638c4d3ff668d313024c2ff7ac2a /src/main/java/io/github
parent289e2e4c2d5ddeca60dc604f9a0c725e07e17432 (diff)
downloadnotenoughupdates-d6167228ce52a7793e4766ddf674727277073ca8.tar.gz
notenoughupdates-d6167228ce52a7793e4766ddf674727277073ca8.tar.bz2
notenoughupdates-d6167228ce52a7793e4766ddf674727277073ca8.zip
Add english locale to event countdowns (#1220)
Diffstat (limited to 'src/main/java/io/github')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java15
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java10
2 files changed, 19 insertions, 6 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java
index aef92239..57095c9f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 NotEnoughUpdates contributors
+ * Copyright (C) 2022-2024 NotEnoughUpdates contributors
*
* This file is part of NotEnoughUpdates.
*
@@ -1699,11 +1699,16 @@ public class CalendarOverlay {
}
private List<String> addCountdownCalculatorToTooltip(long millis, List<String> tooltipToModify) {
- if (NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 1 || NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 2) {
+ if (NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 1 ||
+ NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 2) {
String formatString = "EEEE, MMM d h:mm a";
- if (NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 2) { formatString = "EEEE, MMM d HH:mm"; }
- tooltipToModify.add("§b" + DateTimeFormatter.ofPattern(formatString).format(ZonedDateTime.now().plusSeconds(((millis / 1000)))));
-
+ if (NotEnoughUpdates.INSTANCE.config.misc.showWhenCountdownEnds == 2) {
+ formatString = "EEEE, MMM d HH:mm";
+ }
+ DateTimeFormatter useFormatter = DateTimeFormatter.ofPattern(formatString);
+ if (NotEnoughUpdates.INSTANCE.config.misc.useEnglishCountdown)
+ useFormatter = useFormatter.withLocale(Locale.ENGLISH);
+ tooltipToModify.add("§b" + useFormatter.format(ZonedDateTime.now().plusSeconds(((millis / 1000)))));
}
return tooltipToModify;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
index 1f5c84ac..4889c3d1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Misc.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 NotEnoughUpdates contributors
+ * Copyright (C) 2022-2024 NotEnoughUpdates contributors
*
* This file is part of NotEnoughUpdates.
*
@@ -366,6 +366,14 @@ public class Misc {
@Expose
@ConfigOption(
+ name = "Use english countdown",
+ desc = "Uses english language for countdown instead of your system's selected one"
+ )
+ @ConfigEditorBoolean
+ public boolean useEnglishCountdown = false;
+
+ @Expose
+ @ConfigOption(
name = "Stop Hearts Bouncing",
desc = "Stops the hearts bouncing with regeneration effect"
)