mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-18 19:57:59 +07:00
More cleanup
This commit is contained in:
@ -1,12 +1,11 @@
|
|||||||
package io.anuke.mindustry;
|
package io.anuke.mindustry;
|
||||||
|
|
||||||
import android.*;
|
|
||||||
import android.app.*;
|
import android.app.*;
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.content.pm.*;
|
import android.content.pm.*;
|
||||||
import android.net.*;
|
import android.net.*;
|
||||||
import android.os.*;
|
|
||||||
import android.os.Build.*;
|
import android.os.Build.*;
|
||||||
|
import android.os.*;
|
||||||
import android.provider.Settings.*;
|
import android.provider.Settings.*;
|
||||||
import android.telephony.*;
|
import android.telephony.*;
|
||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
@ -24,7 +23,6 @@ import io.anuke.mindustry.ui.dialogs.*;
|
|||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.System;
|
import java.lang.System;
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@ -38,13 +36,9 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
protected void onCreate(Bundle savedInstanceState){
|
protected void onCreate(Bundle savedInstanceState){
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
|
||||||
config.useImmersiveMode = true;
|
|
||||||
config.depth = 0;
|
|
||||||
if(doubleScaleTablets && isTablet(this.getContext())){
|
if(doubleScaleTablets && isTablet(this.getContext())){
|
||||||
UnitScl.dp.addition = 0.5f;
|
UnitScl.dp.addition = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.hideStatusBar = true;
|
|
||||||
Net.setClientProvider(new ArcNetClient());
|
Net.setClientProvider(new ArcNetClient());
|
||||||
Net.setServerProvider(new ArcNetServer());
|
Net.setServerProvider(new ArcNetServer());
|
||||||
initialize(new ClientLauncher(){
|
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<String> 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
|
@Override
|
||||||
public void shareFile(FileHandle file){
|
public void shareFile(FileHandle file){
|
||||||
}
|
}
|
||||||
@ -97,7 +73,6 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
@Override
|
@Override
|
||||||
public void showFileChooser(boolean open, String extension, Consumer<FileHandle> cons){
|
public void showFileChooser(boolean open, String extension, Consumer<FileHandle> cons){
|
||||||
if(VERSION.SDK_INT >= 19){
|
if(VERSION.SDK_INT >= 19){
|
||||||
|
|
||||||
Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT);
|
Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT);
|
||||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||||
intent.setType("*/*");
|
intent.setType("*/*");
|
||||||
@ -145,7 +120,11 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
public boolean canDonate(){
|
public boolean canDonate(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, config);
|
}, new AndroidApplicationConfiguration(){{
|
||||||
|
config.useImmersiveMode = true;
|
||||||
|
config.depth = 0;
|
||||||
|
config.hideStatusBar = true;
|
||||||
|
}});
|
||||||
checkFiles(getIntent());
|
checkFiles(getIntent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ editor.removeunit = Remove Unit
|
|||||||
editor.teams = Teams
|
editor.teams = Teams
|
||||||
editor.errorload = Error loading file:\n[accent]{0}
|
editor.errorload = Error loading file:\n[accent]{0}
|
||||||
editor.errorsave = Error saving 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.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.errornot = This is not a map file.
|
||||||
editor.errorheader = This map file is either not valid or corrupt.
|
editor.errorheader = This map file is either not valid or corrupt.
|
||||||
|
@ -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. */
|
/** Update discord RPC. */
|
||||||
default void updateRPC(){
|
default void updateRPC(){
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user