plbrault / youre-the-os

A game where you are a computer's OS and you have to manage processes, memory and I/O events.
https://plbrault.github.io/youre-the-os/
GNU General Public License v3.0
1.79k stars 68 forks source link

Open Menu/Pauses and unpause game using escape key. #76

Closed wviana closed 1 year ago

wviana commented 1 year ago

Please fell free to ask for any clarification.

Also removed _in_game_menu_is_open boolean as it was not necessary as _in_game_menu_dialog already represents if the menu is visible or not.

Loved it BTW :heart:

plbrault commented 1 year ago

That's a great idea! I will just need to confirm how it behaves on itch.io as the Escape key is usually used to leave fullscreen mode.

plbrault commented 1 year ago

After testing, it unfortunately does conflict with itch.io's handling of the Escape key in fullscreen. The result is that fullscreen mode is exited, but the menu does not open. I'm not sure what the solution could be.

Also, the PR seems to introduce a glitch where a rectangle appears for a fraction of a second in the top-left corner of the screen when opening the menu. I'm not sure why.

wviana commented 1 year ago

Hi @plbrault, Just updated this branch. I've created a account in itch.io. Uploaded my version and tested it. When on fullscreen it closes fullscreen. When not in fullscreen it pauses the game.

I it's acceptable behavior .

plbrault commented 1 year ago

Glitch mentioned in previous comment is still present.

plbrault commented 1 year ago

@wviana I closed your PR by accident and I seem to even have erased changes from your fork, but I recreated the same PR here: https://github.com/plbrault/youre-the-os/pull/90

I managed to fix the glitch