@@ -46,7 +46,7 @@ class CaptionEntry {
4646 break ;
4747
4848 case 2 :
49- style += `font-family: 'GorDIN';line-height: ${ Math . ceil ( CloseCaptioning . settings . fontSize / 20 * 24 ) } px` ;
49+ style += `font-family: 'GorDIN';line-height: ${ Math . ceil ( ( CloseCaptioning . settings . fontSize / 20 ) * 24 ) } px` ;
5050 break ;
5151
5252 case 3 :
@@ -173,7 +173,7 @@ class CloseCaptioning {
173173 this . showBox ( ) ;
174174 }
175175
176- static checkSizeAndPopIfNecessary ( bIsNewLowPriority : boolean ) : boolean {
176+ static checkSizeAndPopIfNecessary ( bIsNewLowPriority : boolean ) : boolean {
177177 return true ;
178178 const lowestTimeGlobal = { token : '' , emitTime : 999999999 } ;
179179 const lowestTimeLowPriority = { token : '' , emitTime : 999999999 } ;
@@ -200,16 +200,20 @@ class CloseCaptioning {
200200 // replace lowest priority ones if there are any
201201 if ( lowPriorityCount > 0 ) {
202202 // existence of lowestTimeLowPriority is implicit
203- $ . Msg ( `Caption count exceeded (${ captionCount } > ${ this . MAX_ENTRIES } ), removing: '${ lowestTimeLowPriority . token } '` ) ;
203+ $ . Msg (
204+ `Caption count exceeded (${ captionCount } > ${ this . MAX_ENTRIES } ), removing: '${ lowestTimeLowPriority . token } '`
205+ ) ;
204206 ClosedCaptionsAPI . RemoveCaption ( lowestTimeLowPriority . token ) ;
205207 return true ;
206- // if the incoming caption is low priority and there's no space, give up
208+ // if the incoming caption is low priority and there's no space, give up
207209 } else if ( bIsNewLowPriority ) {
208210 $ . Warning ( `Caption count exceeded (${ captionCount } > ${ this . MAX_ENTRIES } ), no space for any more!` ) ;
209211 return false ;
210212 }
211213 // for everything else, get rid of the least lifetime one
212- $ . Msg ( `Caption count exceeded (${ captionCount } > ${ this . MAX_ENTRIES } ), removing: '${ lowestTimeGlobal . token } '` ) ;
214+ $ . Msg (
215+ `Caption count exceeded (${ captionCount } > ${ this . MAX_ENTRIES } ), removing: '${ lowestTimeGlobal . token } '`
216+ ) ;
213217 ClosedCaptionsAPI . RemoveCaption ( lowestTimeGlobal . token ) ;
214218 return true ;
215219 }
@@ -232,32 +236,37 @@ class CloseCaptioning {
232236 const captionList = this . captions . get ( token ) ;
233237 if ( ! captionList ) {
234238 return ;
235- } ;
239+ }
236240 if ( captionList . length === 0 ) {
237241 return ;
238- } ;
242+ }
239243 const caption = captionList [ 0 ] ;
240244 caption . FadeOut ( ) ;
241245 } ) ;
242246
243247 // when a caption is missing. must have cc_captiontrace
244- $ . RegisterEventHandler ( 'BadCaption' , $ . GetContextPanel ( ) , ( token : string , lifetime : number , emitTime : number ) => {
245- this . addCaption ( token ,
246- new CaptionEntry (
248+ $ . RegisterEventHandler (
249+ 'BadCaption' ,
250+ $ . GetContextPanel ( ) ,
251+ ( token : string , lifetime : number , emitTime : number ) => {
252+ this . addCaption (
247253 token ,
248- {
249- bLowPriority : false ,
250- bSFX : false ,
251- nNoRepeat : 0 ,
252- nDelay : 0 ,
253- flLifetimeOverride : - 1.0 ,
254- text : `[MISSING] ${ token } ` ,
255- options : new Map < string , string > ( )
256- } ,
257- emitTime
258- )
259- ) ;
260- } ) ;
254+ new CaptionEntry (
255+ token ,
256+ {
257+ bLowPriority : false ,
258+ bSFX : false ,
259+ nNoRepeat : 0 ,
260+ nDelay : 0 ,
261+ flLifetimeOverride : - 1.0 ,
262+ text : `[MISSING] ${ token } ` ,
263+ options : new Map < string , string > ( )
264+ } ,
265+ emitTime
266+ )
267+ ) ;
268+ }
269+ ) ;
261270
262271 // display standard captions via token, usually from scenes
263272 $ . RegisterEventHandler (
@@ -286,8 +295,7 @@ class CloseCaptioning {
286295 // hide caption box when no more captions are being displayed
287296 static updateVisibility ( ) {
288297 for ( const [ token , list ] of this . captions ) {
289- if ( list . length > 0 )
290- return ;
298+ if ( list . length > 0 ) return ;
291299 }
292300 this . hideBox ( ) ;
293301 }
0 commit comments