diff --git a/Natives/LauncherPreferences.m b/Natives/LauncherPreferences.m index 8f0019e6..0c95c1d0 100644 --- a/Natives/LauncherPreferences.m +++ b/Natives/LauncherPreferences.m @@ -21,7 +21,8 @@ void loadPreferences() { prefDict[@"java_args"] = @""; prefDict[@"java_home"] = @""; prefDict[@"gl4es_libname"] = @""; - // prefDict[@"custom_envVars"] = @""; // TODO + prefDict[@"option_warn"] = @YES; + prefDict[@"local_warn"] = @YES; [prefDict writeToFile:prefPath atomically:YES]; } else { prefDict = [NSMutableDictionary dictionaryWithContentsOfFile:prefPath]; diff --git a/Natives/LauncherPreferencesViewController.m b/Natives/LauncherPreferencesViewController.m index 7f8be7c3..2a5900ed 100644 --- a/Natives/LauncherPreferencesViewController.m +++ b/Natives/LauncherPreferencesViewController.m @@ -110,6 +110,14 @@ UITextField* versionTextField; jhomeTextField.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; [scrollView addSubview:jhomeTextField]; + if ([getPreference(@"option_warn") boolValue] == YES) { + UIAlertController *fullAlert = [UIAlertController alertControllerWithTitle:@"Restart required" message:@"Some options in this menu will require that you restart the launcher for them to take effect."preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil]; + [self presentViewController:fullAlert animated:YES completion:nil]; + [fullAlert addAction:cancel]; + setPreference(@"option_warn", @NO); + } + scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, scrollView.frame.size.height + 200); } diff --git a/Natives/LoginViewController.m b/Natives/LoginViewController.m index 7e8c3254..0e55877d 100644 --- a/Natives/LoginViewController.m +++ b/Natives/LoginViewController.m @@ -8,6 +8,7 @@ #import "LoginViewController.h" #import "AboutLauncherViewController.h" #import "LauncherFAQViewController.h" +#import "LauncherPreferences.h" #include "ios_uikit_bridge.h" #include "utils.h" @@ -243,13 +244,18 @@ void loginAccountInput(UINavigationController *controller, int type, const char* } - (void)loginOffline:(UIButton *)sender { - UIAlertController *offlineAlert = [UIAlertController alertControllerWithTitle:@"Offline mode is now Local mode." message:@"You can continue to play installed versions, but you can no longer download Minecraft without a paid account. No support will be provided for issues with local accounts, or other means of acquiring Minecraft. See our website for more information."preferredStyle:UIAlertControllerStyleActionSheet]; - [self setPopoverProperties:offlineAlert.popoverPresentationController sender:sender]; - UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {[self loginUsername:TYPE_OFFLINE];}]; - UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {[self accountType:sender];}]; - [self presentViewController:offlineAlert animated:YES completion:nil]; - [offlineAlert addAction:ok]; - [offlineAlert addAction:cancel]; + if ([getPreference(@"local_warn") boolValue] == YES) { + UIAlertController *offlineAlert = [UIAlertController alertControllerWithTitle:@"Offline mode is now Local mode." message:@"You can continue to play installed versions, but you can no longer download Minecraft without a paid account. No support will be provided for issues with local accounts, or other means of acquiring Minecraft. See our website for more information."preferredStyle:UIAlertControllerStyleActionSheet]; + [self setPopoverProperties:offlineAlert.popoverPresentationController sender:sender]; + UIAlertAction *ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {[self loginUsername:TYPE_OFFLINE];}]; + UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {[self accountType:sender];}]; + [self presentViewController:offlineAlert animated:YES completion:nil]; + [offlineAlert addAction:ok]; + [offlineAlert addAction:cancel]; + setPreference(@"local_warn", @NO); + } else { + [self loginUsername:(TYPE_OFFLINE)]; + } } - (void)loginDemo:(UIButton *)sender {