mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
add splashscreen for mobile-dev
This commit is contained in:
@@ -640,6 +640,11 @@ public class Main extends AndroidApplication {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeSplashScreen() {
|
||||
//only for desktop mobile-dev
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTablet() {
|
||||
return isTablet;
|
||||
|
||||
@@ -112,6 +112,11 @@ public class Main extends IOSApplication.Delegate {
|
||||
// Not possible on iOS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeSplashScreen() {
|
||||
//only for desktop mobile-dev
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertToJPEG(InputStream input, OutputStream output) throws IOException {
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<include>**/bg_splash.png</include>
|
||||
<include>**/bg_texture.jpg</include>
|
||||
<include>**/font1.ttf</include>
|
||||
<include>**/logo.png</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
@@ -84,11 +85,6 @@
|
||||
<errTitle>forge</errTitle>
|
||||
<downloadUrl>https://bell-sw.com/pages/downloads/#jdk-17-lts</downloadUrl>
|
||||
<icon>src/main/config/forge-adventure.ico</icon>
|
||||
<classPath>
|
||||
<mainClass>forge.app.Main</mainClass>
|
||||
<addDependencies>false</addDependencies>
|
||||
<preCp>anything</preCp>
|
||||
</classPath>
|
||||
<jre>
|
||||
<minVersion>17</minVersion>
|
||||
<requiresJdk>jdkOnly</requiresJdk>
|
||||
@@ -154,6 +150,9 @@
|
||||
<mainClass>forge.app.Main</mainClass>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<SplashScreen-Image>splash/logo.png</SplashScreen-Image>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.Desktop;
|
||||
import java.awt.SplashScreen;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -89,6 +90,14 @@ public class Main {
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeSplashScreen() {
|
||||
SplashScreen splash = SplashScreen.getSplashScreen();
|
||||
if (splash != null) {
|
||||
splash.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTablet() {
|
||||
return true; //treat desktop the same as a tablet
|
||||
|
||||
@@ -159,6 +159,7 @@ public class Forge implements ApplicationListener {
|
||||
public void create() {
|
||||
//install our error handler
|
||||
ExceptionHandler.registerErrorHandling();
|
||||
getDeviceAdapter().closeSplashScreen();
|
||||
|
||||
GuiBase.setIsAndroid(Gdx.app.getType() == Application.ApplicationType.Android);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public interface IDeviceAdapter {
|
||||
void preventSystemSleep(boolean preventSleep);
|
||||
void restart();
|
||||
void exit();
|
||||
void closeSplashScreen();
|
||||
void convertToJPEG(InputStream input, OutputStream output) throws IOException;
|
||||
Pair<Integer, Integer> getRealScreenSize(boolean real);
|
||||
ArrayList<String> getGamepads();
|
||||
|
||||
Reference in New Issue
Block a user