Refactor GuiRotationDial, AimLock rendering#2781
Open
oznogon wants to merge 5 commits intodaid:masterfrom
Open
Refactor GuiRotationDial, AimLock rendering#2781oznogon wants to merge 5 commits intodaid:masterfrom
oznogon wants to merge 5 commits intodaid:masterfrom
Conversation
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.
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. |
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.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 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. 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: