From 6935671308b4c46889341d1a88c2456e9d661389 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sun, 4 Aug 2024 06:00:06 +0700 Subject: [PATCH] Fix: launcher not proceeding after fully downloaded Turns out 2 last commits were pointless and didn't fix the root issue at all --- Natives/LauncherNavigationController.m | 2 +- Natives/ios_uikit_bridge.h | 2 +- Natives/ios_uikit_bridge.m | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Natives/LauncherNavigationController.m b/Natives/LauncherNavigationController.m index 42a5becdbe..7de973eec7 100644 --- a/Natives/LauncherNavigationController.m +++ b/Natives/LauncherNavigationController.m @@ -331,7 +331,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N self.progressViewMain.observedProgress = nil; if (self.task.metadata) { [self invokeAfterJITEnabled:^{ - UIKit_launchMinecraftSurfaceVC(self.task.metadata); + UIKit_launchMinecraftSurfaceVC(self.view.window, self.task.metadata); }]; } else { self.task = nil; diff --git a/Natives/ios_uikit_bridge.h b/Natives/ios_uikit_bridge.h index 3e22e7061b..9575df9879 100644 --- a/Natives/ios_uikit_bridge.h +++ b/Natives/ios_uikit_bridge.h @@ -9,7 +9,7 @@ UIViewController* tmpRootVC; void showDialog(NSString* title, NSString* message); jstring UIKit_accessClipboard(JNIEnv* env, jint action, jstring copySrc); -void UIKit_launchMinecraftSurfaceVC(NSDictionary *metadata); +void UIKit_launchMinecraftSurfaceVC(UIWindow *window, NSDictionary *metadata); void UIKit_returnToSplitView(); void launchInitialViewController(UIWindow *window); diff --git a/Natives/ios_uikit_bridge.m b/Natives/ios_uikit_bridge.m index 77e337891c..ae1c2a5951 100644 --- a/Natives/ios_uikit_bridge.m +++ b/Natives/ios_uikit_bridge.m @@ -107,12 +107,11 @@ jstring UIKit_accessClipboard(JNIEnv* env, jint action, jbyteArray copySrc) { } } -void UIKit_launchMinecraftSurfaceVC(NSDictionary* metadata) { +void UIKit_launchMinecraftSurfaceVC(UIWindow* window, NSDictionary* metadata) { // Leave this pref, might be useful later for launching with Quick Actions/Shortcuts/URL Scheme //setPreference(@"internal_launch_on_boot", getPreference(@"restart_before_launch")); setPrefObject(@"internal.selected_account", BaseAuthenticator.current.authData[@"username"]); dispatch_async(dispatch_get_main_queue(), ^{ - UIWindow *window = currentWindow(); tmpRootVC = window.rootViewController; [UIView animateWithDuration:0.2 animations:^{ window.alpha = 0;