diff --git a/ios/Info.plist.xml b/ios/Info.plist.xml index 144e6b4c87..bc072235db 100644 --- a/ios/Info.plist.xml +++ b/ios/Info.plist.xml @@ -1,118 +1,119 @@ - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${app.name} - CFBundleExecutable - ${app.executable} - CFBundleIdentifier - ${app.id} - CFBundleInfoDictionaryVersion - 6.0 - MinimumOSVersion - 9.0.0 - CFBundleName - ${app.name} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${app.version} - CFBundleIconName - AppIcon - CFBundleSignature - ???? - CFBundleVersion - ${app.build} - LSRequiresIPhoneOS - - UIViewControllerBasedStatusBarAppearance - - UIStatusBarHidden - - UIRequiresFullScreen - - NSPhotoLibraryAddUsageDescription - Mindustry - UIDeviceFamily - - 1 - 2 - - UIRequiredDeviceCapabilities - - armv7 - opengles-2 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${app.name} + CFBundleExecutable + ${app.executable} + CFBundleIdentifier + ${app.id} + CFBundleInfoDictionaryVersion + 6.0 + MinimumOSVersion + 9.0.0 + CFBundleName + ${app.name} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${app.version} + CFBundleIconName + AppIcon + CFBundleSignature + ???? + CFBundleVersion + ${app.build} + LSRequiresIPhoneOS + + UIViewControllerBasedStatusBarAppearance + + UIStatusBarHidden + + UIRequiresFullScreen + + NSPhotoLibraryAddUsageDescription + Mindustry + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + armv7 + opengles-2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + - CFBundleDocumentTypes - - - CFBundleTypeIconFiles - - icon-72.png - - CFBundleTypeName - Mindustry Map File - CFBundleTypeRole - Editor - LSHandlerRank - Owner - LSItemContentTypes - - io.anuke.mindustry.mapfile + CFBundleDocumentTypes + + + CFBundleTypeIconFiles + + icon-72.png + + CFBundleTypeName + Mindustry Map File + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + + io.anuke.mindustry.mapfile + io.anuke.mindustry.savefile + + + + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeDescription + Mindustry Save File + UTTypeIdentifier io.anuke.mindustry.savefile - - - - - UTExportedTypeDeclarations - - - UTTypeConformsTo - - public.data - - UTTypeDescription - Mindustry Save File - UTTypeIdentifier - io.anuke.mindustry.savefile - UTTypeTagSpecification - - public.filename-extension - msav - public.mime-type - mindustry/msav + UTTypeTagSpecification + + public.filename-extension + msav + public.mime-type + mindustry/msav + - - + - UTExportedTypeDeclarations - - - UTTypeConformsTo - - public.data - - UTTypeDescription - Mindustry Map File - UTTypeIdentifier - io.anuke.mindustry.mapfile - UTTypeTagSpecification + UTExportedTypeDeclarations + - public.filename-extension - mmap - public.mime-type - mindustry/mmap + UTTypeConformsTo + + public.data + + UTTypeDescription + Mindustry Map File + UTTypeIdentifier + io.anuke.mindustry.mapfile + UTTypeTagSpecification + + public.filename-extension + mmap + public.mime-type + mindustry/mmap + - - - + + diff --git a/ios/src/io/anuke/mindustry/IOSLauncher.java b/ios/src/io/anuke/mindustry/IOSLauncher.java index c9aa73d1c9..f407263e8a 100644 --- a/ios/src/io/anuke/mindustry/IOSLauncher.java +++ b/ios/src/io/anuke/mindustry/IOSLauncher.java @@ -32,6 +32,8 @@ import static io.anuke.mindustry.Vars.*; import static org.robovm.apple.foundation.NSPathUtilities.getDocumentsDirectory; public class IOSLauncher extends IOSApplication.Delegate { + private boolean forced; + @Override protected IOSApplication createApplication() { Net.setClientProvider(new KryoClient()); @@ -86,7 +88,17 @@ public class IOSLauncher extends IOSApplication.Delegate { p.getPopoverPresentationController().setSourceView(UIApplication.getSharedApplication().getKeyWindow().getRootViewController().getView()); UIApplication.getSharedApplication().getKeyWindow().getRootViewController() - .presentViewController(p, true, () -> io.anuke.ucore.util.Log.info("Success! Presented {0}", to)); + .presentViewController(p, true, () -> io.anuke.ucore.util.Log.info("Success! Presented {0}", to)); + } + + @Override + public void beginForceLandscape(){ + forced = true; + } + + @Override + public void endForceLandscape(){ + forced = false; } }; @@ -94,6 +106,11 @@ public class IOSLauncher extends IOSApplication.Delegate { return new IOSApplication(new Mindustry(), config); } + @Override + public UIInterfaceOrientationMask getSupportedInterfaceOrientations(UIApplication application, UIWindow window){ + return forced ? UIInterfaceOrientationMask.Landscape : UIInterfaceOrientationMask.All; + } + @Override public boolean openURL(UIApplication app, NSURL url, UIApplicationOpenURLOptions options) { System.out.println("Opened URL: " + url.getPath());