diff --git a/Natives/LauncherPreferences.m b/Natives/LauncherPreferences.m index 2db46ef755..34f3547d4f 100644 --- a/Natives/LauncherPreferences.m +++ b/Natives/LauncherPreferences.m @@ -139,7 +139,8 @@ void loadPreferences(BOOL reset) { setDefaultValueForPref(prefDict, @"check_sha", @YES); setDefaultValueForPref(prefDict, @"auto_ram", @(!getEntitlementValue(@"com.apple.private.memorystatus"))); setDefaultValueForPref(prefDict, @"unsupported_warn_counter", @(0)); - + setDefaultValueForPref(prefDict, @"hidden_siderbar", @NO); + // Debug settings setDefaultValueForPref(debugPrefDict, @"debug_skip_wait_jit", @NO); setDefaultValueForPref(debugPrefDict, @"debug_hide_home_indicator", @NO); diff --git a/Natives/LauncherPreferencesViewController.m b/Natives/LauncherPreferencesViewController.m index c84ccae30a..feb15c3a3c 100644 --- a/Natives/LauncherPreferencesViewController.m +++ b/Natives/LauncherPreferencesViewController.m @@ -110,10 +110,18 @@ - (void)viewDidLoad @"AppIcon-Dark" ], @"pickList": @[ - localize(@"preference.title.appicon-default", nil), - localize(@"preference.title.appicon-dark", nil) + localize(@"preference.title.appicon-default", nil), + localize(@"preference.title.appicon-dark", nil) ] }, + @{@"key": @"hidden_sidebar", + @"hasDetail": @YES, + @"icon": @"sidebar.leading", + @"type": self.typeSwitch, + @"enableCondition": ^(BOOL enabled){ + return (UIDevice.currentDevice.systemVersion.floatValue >= 14) && whenNotInGame(); + } + }, @{@"key": @"reset_warnings", @"icon": @"exclamationmark.triangle", @"type": self.typeButton, diff --git a/Natives/LauncherSplitViewController.m b/Natives/LauncherSplitViewController.m index f13b1960a5..ee41639f61 100644 --- a/Natives/LauncherSplitViewController.m +++ b/Natives/LauncherSplitViewController.m @@ -44,15 +44,23 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id size.width; - if (self.preferredDisplayMode == 0 || self.displayMode != UISplitViewControllerDisplayModeSecondaryOnly) { - self.preferredDisplayMode = isPortrait ? - UISplitViewControllerDisplayModeOneOverSecondary : - UISplitViewControllerDisplayModeOneBesideSecondary; - } if (@available(iOS 14.0, tvOS 14.0, *)) { + if (self.preferredDisplayMode == 0 || self.displayMode != UISplitViewControllerDisplayModeSecondaryOnly) { + if([getPreference(@"hidden_sidebar") boolValue]) { + self.preferredDisplayMode = isPortrait ? + UISplitViewControllerDisplayModeOneOverSecondary : + UISplitViewControllerDisplayModeOneBesideSecondary; + } else { + self.preferredDisplayMode = UISplitViewControllerDisplayModeOneOverSecondary; + } + } self.preferredSplitBehavior = isPortrait ? - UISplitViewControllerSplitBehaviorOverlay : - UISplitViewControllerSplitBehaviorTile; + UISplitViewControllerSplitBehaviorOverlay : + UISplitViewControllerSplitBehaviorTile; + } else { + if (self.preferredDisplayMode == 0 || self.displayMode != UISplitViewControllerDisplayModeSecondaryOnly) { + self.preferredDisplayMode = UISplitViewControllerDisplayModeOneOverSecondary; + } } } diff --git a/Natives/en.lproj/Localizable.strings b/Natives/en.lproj/Localizable.strings index 0cd37bebc1..46b10ee655 100644 --- a/Natives/en.lproj/Localizable.strings +++ b/Natives/en.lproj/Localizable.strings @@ -142,11 +142,12 @@ "preference.detail.debug_logging" = "Logs internal settings and actions to latestlog.txt. This helps the developers find issues easier, but Minecraft may run slower as the logs will be written to more often."; "preference.title.jitstreamer_server" = "JitStreamer server IP"; "preference.detail.jitstreamer_server" = "Allows you to change to a custom JitStreamer server IP, such as for self-hosted instances. This option can be left alone if you use the default JitStreamer servers."; - "preference.title.appicon" = "Set app icon"; "preference.detail.appicon" = "Allows you to choose between different Home Screen icons for PojavLauncher."; "preference.title.appicon-default" = "Familiar PojavLauncher light"; "preference.title.appicon-dark" = "Familiar PojavLauncher dark"; +"preference.title.hidden_sidebar" = "Hide main menu sidebar by default"; +"preference.detail.hidden_sidebar" = "Allows you to hide the sidebar on the main menu by default and when rotating on iOS 14 and newer."; "preference.title.reset_warnings" = "Reset all warnings"; "preference.title.done.reset_warnings" = "All warnings have been reset."; diff --git a/Natives/resources/Assets.car b/Natives/resources/Assets.car index 49a965eeef..51afebd714 100644 Binary files a/Natives/resources/Assets.car and b/Natives/resources/Assets.car differ