# HG changeset patch # User Wuzzy # Date 1545153973 -3600 # Node ID ca851d0957cf0b8d10e037fda37fcb250b9d6041 # Parent ead8928a59f80135038d7725b4b5d351a848b733 Add Lua callback: onGameResult diff -r ead8928a59f8 -r ca851d0957cf ChangeLog.txt --- a/ChangeLog.txt Tue Dec 18 18:16:31 2018 +0100 +++ b/ChangeLog.txt Tue Dec 18 18:26:13 2018 +0100 @@ -20,6 +20,7 @@ + New call: GetMissionVar(varname): Get value of mission variable + New call: SetTurnTimePaused(isPaused): Call with true to pause turn time, false to unpause + New call: GetTurnTimePaused(): Returns true if turn time is paused due to Lua + + New callback: onGameResult(winningClan): Called when the game ends normally. winningClan = index of winning clan or -1 on draw + Params explode, poison in the SpawnFake*Crate functions now optional and default to false ====================== 0.9.25 ====================== diff -r ead8928a59f8 -r ca851d0957cf hedgewars/uStats.pas --- a/hedgewars/uStats.pas Tue Dec 18 18:16:31 2018 +0100 +++ b/hedgewars/uStats.pas Tue Dec 18 18:26:13 2018 +0100 @@ -553,13 +553,17 @@ // now to console if winnersClan <> nil then begin + ScriptCall('onGameResult', winnersClan^.ClanIndex); WriteLnToConsole('WINNERS'); WriteLnToConsole(inttostr(winnersClan^.TeamsNumber)); for t:= 0 to winnersClan^.TeamsNumber - 1 do WriteLnToConsole(winnersClan^.Teams[t]^.TeamName); end else + begin + ScriptCall('onGameResult', -1); WriteLnToConsole('DRAW'); + end; ScriptCall('onAchievementsDeclaration'); end;