Skip to content

Commit

Permalink
Merge pull request arichornlover#650 from bhackel/feat/modern-setting…
Browse files Browse the repository at this point in the history
…s-ui

Add "Enable new settings UI"
  • Loading branch information
bhackel authored May 25, 2024
2 parents dc25eb1 + d5d12ec commit bb416b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Localizations/uYouPlus.bundle/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@
"HIDE_INDICATORS_DESC" = "Hides all Indicators that are currently in the App.";
"FIX_CASTING" = "Fix Casting";
"FIX_CASTING_DESC" = "Changes certain A/B flags to fix casting.";
"NEW_SETTINGS_UI" = "Use New Settings UI";
"NEW_SETTINGS_UI_DESC" = "Enables the new Settings UI with tweak categories.";

"DEFAULT" = "Default";
"CUSTOM_COLOR" = "Custom Color";
Expand Down
5 changes: 5 additions & 0 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ BOOL isAdString(NSString *description) {
- (BOOL)respectDeviceCaptionSetting { return NO; } // YouRememberCaption: https://poomsmart.github.io/repo/depictions/youremembercaption.html
- (BOOL)isLandscapeEngagementPanelSwipeRightToDismissEnabled { return YES; } // Swipe right to dismiss the right panel in fullscreen mode
- (BOOL)enableModularPlayerBarController { return NO; } // fixes some of the iSponorBlock problems
- (BOOL)mainAppCoreClientEnableCairoSettings { return IS_ENABLED(@"newSettingsUI_enabled"); } // New grouped settings UI
%end

// Fix Casting: https://github.com/arichornlover/uYouEnhanced/issues/606#issuecomment-2098289942
Expand Down Expand Up @@ -1803,4 +1804,8 @@ static BOOL findCell(ASNodeController *nodeController, NSArray <NSString *> *ide
if (![allKeys containsObject:@"fixCasting_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"fixCasting_enabled"];
}
// Set new grouped settings UI to default enabled
if (![allKeys containsObject:@"newSettingsUI_enabled"]) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"newSettingsUI_enabled"];
}
}
1 change: 1 addition & 0 deletions Sources/uYouPlusSettings.xm
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ extern NSBundle *uYouPlusBundle();
SWITCH_ITEM2(LOC(@"AUTO_HIDE_HOME_INDICATOR"), LOC(@"AUTO_HIDE_HOME_INDICATOR_DESC"), @"autoHideHomeBar_enabled");
SWITCH_ITEM2(LOC(@"HIDE_INDICATORS"), LOC(@"HIDE_INDICATORS_DESC"), @"hideSubscriptionsNotificationBadge_enabled");
SWITCH_ITEM2(LOC(@"FIX_CASTING"), LOC(@"FIX_CASTING_DESC"), @"fixCasting_enabled");
SWITCH_ITEM2(LOC(@"NEW_SETTINGS_UI"), LOC(@"NEW_SETTINGS_UI_DESC"), @"newSettingsUI_enabled");
SWITCH_ITEM(LOC(@"ENABLE_FLEX"), LOC(@"ENABLE_FLEX_DESC"), @"flex_enabled");

if ([settingsViewController respondsToSelector:@selector(setSectionItems:forCategory:title:icon:titleDescription:headerHidden:)])
Expand Down

0 comments on commit bb416b9

Please sign in to comment.