diff --git a/Project.xml b/Project.xml index e0113b964a4..75866587051 100644 --- a/Project.xml +++ b/Project.xml @@ -2,7 +2,7 @@ - + diff --git a/source/UpdateState.hx b/source/UpdateState.hx index 45ea7cf981a..faab727c4c3 100644 --- a/source/UpdateState.hx +++ b/source/UpdateState.hx @@ -153,6 +153,7 @@ class UpdateState extends MusicBeatState progressText.text = FlxMath.roundDecimal(entire_progress, 2) + "%"; download_info.text = currentFile; download_info.x = (progBar_bg.x + progBar_bg.width) - download_info.width; + default: } } @@ -314,7 +315,7 @@ class UpdateState extends MusicBeatState File.saveBytes(path + "JS Engine v" + TitleState.updateVersion + ".zip", fileBytes); text.text = "Unpacking update file..."; text.screenCenter(X); - // Uncompress.run(File.getBytes(path + "JS Engine v" + TitleState.updateVersion + ".zip")) + JSEZip.unzip(path + "JS Engine v" + TitleState.updateVersion + ".zip", "./update/raw/"); text.text = "Update has finished! The update will be installed shortly.."; text.screenCenter(X); @@ -327,6 +328,14 @@ class UpdateState extends MusicBeatState text.screenCenter(X); #end + zip.removeEventListener(ProgressEvent.PROGRESS, onDownloadProgress); + zip.removeEventListener(openfl.events.Event.COMPLETE, onDownloadComplete); + + progressText.text = 'Complete'; + progressText.screenCenter(X); + + currentTask = 'complete'; + FlxG.sound.play(Paths.sound('confirmMenu')); new FlxTimer().start(3, function(e:FlxTimer)