Skip to content

Refactor GuiRotationDial, AimLock rendering#2781

Open
oznogon wants to merge 5 commits intodaid:masterfrom
oznogon:refactor-guirotationdial-aimlock
Open

Refactor GuiRotationDial, AimLock rendering#2781
oznogon wants to merge 5 commits intodaid:masterfrom
oznogon:refactor-guirotationdial-aimlock

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Mar 12, 2026

GuiRotationDial uses sprites for the handle and ring. This limits how GuiRotationDial can 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.

Instead of using sprites, draw a circle outline and use triangle strips for the handle, and apply theme colors for direct customization.

Correspondingly refactor AimLock (the only use of GuiRotationDial) to remove its redundant rendering logic, move its radar rotation offset handling to GuiRotationDial, and fix the headers of the screens that use AimLock and AimLockButton to correctly declare their classes. The default 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.

Before (right) and after:

Screenshot 2026-03-11 182906

oznogon added 4 commits March 12, 2026 10:29
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.
@oznogon oznogon force-pushed the refactor-guirotationdial-aimlock branch from af4b70a to 6e7acac Compare March 12, 2026 17:30
@daid
Copy link
Owner

daid commented Mar 19, 2026

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants