From d8cd580535e66cf9bffbf4f7bb63c2f1d1c10c3d Mon Sep 17 00:00:00 2001 From: sector-a <82838084+sector-a@users.noreply.github.com> Date: Wed, 16 Jul 2025 16:06:45 +0300 Subject: [PATCH] Make haptics intensity on ios and android the same --- source/funkin/Preferences.hx | 4 ++-- source/funkin/save/Save.hx | 4 ++-- source/funkin/ui/options/PreferencesMenu.hx | 2 +- source/funkin/util/HapticUtil.hx | 12 ++---------- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 5a8f736f0..c4fb0c743 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -205,13 +205,13 @@ class Preferences /** * Multiplier of intensity for all the haptic feedback effects. - * @default `1` + * @default `2.5` */ public static var hapticsIntensityMultiplier(get, set):Float; static function get_hapticsIntensityMultiplier():Float { - return Save?.instance?.options?.hapticsIntensityMultiplier ?? 1; + return Save?.instance?.options?.hapticsIntensityMultiplier ?? 2.5; } static function set_hapticsIntensityMultiplier(value:Float):Float diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 1f6c66f3a..89d18e2ba 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: 1, + hapticsIntensityMultiplier: 2.5, autoPause: true, vsyncMode: 'Off', strumlineBackgroundOpacity: 0, @@ -1557,7 +1557,7 @@ typedef SaveDataOptions = /** * Multiplier of intensity for all the haptic feedback effects. - * @default `1` + * @default `2.5` */ var hapticsIntensityMultiplier:Float; diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index cb00a58af..a0ecc5d38 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -137,7 +137,7 @@ class PreferencesMenu extends Page }); createPrefItemNumber('Haptics Intensity', 'Multiplier of intensity for all the haptic feedback effects.', function(value:Float) { Preferences.hapticsIntensityMultiplier = value; - }, null, Preferences.hapticsIntensityMultiplier, 0, 2, 0.1, 0); + }, null, Preferences.hapticsIntensityMultiplier, 0, 5, 0.1, 1); #end createPrefItemCheckbox('Flashing Lights', 'If disabled, it will dampen flashing effects. Useful for people with photosensitive epilepsy.', function(value:Bool):Void { diff --git a/source/funkin/util/HapticUtil.hx b/source/funkin/util/HapticUtil.hx index 6d03c9d46..89c25d31a 100644 --- a/source/funkin/util/HapticUtil.hx +++ b/source/funkin/util/HapticUtil.hx @@ -39,20 +39,12 @@ class HapticUtil ?targetHapticsModes:Array):Void { #if FEATURE_HAPTICS - if (!HapticUtil.hapticsAvailable || Preferences.hapticsIntensityMultiplier == 0) return; + if (!HapticUtil.hapticsAvailable) return; final hapticsModes:Array = targetHapticsModes ?? [HapticsMode.ALL]; if (!hapticsModes.contains(Preferences.hapticsMode)) return; - #if ios - var amplitudeValue = FlxMath.bound(amplitude * 2.5, 0, Constants.MAX_VIBRATION_AMPLITUDE); - #else - var amplitudeValue = amplitude; - #end - - amplitudeValue *= Preferences.hapticsIntensityMultiplier; - - if (amplitudeValue > Constants.MAX_VIBRATION_AMPLITUDE) amplitudeValue = Constants.MAX_VIBRATION_AMPLITUDE; + final amplitudeValue = FlxMath.bound(amplitude * Preferences.hapticsIntensityMultiplier, 0, Constants.MAX_VIBRATION_AMPLITUDE); if (period > 0) {