blob: 8b07e33cb05233a9c9e99ad927640548517c61e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
package com.ilotterytea.maxoning;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import java.util.ArrayList;
import java.util.Objects;
import java.util.Scanner;
// Please note that on macOS your application needs to be started with the -XstartOnFirstThread JVM argument
public class DesktopLauncher {
public static void main (String[] arg) {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setForegroundFPS(60);
config.setTitle(String.format("%s %s: %s", MaxonConstants.GAME_NAME, MaxonConstants.GAME_VERSION, getRandomLine()));
config.setWindowIcon("icon_chest.png");
config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
new Lwjgl3Application(new MaxonGame(), config);
}
private static String getRandomLine() {
String line = "missingno";
try {
Scanner scanner = new Scanner(
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResourceAsStream("texts/splashes.txt"))
);
ArrayList<String> strings = new ArrayList<>();
while (scanner.hasNext()) {
strings.add(scanner.next());
}
line = strings.get((int) Math.floor(Math.random() * strings.size()));
} catch (NullPointerException e) {
e.printStackTrace();
}
return line;
}
}
|