Fixed systems starting, before assets being loaded (I am retarded)

This commit is contained in:
lieght
2025-12-03 18:13:57 +01:00
parent 628e4f30b5
commit 740d2cf3db
2 changed files with 56 additions and 41 deletions

View File

@@ -11,30 +11,6 @@ import org.toop.framework.resource.resources.SoundEffectAsset;
public final class Main {
static void main(String[] args) {
initSystems();
App.run(args);
}
private static void initSystems() {
ResourceManager.loadAssets(new ResourceLoader("app/src/main/resources/localization"));
new Thread(() -> new NetworkingClientEventListener(new NetworkingClientManager())).start();
new Thread(() -> {
MusicManager<MusicAsset> musicManager = new MusicManager<>(ResourceManager.getAllOfTypeAndRemoveWrapper(MusicAsset.class), true);
SoundEffectManager<SoundEffectAsset> soundEffectManager = new SoundEffectManager<>(ResourceManager.getAllOfType(SoundEffectAsset.class));
AudioVolumeManager audioVolumeManager = new AudioVolumeManager()
.registerManager(VolumeControl.MASTERVOLUME, musicManager)
.registerManager(VolumeControl.MASTERVOLUME, soundEffectManager)
.registerManager(VolumeControl.FX, soundEffectManager)
.registerManager(VolumeControl.MUSIC, musicManager);
new AudioEventListener<>(
musicManager,
soundEffectManager,
audioVolumeManager
).initListeners("medium-button-click.wav");
}).start();
}
}