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