GodotECS / godex

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

Fix building without tools enabled #281

Open Beliar83 opened 2 years ago

Beliar83 commented 2 years ago

Disable code that references editor specific things when TOOLS_ENABLED is not defined. This allows building of export templates.

Beliar83 commented 2 years ago

After some more thinking I think many errors would already be gone if the files in the editor_plugins are not included with tools disabled. This can already be done in the SCsub. Do you see any problem with that?

Beliar83 commented 2 years ago

@AndreaCatania What exactly would the problem be with scripted components?

AndreaCatania commented 2 years ago

After some more thinking I think many errors would already be gone if the files in the editor_plugins are not included with tools disabled. This can already be done in the SCsub. Do you see any problem with that?

I think that would make a lot of sense doing that TBH.

What exactly would the problem be with scripted components?

At startup the scripted component need to be fetched, and registered to godex to be used. It uses the function ScriptEcs::reload_scripts() to do that, so we need a way to preserve the ability to load the scripts even in production.

Beliar83 commented 2 years ago

At startup the scripted component need to be fetched, and registered to godex to be used. It uses the function ScriptEcs::reload_scripts() to do that, so we need a way to preserve the ability to load the scripts even in production.

I see, okay.

AndreaCatania commented 2 years ago

It looks nice now, the only issue is find an alternative way of fetching the scripts in production. I think it's enough see how GDScript handle that, since it should work in the same way. I'll try to look into that, and ask to the godot team, feel free to do it too.

Beliar83 commented 1 year ago

@AndreaCatania This should fix the problem with not being able to use EditorFileSystem. I also based it on the changes in #304 , so you might want to check that first.