Moved resources and added package.bat for windows installer generation.

This commit is contained in:
Andrew Lalis 2021-06-20 19:06:11 +02:00
parent 34dc31fbe6
commit fa001996ff
17 changed files with 15 additions and 2 deletions

9
client/package.bat Normal file
View File

@ -0,0 +1,9 @@
cd target
jpackage^
--type exe^
--name "Ace-of-Shades"^
--description "Top-down 2D shooter game inspired by Ace of Spades."^
--module-path "aos-client-3.1.jar;../../core/target/aos-core-3.1.jar"^
--module aos_client/nl.andrewlalis.aos_client.Client^
--win-shortcut^
--win-dir-chooser

View File

@ -21,7 +21,7 @@ public class SoundManager {
private Clip getClip(String sound) {
var soundBytes = this.soundData.get(sound);
if (soundBytes == null) {
InputStream is = Client.class.getResourceAsStream("/sound/" + sound);
InputStream is = Client.class.getResourceAsStream("/nl/andrewlalis/aos_client/sound/" + sound);
if (is == null) {
System.err.println("Could not load sound: " + sound);
return null;

View File

@ -16,7 +16,7 @@ public class GameFrame extends JFrame {
public GameFrame(String title, Client client, GamePanel gamePanel) throws HeadlessException {
super(title);
this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
InputStream iconInputStream = GameFrame.class.getClassLoader().getResourceAsStream("icon.png");
InputStream iconInputStream = GameFrame.class.getClassLoader().getResourceAsStream("/nl/andrewlalis/aos_client/icon.png");
if (iconInputStream != null) {
try {
this.setIconImage(ImageIO.read(iconInputStream));

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -17,6 +17,9 @@
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<maven.compiler.release>16</maven.compiler.release>
<java.version>16</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>

View File

@ -50,6 +50,7 @@ public class ClientHandler extends Thread {
}
public void send(Message message) {
if (this.socket.isClosed()) return;
this.sendingQueue.submit(() -> {
try {
this.out.reset();