TaskWindow now shows progress of each task.
This commit is contained in:
@@ -20,6 +20,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import org.jackhuang.hellominecraft.C;
|
||||
import org.jackhuang.hellominecraft.HMCLog;
|
||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
||||
|
||||
@@ -124,6 +124,7 @@ public abstract class IAssetsHandler {
|
||||
progress = 0;
|
||||
max = assetsDownloadURLs.size();
|
||||
al = new ArrayList<>();
|
||||
int hasDownloaded = 0;
|
||||
for (int i = 0; i < max; i++) {
|
||||
String mark = assetsDownloadURLs.get(i);
|
||||
String url = u + mark;
|
||||
@@ -137,7 +138,10 @@ public abstract class IAssetsHandler {
|
||||
String sha = DigestUtils.sha1Hex(NetUtils.getBytesFromStream(fis));
|
||||
IOUtils.closeQuietly(fis);
|
||||
if (contents.get(i).eTag.equals(sha)) {
|
||||
hasDownloaded++;
|
||||
HMCLog.log("File " + assetsLocalNames.get(i) + " has downloaded successfully, skipped downloading.");
|
||||
if (ppl != null)
|
||||
ppl.setProgress(this, hasDownloaded, max);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user