Skip to content

Conversation

@tomoldy
Copy link

@tomoldy tomoldy commented Dec 6, 2025

Hey! I love this plugin and wanted a way to hide the overlay when nothing is happening, similar to 1-Tick-Flick plugin that i used some inspiration for. This adds an opt-in overlay timeout with a configurable delay. The overlay wakes immediately when you attack/get hit or toggle any prayer, and hides after the idle window if there’s no combat target or prayer interaction. Timeout is off by default.

Changes:

Config: new “Overlay Timeout” section (enable toggle + timeout seconds, default off).
Plugin: track last activity (combat interactions, hitsplats, prayer activate/deactivate) and hide/show the overlay based on the timer; reset on world hops; shutdown cleans ping threads.
Overlay: visibility flag to skip rendering when hidden.
Testing:

Built and ran via test runner.
Verified: overlay stays visible with timeout off; hides after idle when timeout on; wakes on attack/hitsplat; wakes on prayer toggles; disabling timeout shows it immediately.

Please have a review, i havent coded in java in awhile and i'm learning git/github so sorry if its all messy!

Copilot AI review requested due to automatic review settings December 6, 2025 18:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an optional overlay timeout feature to the Histogram plugin, allowing the overlay to automatically hide when the player is inactive in combat. The feature is opt-in (disabled by default) to avoid confusion, and includes configurable timeout duration. The overlay automatically shows when combat activity is detected (attacks, hitsplats, prayer toggles, special attacks) and hides after the configured idle period.

Key Changes:

  • Added configurable overlay timeout with enable toggle and duration setting (default 12 seconds)
  • Implemented combat activity tracking that monitors player interactions, hitsplat events, and prayer toggles
  • Enhanced shutdown logic to properly clean up ping thread executor to prevent resource leaks

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/main/java/com/histogram/HistogramConfig.java Added new "Overlay Timeout" configuration section with enable toggle and timeout duration setting
src/main/java/com/histogram/HistogramPlugin.java Implemented timeout logic with activity tracking, overlay show/hide methods, and executor cleanup in shutdown
src/main/java/com/histogram/HistogramOverlay.java Added volatile visibility flag and setter/getter to support plugin-controlled visibility without removing overlay from manager
.gitignore Added .vscode/ to ignore list for IDE configuration files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 63 to 73
@ConfigItem(
keyName = "overlayTimeoutSeconds",
name = "Timeout seconds",
description = "How long after last combat before hiding the overlay",
section = timeoutSection,
position = 1
)
default int overlayTimeoutSeconds()
{
return 12;
}
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlayTimeoutSeconds configuration lacks validation for negative or zero values. Users could set this to 0 or negative values which would cause the overlay to hide immediately or behave unexpectedly.

Add a @Range annotation to ensure only positive values are allowed, e.g., @Range(min = 1) or at minimum validate the value in the plugin code before use.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment on lines 44 to 45
private long lastCombatMillis;
private boolean overlayVisible = true;
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The overlay visibility state is duplicated between overlayVisible in the plugin and visible in the overlay. This creates potential for inconsistency if the overlay's state is modified directly.

Consider using only the overlay's isVisible() method as the single source of truth, or ensure the plugin field is always kept in sync by checking the overlay's state rather than maintaining a separate copy.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tomoldy
Copy link
Author

tomoldy commented Dec 6, 2025

Resolved all CoPilot asks

@tomoldy tomoldy closed this Dec 6, 2025
@tomoldy tomoldy reopened this Dec 6, 2025
@tomoldy
Copy link
Author

tomoldy commented Dec 6, 2025

commited new changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant