# HG changeset patch # User Wuzzy # Date 1506616584 -7200 # Node ID 1fb961480b3c410a78ee9e843934c14a6dc0f522 # Parent 0c5ce463949ba05e7668554e9e2f91974564eb50 Lua API: Add ReadyTimeLeft variable diff -r 0c5ce463949b -r 1fb961480b3c ChangeLog.txt --- 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 diff -r 0c5ce463949b -r 1fb961480b3c hedgewars/uScript.pas --- 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);