daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Nov 16th, 2018 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Component_InterpreterTimerFix extends gs.Component_CommandInterpreter
  2.     ###*
  3.     * Start Timer
  4.     * @method commandStartTimer
  5.     * @protected
  6.     ###
  7.     commandStartTimer: ->
  8.         scene = SceneManager.scene
  9.         timers = scene.timers
  10.         number = @interpreter.numberValueOf(@params.number)
  11.         timer = timers[number]
  12.         if not timer?
  13.             timer = new gs.Object_IntervalTimer()
  14.             timers[number] = timer
  15.  
  16.         timer.events.offByOwner("elapsed", @object)
  17.         timer.events.on("elapsed", (e) =>
  18.             params = e.data.params
  19.             switch params.action.type
  20.                 when 0 # Jump To Label
  21.                     if params.labelIndex?
  22.                         @interpreter.pointer = params.labelIndex
  23.                     else
  24.                         @interpreter.jumpToLabel(params.action.data.label)
  25.                 when 1 # Call Common Event
  26.                     @interpreter.callCommonEvent(params.action.data.commonEventId, null, @interpreter.isWaiting)
  27.         { params: @params }, @object)
  28.  
  29.         timer.behavior.interval = @interpreter.durationValueOf(@params.interval)
  30.         timer.behavior.start()
  31. gs.Component_CommandInterpreter = Component_InterpreterTimerFix
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top