noxworld-dev / opennox

OpenNox main repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In-game menu becomes inaccessible after exiting to menu with Alt+F4

comradeshook opened this issue · comments

When you exit to menu via Alt+F4 (... which i didn't know was a thing before i tried to hard close the game after #662 happened) and then immediately load a game afterwards, the Esc menu becomes inaccessible; pressing Esc simply does nothing, which persists until you close the game again. Furthermore, once this bug is triggered, Quit in the main menu similarly does nothing when clicked.

To reproduce:

  1. Load a game
  2. Press Alt+F4, returning to the main menu
  3. Click on Quit; nothing happens (bug is already triggered here)
  4. Load a game again
  5. Press Esc, observe as nothing happens

Game can be closed by pressing Alt+F4 twice.

Playing on Windows, GOG version, v1.9.0 alpha12.

I mentioned in #636 that hitting the the X to close the game creates musical issues. I just did some more testing on this and learned something else that might be causing the issue.

In Nox Reloaded, hitting Alt+F4 closes Nox completely and brings you to your desktop, which is why @comradeshook never thought it was a thing in the first place. In OpenNox, Alt+F4 behaves differently; it closes the game, but brings you to the main menu. The question still pops up if you're sure you want to quit, but it's only for a single frame before the game shuts down (for either engine).

Strangely enough, though, when you hit the X to close the window in a game, the "are you sure" window does NOT pop up, but still brings you to the main menu. After loading another game, Escape continues to function properly.

I think the "Are you sure?" window is creating the issues. Nox Reloaded just bypasses the issue entirely by shutting down Nox completely, but when we try to create clever shortcuts to the menu, then we uncover a problem that Westwood already resolved, just in a lazy way.

That makes sense! There's also the thing that F4 on its own is a quickload button for the autosave, which is the "are you sure" you're getting when you press Alt+F4. I did a quick bit of testing, and indeed, if you unbind F4, this bug doesn't trigger, so it checks out that it's related to the popup.

OKAY!!! UPDATE!!!!

@comradeshook Your hypothesis made me go back and start testing more. I hit F4, pulling up the "Are you sure" screen for quickloading, and THEN hit the X to close the window, and THEN Escape didn't work, not in the menu, and not in game. On top of that, loading another game causes F4's "are you sure" screen to NOT pop up.

Also, hitting Quit in the menu is supposed to pop up the "Are you sure you want to quit?" window, but after this bug has occurred, the game just straight up quits without the window popping up.

This is awesome guys! Now I know exactly what to looks for! Thank you a lot! 💪

Excellent, nice sciencing @KILAH4716!