@@ -28,9 +28,15 @@ frameFromMs = aegisub.frame_from_ms
2828class LineCollection
2929 @version : version
3030
31- new : ( @sub , sel, validationCb, selectLines= true ) =>
31+ @fromAllLines : ( sub, validationCb, selectLines ) =>
32+ sel = { }
33+ for i = 1 , # @sub
34+ table.insert ( sel, i ) if @sub [ i] . class == " dialogue"
35+ @ sub, sel, validationCb, selectLines
36+
37+ new : ( @sub , sel, validationCb, selectLines = true ) =>
3238 @lines = { }
33- if sel and # sel > 0
39+ if type ( sel ) == " table " and # sel > 0
3440 @collectLines sel, validationCb, selectLines
3541 if frameFromMs 0
3642 @getFrameInfo !
@@ -43,7 +49,7 @@ class LineCollection
4349
4450 -- This method should update various properties such as
4551 -- (start|end)(Time|Frame).
46- addLine : ( line, validationCb = ( -> return true ) , selectLine= true , index= false ) =>
52+ addLine : ( line, validationCb = ( -> return true ) , selectLine = true , index = false ) =>
4753 if validationCb line
4854 line. parentCollection = @
4955 line. inserted = false
@@ -95,7 +101,7 @@ class LineCollection
95101
96102 @hasMetaStyles = true
97103
98- collectLines : ( sel, validationCb = ( ( line ) -> return not line. comment) , selectLines= true ) =>
104+ collectLines : ( sel, validationCb = (( line ) -> return not line. comment) , selectLines = true ) =>
99105 unless @hasMetaStyles
100106 @generateMetaAndStyles !
101107
0 commit comments