-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Change inf, inf_neg, nan serialization to uppercase, and add INF_NEG GDScript constant #3398
Comments
For |
@aaronfranke I know I can do I can't type Handling |
Do you actually see This is where the value you type into the inspector gets parsed: If you're looking for congruency between what you input and what the inspector shows, I would suggest adding a check for just "inf" and "nan" here: |
Double checked. No, I don't see |
I would prefer if |
Describe the project you are working on
See #3390
Describe the problem or limitation you are having in your project
Most float literals can be typed verbatim in the code inspector. Except for
inf
,nan
, andinf_neg
. Instead we have to useINF
,NAN
and -INF
.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Change the Variant serialization that was consolidated in godotengine/godot#47497 / godotengine/godot#47497 to use uppercase.
However, notice that platforms that were unaffected by godotengine/godot#40589 were already using the
inf
serialization. See godotengine/godot#40589 (comment)Thus, this is a breaking change. Any scene saved with `inf` would fail to load. Perhaps this is acceptable since such scene would not be common. At least it should be acceptable for a version that is already braking stuff.We can allow migration if we still parse the lower case versions along side the uppercase version, but only serialize to the uppercase versions.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Since the inspector uses the float serialization, with the proposed change Infinity would show as
INF
(instead ofinf
), and we would be able to type it as we see it, sinceINF
is already also a GDScript constant. The same logic applies toNAN
. Negative infinity would beINF_NEG
, which would be a new GDScript constant.If this enhancement will not be used often, can it be worked around with a few lines of script?
It is not possible to change the Variant serialization with a script.
Is there a reason why this should be core and not an add-on in the asset library?
It is not possible to change the Variant serialization with a script.
The text was updated successfully, but these errors were encountered: