Allow NewGRFs to give error popups, without disabling them. #9119
Fixes #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.
Motivation / Problem
Say you have a NewGRF, but you should only ever use it with another NewGRF, or a certain combination of settings is completely game breaking. You want to inform the players that they might need to rethink their choices, but you don't want to stop them from going ahead anyway, should they choose to ignore it.
In NML you can have 4 different types of errors. NOTICE, WARNING, ERROR, and FATAL. You would expect all of these to behave differently in some way, but the only difference between WARNING and ERROR is the red word in the message in the NewGRF window. FATAL gives a popup message, but also disables the NewGRF. Now it would make sense to me if ERROR also gave a pop-up, making it distinct from the other 4.
With this change, NewGRF developers like Andy can tell players "Hey we have detected that you don't have a compatible Road Vehicle NewGRF. This means you will not be able to move goods via truck. Is this correct, and if so are you sure about that?"
The direct motivation for this was a perceived issue with FIRS, but I believe this can be widely applicable.
In newgrf_gui.cpp there's a line of code that prevents a popup from appearing if the severity is not
If the severity is
The feature itself is fairly complete.
Older NewGRFs might have used ERROR when it didn't give a popup, and loading it with this change will cause them to generate a pop-up. I think that's a very minor problem.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.
The text was updated successfully, but these errors were encountered:
Alright. How do I delete changes from a PR and how do I add strings to english without changing english.lng? I presume you would need at least 1 string for the thing you want to add.
…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.