further progress
This commit is contained in:
@@ -108,6 +108,8 @@ public class Vars{
|
||||
public static boolean android;
|
||||
/** whether the game is running on a headless server */
|
||||
public static boolean headless;
|
||||
/** whether steam is enabled for this game */
|
||||
public static boolean steam;
|
||||
/** application data directory, equivalent to {@link io.anuke.arc.Settings#getDataDirectory()} */
|
||||
public static FileHandle dataDirectory;
|
||||
/** data subdirectory used for screenshots */
|
||||
@@ -217,6 +219,10 @@ public class Vars{
|
||||
|
||||
Core.settings.setAppName(appName);
|
||||
|
||||
if(steam){
|
||||
Core.settings.setDataDirectory(Core.files.local("saves/"));
|
||||
}
|
||||
|
||||
dataDirectory = Core.settings.getDataDirectory();
|
||||
screenshotDirectory = dataDirectory.child("screenshots/");
|
||||
customMapDirectory = dataDirectory.child("maps/");
|
||||
|
||||
@@ -350,35 +350,37 @@ public class Control implements ApplicationListener{
|
||||
|
||||
//display UI scale changed dialog
|
||||
if(Core.settings.getBool("uiscalechanged", false)){
|
||||
FloatingDialog dialog = new FloatingDialog("$confirm");
|
||||
Core.app.post(() -> Core.app.post(() -> {
|
||||
FloatingDialog dialog = new FloatingDialog("$confirm");
|
||||
dialog.setFillParent(true);
|
||||
|
||||
float[] countdown = {60 * 11};
|
||||
Runnable exit = () -> {
|
||||
Core.settings.put("uiscale", 100);
|
||||
Core.settings.put("uiscalechanged", false);
|
||||
settings.save();
|
||||
dialog.hide();
|
||||
Core.app.exit();
|
||||
};
|
||||
float[] countdown = {60 * 11};
|
||||
Runnable exit = () -> {
|
||||
Core.settings.put("uiscale", 100);
|
||||
Core.settings.put("uiscalechanged", false);
|
||||
settings.save();
|
||||
dialog.hide();
|
||||
Core.app.exit();
|
||||
};
|
||||
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.label(() -> {
|
||||
if(countdown[0] <= 0){
|
||||
exit.run();
|
||||
}
|
||||
return Core.bundle.format("uiscale.reset", (int)((countdown[0] -= Time.delta()) / 60f));
|
||||
}).pad(10f).expand().left();
|
||||
dialog.cont.label(() -> {
|
||||
if(countdown[0] <= 0){
|
||||
exit.run();
|
||||
}
|
||||
return Core.bundle.format("uiscale.reset", (int)((countdown[0] -= Time.delta()) / 60f));
|
||||
}).pad(10f).expand().center();
|
||||
|
||||
dialog.buttons.defaults().size(200f, 60f);
|
||||
dialog.buttons.addButton("$uiscale.cancel", exit);
|
||||
dialog.buttons.defaults().size(200f, 60f);
|
||||
dialog.buttons.addButton("$uiscale.cancel", exit);
|
||||
|
||||
dialog.buttons.addButton("$ok", () -> {
|
||||
Core.settings.put("uiscalechanged", false);
|
||||
settings.save();
|
||||
dialog.hide();
|
||||
});
|
||||
dialog.buttons.addButton("$ok", () -> {
|
||||
Core.settings.put("uiscalechanged", false);
|
||||
settings.save();
|
||||
dialog.hide();
|
||||
});
|
||||
|
||||
Core.app.post(dialog::show);
|
||||
dialog.show();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,7 +326,7 @@ public class Net{
|
||||
|
||||
public static void dispose(){
|
||||
if(clientProvider != null) clientProvider.dispose();
|
||||
if(serverProvider != null) serverProvider.dispose();
|
||||
if(serverProvider != null) serverProvider.close();
|
||||
clientProvider = null;
|
||||
serverProvider = null;
|
||||
server = false;
|
||||
@@ -399,8 +399,5 @@ public class Net{
|
||||
|
||||
/** Returns a connection by ID. */
|
||||
NetConnection getByID(int id);
|
||||
|
||||
/** Close all connections. */
|
||||
void dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user