's' key to speed up demo playing
authorunc0rr
Sun, 02 Dec 2007 17:29:20 +0000
changeset 626 a30171dbcd19
parent 625 373353eaa742
child 627 92e136c3eb46
's' key to speed up demo playing
hedgewars/CCHandlers.inc
hedgewars/uConsole.pas
hedgewars/uGame.pas
hedgewars/uKeys.pas
hedgewars/uMisc.pas
--- a/hedgewars/CCHandlers.inc	Sat Dec 01 12:38:15 2007 +0000
+++ b/hedgewars/CCHandlers.inc	Sun Dec 02 17:29:20 2007 +0000
@@ -501,3 +501,13 @@
        end;
   end
 end;
+
+procedure chSpeedup_p(var s: shortstring);
+begin
+isSpeed:= true
+end;
+
+procedure chSpeedup_m(var s: shortstring);
+begin
+isSpeed:= false
+end;
--- a/hedgewars/uConsole.pas	Sat Dec 01 12:38:15 2007 +0000
+++ b/hedgewars/uConsole.pas	Sun Dec 02 17:29:20 2007 +0000
@@ -299,6 +299,8 @@
 RegisterVariable('addhh'   , vtCommand, @chAddHH        , false);
 RegisterVariable('hhcoords', vtCommand, @chSetHHCoords  , false);
 RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false);
+RegisterVariable('+speedup', vtCommand, @chSpeedup_p    , true );
+RegisterVariable('-speedup', vtCommand, @chSpeedup_m    , true );
 RegisterVariable('skip'    , vtCommand, @chSkip         , false);
 RegisterVariable('say'     , vtCommand, @chSay          , true );
 RegisterVariable('ammomenu', vtCommand, @chAmmoMenu     , false);
--- a/hedgewars/uGame.pas	Sat Dec 01 12:38:15 2007 +0000
+++ b/hedgewars/uGame.pas	Sun Dec 02 17:29:20 2007 +0000
@@ -46,6 +46,7 @@
    end;
 if Lag > 100 then Lag:= 100
 else if GameType = gmtSave then Lag:= 2500;
+if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;
 
 i:= 1;
 while (GameState <> gsExit) and (i <= Lag) do
--- a/hedgewars/uKeys.pas	Sat Dec 01 12:38:15 2007 +0000
+++ b/hedgewars/uKeys.pas	Sun Dec 02 17:29:20 2007 +0000
@@ -120,6 +120,7 @@
 DefaultBinds[102]:= 'fullscr';
 DefaultBinds[104]:= 'findhh';
 DefaultBinds[112]:= 'pause';
+DefaultBinds[115]:= '+speedup';
 DefaultBinds[127]:= 'rotmask';
 SetDefaultBinds
 end;
--- a/hedgewars/uMisc.pas	Sat Dec 01 12:38:15 2007 +0000
+++ b/hedgewars/uMisc.pas	Sun Dec 02 17:29:20 2007 +0000
@@ -27,6 +27,7 @@
     isSoundEnabled  : boolean = true;
     isSEBackup      : boolean = true;
     isInMultiShoot  : boolean = false;
+    isSpeed         : boolean = false;
 
     GameState     : TGameState = Low(TGameState);
     GameType      : TGameType = gmtLocal;