diff --git a/art/flashFiles/glowing bf.fla b/art/flashFiles/glowing bf.fla index f9195539..d557f522 100644 Binary files a/art/flashFiles/glowing bf.fla and b/art/flashFiles/glowing bf.fla differ diff --git a/assets/images/menus/update/bf.png b/assets/images/menus/update/bf.png new file mode 100644 index 00000000..4a14df22 Binary files /dev/null and b/assets/images/menus/update/bf.png differ diff --git a/assets/images/menus/update/bf.xml b/assets/images/menus/update/bf.xml new file mode 100644 index 00000000..3a0048a0 --- /dev/null +++ b/assets/images/menus/update/bf.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/buildnumber.txt b/buildnumber.txt index 3e19de01..5e1a2736 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1556 \ No newline at end of file +1565 \ No newline at end of file diff --git a/source/funkin/menus/FreeplayState.hx b/source/funkin/menus/FreeplayState.hx index 5b360608..a639af76 100644 --- a/source/funkin/menus/FreeplayState.hx +++ b/source/funkin/menus/FreeplayState.hx @@ -140,6 +140,8 @@ class FreeplayState extends MusicBeatState changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0)); changeDiff((controls.LEFT_P ? -1 : 0) + (controls.RIGHT_P ? 1 : 0)); + // putting it before so that its actually smooth + updateOptionsAlpha(); scoreText.text = "PERSONAL BEST:" + lerpScore; scoreBG.scale.set(Math.max(diffText.width, scoreText.width) + 8, 66); @@ -152,9 +154,6 @@ class FreeplayState extends MusicBeatState bg.color = CoolUtil.lerpColor(bg.color, songs[curSelected].color, 0.0625); - // putting it before so that its actually smooth - updateOptionsAlpha(); - var dontPlaySongThisFrame = false; #if PRELOAD_ALL autoplayElapsed += elapsed; diff --git a/source/funkin/updating/AsyncUpdater.hx b/source/funkin/updating/AsyncUpdater.hx index 7db4bb69..2d044c3a 100644 --- a/source/funkin/updating/AsyncUpdater.hx +++ b/source/funkin/updating/AsyncUpdater.hx @@ -85,6 +85,7 @@ class AsyncUpdater { doFile([exePath], [executableName], function() { trace('done, starting installation'); installFiles(fileNames); + progress.done = true; }); }); } @@ -141,6 +142,7 @@ class UpdaterProgress { public var files:Int = 0; public var bytesLoaded:Float = 0; public var bytesTotal:Float = 0; + public var done:Bool = false; public var curZipProgress:ZipProgress = new ZipProgress(); public function new() {} diff --git a/source/funkin/updating/UpdateScreen.hx b/source/funkin/updating/UpdateScreen.hx index 68afaa6e..4ce7f624 100644 --- a/source/funkin/updating/UpdateScreen.hx +++ b/source/funkin/updating/UpdateScreen.hx @@ -1,5 +1,8 @@ package funkin.updating; +import flixel.math.FlxRect; +import flixel.system.FlxSound; +import flixel.FlxSprite; import flixel.FlxG; import flixel.ui.FlxBar; import funkin.updating.UpdateUtil.UpdateCheckCallback; @@ -8,6 +11,10 @@ class UpdateScreen extends MusicBeatState { public var updater:AsyncUpdater; public var progressBar:FlxBar; + public var bf:FlxSprite; + + public var done:Bool = false; + public var overSound:FlxSound; public function new(check:UpdateCheckCallback) { super(false); @@ -17,17 +24,29 @@ class UpdateScreen extends MusicBeatState { public override function create() { super.create(); - progressBar = new FlxBar(0, FlxG.height - 150, LEFT_TO_RIGHT, FlxG.width, 150); + progressBar = new FlxBar(0, FlxG.height - 75, LEFT_TO_RIGHT, FlxG.width, 75); progressBar.createGradientBar([0xFF000000], [0xFF000000, 0xFF111111, 0xFF222222, 0xFF444444, 0xFF888888, -1], 1, 90); progressBar.setRange(0, 4); add(progressBar); + bf = new FlxSprite(); + bf.antialiasing = true; + bf.frames = Paths.getFrames("menus/update/bf"); + bf.animation.addByPrefix("loading", "", 0, false); + bf.animation.addByPrefix("loading-anim", "", 24, false); + bf.animation.play("loading"); + bf.screenCenter(); + add(bf); + + overSound = FlxG.sound.load(Paths.sound('gameOverEnd')); + updater.execute(); } public override function update(elapsed:Float) { super.update(elapsed); + if (done) return; var prog = updater.progress; switch(prog.step) { case PREPARING: @@ -39,5 +58,22 @@ class UpdateScreen extends MusicBeatState { case INSTALLING: progressBar.value = 3 + ((prog.curFile-1+(prog.curZipProgress.curFile/prog.curZipProgress.fileCount))/prog.files); } + var rect = new FlxRect(0, (1 - (progressBar.value / 4)) * bf.frameHeight, bf.frameWidth, 0); + rect.height = bf.frameHeight - rect.y; + + bf.clipRect = rect; + bf.alpha = (progressBar.value / 4) * FlxG.random.float(0.70, 0.80); + if (done = prog.done) { + // update is done, play bf's anim + FlxG.sound.music.stop(); + overSound.play(); + bf.animation.curAnim.frameRate = 24; + bf.animation.play("loading-anim"); + bf.alpha = 1; + FlxG.camera.fade(0xFF000000, overSound.length / 1000, false, function() { + trace("crap"); + }); + bf.clipRect = null; + } } } \ No newline at end of file