godotengine / godotengine/godot
PropertyInfo Usage has no effect in GDExtension
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in 4.3
### System information
Windows 11 - Godot 4.3 - Forward+
### Issue description
While developing a plugin using GDExtension for godot I've noticed `usage` has no effect when adding a custom EditorSettings. You can enter a random int and it doesn't affect anything the main reason I need this is `PROPERTY_USAGE_RESTART_IF_CHANGED` which doesn't work.
It's necessary for GDExtension editor settings to warn user to restart editor on certain critical settings.
```CPP
PropertyInfo propertyGen(Variant::INT, "gdrtx/compute_model", PropertyHint::PROPERTY_HINT_ENUM, "Cuda,OpenCL",
PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
editor_settings->add_property_info(propertyGen);
```
Same issue was addressed here https://github.com/godotengine/godot/pull/66079 which was fixed for ProjectSettings but not EditorSettings.
### Steps to reproduce
1. Create a simple EditorPlugin and register it.
2. Get Editor Settings Instance and Register a new PropertyInfo with `PROPERTY_USAGE_RESTART_IF_CHANGED` flag
3. Run editor.
4. Change the setting and you will be not prompted for restart.
### Minimal reproduction project (MRP)
No Project
Contributor guide
Research direction
Start by reproducing the EditorPlugin and EditorSettings steps in the issue on Godot 4.3, then inspect how PropertyInfo usage is handled for EditorSettings and compare it with the ProjectSettings fix in PR 66079. Done means PROPERTY_USAGE_RESTART_IF_CHANGED on a GDExtension EditorSettings property prompts the user to restart the editor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, godot
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100