Naming and logging

This commit is contained in:
lieght
2025-10-01 19:21:39 +02:00
parent 258adbb627
commit afdadbba66
3 changed files with 3 additions and 2 deletions

View File

@@ -61,6 +61,7 @@ public class AssetLoader {
fileSearcher(rootFolder, foundFiles); fileSearcher(rootFolder, foundFiles);
this.totalCount = foundFiles.size(); this.totalCount = foundFiles.size();
loader(foundFiles); loader(foundFiles);
logger.info("Total files loaded: " + this.totalCount);
} }
/** /**

View File

@@ -32,7 +32,7 @@ public class SoundManager {
private void handlePlaySound(AudioEvents.PlayAudio event) { private void handlePlaySound(AudioEvents.PlayAudio event) {
try { try {
this.playSound(event.fileNameNoExtensionAndNoDirectory(), event.loop()); this.playSound(event.fileName(), event.loop());
} catch (UnsupportedAudioFileException | LineUnavailableException | IOException e) { } catch (UnsupportedAudioFileException | LineUnavailableException | IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@@ -5,7 +5,7 @@ import org.toop.framework.eventbus.events.EventsBase;
public class AudioEvents extends EventsBase { public class AudioEvents extends EventsBase {
/** Starts playing a sound. */ /** Starts playing a sound. */
public record PlayAudio(String fileNameNoExtensionAndNoDirectory, boolean loop) public record PlayAudio(String fileName, boolean loop)
implements EventWithoutSnowflake {} implements EventWithoutSnowflake {}
public record StopAudio(long clipId) implements EventWithoutSnowflake {} public record StopAudio(long clipId) implements EventWithoutSnowflake {}