mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Refactor restart code so app can support restarting
Add Landscape Mode setting to app
This commit is contained in:
@@ -3,7 +3,6 @@ package forge.app;
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
|
||||
import com.badlogic.gdx.backends.lwjgl.LwjglClipboard;
|
||||
@@ -12,6 +11,7 @@ import forge.Forge;
|
||||
import forge.assets.AssetsDownloader;
|
||||
import forge.interfaces.IDeviceAdapter;
|
||||
import forge.util.FileUtil;
|
||||
import forge.util.RestartUtil;
|
||||
import forge.util.Utils;
|
||||
|
||||
public class Main {
|
||||
@@ -54,6 +54,13 @@ public class Main {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restart() {
|
||||
if (RestartUtil.prepareForRestart()) {
|
||||
Gdx.app.exit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
Gdx.app.exit(); //can just use Gdx.app.exit for desktop
|
||||
|
||||
Reference in New Issue
Block a user