Some more sharing revisions
@ -105,7 +105,7 @@ text.savefail=Failed to save game!
|
||||
text.save.delete.confirm=Are you sure you want to delete this save?
|
||||
text.save.delete=Delete
|
||||
text.save.export=Export Save
|
||||
text.save.import.invalid=[orange]This save is invalid!
|
||||
text.save.import.invalid=[orange]This save is invalid!\n\nNote that[scarlet]importing saves with custom maps[orange]\nfrom other devices does not work!
|
||||
text.save.import.fail=[crimson]Failed to import save: [orange]{0}
|
||||
text.save.export.fail=[crimson]Failed to export save: [orange]{0}
|
||||
text.save.import=Import Save
|
||||
|
@ -86,7 +86,7 @@ public class Saves {
|
||||
current = slot;
|
||||
}
|
||||
|
||||
public void importSave(FileHandle file) throws IOException{
|
||||
public SaveSlot importSave(FileHandle file) throws IOException{
|
||||
SaveSlot slot = new SaveSlot(nextSlot);
|
||||
slot.importFile(file);
|
||||
nextSlot ++;
|
||||
@ -94,6 +94,7 @@ public class Saves {
|
||||
saves.add(slot);
|
||||
slot.meta = SaveIO.getData(slot.index);
|
||||
current = slot;
|
||||
return slot;
|
||||
}
|
||||
|
||||
public Array<SaveSlot> getSaveSlots(){
|
||||
|
@ -165,26 +165,30 @@ public class LoadDialog extends FloatingDialog{
|
||||
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
|
||||
}
|
||||
|
||||
public void runLoadSave(SaveSlot slot){
|
||||
ui.loadfrag.show();
|
||||
|
||||
Timers.runTask(3f, () -> {
|
||||
ui.loadfrag.hide();
|
||||
hide();
|
||||
try{
|
||||
slot.load();
|
||||
state.set(State.playing);
|
||||
ui.paused.hide();
|
||||
}catch(Exception e){
|
||||
Log.err(e);
|
||||
ui.paused.hide();
|
||||
state.set(State.menu);
|
||||
logic.reset();
|
||||
ui.showError("$text.save.corrupted");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void modifyButton(TextButton button, SaveSlot slot){
|
||||
button.clicked(() -> {
|
||||
if(!button.childrenPressed()){
|
||||
ui.loadfrag.show();
|
||||
|
||||
Timers.runTask(3f, () -> {
|
||||
ui.loadfrag.hide();
|
||||
hide();
|
||||
try{
|
||||
slot.load();
|
||||
state.set(State.playing);
|
||||
ui.paused.hide();
|
||||
}catch(Exception e){
|
||||
Log.err(e);
|
||||
ui.paused.hide();
|
||||
state.set(State.menu);
|
||||
logic.reset();
|
||||
ui.showError("$text.save.corrupted");
|
||||
}
|
||||
});
|
||||
runLoadSave(slot);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
<true/>
|
||||
<key>UIRequiresFullScreen</key>
|
||||
<true/>
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>Mindustry</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
@ -66,6 +68,7 @@
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>public.png</string>
|
||||
<string>io.anuke.mindustry.savefile</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
@ -1,13 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-40.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-60.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
@ -23,13 +25,15 @@
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-80.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "icon-121.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
@ -45,33 +49,39 @@
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-20.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-42.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-29.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-58.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-41.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-81.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
@ -87,8 +97,9 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "icon-167.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
|
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-121.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-167.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-20.png
Normal file
After Width: | Height: | Size: 810 B |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-29.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-40.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-41.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-42.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-58.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-60.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-80.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
ios/data/Assets.xcassets/AppIcon.appiconset/icon-81.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
ios/data/icon-167.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
ios/data/icon-20.png
Normal file
After Width: | Height: | Size: 810 B |
BIN
ios/data/icon-29.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
ios/data/icon-40.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
ios/data/icon-58.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
ios/data/icon-60.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
ios/data/icon-80.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
@ -2,5 +2,5 @@ app.version=1.0
|
||||
app.id=io.anuke.mindustry
|
||||
app.mainclass=io.anuke.mindustry.IOSLauncher
|
||||
app.executable=IOSLauncher
|
||||
app.build=4
|
||||
app.build=5
|
||||
app.name=Mindustry
|
||||
|
@ -10,6 +10,7 @@ import io.anuke.kryonet.KryoServer;
|
||||
import io.anuke.mindustry.core.Platform;
|
||||
import io.anuke.mindustry.core.ThreadHandler;
|
||||
import io.anuke.mindustry.io.SaveIO;
|
||||
import io.anuke.mindustry.io.Saves.SaveSlot;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.scene.ui.TextField;
|
||||
@ -95,7 +96,7 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
||||
|
||||
@Override
|
||||
public boolean openURL(UIApplication app, NSURL url, UIApplicationOpenURLOptions options) {
|
||||
System.out.println("Opened URL: " + url.getAbsoluteString());
|
||||
System.out.println("Opened URL: " + url.getPath());
|
||||
openURL(url);
|
||||
return false;
|
||||
}
|
||||
@ -105,7 +106,7 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
||||
boolean b = super.didFinishLaunching(application, options);
|
||||
|
||||
if(options != null && options.has(UIApplicationLaunchOptions.Keys.URL())){
|
||||
System.out.println("Opened URL at launch: " + ((NSURL)options.get(UIApplicationLaunchOptions.Keys.URL())).getAbsoluteString());
|
||||
System.out.println("Opened URL at launch: " + ((NSURL)options.get(UIApplicationLaunchOptions.Keys.URL())).getPath());
|
||||
openURL(((NSURL)options.get(UIApplicationLaunchOptions.Keys.URL())));
|
||||
}
|
||||
|
||||
@ -113,17 +114,17 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
||||
}
|
||||
|
||||
void openURL(NSURL url){
|
||||
String str = url.getAbsoluteURL().getAbsoluteString().toLowerCase();
|
||||
System.err.println("STR: " + str);
|
||||
String str = url.getPath().toLowerCase();
|
||||
|
||||
Timers.runTask(30f, () -> {
|
||||
FileHandle file = Gdx.files.absolute(url.getAbsoluteString());
|
||||
FileHandle file = Gdx.files.absolute(url.getPath());
|
||||
|
||||
if(str.endsWith("mins")){ //open save
|
||||
|
||||
if(SaveIO.isSaveValid(file)){
|
||||
try{
|
||||
control.getSaves().importSave(file);
|
||||
SaveSlot slot = control.getSaves().importSave(file);
|
||||
ui.load.runLoadSave(slot);
|
||||
}catch (IOException e){
|
||||
ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false)));
|
||||
}
|
||||
|