Small cleanup

This commit is contained in:
NeeEoo
2024-04-05 20:25:10 +02:00
parent 9da3a25b5c
commit 7b279bfed0
8 changed files with 14 additions and 13 deletions
@@ -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;
+3 -1
View File
@@ -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();
@@ -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;
@@ -253,7 +253,7 @@ class CharterBackdropDummy extends UISprite {
public override function draw() {
@:privateAccess
__lastDrawCameras = [for(c in cameras) c];
__lastDrawCameras = cameras.copy();
}
}
+1 -1
View File
@@ -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() {
+3 -4
View File
@@ -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)
{
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -74,7 +74,7 @@ class Strum extends FlxSprite {
}
public override function draw() {
lastDrawCameras = [for(c in cameras) c];
lastDrawCameras = cameras.copy();
super.draw();
}