-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename color constants #41019
Rename color constants #41019
Conversation
Color constants are registered here: Lines 2334 to 2337 in ec678c5
In order for the color name to be uppercase, the second argument to To do this you might (a) modify |
I just added the entire bunch of names as new entries. Old code needn't break. Spaces are marked as underscores in C++ and C# pascalcasing is updated as per X11 color names, Wikipedia. My other option was to entirely replace the constants and introduce new |
43f9c5c
to
bda2f4d
Compare
bda2f4d
to
3b11808
Compare
However this doesn't follow the consistency that @aaronfranke wanted to provide ( While obviously better done in C++ for performance reasons, I don't see why |
They could be, but this is a very simple feature so it's easy enough to just have it built-in, and arguably commonly used (the colors are used less othen than the constants like Vector2.UP, but they are both sets of standardized constants so we should treat them the same). When it comes to |
Would this be done by adding another Variant Type in variant_call.cpp? |
51eb193
to
c37a4df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the constants, I'm not sure of the best way to implement them. Take a look at the PR that added them. If you can't figure something out, I'll try myself later.
Should I reintroduce the old names for 3.2 compat? I guess a commit with that can go into the 3.2 branch but one without it can go into 4.0 only. |
@aaronfranke Looks like the files have been moved to core/math and the types have been renamed without any changes to the colour names. I guess I'll have to redo some of this... |
@reduz could you review this? Seems you were the author of the moving change. Editing your change will definitely break compat for 3.2, which I wish to target but in practice I'm not. |
I believe @reduz has addressed this in the latest changes relating to code reorganisation. |
Looks like my transformation code is wasteful. I'll need to provide the names directly in color_names.inc, or wherever the colour names are registered. |
@Vivraan This can't be done to 3.2 because it breaks compatibility. What you have here is a merge, but you need a rebase and ideally squash, where it says "Commits 29" it should say "Commits 1". See this article for more information. |
It looks like this because the files I was trying to change have been (re)moved. Atm I'm waiting for Reduz to review this change, since it looks like the way these constants are defined or introduced has been completely redone. |
GDScript: |
Named color constants renamed to UPPERCASE. Unlike godotengine#41019, this PR is complete and implements these changes in the simplest way possible. Co-authored-by: Shivam Mukherjee <mshivam98@gmail.com>
For the record: #45144, which replaces this PR, has been merged. |
Fix naming of certain constants and color name strings in C++ and C#.
Advise on how to parse constants in UPPERCASE_NAMING style for gdscript Color Constants.