godotengine / godotengine/godot-cpp

Custom extensions_api.json - Returned enum missing class identifier

Open
#1,893 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

### Godot version

v4.5.1.stable.official [f62fdbde1]

### godot-cpp version

4.5 (e83fd09)

### System information

Windows 10, x86-64, AMD Ryzen 9 5900HX, NVidia GeForce RTX 3070

### Issue description

When creating a custom extensions_api.json bindings to include information from the GodotSteam GDExtension, my custom GDExtension creates the C++ header and source files, but any time an enum is returned that is specific to the `Steam` class, it doesn't have `Steam::` in front of it. For example, the return for `Steam::getConnectedUniverse` method was just `Universe` instead of `Steam::Universe` in the steam.cpp file.

### Steps to reproduce

From scratch instructions:
- Create an empty project in Godot 4.5.1
- Download GodotSteam GDExtension 4.4+ from the Asset Store
- Close the Godot Editor
- Navigate to the project folder
- Run `godot --headless --dump-extension-api` to generate the extension_api.json file (saved as steam_extension_api.json)
- Copy this to a blank GDExtension C++ Template project
- Build using `scons platform=windows custom_api_file=steam_extension_api.json`
- Error as the generated steam.cpp file uses enums without the class identifier

Using minimal reproduction project:
- Navigate to the `demo` subfolder
- Run `godot --headless --dump-extension-api` to generate the extension_api.json file (saved as steam_extension_api.json)
- Build using `scons platform=windows custom_api_file=steam_extension_api.json`

### Minimal reproduction project

I have created a copy of my custom GDExtension with all code removed, and the demo project stripped to bare minimum. It includes the download of GodotSteam from the Asset Library at the time of this issue.

[godotsteam_extension_enum_project.zip](https://github.com/user-attachments/files/23972296/godotsteam_extension_enum_project.zip)

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.