Engine:
authorsmaxx
Wed, 01 Sep 2010 20:41:45 +0200
changeset 3799 5341dc5a8919
parent 3798 7dcfdd595b30
child 3800 32cb5e1a6293
Engine: * Changed ready time's message to include the team name and show as a gamestate message * Moved ready time handling to ProcessGears in uGears (TurnTimeLeft handling)
hedgewars/hwengine.pas
hedgewars/uGears.pas
hedgewars/uStore.pas
hedgewars/uTeams.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/hwengine.pas	Wed Sep 01 18:06:52 2010 +0200
+++ b/hedgewars/hwengine.pas	Wed Sep 01 20:41:45 2010 +0200
@@ -85,7 +85,7 @@
                 ProcessKbd;
                 if not isPaused then
                     begin
-                    if ReadyTimeLeft = 0 then DoGameTick(Lag);
+                    DoGameTick(Lag);
                     ProcessVisualGears(Lag);
                     end;
                 end;
--- a/hedgewars/uGears.pas	Wed Sep 01 18:06:52 2010 +0200
+++ b/hedgewars/uGears.pas	Wed Sep 01 20:41:45 2010 +0200
@@ -848,7 +848,14 @@
                     and (CurrentHedgehog^.Gear <> nil)
                     and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then
                         PlaySound(sndHurry, CurrentTeam^.voicepack);
-                dec(TurnTimeLeft)
+                if ReadyTimeLeft > 0 then
+                    begin
+                    if ReadyTimeLeft = 2000 then
+                        PlaySound(sndComeonthen, CurrentTeam^.voicepack);
+                    dec(ReadyTimeLeft)
+                    end
+                else
+                    dec(TurnTimeLeft)
                 end;
 
 if skipFlag then
--- a/hedgewars/uStore.pas	Wed Sep 01 18:06:52 2010 +0200
+++ b/hedgewars/uStore.pas	Wed Sep 01 20:41:45 2010 +0200
@@ -26,7 +26,6 @@
 var PixelFormat: PSDL_PixelFormat;
     SDLPrimSurface: PSDL_Surface;
     PauseTexture,
-    ReadyTexture,
     SyncTexture,
     ConfirmTexture: PTexture;
     cScaleFactor: GLfloat;
@@ -447,7 +446,6 @@
 
 // TODO: are those textures ever freed?
 PauseTexture:= RenderStringTex(trmsg[sidPaused], cYellowColor, fntBig);
-ReadyTexture:= RenderStringTex(trmsg[sidReady], cYellowColor, fntBig);
 ConfirmTexture:= RenderStringTex(trmsg[sidConfirm], cYellowColor, fntBig);
 SyncTexture:= RenderStringTex(trmsg[sidSync], cYellowColor, fntBig);
 
--- a/hedgewars/uTeams.pas	Wed Sep 01 18:06:52 2010 +0200
+++ b/hedgewars/uTeams.pas	Wed Sep 01 20:41:45 2010 +0200
@@ -287,7 +287,8 @@
         PlaySound(sndIllGetYou, CurrentTeam^.voicepack)
     else
         PlaySound(sndYesSir, CurrentTeam^.voicepack);
-    ReadyTimeLeft:= cReadyDelay
+    ReadyTimeLeft:= cReadyDelay;
+    AddCaption(Format(shortstring(trmsg[sidReady]), CurrentTeam^.TeamName), cWhiteColor, capgrpGameState)
     end
 else
     begin
--- a/hedgewars/uWorld.pas	Wed Sep 01 18:06:52 2010 +0200
+++ b/hedgewars/uWorld.pas	Wed Sep 01 20:41:45 2010 +0200
@@ -857,18 +857,6 @@
 
 if fastUntilLag then DrawCentered(0, (cScreenHeight shr 1), SyncTexture);
 if isPaused then DrawCentered(0, (cScreenHeight shr 1), PauseTexture);
-if ReadyTimeLeft > 0 then
-    begin
-    // TODO: move outside drawing code or do a spearate step in ugears?
-    if (ReadyTimeLeft = 2000) or ((ReadyTimeLeft - Lag < 2000) and (ReadyTimeLeft > 2000)) then
-        PlaySound(sndComeonthen, CurrentTeam^.voicepack);
-
-    if ReadyTimeLeft > Lag then
-        dec(ReadyTimeLeft, Lag)
-    else
-        ReadyTimeLeft:= 0;
-    DrawCentered(0, (cScreenHeight shr 1), ReadyTexture);
-    end;
 if not isFirstFrame and (missionTimer <> 0) or isPaused or fastUntilLag or (GameState = gsConfirm) then
     begin
     if (ReadyTimeLeft = 0) and (missionTimer > 0) then dec(missionTimer, Lag);
--- a/share/hedgewars/Data/Locale/en.txt	Wed Sep 01 18:06:52 2010 +0200
+++ b/share/hedgewars/Data/Locale/en.txt	Wed Sep 01 20:41:45 2010 +0200
@@ -64,7 +64,7 @@
 01:11=This weapon or utility is not yet available!
 01:12=Last round till Sudden Death!
 01:13=%1 rounds till Sudden Death!
-01:14=Get ready!
+01:14=Get ready, %1!
 
 ; Event messages
 ; Hog (%1) died