mirror of
https://github.com/CompeyDev/touch-grass-reminder.git
synced 2024-12-12 04:40:39 +00:00
feat: finalize translations for toasts
This commit is contained in:
parent
920efccfcb
commit
4f06d2dec7
4 changed files with 18 additions and 13 deletions
|
@ -20,7 +20,8 @@ public class TouchGrassWarningClient implements ClientModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitializeClient(ModContainer mod) {
|
||||
LOGGER.info("Touch Grass Warning init; isEnabled={}, reminderFrequency={}h", config.isEnabled, config.reminderFrequency);
|
||||
LOGGER.info("Touch Grass Warning init; isEnabled={}, reminderFrequency={}h", config.isEnabled,
|
||||
config.reminderFrequency);
|
||||
LOGGER.info("Registering JOIN & DISCONNECT events...");
|
||||
|
||||
if (config.isEnabled) {
|
||||
|
|
|
@ -12,5 +12,5 @@ public class ConfigModel {
|
|||
@SerialEntry(comment = "Number of hours the warning should be displayed after")
|
||||
@AutoGen(category = "touch_grass_warning")
|
||||
@IntField(min = 1)
|
||||
public int reminderFrequency = 24;
|
||||
public int reminderFrequency = 24;
|
||||
}
|
||||
|
|
|
@ -15,9 +15,11 @@ public class PlayDurationHandler implements Runnable {
|
|||
public PlayDurationHandler(Minecraft client, long startTime, int reminderFrequency) {
|
||||
this.client = client;
|
||||
this.startTime = startTime;
|
||||
this.reminderFrequency = reminderFrequency;
|
||||
|
||||
this.toast = new SystemToast(SystemToastIds.TUTORIAL_HINT, Component.literal(String.format("You've been playing for greater than %d hours", reminderFrequency)),
|
||||
Component.literal("Excessive gaming may interfere with normal daily life"));
|
||||
this.toast = new SystemToast(SystemToastIds.TUTORIAL_HINT,
|
||||
Component.translatable("touch_grass_warning.toast.name", reminderFrequency),
|
||||
Component.translatable("touch_grass_warning.toast.description"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,7 +36,7 @@ public void run() {
|
|||
}
|
||||
|
||||
try {
|
||||
// Check every 10 minutes
|
||||
// Recheck every 10 minutes
|
||||
Thread.sleep(10 * 60 * 1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
"yacl3.config.touchgrassreminder:config.category.touch_grass_warning": "Touch Grass Reminder",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled": "Enabled",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled.desc.1": "Whether most of the mod's functionality is enabled",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled.desc.2": "Takes effect on restart",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency": "Reminder frequency",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency.desc.1": "After how long the warning should appear (in hours)",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency.desc.2": "Takes effect on restart"
|
||||
}
|
||||
"yacl3.config.touchgrassreminder:config.category.touch_grass_warning": "Touch Grass Reminder",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled": "Enabled",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled.desc.1": "Whether most of the mod's functionality is enabled",
|
||||
"yacl3.config.touchgrassreminder:config.isEnabled.desc.2": "Takes effect on restart",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency": "Reminder frequency",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency.desc.1": "After how long the warning should appear (in hours)",
|
||||
"yacl3.config.touchgrassreminder:config.reminderFrequency.desc.2": "Takes effect on restart",
|
||||
"touch_grass_warning.toast.title": "You've been playing for greater than %d hours",
|
||||
"touch_grass_warning.toast.description": "Excessive gaming may interfere with normal daily life"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue