Skip movies with `esc'

This commit is contained in:
Paul Chote
2010-08-16 17:39:32 +12:00
parent 38e5f70cbe
commit 0cf51d8142
3 changed files with 17 additions and 2 deletions

View File

@@ -390,9 +390,11 @@ namespace OpenRA
orderManager.StartGame();
}
public static event Action OnGameStart = () => { };
public static event Action OnGameStart = () => {};
public static event Action BeforeGameStart = () => {};
internal static void StartGame()
{
BeforeGameStart();
LoadMap(LobbyInfo.GlobalSettings.Map);
if (orderManager.GameStarted) return;
Widget.SelectedWidget = null;

View File

@@ -97,6 +97,19 @@ namespace OpenRA.Widgets
Game.Renderer.RgbaSpriteRenderer.DrawSprite(overlaySprite, videoOrigin, "chrome", videoSize);
}
public override bool HandleKeyPressInner(KeyInput e)
{
if (e.Event == KeyInputEvent.Down)
{
if (e.KeyChar == 27) // Escape
{
Stop();
return true;
}
}
return false;
}
public void Play()
{
PlayThen(() => {});

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
var gameRoot = r.GetWidget("INGAME_ROOT");
var optionsBG = gameRoot.GetWidget("INGAME_OPTIONS_BG");
Game.OnGameStart += () => r.OpenWindow("INGAME_ROOT");
Game.BeforeGameStart += () => r.OpenWindow("INGAME_ROOT");
Game.OnGameStart += () => gameRoot.GetWidget<RadarBinWidget>("INGAME_RADAR_BIN").SetWorld(Game.world);
r.GetWidget("INGAME_OPTIONS_BUTTON").OnMouseUp = mi => {