@@ -463,6 +463,24 @@ public static SKBitmap DrawTimestamp(SKBitmap sectionImage, List<SKBitmap> image
463
463
}
464
464
public SKBitmap DrawBadges ( SKBitmap sectionImage , List < SKBitmap > imageList , ChatRenderOptions renderOptions , List < ChatBadge > chatBadges , Comment comment , Size canvasSize , ref Point drawPos )
465
465
{
466
+ //A little easter egg for my Twitch username won't hurt :)
467
+ if ( comment . commenter . name == "ilovekeepo69" && chatBadges . Any ( x => x . Name == "ilovekeepo69" ) )
468
+ {
469
+ SKBitmap badgeImage = chatBadges . Where ( x => x . Name == "ilovekeepo69" ) . First ( ) . Versions [ "1" ] ;
470
+ using ( SKCanvas sectionImageCanvas = new SKCanvas ( sectionImage ) )
471
+ {
472
+ float imageRatio = ( float ) ( renderOptions . EmoteScale * 0.5 ) ;
473
+ float imageSize = badgeImage . Width * imageRatio ;
474
+ float left = ( float ) drawPos . X ;
475
+ float right = imageSize + left ;
476
+ float top = ( float ) ( ( sectionImage . Height - imageSize ) / 2 ) ;
477
+ float bottom = imageSize + top ;
478
+ SKRect drawBox = new SKRect ( left , top , right , bottom ) ;
479
+ sectionImageCanvas . DrawBitmap ( badgeImage , drawBox , imagePaint ) ;
480
+ drawPos . X += ( int ) Math . Floor ( 20 * renderOptions . EmoteScale ) ;
481
+ }
482
+ }
483
+
466
484
if ( comment . message . user_badges != null )
467
485
{
468
486
foreach ( var badge in comment . message . user_badges )
@@ -502,7 +520,6 @@ public SKBitmap DrawBadges(SKBitmap sectionImage, List<SKBitmap> imageList, Chat
502
520
}
503
521
}
504
522
}
505
-
506
523
return sectionImage ;
507
524
}
508
525
public static SKBitmap DrawUsername ( SKBitmap sectionImage , List < SKBitmap > imageList , ChatRenderOptions renderOptions , SKPaint nameFont , string userName , SKColor userColor , Size canvasSize , ref Point drawPos )
0 commit comments