-
-
Notifications
You must be signed in to change notification settings - Fork 105
Description
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, and inf_neg. Instead we have to use INF, 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)
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 of inf), and we would be able to type it as we see it, since INF is already also a GDScript constant. The same logic applies to NAN. Negative infinity would be INF_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.