Skip to content

Commit

Permalink
Update loader code
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Nov 14, 2024
1 parent 06efacd commit 2f3a003
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package emu.com.github.xpenatan.jparser.loader;

import com.github.xpenatan.gdx.backends.teavm.assetloader.AssetInstance;
import com.github.xpenatan.gdx.backends.teavm.assetloader.AssetLoader;
import com.github.xpenatan.gdx.backends.teavm.assetloader.AssetLoaderListener;
import com.github.xpenatan.jparser.loader.JParserLibraryLoaderListener;
Expand Down Expand Up @@ -29,9 +30,9 @@ public void loadInternal(String libraryName, JParserLibraryLoaderListener listen
return;
}
loadedLibraries.add(libraryName);
AssetLoader.AssetLoad instance = AssetLoader.getInstance();
AssetLoader instance = AssetInstance.getLoaderInstance();
if(listener != null) {
instance.loadScript(true, libraryName, new AssetLoaderListener<>(){
instance.loadScript(libraryName, new AssetLoaderListener<>(){
@Override
public void onSuccess(String url, String result) {
listener.onLoad(true);
Expand All @@ -42,8 +43,5 @@ public void onFailure(String url) {
}
});
}
else {
instance.loadScript(false, libraryName, null);
}
}
}

0 comments on commit 2f3a003

Please sign in to comment.