From c827624404a31e7fb56dadd212c1a5953de37242 Mon Sep 17 00:00:00 2001 From: Thatchapon Unprasert Date: Sat, 6 Apr 2024 12:08:47 +0700 Subject: [PATCH] New code for red progress bar --- Sources/uYouPlus.h | 2 ++ Sources/uYouPlus.xm | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Sources/uYouPlus.h b/Sources/uYouPlus.h index 1a4e5bbf66..f2d36cd247 100644 --- a/Sources/uYouPlus.h +++ b/Sources/uYouPlus.h @@ -9,6 +9,8 @@ #import "uYouPlusThemes.h" // Hide "Buy Super Thanks" banner (_ASDisplayView) #import // Activate FLEX #import +#import +#import // Hide buttons under the video player by @PoomSmart #import diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index c3023b1b3f..1cb6532240 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -143,13 +143,27 @@ static BOOL findCell(ASNodeController *nodeController, NSArray *ide } %end -// Bring back the red progress bar - Broken?! +// Bring back the red progress bar - old versions %hook YTInlinePlayerBarContainerView - (id)quietProgressBarColor { return IS_ENABLED(@"redProgressBar_enabled") ? [UIColor redColor] : %orig; } %end +// Bring back the red progress bar - new versions +%hook YTPlayerBarRectangleDecorationView +- (void)drawRectangleDecorationWithSideMasks:(CGRect)rect { + if (IS_ENABLED(@"redProgressBar_enabled")) { + YTIPlayerBarDecorationModel *model = [self valueForKey:@"_model"]; + int overlayMode = model.playingState.overlayMode; + model.playingState.overlayMode = 1; + %orig; + model.playingState.overlayMode = overlayMode; + } else + %orig; +} +%end + // Hide videos' end screens // See YTNoHoverCards.x