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

Game no longer pauses for year end awards screen #286

Closed
MarkL1961 opened this issue Jul 14, 2014 · 13 comments
Closed

Game no longer pauses for year end awards screen #286

MarkL1961 opened this issue Jul 14, 2014 · 13 comments
Labels

Comments

@MarkL1961
Copy link
Contributor

At year end the game should pause when the awards screen pops up and it no longer does

@J-Shep
Copy link
Contributor

J-Shep commented Jul 15, 2014

@MarkL1961 I will try to fix this bug by Saturday if your not already working on this.

@MarkL1961
Copy link
Contributor Author

I am not sure this is fixed!
I am testing with CTH-20140824-master-b408fa2818 and not only did the game not pause at year end I also did not get the fax to move on to the next level. Speed setting 3 or speedup has the same result.

save

@MarkL1961 MarkL1961 reopened this Aug 28, 2014
@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

@MarkL1961 Today I will investigate why this bug is back.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

@MarkL1961 In your saved game the game isn't paused because for some reason world:isCurrentSpeed("Pause") is returning true.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

@MarkL1961 It also returns true in another saved game I've tested.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

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.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

@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.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

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.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

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.

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

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.

@J-Shep J-Shep added Fixed and removed Fixed labels Aug 29, 2014
J-Shep pushed a commit to J-Shep/CorsixTH that referenced this issue Aug 29, 2014
…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.
J-Shep pushed a commit to J-Shep/CorsixTH that referenced this issue Aug 29, 2014
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.
@MarkL1961
Copy link
Contributor Author

For the win game fax you don't have to click on anything now as it should open on its own

@J-Shep
Copy link
Contributor

J-Shep commented Aug 29, 2014

@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.

J-Shep pushed a commit to J-Shep/CorsixTH that referenced this issue Aug 30, 2014
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.
@MarkL1961
Copy link
Contributor Author

Just got around to testing this and it is working for me. I think it is safe to close now - thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants