Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building without tools enabled #281

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

Beliar83
Copy link
Contributor

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

Copy link
Member

@AndreaCatania AndreaCatania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks really nice, and it's super helpful. I think we just need to find the proper way of fetching the scripts in production, if EditorFileSystem::get_singleton() is not available, otherwise we will not be able to properly execute the scripted components.

modules/godot/editor_plugins/editor_world_ecs.cpp Outdated Show resolved Hide resolved
@@ -1352,3 +1357,4 @@ void WorldECSEditorPlugin::make_visible(bool p_visible) {
ecs_editor->set_world_ecs(nullptr);
}
}
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, a new line is missing here, the CI will fail

@@ -432,6 +432,7 @@ TypedArray<String> WorldECS::get_configuration_warnings() const {
warnings.push_back(TTR("The selected pipeline `") + active_pipeline + TTR("` doesn't exists in this WorldECS."));
}

#ifdef TOOLS_ENABLED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if wrap the entire function with ifdef would make more sense instead, what do you think?

modules/godot/nodes/script_ecs.cpp Show resolved Hide resolved
modules/godot/nodes/script_ecs.cpp Show resolved Hide resolved
modules/godot/nodes/script_ecs.cpp Outdated Show resolved Hide resolved
modules/godot/nodes/script_ecs.cpp Show resolved Hide resolved
@Beliar83
Copy link
Contributor Author

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
Copy link
Contributor Author

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

@AndreaCatania
Copy link
Member

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
Copy link
Contributor Author

Beliar83 commented Jan 16, 2022

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
Copy link
Member

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 Beliar83 force-pushed the export_templates branch from 9360eb2 to b89d2b7 Compare May 6, 2022 05:44
@Beliar83
Copy link
Contributor Author

@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 Beliar83 force-pushed the export_templates branch 3 times, most recently from 39e8f43 to dc730aa Compare February 23, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants