diff --git a/source/funkin/backend/system/updating/AsyncUpdater.hx b/source/funkin/backend/system/updating/AsyncUpdater.hx index af7cfff5..04dbafe8 100644 --- a/source/funkin/backend/system/updating/AsyncUpdater.hx +++ b/source/funkin/backend/system/updating/AsyncUpdater.hx @@ -101,7 +101,7 @@ class AsyncUpdater { progress.files = files.length; progress.step = DOWNLOADING_ASSETS; trace('starting assets download'); - doFile([for(e in files) e], [for(e in fileNames) e], function() { + doFile([for(e in files) e], fileNames.copy(), function() { progress.curFile = -1; progress.curFileName = null; progress.files = 1; diff --git a/source/funkin/backend/utils/XMLUtil.hx b/source/funkin/backend/utils/XMLUtil.hx index 23ed0516..2f314e78 100644 --- a/source/funkin/backend/utils/XMLUtil.hx +++ b/source/funkin/backend/utils/XMLUtil.hx @@ -285,10 +285,12 @@ class XMLUtil { } /** + * Trims and removes spacing from the nodeValue in the XML + * * WARNING: will edit directly the node! */ public static function fixSpacingInNode(node:Access):Access { - var arr = [for(x in node.x) x]; + var arr = Lambda.array(node.x); for(i => n in arr) { if(n.nodeType == PCData) { if(i == 0) n.nodeValue = n.nodeValue.ltrim(); diff --git a/source/funkin/editors/charter/CharterAutoSaveUI.hx b/source/funkin/editors/charter/CharterAutoSaveUI.hx index d412bc16..5f3ed9b8 100644 --- a/source/funkin/editors/charter/CharterAutoSaveUI.hx +++ b/source/funkin/editors/charter/CharterAutoSaveUI.hx @@ -31,7 +31,7 @@ class CharterAutoSaveUI extends UISliceSprite { progressBarBack = new FlxSprite(x + 10, y + bHeight - 20).makeGraphic(Std.int(bWidth-20), 10, 0x00000000, true); progressBarBack.drawRoundRect(0, 0, progressBarBack.width, progressBarBack.height, 4, 6, 0xFF727272, null, {smoothing: false}); progressBarBack.drawRoundRect(1, 1, progressBarBack.width-2, progressBarBack.height-2, 4, 6, 0xFF0D0D0D, null, {smoothing: false}); - members.push(progressBarBack); progressBarBack.antialiasing = false; + members.push(progressBarBack); progressBarBack.antialiasing = false; progressBar = new FlxSprite(x + 10, y + bHeight - 20).makeGraphic(Std.int(bWidth-20), 10, 0x00000000, true); progressBar.drawRoundRect(0, 0, progressBar.width, progressBar.height, 4, 6, 0xFF727272, null, {smoothing: false}); @@ -65,7 +65,7 @@ class CharterAutoSaveUI extends UISliceSprite { public function startAutoSave(time:Float, sucessText:String) { appearAnimation(); - + __tween = FlxTween.num(0, 1, time, null, (v:Float) -> { if ((progress = v) < .95) { autosavingText.text = 'Autosaving in ${Math.min(Math.round(time), 1+Math.floor(Math.abs(time-(progress*time))))} seconds'; @@ -100,7 +100,7 @@ class CharterAutoSaveUI extends UISliceSprite { autosavingText.follow(this, 12+10+4, 8); autosavingText.alpha = alpha; - + for (bar in [progressBar, progressBarBack]) { bar.follow(this, 10, bHeight-20); bar.alpha = alpha; diff --git a/source/funkin/editors/charter/CharterBackdropGroup.hx b/source/funkin/editors/charter/CharterBackdropGroup.hx index e9240ad1..21eeb90f 100644 --- a/source/funkin/editors/charter/CharterBackdropGroup.hx +++ b/source/funkin/editors/charter/CharterBackdropGroup.hx @@ -253,7 +253,7 @@ class CharterBackdropDummy extends UISprite { public override function draw() { @:privateAccess - __lastDrawCameras = [for(c in cameras) c]; + __lastDrawCameras = cameras.copy(); } } diff --git a/source/funkin/editors/ui/UISprite.hx b/source/funkin/editors/ui/UISprite.hx index 5a41cec3..1246e6de 100644 --- a/source/funkin/editors/ui/UISprite.hx +++ b/source/funkin/editors/ui/UISprite.hx @@ -69,7 +69,7 @@ class UISprite extends FlxSprite { public function drawSuper() { super.draw(); - __lastDrawCameras = [for(c in cameras) c]; + __lastDrawCameras = cameras.copy(); } public function drawMembers() { diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 8efd1a50..2f6d0a7e 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -405,11 +405,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset if (hasInterval) beatInterval = Std.parseInt(xml.x.get("interval")); var tempList = ["isPlayer", "isGF", "x", "y", "gameOverChar", "camx", "camy", "holdTime", "flipX", "icon", "color", "scale", "antialiasing", "sprite", "interval"]; - var atts = [for (i in xml.x.attributes()) i]; + var atts = xml.x.attributes(); for (i in atts) - if (!tempList.contains(i)) { + if (!tempList.contains(i)) extra[i] = xml.x.get(i); - } loadSprite(Paths.image('characters/$sprite')); @@ -451,7 +450,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset for (name in animsOrder) if (animDatas.exists(name)) anims.push(animDatas.get(name)); } else - anims = [for (anim in animDatas) anim]; + anims = Lambda.array(animDatas); for (anim in anims) { diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index f585e89f..a9b6403e 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -967,7 +967,7 @@ class PlayState extends MusicBeatState { if (songData == null) songData = SONG; - events = songData.events != null ? [for(e in songData.events) e] : []; + events = songData.events != null ? songData.events.copy() : []; // get first camera focus for(e in events) { if (e.time > 10) break; diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index e2b6ccd0..cbce2da4 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -74,7 +74,7 @@ class Strum extends FlxSprite { } public override function draw() { - lastDrawCameras = [for(c in cameras) c]; + lastDrawCameras = cameras.copy(); super.draw(); }