Skip to content

Commit

Permalink
Edited Settings for Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
arichornlover authored Sep 25, 2022
1 parent 3d9d4dd commit 46e63b9
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Settings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ extern BOOL hidePaidPromotionCard();
extern BOOL hideNotificationButton();
extern BOOL fixGoogleSignIn();
extern BOOL replacePreviousAndNextButton();
extern BOOL dontEatMyContent();
extern BOOL ytDisableHighContrastUI();

// Settings
%hook YTAppSettingsPresentationData
Expand Down Expand Up @@ -59,6 +61,24 @@ extern BOOL replacePreviousAndNextButton();
exit(0);
}];

YTSettingsSectionItem *ytDisableHighContrastUI = [[%c(YTSettingsSectionItem) alloc] initWithTitle:@"Revert The High Contrast UI (YTDisableHighContrastUI)" titleDescription:@"App restart is required."];
ytDisableHighContrastUI.hasSwitch = YES;
ytDisableHighContrastUI.switchVisible = YES;
ytDisableHighContrastUI.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"ytDisableHighContrastUI_enabled"];
ytDisableHighContrastUI.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"ytDisableHighContrastUI_enabled"];
return YES;
};

YTSettingsSectionItem *dontEatMyContent = [[%c(YTSettingsSectionItem) alloc] initWithTitle:LOC(@"Do Not Eat My Content") titleDescription:LOC(@"Prevent the notch/Dynamic Island from munching on 2:1 video content in YouTube")];
dontEatMyContent.hasSwitch = YES;
dontEatMyContent.switchVisible = YES;
dontEatMyContent.on = [[NSUserDefaults standardUserDefaults] boolForKey:@"dontEatMyContent_enabled"];
dontEatMyContent.switchBlock = ^BOOL (YTSettingsCell *cell, BOOL enabled) {
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"dontEatMyContent_enabled"];
return YES;
};

YTSettingsSectionItem *replacePreviousAndNextButton = [[%c(YTSettingsSectionItem) alloc] initWithTitle:LOC(@"REPLACE_PREVIOUS_NEXT_BUTTON") titleDescription:LOC(@"REPLACE_PREVIOUS_NEXT_BUTTON_DESC")];
replacePreviousAndNextButton.hasSwitch = YES;
replacePreviousAndNextButton.switchVisible = YES;
Expand Down Expand Up @@ -248,7 +268,7 @@ extern BOOL replacePreviousAndNextButton();
return YES;
};

NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[killApp, autoFull, ytMiniPlayer, fixGoogleSignIn, hideAutoplaySwitch, hideCercubeButton, hideCercubePiP, hideCercubeDownload, hideCastButton, hideCC, hideHUD, hideHoverCard, hideNotificationButton, hideShorts, hidePaidPromotionCard, hidePreviousAndNextButton, hideWatermarks, bigYTMiniPlayer, oledDarkMode, oledKeyBoard, replacePreviousAndNextButton, reExplore]];
NSMutableArray <YTSettingsSectionItem *> *sectionItems = [NSMutableArray arrayWithArray:@[killApp, autoFull, ytMiniPlayer, fixGoogleSignIn, hideAutoplaySwitch, hideCercubeButton, hideCercubePiP, hideCercubeDownload, hideCastButton, hideCC, hideHUD, hideHoverCard, hideNotificationButton, hideShorts, hidePaidPromotionCard, hidePreviousAndNextButton, hideWatermarks, bigYTMiniPlayer, oledDarkMode, oledKeyBoard, replacePreviousAndNextButton, dontEatMyContent, reExplore, ytDisableHighContrastUI]];
[delegate setSectionItems:sectionItems forCategory:CercubePlusSection title:@"CercubePlus" titleDescription:nil headerHidden:NO];
}

Expand All @@ -259,4 +279,4 @@ extern BOOL replacePreviousAndNextButton();
}
%orig;
}
%end
%end

0 comments on commit 46e63b9

Please sign in to comment.