-
Notifications
You must be signed in to change notification settings - Fork 36
State V2 and actually use GLRenderer #594
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: v1
Are you sure you want to change the base?
Conversation
Job Summary for GradleBuild :: build
|
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 upgrades the PolyUI library from version 1.15.2 to 2.0.4 and refactors the codebase to use the new State V2 API. Additionally, it switches from NVGRendererImpl to GLRendererImpl for rendering and includes several bug fixes.
Key changes:
- Migration to State V2 API with bidirectional state binding between UI components and properties
- Switch from framebuffer-based rendering to direct viewport-based rendering using GLRenderer
- Fixed error message in EventManager to correctly display handler class name
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/ui/src/main/kotlin/org/polyfrost/oneconfig/api/ui/v1/internal/GLRendererImpl.kt | Added null-safety checks for glyph operations and range validation for character codes |
| modules/internal/src/main/kotlin/org/polyfrost/oneconfig/internal/ui/OneConfigUI.kt | Refactored search functionality to use State V2 with listener pattern instead of onChange callbacks |
| modules/hud/src/main/kotlin/org/polyfrost/oneconfig/api/hud/v1/internal/hudpages.kt | Migrated HUD settings to State V2 API, replacing manual onChange handlers with state binding |
| modules/events/src/main/java/org/polyfrost/oneconfig/api/event/v1/EventManager.java | Fixed error message to show correct handler class name instead of event class name |
| modules/config/src/main/java/org/polyfrost/oneconfig/api/config/v1/Property.java | Changed set/setReferential methods to return boolean, added removeCallback functionality |
| modules/config-impl/src/main/kotlin/org/polyfrost/oneconfig/api/config/v1/internal/ConfigVisualizer.kt | Updated accordion state handling to use State objects instead of primitives |
| modules/config-impl/src/main/kotlin/org/polyfrost/oneconfig/api/config/v1/Visualizer.kt | Added toState() and toEnumState() methods for Property-to-State conversion with weak references |
| minecraft/src/main/java/org/polyfrost/oneconfig/api/ui/v1/internal/wrappers/PolyUIScreen.java | Removed framebuffer rendering, switched to direct viewport manipulation for GLRenderer compatibility |
| minecraft/src/main/java/org/polyfrost/oneconfig/api/ui/v1/internal/UIManagerImpl.java | Switched from NVGRendererImpl to GLRendererImpl |
| gradle/libs.versions.toml | Upgraded PolyUI dependency from 1.15.2 to 2.0.4 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
modules/internal/src/main/kotlin/org/polyfrost/oneconfig/internal/ui/OneConfigUI.kt
Show resolved
Hide resolved
modules/ui/src/main/kotlin/org/polyfrost/oneconfig/api/ui/v1/internal/GLRendererImpl.kt
Outdated
Show resolved
Hide resolved
modules/hud/src/main/kotlin/org/polyfrost/oneconfig/api/hud/v1/internal/hudpages.kt
Show resolved
Hide resolved
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
…, remove old code from LegacyHud
…er' into state-v2-and-actually-use-glrenderer
Job Summary for GradleBuild :: build
|
| renderer.accept(event.ctx); | ||
| }); | ||
| // todo temporary reversion: on RenderEvent it just renders nothing (see #592, #579) | ||
| EventManager.register(HudRenderEvent.class, event -> renderer.accept(event.ctx)); |
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.
is this something we should put on our issues board
Job Summary for GradleBuild :: build
|
…er' into state-v2-and-actually-use-glrenderer
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Job Summary for GradleBuild :: build
|
Description
Related Issue(s)
Checklist