# HG changeset patch # User sheepluva # Date 1453533074 -3600 # Node ID 663ecfb05df6c3be4b315a35c5134e13ddc17e6f # Parent aab4767d9a50b4d18b2447c2ca2ca25ad7b1ec81 Lua API: SetCinematicMode(enable) diff -r aab4767d9a50 -r 663ecfb05df6 ChangeLog.txt --- a/ChangeLog.txt Sat Jan 23 07:53:57 2016 +0100 +++ b/ChangeLog.txt Sat Jan 23 08:11:14 2016 +0100 @@ -12,6 +12,8 @@ * Fixed screenshots being too bright if taken in quick succession * Fixed hog-speech missing a response type (Justyouwait/"You're gonna pay for that") on some platforms (e.g. Linux) * Various other fixes +Lua-API: + + New call: SetCinematicMode(enable) -- e.g. for cutscenes etc. 0.9.21 -> 0.9.22 + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs) diff -r aab4767d9a50 -r 663ecfb05df6 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Sat Jan 23 07:53:57 2016 +0100 +++ b/hedgewars/uScript.pas Sat Jan 23 08:11:14 2016 +0100 @@ -440,6 +440,20 @@ lc_setweapon:= 0; end; +// enable/disable cinematic effects +function lc_setcinematicmode(L : Plua_State) : LongInt; Cdecl; +var at: LongInt; +const + call = 'SetCinematicMode'; + params = 'enable'; +begin + if (CheckLuaParamCount(L, 1, call, params)) then + begin + CinematicScript:= lua_toboolean(L, 1); + end; + lc_setcinematicmode:= 0; +end; + // no parameter means reset to default (and 0 means unlimited) function lc_setmaxbuilddistance(L : Plua_State) : LongInt; Cdecl; var np: LongInt; @@ -3340,6 +3354,7 @@ lua_register(luaState, _P'SetWaterLine', @lc_setwaterline); lua_register(luaState, _P'SetNextWeapon', @lc_setnextweapon); lua_register(luaState, _P'SetWeapon', @lc_setweapon); +lua_register(luaState, _P'SetCinematicMode', @lc_setcinematicmode); lua_register(luaState, _P'SetMaxBuildDistance', @lc_setmaxbuilddistance); // drawn map functions lua_register(luaState, _P'AddPoint', @lc_addPoint); diff -r aab4767d9a50 -r 663ecfb05df6 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Sat Jan 23 07:53:57 2016 +0100 +++ b/hedgewars/uVariables.pas Sat Jan 23 08:11:14 2016 +0100 @@ -215,6 +215,7 @@ InCinematicMode : boolean; CinematicSteps : LongInt; CinematicBarH : LongInt; + CinematicScript : boolean; UIDisplay : TUIDisplay; LocalMessage : LongWord; @@ -2691,6 +2692,7 @@ InCinematicMode := false; CinematicSteps := 0; CinematicBarH := 0; + CinematicScript := false; // those values still are not perfect cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth); diff -r aab4767d9a50 -r 663ecfb05df6 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sat Jan 23 07:53:57 2016 +0100 +++ b/hedgewars/uWorld.pas Sat Jan 23 08:11:14 2016 +0100 @@ -1383,9 +1383,9 @@ SetScale(cDefaultZoomLevel); // cinematic effects -if InCinematicMode +if CinematicScript or (InCinematicMode and ((CurrentHedgehog = nil) or CurrentHedgehog^.Team^.ExtDriven - or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo)) then + or (CurrentHedgehog^.BotLevel <> 0) or (GameType = gmtDemo))) then begin inc(CinematicSteps, Lag); if CinematicSteps > 300 then