Pause the game when users navigate to the options menu in SP mode

This commit is contained in:
Scott_NZ
2013-03-17 21:14:49 +13:00
parent 86b55a6444
commit 2722fc5434
7 changed files with 37 additions and 15 deletions

View File

@@ -30,7 +30,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var optionsBG = gameRoot.Get("INGAME_OPTIONS_BG");
r.Get<ButtonWidget>("INGAME_OPTIONS_BUTTON").OnClick = () =>
{
optionsBG.Visible = !optionsBG.Visible;
if (world.LobbyInfo.IsSinglePlayer)
world.IssueOrder(Order.PauseGame());
};
optionsBG.Get<ButtonWidget>("DISCONNECT").OnClick = () =>
{
@@ -43,14 +47,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
optionsBG.Get<ButtonWidget>("SETTINGS").OnClick = () => Ui.OpenWindow("SETTINGS_MENU");
optionsBG.Get<ButtonWidget>("MUSIC").OnClick = () => Ui.OpenWindow("MUSIC_MENU");
optionsBG.Get<ButtonWidget>("RESUME").OnClick = () => optionsBG.Visible = false;
optionsBG.Get<ButtonWidget>("RESUME").OnClick = () =>
{
optionsBG.Visible = false;
if (world.LobbyInfo.IsSinglePlayer)
world.IssueOrder(Order.PauseGame());
};
optionsBG.Get<ButtonWidget>("SURRENDER").IsVisible = () => false;
Ui.Root.Get<ButtonWidget>("INGAME_STATS_BUTTON").OnClick = () =>
{
var stats = gameRoot.Get("OBSERVER_STATS");
stats.Visible = !stats.Visible;
};
Ui.Root.Get<ButtonWidget>("INGAME_STATS_BUTTON").OnClick = () => gameRoot.Get("OBSERVER_STATS").Visible ^= true;
}
void UnregisterEvents()