godex icon indicating copy to clipboard operation
godex copied to clipboard

Fix building without tools enabled

Open Beliar83 opened this issue 4 years ago • 6 comments

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

Beliar83 avatar Jan 15 '22 14:01 Beliar83

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 avatar Jan 16 '22 11:01 Beliar83

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

Beliar83 avatar Jan 16 '22 13:01 Beliar83

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.

AndreaCatania avatar Jan 16 '22 14:01 AndreaCatania

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.

Beliar83 avatar Jan 16 '22 14:01 Beliar83

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.

AndreaCatania avatar Jan 18 '22 07:01 AndreaCatania

@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.

Beliar83 avatar Feb 23 '23 21:02 Beliar83