GodotECS / godex

Godex is a Godot Engine ECS library.
MIT License
1.2k stars 68 forks source link

Ref #292 - Attempt to fix editor UI #296

Closed florianvazelle closed 2 years ago

florianvazelle commented 2 years ago

When I use godex, I encounter the first problem described in ticket https://github.com/GodotECS/godex/issues/292.

No ECS tab in editor from the latest master

I could see that this was due to the fact that, in the method initialize_godot_module, the singleton EditorNode was at nullptr.

I made some quick changes, observing what was done in other godot modules. Now, the menu described in the doc, here, appear. But, this one is different.

Does the documentation correspond to a particular version of godex ?

I'm new to module development for godot, and although the menu appears, sometimes the module seems to be flaky.

AndreaCatania commented 2 years ago

Yes the editor is significantly different now, that doc is out of date, so I think this PR fixes that issue. I'm just curious about the get_gui_base() change; I think it's valid so we can definitely use that, but did you change it because you had an issue? In any case, great work!

florianvazelle commented 2 years ago

Yes, I'm on Manjaro 21.3.2, and without my second commit, when I open a project (an empty project), Godot crash with this message:

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.alpha.custom_build (2998be4f998409ba14b5d6e1c184fe6767c87a3e)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3e8e0) [0x7fac917f48e0] (??:0)
[2] Object::get_class_name() const (??:0)
[3] Control::get_theme_icon(StringName const&, StringName const&) const (??:0)
[4] EditorWorldECS::EditorWorldECS(EditorNode*) (??:0)
[5] WorldECSEditorPlugin::WorldECSEditorPlugin(EditorNode*) (??:0)
[6] /godot/bin/godot.linuxbsd.tools.64(+0x25bdf88) [0x557e4d538f88] (??:0)
[7] EditorNode::EditorNode() (??:0)
[8] Main::start() (??:0)
[9] /godot/bin/godot.linuxbsd.tools.64(main+0x161) [0x557e4d4d42ea] (??:0)
[10] /usr/lib/libc.so.6(+0x29290) [0x7fac917df290] (??:0)
[12] /godot/bin/godot.linuxbsd.tools.64(_start+0x25) [0x557e4d4d40b5] (??:0)
-- END OF BACKTRACE --
================================================================
florianvazelle commented 2 years ago

This does not seem to happen on Ubuntu 20.04. I'm trying to create a project to reproduce the bug, if necessary florianvazelle/arch-godot-godex.

AndreaCatania commented 2 years ago

Most likely it should be reported on godot side. However get_gui_base is valid I think, as it should be able to take the icons from that pointer too. If not we can revert that change, and fix the bug properly.