Add Debug Overlay with runtime element inspection and extractor registry - #36
Merged
Conversation
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.
Summary
This PR adds a GUI Debug Overlay (Debug Mode) to GuideNH that helps developers and content creators inspect, pick, and export detailed information about guide pages and scene elements at runtime.
Key capabilities
Toggleable GUI debug overlay (hotkey: Ctrl + Shift + Alt + C) with persistent config switches.
Left-bottom information panel showing FPS, memory usage, mouse coordinates, hovered element details, and parent element information.
Center-bottom debug control panel for toggling display options, printing the document tree, recompiling the current page, and exporting debug data.
Precise runtime element picking through deep traversal, including support for:
DebugComponentfor sub-components (tabs, scene buttons, chart parts).DebugFlowContainerfor inline flow elements (images, links, text, LaTeX).InterpolatedViewportfor animated scroll/zoom-aware hit testing.Registry-based
DebugInfoExtractorsystem with built-in extractors for documents, paragraphs, headings, items, images, charts, Mermaid diagrams, scenes, code blocks, LaTeX, containers, and generic fallback handling.Animated debug visualization with configurable dashed outlines, cursor markers, colors, scale, line thickness, and animation parameters.
PerformanceMonitorfor FPS and memory sampling, andTreePrinterfor structured document tree output.Integration with
GuideScreenandSceneEditorScreenfor overlay rendering and debug input handling.New localization entries (
en_US,zh_CN) and wiki documentation for Debug Mode.Configurable debug options under
ModConfig.Debug, with debug logic gated to minimize overhead when disabled.Checklist