From ad3bf2d2d209536aa6e55491b366424a7bcdc6fa Mon Sep 17 00:00:00 2001 From: MoonDroid <81515012+moondroidcoder@users.noreply.github.com> Date: Thu, 17 Jul 2025 03:04:54 +0700 Subject: [PATCH] Update haptic values to compensate for default 1 multiplier --- source/funkin/Preferences.hx | 2 +- source/funkin/mobile/ui/FunkinBackButton.hx | 2 +- source/funkin/play/PauseSubState.hx | 6 +++--- source/funkin/play/ResultState.hx | 4 ++-- .../funkin/play/notes/NoteVibrationsHandler.hx | 4 ++-- source/funkin/save/Save.hx | 4 ++-- source/funkin/ui/MenuList.hx | 5 +++-- source/funkin/ui/freeplay/FreeplayState.hx | 16 ++++++++-------- source/funkin/util/Constants.hx | 2 +- 9 files changed, 23 insertions(+), 22 deletions(-) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index c4fb0c743..cf1eb404e 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -211,7 +211,7 @@ class Preferences static function get_hapticsIntensityMultiplier():Float { - return Save?.instance?.options?.hapticsIntensityMultiplier ?? 2.5; + return Save?.instance?.options?.hapticsIntensityMultiplier ?? 1; } static function set_hapticsIntensityMultiplier(value:Float):Float diff --git a/source/funkin/mobile/ui/FunkinBackButton.hx b/source/funkin/mobile/ui/FunkinBackButton.hx index 039130866..8b67e8384 100644 --- a/source/funkin/mobile/ui/FunkinBackButton.hx +++ b/source/funkin/mobile/ui/FunkinBackButton.hx @@ -66,7 +66,7 @@ class FunkinBackButton extends FunkinButton held = true; FlxTween.cancelTweensOf(this); - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); animation.play('hold'); alpha = 1; diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 93738a6a3..7616a4b08 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -536,7 +536,7 @@ class PauseSubState extends MusicBeatSubState FlxTween.tween(pauseCircle, {alpha: 0}, 0.6, {ease: FlxEase.quartOut}); hapticTimer.start(0.2, function(_) { - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); }); dataFadeTimer.start(0.3, function(_) { @@ -640,12 +640,12 @@ class PauseSubState extends MusicBeatSubState if (i == currentEntry) { currentMenuEntries[currentEntry].callback(this); - HapticUtil.vibrate(0, 0.05, 0.5); + HapticUtil.vibrate(0, 0.05, 1); break; } changeSelection(i - currentEntry); - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); break; } diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index 519da9d0b..9db60589c 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -773,7 +773,7 @@ class ResultState extends MusicBeatSubState // GF slams into the wall. if (atlas.sprite.anim.curFrame == 51) { - HapticUtil.vibrate(0, 0.01, Constants.MAX_VIBRATION_AMPLITUDE / 3); + HapticUtil.vibrate(0, 0.01, (Constants.MAX_VIBRATION_AMPLITUDE / 3) * 2.5); break; } @@ -797,7 +797,7 @@ class ResultState extends MusicBeatSubState // Pico shoots. if (atlas.sprite.anim.curFrame == 45) { - HapticUtil.vibrate(0, 0.01, Constants.MAX_VIBRATION_AMPLITUDE / 3); + HapticUtil.vibrate(0, 0.01, (Constants.MAX_VIBRATION_AMPLITUDE / 3) * 2.5); break; } diff --git a/source/funkin/play/notes/NoteVibrationsHandler.hx b/source/funkin/play/notes/NoteVibrationsHandler.hx index 1d4423085..c1aa94da9 100644 --- a/source/funkin/play/notes/NoteVibrationsHandler.hx +++ b/source/funkin/play/notes/NoteVibrationsHandler.hx @@ -61,7 +61,7 @@ class NoteVibrationsHandler if (stackingAmplitude > Constants.MAX_VIBRATION_AMPLITUDE) stackingAmplitude = Constants.MAX_VIBRATION_AMPLITUDE; - if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude, 1, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); + if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude * 2.5, 1, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); } /** @@ -84,7 +84,7 @@ class NoteVibrationsHandler if (stackingAmplitude > Constants.MAX_VIBRATION_AMPLITUDE) stackingAmplitude = Constants.MAX_VIBRATION_AMPLITUDE; - if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude, 1, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); + if (stackingAmplitude > 0) HapticUtil.vibrate(0, 0.01, stackingAmplitude * 2.5, 1, [HapticsMode.ALL, HapticsMode.NOTES_ONLY]); for (currentNoteStatus in noteStatuses) { diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 89d18e2ba..1f6c66f3a 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -123,7 +123,7 @@ class Save zoomCamera: true, debugDisplay: false, hapticsMode: 'All', - hapticsIntensityMultiplier: 2.5, + hapticsIntensityMultiplier: 1, autoPause: true, vsyncMode: 'Off', strumlineBackgroundOpacity: 0, @@ -1557,7 +1557,7 @@ typedef SaveDataOptions = /** * Multiplier of intensity for all the haptic feedback effects. - * @default `2.5` + * @default `1` */ var hapticsIntensityMultiplier:Float; diff --git a/source/funkin/ui/MenuList.hx b/source/funkin/ui/MenuList.hx index ef33b1be1..a8f08baa1 100644 --- a/source/funkin/ui/MenuList.hx +++ b/source/funkin/ui/MenuList.hx @@ -18,6 +18,7 @@ class MenuTypedList extends FlxTypedGroup { // Pause input variable public static var pauseInput:Bool = false; + public var selectedIndex(default, null):Int = 0; public var selectedItem(get, never):T; @@ -180,7 +181,7 @@ class MenuTypedList extends FlxTypedGroup item.scale.set(1.1, 1.1); FlxTween.tween(item.scale, {x: 1, y: 1}, 0.3, {ease: FlxEase.backOut}); - HapticUtil.vibrate(0, 0.05, 0.5); + HapticUtil.vibrate(0, 0.05, 1); accept(); } else @@ -189,7 +190,7 @@ class MenuTypedList extends FlxTypedGroup item.scale.set(0.94, 0.94); FlxTween.tween(item.scale, {x: 1, y: 1}, 0.3, {ease: FlxEase.backOut}); - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); } } else diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 20931264c..0171b0c60 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1630,7 +1630,7 @@ class FreeplayState extends MusicBeatSubState if (dj != null) FlxG.watch.addQuick('dj-anim', dj.getCurrentAnimation()); // If the allowPicoBulletsVibration is true, trigger vibration each update (for pico shooting bullets animation). - if (allowPicoBulletsVibration) HapticUtil.vibrate(0, 0.01, Constants.MAX_VIBRATION_AMPLITUDE / 3); + if (allowPicoBulletsVibration) HapticUtil.vibrate(0, 0.01, (Constants.MAX_VIBRATION_AMPLITUDE / 3) * 2.5); } var _dragOffset:Float = 0; @@ -1830,7 +1830,7 @@ class FreeplayState extends MusicBeatSubState curSelected = i; changeSelection(0); FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); } break; } @@ -1991,7 +1991,7 @@ class FreeplayState extends MusicBeatSubState // If we press onto our difficulty, we want to "grab" it rather than simply check if we are overlapping if (TouchUtil.overlapsComplex(currentDifficultySprite, funnyCam) && TouchUtil.justPressed && !draggingDifficulty) { - HapticUtil.vibrate(0, 0.01, 0.15, 0.4); + HapticUtil.vibrate(0, 0.01, 0.375, 0.4); draggingDifficulty = true; } @@ -2004,7 +2004,7 @@ class FreeplayState extends MusicBeatSubState var vibDist:Float = 5; // essentially how far the touch needs to be before it will trigger a tiny haptic feel if (Std.int((TouchUtil.touch.x - _dragOffset) / vibDist) * vibDist != _prevRoundedDragOffset) { - HapticUtil.vibrate(0, 0.01, 0.08, 0.8); + HapticUtil.vibrate(0, 0.01, 0.2, 0.8); } _prevRoundedDragOffset = Std.int((TouchUtil.touch.x - _dragOffset) / vibDist) * vibDist; @@ -2216,7 +2216,7 @@ class FreeplayState extends MusicBeatSubState } if (change != 0) { - HapticUtil.vibrate(0, 0.01, 0.2, 0.1); + HapticUtil.vibrate(0, 0.01, 0.5, 0.1); FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); } @@ -2579,7 +2579,7 @@ class FreeplayState extends MusicBeatSubState // A single vibration. default: - HapticUtil.vibrate(Constants.DEFAULT_VIBRATION_PERIOD, Constants.DEFAULT_VIBRATION_DURATION * 5, Constants.MAX_VIBRATION_AMPLITUDE / 3); + HapticUtil.vibrate(Constants.DEFAULT_VIBRATION_PERIOD, Constants.DEFAULT_VIBRATION_DURATION * 5, (Constants.MAX_VIBRATION_AMPLITUDE / 3) * 2.5); } }); } @@ -2659,7 +2659,7 @@ class FreeplayState extends MusicBeatSubState if (curSelected != prevSelected) { FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); - HapticUtil.vibrate(0, 0.01, 0.2); + HapticUtil.vibrate(0, 0.01, 0.5); dj?.resetAFKTimer(); _pressedOnSelected = false; } @@ -2738,7 +2738,7 @@ class FreeplayState extends MusicBeatSubState } // Small vibrations every selection change. - if (change != 0) HapticUtil.vibrate(0, 0.01, 0.2); + if (change != 0) HapticUtil.vibrate(0, 0.01, 0.5); } public function playCurSongPreview(?daSongCapsule:SongMenuItem):Void diff --git a/source/funkin/util/Constants.hx b/source/funkin/util/Constants.hx index 6af1d2365..c389b3abf 100644 --- a/source/funkin/util/Constants.hx +++ b/source/funkin/util/Constants.hx @@ -614,7 +614,7 @@ class Constants /** * Min vibration amplitude. */ - public inline static final MIN_VIBRATION_AMPLITUDE:Float = 0.1; + public inline static final MIN_VIBRATION_AMPLITUDE:Float = 0.25; /** * Default vibration amplitude.