godotengine / godotengine/godot-visual-script

Add MouseMode enums to Visual Script's constant

Open
#23 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
131
Forks
25
PR merge metrics
No merged PRs in 30d

Description

### Describe the project you are working on
I'm working on a 3D endless runner game.

### Describe the problem or limitation you are having in your project
Currently, setting MouseMode in Visual Script can only be done using an integer value, as shown below:
![Screenshot 2020-12-01 213533](https://user-images.githubusercontent.com/1403194/100814268-16242f00-3420-11eb-87d2-4e1821c6fa61.jpg)

This doesn't tell the user what exactly mode it is being set to, making the code unclear when debugging. This is contrary to GDScript which MouseMode is set by the enumerations (MOUSE_MODE_VISIBLE, MOUSE_MODE_HIDDEN, MOUSE_MODE_CAPTURED), as shown [here](https://docs.godotengine.org/en/stable/classes/class_input.html?highlight=MOUSE_MODE_CAPTURED#enum-input-mousemode).

Considering that the function itself tells the user to look for constants for more information, yet there is no related constant to be found anywhere in the engine is pretty much misleading 😅, as shown below:
![Screenshot 2020-12-01 214059](https://user-images.githubusercontent.com/1403194/100816023-ff7fd700-3423-11eb-9458-6e29c9b53302.jpg)

According to [this](https://docs.godotengine.org/en/stable/classes/class_input.html?highlight=MOUSE_MODE_CAPTURED#description), the constant relating to this should be found in the InputMap class (I could be wrong though).

However,
![Screenshot 2020-12-01 213948](https://user-images.githubusercontent.com/1403194/100816314-977dc080-3424-11eb-9e6e-b082f1068aa8.jpg)

### Describe the feature / enhancement and how it helps to overcome the problem or limitation
By adding the MouseMode enums to Visual Script's constant, this problem would be fixed.

### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
For example, the implementation would be the same as Vector3.UP which already presents as a constant in the engine.

In the most popular function like the _move_and_slide_, if the user doesn't know which's the right value to set for the Vector3 directions...
![Screenshot 2020-12-01 220936](https://user-images.githubusercontent.com/1403194/100815650-373a4f00-3423-11eb-8117-d7925633dc0f.jpg)

Here is the constant for them which also makes the code much clearer to read:
![Screenshot 2020-12-01 213803](https://user-images.githubusercontent.com/1403194/100815720-618c0c80-3423-11eb-962d-cc11c110c589.jpg)

### If this enhancement will not be used often, can it be worked around with a few lines of script?
This will be used very often and can't be worked around since it's the core feature of the engine.

### Is there a reason why this should be core and not an add-on in the asset library?
This is the core functionality.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.