share/hedgewars/Data/Scripts/Animate.lua
changeset 7263 644eabbc9218
parent 7255 93cf6b3b89be
child 7438 195f9cbd6df6
equal deleted inserted replaced
7261:158f8fb74ded 7263:644eabbc9218
     9 
     9 
    10 function AddSkipFunction(anim, func, args)
    10 function AddSkipFunction(anim, func, args)
    11   skipFuncList[anim] = {sfunc = func, sargs = args}
    11   skipFuncList[anim] = {sfunc = func, sargs = args}
    12 end
    12 end
    13 
    13 
    14 function RemoveSkipFunctin(anim)
    14 function RemoveSkipFunction(anim)
    15   skipFuncList[anim] = nil
    15   skipFuncList[anim] = nil
    16 end
    16 end
    17 
    17 
    18 function SetAnimSkip(bool)
    18 function SetAnimSkip(bool)
    19   skipping = bool
    19   skipping = bool
   321   stageEvents[seNum].dFunc = doFunc
   321   stageEvents[seNum].dFunc = doFunc
   322   stageEvents[seNum].dArgs = doArgs
   322   stageEvents[seNum].dArgs = doArgs
   323   stageEvents[seNum].evType = evType
   323   stageEvents[seNum].evType = evType
   324 end
   324 end
   325 
   325 
       
   326 function AddNewEvent(condFunc, condArgs, doFunc, doArgs, evType)
       
   327   local i
       
   328   for i = 1, seNum do
       
   329     if stageEvents[i].cFunc == condFunc and stageEvents[i].cArgs == condArgs and
       
   330        stageEvents[i].dFunc == doFunc and stageEvents[i].dArgs == doArgs and 
       
   331        stageEvents[seNum].evType == evType then
       
   332        return
       
   333     end
       
   334   end
       
   335   AddEvent(condFunc, condArgs, doFunc, doArgs, evType)
       
   336 end
       
   337 
   326 function RemoveEvent(evNum)
   338 function RemoveEvent(evNum)
   327   if stageEvents[evNum] ~= nil then
   339   if stageEvents[evNum] ~= nil then
   328     seNum = seNum - 1
   340     seNum = seNum - 1
   329     table.remove(stageEvents, evNum)
   341     table.remove(stageEvents, evNum)
   330   end
   342   end