Enum support in SettingsGroup derive macro, implemented key attribute#23719
Enum support in SettingsGroup derive macro, implemented key attribute#23719mpowell90 wants to merge 15 commits intobevyengine:mainfrom
Conversation
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
24abb12 to
6b56f1f
Compare
|
FAO reviewers: i've added the fix for #23722 to this PR as it touches the same code. I can split out into a separate PR if preferred. |
kfc35
left a comment
There was a problem hiding this comment.
Just some doc refinements and some code clean-ups that I’d like to see get done (specifically that removal of the redundant code block)
Also @DavidCrossman ’s comment is valid
Feel free to re-request after you’ve addressed everything!
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
39e74ca to
0606b3d
Compare
Objective
Implements part of #23302
Fixes: #23722
For background on bevy settings see the initial PR:
#23034
Solution
Supports
unit-likeEnum resources:Assuming the above is initialised as
CounterRefreshRateSettings::Slow, results in:Setting the
groupattribute works the same as structs:#[settings_group(group = "counter_settings")]Results in:
This PR adds a
keyattribute which can only be used on enums (for now), otherwise a compile-time error is thrown:#[settings_group(key = "refresh_rate")]Results in:
Testing