OpenRA/OpenRA — pull request #2149 by TheUnknownCylon (2012-05-16 19:46:16+00:00)
Title: Simplepause

The what: This branch demonstrates the possibility of a pause function for the OpenRA game engine.

The why: when playing with a friend or family member, it is sometimes desired to pause the game. For instance to get a drink or something to eat, when the phone rings, etc. Pausing the game will not ruin your life then, and it also won't ruin your game.

The how: the usage is very simple now. During the game, one can press the PAUSE key on the keyboard, and the game will pause. The game can be un-paused by pressing the key again.

In the background the following is done to make this work:
* The client sends PAUSE GAME REQUEST to the server.
* The server replies with PAUSE GAME to all clients.
* From now on, the ordermanager.tick() will not be invoked
Note: pause messages are immediate orders (so one can unpause).

Some remarks:
* Orders can be given, but are queued. The UI will not update these orders until the game un-pauses.
* It has been tested with 1vs1.

Possible future extentions:
* Adding a pause option in the game-menu (for keyboards without a pause-key)
* Freeze the game with a "pause screen", where the user can un-pause, resign, chat, and change settings
* By the game-creating adding a setting which enables/disables the pause-option.