Add option to hide the histogram when the inventory is closed - #9
Open
SnavvieJD wants to merge 1 commit into
Open
Add option to hide the histogram when the inventory is closed#9SnavvieJD wants to merge 1 commit into
SnavvieJD wants to merge 1 commit into
Conversation
The overlay is typically positioned over the inventory panel. When the inventory is closed the panel disappears but the histogram stays, leaving the tick marks floating over the game world. HistogramOverlay had no access to game state (it was constructed with only the config), so it couldn't tell whether the inventory was open. This passes the plugin's existing injected Client through to the overlay and adds a "Hide When Inventory Closed" toggle to the Panel section, defaulting to off so existing behaviour is unchanged. The event updates now run before the visibility check rather than after the draw, so events are still aged and pruned while the panel is hidden and the frame delta doesn't spike when it reappears. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8.
The overlay is normally positioned over the inventory panel. When the inventory is closed the panel disappears but the histogram stays, leaving the tick marks floating over the game world.
HistogramOverlayhad no access to game state — it was constructed with only the config — so it couldn't tell whether the inventory was open.What this does
Hide When Inventory Closedboolean to the Panel section, defaulting to off so existing behaviour is unchangedClientthrough to the overlaynullearly fromrenderwhen the toggle is on andInterfaceID.Inventory.ITEMSis null or hiddenOne thing worth a look: I moved
updateDelta()andupdateEvents()to the top ofrender, before the visibility check, rather than leaving them between the fill and the draw. Without that, events would keep accumulating in the deque while the panel was hidden (they're still added by the plugin's subscribers) anddeltawould spike on the frame it reappeared, sincelastnanoonly advances inupdateDelta. The fill doesn't depend on either call, so the reorder is otherwise inert.Testing
I have not built or run this. I don't have a JDK on this machine, so it's compile-unverified — please treat it as a suggestion rather than something ready to merge.
HistogramPluginTestdoesn't referenceHistogramOverlay, so the constructor change shouldn't affect it, but that's from reading rather than running.I used
net.runelite.api.gameval.InterfaceIDsinceComponentIDis gone from current RuneLite and the build targetslatest.release. If you support older client versions, that import may need to change.Happy to adjust or close this if you'd rather implement it your own way.