From 6e9ec38c4a235ef0ee03d065b0e5247271baacf7 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Sat, 24 Aug 2024 16:30:30 -0700 Subject: [PATCH] Add reminder for YouTube Plus --- Source/Settings.xm | 15 +++++++++++++++ YTLitePlus.h | 1 + 2 files changed, 16 insertions(+) diff --git a/Source/Settings.xm b/Source/Settings.xm index eff47c3..94bccaf 100644 --- a/Source/Settings.xm +++ b/Source/Settings.xm @@ -145,6 +145,14 @@ static const NSInteger YTLiteSection = 789; // Show a confirmation message or perform some other action here [[%c(GOOHUDManagerInternal) sharedInstance] showMessageMainThread:[%c(YTHUDMessage) messageWithText:@"Settings copied"]]; } + // Prompt to export YouTube Plus settings + UIAlertController *exportAlert = [UIAlertController alertControllerWithTitle:@"Export Settings" message:@"Note: This cannot save iSponsorBlock and most YouTube settings.\nWould you like to also export your YouTube Plus Settings?" preferredStyle:UIAlertControllerStyleAlert]; + [exportAlert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; + [exportAlert addAction:[UIAlertAction actionWithTitle:@"Export" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + // Export YouTube Plus Settings functionality + [%c(YTLUserDefaults) exportYtlSettings]; + }]]; + [settingsViewController presentViewController:exportAlert animated:YES completion:nil]; return YES; } ]; @@ -186,6 +194,13 @@ static const NSInteger YTLiteSection = 789; }]]; [settingsViewController presentViewController:confirmPasteAlert animated:YES completion:nil]; } + // Reminder to import YouTube Plus settings + UIAlertController *reminderAlert = [UIAlertController alertControllerWithTitle:@"Reminder" + message:@"Remember to import your YouTube Plus settings as well." + preferredStyle:UIAlertControllerStyleAlert]; + [reminderAlert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; + [settingsViewController presentViewController:reminderAlert animated:YES completion:nil]; + return YES; } ]; diff --git a/YTLitePlus.h b/YTLitePlus.h index 8a41583..062a504 100644 --- a/YTLitePlus.h +++ b/YTLitePlus.h @@ -133,6 +133,7 @@ typedef NS_ENUM(NSUInteger, GestureSection) { // OLED Live Chat - @bhackel @interface YTLUserDefaults : NSUserDefaults ++ (void)exportYtlSettings; @end // Hide Home Tab - @bhackel