-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Make "decimal" functions more consistent #21425
Conversation
022a588
to
d4f6e7c
Compare
I don't think That said, we're not keen on breaking compatibility unless there is a strong incentive, so I'm not convinced by these changes. |
I find the name |
I don't even know why we need this function, which can easily be solved by |
You're right, though modulo is a bit slower. |
Then should I remove the new "decimals()" functionality and instead leave it pointing to "step_decimals" like it was before? That would make it not break compatibility. EDIT: Done, does not break compatibility anymore |
IMO it's not worth renaming |
d4f6e7c
to
9fccba1
Compare
9fccba1
to
b6f7be4
Compare
80156c7
to
cff7e79
Compare
cff7e79
to
74eefda
Compare
No longer breaks compat. If we're deprecating ERR_EXPLAIN("GDScript method 'decimals' is deprecated and replaced by 'step_decimals', please update your code accordingly.");
WARN_DEPRECATED (and then still fallback to About the addition of |
Since 74eefda56 is independent of the renaming proposal, I'd suggest to put it in its own PR so that I can merge it as a bugfix. |
74eefda
to
cee7872
Compare
Here it is then: #22251 |
ec9e179
to
c68e9ac
Compare
c68e9ac
to
b15fa7a
Compare
b15fa7a
to
6195be1
Compare
@akien-mga I've added the deprecation warnings as you suggested. And to clarify, as I mentioned in #22251, the only reason |
6195be1
to
7fd04f6
Compare
7fd04f6
to
8574aec
Compare
8574aec
to
5937e16
Compare
5937e16
to
6832c6b
Compare
6832c6b
to
fc4b249
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.
I still don't have a strong opinion on this matter but it's being deprecated the right way, so that's fine with me to merge. If anyone is against it, speak now or never :)
In GDScript, rename "decimals" to "step_decimals". In C#, add "StepDecimals", but keep the old functionality in a method called "DecimalCount".
fc4b249
to
620ec47
Compare
So, just to clarify the justification for this PR:
|
Thanks! |
Replaced by 'step_decimals' in 3.2 via godotengine#21425.
Previously, "decimals()" in GDScript and "Decimals()" in C# had different behavior. I have renamed the method to "step_decimals()". It was already called that internally. C# is now consistent with core.