From e0c49c3ed60358d8a3fc09fc54f3465c3d4bbefc Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichorn@users.noreply.github.com> Date: Wed, 15 Nov 2023 17:15:19 -0600 Subject: [PATCH] New Section in Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a new section so that Miscellaneous won’t get cluttered. --- Settings.xm | 89 +++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/Settings.xm b/Settings.xm index cce3976..9e4891a 100644 --- a/Settings.xm +++ b/Settings.xm @@ -349,6 +349,45 @@ extern NSBundle *uYouPlusBundle(); }]; [sectionItems addObject:shortsControlOverlayGroup]; +# pragma mark - Video Player Buttons + YTSettingsSectionItem *videoPlayerButtonsGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"Video Player Buttons Options") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { + NSArray *rows = @[ + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the Download Button under player") + titleDescription:LOC(@"Hides the Download Button under the video player.") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"hideAddToOfflineButton_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAddToOfflineButton_enabled"]; + return YES; + } + settingItemId:0], + + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the Remix Button under player") + titleDescription:LOC(@"Hides the Remix Button under the video player.") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"hideRemixButton_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideRemixButton_enabled"]; + return YES; + } + settingItemId:0], + + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the comment section under player") + titleDescription:LOC(@"Hides the Comment Section below the player.") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"hideCommentSection_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCommentSection_enabled"]; + return YES; + } + settingItemId:0] + ]; + YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"Video Player Buttons Options") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; + [settingsViewController pushViewController:picker]; + return YES; + }]; + [sectionItems addObject:videoPlayerButtonsGroup]; + # pragma mark - App Settings Overlay Options YTSettingsSectionItem *appSettingsOverlayGroup = [YTSettingsSectionItemClass itemWithTitle:LOC(@"App Settings Overlay Options") accessibilityIdentifier:nil detailTextBlock:nil selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { NSArray *rows = @[ @@ -1583,6 +1622,16 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide YouTube Logo") + titleDescription:LOC(@"Toggle this to hide the YouTube Logo in the YouTube App.") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"hideYouTubeLogo_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideYouTubeLogo_enabled"]; + return YES; + } + settingItemId:0], + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"ENABLE_YT_STARTUP_ANIMATION") titleDescription:LOC(@"ENABLE_YT_STARTUP_ANIMATION_DESC") accessibilityIdentifier:nil @@ -1623,16 +1672,6 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide YouTube Logo") - titleDescription:LOC(@"Toggle this to hide the YouTube Logo in the YouTube App.") - accessibilityIdentifier:nil - switchOn:IsEnabled(@"hideYouTubeLogo_enabled") - switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { - [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideYouTubeLogo_enabled"]; - return YES; - } - settingItemId:0], - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Stick Navigation Bar") titleDescription:LOC(@"Enable to make the Navigation Bar stay on the App when scrolling.") accessibilityIdentifier:nil @@ -1693,36 +1732,6 @@ extern NSBundle *uYouPlusBundle(); } settingItemId:0], - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the Download Button under player") - titleDescription:LOC(@"Hides the Download Button under the video player.") - accessibilityIdentifier:nil - switchOn:IsEnabled(@"hideAddToOfflineButton_enabled") - switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { - [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideAddToOfflineButton_enabled"]; - return YES; - } - settingItemId:0], - - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the Remix Button under player") - titleDescription:LOC(@"Hides the Remix Button under the video player.") - accessibilityIdentifier:nil - switchOn:IsEnabled(@"hideRemixButton_enabled") - switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { - [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideRemixButton_enabled"]; - return YES; - } - settingItemId:0], - - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide the comment section under player") - titleDescription:LOC(@"Hides the Comment Section below the player.") - accessibilityIdentifier:nil - switchOn:IsEnabled(@"hideCommentSection_enabled") - switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { - [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"hideCommentSection_enabled"]; - return YES; - } - settingItemId:0], - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"Hide all videos under player") titleDescription:LOC(@"Hides all videos below the player.") accessibilityIdentifier:nil