Enum support in SettingsGroup derive macro, implemented key attribute#23719
Enum support in SettingsGroup derive macro, implemented key attribute#23719mpowell90 wants to merge 5 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
Objective
Implements part of #23302
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