Lua API: Add ReadyTimeLeft variable
authorWuzzy <almikes@aol.com>
Thu, 28 Sep 2017 18:36:24 +0200
changeset 12576 1fb961480b3c
parent 12575 0c5ce463949b
child 12577 e2b5c6e805e8
Lua API: Add ReadyTimeLeft variable
ChangeLog.txt
hedgewars/uScript.pas
--- a/ChangeLog.txt	Thu Sep 28 17:26:54 2017 +0200
+++ b/ChangeLog.txt	Thu Sep 28 18:36:24 2017 +0200
@@ -300,6 +300,7 @@
  + New variable: AirMinesNum -- Number of air mines being placed on a medium-sized map
  + New variable: WorldEdge -- World edge type (weNone, weWrap, weBounce, weSea)
  + New variable: AmmoTypeMax -- Maximum ammo type ID (useful to iterate through all ammo types, starting by 0)
+ + New variable: ReadyTimeLeft -- Remaining ready time, 0 if turn in progress. Can be set in onNewTurn
  + Locale library: loc_noop -- Mark string for translation but don't translate it
  + Animate library: AnimInit([startAnimating]) -- New parameter startAnimating: if true, will start game in cinematic mode with most controls disabled. Must play an animation after that
  * Fixed call: HideHog(gear) -- Fix crash when gear is invalid. Returns true on success or false otherwise
--- a/hedgewars/uScript.pas	Thu Sep 28 17:26:54 2017 +0200
+++ b/hedgewars/uScript.pas	Thu Sep 28 18:36:24 2017 +0200
@@ -3160,6 +3160,7 @@
 procedure SetGlobals;
 begin
 ScriptSetInteger('TurnTimeLeft', TurnTimeLeft);
+ScriptSetInteger('ReadyTimeLeft', ReadyTimeLeft);
 ScriptSetInteger('GameTime', GameTicks);
 ScriptSetInteger('TotalRounds', TotalRounds);
 ScriptSetInteger('WaterLine', cWaterLine);
@@ -3206,6 +3207,7 @@
 // It is inconsistent anyway to have some globals be read-only and others not with no indication whatsoever.
 // -- sheepluva
 TurnTimeLeft:= ScriptGetInteger('TurnTimeLeft');
+ReadyTimeLeft:= ScriptGetInteger('ReadyTimeLeft');
 end;
 
 procedure ScriptCall(fname : shortstring);