From 83ed531380b0327f12f2f9e52e5484d800202473 Mon Sep 17 00:00:00 2001 From: arichorn <78001398+arichorn@users.noreply.github.com> Date: Sat, 29 Jul 2023 21:25:33 -0500 Subject: [PATCH] Improvements --- uYouPlus.xm | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index 5abde3e..e3c84fe 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -61,24 +61,6 @@ static BOOL IsEnabled(NSString *key) { } %end -// Enable Share Button / Enable Save to Playlist Button -%hook YTMainAppControlsOverlayView -- (void)setShareButtonAvailable:(BOOL)arg1 { - if (IsEnabled(@"enableShareButton_enabled")) { - %orig(YES); - } else { - %orig(NO); - } -} -- (void)setAddToButtonAvailable:(BOOL)arg1 { - if (IsEnabled(@"enableSaveToButton_enabled")) { - %orig(YES); - } else { - %orig(NO); - } -} -%end - # pragma mark - YouTube's patches %hook YTHotConfig - (BOOL)disableAfmaIdfaCollection { return NO; } @@ -491,6 +473,15 @@ static void replaceTab(YTIGuideResponse *response) { %end %end +// Hide Subscriptions Notification Badge +%group gHideSubscriptionsNotificationBadge +%hook YTPivotBarIndicatorView +- (void)removeFromSuperview { + %orig(YES); +} +%end +%end + // BigYTMiniPlayer: https://github.com/Galactic-Dev/BigYTMiniPlayer %group Main %hook YTWatchMiniBarView @@ -612,7 +603,7 @@ static void replaceTab(YTIGuideResponse *response) { %end // Video Controls Overlay Options -// Hide CC / Autoplay switch +// Hide CC / Autoplay switch / Enable Share Button / Enable Save to Playlist Button %hook YTMainAppControlsOverlayView - (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button return IsEnabled(@"hideCC_enabled") ? %orig(NO) : %orig; @@ -621,6 +612,20 @@ static void replaceTab(YTIGuideResponse *response) { if (IsEnabled(@"hideAutoplaySwitch_enabled")) {} else { return %orig; } } +- (void)setShareButtonAvailable:(BOOL)arg1 { + if (IsEnabled(@"enableShareButton_enabled")) { + %orig(YES); + } else { + %orig(NO); + } +} +- (void)setAddToButtonAvailable:(BOOL)arg1 { + if (IsEnabled(@"enableSaveToButton_enabled")) { + %orig(YES); + } else { + %orig(NO); + } +} %end // Hide HUD Messages @@ -811,16 +816,6 @@ static void replaceTab(YTIGuideResponse *response) { %end %end -%hook YTPivotBarIndicatorView -- (void)removeFromSuperview { - if (IsEnabled(@"hideSubscriptionsNotificationBadge_enabled")) { - %orig(YES); - } else { - %orig(NO); - } -} -%end - // YT startup animation %hook YTColdConfig - (BOOL)mainAppCoreClientIosEnableStartupAnimation { @@ -840,6 +835,9 @@ static void replaceTab(YTIGuideResponse *response) { if (IsEnabled(@"bigYTMiniPlayer_enabled") && (UIDevice.currentDevice.userInterfaceIdiom != UIUserInterfaceIdiomPad)) { %init(Main); } + if (IsEnabled(@"hideSubscriptionsNotificationBadge_enabled")) { + %init(gHideSubscriptionsNotificationBadge); + } if (IsEnabled(@"hidePreviousAndNextButton_enabled")) { %init(gHidePreviousAndNextButton); }