Stills attempting to hide home indicator

Also, fixed custom controls
This commit is contained in:
Duy Tran Khanh committed 2021-03-20 19:39:13 +07:00
1 parent 19cbac05b1
commit 6005ae7206
4 files changed
+23 -14

No files matched your search

+2 -10
View File
@@ -111,15 +111,7 @@ void loginAccountInput(UINavigationController *controller, int type, const char*
[scrollView addSubview:button_login_account];
}
-(BOOL)prefersHomeIndicatorAutoHidden {
return YES;
}
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
return UIRectEdgeBottom;
}
-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0)) {
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0)) {
if(@available(iOS 13.0, *)) {
if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
self.view.backgroundColor = [UIColor blackColor];
@@ -228,7 +220,7 @@ void loginAccountInput(UINavigationController *controller, int type, const char*
[self.navigationController pushViewController:vc animated:YES];
}
-(void)loginMojangWithUsername:(NSString*)input_username password:(NSString*)input_password {
- (void)loginMojangWithUsername:(NSString*)input_username password:(NSString*)input_password {
NSString *input_uuid = [[NSUUID UUID] UUIDString];
NSURLSession *session = [NSURLSession sharedSession];
+11 -2
View File
@@ -147,13 +147,14 @@ int notchOffset;
}
NSError *cc_error;
if (YES /* FIXME, temp skip */ || !cc_file || !fread(cc_data, cc_size, 1, cc_file)) {
if (!cc_file || !fread(cc_data, cc_size, 1, cc_file)) {
NSLog(@"Error: could not read \"default.json\", fallbacking to default control.\n%s", strerror(errno));
fclose(cc_file);
} else {
fclose(cc_file);
NSLog(@"%s", cc_data);
NSDictionary *cc_dictionary = [NSJSONSerialization JSONObjectWithData:@(cc_data) options:kNilOptions error:&cc_error];
NSData* cc_objc_data = [@(cc_data) dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *cc_dictionary = [NSJSONSerialization JSONObjectWithData:cc_objc_data options:kNilOptions error:&cc_error];
if (cc_error != nil) {
showDialog(self, @"Error parsing JSON", cc_error.localizedDescription);
} else {
@@ -232,6 +233,14 @@ int notchOffset;
[self setupGL];
}
- (BOOL)prefersHomeIndicatorAutoHidden {
return YES;
}
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
return UIRectEdgeAll;
}
#pragma mark - MetalANGLE stuff
- (void)dealloc
+7
View File
@@ -8,6 +8,13 @@
/**
* To compatible with Android, NSArray (ControlData)
* will store the scaled values.
*
* TODO implement:
* - dynamicX
* - dynamicY
* - isDynamicBtn
* - scaledAt
* - (maybe more)
*/
+ (id)initWithProperties:(NSMutableDictionary *)propArray {
+3 -2
View File
@@ -106,16 +106,17 @@ void UIKit_setButtonSkippable() {
void UIKit_launchMinecraftSurfaceVC() {
dispatch_async(dispatch_get_main_queue(), ^{
LauncherViewController *rootController = nil;
UIViewController *rootController = nil;
if (@available(iOS 13.0, *)) {
rootController = UIApplication.sharedApplication.windows.lastObject.rootViewController;
} else {
rootController =(LauncherViewController*) [[(AppDelegate*) [[UIApplication sharedApplication]delegate] window] rootViewController];
rootController =(UIViewController*) [[(AppDelegate*) [[UIApplication sharedApplication]delegate] window] rootViewController];
}
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MinecraftSurface" bundle:nil];
SurfaceViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"MinecraftSurfaceVC"];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
[rootController presentViewController:vc animated:YES completion:nil];
// rootController.childForScreenEdgesDeferringSystemGestures = vc;
});
}