Skip to content

Commit 3c1a0ca

Browse files
authored
Merge pull request #11 from petzku/timing-assistant/remove-500ms-limits
[TimingAssistant] Remove forced 500ms gap from kf
2 parents 18c22da + ddf4f48 commit 3c1a0ca

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

macros/phos.TimingAssistant.moon

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export script_name = "Timing Assistant"
22
export script_description = "A second brain for timers."
3-
export script_version = "2.0.0"
3+
export script_version = "2.0.1"
44
export script_author = "PhosCity"
55
export script_namespace = "phos.TimingAssistant"
66

@@ -221,22 +221,10 @@ timeStart = (sub, sel, opt) ->
221221
-- Line Linking
222222
if endTimePrevious and math.abs(endTimePrevious - startTime) < opt.startLink and not isKeyframe(endTimePrevious)
223223
previousKeyframe, nextKeyframe = findAdjacentKeyframes endTimePrevious
224-
keyframePlus500ms = getTime(previousKeyframe) + 500
225224

226-
if startTime < endTimePrevious and endTimePrevious < keyframePlus500ms
227-
line.start_time = startTime - opt.startLeadIn unless snap
228-
previousLine.end_time = getTime previousKeyframe
229-
debugMsg opt, "Link lines failed because a keyframe is close. Snap end of last line. Add lead in to current line."
230-
231-
elseif (startTime - opt.startLeadIn) > (getTime(nextKeyframe) - 500)
232-
line.start_time = getTime(nextKeyframe) - 500 unless snap
233-
previousLine.end_time = line.start_time - opt.gap
234-
debugMsg opt, "Link lines by ensuring that start time is 500 ms away from next keyframe."
235-
236-
else
237-
line.start_time = startTime - math.min(opt.startLeadIn, startTime - keyframePlus500ms) unless snap
238-
previousLine.end_time = line.start_time - opt.gap
239-
debugMsg opt, "Link lines by adding appropriate lead in to current line."
225+
line.start_time = startTime - opt.startLeadIn unless snap
226+
previousLine.end_time = line.start_time - opt.gap
227+
debugMsg opt, "Link lines by adding appropriate lead in to current line."
240228

241229
sub[i - j] = previousLine
242230
link = true
@@ -275,8 +263,8 @@ timeEnd = (sub, sel, opt) ->
275263
if opt.endKeysnapAfter >= 850 and nextKfDistance >= 850 and nextKfDistance <= opt.endKeysnapAfter and previousKfDistance > opt.endKeysnapBefore
276264
cps = calculateCPS(line)
277265
if cps <= 15
278-
line.end_time = endTime + math.min(opt.endLeadOut, nextKfDistance - 500)
279-
debugMsg opt, "cps is less than 15.\nAdjusting end time so that it's 500 ms away from keyframe or adding lead out whichever is lesser."
266+
line.end_time = endTime + opt.endLeadOut
267+
debugMsg opt, "cps is less than 15.\nAdding lead out normally."
280268
else
281269
line.end_time = getTime nextKeyframe
282270
debugMsg opt, "cps is more than 15.\nSnapping to keyframe more than 850 ms away."

0 commit comments

Comments
 (0)