-
Notifications
You must be signed in to change notification settings - Fork 355
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
Game no longer pauses for year end awards screen #286
Comments
@MarkL1961 I will try to fix this bug by Saturday if your not already working on this. |
I am not sure this is fixed! |
@MarkL1961 Today I will investigate why this bug is back. |
@MarkL1961 In your saved game the game isn't paused because for some reason world:isCurrentSpeed("Pause") is returning true. |
@MarkL1961 It also returns true in another saved game I've tested. |
None of the commits since my #288 bug fix commit, have changed anything related to the game speed code so I don't yet know how this bug has come back after my simple commit fixed it on August 2nd. |
@MarkL1961 Your saved game and the other saved game I've tested are both level 1 hospitals which are won after the first year: so before the annual report dialog is opened, world:winGame() is called and line 1514 pauses the game but for some reason this setSpeed() call fails to pause the game. |
Another problem with winGame() being called at the end of the first year in a level 1 hospital is that the "end game?" fax message doesn't appear. winGame() works properly when its called 4 months later. |
Fax:close() is being called before the "end game?" fax message has been opened and before its icon has appeared, this sets the game speed from paused to normal after the annual report dialog has been displayed. Imo winGame() shouldn't be called at the end of a year until after the annual report dialog has been closed. |
This is the problem: the fax window and annual report window can't be displayed at the same time because they have the same window.modal_class, so the "end game?" fax window is deleted by ui.lua (before its icon has been clicked to make it visible) when the annual report window calls: ui.addWindow() I will submit a pull request later which will fix this bug. |
…losed This change is required to make my "288_fix" commit always prevent issue CorsixTH#286 and is also required to make the "end level?" fax window visible and usable when its shown at the end of a year. World:onTick() would first display the fax window for the "end level?" fax by calling OnEndMonth() and then it would call OnEndYear() which would open the window for the annual report and consequently close the "end level?" fax window before a player could see and use it. This fax window's close() function would also unpause the game while the annual report window was shown.
This change is required to make my "288_fix" commit always prevent issue CorsixTH#286 and is also required to make the "end level?" fax window visible and usable when its shown at the end of a year. World:onTick() would first display the fax window for the "end level?" fax by calling OnEndMonth() and then it would call OnEndYear() which would open the window for the annual report and consequently close the "end level?" fax window before a player could see and use it. This fax window's close() function would also unpause the game while the annual report window was shown.
For the win game fax you don't have to click on anything now as it should open on its own |
@MarkL1961 Yes it was being opened automatically but the conflict this fax window had with the annual report window, would close it before it became visible. |
This change is required to make my "288_fix" commit always prevent issue CorsixTH#286 and is also required to make the "end level?" fax window visible and usable when its shown at the end of a year. World:onTick() would first display the fax window for the "end level?" fax by calling OnEndMonth() and then it would call OnEndYear() which would open the window for the annual report and consequently close the "end level?" fax window before a player could see and use it. This fax window's close() function would also unpause the game while the annual report window was shown.
Just got around to testing this and it is working for me. I think it is safe to close now - thanks 👍 |
At year end the game should pause when the awards screen pops up and it no longer does
The text was updated successfully, but these errors were encountered: