-
Notifications
You must be signed in to change notification settings - Fork 1
Add overlay timeout (combat/prayer activity wake) #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Overlay timeout
There was a problem hiding this 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.
| @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; | ||
| } |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
| private long lastCombatMillis; | ||
| private boolean overlayVisible = true; |
Copilot
AI
Dec 6, 2025
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
|
Resolved all CoPilot asks |
|
commited new changes! |
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!