[WIP] Add ability to skip download assets

This commit is contained in:
Duy Tran Khanh committed 2021-02-03 05:23:15 +07:00
1 parent bcbbde5ee9
commit 2f99a5ecd7
7 files changed
+40 -14

No files matched your search

@@ -181,12 +181,13 @@ public class PLaunchApp {
File objectsDir = new File(outputDir, "objects");
int downloadedSs = 0;
for (JAssetInfo asset : assetsObjects.values()) {
currProgress++;
mIsAssetsProcessing = !UIKit.updateProgressSafe(currProgress / maxProgress, "Downloading " + assetsObjects.keySet().toArray(new String[0])[downloadedSs]);
if (!mIsAssetsProcessing) {
return;
}
currProgress++;
UIKit.updateProgressSafe(currProgress / maxProgress, "Downloading " + assetsObjects.keySet().toArray(new String[0])[downloadedSs]);
if(!assets.map_to_resources) downloadAsset(asset, objectsDir);
else downloadAssetMapped(asset,(assetsObjects.keySet().toArray(new String[0])[downloadedSs]),outputDir);
downloadedSs++;
@@ -45,9 +45,9 @@ public class UIKit {
CallbackBridge.sendCursorPos(CallbackBridge.mouseX, CallbackBridge.mouseY);
}
public static void updateProgressSafe(final float progress, final String message) {
public static boolean updateProgressSafe(final float progress, final String message) {
System.out.println(message);
updateProgress(progress, ((int) progress)*100 + "% - " + message);
return updateProgress(progress, ((int) (progress * 100)) + "% - " + message);
}
static {
@@ -58,7 +58,7 @@ public class UIKit {
// public static native void runOnUIThread(UIKitCallback callback);
// Update progress
public static native void updateProgress(float progress, String message);
public static native boolean updateProgress(float progress, String message);
// Start SurfaceViewController
public static native void launchMinecraftSurface(boolean isUseStackQueueBool);