From 06e6deae42c74dec838a7ee08ea6d086b4b99c94 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 7 Sep 2019 12:10:26 -0400 Subject: [PATCH 1/3] More cleanup --- .../io/anuke/mindustry/AndroidLauncher.java | 33 ++++--------------- core/assets/bundles/bundle.properties | 2 +- .../src/io/anuke/mindustry/core/Platform.java | 5 --- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/android/src/io/anuke/mindustry/AndroidLauncher.java b/android/src/io/anuke/mindustry/AndroidLauncher.java index d7dd912ca8..a21e03ae62 100644 --- a/android/src/io/anuke/mindustry/AndroidLauncher.java +++ b/android/src/io/anuke/mindustry/AndroidLauncher.java @@ -1,12 +1,11 @@ package io.anuke.mindustry; -import android.*; import android.app.*; import android.content.*; import android.content.pm.*; import android.net.*; -import android.os.*; import android.os.Build.*; +import android.os.*; import android.provider.Settings.*; import android.telephony.*; import io.anuke.arc.*; @@ -24,7 +23,6 @@ import io.anuke.mindustry.ui.dialogs.*; import java.io.*; import java.lang.System; -import java.util.*; import static io.anuke.mindustry.Vars.*; @@ -38,13 +36,9 @@ public class AndroidLauncher extends AndroidApplication{ protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); - config.useImmersiveMode = true; - config.depth = 0; if(doubleScaleTablets && isTablet(this.getContext())){ UnitScl.dp.addition = 0.5f; } - - config.hideStatusBar = true; Net.setClientProvider(new ArcNetClient()); Net.setServerProvider(new ArcNetServer()); initialize(new ClientLauncher(){ @@ -72,24 +66,6 @@ public class AndroidLauncher extends AndroidApplication{ } } - @Override - public void requestExternalPerms(Runnable callback){ - if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M || (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED && - checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED)){ - callback.run(); - }else{ - permCallback = callback; - ArrayList perms = new ArrayList<>(); - if(checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){ - perms.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); - } - if(checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){ - perms.add(Manifest.permission.READ_EXTERNAL_STORAGE); - } - requestPermissions(perms.toArray(new String[0]), PERMISSION_REQUEST_CODE); - } - } - @Override public void shareFile(FileHandle file){ } @@ -97,7 +73,6 @@ public class AndroidLauncher extends AndroidApplication{ @Override public void showFileChooser(boolean open, String extension, Consumer cons){ if(VERSION.SDK_INT >= 19){ - Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("*/*"); @@ -145,7 +120,11 @@ public class AndroidLauncher extends AndroidApplication{ public boolean canDonate(){ return true; } - }, config); + }, new AndroidApplicationConfiguration(){{ + config.useImmersiveMode = true; + config.depth = 0; + config.hideStatusBar = true; + }}); checkFiles(getIntent()); } diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index c451cfd568..eb9410b09e 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -233,7 +233,7 @@ editor.removeunit = Remove Unit editor.teams = Teams editor.errorload = Error loading file:\n[accent]{0} editor.errorsave = Error saving file:\n[accent]{0} -editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy Map' button in the editor. +editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy MThereap' button in the editor. editor.errorlegacy = This map is too old, and uses a legacy map format that is no longer supported. editor.errornot = This is not a map file. editor.errorheader = This map file is either not valid or corrupt. diff --git a/core/src/io/anuke/mindustry/core/Platform.java b/core/src/io/anuke/mindustry/core/Platform.java index 7e008136a5..feb23335b6 100644 --- a/core/src/io/anuke/mindustry/core/Platform.java +++ b/core/src/io/anuke/mindustry/core/Platform.java @@ -36,11 +36,6 @@ public interface Platform{ }); } - /** Request external read/write perms. Run callback when complete.*/ - default void requestExternalPerms(Runnable callback){ - callback.run(); - } - /** Update discord RPC. */ default void updateRPC(){ } From aa5152ac7019ce8c69db566389bb960b8e840c9e Mon Sep 17 00:00:00 2001 From: Ulysses2 Date: Sun, 8 Sep 2019 09:31:49 -0400 Subject: [PATCH 2/3] Update Router.java (#643) --- .../io/anuke/mindustry/world/blocks/distribution/Router.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/Router.java b/core/src/io/anuke/mindustry/world/blocks/distribution/Router.java index 1294e8a2b2..6aea6275a0 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/Router.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/Router.java @@ -61,7 +61,7 @@ public class Router extends Block{ int counter = tile.rotation(); for(int i = 0; i < proximity.size; i++){ Tile other = proximity.get((i + counter) % proximity.size); - if(tile == from) continue; + if(other == from) continue; if(set) tile.rotation((byte)((tile.rotation() + 1) % proximity.size)); if(other.block().acceptItem(item, other, Edges.getFacingEdge(tile, other))){ return other; From ec58e868fd2472ec0f536278fd80b4ce28a440b4 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 8 Sep 2019 11:35:38 -0400 Subject: [PATCH 3/3] Update bundle.properties --- core/assets/bundles/bundle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index eb9410b09e..c451cfd568 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -233,7 +233,7 @@ editor.removeunit = Remove Unit editor.teams = Teams editor.errorload = Error loading file:\n[accent]{0} editor.errorsave = Error saving file:\n[accent]{0} -editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy MThereap' button in the editor. +editor.errorimage = That's an image, not a map.\n\nIf you want to import a 3.5/build 40 map, use the 'Import Legacy Map' button in the editor. editor.errorlegacy = This map is too old, and uses a legacy map format that is no longer supported. editor.errornot = This is not a map file. editor.errorheader = This map file is either not valid or corrupt.