Cache pause state and switch back to it when closing the ingame menu. Fix formatting fail in d2k mod.yaml
This commit is contained in:
@@ -38,14 +38,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
|
||||
void InitRootWidgets()
|
||||
{
|
||||
var cachedPause = false;
|
||||
Widget optionsBG = null;
|
||||
optionsBG = Game.LoadWidget(world, "INGAME_OPTIONS_BG", Ui.Root, new WidgetArgs
|
||||
{
|
||||
{ "onExit", () =>
|
||||
{
|
||||
if (world.LobbyInfo.IsSinglePlayer)
|
||||
world.IssueOrder(Order.PauseGame(false));
|
||||
optionsBG.Visible = false;
|
||||
|
||||
if (world.LobbyInfo.IsSinglePlayer)
|
||||
world.IssueOrder(Order.PauseGame(cachedPause));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -53,8 +55,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
||||
gameRoot.Get<ButtonWidget>("INGAME_OPTIONS_BUTTON").OnClick = () =>
|
||||
{
|
||||
optionsBG.Visible ^= true;
|
||||
if (optionsBG.Visible)
|
||||
{
|
||||
cachedPause = world.Paused;
|
||||
|
||||
if (world.LobbyInfo.IsSinglePlayer)
|
||||
world.IssueOrder(Order.PauseGame(optionsBG.Visible));
|
||||
world.IssueOrder(Order.PauseGame(true));
|
||||
}
|
||||
else
|
||||
world.IssueOrder(Order.PauseGame(cachedPause));
|
||||
};
|
||||
|
||||
Game.LoadWidget(world, "CHAT_PANEL", gameRoot, new WidgetArgs());
|
||||
|
||||
@@ -61,7 +61,8 @@ ChromeLayout:
|
||||
mods/ra/chrome/dropdowns.yaml
|
||||
mods/ra/chrome/modchooser.yaml
|
||||
mods/ra/chrome/cheats.yaml
|
||||
mods/ra/chrome/musicplayer.yaml mods/d2k/chrome/tooltips.yaml
|
||||
mods/ra/chrome/musicplayer.yaml
|
||||
mods/d2k/chrome/tooltips.yaml
|
||||
Weapons:
|
||||
mods/d2k/weapons/defaults.yaml
|
||||
mods/d2k/weapons/explosions.yaml
|
||||
|
||||
Reference in New Issue
Block a user