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

Replace WinForms crash dialog with SDL_ShowMessageBox. #18582

Closed
wants to merge 1 commit into from

Conversation

pchote
Copy link
Member

@pchote pchote commented Sep 2, 2020

This PR aims to solve another issue facing #17989, that .net core refuses to build anything that uses winforms on non-windows platforms.

This will also resolve OpenRA/OpenRAModSDK#123 once the SDK is updated to use the newer engine.

Old dialog:
Screenshot 2020-09-02 at 18 07 10

New dialog:
Screenshot 2020-09-02 at 18 17 59

This includes a minimal wrapper that pinvokes directly into the sdl2.dll because I couldn't find any documentation on how to allow csc to compile code that depends on netstandard that doesn't involve hardcoded filepaths. We should be able to replace this with SDL2-CS in #17989.

Test builds: https://github.com/pchote/OpenRA/releases/tag/devtest-20200902

@pchote pchote requested a review from teinarss September 2, 2020 20:29

namespace OpenRA
{
// Minimal SDL wrapper to work around SDL2-CS requiring netstandard2.0
Copy link
Member Author

Choose a reason for hiding this comment

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

If we want to go ahead with this approach I will need to reword this to clearly attribute SDL2-CS and its license.

@teinarss
Copy link
Contributor

teinarss commented Sep 3, 2020

Another solution would to use https://avaloniaui.net/

@pchote
Copy link
Member Author

pchote commented Sep 6, 2020

As discussed on IRC, we'll do these changes in #17989 to avoid the uglyness of the SDL2-CS workaround.

@pchote pchote closed this Sep 6, 2020
@pchote pchote mentioned this pull request Nov 22, 2020
@pchote pchote deleted the sdlforms branch April 8, 2021 21:10
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.

The Windows package build still references System.Drawing.
2 participants