diff --git a/assets/data/scripts/pixel.hx b/assets/data/scripts/pixel.hx index e829b49e..66530b0a 100644 --- a/assets/data/scripts/pixel.hx +++ b/assets/data/scripts/pixel.hx @@ -16,8 +16,8 @@ static var daPixelZoom = 6; * UI */ function onNoteCreation(event) { - if (event.note.mustPress && !pixelNotesForBF) return; - if (!event.note.mustPress && !pixelNotesForDad) return; + if (event.note.strumLine == playerStrums && !pixelNotesForBF) return; + if (event.note.strumLine == cpuStrums && !pixelNotesForDad) return; event.cancel(); @@ -105,14 +105,12 @@ function onStartCountdown() { FlxG.cameras.add(newNoteCamera, false); var pixelSwagWidth = Note.swagWidth + (daPixelZoom - (Note.swagWidth % daPixelZoom)); - // TODO: multikey support?? - for(s in 0...4) { + + for(p in players) { var i = 0; - for(str in [cpuStrums.members[s], playerStrums.members[s]]) { - // TODO: middlescroll??? - str.x = (FlxG.width * (0.25 + (0.5 * i))) + (pixelSwagWidth * (s - 2)); + for(str in p.members) { + str.x = (FlxG.width * strumOffset) + (pixelSwagWidth * (i - 2)); str.x -= str.x % daPixelZoom; - str.cameras = [newNoteCamera]; i++; } } @@ -153,10 +151,11 @@ function postUpdate(elapsed) { e.downscroll = camHUD.downscroll; } if (enableCameraHacks) { - notes.forEach(function(n) { - n.y -= n.y % daPixelZoom; - n.x -= n.x % daPixelZoom; - }); + for(p in players) + p.notes.forEach(function(n) { + n.y -= n.y % daPixelZoom; + n.x -= n.x % daPixelZoom; + }); } for(e in pixellyCameras) { diff --git a/assets/data/scripts/week6-pause.hx b/assets/data/scripts/week6-pause.hx index 2303b509..7a6b58af 100644 --- a/assets/data/scripts/week6-pause.hx +++ b/assets/data/scripts/week6-pause.hx @@ -11,7 +11,7 @@ var hand:FlxSprite; var texts:Array = []; -var isThorns = PlayState.SONG.song.toLowerCase() == "thorns"; +var isThorns = PlayState.SONG.meta.name.toLowerCase() == "thorns"; function create(event) { // cancel default pause menu!! diff --git a/assets/sounds/pixel/clickText.ogg b/assets/sounds/pixel/clickText.ogg new file mode 100644 index 00000000..78776cef Binary files /dev/null and b/assets/sounds/pixel/clickText.ogg differ diff --git a/buildnumber.txt b/buildnumber.txt index 9e7afa3a..37b9a3fb 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2313 \ No newline at end of file +2319 \ No newline at end of file diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 89b10831..adbb088a 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -30,6 +30,7 @@ using StringTools; @:allow(funkin.desktop.editors.CharacterEditor) @:allow(funkin.game.StrumLine) +@:allow(funkin.game.PlayState) class Character extends FunkinSprite implements IBeatReceiver implements IOffsetCompatible { private var __stunnedTime:Float = 0; diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 86dd34e4..7834baf2 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -590,11 +590,10 @@ class PlayState extends MusicBeatState var strOffset:Float = strumLine.strumLinePos == null ? (strumLine.opponent ? 0.25 : 0.75) : strumLine.strumLinePos; var strLine = new StrumLine(chars, strOffset, !coopMode && (strumLine.opponent != opponentMode), strumLine.opponent, coopMode ? (strumLine.opponent ? controlsP2 : controlsP1) : controls); strLine.cameras = [camHUD]; + strLine.data = strumLine; players.push(strLine); if (strumLine.visible != false) add(strLine); - - strLine.generate(strumLine); } splashHandler = new SplashHandler(); @@ -606,6 +605,9 @@ class PlayState extends MusicBeatState // CAMERA & HUD INITIALISATION #if REGION + for(str in players) + str.generate(str.data); + camFollow = new FlxObject(0, 0, 2, 2); camFollow.setPosition(camPos.x, camPos.y); add(camFollow); @@ -1304,6 +1306,9 @@ class PlayState extends MusicBeatState var notePerStrum = [for(_ in 0...4) null]; if (__justPressed.contains(true)) { + for(c in p.characters) + c.__lockAnimThisFrame = true; + __funcsToExec.push(function(note:Note) { if (__justPressed[note.strumID] && !note.isSustainNote && !note.wasGoodHit && note.canBeHit) { if (notePerStrum[note.strumID] == null) notePerStrum[note.strumID] = note; diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx index 8f0ed9ef..753d0f62 100644 --- a/source/funkin/game/Stage.hx +++ b/source/funkin/game/Stage.hx @@ -92,13 +92,22 @@ class Stage extends FlxBasic implements IBeatReceiver { state.add(spr); spr; case "boyfriend" | "bf": - addCharPos("boyfriend", node); + addCharPos("boyfriend", node, { + x: 770, + y: 100 + }); null; case "girlfriend" | "gf": - addCharPos("girlfriend", node); + addCharPos("girlfriend", node, { + x: 400, + y: 130 + }); null; case "dad" | "opponent": - addCharPos("dad", node); + addCharPos("dad", node, { + x: 100, + y: 100 + }); null; case "character": if (!node.has.name) continue; @@ -165,11 +174,10 @@ class Stage extends FlxBasic implements IBeatReceiver { state.add(char); else { var charPos = characterPoses[posName]; - if (charPos.node != null) { - doCharNodeShit(char, charPos.node); - } else if (charPos.nonXMLInfo != null) { + if (charPos.nonXMLInfo != null) char.setPosition(charPos.nonXMLInfo.x, charPos.nonXMLInfo.y); - } + if (charPos.node != null) + doCharNodeShit(char, charPos.node); state.insert(state.members.indexOf(charPos.dummy), char); } } diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 4a745720..5a5e26b0 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -27,6 +27,10 @@ class StrumLine extends FlxTypedGroup { * Controls assigned to this strumline. */ public var controls:Controls = null; + /** + * Chart JSON data assigned to this StrumLine (Codename format) + */ + public var data:ChartStrumLine = null; /** * Whenever Ghost Tapping is enabled. */ diff --git a/source/funkin/system/FunkinGame.hx b/source/funkin/system/FunkinGame.hx index 0268c4e0..5f127090 100644 --- a/source/funkin/system/FunkinGame.hx +++ b/source/funkin/system/FunkinGame.hx @@ -17,4 +17,16 @@ class FunkinGame extends FlxGame { _total = ticks = getTicks(); super.onEnterFrame(t); } + + public override function draw() { + MemoryUtil.askDisable(); + super.draw(); + MemoryUtil.askEnable(); + } + + public override function update() { + MemoryUtil.askDisable(); + super.update(); + MemoryUtil.askEnable(); + } } \ No newline at end of file diff --git a/source/funkin/system/framerate/SystemInfo.hx b/source/funkin/system/framerate/SystemInfo.hx index 172ff1d4..7379382b 100644 --- a/source/funkin/system/framerate/SystemInfo.hx +++ b/source/funkin/system/framerate/SystemInfo.hx @@ -2,6 +2,7 @@ package funkin.system.framerate; import flixel.FlxG; import flixel.math.FlxMath; +import funkin.utils.MemoryUtil; class SystemInfo extends FramerateCategory { public function new() { @@ -14,6 +15,7 @@ class SystemInfo extends FramerateCategory { _text += '\nObjs in state: ${FlxG.state.members.length}'; _text += '\nNb cameras: ${FlxG.cameras.list.length}'; _text += '\nCurrent state: ${Type.getClassName(Type.getClass(FlxG.state))}'; + _text += '\nGarbage Collector: ${MemoryUtil.disableCount > 0 ? "OFF" : "ON"} (${MemoryUtil.disableCount})'; this.text.text = _text; super.__enterFrame(t);