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

[NewGRF] There's no way to make Pop-up error messages that don't disable NewGRFs #9115

Closed
EratoNysiad opened this issue Apr 26, 2021 · 0 comments · Fixed by #9119
Closed

[NewGRF] There's no way to make Pop-up error messages that don't disable NewGRFs #9115

EratoNysiad opened this issue Apr 26, 2021 · 0 comments · Fixed by #9119

Comments

@EratoNysiad
Copy link
Contributor

@EratoNysiad EratoNysiad commented Apr 26, 2021

Version of OpenTTD

1.11.0, Windows 10. Using NML here.

Expected result

I have a NewGRF with the code error(ERROR,string(STR_OH_NO));, and I expect this to give an error pop-up with the text in STR_OH_NO. That you're then free to click away. We don't want to be using FATAL, because FATAL actually disables the NewGRF. We want to inform the user, but still allow them to do their thing if they really want to.

Actual result

Instead in the NewGRF window, it creates some red text saying "error", this is the exact same behaviour using WARNING gives, except the text says "warning". Which makes me think it has to be a bug.

Tyler found the culprit: https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf_gui.cpp#L50
I think this line was erroneously written by someone who forgot about errors.

Steps to reproduce

Create a NewGRF using nml, use the code error(ERROR,string(STR_OH_NO));, make sure to have a STR_OH_NO and you'll see nothing at all, until you open the NewGRF window.

EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". Also provided a translation in a few languages I'm confident enough in to remove a word.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
… functionally distinct, with ERROR giving a pop-up window.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". Also provided a translation in a few languages I'm confident enough in to remove a word.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
…p window now.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". Also provided a translation in a few languages I'm confident enough in to remove a word.

Revert: Translation through commit.

Undo: change languages

Fix: [NewGRF] Style compliance

Fixed indentation
Fixed extra space
Fixed else on next line
Fixed confusing comment.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
…p window now.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". This makes ERROR functionally distinct from WARNING.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
…p window now.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". This makes ERROR functionally distinct from WARNING.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
…p window now.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". This makes ERROR functionally distinct from WARNING.
EratoNysiad added a commit to EratoNysiad/OpenTTD that referenced this issue Apr 27, 2021
…p window now.

Fixed issue OpenTTD#9115 by also creating an error pop-up for errors with the severity ERROR, instead of just FATAL. Also added a string for it, STR_NEWGRF_ERROR_POPUP, which is the string STR_NEWGRF_ERROR_FATAL_POPUP, but without the word "fatal". This makes ERROR functionally distinct from WARNING.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant