Files
PojavLauncher_iOS/Natives/LauncherFAQViewController.m
T
Duy Tran Khanh fe5f9e77a9 Changes
- Added a check to prevent attempt to launch 1.17+ with Java 8.
- Added an option to disable gl4es shaderconv in order to let ANGLE
processes them directly. This option lets Minecraft 1.17+ work
without the patch resource pack, OptiFine works aswell :)
- Changing renderer library no longer requires restart the launcher.
- Fixed some alert dialogs not displaying.
- PList default values are now set every time it loads.
2021-08-13 07:25:17 +07:00

92 lines
4.1 KiB
Objective-C

#import "LauncherFAQViewController.h"
#include "utils.h"
@interface LauncherFAQViewController () {
}
@end
@implementation LauncherFAQViewController
- (void)viewDidLoad
{
[super viewDidLoad];
viewController = self;
[self setTitle:@"Launcher FAQ"];
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];
int width = (int) roundf(screenBounds.size.width);
int height = (int) roundf(screenBounds.size.height) - self.navigationController.navigationBar.frame.size.height;
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
[self.view addSubview:scrollView];
scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, scrollView.frame.size.height + 200);
// Update color mode once
if(@available(iOS 13.0, *)) {
[self traitCollectionDidChange:nil];
} else {
self.view.backgroundColor = [UIColor whiteColor];
}
UILabel *boldJDKView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, 4.0, width - 40, 30.0)];
boldJDKView.text = @"Modded versions before 1.16";
boldJDKView.lineBreakMode = NSLineBreakByWordWrapping;
boldJDKView.numberOfLines = 0;
[scrollView addSubview:boldJDKView];
[boldJDKView setFont:[UIFont boldSystemFontOfSize:20]];
UILabel *JDKView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, boldJDKView.frame.origin.y + boldJDKView.frame.size.height, width - 40, 30.0)];
JDKView.text = @"In order to use these versions, you need to install openjdk-8-jre from Doregon's Repo and write the following in /var/mobile/Documents/.pojavlauncher/custom_env.txt:\n\n"
"JAVA_HOME=/usr/lib/jvm/java-8-openjdk";
JDKView.lineBreakMode = NSLineBreakByWordWrapping;
JDKView.numberOfLines = 0;
[JDKView sizeToFit];
[scrollView addSubview:JDKView];
UILabel *boldSnapView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, JDKView.frame.origin.y + JDKView.frame.size.height, width - 40, 30.0)];
boldSnapView.text = @"Vanilla versions after 21w08b";
boldSnapView.lineBreakMode = NSLineBreakByWordWrapping;
boldSnapView.numberOfLines = 0;
[scrollView addSubview:boldSnapView];
[boldSnapView setFont:[UIFont boldSystemFontOfSize:20]];
UILabel *snapView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, boldSnapView.frame.origin.y + boldSnapView.frame.size.height, width - 40, 30.0)];
snapView.text = @"In order to use these versions, you need to follow the instructions on our website (Updates > Preliminary support for 1.17)";
snapView.lineBreakMode = NSLineBreakByWordWrapping;
snapView.numberOfLines = 0;
[snapView sizeToFit];
[scrollView addSubview:snapView];
UILabel *boldJetsamView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, snapView.frame.origin.y + snapView.frame.size.height, width - 40, 30.0)];
boldJetsamView.text = @"Jetsam crashes";
boldJetsamView.lineBreakMode = NSLineBreakByWordWrapping;
boldJetsamView.numberOfLines = 0;
[scrollView addSubview:boldJetsamView];
[boldJetsamView setFont:[UIFont boldSystemFontOfSize:20]];
UILabel *jetsamView = [[UILabel alloc] initWithFrame:CGRectMake(20.0, boldJetsamView.frame.origin.y + boldJetsamView.frame.size.height, width - 40, 30.0)];
jetsamView.text = @"Even though PojavLauncher only allocates 1/4 of the system's total memory, jetsam can still kill the game. A solution is described on the PojavLauncher website (iOS > Wiki > Going further > overb0arding)";
jetsamView.lineBreakMode = NSLineBreakByWordWrapping;
jetsamView.numberOfLines = 0;
[jetsamView sizeToFit];
[scrollView addSubview:jetsamView];
}
-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
if(@available(iOS 13.0, *)) {
if (UITraitCollection.currentTraitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
self.view.backgroundColor = [UIColor blackColor];
} else {
self.view.backgroundColor = [UIColor whiteColor];
}
}
}
@end