Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,124 @@ default int maxBreakDuration() {
return 15;
}

@ConfigItem(
keyName = "enableLongBreaks",
name = "Enable Long Breaks",
description = "Enable a second independent long-break timer",
position = 4,
section = breakTimingSettings
)
default boolean enableLongBreaks() {
return false;
}

@ConfigItem(
keyName = "minLongBreakInterval",
name = "Min Long Break Interval (minutes)",
description = "Minimum time to play before a long break can trigger",
position = 5,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int minLongBreakInterval() {
return 120;
}

@ConfigItem(
keyName = "maxLongBreakInterval",
name = "Max Long Break Interval (minutes)",
description = "Maximum time to play before a long break can trigger",
position = 6,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int maxLongBreakInterval() {
return 180;
}

@ConfigItem(
keyName = "minLongBreakDuration",
name = "Min Long Break Duration (minutes)",
description = "Minimum long-break duration",
position = 7,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int minLongBreakDuration() {
return 8;
}

@ConfigItem(
keyName = "maxLongBreakDuration",
name = "Max Long Break Duration (minutes)",
description = "Maximum long-break duration",
position = 8,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int maxLongBreakDuration() {
return 11;
}

@ConfigItem(
keyName = "enableMegaBreaks",
name = "Enable Mega Breaks",
description = "Enable a third independent mega-break timer",
position = 9,
section = breakTimingSettings
)
default boolean enableMegaBreaks() {
return false;
}

@ConfigItem(
keyName = "minMegaBreakInterval",
name = "Min Mega Break Interval (minutes)",
description = "Minimum time to play before a mega break can trigger",
position = 10,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int minMegaBreakInterval() {
return 240;
}

@ConfigItem(
keyName = "maxMegaBreakInterval",
name = "Max Mega Break Interval (minutes)",
description = "Maximum time to play before a mega break can trigger",
position = 11,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int maxMegaBreakInterval() {
return 360;
}

@ConfigItem(
keyName = "minMegaBreakDuration",
name = "Min Mega Break Duration (minutes)",
description = "Minimum mega-break duration",
position = 12,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int minMegaBreakDuration() {
return 20;
}

@ConfigItem(
keyName = "maxMegaBreakDuration",
name = "Max Mega Break Duration (minutes)",
description = "Maximum mega-break duration",
position = 13,
section = breakTimingSettings
)
@Range(min = 1, max = 600)
default int maxMegaBreakDuration() {
return 30;
}

// ========== BREAK BEHAVIOR SECTION ==========
@ConfigSection(
name = "Break Behavior",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ public Dimension render(Graphics2D graphics) {
.rightColor(Color.GRAY)
.build());

panelComponent.getChildren().add(LineComponent.builder()
.left("Runtime:")
.right(formatDuration(script.getScriptActiveSeconds()))
.rightColor(Color.WHITE)
.build());

panelComponent.getChildren().add(LineComponent.builder()
.left("Breaks:")
.right(String.valueOf(script.getBreaksActivatedCount()))
.rightColor(Color.WHITE)
.build());

// Show play schedule info if enabled
if (config.usePlaySchedule()) {
panelComponent.getChildren().add(LineComponent.builder()
Expand All @@ -88,14 +100,30 @@ public Dimension render(Graphics2D graphics) {
.rightColor(Color.GREEN)
.build());
}
long secondsUntilLongBreak = script.getTimeUntilLongBreak();
if (config.enableLongBreaks() && secondsUntilLongBreak >= 0) {
panelComponent.getChildren().add(LineComponent.builder()
.left("Long break:")
.right(formatDuration(secondsUntilLongBreak))
.rightColor(Color.ORANGE)
.build());
}
long secondsUntilMegaBreak = script.getTimeUntilMegaBreak();
if (config.enableMegaBreaks() && secondsUntilMegaBreak >= 0) {
panelComponent.getChildren().add(LineComponent.builder()
.left("Mega break:")
.right(formatDuration(secondsUntilMegaBreak))
.rightColor(Color.MAGENTA)
.build());
}
} else if (BreakHandlerV2State.isBreakActive()) {
long secondsRemaining = script.getBreakTimeRemaining();
if (secondsRemaining >= 0) {
String timeStr = formatDuration(secondsRemaining);
panelComponent.getChildren().add(LineComponent.builder()
.left("Break ends:")
.left(script.isCurrentBreakMega() ? "Mega break ends:" : script.isCurrentBreakLong() ? "Long break ends:" : "Break ends:")
.right(timeStr)
.rightColor(Color.ORANGE)
.rightColor(script.isCurrentBreakMega() ? Color.MAGENTA : Color.ORANGE)
.build());
}
}
Expand Down Expand Up @@ -163,7 +191,9 @@ public Dimension render(Graphics2D graphics) {
// Break configuration
panelComponent.getChildren().add(LineComponent.builder()
.left("Break type:")
.right(config.logoutOnBreak() ? "Logout" : "Stay logged in")
.right((config.logoutOnBreak() ? "Logout" : "Stay logged in")
+ (config.enableLongBreaks() ? " + long" : "")
+ (config.enableMegaBreaks() ? " + mega" : ""))
.rightColor(Color.LIGHT_GRAY)
.build());

Expand Down
Loading