Add UpdateHistory and LauncherFAQ buttons
These will be adjusted greatly in the future, as I am continuing work on these
This commit is contained in:
7 files changed
+244
-1
No files matched your search
@@ -13,7 +13,7 @@ set_target_properties(PojavLauncher PROPERTIES
|
||||
MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
|
||||
MACOSX_BUNDLE_INFO_PLIST "../Info.plist")
|
||||
|
||||
add_library(pojavexec SHARED log.m AppDelegate.m SceneDelegate.m UILauncher.m LauncherViewController.m LauncherPreferencesViewController.m LoginViewController.m SurfaceViewController.m egl_bridge_ios.m ios_uikit_bridge.m customcontrols/ControlButton.m egl_bridge.c input_bridge_v3.c utils.c)
|
||||
add_library(pojavexec SHARED log.m AppDelegate.m SceneDelegate.m UILauncher.m LauncherViewController.m LauncherPreferencesViewController.m LauncherFAQViewController.m LoginViewController.m SurfaceViewController.m UpdateHistoryViewController.m egl_bridge_ios.m ios_uikit_bridge.m customcontrols/ControlButton.m egl_bridge.c input_bridge_v3.c utils.c)
|
||||
target_link_libraries(pojavexec
|
||||
"-Fresources/Frameworks"
|
||||
"-framework UIKit"
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface LauncherFAQViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
#import "LauncherFAQViewController.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
@interface LauncherFAQViewController () {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation LauncherFAQViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
|
||||
[self setNeedsUpdateOfHomeIndicatorAutoHidden];
|
||||
|
||||
[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 *boldSnapView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, 4.0, width - 4, 15.0)];
|
||||
boldSnapView.text = @"Version incompatibility";
|
||||
boldSnapView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
boldSnapView.numberOfLines = 0;
|
||||
[boldSnapView sizeToFit];
|
||||
[scrollView addSubview:boldSnapView];
|
||||
[boldSnapView setFont:[UIFont boldSystemFontOfSize:15]];
|
||||
|
||||
UILabel *snapView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, boldSnapView.frame.origin.y + 20.0, width - 4, 30.0)];
|
||||
snapView.text = @"Versions of vanilla Minecraft below 1.6 and higher than 21w10a, and modded Minecraft below 1.16 do not yet work with PojavLauncher iOS. There are currently no solutions to fix this issue, but solutions are in the works.";
|
||||
snapView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
snapView.numberOfLines = 0;
|
||||
[snapView sizeToFit];
|
||||
[scrollView addSubview:snapView];
|
||||
|
||||
UILabel *boldJetsamView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, snapView.frame.origin.y + 70, width - 4, 15.0)];
|
||||
boldJetsamView.text = @"Jetsam crashes";
|
||||
boldJetsamView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
boldJetsamView.numberOfLines = 0;
|
||||
[boldJetsamView sizeToFit];
|
||||
[scrollView addSubview:boldJetsamView];
|
||||
[boldJetsamView setFont:[UIFont boldSystemFontOfSize:15]];
|
||||
|
||||
UILabel *jetsamView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, boldJetsamView.frame.origin.y + 20.0, width - 4, 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.";
|
||||
jetsamView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
jetsamView.numberOfLines = 0;
|
||||
[jetsamView sizeToFit];
|
||||
[scrollView addSubview:jetsamView];
|
||||
}
|
||||
|
||||
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
|
||||
return UIRectEdgeBottom;
|
||||
}
|
||||
|
||||
- (BOOL)prefersHomeIndicatorAutoHidden {
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(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
|
||||
@@ -1,5 +1,6 @@
|
||||
#import "LauncherViewController.h"
|
||||
#import "LauncherPreferencesViewController.h"
|
||||
#import "LauncherFAQViewController.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
@@ -66,6 +67,12 @@ UITextField* versionTextField;
|
||||
[preferences_button addTarget:self action:@selector(enterPreferences) forControlEvents:UIControlEventTouchUpInside];
|
||||
[scrollView addSubview:preferences_button];
|
||||
|
||||
UIButton *quickfaq = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[quickfaq setTitle:@"FAQ" forState:UIControlStateNormal];
|
||||
quickfaq.frame = CGRectMake(width - 110.0, height - 108.0, 100.0, 50.0);
|
||||
[quickfaq addTarget:self action:@selector(showFAQ) forControlEvents:UIControlEventTouchUpInside];
|
||||
[scrollView addSubview:quickfaq];
|
||||
|
||||
install_progress_bar = [[UIProgressView alloc] initWithFrame:CGRectMake(4.0, height - 58.0, width - 8.0, 6.0)];
|
||||
[scrollView addSubview:install_progress_bar];
|
||||
|
||||
@@ -111,4 +118,10 @@ UITextField* versionTextField;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (void)showFAQ
|
||||
{
|
||||
LauncherFAQViewController *vc = [[LauncherFAQViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -6,6 +6,7 @@
|
||||
#import "AppDelegate.h"
|
||||
#import "LauncherViewController.h"
|
||||
#import "LoginViewController.h"
|
||||
#import "UpdateHistoryViewController.h"
|
||||
|
||||
#include "ios_uikit_bridge.h"
|
||||
#include "utils.h"
|
||||
@@ -113,6 +114,12 @@ void loginAccountInput(UINavigationController *controller, int type, const char*
|
||||
[button_login_account setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[button_login_account addTarget:self action:@selector(loginAccount) forControlEvents:UIControlEventTouchUpInside];
|
||||
[scrollView addSubview:button_login_account];
|
||||
|
||||
UIButton *button_update_history = [UIButton buttonWithType:UIButtonTypeRoundedRect];
|
||||
[button_update_history setTitle:@"Update History" forState:UIControlStateNormal];
|
||||
button_update_history.frame = CGRectMake((width / 2) - 100.0, height - 75.0, 200.0, 50.0);
|
||||
[button_update_history addTarget:self action:@selector(updateHistory) forControlEvents:UIControlEventTouchUpInside];
|
||||
[scrollView addSubview:button_update_history];
|
||||
}
|
||||
|
||||
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
|
||||
@@ -288,6 +295,12 @@ void loginAccountInput(UINavigationController *controller, int type, const char*
|
||||
[postDataTask resume];
|
||||
}
|
||||
|
||||
- (void)updateHistory
|
||||
{
|
||||
UpdateHistoryViewController *vc = [[UpdateHistoryViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - ASWebAuthenticationPresentationContextProviding
|
||||
- (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(ASWebAuthenticationSession *)session API_AVAILABLE(ios(13.0)){
|
||||
return UIApplication.sharedApplication.windows.firstObject;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UpdateHistoryViewController : UIViewController
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
#import "UpdateHistoryViewController.h"
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
@interface UpdateHistoryViewController () {
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation UpdateHistoryViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
|
||||
[self setNeedsUpdateOfHomeIndicatorAutoHidden];
|
||||
|
||||
[self setTitle:@"PojavLauncher Update History"];
|
||||
|
||||
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;
|
||||
|
||||
// Update color mode once
|
||||
if(@available(iOS 13.0, *)) {
|
||||
[self traitCollectionDidChange:nil];
|
||||
} else {
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
|
||||
UILabel *latestVerView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, 4.0, width, 30.0)];
|
||||
latestVerView.text = @"1.3";
|
||||
latestVerView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
latestVerView.numberOfLines = 0;
|
||||
[scrollView addSubview:latestVerView];
|
||||
[latestVerView setFont:[UIFont boldSystemFontOfSize:20]];
|
||||
|
||||
UILabel *latestVerCont = [[UILabel alloc] initWithFrame:CGRectMake(4.0, latestVerView.frame.origin.y + latestVerView.frame.size.height, width - 4, 30.00)];
|
||||
latestVerCont.text = @"You are running a development build of this version, so it does not have a valid changelog just yet.";
|
||||
latestVerCont.numberOfLines = 0;
|
||||
[latestVerCont sizeToFit];
|
||||
[scrollView addSubview:latestVerCont];
|
||||
|
||||
UILabel *backOneVerView = [[UILabel alloc] initWithFrame:CGRectMake(4.0, latestVerCont.frame.origin.y + latestVerCont.frame.size.height + 20.0, width - 4, 30.0)];
|
||||
backOneVerView.text = @"1.2";
|
||||
backOneVerView.lineBreakMode = NSLineBreakByWordWrapping;
|
||||
backOneVerView.numberOfLines = 0;
|
||||
[scrollView addSubview:backOneVerView];
|
||||
[backOneVerView setFont:[UIFont boldSystemFontOfSize:20]];
|
||||
|
||||
UILabel *backOneVerChanges = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerView.frame.origin.y + backOneVerView.frame.size.height, width - 4, 30.00)];
|
||||
backOneVerChanges.text = @"Changes";
|
||||
backOneVerChanges.numberOfLines = 0;
|
||||
[scrollView addSubview:backOneVerChanges];
|
||||
[backOneVerChanges setFont:[UIFont boldSystemFontOfSize:17]];
|
||||
|
||||
|
||||
UILabel *backOneVerChangesCont = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerChanges.frame.origin.y + backOneVerChanges.frame.size.height, width - 4, 30.00)];
|
||||
backOneVerChangesCont.text = @"- Use new method for Microsoft login\n- Moved latestlog.txt and overrideargs.txt to /var/mobile/Documents/.pojavlauncher\n- WIP custom controls and external mouse support";
|
||||
backOneVerChangesCont.numberOfLines = 0;
|
||||
[backOneVerChangesCont sizeToFit];
|
||||
[scrollView addSubview:backOneVerChangesCont];
|
||||
|
||||
UILabel *backOneVerFixes = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerChangesCont.frame.origin.y + backOneVerChangesCont.frame.size.height + 5.0, width - 4, 30.00)];
|
||||
backOneVerFixes.text = @"Fixes";
|
||||
backOneVerFixes.numberOfLines = 0;
|
||||
[scrollView addSubview:backOneVerFixes];
|
||||
[backOneVerFixes setFont:[UIFont boldSystemFontOfSize:17]];
|
||||
|
||||
UILabel *backOneVerFixesCont = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerFixes.frame.origin.y + backOneVerFixes.frame.size.height, width - 4, 30.00)];
|
||||
backOneVerFixesCont.text = @"- Fix file permission issues during install of package\n- Hide home bar like Bedrock Edition\n- Properly hide iPad status bar";
|
||||
backOneVerFixesCont.numberOfLines = 0;
|
||||
[backOneVerFixesCont sizeToFit];
|
||||
[scrollView addSubview:backOneVerFixesCont];
|
||||
|
||||
UILabel *backOneVerIssues = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerFixesCont.frame.origin.y + backOneVerFixesCont.frame.size.height + 5.0, width - 4, 30.00)];
|
||||
backOneVerIssues.text = @"Issues";
|
||||
backOneVerIssues.numberOfLines = 0;
|
||||
[scrollView addSubview:backOneVerIssues];
|
||||
[backOneVerIssues setFont:[UIFont boldSystemFontOfSize:17]];
|
||||
|
||||
UILabel *backOneVerIssuesCont = [[UILabel alloc] initWithFrame:CGRectMake(4.0, backOneVerIssues.frame.origin.y + backOneVerIssues.frame.size.height, width - 4, 30.00)];
|
||||
backOneVerIssuesCont.text = @"- Crash if login to Microsoft fails\n- Several Forge versions won’t work due to removed deprecated classes (see #67 and #68)\n- Text input will not work on 1.12.2 and below";
|
||||
backOneVerIssuesCont.numberOfLines = 0;
|
||||
[backOneVerIssuesCont sizeToFit];
|
||||
[scrollView addSubview:backOneVerIssuesCont];
|
||||
|
||||
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width, scrollView.frame.size.height + 200);
|
||||
|
||||
}
|
||||
|
||||
- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
|
||||
return UIRectEdgeBottom;
|
||||
}
|
||||
|
||||
- (BOOL)prefersHomeIndicatorAutoHidden {
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(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
|
||||
Reference in new issue
Block a user