Add looping support for line templates. Produce multiple whole lines here, instead of multiple copies of each syllable one after another on the same line.

Originally committed to SVN as r1553.
This commit is contained in:
Niels Martin Hansen 2007-09-03 13:39:03 +00:00
parent 62ded21ece
commit fda44c93a5

View file

@ -443,6 +443,9 @@ function apply_line(meta, styles, subs, line, templates, tenv)
-- Apply all line templates -- Apply all line templates
aegisub.debug.out(5, "Running line templates\n") aegisub.debug.out(5, "Running line templates\n")
for t in matching_templates(templates.line, line, tenv) do for t in matching_templates(templates.line, line, tenv) do
tenv.j = 0
while tenv.j < t.loops do
tenv.j = tenv.j + 1
if t.code then if t.code then
aegisub.debug.out(5, "Code template, %s\n", t.code) aegisub.debug.out(5, "Code template, %s\n", t.code)
tenv.line = line tenv.line = line
@ -483,6 +486,7 @@ function apply_line(meta, styles, subs, line, templates, tenv)
subs.append(newline) subs.append(newline)
end end
end end
end
aegisub.debug.out(5, "Done running line templates\n\n") aegisub.debug.out(5, "Done running line templates\n\n")
-- Loop over syllables -- Loop over syllables