Skip to content
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

Inspector no longer interprets Comma as decimal point in editor #24531

Closed
kondelik opened this issue Dec 21, 2018 · 4 comments
Closed

Inspector no longer interprets Comma as decimal point in editor #24531

kondelik opened this issue Dec 21, 2018 · 4 comments

Comments

@kondelik
Copy link

kondelik commented Dec 21, 2018

Godot version:
3.1-alpha (2 and 3, didnt test alpha1)

OS/device including version:
Windows 10, non-english keyboard

Issue description:

Regression of issue #6028 in godot 3.1 alpha. Original issue fixed by PR #13240

In GODOT 3.0 editor you can use "," as decimal separator:

insert_with_comma_godot305
(comma is simply replaced by dot)

In GODOT 3.1-alpha (2 and 3, didnt test 1) everything after comma is trimmed:
insert_with_comma_godot31_alpha

Steps to reproduce:

Same as in issue #6028

  1. In editor, write "1.1" to any float box (like "rotation degrees" on Node2D) - rotation is set to "1.1"
  2. In editor, write "1,1" to any float box (like "rotation degrees" on Node2D) - rotation is set to "1"
@akien-mga akien-mga added this to the 3.1 milestone Dec 21, 2018
akien-mga added a commit to akien-mga/godot that referenced this issue Dec 21, 2018
@akien-mga akien-mga changed the title Godot 3.1-alpha regression: Interpret Comma as decimal point in editor Inspector no longer interprets Comma as decimal point in editor Jan 9, 2019
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 9, 2019
@akien-mga
Copy link
Member

See discussion on #24532.

Simply replacing "," by "." is problematic as the EditorSpinSlider uses the Expression node to parse commands and can support functions with multiple arguments, such as pow(2, 3).

A better solution would be to intercept the key event from this numpad comma separator and replace it by a KEY_KP_PERIOD event (only in EditorSpinSlider). This implies actually exposing this separator event to Godot in platform keyboard bindings.

@akien-mga akien-mga removed this from the 3.2 milestone Dec 13, 2019
@Calinou
Copy link
Member

Calinou commented Jul 22, 2020

@akien-mga Is using pow() and other functions in the inspector common enough? If not, I think it'd be better to just replace , with . at this point.

Most expression usage in the editor seems to revolve around basic math operators (+-*/%). If we really need pow(), I guess we could add an ** exponentation operator to Expression.

@akien-mga
Copy link
Member

It's important in Expression yes, which can parse full expressions.

That's why I said this should be handled ad-hoc in the inspector only (EditorSpinSlider).

@Calinou
Copy link
Member

Calinou commented Sep 27, 2020

Closing in favor of godotengine/godot-proposals#1576, as feature proposals are now tracked in the Godot proposals repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants