From cbff9a371942fa9060705a6d26e1b15ba84d5e33 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 9 May 2025 22:51:57 -0400 Subject: [PATCH 1/5] freeplay momentum scrolling on mobile --- hmm.json | 2 +- source/funkin/ui/freeplay/FreeplayState.hx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hmm.json b/hmm.json index e5c498c40..5f2f1b956 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "flixel", "type": "git", "dir": null, - "ref": "3e3a7be79a40a3423cdf88b29b5a85a8442fcc61", + "ref": "8ab2490e41755c1ab49e8f1bb136b80329ae281f", "url": "https://github.com/FunkinCrew/flixel-mobile" }, { diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 9acee2598..d9be56dab 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1604,7 +1604,10 @@ class FreeplayState extends MusicBeatSubState private function handleTouchCapsuleClick():Void { if (diffSelRight == null) return; - if (TouchUtil.justReleased && !TouchUtil.overlaps(diffSelRight, funnyCam) && TouchUtil.touch.ticksDeltaSincePress < 200) + if (TouchUtil.justReleased + && TouchUtil.touch.velocity.length < 5 + && !TouchUtil.overlaps(diffSelRight, funnyCam) + && TouchUtil.touch.ticksDeltaSincePress < 500) { curSelected = Math.round(curSelectedFloat); @@ -1667,7 +1670,7 @@ class FreeplayState extends MusicBeatSubState if (Math.isFinite(flickVelocity)) { _flickEnded = false; - var velocityMove = flickVelocity / FlxG.updateFramerate * 0.03; + var velocityMove = flickVelocity * elapsed; _moveLength += Math.abs(velocityMove); curSelectedFloat -= velocityMove; updateSongsScroll(); From 6289dfdd0205eb9c38ddd44af967e04fc88774b1 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Mon, 12 May 2025 06:23:20 +0700 Subject: [PATCH 2/5] Adjust touch movement scaling in FreeplayState New flixel ref has DPI Scaling for flicks, and added DPI scaling to freeplay's scroll too. --- hmm.json | 2 +- source/funkin/ui/freeplay/FreeplayState.hx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index 5f2f1b956..58a3d2b48 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "flixel", "type": "git", "dir": null, - "ref": "8ab2490e41755c1ab49e8f1bb136b80329ae281f", + "ref": "e24c62c08d951351749e62ec31a95316974b91d9", "url": "https://github.com/FunkinCrew/flixel-mobile" }, { diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index d9be56dab..e4a69307b 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1651,7 +1651,11 @@ class FreeplayState extends MusicBeatSubState final delta = touch.deltaViewY; if (Math.abs(delta) >= 2) { - var moveLength = delta / FlxG.updateFramerate * 1.2; + var dpiScale = FlxG.stage.window.display.dpi / 160; + + FlxMath.clamp(dpiScale, 0.5, 2); + + var moveLength = delta / FlxG.updateFramerate / dpiScale; _moveLength += Math.abs(moveLength); curSelectedFloat -= moveLength; updateSongsScroll(); From 91e9d5d55c825e8dbb551a71183da1b6d075ed5d Mon Sep 17 00:00:00 2001 From: KarimAkra Date: Fri, 23 May 2025 12:12:35 +0300 Subject: [PATCH 3/5] Fixed the dark bar being missing (small) on the boyfriend backing card --- source/funkin/ui/freeplay/backcards/BackingCard.hx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source/funkin/ui/freeplay/backcards/BackingCard.hx b/source/funkin/ui/freeplay/backcards/BackingCard.hx index b3b41148f..b3a25ae5c 100644 --- a/source/funkin/ui/freeplay/backcards/BackingCard.hx +++ b/source/funkin/ui/freeplay/backcards/BackingCard.hx @@ -51,13 +51,8 @@ class BackingCard extends FlxSpriteGroup pinkBack.loadGraphic(bitmap); orangeBackShit = new FunkinSprite(84, 440).makeSolidColor(Std.int(pinkBack.width), 75, 0xFFFEDA00); - orangeBackShit.scale.y = FullScreenScaleMode.windowScale.y; - alsoOrangeLOL = new FunkinSprite(0, orangeBackShit.y).makeSolidColor(100, Std.int(orangeBackShit.height), 0xFFFFD400); - scale.x = FullScreenScaleMode.windowScale.x; - confirmGlow2 = new FlxSprite(confirmGlow.x, confirmGlow.y).loadGraphic(Paths.image('freeplay/confirmGlow2')); - backingTextYeah = new FlxAtlasSprite((FreeplayState.CUTOUT_WIDTH * FreeplayState.DJ_POS_MULTI) + 640, 370, Paths.animateAtlas("freeplay/backing-text-yeah"), { FrameRate: 24.0, From bbfbce6404aa7d573019468a1a6e2ba8f71edc16 Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Thu, 22 May 2025 16:38:10 +0700 Subject: [PATCH 4/5] Update lime and astc-compressor refs --- hmm.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmm.json b/hmm.json index e60728df3..9a00b8066 100644 --- a/hmm.json +++ b/hmm.json @@ -11,7 +11,7 @@ "name": "astc-compressor", "type": "git", "dir": null, - "ref": "9204077f468e85d67d63974e99d70348eebf99ba", + "ref": "8c9f56927c523df7b849352c6951f04112fe15cc", "url": "https://github.com/KarimAkra/astc-compressor" }, { @@ -172,7 +172,7 @@ "name": "lime", "type": "git", "dir": null, - "ref": "15640a344d73c86059275e8b9bf308bb546f6406", + "ref": "8d16f921a8627f4b39b2973518fac22e36a88fe6", "url": "https://github.com/FunkinCrew/lime-mobile" }, { From 7f924cd563fb2b90c41ce9a9c6fcb57c3d398b1e Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Thu, 22 May 2025 16:21:34 +0700 Subject: [PATCH 5/5] fix(mobile): Made freeplay scrolling more consistent and less buggy when dragging diagonally. --- source/funkin/ui/freeplay/FreeplayState.hx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index a26305e6c..890c6b5ad 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1625,6 +1625,7 @@ class FreeplayState extends MusicBeatSubState { final capsule = grpCapsules.members[i]; if (!TouchUtil.overlaps(capsule.theActualHitbox, funnyCam)) continue; + if (SwipeUtil.swipeAny) continue; if (capsule.selected) { @@ -1651,14 +1652,13 @@ class FreeplayState extends MusicBeatSubState function handleTouchSelectionScroll(elapsed:Float):Void { if (draggingDifficulty) return; + if (TouchUtil.pressAction(grpCapsules.members[curSelected].theActualHitbox, funnyCam)) return; if (TouchUtil.justPressed && TouchUtil.overlaps(capsuleHitbox, funnyCam)) { _pressedOnCapsule = true; } - if (TouchUtil.overlaps(grpCapsules.members[curSelected].theActualHitbox, funnyCam)) return; - for (touch in FlxG.touches.list) { if (touch.pressed && _pressedOnCapsule) @@ -1742,13 +1742,17 @@ class FreeplayState extends MusicBeatSubState dj?.resetAFKTimer(); changeDiff(1, false, true); _pressedOnSelected = false; + FlxG.touches.flickManager.destroy(); + _flickEnded = true; new FlxTimer().start(0.2, (afteranim) -> { grpCapsules.members[curSelected].doLerp = true; busy = false; - draggingDifficulty = false; generateSongList(currentFilter, true, false); }); + new FlxTimer().start(0.3, (afteranim) -> { + draggingDifficulty = false; + }); } else if (SwipeUtil.swipeRight) { @@ -1756,13 +1760,17 @@ class FreeplayState extends MusicBeatSubState dj?.resetAFKTimer(); changeDiff(-1, false, true); _pressedOnSelected = false; + FlxG.touches.flickManager.destroy(); + _flickEnded = true; new FlxTimer().start(0.2, (afteranim) -> { grpCapsules.members[curSelected].doLerp = true; busy = false; - draggingDifficulty = false; generateSongList(currentFilter, true, false); }); + new FlxTimer().start(0.3, (afteranim) -> { + draggingDifficulty = false; + }); } if (TouchUtil.touch.ticksDeltaSincePress >= 500) @@ -1774,7 +1782,6 @@ class FreeplayState extends MusicBeatSubState } else { - draggingDifficulty = false; grpCapsules.members[curSelected].doLerp = true; } @@ -2421,6 +2428,8 @@ class FreeplayState extends MusicBeatSubState { FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); HapticUtil.vibrate(0, 0.01, 0.2); + dj?.resetAFKTimer(); + _pressedOnSelected = false; } }