Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 6 additions and 4 deletions
Showing only changes of commit 19815dbb4d - Show all commits

View File

@ -59,6 +59,7 @@ sequence.stop = function () {
if (sequence._state.stop) sequence._state.stop() if (sequence._state.stop) sequence._state.stop()
if (sequence._state.input) sequence._state.input() if (sequence._state.input) sequence._state.input()
sequence._state.stop = null sequence._state.stop = null
sequence._state.input = null sequence._state.input = null
} }
@ -73,25 +74,26 @@ sequence.resume = function () {
} }
sequence.step = function () { sequence.step = function () {
log.info('step', `Started step ${sequence._state.count}`)
if (sequence._state.active && !sequence._state.paused) { if (sequence._state.active && !sequence._state.paused) {
if (sequence._state.arr.length > 0) { if (sequence._state.arr.length > 0) {
if (sequence._state.count > sequence._state.arr.length) { if (sequence._state.count > sequence._state.arr.length - 1) {
return sequence.stop() return sequence.stop()
} }
log.info('step') log.info('step', sequence._state.count)
return sequence._state.arr[sequence._state.count](() => { return sequence._state.arr[sequence._state.count](() => {
sequence._state.count++ sequence._state.count++
sequence.step() sequence.step()
}) })
} else if (sequence._loop.arr.length > 0) { } else if (sequence._loop.arr.length > 0) {
if (sequence._state.count > sequence._loop.arr.length) { if (sequence._state.count > sequence._loop.arr.length - 1) {
sequence._state.count = 0 sequence._state.count = 0
sequence._loop.count++ sequence._loop.count++
} }
if (sequence._loop.max > 0 && sequence._loop.count > sequence._loop.max) { if (sequence._loop.max > 0 && sequence._loop.count > sequence._loop.max) {
return sequence.stop() return sequence.stop()
} }
log.info() log.info('step', sequence._state.count)
return sequence._loop.arr[sequence._state.count](() => { return sequence._loop.arr[sequence._state.count](() => {
sequence._state.count++ sequence._state.count++
sequence.step() sequence.step()