new PauseState to differentiate game and editor pausing

This commit is contained in:
Matthias Mailänder
2014-07-03 20:47:51 +02:00
parent d580ca6417
commit d1e18cad7a
8 changed files with 19 additions and 18 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
{
case "pause":
world.IssueOrder(new Order("PauseGame", null, false)
{ TargetString = world.Paused ? "UnPause" : "Pause" });
{ TargetString = world.Paused == World.PauseState.Paused ? "UnPause" : "Pause" });
break;
case "surrender":
world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));

View File

@@ -27,12 +27,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
var startTick = Ui.LastTickTime;
// Blink the status line
status.IsVisible = () => (world.Paused || world.Timestep != Game.Timestep)
status.IsVisible = () => (world.Paused == World.PauseState.Paused || world.Timestep != Game.Timestep)
&& (Ui.LastTickTime - startTick) / 1000 % 2 == 0;
status.GetText = () =>
{
if (world.Paused || world.Timestep == 0)
if (world.Paused == World.PauseState.Paused || world.Timestep == 0)
return "Paused";
if (world.Timestep == 1)

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
optionsBG.Visible ^= true;
if (optionsBG.Visible)
{
cachedPause = world.PredictedPaused;
cachedPause = world.PredictedPaused == World.PauseState.Paused;
if (world.LobbyInfo.IsSinglePlayer)
world.SetPauseState(true);