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 c4df0f95: bootstrap was only showing a black screen #8788

Merged
merged 1 commit into from Mar 1, 2021

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Mar 1, 2021

Fixes #8785

Tnx to @PeterN for triage.

Motivation / Problem

Bootstrap wasn't working. Now it is.

Description

The bootstrap has the _switch_mode to SM_MENU, and never leaves
this mode. Neither is it considered a modal window (while in some
sense it really is). So .. we need to add another "draw anyway"
exception, to make sure bootstrap is being drawn.

Over the years we collected various of ways of doing "modal" windows, where two use HasModalProgress (but are implemented differently) and one, as it turns out, uses a completely different method. This confused the new video-driver code.

This fix is just a quick-fix, as this non-sense should be resolved properly ;) Mostly, these exceptions are here as when you press "Exit to Main Menu" the window asking for confirmation is removed before your game-mode is switched, leave you in-game with a non-responsive interface, being confused. So this code in question keeps the confirmation dialog visible, while the game switched to a new mode.
The more proper fix is to show a dialog: "Exiting game ...", and let the drawing continue. This also, not now but in future iterations, would make it possible to keep the mouse responsive.

But, both solutions are not there yet, and require more refactoring of video-driver related code. I would consider that unlikely to hit 1.11, hence this fix to at least make bootstrap work again. A hack on a hack is still just a hack :D

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

The bootstrap has the _switch_mode to SM_MENU, and never leaves
this mode. Neither is it considered a modal window (while in some
sense it really is). So .. we need to add another "draw anyway"
exception, to make sure bootstrap is being drawn.
LordAro
LordAro approved these changes Mar 1, 2021
@TrueBrain TrueBrain merged commit abac4b1 into OpenTTD:master Mar 1, 2021
10 checks passed
@TrueBrain TrueBrain deleted the bootstrap-fix branch Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants