diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index c55e206..f7ad2ef 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -18,29 +18,28 @@ NSBundle *tweakBundle = uYouPlusBundle(); // // Notifications Tab - @arichornlover & @dayanch96 +%group gShowNotificationsTab %hook YTPivotBarView - (void)setRenderer:(YTIPivotBarRenderer *)renderer { @try { - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"kShowNotificationsTab"]) { - YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init]; - [endPoint setBrowseId:@"FEnotifications_inbox"]; - YTICommand *command = [[%c(YTICommand) alloc] init]; - [command setBrowseEndpoint:endPoint]; + YTIBrowseEndpoint *endPoint = [[%c(YTIBrowseEndpoint) alloc] init]; + [endPoint setBrowseId:@"FEnotifications_inbox"]; + YTICommand *command = [[%c(YTICommand) alloc] init]; + [command setBrowseEndpoint:endPoint]; - YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init]; - [itemBar setPivotIdentifier:@"FEnotifications_inbox"]; - YTIIcon *icon = [itemBar icon]; - [icon setIconType:NOTIFICATIONS]; - [itemBar setNavigationEndpoint:command]; + YTIPivotBarItemRenderer *itemBar = [[%c(YTIPivotBarItemRenderer) alloc] init]; + [itemBar setPivotIdentifier:@"FEnotifications_inbox"]; + YTIIcon *icon = [itemBar icon]; + [icon setIconType:YTIconTypeNOTIFICATIONS]; + [itemBar setNavigationEndpoint:command]; - YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"]; - [itemBar setTitle:formatString]; + YTIFormattedString *formatString = [%c(YTIFormattedString) formattedStringWithString:@"Notifications"]; + [itemBar setTitle:formatString]; - YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init]; - [barSupport setPivotBarItemRenderer:itemBar]; + YTIPivotBarSupportedRenderers *barSupport = [[%c(YTIPivotBarSupportedRenderers) alloc] init]; + [barSupport setPivotBarItemRenderer:itemBar]; - [renderer.itemsArray addObject:barSupport]; - } + [renderer.itemsArray addObject:barSupport]; } @catch (NSException *exception) { NSLog(@"Error setting renderer: %@", exception.reason); } @@ -66,6 +65,7 @@ NSBundle *tweakBundle = uYouPlusBundle(); } } %end +%end // LEGACY VERSION ⚠️ // Hide the (Connect / Thanks / Save / Report) Buttons under the Video Player - 17.33.2 and up - @arichornlover (inspired by @PoomSmart's version) @@ -1878,6 +1878,9 @@ static int contrastMode() { if (IS_ENABLED(kHideChipBar)) { %init(gHideChipBar); } + if (IS_ENABLED(kShowNotificationsTab)) { + %init(gShowNotificationsTab); + } if (IS_ENABLED(kPortraitFullscreen)) { %init(gPortraitFullscreen); }