share/hedgewars/Data/Scripts/Animate.lua
changeset 12599 d8adae379d3c
parent 12093 1da37e2ba6fd
child 12783 cb29ec085767
--- a/share/hedgewars/Data/Scripts/Animate.lua	Fri Sep 29 19:31:25 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Animate.lua	Fri Sep 29 21:44:35 2017 +0200
@@ -5,6 +5,8 @@
 local FunctionList, FunctionListNum
 local skipFuncList
 local skipping
+local baseInputMask = 0xFFFFFFFF
+local extraInputMask = baseInputMask
 --------------------------------Animation---------------------------------
 --------------------------(In-game cinematics)----------------------------
 
@@ -50,16 +52,27 @@
   RemoveFunction()
 end
 
+local function updateInputMask()
+     SetInputMask(band(baseInputMask, extraInputMask))
+end
+
 local function startCinemaLock()
      SetCinematicMode(true)
-     SetInputMask(bnot(gmAnimate+gmAttack+gmDown+gmHJump+gmLeft+gmLJump+gmRight+gmSlot+gmSwitch+gmTimer+gmUp+gmWeapon))
+     baseInputMask = bnot(gmAnimate+gmAttack+gmDown+gmHJump+gmLeft+gmLJump+gmRight+gmSlot+gmSwitch+gmTimer+gmUp+gmWeapon)
+     updateInputMask()
 end
 
 local function stopCinemaLock()
-     SetInputMask(0xFFFFFFFF)
+     baseInputMask = 0xFFFFFFFF
+     updateInputMask()
      SetCinematicMode(false)
 end
 
+function AnimSetInputMask(newExtraInputMask)
+     extraInputMask = newExtraInputMask
+     updateInputMask()
+end
+
 function AnimInit(startAnimating)
   lastx = 0
   lasty = 0