if maxi<2 then aegisub.cancel() end if i==1 then pressed,results=aegisub.dialog.display( { {x=0,y=0,width=1,height=1,class="label",label="Wipe duration (in):"}, {x=1,y=0,width=1,height=1,class="intedit",name="wdur",min=0,value=100,hint="Time from when the beginning of the text first appears to when the end first appears"}, {x=2,y=0,width=1,height=1,class="label",label="Wipe duration (out):"}, {x=3,y=0,width=1,height=1,class="intedit",name="wdur2",min=0,value=100,hint="Time from when the beginning of the text first appears to when the end first appears"}, {x=0,y=1,width=1,height=1,class="label",label="Fade duration (in):"}, {x=1,y=1,width=1,height=1,class="intedit",name="fdur",min=0,value=100,hint="Time from when a segment of text first appears to when it's fully opaque"}, {x=2,y=1,width=1,height=1,class="label",label="Fade duration (out):"}, {x=3,y=1,width=1,height=1,class="intedit",name="fdur2",min=0,value=100,hint="Time from when a segment of text first appears to when it's fully opaque"}, {x=0,y=2,width=2,height=1,class="checkbox",name="rev",value=false,label="Reverse (in)"}, {x=2,y=2,width=2,height=1,class="checkbox",name="rev2",value=false,label="Reverse (out)"} }, {"OK","Cancel"}) if pressed=="Cancel" then aegisub.cancel() end flags.off=results.wdur/(maxi-1) flags.off2=results.wdur2/(maxi-1) flags.fad=results.fdur flags.rev=results.rev flags.fad2=results.fdur2 flags.rev2=results.rev2 end if results.rev then line.start_time=math.floor(line.start_time+maxi*flags.off-i*flags.off) else line.start_time=math.floor(line.start_time+(i-1)*flags.off) end if results.rev2 then line.end_time=math.floor(line.end_time-(i-1)*flags.off2) else line.end_time=math.floor(line.end_time-maxi*flags.off2+i*flags.off2) end if j==1 then remove("fad") tag=tag:gsub("{",("{\\fad(%d,%d)"):format(flags.fad,flags.fad2)):gsub("\\fad%(0,0%)","") end