diff --git a/source/funkin/Preloader.hx b/source/funkin/Preloader.hx index 24015be05..2a73d8199 100644 --- a/source/funkin/Preloader.hx +++ b/source/funkin/Preloader.hx @@ -8,6 +8,9 @@ import flash.display.Sprite; import flixel.system.FlxBasePreloader; import openfl.display.Sprite; import funkin.util.CLIUtil; +import openfl.text.TextField; +import openfl.text.TextFormat; +import flixel.system.FlxAssets; @:bitmap("art/preloaderArt.png") class LogoImage extends BitmapData {} @@ -21,12 +24,26 @@ class Preloader extends FlxBasePreloader } var logo:Sprite; + var _text:TextField; override function create():Void { this._width = Lib.current.stage.stageWidth; this._height = Lib.current.stage.stageHeight; + _text = new TextField(); + _text.width = 500; + _text.text = "Loading FNF"; + _text.defaultTextFormat = new TextFormat(FlxAssets.FONT_DEFAULT, 16, 0xFFFFFFFF); + _text.embedFonts = true; + _text.selectable = false; + _text.multiline = false; + _text.wordWrap = false; + _text.autoSize = LEFT; + _text.x = 2; + _text.y = 2; + addChild(_text); + var ratio:Float = this._width / 2560; // This allows us to scale assets depending on the size of the screen. logo = new Sprite(); @@ -34,27 +51,14 @@ class Preloader extends FlxBasePreloader logo.scaleX = logo.scaleY = ratio; logo.x = ((this._width) / 2) - ((logo.width) / 2); logo.y = (this._height / 2) - ((logo.height) / 2); - addChild(logo); // Adds the graphic to the NMEPreloader's buffer. + // addChild(logo); // Adds the graphic to the NMEPreloader's buffer. super.create(); } override function update(Percent:Float):Void { - if (Percent < 69) - { - logo.scaleX += Percent / 1920; - logo.scaleY += Percent / 1920; - logo.x -= Percent * 0.6; - logo.y -= Percent / 2; - } - else - { - logo.scaleX = this._width / 1280; - logo.scaleY = this._width / 1280; - logo.x = ((this._width) / 2) - ((logo.width) / 2); - logo.y = (this._height / 2) - ((logo.height) / 2); - } + _text.text = "FNF: " + Math.round(Percent * 100) + "%"; super.update(Percent); } diff --git a/source/funkin/ui/story/Level.hx b/source/funkin/ui/story/Level.hx index ea6940c4a..c93ad41a6 100644 --- a/source/funkin/ui/story/Level.hx +++ b/source/funkin/ui/story/Level.hx @@ -187,6 +187,10 @@ class Level implements IRegistryEntry if (_data.props.length == 0) return props; + var hiddenProps:Array = props.splice(_data.props.length - 1, props.length - 1); + for (hiddenProp in hiddenProps) + hiddenProp.visible = false; + for (propIndex in 0..._data.props.length) { var propData = _data.props[propIndex]; @@ -198,6 +202,7 @@ class Level implements IRegistryEntry { existingProp.propData = propData; existingProp.x = propData.offsets[0] + FlxG.width * 0.25 * propIndex; + existingProp.visible = true; } else { diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 54e16e917..bd7a05f91 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -590,7 +590,9 @@ class StoryMenuState extends MusicBeatState { // Both the previous and current level were simple backgrounds. // Fade between colors directly, rather than fading one background out and another in. - FlxTween.color(levelBackground, 0.4, previousColor, currentColor); + // cancels potential tween in progress, and tweens from there + FlxTween.cancelTweensOf(levelBackground); + FlxTween.color(levelBackground, 0.9, levelBackground.color, currentColor, {ease: FlxEase.quartOut}); } else { @@ -630,10 +632,10 @@ class StoryMenuState extends MusicBeatState function updateProps():Void { - for (prop in currentLevel.buildProps(levelProps.members)) + for (ind => prop in currentLevel.buildProps(levelProps.members)) { prop.zIndex = 1000; - levelProps.add(prop); + if (levelProps.members[ind] != prop) levelProps.replace(levelProps.members[ind], prop) ?? levelProps.add(prop); } refresh();