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.confirm=Are you sure you want to delete this save?
|
||||||
text.save.delete=Delete
|
text.save.delete=Delete
|
||||||
text.save.export=Export Save
|
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.import.fail=[crimson]Failed to import save: [orange]{0}
|
||||||
text.save.export.fail=[crimson]Failed to export save: [orange]{0}
|
text.save.export.fail=[crimson]Failed to export save: [orange]{0}
|
||||||
text.save.import=Import Save
|
text.save.import=Import Save
|
||||||
|
@ -86,7 +86,7 @@ public class Saves {
|
|||||||
current = slot;
|
current = slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importSave(FileHandle file) throws IOException{
|
public SaveSlot importSave(FileHandle file) throws IOException{
|
||||||
SaveSlot slot = new SaveSlot(nextSlot);
|
SaveSlot slot = new SaveSlot(nextSlot);
|
||||||
slot.importFile(file);
|
slot.importFile(file);
|
||||||
nextSlot ++;
|
nextSlot ++;
|
||||||
@ -94,6 +94,7 @@ public class Saves {
|
|||||||
saves.add(slot);
|
saves.add(slot);
|
||||||
slot.meta = SaveIO.getData(slot.index);
|
slot.meta = SaveIO.getData(slot.index);
|
||||||
current = slot;
|
current = slot;
|
||||||
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Array<SaveSlot> getSaveSlots(){
|
public Array<SaveSlot> getSaveSlots(){
|
||||||
|
@ -165,9 +165,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
|
}).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void modifyButton(TextButton button, SaveSlot slot){
|
public void runLoadSave(SaveSlot slot){
|
||||||
button.clicked(() -> {
|
|
||||||
if(!button.childrenPressed()){
|
|
||||||
ui.loadfrag.show();
|
ui.loadfrag.show();
|
||||||
|
|
||||||
Timers.runTask(3f, () -> {
|
Timers.runTask(3f, () -> {
|
||||||
@ -186,6 +184,12 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void modifyButton(TextButton button, SaveSlot slot){
|
||||||
|
button.clicked(() -> {
|
||||||
|
if(!button.childrenPressed()){
|
||||||
|
runLoadSave(slot);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>UIRequiresFullScreen</key>
|
<key>UIRequiresFullScreen</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||||
|
<string>Mindustry</string>
|
||||||
<key>UIDeviceFamily</key>
|
<key>UIDeviceFamily</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
@ -66,6 +68,7 @@
|
|||||||
<key>LSItemContentTypes</key>
|
<key>LSItemContentTypes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>public.png</string>
|
<string>public.png</string>
|
||||||
|
<string>io.anuke.mindustry.savefile</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "icon-40.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "icon-60.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -23,13 +25,15 @@
|
|||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "icon-80.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "icon-121.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -45,33 +49,39 @@
|
|||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-20.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-42.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-29.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-58.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-41.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-81.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -87,8 +97,9 @@
|
|||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "83.5x83.5",
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "icon-167.png",
|
||||||
"scale" : "2x"
|
"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.id=io.anuke.mindustry
|
||||||
app.mainclass=io.anuke.mindustry.IOSLauncher
|
app.mainclass=io.anuke.mindustry.IOSLauncher
|
||||||
app.executable=IOSLauncher
|
app.executable=IOSLauncher
|
||||||
app.build=4
|
app.build=5
|
||||||
app.name=Mindustry
|
app.name=Mindustry
|
||||||
|
@ -10,6 +10,7 @@ import io.anuke.kryonet.KryoServer;
|
|||||||
import io.anuke.mindustry.core.Platform;
|
import io.anuke.mindustry.core.Platform;
|
||||||
import io.anuke.mindustry.core.ThreadHandler;
|
import io.anuke.mindustry.core.ThreadHandler;
|
||||||
import io.anuke.mindustry.io.SaveIO;
|
import io.anuke.mindustry.io.SaveIO;
|
||||||
|
import io.anuke.mindustry.io.Saves.SaveSlot;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.scene.ui.TextField;
|
import io.anuke.ucore.scene.ui.TextField;
|
||||||
@ -95,7 +96,7 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean openURL(UIApplication app, NSURL url, UIApplicationOpenURLOptions options) {
|
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);
|
openURL(url);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -105,7 +106,7 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
|||||||
boolean b = super.didFinishLaunching(application, options);
|
boolean b = super.didFinishLaunching(application, options);
|
||||||
|
|
||||||
if(options != null && options.has(UIApplicationLaunchOptions.Keys.URL())){
|
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())));
|
openURL(((NSURL)options.get(UIApplicationLaunchOptions.Keys.URL())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,17 +114,17 @@ public class IOSLauncher extends IOSApplication.Delegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void openURL(NSURL url){
|
void openURL(NSURL url){
|
||||||
String str = url.getAbsoluteURL().getAbsoluteString().toLowerCase();
|
String str = url.getPath().toLowerCase();
|
||||||
System.err.println("STR: " + str);
|
|
||||||
|
|
||||||
Timers.runTask(30f, () -> {
|
Timers.runTask(30f, () -> {
|
||||||
FileHandle file = Gdx.files.absolute(url.getAbsoluteString());
|
FileHandle file = Gdx.files.absolute(url.getPath());
|
||||||
|
|
||||||
if(str.endsWith("mins")){ //open save
|
if(str.endsWith("mins")){ //open save
|
||||||
|
|
||||||
if(SaveIO.isSaveValid(file)){
|
if(SaveIO.isSaveValid(file)){
|
||||||
try{
|
try{
|
||||||
control.getSaves().importSave(file);
|
SaveSlot slot = control.getSaves().importSave(file);
|
||||||
|
ui.load.runLoadSave(slot);
|
||||||
}catch (IOException e){
|
}catch (IOException e){
|
||||||
ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false)));
|
ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false)));
|
||||||
}
|
}
|
||||||
|