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

Allow ExportPlugin to add export messages; use in C# export plugin #90555

Closed
wants to merge 2 commits into from

Conversation

raulsntos
Copy link
Member

  • Expose EditorExportPlatform::add_message as a method in ExportPlugin so plugins can add messages that will be displayed in the export log at the end of exporting.
  • Use the new ExportPlugin::add_message in the C# export plugin to add error messages instead of a custom error dialog. Integrates the .NET error messages with the export log dialog so only one dialog is displayed.

add_message

Alternative design

We could alternatively expose the method in EditorExportPlatform and add a get_export_platform method to ExportPlugin so we could retrieve the export platform from the plugin.

doc/classes/EditorExportPlatform.xml Outdated Show resolved Hide resolved
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 12, 2024
@dsnopek
Copy link
Contributor

dsnopek commented Apr 13, 2024

Alternative design

We could alternatively expose the method in EditorExportPlatform and add a get_export_platform method to ExportPlugin so we could retrieve the export platform from the plugin.

I've been planning to eventually make a PR to add an EditorExportPlatformExtension class that would allow GDExtensions to add new EditorExportPlatform's. (I started this in a branch a few months ago, but haven't found the time to finish it.)

This would be helpful in allowing folks to add support for exporting to console, for example, without needing to make a custom build of the editor.

In any case, as part of that work, we'd need to expose EditorExportPlatform::add_message() anyway. So, I personally quite like the alternative design, otherwise, we'll end up with two ways to do add_message()

Allow export plugins to add messages to the preset's export platform.
Integrates .NET error messages with the export log dialog.
@raulsntos
Copy link
Member Author

That's a good point, the alternative design would also supersede #90556 since having access to the EditorExportPlatform would not require us to expose another way to get the OS name from ExportPlugin.

That said, as long as EditorExportPlatform is not accessible from EditorPlugin then even if both of these add_message methods are exposed, only one of them would be available depending on where you are.

@dsnopek
Copy link
Contributor

dsnopek commented Apr 14, 2024

That said, as long as EditorExportPlatform is not accessible from EditorPlugin then even if both of these add_message methods are exposed, only one of them would be available depending on where you are.

Ah, yeah, that makes sense. Having EditorPlugin::add_message() available makes it more convenient to use when implementing an EditorPlugin, and there isn't really any harm in having it both places. :-)

@raulsntos
Copy link
Member Author

raulsntos commented Apr 29, 2024

I'll make a PR for the C# changes in this PR after #90782 is merged.

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.

4 participants