@@ -274,6 +274,9 @@ export class Body {
274274 if ( focused || config . showHealthBars ) {
275275 this . drawHealthBar ( match , overlayCtx )
276276 }
277+ if ( focused || config . showPaintBars ) {
278+ this . drawPaintBar ( match , overlayCtx , config . showHealthBars )
279+ }
277280 }
278281 }
279282
@@ -435,6 +438,21 @@ export class Body {
435438 ctx . fillRect ( hpBarX , hpBarY , hpBarWidth * ( this . hp / this . maxHp ) , hpBarHeight )
436439 }
437440
441+ private drawPaintBar ( match : Match , ctx : CanvasRenderingContext2D , healthVisible : boolean ) : void {
442+ const dimension = match . currentRound . map . staticMap . dimension
443+ const interpCoords = this . getInterpolatedCoords ( match )
444+ const renderCoords = renderUtils . getRenderCoords ( interpCoords . x , interpCoords . y , dimension )
445+ const paintBarWidth = 0.8
446+ const paintBarHeight = 0.1
447+ const paintBarYOffset = 0.4 + ( healthVisible ? 0.11 : 0 )
448+ const paintBarX = renderCoords . x + 0.5 - paintBarWidth / 2
449+ const paintBarY = renderCoords . y + 0.5 + paintBarYOffset
450+ ctx . fillStyle = 'rgba(0,0,0,.3)'
451+ ctx . fillRect ( paintBarX , paintBarY , paintBarWidth , paintBarHeight )
452+ ctx . fillStyle = '#c515ed'
453+ ctx . fillRect ( paintBarX , paintBarY , paintBarWidth * ( this . paint / this . maxPaint ) , paintBarHeight )
454+ }
455+
438456 protected drawLevel ( match : Match , ctx : CanvasRenderingContext2D ) {
439457 if ( this . level <= 1 ) return
440458
0 commit comments