Refactor GuiRotationDial, AimLock rendering#2781
Merged
daid merged 7 commits intodaid:masterfrom Mar 27, 2026
Merged
Conversation
af4b70a to
6e7acac
Compare
Owner
|
It's a big of a visual shame to lose the rounded corners, this could potentially be fixed by rendering a (stretched) texture on the dial instead of a solid color. |
Contributor
Author
|
Since this uses EDIT: Like daid/SeriousProton#306 ? |
5eb7b57 to
346831f
Compare
Contributor
Author
|
Refactored to use |
GuiRotationDial uses sprites for the handle and ring, which makes resizing it inflexible and requires replacing sprites to theme it. Use drawCircleOutline, triangle strips, and theme colors instead to allow the ring and handle to be more easily customized.
Allow defining optional textures for the GuiRotationDial handle (front) and ring (back). - Rename dial_background.png to RotationDialBackground.png per other widget PNG naming conventions, and reshade to white to take theme colors better. - Replace dial_button.png with new RotationDialHandle.png as a 9-segment stretched texture in white with rounded corners. - Use drawTexturedTriangleStrip to texture the handle, falling back to colored drawTriangleStrip if no texture is defined in the theme. - Update drawStretched call to apply a ring texture if present, falling back to colored drawCircleOutline.
- Fix theme defaults and expand theme properties. - Fix left-column segment U-axis coordinates. - Fix radial band rendering to reduce artifacts on large arc widths. - Dynamically resegment handle strip for runtime changes to handle_arc. - Stop rendering if visible but the parent radius is < 1. - Allow function-defined thickness to override theme definition, i.e. for runtime-defined arc changes. - Update click region if thickness changed.
72d320a to
e34f6cb
Compare
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.
GuiRotationDialuses sprites for the handle and ring. This limits howGuiRotationDialcan be used, since resizing it also changes the width of the ring and size of the handle, and the handle's arc is fixed to 20 degrees, which happens to be the size of the default handle sprite.Use triangle strips for the handle, use a 9-segment stretched texture to allow texturing the handle, and apply theme colors for direct customization. Add a drawCircleOutline fallback for the background ring, to use if no textures is defined on the theme. Also scale that fallback relative to the ring radius or use an optional defined size.
While the fallback ring is more flexible, this still uses and prioitizes a fixed ring texture to retain backward behaviors.
Correspondingly refactor
AimLock(the only use ofGuiRotationDial) to remove its redundant rendering logic, move its radar rotation offset handling toGuiRotationDial, and fix the headers of the screens that useAimLockandAimLockButtonto correctly declare their classes.Ring thickness, which is now configurable, is also reduced to 1/10 of the radius instead of about 1/8 to avoid hiding heading tigs. The background ring texture is also modified to better fit this new width.
Before:
After (textures on ring and handle):
After (no textures on ring or handle):
Demonstrating handle UVs (sliders were a debug tool and not part of the PR):
Recording.2026-03-20.144216.uvrect.guirotationdial.mp4